@rongcloud/engine 5.42.0 → 5.44.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
1
+ "use strict";
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -13,4 +13,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
15
  ***************************************************************************** */
16
- var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};function t(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var r,n=function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};function i(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function o(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}function a(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function s(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function l(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}function c(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function d(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r}exports.UploadMethod=void 0,(r=exports.UploadMethod||(exports.UploadMethod={}))[r.QINIU=1]="QINIU",r[r.ALI=2]="ALI",r[r.AWS=3]="AWS",r[r.STC=4]="STC",r[r.MINIO=5]="MINIO";var f,_,p,h,g,E,b,I,T,v,R,m,y,A,O,S,C,N,M,P,L,w,U,D,x,G,V,j,k,F,B={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",A_SEND_TYPING_STATUS_T:"A-send_typing_status-T",A_SEND_TYPING_STATUS_R:"A-send_typing_status-R",A_SEND_READ_RECEIPT_REQ_T:"A-send_read_receipt_req-T",A_SEND_READ_RECEIPT_REQ_R:"A-send_read_receipt_req-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_LOCAL_MSGS_T:"A-delete_local_msgs-T",A_DELETE_LOCAL_MSGS_R:"A-delete_local_msgs-R",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_REJOIN_CHATROOM_T:"L-rejoin_chatroom-T",L_REJOIN_CHATROOM_R:"L-rejoin_chatroom-R",A_QUIT_CHATROOM_T:"A-quit_chatroom-T",A_QUIT_CHATROOM_R:"A-quit_chatroom-R",A_GET_CHATROOM_INFO_T:"A-get_chatroom_info-T",A_GET_CHATROOM_INFO_R:"A-get_chatroom_info-R",A_SET_CHATROOM_ENTRY_T:"A-set_chatroom_entry-T",A_SET_CHATROOM_ENTRY_R:"A-set_chatroom_entry-R",A_SET_CHATROOM_ENTRIES_T:"A-set_chatroom_entries-T",A_SET_CHATROOM_ENTRIES_R:"A-set_chatroom_entries-R",A_REMOVE_CHATROOM_ENTRY_T:"A-remove_chatroom_entry-T",A_REMOVE_CHATROOM_ENTRY_R:"A-remove_chatroom_entry-R",A_REMOVE_CHATROOM_ENTRIES_T:"A-remove_chatroom_entries-T",A_REMOVE_CHATROOM_ENTRIES_R:"A-remove_chatroom_entries-R",A_GET_CHATROOM_ENTRY_T:"A-get_chatroom_entry-T",A_GET_CHATROOM_ENTRY_R:"A-get_chatroom_entry-R",A_GET_CHATROOM_ENTRIES_T:"A-get_chatroom_entries-T",A_GET_CHATROOM_ENTRIES_R:"A-get_chatroom_entries-R",A_BIND_RTC_FOR_CHATROOM_T:"A-bind_rtc_for_chatroom-T",A_BIND_RTC_FOR_CHATROOM_R:"A-bind_rtc_for_chatroom-R",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",A_GET_REMOTE_HISTORY_MSG_T:"A-get_remote_history_msg-T",A_GET_REMOTE_HISTORY_MSG_R:"A-get_remote_history_msg-R",L_CALLBACK_E:"L-callback-E",A_SEND_READ_RECEIPT_T:"A-send_read_receipt-T",A_SEND_READ_RECEIPT_R:"A-send_read_receipt-R",A_SEND_READ_RECEIPT_V2_T:"A-send_read_receipt_v2-T",A_SEND_READ_RECEIPT_V2_R:"A-send_read_receipt_v2-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_UNSUPPORT_NTF_FROM_MAIN_E:"L_UNSUPPORT_NTF_FROM_MAIN_E",A_REMOVE_PROXY_O:"A-remove_proxy-O",L_SET_PROXY_O:"L-set_proxy-O",L_TEST_PROXY_T:"L-test_proxy-T",L_TEST_PROXY_R:"L-test_proxy-R",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_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_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_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_DEL_REMOTE_MSGS_T:"A-del_remote_msgs-T",A_DEL_REMOTE_MSGS_R:"A-del_remote_msgs-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",A_LOAD_CONVERSATION_LIST_T:"A-load_conversation_list-T",A_LOAD_CONVERSATION_LIST_R:"A-load_conversation_list-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_UNREAD_COUNT_T:"A-get_unread_count-T",A_GET_UNREAD_COUNT_R:"A-get_unread_count-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",L_PULL_OFFLINE_MESSAGE_FINISHED_S:"L-pull_offline_message_finished-S",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",A_BATCH_DEL_CONVERS_T:"A-batch_del_conversation-T",A_BATCH_DEL_CONVERS_R:"A-batch_del_conversation-R",A_SYNC_REMOTE_CONVERSATIONS_T:"A-e_sync_remote_conversations-T",A_SYNC_REMOTE_CONVERSATIONS_R:"A-e_sync_remote_conversations-R",L_UPDATE_MSG_BOX_TIME_O:"L-update_msg_box_time-O",A_SEND_UG_TYPING_T:"A-send_ug_typing-T",A_SEND_UG_TYPING_R:"A-send_ug_typing-R",A_GET_UG_LIST_T:"A-get_ug_list-T",A_GET_UG_LIST_R:"A-get_ug_list-R",A_GET_UG_MSGS_BY_UID_T:"A-get_ug_msgs_by_uid-T",A_GET_UG_MSGS_BY_UID_R:"A-get_ug_msgs_by_uid-R",A_GET_UG_UNREAD_MENTIONED_DIGEST_T:"A-get_ug_unread_mentioned_digest-T",A_GET_UG_UNREAD_MENTIONED_DIGEST_R:"A-get_ug_unread_mentioned_digest-R",A_GET_HIS_MSGS_BY_OBJ_NAMES_T:"A-get_his_msgs_by_obj_names-T",A_GET_HIS_MSGS_BY_OBJ_NAMES_R:"A-get_his_msgs_by_obj_names-R",A_GET_CONTINUOUS_MSGS_T:"A-get_continuous_msgs-T",A_GET_CONTINUOUS_MSGS_R:"A-get_continuous_msgs-R",A_GET_MSGS_AROUND_TIMESTAMP_T:"A-get_msgs_around_timestamp-T",A_GET_MSGS_AROUND_TIMESTAMP_R:"A-get_msgs_around_timestamp-R",A_CLEAR_LOCAL_MSG_T:"A-clear_local_msg-T",A_CLEAR_LOCAL_MSG_R:"A-clear_local_msg-R",A_DEL_LOCAL_MSGS_BY_TIME_T:"A-del_local_msgs_by_time-T",A_DEL_LOCAL_MSGS_BY_TIME_R:"A-del_local_msgs_by_time-R",A_BATCH_CLEAR_LOCAL_MSGS_BY_TIME_T:"A-batch_clear_local_msgs_by_time-T",A_BATCH_CLEAR_LOCAL_MSGS_BY_TIME_R:"A-batch_clear_local_msgs_by_time-R",A_DEL_LOCAL_UG_MSGS_FOR_ALL_CHANNEL_T:"A-del_local_ug_msgs_for_all_channel-T",A_DEL_LOCAL_UG_MSGS_FOR_ALL_CHANNEL_R:"A-del_local_ug_msgs_for_all_channel-R",A_UPDATE_MSG_EXPANSION_T:"A-update_msg_expansion-T",A_UPDATE_MSG_EXPANSION_R:"A-update_msg_expansion-R",A_REMOVE_MSG_EXPANSION_T:"A-remove_msg_expansion-T",A_REMOVE_MSG_EXPANSION_R:"A-remove_msg_expansion-R",A_REMOVE_ALL_MSG_EXPANSION_T:"A-remove_all_msg_expansion-T",A_REMOVE_ALL_MSG_EXPANSION_R:"A-remove_all_msg_expansion-R",A_INSERT_MSG_T:"A-insert_msg-T",A_INSERT_MSG_R:"A-insert_msg-R",A_BATCH_INSERT_MSGS_T:"A-batch_insert_msgs-T",A_BATCH_INSERT_MSGS_R:"A-batch_insert_msgs-R",A_SET_MSG_CONTENT_T:"A-set_msg_content-T",A_SET_MSG_CONTENT_R:"A-set_msg_content-R",A_SET_UG_DEFAULT_NTF_LEVEL_T:"A-set_ug_default_ntf_level-T",A_SET_UG_DEFAULT_NTF_LEVEL_R:"A-set_ug_default_ntf_level-R",A_GET_UG_DEFAULT_NTF_LEVEL_T:"A-get_ug_default_ntf_level-T",A_GET_UG_DEFAULT_NTF_LEVEL_R:"A-get_ug_default_ntf_level-R",A_GET_UG_UNREAD_COUNT_FOR_ALL_CHANNELS_T:"A-get_ug_unread_count_for_all_channels-T",A_GET_UG_UNREAD_COUNT_FOR_ALL_CHANNELS_R:"A-get_ug_unread_count_for_all_channels-R",A_GET_TOTAL_UNREAD_COUNT_BY_LEVELS_T:"A-get_total_unread_count_by_levels-T",A_GET_TOTAL_UNREAD_COUNT_BY_LEVELS_R:"A-get_total_unread_count_by_levels-R",A_GET_TOTAL_UNREAD_COUNT_T:"A-get_total_unread_count-T",A_GET_TOTAL_UNREAD_COUNT_R:"A-get_total_unread_count-R",A_GET_FIRST_UNREAD_MEG_T:"A-get_first_unread_msg-T",A_GET_FIRST_UNREAD_MSG_R:"A-get_first_unread_msg-R",A_GET_FIRST_UNREAD_MSG_DIGEST_T:"A-get_first_unread_msg_digest-T",A_GET_FIRST_UNREAD_MSG_DIGEST_R:"A-get_first_unread_msg_digest-R",A_GET_UNREAD_MENTIONED_MSGS_T:"A-get_unread_mentioned_msgs-T",A_GET_UNREAD_MENTIONED_MSGS_R:"A-get_unread_mentioned_msgs-R",A_GET_UG_UNREAD_INFO_LIST_T:"A-get_ug_unread_info_list-T",A_GET_UG_UNREAD_INFO_LIST_R:"A-get_ug_unread_info_list-R",A_GET_UG_FIRST_UNREAD_MSG_DIGEST_T:"A-get_ug_first_unread_msg_digest-T",A_GET_UG_FIRST_UNREAD_MSG_DIGEST_R:"A-get_ug_first_unread_msg_digest-R",A_GET_LOCAL_MSG_COUNT_T:"A-get_local_msg_count-T",A_GET_LOCAL_MSG_COUNT_R:"A-get_local_msg_count-R",A_GET_CONVERSATIONS_T:"A-get_conversations-T",A_GET_CONVERSATIONS_R:"A-get_conversations-R",A_GET_BLOCKED_UG_LIST_T:"A-get_blocked_ug_list-T",A_GET_BLOCKED_UG_LIST_R:"A-get_blocked_ug_list-R",A_CLEAR_UNREAD_COUNT_T:"A-clear_unread_count-T",A_CLEAR_UNREAD_COUNT_R:"A-clear_unread_count-R",A_CLEAR_ALL_UNREAD_COUNT_T:"A-clear_all_unread_count-T",A_CLEAR_ALL_UNREAD_COUNT_R:"A-clear_all_unread_count-R",A_GET_TOP_CONVERSATION_LIST_T:"A-get_top_conversation_list-T",A_GET_TOP_CONVERSATION_LIST_R:"A-get_top_conversation_list-R",A_GET_UNREAD_CONVERSATION_LIST_T:"A-get_unread_conversation_list-T",A_GET_UNREAD_CONVERSATION_LIST_R:"A-get_unread_conversation_list-R",A_GET_BLOCKED_CONVERSATION_LIST_T:"A-get_blocked_conversation_list-T",A_GET_BLOCKED_CONVERSATION_LIST_R:"A-get_blocked_conversation_list-R",A_GET_ALL_CONVERSATION_LIST_T:"A-get_all_conversation_list-T",A_GET_ALL_CONVERSATION_LIST_R:"A-get_all_conversation_list-R",A_GET_CONVERSATION_LIST_BY_TIME_T:"A-get_conversation_list_by_time-T",A_GET_CONVERSATION_LIST_BY_TIME_R:"A-get_conversation_list_by_time-R",A_GET_CONVERSATION_LIST_OLD_T:"A-get_conversation_list_old-T",A_GET_CONVERSATION_LIST_OLD_R:"A-get_conversation_list_old-R",A_GET_UNREAD_MENTIONED_COUNT_T:"A-get_unread_mentioned_count-T",A_GET_UNREAD_MENTIONED_COUNT_R:"A-get_unread_mentioned_count-R",A_GET_ALL_UNREAD_MENTIONED_COUNT_T:"A-get_all_unread_mentioned_count-T",A_GET_ALL_UNREAD_MENTIONED_COUNT_R:"A-get_all_unread_mentioned_count-R",A_GET_REALTIME_CONVERSATIONS_T:"A-get_realtime_conversations-T",A_GET_REALTIME_CONVERSATIONS_R:"A-get_realtime_conversations-R",A_GET_REALTIM_CON_TOTAL_UNREAD_COUNT_T:"A-get_realtime_con_total_unread_count-T",A_GET_REALTIM_CON_TOTAL_UNREAD_COUNT_R:"A-get_realtime_con_total_unread_count-R",A_CLEAR_REALTIME_CON_UNREAD_COUNT_T:"A-clear_realtime_con_unread_count-T",A_CLEAR_REALTIME_CON_UNREAD_COUNT_R:"A-clear_realtime_con_unread_count-R",A_REMOVE_REALTIME_CONVERSATIONS_T:"A-remove_realtime_conversations-T",A_REMOVE_REALTIME_CONVERSATIONS_R:"A-remove_realtime_conversations-R",A_BATCH_GET_REALTIME_CON_UNREAD_COUNT_T:"A-batch_get_realtime_con_unread_count-T",A_BATCH_GET_REALTIME_CON_UNREAD_COUNT_R:"A-batch_get_realtime_con_unread_count-R",A_GET_SUB_USERS_STATUS_T:"A-get_sub_users_status-T",A_GET_SUB_USERS_STATUS_R:"A-get_sub_users_status-R",A_GET_SUB_USERS_ONLINE_STATUS_T:"A-get_sub_users_online_status-T",A_GET_SUB_USERS_ONLINE_STATUS_R:"A-get_sub_users_online_status-R",A_SAVE_EDITED_MSG_DRAFT_T:"A-save_edited_msg_draft-T",A_SAVE_EDITED_MSG_DRAFT_R:"A-save_edited_msg_draft-R",A_GET_EDITED_MSG_DRAFT_T:"A-get_edited_msg_draft-T",A_GET_EDITED_MSG_DRAFT_R:"A-get_edited_msg_draft-R",A_CLEAR_EDITED_MSG_DRAFT_T:"A-clear_edited_msg_draft-T",A_CLEAR_EDITED_MSG_DRAFT_R:"A-clear_edited_msg_draft-R",A_GET_UNREAD_MENTION_ME_CONVERSATION_LIST_T:"A-get_unread_mention_me_conversation_list-T",A_GET_UNREAD_MENTION_ME_CONVERSATION_LIST_R:"A-get_unread_mention_me_conversation_list-R",A_GET_USER_PROFILES_T:"A-get_user_profiles-T",A_GET_USER_PROFILES_R:"A-get_user_profiles-R",A_ADD_TO_BLACKLIST_T:"A-add_to_blacklist-T",A_ADD_TO_BLACKLIST_R:"A-add_to_blacklist-R",A_REMOVE_FROM_BLACKLIST_T:"A-remove_from_blacklist-T",A_REMOVE_FROM_BLACKLIST_R:"A-remove_from_blacklist-R",A_GET_BLACKLIST_T:"A-get_blacklist-T",A_GET_BLACKLIST_R:"A-get_blacklist-R",A_GET_BLACKLIST_STATUS_T:"A-get_blacklist_status-T",A_GET_BLACKLIST_STATUS_R:"A-get_blacklist_status-R",A_E_SET_MSG_RECEIVED_STATUS_T:"A-e_set_msg_received_status-T",A_E_SET_MSG_RECEIVED_STATUS_R:"A-e_set_msg_received_status-R",A_E_SET_MSG_SENT_STATUS_T:"A-e_set_msg_sent_status-T",A_E_SET_MSG_SENT_STATUS_R:"A-e_set_msg_sent_status-R",A_E_SET_CHECK_DUPLICATE_MSG_T:"A-e_set_check_duplicate_msg-T",A_E_SET_CHECK_DUPLICATE_MSG_R:"A-e_set_check_duplicate_msg-R",A_SET_PROXY_T:"A-set_proxy-T",A_SET_PROXY_R:"A-set_proxy-R",A_GET_PROXY_T:"A-get_proxy-T",A_GET_PROXY_R:"A-get_proxy-R",A_TEST_PROXY_T:"A-test_proxy-T",A_TEST_PROXY_R:"A-test_proxy-R",A_CLEAR_UNREAD_COUNT_BY_TIME_T:"A-clear_unread_count_by_time-T",A_CLEAR_UNREAD_COUNT_BY_TIME_R:"A-clear_unread_count_by_time-R",A_GET_MSG_READER_T:"A-get_msg_reader-T",A_GET_MSG_READER_R:"A-get_msg_reader-R",A_SEND_READ_RECEIPT_V4_T:"A-send_read_receipt_v4-T",A_SEND_READ_RECEIPT_V4_R:"A-send_read_receipt_v4-R",A_GET_READ_RECEIPT_V4_T:"A-get_read_receipt_V4-T",A_GET_READ_RECEIPT_V4_R:"A-get_read_receipt_V4-R",A_BATCH_GET_READ_RECEIPT_INFO_V4_T:"A-batch_get_read_receipt_info_V4-T",A_BATCH_GET_READ_RECEIPT_INFO_V4_R:"A-batch_get_read_receipt_info_V4-R",A_GET_ALL_ROBOTS_T:"A-get_all_robots-T",A_GET_ALL_ROBOTS_R:"A-get_all_robots-R",A_GET_ROBOT_BY_ID_T:"A-get_robot_by_id-T",A_GET_ROBOT_BY_ID_R:"A-get_robot_by_id-R",A_ADD_FRIEND_T:"A-add_friend-T",A_ADD_FRIEND_R:"A-add_friend-R",A_DELETE_FRIENDS_T:"A-delete_friends-T",A_DELETE_FRIENDS_R:"A-delete_friends-R",A_ACCEPT_FRIEND_REQUEST_T:"A-accept_friend_request-T",A_ACCEPT_FRIEND_REQUEST_R:"A-accept_friend_request-R",A_REFUSE_FRIEND_REQUEST_T:"A-refuse_friend_request-T",A_REFUSE_FRIEND_REQUEST_R:"A-refuse_friend_request-R",A_SET_FRIEND_INFO_T:"A-set_friend_info-T",A_SET_FRIEND_INFO_R:"A-set_friend_info-R",A_CHECK_FRIENDS_T:"A-check_friends-T",A_CHECK_FRIENDS_R:"A-check_friends-R",A_GET_FRIENDS_T:"A-get_friends-T",A_GET_FRIENDS_R:"A-get_friends-R",A_GET_FRIEND_APPLICATIONS_T:"A-get_friend_applications-T",A_GET_FRIEND_APPLICATIONS_R:"A-get_friend_applications-R",A_GET_FRIENDS_INFO_T:"A-get_friends_info-T",A_GET_FRIENDS_INFO_R:"A-get_friends_info-R",A_SEARCH_FRIENDS_INFO_T:"A-search_friends_info-T",A_SEARCH_FRIENDS_INFO_R:"A-search_friends_info-R",A_SET_FRIEND_ADD_PERMISSION_T:"A-set_friend_add_permission-T",A_SET_FRIEND_ADD_PERMISSION_R:"A-set_friend_add_permission-R",A_GET_FRIEND_ADD_PERMISSION_T:"A-get_friend_add_permission-T",A_GET_FRIEND_ADD_PERMISSION_R:"A-get_friend_add_permission-R",A_CREATE_GROUP_T:"A-create_group-T",A_CREATE_GROUP_R:"A-create_group-R",A_UPDATE_GROUP_INFO_T:"A-update_group_info-T",A_UPDATE_GROUP_INFO_R:"A-update_group_info-R",A_GET_GROUPS_INFO_T:"A-get_groups_info-T",A_GET_GROUPS_INFO_R:"A-get_groups_info-R",A_KICK_GROUP_MEMBERS_T:"A-kick_group_members-T",A_KICK_GROUP_MEMBERS_R:"A-kick_group_members-R",A_QUIT_GROUP_T:"A-quit_group-T",A_QUIT_GROUP_R:"A-quit_group-R",A_DISMISS_GROUP_T:"A-dismiss_group-T",A_DISMISS_GROUP_R:"A-dismiss_group-R",A_TRANSFER_GROUP_OWNER_T:"A-transfer_group_owner-T",A_TRANSFER_GROUP_OWNER_R:"A-transfer_group_owner-R",A_ADD_GROUP_MANAGERS_T:"A-add_group_managers-T",A_ADD_GROUP_MANAGERS_R:"A-add_group_managers-R",A_REMOVE_GROUP_MANAGERS_T:"A-remove_group_managers-T",A_REMOVE_GROUP_MANAGERS_R:"A-remove_group_managers-R",A_GET_GROUP_MEMBERS_T:"A-get_group_members-T",A_GET_GROUP_MEMBERS_R:"A-get_group_members-R",A_SET_GROUP_MEMBER_INFO_T:"A-set_group_member_info-T",A_SET_GROUP_MEMBER_INFO_R:"A-set_group_member_info-R",A_SEARCH_GROUP_MEMBERS_T:"A-search_group_members-T",A_SEARCH_GROUP_MEMBERS_R:"A-search_group_members-R",A_JOIN_GROUP_T:"A-join_group-T",A_JOIN_GROUP_R:"A-join_group-R",A_INVITE_USERS_TO_GROUP_T:"A-invite_users_to_group-T",A_INVITE_USERS_TO_GROUP_R:"A-invite_users_to_group-R",A_ADD_GROUP_FOLLOWS_T:"A-add_group_follows-T",A_ADD_GROUP_FOLLOWS_R:"A-add_group_follows-R",A_REMOVE_GROUP_FOLLOWS_T:"A-remove_group_follows-T",A_REMOVE_GROUP_FOLLOWS_R:"A-remove_group_follows-R",A_GET_GROUP_FOLLOWS_T:"A-get_group_follows-T",A_GET_GROUP_FOLLOWS_R:"A-get_group_follows-R",A_SET_GROUP_REMARK_T:"A-set_group_remark-T",A_SET_GROUP_REMARK_R:"A-set_group_remark-R",A_GET_GROUP_MEMBERS_BY_ROLE_T:"A-get_group_members_by_role-T",A_GET_GROUP_MEMBERS_BY_ROLE_R:"A-get_group_members_by_role-R",A_ACCEPT_GROUP_INVITE_T:"A-accept_group_invite-T",A_ACCEPT_GROUP_INVITE_R:"A-accept_group_invite-R",A_REFUSE_GROUP_INVITE_T:"A-refuse_group_invite-T",A_REFUSE_GROUP_INVITE_R:"A-refuse_group_invite-R",A_ACCEPT_GROUP_APPLICATION_T:"A-accept_group_application-T",A_ACCEPT_GROUP_APPLICATION_R:"A-accept_group_application-R",A_REFUSE_GROUP_APPLICATION_T:"A-refuse_group_application-T",A_REFUSE_GROUP_APPLICATION_R:"A-refuse_group_application-R",A_GET_GROUP_APPLICATIONS_T:"A-get_group_applications-T",A_GET_GROUP_APPLICATIONS_R:"A-get_group_applications-R",A_GET_JOINED_GROUPS_BY_ROLES_T:"A-get_joined_groups_by_roles-T",A_GET_JOINED_GROUPS_BY_ROLES_R:"A-get_joined_groups_by_roles-R",A_SEARCH_JOINED_GROUPS_T:"A-search_joined_groups-T",A_SEARCH_JOINED_GROUPS_R:"A-search_joined_groups-R",A_GET_JOINED_GROUPS_T:"A-get_joined_groups-T",A_GET_JOINED_GROUPS_R:"A-get_joined_groups-R",A_SEARCH_USER_PROFILE_BY_UNIQUE_ID_T:"A-search_user_profile_by_unique_id-T",A_SEARCH_USER_PROFILE_BY_UNIQUE_ID_R:"A-search_user_profile_by_unique_id-R",A_UPDATE_MY_USER_PROFILE_VISIBILITY_T:"A-update_my_user_profile_visibility-T",A_UPDATE_MY_USER_PROFILE_VISIBILITY_R:"A-update_my_user_profile_visibility-R",A_GET_MY_USER_PROFILE_VISIBILITY_T:"A-get_my_user_profile_visibility-T",A_GET_MY_USER_PROFILE_VISIBILITY_R:"A-get_my_user_profile_visibility-R",A_SUBSCRIBE_USER_STATUS_T:"A-subscribe_user_status-T",A_SUBSCRIBE_USER_STATUS_R:"A-subscribe_user_status-R",A_UNSUBSCRIBE_USER_STATUS_T:"A-unsubscribe_user_status-T",A_UNSUBSCRIBE_USER_STATUS_R:"A-unsubscribe_user_status-R",A_GET_SUBSCRIBE_USER_STATUS_LIST_T:"A-get_subscribe_user_status_list-T",A_GET_SUBSCRIBE_USER_STATUS_LIST_R:"A-get_subscribe_user_status_list-R",A_GET_MY_USER_PROFILE_T:"A-get_my_user_profile-T",A_GET_MY_USER_PROFILE_R:"A-get_my_user_profile-R",A_UPDATE_MY_USER_PROFILE_T:"A-update_my_user_profile-T",A_UPDATE_MY_USER_PROFILE_R:"A-update_my_user_profile-R",A_GET_CONVERSATIONS_INCLUDING_ROBOTS_T:"A-get_conversations_including_robots-T",A_GET_CONVERSATIONS_INCLUDING_ROBOTS_R:"A-get_conversations_including_robots-R",L_PULL_SG_UNREAD_COUNT_T:"L-pull_sg_unread_count-T",L_PULL_SG_UNREAD_COUNT_R:"L-pull_sg_unread_count-R",A_MARK_REMOTE_CONVERSATION_AS_READ_T:"A-mark_remote_conversation_as_read-T",A_MARK_REMOTE_CONVERSATION_AS_READ_R:"A-mark_remote_conversation_as_read-R",A_ADD_MSG_REACTION_T:"A-add_msg_reaction-T",A_ADD_MSG_REACTION_R:"A-add_msg_reaction-R",A_REMOVE_MSG_REACTION_T:"A-remove_msg_reaction-T",A_REMOVE_MSG_REACTION_R:"A-remove_msg_reaction-R",A_BATCH_GET_MSG_REACTION_SUMMARIES_T:"A-batch_get_msg_reaction_summaries-T",A_BATCH_GET_MSG_REACTION_SUMMARIES_R:"A-batch_get_msg_reaction_summaries-R",A_GET_MSG_REACTIONS_T:"A-get_msg_reactions-T",A_GET_MSG_REACTIONS_R:"A-get_msg_reactions-R",A_GET_MSG_REACTION_USERS_T:"A-get_msg_reaction_users-T",A_GET_MSG_REACTION_USERS_R:"A-get_msg_reaction_users-R",L_EXEC_CUSTOM_CONVERSATION_STORAGE_EVICTION_E:"L-exec_custom_conversation_storage_eviction-E",A_GET_MESSAGES_T:"A-get_msgs-T",A_GET_MESSAGES_R:"A-get_msgs-R"};exports.DirectionType=void 0,(f=exports.DirectionType||(exports.DirectionType={}))[f.BOTH=2]="BOTH",exports.QueryFriendsDirectionType=void 0,(_=exports.QueryFriendsDirectionType||(exports.QueryFriendsDirectionType={}))[_.BOTH=2]="BOTH",exports.FriendAddPermission=void 0,(p=exports.FriendAddPermission||(exports.FriendAddPermission={}))[p.FREE=1]="FREE",p[p.NEED_VERIFY=2]="NEED_VERIFY",p[p.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED",exports.FriendRelationType=void 0,(h=exports.FriendRelationType||(exports.FriendRelationType={}))[h.NONE=0]="NONE",h[h.IN_MY_FRIEND_LIST=1]="IN_MY_FRIEND_LIST",h[h.IN_OTHER_FRIEND_LIST=2]="IN_OTHER_FRIEND_LIST",h[h.BOTH_WAY=3]="BOTH_WAY",exports.FriendApplicationType=void 0,(g=exports.FriendApplicationType||(exports.FriendApplicationType={}))[g.SENT=1]="SENT",g[g.RECEIVED=2]="RECEIVED",exports.FriendApplicationStatus=void 0,(E=exports.FriendApplicationStatus||(exports.FriendApplicationStatus={}))[E.UNHANDLED=0]="UNHANDLED",E[E.ACCEPTED=1]="ACCEPTED",E[E.REFUSED=2]="REFUSED",E[E.EXPIRED=3]="EXPIRED",function(e){e[e.FRIEND_APPLICATION=31]="FRIEND_APPLICATION"}(b||(b={})),function(e){e[e.FRIEND_APPLY=0]="FRIEND_APPLY",e[e.FRIEND_REFUSE=1]="FRIEND_REFUSE",e[e.FRIEND_USER_INFO=2]="FRIEND_USER_INFO",e[e.FRIENDS_INPUT=3]="FRIENDS_INPUT",e[e.FRIEND_CLEAR=4]="FRIEND_CLEAR",e[e.FRIEND_INFO_CHANGE=5]="FRIEND_INFO_CHANGE",e[e.FRIEND_INFO_CHANGE_SYNC=6]="FRIEND_INFO_CHANGE_SYNC"}(I||(I={})),exports.GroupJoinPermission=void 0,(T=exports.GroupJoinPermission||(exports.GroupJoinPermission={}))[T.OWNER_VERIFY=0]="OWNER_VERIFY",T[T.FREE=1]="FREE",T[T.OWNER_OR_MANAGER_VERIFY=2]="OWNER_OR_MANAGER_VERIFY",T[T.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED",exports.GroupOperationPermission=void 0,(v=exports.GroupOperationPermission||(exports.GroupOperationPermission={}))[v.OWNER=0]="OWNER",v[v.OWNER_OR_MANAGER=1]="OWNER_OR_MANAGER",v[v.EVERYONE=2]="EVERYONE",exports.GroupMemberInfoEditPermission=void 0,(R=exports.GroupMemberInfoEditPermission||(exports.GroupMemberInfoEditPermission={}))[R.OWNER_OR_MANAGER_OR_SELF=0]="OWNER_OR_MANAGER_OR_SELF",R[R.OWNER_OR_SELF=1]="OWNER_OR_SELF",R[R.SELF=2]="SELF",exports.GroupInviteHandlePermission=void 0,(m=exports.GroupInviteHandlePermission||(exports.GroupInviteHandlePermission={}))[m.FREE=0]="FREE",m[m.INVITEE_VERIFY=1]="INVITEE_VERIFY",exports.GroupMemberRole=void 0,(y=exports.GroupMemberRole||(exports.GroupMemberRole={}))[y.UNDEF=0]="UNDEF",y[y.NORMAL=1]="NORMAL",y[y.MANAGER=2]="MANAGER",y[y.OWNER=3]="OWNER",exports.GroupOperation=void 0,(A=exports.GroupOperation||(exports.GroupOperation={}))[A.CREATE=0]="CREATE",A[A.JOIN=1]="JOIN",A[A.KICK=2]="KICK",A[A.QUIT=3]="QUIT",A[A.DISMISS=4]="DISMISS",A[A.ADD_MANAGER=5]="ADD_MANAGER",A[A.REMOVE_MANAGER=6]="REMOVE_MANAGER",A[A.TRANSFER_GROUP_OWNER=7]="TRANSFER_GROUP_OWNER",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"}(O||(O={})),exports.GroupOperationType=void 0,(S=exports.GroupOperationType||(exports.GroupOperationType={}))[S.ADD=1]="ADD",S[S.REMOVE=2]="REMOVE",exports.GroupApplicationStatus=void 0,(C=exports.GroupApplicationStatus||(exports.GroupApplicationStatus={}))[C.MANAGER_UNHANDLED=0]="MANAGER_UNHANDLED",C[C.MANAGER_REFUSED=1]="MANAGER_REFUSED",C[C.INVITEE_UNHANDLED=2]="INVITEE_UNHANDLED",C[C.INVITEE_REFUSED=3]="INVITEE_REFUSED",C[C.JOINED=4]="JOINED",C[C.EXPIRED=5]="EXPIRED",exports.GroupOperationStatus=void 0,(N=exports.GroupOperationStatus||(exports.GroupOperationStatus={}))[N.REFUSE=0]="REFUSE",N[N.ACCEPT=1]="ACCEPT",exports.GroupOperationRole=void 0,(M=exports.GroupOperationRole||(exports.GroupOperationRole={}))[M.APPLICANT=0]="APPLICANT",M[M.MANAGER=1]="MANAGER",function(e){e[e.GROUP_OPERATION=11]="GROUP_OPERATION",e[e.GROUP_PROFILE_CHANGE=12]="GROUP_PROFILE_CHANGE",e[e.GROUP_APPLICATION_INVITATION=13]="GROUP_APPLICATION_INVITATION",e[e.GROUP_FOLLOW_USER_CHANGE=14]="GROUP_FOLLOW_USER_CHANGE"}(P||(P={})),exports.GroupApplicationType=void 0,(L=exports.GroupApplicationType||(exports.GroupApplicationType={}))[L.APPLICATION=0]="APPLICATION",L[L.INVITATION=1]="INVITATION",exports.GroupApplicationDirection=void 0,(w=exports.GroupApplicationDirection||(exports.GroupApplicationDirection={}))[w.APPLICATION_SENT=0]="APPLICATION_SENT",w[w.INVITATION_SENT=1]="INVITATION_SENT",w[w.INVITATION_RECEIVED=2]="INVITATION_RECEIVED",w[w.APPLICATION_RECEIVED=3]="APPLICATION_RECEIVED",exports.ChatroomEntryType=void 0,(U=exports.ChatroomEntryType||(exports.ChatroomEntryType={}))[U.UPDATE=1]="UPDATE",U[U.DELETE=2]="DELETE",exports.ChrmSyncStatus=void 0,(D=exports.ChrmSyncStatus||(exports.ChrmSyncStatus={}))[D.QUIT=0]="QUIT",D[D.JOIN=1]="JOIN",exports.ChatroomSyncStatusReason=void 0,(x=exports.ChatroomSyncStatusReason||(exports.ChatroomSyncStatusReason={}))[x.LeaveOnMyOwn=1]="LeaveOnMyOwn",x[x.OtherDeviceLogin=2]="OtherDeviceLogin",exports.ChatroomUserChangeType=void 0,(G=exports.ChatroomUserChangeType||(exports.ChatroomUserChangeType={}))[G.QUIT=0]="QUIT",G[G.JOIN=1]="JOIN",exports.ChrmMemBanType=void 0,(V=exports.ChrmMemBanType||(exports.ChrmMemBanType={}))[V.UnmuteUsers=0]="UnmuteUsers",V[V.MuteUsers=1]="MuteUsers",V[V.UnmuteAll=2]="UnmuteAll",V[V.MuteAll=3]="MuteAll",V[V.RemoveWhitelist=4]="RemoveWhitelist",V[V.AddWhitelist=5]="AddWhitelist",V[V.UnmuteGloble=6]="UnmuteGloble",V[V.MuteGloble=7]="MuteGloble",exports.ChrmMemOperateType=void 0,(j=exports.ChrmMemOperateType||(exports.ChrmMemOperateType={}))[j.Deblock=0]="Deblock",j[j.Blocked=1]="Blocked",exports.ErrorCode=void 0,(k=exports.ErrorCode||(exports.ErrorCode={}))[k.SUCCESS=0]="SUCCESS",k[k.ACTIVE_DISCONNECT=2]="ACTIVE_DISCONNECT",k[k.REJECTED_BY_BLACKLIST=405]="REJECTED_BY_BLACKLIST",k[k.NOT_IN_WHITELIST=407]="NOT_IN_WHITELIST",k[k.FORBIDDEN_IN_PRIVATE=20106]="FORBIDDEN_IN_PRIVATE",k[k.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE=20109]="SYS_CONVERSATION_NOT_SUPPORT_MESSAGE",k[k.DANGEROUS_CONTENT=20112]="DANGEROUS_CONTENT",k[k.CONTENT_REVIEW_REJECTED=20113]="CONTENT_REVIEW_REJECTED",k[k.MESSAGE_OVER_MODIFY_TIME_FAIL=20114]="MESSAGE_OVER_MODIFY_TIME_FAIL",k[k.MESSAGE_SIZE_EXCEEDED=20115]="MESSAGE_SIZE_EXCEEDED",k[k.MESSAGE_UNSUPPORTED_MODIFY=20116]="MESSAGE_UNSUPPORTED_MODIFY",k[k.CLOUD_DATA_CENTER_INVALID=20512]="CLOUD_DATA_CENTER_INVALID",k[k.SEND_FREQUENCY_TOO_FAST=20604]="SEND_FREQUENCY_TOO_FAST",k[k.OPERATION_BLOCKED=20605]="OPERATION_BLOCKED",k[k.OPERATION_NOT_SUPPORT=20606]="OPERATION_NOT_SUPPORT",k[k.REQUEST_OVER_FREQUENCY=20607]="REQUEST_OVER_FREQUENCY",k[k.NOT_IN_DISCUSSION=21406]="NOT_IN_DISCUSSION",k[k.SENSITIVE_SHIELD=21501]="SENSITIVE_SHIELD",k[k.SENSITIVE_REPLACE=21502]="SENSITIVE_REPLACE",k[k.MESSAGE_EXPAND_NOT_EXIST=22201]="MESSAGE_EXPAND_NOT_EXIST",k[k.MESSAGE_EXPAND_NOT_SUPPORT=22202]="MESSAGE_EXPAND_NOT_SUPPORT",k[k.MESSAGE_EXPAND_FORMAT_ERROR=22203]="MESSAGE_EXPAND_FORMAT_ERROR",k[k.MESSAGE_EXPAND_NOT_AUTHORIZED=22204]="MESSAGE_EXPAND_NOT_AUTHORIZED",k[k.NOT_IN_GROUP=22406]="NOT_IN_GROUP",k[k.FORBIDDEN_IN_GROUP=22408]="FORBIDDEN_IN_GROUP",k[k.NOT_IN_CHATROOM=23406]="NOT_IN_CHATROOM",k[k.GET_USERINFO_ERROR=23407]="GET_USERINFO_ERROR",k[k.FORBIDDEN_IN_CHATROOM=23408]="FORBIDDEN_IN_CHATROOM",k[k.RC_CHATROOM_USER_KICKED=23409]="RC_CHATROOM_USER_KICKED",k[k.RC_CHATROOM_NOT_EXIST=23410]="RC_CHATROOM_NOT_EXIST",k[k.RC_CHATROOM_IS_FULL=23411]="RC_CHATROOM_IS_FULL",k[k.RC_CHATROOM_PATAMETER_INVALID=23412]="RC_CHATROOM_PATAMETER_INVALID",k[k.CHATROOM_GET_HISTORYMSG_ERROR=23413]="CHATROOM_GET_HISTORYMSG_ERROR",k[k.CHATROOM_NOT_OPEN_HISTORYMSG_STORE=23414]="CHATROOM_NOT_OPEN_HISTORYMSG_STORE",k[k.CHATROOM_KV_EXCEED=23423]="CHATROOM_KV_EXCEED",k[k.CHATROOM_KV_OVERWRITE_INVALID=23424]="CHATROOM_KV_OVERWRITE_INVALID",k[k.CHATROOM_SET_PROPERTY_OVER_FREQUENCY=23425]="CHATROOM_SET_PROPERTY_OVER_FREQUENCY",k[k.CHATROOM_KV_STORE_NOT_OPEN=23426]="CHATROOM_KV_STORE_NOT_OPEN",k[k.CHATROOM_KEY_NOT_EXIST=23427]="CHATROOM_KEY_NOT_EXIST",k[k.CHATROOM_KV_STORE_NOT_ALL_SUCCESS=23428]="CHATROOM_KV_STORE_NOT_ALL_SUCCESS",k[k.CHATROOM_KV_STORE_OUT_LIMIT=23429]="CHATROOM_KV_STORE_OUT_LIMIT",k[k.CHATROOM_KV_SET_ERROR=23431]="CHATROOM_KV_SET_ERROR",k[k.HAVNODEVICEID=24001]="HAVNODEVICEID",k[k.DEVICEIDISHAVE=24002]="DEVICEIDISHAVE",k[k.FEILD=24009]="FEILD",k[k.INTERNALERRROR=24015]="INTERNALERRROR",k[k.RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET=24360]="RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET",k[k.RC_USER_PROFILE_KEY_NOT_EXIST=24361]="RC_USER_PROFILE_KEY_NOT_EXIST",k[k.RC_USER_PROFILE_EXT_KEY_NOT_EXIST=24362]="RC_USER_PROFILE_EXT_KEY_NOT_EXIST",k[k.RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT=24363]="RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT",k[k.RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT=24364]="RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT",k[k.RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT=24365]="RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT",k[k.RC_USER_PROFILE_USER_NOT_EXIST=24366]="RC_USER_PROFILE_USER_NOT_EXIST",k[k.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS=24367]="RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS",k[k.RC_USER_PROFILE_VALUE_EXCEED_RANGE=24368]="RC_USER_PROFILE_VALUE_EXCEED_RANGE",k[k.RC_USER_PROFILE_SERVICE_UNAVAILABLE=24369]="RC_USER_PROFILE_SERVICE_UNAVAILABLE",k[k.ULTRA_GROUP_SERVICE_UNAVAILABLE=24401]="ULTRA_GROUP_SERVICE_UNAVAILABLE",k[k.ULTRA_GROUP_SERVICE_ERROR=24402]="ULTRA_GROUP_SERVICE_ERROR",k[k.ULTRA_GROUP_PARAMETER_ERROR=24403]="ULTRA_GROUP_PARAMETER_ERROR",k[k.ULTRA_GROUP_UNKNOWN_ERROR=24404]="ULTRA_GROUP_UNKNOWN_ERROR",k[k.NOT_IN_ULTRA_GROUP=24406]="NOT_IN_ULTRA_GROUP",k[k.FORBIDDEN_IN_ULTRA_GROUP=24408]="FORBIDDEN_IN_ULTRA_GROUP",k[k.ULTRA_GROUP_NOT_EXIST=24410]="ULTRA_GROUP_NOT_EXIST",k[k.ULTRA_GROUP_MEMBERS_OVERSIZE=24411]="ULTRA_GROUP_MEMBERS_OVERSIZE",k[k.ULTRA_GROUP_JOINED_OVERSIZE=24412]="ULTRA_GROUP_JOINED_OVERSIZE",k[k.ULTRA_GROUP_CHANNELS_OVERSIZE=24413]="ULTRA_GROUP_CHANNELS_OVERSIZE",k[k.ULTRA_GROUP_CHANNEL_ID_NOT_EXIST=24414]="ULTRA_GROUP_CHANNEL_ID_NOT_EXIST",k[k.ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY=24415]="ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY",k[k.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL=24416]="ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL",k[k.RECALL_MESSAGE=25101]="RECALL_MESSAGE",k[k.MESSAGE_STORAGE_SERVICE_UNAVAILABLE=25102]="MESSAGE_STORAGE_SERVICE_UNAVAILABLE",k[k.RC_SERVER_UNKOWN_ERROR=25104]="RC_SERVER_UNKOWN_ERROR",k[k.RECALL_MESSAGE_USER_INVALID=25107]="RECALL_MESSAGE_USER_INVALID",k[k.RC_ENTRUST_SERVER_ERROR=25402]="RC_ENTRUST_SERVER_ERROR",k[k.RC_ENTRUST_SERVER_PARAMETER_ERROR=25403]="RC_ENTRUST_SERVER_PARAMETER_ERROR",k[k.RC_GROUP_ILLEGAL_ERROR=25404]="RC_GROUP_ILLEGAL_ERROR",k[k.RC_GROUP_AUTHORITY_ERROR=25405]="RC_GROUP_AUTHORITY_ERROR",k[k.RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT=25406]="RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT",k[k.RC_GROUP_PARAMETER_FORMAT_ERROR=25407]="RC_GROUP_PARAMETER_FORMAT_ERROR",k[k.RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS=25408]="RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS",k[k.RC_GROUP_ID_ALREADY_EXIST=25409]="RC_GROUP_ID_ALREADY_EXIST",k[k.RC_GROUP_ID_NOT_EXIST=25410]="RC_GROUP_ID_NOT_EXIST",k[k.RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT=25411]="RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT",k[k.RC_GROUP_MEMBERS_ALREADY_IN_GROUP=25412]="RC_GROUP_MEMBERS_ALREADY_IN_GROUP",k[k.RC_GROUP_NOT_ALLOW_SDK_OPERATION=25413]="RC_GROUP_NOT_ALLOW_SDK_OPERATION",k[k.RC_GROUP_NOT_ALLOW_JOIN=25414]="RC_GROUP_NOT_ALLOW_JOIN",k[k.RC_GROUP_EXT_KEY_NOT_EXIST=25415]="RC_GROUP_EXT_KEY_NOT_EXIST",k[k.RC_GROUP_REQUEST_OVERFREQUENCY=25416]="RC_GROUP_REQUEST_OVERFREQUENCY",k[k.RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK=25417]="RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK",k[k.RC_GROUP_USER_NOT_IN_GROUP=25418]="RC_GROUP_USER_NOT_IN_GROUP",k[k.RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT=25419]="RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT",k[k.RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP=25420]="RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP",k[k.RC_GROUP_APPLICATION_NOT_EXIST=25421]="RC_GROUP_APPLICATION_NOT_EXIST",k[k.RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT=25422]="RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT",k[k.RC_GROUP_NAME_INVALID=25423]="RC_GROUP_NAME_INVALID",k[k.RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT=25424]="RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT",k[k.RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER=25425]="RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER",k[k.RC_GROUP_NO_INVITE_PERMISSION=25426]="RC_GROUP_NO_INVITE_PERMISSION",k[k.RC_GROUP_NEED_INVITEE_ACCEPT=25427]="RC_GROUP_NEED_INVITEE_ACCEPT",k[k.RC_GROUP_APPLICATION_ALREADY_HANDLE=25428]="RC_GROUP_APPLICATION_ALREADY_HANDLE",k[k.RC_GROUP_OLD_GROUP_NOT_ENTRUST=25429]="RC_GROUP_OLD_GROUP_NOT_ENTRUST",k[k.RC_GROUP_ID_INVALID=25430]="RC_GROUP_ID_INVALID",k[k.RC_PAGE_TOKEN_PARSING_FAILED=25432]="RC_PAGE_TOKEN_PARSING_FAILED",k[k.RC_FRIEND_ALREADY_FRIEND=25460]="RC_FRIEND_ALREADY_FRIEND",k[k.RC_FRIEND_NEED_ACCEPT=25461]="RC_FRIEND_NEED_ACCEPT",k[k.RC_FRIEND_IN_OTHER_BLACK_LIST=25462]="RC_FRIEND_IN_OTHER_BLACK_LIST",k[k.RC_FRIEND_NOT_IN_OTHER_WHITE_LIST=25463]="RC_FRIEND_NOT_IN_OTHER_WHITE_LIST",k[k.RC_FRIEND_IN_MY_BLACK_LIST=25464]="RC_FRIEND_IN_MY_BLACK_LIST",k[k.RC_FRIEND_NOT_IN_MY_WHITE_LIST=25465]="RC_FRIEND_NOT_IN_MY_WHITE_LIST",k[k.RC_FRIEND_APPLICATION_NOT_EXIST=25466]="RC_FRIEND_APPLICATION_NOT_EXIST",k[k.RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT=25467]="RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT",k[k.RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT=25468]="RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT",k[k.RC_FRIEND_NOT_FRIEND=25469]="RC_FRIEND_NOT_FRIEND",k[k.RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT=25470]="RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT",k[k.RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND=25471]="RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND",k[k.RC_FRIEND_NOT_EXIST=25472]="RC_FRIEND_NOT_EXIST",k[k.RC_FRIEND_NOT_ALLOW_ADD_SELF=25473]="RC_FRIEND_NOT_ALLOW_ADD_SELF",k[k.RC_FRIEND_NOT_SUPPORT_ROBOT=25474]="RC_FRIEND_NOT_SUPPORT_ROBOT",k[k.SERVICE_INFORMATION_AUDIT_FAILED=25480]="SERVICE_INFORMATION_AUDIT_FAILED",k[k.PUSH_PARAMETER_INVALID=26001]="PUSH_PARAMETER_INVALID",k[k.USER_SETTING_SYNCED_ERROR=26002]="USER_SETTING_SYNCED_ERROR",k[k.CONVERSATION_TAG_OVERSIZE=26004]="CONVERSATION_TAG_OVERSIZE",k[k.RC_READ_RECEIPT_V4_INVALID=26005]="RC_READ_RECEIPT_V4_INVALID",k[k.RC_SERVER_DRIVE_UNREAD_COUNT_INVALID=26006]="RC_SERVER_DRIVE_UNREAD_COUNT_INVALID",k[k.RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED=26007]="RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED",k[k.RC_SERVER_PARAMETER_MESSAGEUID_INVALID=26009]="RC_SERVER_PARAMETER_MESSAGEUID_INVALID",k[k.RC_SERVER_PARAMETER_INVALID=26010]="RC_SERVER_PARAMETER_INVALID",k[k.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE=26020]="RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE",k[k.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT=26021]="RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT",k[k.RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT=26022]="RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT",k[k.RC_FILE_SIZE_EXCEED_LIMIT=26106]="RC_FILE_SIZE_EXCEED_LIMIT",k[k.INVALID_PARAMETER_SIZE_NOT_FOUND=26107]="INVALID_PARAMETER_SIZE_NOT_FOUND",k[k.SERVICE_RRSV5_UNAVAILABLE=26314]="SERVICE_RRSV5_UNAVAILABLE",k[k.SERVICE_RRSV5_READ_RECEIPT_NOT_SUPPORT=26315]="SERVICE_RRSV5_READ_RECEIPT_NOT_SUPPORT",k[k.SERVICE_RRSV5_PARAM_LENGTH_EXCEED=26316]="SERVICE_RRSV5_PARAM_LENGTH_EXCEED",k[k.SERVICE_RRSV5_CONVERSATION_NOT_SUPPORT=26317]="SERVICE_RRSV5_CONVERSATION_NOT_SUPPORT",k[k.SERVICE_RRSV5_QUERY_NOT_SUPPORT=26318]="SERVICE_RRSV5_QUERY_NOT_SUPPORT",k[k.SERVICE_RRSV5_MESSAGE_SENDER_MISMATCH=26320]="SERVICE_RRSV5_MESSAGE_SENDER_MISMATCH",k[k.SERVICE_RRSV5_MESSAGE_RECEIPT_NEEDLESS=26321]="SERVICE_RRSV5_MESSAGE_RECEIPT_NEEDLESS",k[k.SERVICE_RRSV5_MESSAGE_NOT_EXIST=26322]="SERVICE_RRSV5_MESSAGE_NOT_EXIST",k[k.MSG_REACTION_LIMIT_REACHED=26323]="MSG_REACTION_LIMIT_REACHED",k[k.MSG_REACTION_USER_LIMIT_REACHED=26324]="MSG_REACTION_USER_LIMIT_REACHED",k[k.SERVICE_STT_UNAVAILABLE=28300]="SERVICE_STT_UNAVAILABLE",k[k.SERVICE_STT_CONVERTED_FAILED=28304]="SERVICE_STT_CONVERTED_FAILED",k[k.SERVICE_STT_INTERNAL_ERROR=28305]="SERVICE_STT_INTERNAL_ERROR",k[k.SERVICE_STT_PARAM_MISS=28306]="SERVICE_STT_PARAM_MISS",k[k.SERVICE_STT_USAGE_EXCEED=28307]="SERVICE_STT_USAGE_EXCEED",k[k.TRANS_SERVICE_NOT_OPEN=28400]="TRANS_SERVICE_NOT_OPEN",k[k.TRANS_FAILED=28401]="TRANS_FAILED",k[k.TRANS_INTERNAL_ERROR=28402]="TRANS_INTERNAL_ERROR",k[k.TRANS_PARAM_MISSING=28403]="TRANS_PARAM_MISSING",k[k.TRANS_PARAM_ERROR=28404]="TRANS_PARAM_ERROR",k[k.TRANS_QUOTA_LIMIT=28405]="TRANS_QUOTA_LIMIT",k[k.TRANS_TEXT_LENGTH_EXCEEDS_LIMIT=28406]="TRANS_TEXT_LENGTH_EXCEEDS_LIMIT",k[k.TRANS_LANGUAGE_NOT_SUPPORT=28407]="TRANS_LANGUAGE_NOT_SUPPORT",k[k.RC_NET_CHANNEL_INVALID=30001]="RC_NET_CHANNEL_INVALID",k[k.RC_NET_UNAVAILABLE=30002]="RC_NET_UNAVAILABLE",k[k.RC_MSG_RESP_TIMEOUT=30003]="RC_MSG_RESP_TIMEOUT",k[k.RC_HTTP_SEND_FAIL=30004]="RC_HTTP_SEND_FAIL",k[k.RC_HTTP_REQ_FAIL=30005]="RC_HTTP_REQ_FAIL",k[k.RC_HTTP_RECV_FAIL=30006]="RC_HTTP_RECV_FAIL",k[k.RC_NAVI_REQ_FAILED=30007]="RC_NAVI_REQ_FAILED",k[k.RC_NODE_NOT_FOUND=30008]="RC_NODE_NOT_FOUND",k[k.RC_DOMAIN_NOT_RESOLVE=30009]="RC_DOMAIN_NOT_RESOLVE",k[k.RC_SOCKET_NOT_CREATED=30010]="RC_SOCKET_NOT_CREATED",k[k.RC_SOCKET_DISCONNECTED=30011]="RC_SOCKET_DISCONNECTED",k[k.RC_PING_EXCEED_LIMIT=30012]="RC_PING_EXCEED_LIMIT",k[k.PONG_RECEIVED_ERROR=30013]="PONG_RECEIVED_ERROR",k[k.RC_MSG_SEND_FAIL=30014]="RC_MSG_SEND_FAIL",k[k.CONNECT_OVER_FREQUENCY=30015]="CONNECT_OVER_FREQUENCY",k[k.RC_MSG_CONTENT_EXCEED_LIMIT=30016]="RC_MSG_CONTENT_EXCEED_LIMIT",k[k.MESSAGE_NOT_SUPPORT_SENDING=30017]="MESSAGE_NOT_SUPPORT_SENDING",k[k.RC_NETWORK_DOWN=30019]="RC_NETWORK_DOWN",k[k.RC_TCP_DISCONNECTED_NO_RMTP=30021]="RC_TCP_DISCONNECTED_NO_RMTP",k[k.RC_CONN_ACK_TIMEOUT=31e3]="RC_CONN_ACK_TIMEOUT",k[k.RC_CONN_PROTO_VERSION_ERROR=31001]="RC_CONN_PROTO_VERSION_ERROR",k[k.RC_CONN_IDENTIFIER_REJECTED=31002]="RC_CONN_IDENTIFIER_REJECTED",k[k.RC_CONN_SERVER_UNAVAILABLE=31003]="RC_CONN_SERVER_UNAVAILABLE",k[k.RC_CONN_TOKEN_INCORRECT=31004]="RC_CONN_TOKEN_INCORRECT",k[k.RC_CONN_NOT_AUTHRORIZED=31005]="RC_CONN_NOT_AUTHRORIZED",k[k.RC_CONN_REDIRECTED=31006]="RC_CONN_REDIRECTED",k[k.RC_CONN_PACKAGE_NAME_INVALID=31007]="RC_CONN_PACKAGE_NAME_INVALID",k[k.RC_CONN_APP_BLOCKED_OR_DELETED=31008]="RC_CONN_APP_BLOCKED_OR_DELETED",k[k.RC_CONN_USER_BLOCKED=31009]="RC_CONN_USER_BLOCKED",k[k.RC_DISCONN_KICK=31010]="RC_DISCONN_KICK",k[k.RC_DISCONN_EXCEPTION=31011]="RC_DISCONN_EXCEPTION",k[k.CONNECTION_ENCRYPT_AUTHORIZED_ERROR=31012]="CONNECTION_ENCRYPT_AUTHORIZED_ERROR",k[k.RC_CONN_TOKEN_EXPIRED=31020]="RC_CONN_TOKEN_EXPIRED",k[k.RC_CONN_DEVICE_ERROR=31021]="RC_CONN_DEVICE_ERROR",k[k.RC_CONN_HOSTNAME_ERROR=31022]="RC_CONN_HOSTNAME_ERROR",k[k.RC_DISCONN_SAME_CLIENT_ON_LINE=31023]="RC_DISCONN_SAME_CLIENT_ON_LINE",k[k.RC_LISCENSE_COUNT_OUT_OF_LIMIT=31024]="RC_LISCENSE_COUNT_OUT_OF_LIMIT",k[k.RC_CONN_WRONG_CLUSTER=31025]="RC_CONN_WRONG_CLUSTER",k[k.RC_APP_AUTH_NOT_PASS=31026]="RC_APP_AUTH_NOT_PASS",k[k.RC_OTP_USED=31027]="RC_OTP_USED",k[k.RC_PLATFORM_ERROR=31028]="RC_PLATFORM_ERROR",k[k.RC_ACCOUNT_CANCELLATION=31029]="RC_ACCOUNT_CANCELLATION",k[k.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",k[k.RC_QUERY_ACK_NO_DATA=32001]="RC_QUERY_ACK_NO_DATA",k[k.RC_MSG_DATA_INCOMPLETE=32002]="RC_MSG_DATA_INCOMPLETE",k[k.RC_UDP_DISCONNECTED=32011]="RC_UDP_DISCONNECTED",k[k.RC_TCP_RESET=32054]="RC_TCP_RESET",k[k.CONNECTION_REFUSED=32061]="CONNECTION_REFUSED",k[k.PROTOCOL_DECODE_ERROR=32546]="PROTOCOL_DECODE_ERROR",k[k.PROTOCOL_MESSAGE_SAVED_ERROR=33e3]="PROTOCOL_MESSAGE_SAVED_ERROR",k[k.BIZ_ERROR_CLIENT_NOT_INIT=33001]="BIZ_ERROR_CLIENT_NOT_INIT",k[k.BIZ_ERROR_DATABASE_ERROR=33002]="BIZ_ERROR_DATABASE_ERROR",k[k.BIZ_ERROR_INVALID_PARAMETER=33003]="BIZ_ERROR_INVALID_PARAMETER",k[k.BIZ_ERROR_NO_CHANNEL=33004]="BIZ_ERROR_NO_CHANNEL",k[k.BIZ_ERROR_RECONNECT_SUCCESS=33005]="BIZ_ERROR_RECONNECT_SUCCESS",k[k.BIZ_ERROR_CONNECTING=33006]="BIZ_ERROR_CONNECTING",k[k.MSG_ROAMING_SERVICE_UNAVAILABLE=33007]="MSG_ROAMING_SERVICE_UNAVAILABLE",k[k.MSG_INSERT_ERROR=33008]="MSG_INSERT_ERROR",k[k.MSG_DEL_ERROR=33009]="MSG_DEL_ERROR",k[k.TAG_NOT_EXIST=33100]="TAG_NOT_EXIST",k[k.TAG_EXISTS=33101]="TAG_EXISTS",k[k.NO_TAG_IN_CONVER=33102]="NO_TAG_IN_CONVER",k[k.METHOD_BUSY=33103]="METHOD_BUSY",k[k.SDK_PULL_CONVERSATION=33302]="SDK_PULL_CONVERSATION",k[k.MODIFIED_MESSAGE_IS_NOT_SENT=33401]="MODIFIED_MESSAGE_IS_NOT_SENT",k[k.MODIFIED_MESSAGE_TIMEOUT=33402]="MODIFIED_MESSAGE_TIMEOUT",k[k.QUOTE_MSG_NOT_FOUND=33403]="QUOTE_MSG_NOT_FOUND",k[k.INVALID_PARAMETER_QUOTE_INFO=33404]="INVALID_PARAMETER_QUOTE_INFO",k[k.REACTION_ID_INVALID=33405]="REACTION_ID_INVALID",k[k.RC_CONNECTION_EXIST=34001]="RC_CONNECTION_EXIST",k[k.PACKAGE_ENVIRONMENT_ERROR=34005]="PACKAGE_ENVIRONMENT_ERROR",k[k.CONNECTION_TIMEOUT=34006]="CONNECTION_TIMEOUT",k[k.MESSAGE_KV_NOT_SUPPORT=34008]="MESSAGE_KV_NOT_SUPPORT",k[k.MESSAGE_EXPANDED_ERROR=34009]="MESSAGE_EXPANDED_ERROR",k[k.EXPANSION_LIMIT_EXCEET=34010]="EXPANSION_LIMIT_EXCEET",k[k.UPLOAD_FAIL=34011]="UPLOAD_FAIL",k[k.CONVER_OUT_LIMIT_ERROR=34013]="CONVER_OUT_LIMIT_ERROR",k[k.READ_RECEIPT_ERROR=34014]="READ_RECEIPT_ERROR",k[k.PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE=34016]="PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE",k[k.MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE=34017]="MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE",k[k.MEDIA_EXCEPTION=34018]="MEDIA_EXCEPTION",k[k.MESSAGE_NOT_REGISTERED=34021]="MESSAGE_NOT_REGISTERED",k[k.METHOD_NOT_SUPPORT=34022]="METHOD_NOT_SUPPORT",k[k.ULTRA_GROUP_CHANNEL_NOT_EXIST=34024]="ULTRA_GROUP_CHANNEL_NOT_EXIST",k[k.INCONSISTENT_CONVERSATION_TYPE=34025]="INCONSISTENT_CONVERSATION_TYPE",k[k.INVALID_PARAMETER_LAUGUAGE=34200]="INVALID_PARAMETER_LAUGUAGE",k[k.CONVERSATION_TYPE_NOT_SUPPORT=34201]="CONVERSATION_TYPE_NOT_SUPPORT",k[k.INVALID_PARAMETER_TIMESTAMP=34202]="INVALID_PARAMETER_TIMESTAMP",k[k.INVALID_PARAMETER_MESSAGE_UID=34203]="INVALID_PARAMETER_MESSAGE_UID",k[k.INVALID_PARAMETER_MESSAGE_ID=34204]="INVALID_PARAMETER_MESSAGE_ID",k[k.INVALID_PARAMETER_MESSAGE_CONTENT=34205]="INVALID_PARAMETER_MESSAGE_CONTENT",k[k.MSG_LIMIT_ERROR=34206]="MSG_LIMIT_ERROR",k[k.INVALID_PARAMETER_MEDIA_TYPE=34207]="INVALID_PARAMETER_MEDIA_TYPE",k[k.INVALID_PARAMETER_REQUEST_URL=34208]="INVALID_PARAMETER_REQUEST_URL",k[k.INVALID_PARAMETER_CONVERSATION_TYPE=34209]="INVALID_PARAMETER_CONVERSATION_TYPE",k[k.INVALID_PARAMETER_TARGET_ID=34210]="INVALID_PARAMETER_TARGET_ID",k[k.INVALID_PARAMETER_CHANNEL_ID=34211]="INVALID_PARAMETER_CHANNEL_ID",k[k.INVALID_PARAMETER_TAG_ID=34212]="INVALID_PARAMETER_TAG_ID",k[k.INVALID_PARAMETER_TAG_NAME=34213]="INVALID_PARAMETER_TAG_NAME",k[k.INVALID_PARAMETER_USER_ID=34214]="INVALID_PARAMETER_USER_ID",k[k.INVALID_PARAMETER_USERIDLIST=34215]="INVALID_PARAMETER_USERIDLIST",k[k.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME=34217]="INVALID_PARAMETER_DOWNLOADMEDIAFILENAME",k[k.INVALID_PARAMETER_MESSAGE_EXPANSION=34220]="INVALID_PARAMETER_MESSAGE_EXPANSION",k[k.INVALID_PARAMETER_NOTMEDIAMESSAGE=34223]="INVALID_PARAMETER_NOTMEDIAMESSAGE",k[k.INVALID_PARAMETER_TIMESTRING=34224]="INVALID_PARAMETER_TIMESTRING",k[k.INVALID_PARAMETER_CONVERSATION=34225]="INVALID_PARAMETER_CONVERSATION",k[k.INVALID_PARAMETER_NOTIFICATION_LEVEL=34228]="INVALID_PARAMETER_NOTIFICATION_LEVEL",k[k.INVALID_PARAMETER_MESSAGE_ARRAY=34229]="INVALID_PARAMETER_MESSAGE_ARRAY",k[k.INVALID_PARAMETER_RECEIVED_STATUS=34230]="INVALID_PARAMETER_RECEIVED_STATUS",k[k.INVALID_PARAMETER_CHANNEL_TYPE=34231]="INVALID_PARAMETER_CHANNEL_TYPE",k[k.INVALID_PARAMETER_COUNT=34232]="INVALID_PARAMETER_COUNT",k[k.INVALID_PARAMETER_MEDIA_URL=34235]="INVALID_PARAMETER_MEDIA_URL",k[k.INVALID_PARAMETER_UNIQUE_ID=34236]="INVALID_PARAMETER_UNIQUE_ID",k[k.INVALID_PARAMETER_PROXY=34238]="INVALID_PARAMETER_PROXY",k[k.INVALID_PARAMETER_TESTHOST=34239]="INVALID_PARAMETER_TESTHOST",k[k.INVALID_CONNECT_TESTHOST_FAILED=34240]="INVALID_CONNECT_TESTHOST_FAILED",k[k.INVALID_PARAMETER_CONVERSATIONS=34242]="INVALID_PARAMETER_CONVERSATIONS",k[k.INVALID_PARAMETER_SENT_STATUS=34244]="INVALID_PARAMETER_SENT_STATUS",k[k.RC_CONN_PROXY_UNAVAILABLE=34245]="RC_CONN_PROXY_UNAVAILABLE",k[k.INVALID_PARAMETER_RTCROOMID=34259]="INVALID_PARAMETER_RTCROOMID",k[k.INVALID_PARAMETER_KEY=34260]="INVALID_PARAMETER_KEY",k[k.INVALID_PARAMETER_KEYS=34261]="INVALID_PARAMETER_KEYS",k[k.INVALID_PARAMETER_VALUE=34262]="INVALID_PARAMETER_VALUE",k[k.INVALID_PARAMETER_ENTRIES=34263]="INVALID_PARAMETER_ENTRIES",k[k.INVALID_PARAMETER_NOTIFICATION_EXTRA=34264]="INVALID_PARAMETER_NOTIFICATION_EXTRA",k[k.INVALID_PARAMETER_MESSAGE_OBJECT_NAME=34271]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME",k[k.INVALID_PARAMETER_BEFORE=34272]="INVALID_PARAMETER_BEFORE",k[k.INVALID_PARAMETER_AFTER=34273]="INVALID_PARAMETER_AFTER",k[k.INVALID_PARAMETER_KEYWORD=34274]="INVALID_PARAMETER_KEYWORD",k[k.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST=34275]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST",k[k.INVALID_PARAMETER_OFFSET=34276]="INVALID_PARAMETER_OFFSET",k[k.INVALID_PARAMETER_START_TIME=34277]="INVALID_PARAMETER_START_TIME",k[k.INVALID_PARAMETER_END_TIME=34278]="INVALID_PARAMETER_END_TIME",k[k.INVALID_PARAMETER_LIMIT=34279]="INVALID_PARAMETER_LIMIT",k[k.INVALID_MESSAGE_DIRECTION=34280]="INVALID_MESSAGE_DIRECTION",k[k.INVALID_MESSAGE_SENT_STATUS=34281]="INVALID_MESSAGE_SENT_STATUS",k[k.INVALID_PARAMETER_TARGETID_LIST=34282]="INVALID_PARAMETER_TARGETID_LIST",k[k.INVALID_PARAMETER_SPAN_MINUTES=34283]="INVALID_PARAMETER_SPAN_MINUTES",k[k.INVALID_PARAMETER_CONVERSATION_TYPE_LIST=34284]="INVALID_PARAMETER_CONVERSATION_TYPE_LIST",k[k.INVALID_PARAMETER_CONVERSATION_LIST=34287]="INVALID_PARAMETER_CONVERSATION_LIST",k[k.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST=34288]="INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST",k[k.INVALID_PARAMETER_START_MESSAGE_UID=34289]="INVALID_PARAMETER_START_MESSAGE_UID",k[k.INVALID_PARAMETER_END_MESSAGE_UID=34290]="INVALID_PARAMETER_END_MESSAGE_UID",k[k.READ_RECEIPT_V4_NOT_SUPPORT=34291]="READ_RECEIPT_V4_NOT_SUPPORT",k[k.READ_RECEIPT_V4_UPDATE_NOT_SUPPORT=34292]="READ_RECEIPT_V4_UPDATE_NOT_SUPPORT",k[k.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE=34296]="RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE",k[k.RC_DB_NOT_INIT=34301]="RC_DB_NOT_INIT",k[k.RC_DB_CORRUPT=34302]="RC_DB_CORRUPT",k[k.RC_DB_SQL_ERROR=34303]="RC_DB_SQL_ERROR",k[k.RC_DB_DATA_NOT_FOUND=34304]="RC_DB_DATA_NOT_FOUND",k[k.RC_NET_DATA_ERROR=34305]="RC_NET_DATA_ERROR",k[k.INVALID_PARAMETER_SUBSCRIBE_TYPE=34306]="INVALID_PARAMETER_SUBSCRIBE_TYPE",k[k.INVALID_PARAMETER_SUBSCRIBE_EXPIRY=34307]="INVALID_PARAMETER_SUBSCRIBE_EXPIRY",k[k.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS=34308]="INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS",k[k.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE=34309]="INVALID_PARAMETER_SUBSCRIBE_PAGESIZE",k[k.SUB_PROCESS_EXIT=34310]="SUB_PROCESS_EXIT",k[k.ADDON_NOT_EXIST=34311]="ADDON_NOT_EXIST",k[k.INVALID_PARAMETER_USER_PROFILE=34312]="INVALID_PARAMETER_USER_PROFILE",k[k.INVALID_PARAMETER_USER_PROFILE_VISIBILITY=34313]="INVALID_PARAMETER_USER_PROFILE_VISIBILITY",k[k.INVALID_PARAMETER_EXTRA=34314]="INVALID_PARAMETER_EXTRA",k[k.DB_UPGRADE_FAILED=34315]="DB_UPGRADE_FAILED",k[k.INVALID_PARAMETER_GROUP_INFO=34318]="INVALID_PARAMETER_GROUP_INFO",k[k.INVALID_PARAMETER_GROUP_ID=34319]="INVALID_PARAMETER_GROUP_ID",k[k.INVALID_PARAMETER_GROUP_NAME=34320]="INVALID_PARAMETER_GROUP_NAME",k[k.INVALID_PARAMETER_GROUP_IDS=34321]="INVALID_PARAMETER_GROUP_IDS",k[k.INVALID_PARAMETER_GROUP_MEMBER_ROLE=34322]="INVALID_PARAMETER_GROUP_MEMBER_ROLE",k[k.INVALID_PARAMETER_GROUP_APPLICATION_STATUS=34323]="INVALID_PARAMETER_GROUP_APPLICATION_STATUS",k[k.INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION=34324]="INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION",k[k.INVALID_PARAMETER_NICK_NAME=34325]="INVALID_PARAMETER_NICK_NAME",k[k.INVALID_PARAMETER_REASON=34326]="INVALID_PARAMETER_REASON",k[k.INVALID_PARAMETER_REMARK=34327]="INVALID_PARAMETER_REMARK",k[k.INVALID_PARAMETER_PAGING_QUERY_OPTION=34328]="INVALID_PARAMETER_PAGING_QUERY_OPTION",k[k.NET_DATA_IS_SYNCHRONIZING=34329]="NET_DATA_IS_SYNCHRONIZING",k[k.INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE=34330]="INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE",k[k.INVALID_PARAMETER_DIRECTION_TYPE=34331]="INVALID_PARAMETER_DIRECTION_TYPE",k[k.INVALID_PARAMETER_FRIEND_APPLICATION_TYPE=34332]="INVALID_PARAMETER_FRIEND_APPLICATION_TYPE",k[k.INVALID_PARAMETER_FRIEND_APPLICATION_STATUS=34333]="INVALID_PARAMETER_FRIEND_APPLICATION_STATUS",k[k.INVALID_PARAMETER_FRIEND_ADD_PERMISSION=34334]="INVALID_PARAMETER_FRIEND_ADD_PERMISSION",k[k.INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS=34335]="INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS",k[k.RC_REAL_TIME_CONVERSATION_UNAVAILABLE=34336]="RC_REAL_TIME_CONVERSATION_UNAVAILABLE",k[k.SERVER_DATA_ERROR=34344]="SERVER_DATA_ERROR",k[k.INVALID_PARAMETER_MESSAGE_INFO_MAP=34345]="INVALID_PARAMETER_MESSAGE_INFO_MAP",k[k.INVALID_PARAMETER_PAGE_TOKEN=34346]="INVALID_PARAMETER_PAGE_TOKEN",k[k.SERVER_RECORD_UNREAD_COUNT_ENABLED_FORBIDDEN=34435]="SERVER_RECORD_UNREAD_COUNT_ENABLED_FORBIDDEN",k[k.SERVER_RECORD_UNREAD_COUNT_DISABLED=34436]="SERVER_RECORD_UNREAD_COUNT_DISABLED",k[k.DATABASEDISKFULL=34439]="DATABASEDISKFULL",k[k.GROUP_SYNC_ERROR=35001]="GROUP_SYNC_ERROR",k[k.GROUP_MATCH_ERROR=35002]="GROUP_MATCH_ERROR",k[k.NOT_SUPPORT=35004]="NOT_SUPPORT",k[k.MAIN_PROCESS_ERROR=35005]="MAIN_PROCESS_ERROR",k[k.CAN_NOT_RECONNECT=35007]="CAN_NOT_RECONNECT",k[k.SERVER_UNAVAILABLE=35008]="SERVER_UNAVAILABLE",k[k.HOSTNAME_ERROR=35009]="HOSTNAME_ERROR",k[k.HAS_OHTER_SAME_CLIENT_ON_LINE=35010]="HAS_OHTER_SAME_CLIENT_ON_LINE",k[k.METHOD_NOT_AVAILABLE=35011]="METHOD_NOT_AVAILABLE",k[k.METHOD_ONLY_SUPPORT_ULTRA_GROUP=35014]="METHOD_ONLY_SUPPORT_ULTRA_GROUP",k[k.DRAFT_SAVE_ERROR=35015]="DRAFT_SAVE_ERROR",k[k.DRAFT_REMOVE_ERROR=35016]="DRAFT_REMOVE_ERROR",k[k.CONVER_REMOVE_ERROR=35020]="CONVER_REMOVE_ERROR",k[k.CONVER_GET_ERROR=35021]="CONVER_GET_ERROR",k[k.SEARCH_PROPS_LIMIT_ERROR=35022]="SEARCH_PROPS_LIMIT_ERROR",k[k.INVALID_PARAMETER_MESSAGE_TYPE=35024]="INVALID_PARAMETER_MESSAGE_TYPE",k[k.INVALID_PARAMETER_ORDER=35025]="INVALID_PARAMETER_ORDER",k[k.INVALID_PARAMETER_DRAFT=35028]="INVALID_PARAMETER_DRAFT",k[k.INVALID_PARAMETER_MESSAGE=35029]="INVALID_PARAMETER_MESSAGE",k[k.INVALID_PARAMETER_PUSH_CONTENT=35030]="INVALID_PARAMETER_PUSH_CONTENT",k[k.INVALID_PARAMETER_SENDOPTIONS=35031]="INVALID_PARAMETER_SENDOPTIONS",k[k.INVALID_PARAMETER_CONTENT_DISPOSITION=35032]="INVALID_PARAMETER_CONTENT_DISPOSITION",k[k.INVALID_PARAMETER_SAVE_NAME=35033]="INVALID_PARAMETER_SAVE_NAME",k[k.INVALID_PARAMETER_SERVER_TYPE=35034]="INVALID_PARAMETER_SERVER_TYPE",k[k.INVALID_PARAMETER_CLEAN_SPACE=35035]="INVALID_PARAMETER_CLEAN_SPACE",k[k.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION=35036]="INVALID_PARAMETER_CAN_INCLUDE_EXPANSION",k[k.INVALID_PARAMETER_DISABLE_NOTIFICATION=35037]="INVALID_PARAMETER_DISABLE_NOTIFICATION",k[k.INVALID_PARAMETER_CHECK_DUPLICATE=35038]="INVALID_PARAMETER_CHECK_DUPLICATE",k[k.INVALID_PARAMETER_IS_AUTO_DELETE=35039]="INVALID_PARAMETER_IS_AUTO_DELETE",k[k.INVALID_PARAMETER_IS_SEND_NOTIFICATION=35040]="INVALID_PARAMETER_IS_SEND_NOTIFICATION",k[k.INVALID_PARAMETER_IS_FORCE=35041]="INVALID_PARAMETER_IS_FORCE",k[k.INVALID_PARAMETER_IS_TOP=35042]="INVALID_PARAMETER_IS_TOP",k[k.INVALID_PARAMETER_IS_UPDATE_TIME=35043]="INVALID_PARAMETER_IS_UPDATE_TIME",k[k.INVALID_PARAMETER_CONTAIN_MUTED=35044]="INVALID_PARAMETER_CONTAIN_MUTED",k[k.INVALID_PARAMETER_IS_STATUS_MESSAGE=35045]="INVALID_PARAMETER_IS_STATUS_MESSAGE",k[k.INVALID_PARAMETER_IS_MENTIONED=35046]="INVALID_PARAMETER_IS_MENTIONED",k[k.INVALID_PARAMETER_IS_VOIP_PUSH=35047]="INVALID_PARAMETER_IS_VOIP_PUSH",k[k.INVALID_PARAMETER_MENTIONED_TYPE=35048]="INVALID_PARAMETER_MENTIONED_TYPE",k[k.INVALID_PARAMETER_PUSH_CONFIG=35049]="INVALID_PARAMETER_PUSH_CONFIG",k[k.INVALID_PARAMETER_PUSH_DATA=35050]="INVALID_PARAMETER_PUSH_DATA",k[k.DNS_PROXY_TIMEOUT=35051]="DNS_PROXY_TIMEOUT",k[k.DNS_PROXY_ERROR=35052]="DNS_PROXY_ERROR",k[k.DNS_PROXY_DATA_ERROR=35053]="DNS_PROXY_DATA_ERROR",k[k.INVALID_DISABLE_UPDATE_LAST_MESSAGE=35054]="INVALID_DISABLE_UPDATE_LAST_MESSAGE",k[k.ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING=35055]="ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING",k[k.SEND_READ_RECEIPT_CONF_ERROR=35056]="SEND_READ_RECEIPT_CONF_ERROR",k[k.SPEECH_TO_TEXT_DISABLE=35057]="SPEECH_TO_TEXT_DISABLE",k[k.SPEECH_TO_TEXT_REQUEST_IN_PROCESS=35058]="SPEECH_TO_TEXT_REQUEST_IN_PROCESS",k[k.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED=35059]="SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED",k[k.TRANSLATION_PARAMS_TYPE_INVALID=35060]="TRANSLATION_PARAMS_TYPE_INVALID",k[k.TRANSLATION_PARAMS_LIST_INVALID=35061]="TRANSLATION_PARAMS_LIST_INVALID",k[k.INVALID_PARAMETER_TRANSLATE_STRATEGY=35062]="INVALID_PARAMETER_TRANSLATE_STRATEGY",k[k.TRANSLATION_LANGUAGE_SAME=35063]="TRANSLATION_LANGUAGE_SAME",k[k.INVALID_PARAMETER_TRANSLATE_MODE=35064]="INVALID_PARAMETER_TRANSLATE_MODE",k[k.TRANSLATION_TEXT_INVALID=35065]="TRANSLATION_TEXT_INVALID",k[k.MSG_BLOCK_SEND=35066]="MSG_BLOCK_SEND",k[k.CHATROOM_ID_ISNULL=36001]="CHATROOM_ID_ISNULL",k[k.CHARTOOM_JOIN_ERROR=36002]="CHARTOOM_JOIN_ERROR",k[k.CHATROOM_HISMESSAGE_ERROR=36003]="CHATROOM_HISMESSAGE_ERROR",k[k.CHATROOM_KV_NOT_FOUND=36004]="CHATROOM_KV_NOT_FOUND",k[k.BLACK_ADD_ERROR=37001]="BLACK_ADD_ERROR",k[k.BLACK_GETSTATUS_ERROR=37002]="BLACK_GETSTATUS_ERROR",k[k.BLACK_REMOVE_ERROR=37003]="BLACK_REMOVE_ERROR",k[k.DRAF_GET_ERROR=38001]="DRAF_GET_ERROR",k[k.STREAM_MESSAGE_DISABLE=39001]="STREAM_MESSAGE_DISABLE",k[k.STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED=39002]="STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED",k[k.STREAM_MESSAGE_EXPANSION_KEY_ERROR=39003]="STREAM_MESSAGE_EXPANSION_KEY_ERROR",k[k.STREAM_MESSAGE_REQUEST_FAIL=39005]="STREAM_MESSAGE_REQUEST_FAIL",k[k.STREAM_MESSAGE_REQUEST_IN_PROCESS=39006]="STREAM_MESSAGE_REQUEST_IN_PROCESS",k[k.STREAM_MESSAGE_SYNCED=39007]="STREAM_MESSAGE_SYNCED",k[k.QNTKN_GET_ERROR=41002]="QNTKN_GET_ERROR",k[k.TIMEOUT=-1]="TIMEOUT",exports.ConversationType=void 0,(F=exports.ConversationType||(exports.ConversationType={}))[F.NONE=0]="NONE",F[F.PRIVATE=1]="PRIVATE",F[F.DISCUSSION=2]="DISCUSSION",F[F.GROUP=3]="GROUP",F[F.CHATROOM=4]="CHATROOM",F[F.CUSTOMER_SERVICE=5]="CUSTOMER_SERVICE",F[F.SYSTEM=6]="SYSTEM",F[F.APP_PUBLIC_SERVICE=7]="APP_PUBLIC_SERVICE",F[F.PUBLIC_SERVICE=8]="PUBLIC_SERVICE",F[F.ULTRA_GROUP=10]="ULTRA_GROUP",F[F.RTC_ROOM=12]="RTC_ROOM";var H,Y,W,J=0,q=1,K=2,Q=3,X=4,Z=5,z=6,$=7,ee=function(e){var t=[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP,exports.ConversationType.SYSTEM,exports.ConversationType.PUBLIC_SERVICE,exports.ConversationType.APP_PUBLIC_SERVICE];switch(e){case J:return t;case q:return[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP];case K:return l(l([],u(t),!1),[exports.ConversationType.ULTRA_GROUP],!1);case Q:return l(l([],u(t),!1),[exports.ConversationType.ULTRA_GROUP,exports.ConversationType.CHATROOM],!1);case X:return l(l([],u(t),!1),[exports.ConversationType.ULTRA_GROUP,exports.ConversationType.CHATROOM,exports.ConversationType.RTC_ROOM,exports.ConversationType.CUSTOMER_SERVICE,exports.ConversationType.DISCUSSION],!1);case Z:return[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP,exports.ConversationType.ULTRA_GROUP];case z:return[exports.ConversationType.GROUP];case $:return[exports.ConversationType.PRIVATE]}},te=function(e,t){return ee(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"}(H||(H={})),exports.FileType=void 0,(Y=exports.FileType||(exports.FileType={}))[Y.IMAGE=1]="IMAGE",Y[Y.AUDIO=2]="AUDIO",Y[Y.VIDEO=3]="VIDEO",Y[Y.FILE=4]="FILE",Y[Y.SIGHT=5]="SIGHT",Y[Y.COMBINE_HTML=6]="COMBINE_HTML",exports.MentionedType=void 0,(W=exports.MentionedType||(exports.MentionedType={}))[W.ALL=1]="ALL",W[W.SINGAL=2]="SINGAL";var re,ne,ie,oe,ae,se,ue,le,ce,de,fe,_e,pe,he,ge,Ee,be,Ie,Te,ve,Re,me={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"};exports.UltraGroupChannelType=void 0,(re=exports.UltraGroupChannelType||(exports.UltraGroupChannelType={}))[re.PUBLIC=0]="PUBLIC",re[re.PRIVATE=1]="PRIVATE",exports.UltraGroupChannelChangeType=void 0,(ne=exports.UltraGroupChannelChangeType||(exports.UltraGroupChannelChangeType={}))[ne.PUBLIC_TO_PRIVATE=2]="PUBLIC_TO_PRIVATE",ne[ne.PRIVATE_TO_PUBLIC=3]="PRIVATE_TO_PUBLIC",ne[ne.PUBLIC_TO_PRIVATE_USER_NOT_IN=6]="PUBLIC_TO_PRIVATE_USER_NOT_IN",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"}(ie||(ie={})),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"}(oe||(oe={})),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"}(ae||(ae={})),function(e){e[e.NOT_MENTIONED=0]="NOT_MENTIONED",e[e.ALL=1]="ALL",e[e.ME=2]="ME"}(se||(se={})),exports.SentStatus=void 0,(ue=exports.SentStatus||(exports.SentStatus={}))[ue.SENDING=10]="SENDING",ue[ue.FAILED=20]="FAILED",ue[ue.SENT=30]="SENT",ue[ue.RECEIVED=40]="RECEIVED",ue[ue.READ=50]="READ",ue[ue.DESTROYED=60]="DESTROYED",exports.OperateStatus=void 0,(le=exports.OperateStatus||(exports.OperateStatus={}))[le.typing=0]="typing",exports.OnlineStatus=void 0,(ce=exports.OnlineStatus||(exports.OnlineStatus={}))[ce.ONLINE=1]="ONLINE",ce[ce.OFFLINE=0]="OFFLINE",exports.Platform=void 0,(de=exports.Platform||(exports.Platform={}))[de.Other=0]="Other",de[de.iOS=1]="iOS",de[de.Android=2]="Android",de[de.Web=3]="Web",de[de.PC=4]="PC",de[de.Mini=5]="Mini",de[de.HarmonyOS=6]="HarmonyOS",exports.SubscribeType=void 0,(fe=exports.SubscribeType||(exports.SubscribeType={}))[fe.ONLINE_STATUS=1]="ONLINE_STATUS",fe[fe.USER_PROFILE=2]="USER_PROFILE",fe[fe.FRIEND_ONLINE_STATUS=3]="FRIEND_ONLINE_STATUS",fe[fe.FRIEND_USER_PROFILE=4]="FRIEND_USER_PROFILE",exports.SubscribeOperationType=void 0,(_e=exports.SubscribeOperationType||(exports.SubscribeOperationType={}))[_e.SUBSCRIBE=0]="SUBSCRIBE",_e[_e.UNSUBSCRIBE=1]="UNSUBSCRIBE",exports.UserProfileVisibility=void 0,(pe=exports.UserProfileVisibility||(exports.UserProfileVisibility={}))[pe.NOT_SET=0]="NOT_SET",pe[pe.INVISIBLE=1]="INVISIBLE",pe[pe.EVERYONE=2]="EVERYONE",pe[pe.FriendVisible=3]="FriendVisible",exports.RCConnectionStatus=void 0,(he=exports.RCConnectionStatus||(exports.RCConnectionStatus={}))[he.CONNECTED=0]="CONNECTED",he[he.CONNECTING=1]="CONNECTING",he[he.DISCONNECTED=2]="DISCONNECTED",he[he.SUSPENDED=3]="SUSPENDED",exports.MessageBlockType=void 0,(ge=exports.MessageBlockType||(exports.MessageBlockType={}))[ge.GLOBAL=1]="GLOBAL",ge[ge.CUSTOM=2]="CUSTOM",ge[ge.THIRD_PARTY=3]="THIRD_PARTY",exports.MessageBlockSourceType=void 0,(Ee=exports.MessageBlockSourceType||(exports.MessageBlockSourceType={}))[Ee.MSG_ORIGINAL=0]="MSG_ORIGINAL",Ee[Ee.MSG_EXPANSION=1]="MSG_EXPANSION",Ee[Ee.MSG_MODIFY=2]="MSG_MODIFY",exports.MessageDirection=void 0,(be=exports.MessageDirection||(exports.MessageDirection={}))[be.SEND=1]="SEND",be[be.RECEIVE=2]="RECEIVE",exports.PushImportanceHonor=void 0,(Ie=exports.PushImportanceHonor||(exports.PushImportanceHonor={})).NORMAL="NORMAL",Ie.LOW="LOW",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"}(Te||(Te={})),exports.NotificationLevel=void 0,(ve=exports.NotificationLevel||(exports.NotificationLevel={}))[ve.ALL_MESSAGE=-1]="ALL_MESSAGE",ve[ve.NOT_SET=0]="NOT_SET",ve[ve.AT_MESSAGE_NOTIFICATION=1]="AT_MESSAGE_NOTIFICATION",ve[ve.AT_USER_NOTIFICATION=2]="AT_USER_NOTIFICATION",ve[ve.AT_GROUP_ALL_USER_NOTIFICATION=4]="AT_GROUP_ALL_USER_NOTIFICATION",ve[ve.NOT_MESSAGE_NOTIFICATION=5]="NOT_MESSAGE_NOTIFICATION",exports.NotificationStatus=void 0,(Re=exports.NotificationStatus||(exports.NotificationStatus={}))[Re.OPEN=1]="OPEN",Re[Re.CLOSE=2]="CLOSE";var ye,Ae,Oe,Se,Ce,Ne,Me,Pe,Le,we=function(e){return e<=exports.NotificationLevel.NOT_SET?exports.NotificationStatus.CLOSE:exports.NotificationStatus.OPEN};exports.ReceivedStatus=void 0,(ye=exports.ReceivedStatus||(exports.ReceivedStatus={}))[ye.READ=1]="READ",ye[ye.LISTENED=2]="LISTENED",ye[ye.DOWNLOADED=4]="DOWNLOADED",ye[ye.RETRIEVED=8]="RETRIEVED",ye[ye.UNREAD=0]="UNREAD",function(e){e[e.PRIVATE=1]="PRIVATE",e[e.OPEN=0]="OPEN"}(Ae||(Ae={})),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"}(Ce||(Ce={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT"}(Ne||(Ne={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT",e[e.REDIRECTED=3]="REDIRECTED",e[e.TIMEOUT=4]="TIMEOUT"}(Me||(Me={})),exports.InterruptionLevel=void 0,(Pe=exports.InterruptionLevel||(exports.InterruptionLevel={})).PASSIVE="passive",Pe.ACTIVE="active",Pe.TIME_SENSITIVE="time-sensitive",Pe.CRITICAL="critical",exports.PushNotificationQuietHoursLevel=void 0,(Le=exports.PushNotificationQuietHoursLevel||(exports.PushNotificationQuietHoursLevel={}))[Le.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT=0]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT",Le[Le.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_MENTION_MESSAGE=1]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_MENTION_MESSAGE",Le[Le.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_BLOCKED=5]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_BLOCKED";var Ue,De,xe={ALL:0,EXCLUDE_ROBOT:1,ROBOT_ONLY:2},Ge={NOT_CONVERTED:0,CONVERTING:1,SUCCESS:2,FAILED:3},Ve={UNKNOWN:-1,V1:0,V2:1,V4:3,V5:4},je={DEFAULT:0,DELETED:1,RECALLED:2},ke={ADDED:1,REMOVED:2,CLEARED:3};!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={})),exports.HttpMethod=void 0,(De=exports.HttpMethod||(exports.HttpMethod={})).GET="GET",De.POST="POST",De.PUT="PUT";var Fe=72e5,Be=6e4,He=131072,Ye="5.42.0".replace(/-.+$/,""),We="rongcloudsystem",Je=864e5,qe="RCDeviceId",Ke=function(e){return"navi_".concat(e)},Qe=function(e,t){return"RC-con-stat-ver-".concat(e,"-").concat(t)},Xe=function(e,t){return"RCV4-CONVER-".concat(e,"-").concat(t)},Ze=function(e,t){return"RCV4-ultragroupconversation-".concat(e,"-").concat(t)},ze=function(e,t){return"RC-con-type-settings-".concat(e,"-").concat(t)},$e=function(e,t){return"outbox_".concat(e,"_").concat(t)},et=function(e,t){return"inbox_".concat(e,"_").concat(t)},rt=function(e,t){return"broadcastbox_".concat(e,"_").concat(t)},nt=function(e,t){return"send_msg_".concat(e,"_").concat(t)},it=function(e,t){return"RC-us-".concat(e,"-").concat(t)},ot=function(e){return"rc-static-config-".concat(e)},at=function(e){return"RC-cc-".concat(e)},st=function(e,t){return"RC-RR-".concat(e,"-").concat(t)},ut=function(e){return"RC-LI-".concat(e)},lt=Math.pow(2,31)-1,ct="undefined"!=typeof window&&window?(window.__RCVersionInfo||(window.__RCVersionInfo={}),window.__RCVersionInfo):{},dt="engine";ct[dt]="5.42.0";var ft=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)&&(ct[e]=t)}}),Object.defineProperty(e,"validEngine",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.match(/\d+\.\d+\.\d+/);if(!t)return!1;var r=t[0].split(".").map((function(e){return e.padStart(3,"0")})).join("");return ct[dt].match(/\d+\.\d+\.\d+/)[0].split(".").map((function(e){return e.padStart(3,"0")})).join("")>=r}}),Object.defineProperty(e,"getInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return ct}}),e}();var _t={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,r=Date.now(),n=r.toString(36),i=Math.floor(Math.random()*r).toString(36),o=e-n.length-i.length;return[i,n,o>0?(t=o,Array.from({length:t}).map((function(){return Math.floor(36*Math.random()).toString(36)})).join("")):""].join("").slice(0,e)}},pt=_t.genWithLen(22),ht=Date.now(),gt=function(e){return"string"==typeof e},Et=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)}},It=function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")},Tt=function(e){return function(t){return gt(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 gt(e)&&e.length>0},Rt=function(e){return"[object Object]"===Object.prototype.toString.call(e)},mt=function(e){return"function"==typeof e},yt=function(e){return void 0===e||"[object Undefined]"===Object.prototype.toString.call(e)},At=function(e){return gt(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 Et(e)&&Object.prototype.hasOwnProperty.call(exports.NotificationLevel,e)},Ct=function(e){var t=!1;return gt(e)&&!/_/g.test(e)&&e.length<=20&&(t=!0),t},Nt=function(e){return Tt({minLength:1,maxLength:64})(e)},Mt=function(e){return Tt({minLength:1,maxLength:64})(e)&&/^[a-zA-Z0-9+=\-_|:]*$/.test(e)},Pt=function(){return void 0!==(null===window||void 0===window?void 0:window.__RCCppContextBridge__)},Lt=function(e){return{isRead:(e&exports.ReceivedStatus.READ)===exports.ReceivedStatus.READ,isListened:(e&exports.ReceivedStatus.LISTENED)===exports.ReceivedStatus.LISTENED,isDownload:(e&exports.ReceivedStatus.DOWNLOADED)===exports.ReceivedStatus.DOWNLOADED,isRetrieved:(e&exports.ReceivedStatus.RETRIEVED)===exports.ReceivedStatus.RETRIEVED}},wt=function(e){return[exports.Platform.iOS,exports.Platform.Android,exports.Platform.Web,exports.Platform.PC,exports.Platform.Mini,exports.Platform.HarmonyOS].map((function(t){var r=e.findIndex((function(e){return e.platform===t}));return-1===r?{platform:t,changeTime:0,eventValue:0}:e[r]}))},Ut=function(e,t,r){var n=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 n.userId=e,r.forEach((function(e){n.extraProfile=n.extraProfile||{},n.extraProfile[e.key]=e.value})),n},Dt=function(e,t,r){return t?1===r?H.TLS:H.RMTP:"http"===e?H.WS:H.WSS},xt=function(e,t){var r=e.server,n=e.backupServer,i=e.bs,o=e.serverAddr,a=e.protocol,s=e.openTLS;if(o)return l([],u(o.filter((function(e){return e.addr}))),!1);var c=[],d=[];return r&&d.push(r),(n||i||"").split(",").forEach((function(e){d.indexOf(e)<0&&d.push(e)})),d.forEach((function(e,n){e&&c.push({addr:e,protocol:Dt(a,t,s),weight:r.length-n,race:!1})})),l([],u(c),!1)},Gt=function(e){return void 0===e&&(e=[]),e.map((function(e){var t=Ft(e.settingProfile),r=e.extProfile||[],i=e.targetId,o=e.baseInfo,a=e.userInfo;return JSON.parse(JSON.stringify(n(n({groupId:i},jt(t)),{extProfile:r.length>0?Ft(r):void 0,creatorId:null==o?void 0:o.creatorId,ownerId:null==o?void 0:o.ownerId,createTime:null==o?void 0:o.createTime,membersCount:null==o?void 0:o.memberCount,remark:null==a?void 0:a.remarkName})))}))},Vt=function(e){if(void 0!==e){var t=Number(e);return Number.isNaN(t)?void 0:t}},jt=function(e){return JSON.parse(JSON.stringify({groupName:e.name,portraitUri:e.portraitUrl,introduction:e.introduction,notice:e.announcement,joinPermission:Vt(e.joinPerm),removeMemberPermission:Vt(e.removePerm),invitePermission:Vt(e.memInvitePerm),inviteHandlePermission:Vt(e.invitePerm),groupInfoEditPermission:Vt(e.profilePerm),memberInfoEditPermission:Vt(e.memProfilePerm)}))},kt=function(e){return void 0===e&&(e=[]),e.map(Bt)},Ft=function(e){var t={};return e&&0!==e.length?(e.forEach((function(e){t[e.key]=e.value})),t):t},Bt=function(e){var t=e.userId,r=e.name,n=e.portraitUrl,i=e.ext||{},o=i.role,a=i.joinTime,s=i.channelNickName,u=i.additional,l=i.isBot;return{userId:t,name:r||"",portraitUri:n||"",nickname:s||"",extra:u||"",role:o||exports.GroupMemberRole.UNDEF,joinedTime:a||0,isRobot:!!l}},Ht=function(e){var t=e.joinUserInfo,r=e.inviterInfo,n=e.processInfo;return{groupId:e.targetId,joinMemberInfo:Bt(t),inviterInfo:r&&r.userId?Bt(r):void 0,operatorInfo:n&&n.userId?Bt(n):void 0,status:e.status,direction:e.directionType,type:e.joinType,operationTime:e.applyTime||0,reason:e.detail||""}},Yt=function(e){return e.reduce((function(e,t){return e[t.key]=t.value,e}),{})},Wt=function(e,t){if(e=e.replace(/\?$/,""),!t)return e;var r=Object.keys(t).map((function(e){return"".concat(e,"=").concat(t[e])})).filter((function(e){return!!e}));return r.length?[e,r.join("&")].join("?"):e};function Jt(e){for(var t=null===window||void 0===window?void 0:window.atob(e),r=new Uint8Array(t.length),n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r.buffer}var qt,Kt=function(e,t){var r=Math.floor(1e3*Math.random()%1e4),n=_t.gen(),i=function(e){e=e||"-";var t=new Date,r=t.getFullYear(),n=t.getMonth()+1,i=t.getDate();return"".concat(r).concat(e).concat(n).concat(e).concat(i)}(),o=(new Date).getTime(),a="";if(t){var s=t.split(".");a=".".concat(s[s.length-1])}return"".concat(e,"__RC-").concat(i,"_").concat(r,"_").concat(o).concat(n).concat(a)},Qt=function(e,t,r){void 0===e&&(e={}),void 0===t&&(t={}),void 0===r&&(r={});var n=t.channelIdMi,i=t.channelIdHW,o=t.channelIdOPPO,a=t.typeVivo,s=t.importanceHW,u=t.categoryHW,l=t.imageUrlHW,c=t.categoryVivo,d=t.importanceHonor,f=t.imageUrlHonor,_=function(e,t){void 0===e&&(e={}),void 0===t&&(t={});var r=e.threadId,n=e.apnsCollapseId,i=e.category,o=e.richMediaUri,a=e.interruptionLevel,s=t.googleConfig,u={};u["thread-id"]=r||"",u["apns-collapse-id"]=n||"",u.category=i||"",u.richMediaUri=o||"",u["interruption-level"]=a||"active";var 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),p=[{HW:{channelId:i||"",importance:s||"NORMAL",image:l||"",category:u||""}},{MI:{channelId:n||""}},{OPPO:{channelId:o||""}},{VIVO:{classification:a||"",category:c||""}},{APNS:_.APNS},{FCM:_.FCM},{HONOR:{importance:d||exports.PushImportanceHonor.NORMAL,image:f||""}},{OHOS:{category:r.category||null,image:r.image||""}}];return JSON.stringify(p)},Xt=function(e,t){var r={},n={notificationId:t||""},i={};if(!e)return{iOSConfig:r,androidConfig:n,harmonyOSConfig:i};try{var o=JSON.parse(e);null==o||o.forEach((function(e){var t,o,a,s,u,l,c,d,f,_,p,h,g=Object.keys(e);if(0!==g.length){var E=g[0];switch(E){case"HW":return n.channelIdHW=null===(t=e[E])||void 0===t?void 0:t.channelId,n.importanceHW=null===(o=e[E])||void 0===o?void 0:o.importance,n.imageUrlHW=null===(a=e[E])||void 0===a?void 0:a.image,void(n.categoryHW=null===(s=e[E])||void 0===s?void 0:s.category);case"MI":return void(n.channelIdMi=null===(u=e[E])||void 0===u?void 0:u.channelId);case"OPPO":return void(n.channelIdOPPO=null===(l=e[E])||void 0===l?void 0:l.channelId);case"VIVO":return n.typeVivo=null===(c=e[E])||void 0===c?void 0:c.classification,void(n.categoryVivo=null===(d=e[E])||void 0===d?void 0:d.category);case"APNS":return r.threadId=e[E]["thread-id"],r.apnsCollapseId=e[E]["apns-collapse-id"],r.category=e[E].category,r.richMediaUri=e[E].richMediaUri,void(r.interruptionLevel=e[E]["interruption-level"]);case"FCM":return void(n.googleConfig={collapseKey:e[E].collapse_key||"",imageUrl:e[E].imageUrl||"",priority:e[E].priority||""});case"HONOR":return n.importanceHonor=null===(f=e[E])||void 0===f?void 0:f.importance,void(n.imageUrlHonor=null===(_=e[E])||void 0===_?void 0:_.image);case"OHOS":i.category=null===(p=e[E])||void 0===p?void 0:p.category,i.image=null===(h=e[E])||void 0===h?void 0:h.image}}}))}catch(e){}return{iOSConfig:r,androidConfig:n,harmonyOSConfig:i}},Zt=function(e){var t=/^[A-Za-z0-9_=+-]+$/.test(e),r=e.length;return t&&(r<=128&&r>=1)},zt=function(e){var t=e.length;return t<=4096&&t>=1},$t=(qt=0,function(){var e=((4294967295&Date.now())>>>0).toString(2),t=Math.floor(Math.random()*(Math.pow(2,8)-1)),r=e+qt.toString(2).padStart(11,"0")+t.toString(2).padStart(8,"0");return qt=2047&++qt,parseInt(r,2)}),er=function(){var e=ft.getInfo(),t="electron";for(var r in e)"engine"!==r&&(t=["imlib-v2-adapter","imlib-next"].includes(r)?r:"electron");return t},tr=function(e,t,r){return o(void 0,void 0,void 0,(function(){var n,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 n=o.sent(),[4,window.crypto.subtle.decrypt({name:"AES-CBC",iv:(new TextEncoder).encode(r)},n,Jt(e))];case 2:return i=o.sent(),[2,(new TextDecoder).decode(i)]}}))}))};function rr(e,t){var r;if(!e)return"";var n="undefined"!=typeof window&&"https:"===(null===(r=null===window||void 0===window?void 0:window.location)||void 0===r?void 0:r.protocol);return/^https?:\/\//.test(e)?n?e.replace(/^https?:\/\//i,"https://"):e:t!==H.HTTP||n?"https://".concat(e):"http://".concat(e)}var nr=function(e,t){if(!e)return"";var r=e.ossConfig,n=void 0===r?"":r,i="";try{var o=JSON.parse(n);if(o.length>0){var a=o.find((function(e){return e.minio}));a&&(i=a.minio)}}catch(e){t.warn(B.L_PARSE_JSON_E,JSON.stringify({ossConfig:n,error:e}))}return i};var ir,or=function(e,t){return t&&0!==t.length?[exports.ConversationType.GROUP,exports.ConversationType.ULTRA_GROUP,exports.ConversationType.APP_PUBLIC_SERVICE,exports.ConversationType.PUBLIC_SERVICE].includes(e)?t:[]:t||[]},ar=function(e){function r(t){var r=e.call(this,t)||this;return r.name="RCError",r}return t(r,e),Object.defineProperty(r,"InvalidParameters",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return(null==e?void 0:e.length)?new r("Invalid parameter -> ".concat(e)):new r("Invalid parameters.")}}),Object.defineProperty(r,"ParameterTypeError",{enumerable:!1,configurable:!0,writable:!0,value:function(){return new r("Wrong parameter type")}}),r}(Error),sr=function(){function e(){ir.set(this,!1)}return Object.defineProperty(e.prototype,"stopPropagation",{enumerable:!1,configurable:!0,writable:!0,value:function(){d(this,ir,!0,"f")}}),Object.defineProperty(e.prototype,"isStopPropagation",{get:function(){return c(this,ir,"f")},enumerable:!1,configurable:!0}),e}();ir=new WeakMap;var ur=function(){function e(){Object.defineProperty(this,"_map",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"_piped",{enumerable:!0,configurable:!0,writable:!0,value:new Map})}return Object.defineProperty(e.prototype,"_addItem",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){void 0===i&&(i=0);var o=Symbol(),a=this._map.get(e)||this._map.set(e,[]).get(e),s={symbol:o,priority:Math.min(i,100),listener:t.bind(n),once:r},u=a.findIndex((function(e){return e.priority>i}));return-1===u?a.push(s):a.splice(u,0,s),o}}),Object.defineProperty(e.prototype,"on",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=0),this._addItem(e,t,!1,r,n)}}),Object.defineProperty(e.prototype,"once",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=0),this._addItem(e,t,!0,r,n)}}),Object.defineProperty(e.prototype,"off",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;try{for(var n=s(this._map),i=n.next();!i.done;i=n.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&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=this._map.get(e);if(n&&n.length>0)for(var i=new sr,o=0;o<n.length;o+=1){var a=n[o],s=a.once,c=a.listener;s&&n.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.entries()),!1).forEach((function(r){var n=u(r,2),i=n[0],o=n[1];(0===o.length||o.includes(e))&&i.emit.apply(i,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,t){this._piped.set(e,t||[])}}),e}(),lr=function(e){function r(t){var r=e.call(this)||this;return Object.defineProperty(r,"_name",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"_versionQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(r,"_pullingPromise",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(r,"_dataVersion",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(r,"_invervalTimer",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(r,"_started",{enumerable:!0,configurable:!0,writable:!0,value:!1}),r}return t(r,e),Object.defineProperty(r.prototype,"length",{get:function(){return this._versionQueue.length},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"_isPulling",{get:function(){return null!==this._pullingPromise},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"setInitVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){void 0===t&&(t=!1),-1===this._dataVersion&&(this._dataVersion=e,t&&this._execPulling())}}),Object.defineProperty(r.prototype,"push",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._versionQueue.push(e),-1!==this._dataVersion&&this._execPulling()}}),Object.defineProperty(r.prototype,"_execPulling",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,n,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,r=e.data,this._pullingPromise=null,!t)return[2];if(void 0===(null==r?void 0:r.version)||r.version<this._dataVersion)throw new Error("".concat(this._name,": version error, please check: lastVersion: ").concat(this._dataVersion,", newVersion: ").concat(null==r?void 0:r.version));return n=r.version,i=r.hasNext,o=this._versionQueue.filter((function(e){return e>n})),this._versionQueue=l([],u(o),!1),this._dataVersion=n,i?[2,this._execPulling()]:this._versionQueue.length>0?(this._versionQueue.length=0,[2,this._execPulling()]):[2]}}))}))}}),Object.defineProperty(r.prototype,"startInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;this._started||(this._started=!0,t&&this._execPulling(),this._invervalTimer=setInterval((function(){return r._execPulling()}),e))}}),Object.defineProperty(r.prototype,"stopInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._started&&(this._started=!1,clearInterval(this._invervalTimer),this._invervalTimer=-1)}}),Object.defineProperty(r.prototype,"reset",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.stopInterval(),this._versionQueue.length=0,this._dataVersion=-1}}),r}(ur),cr=function(){function e(e,t){var r=this;Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_resolve",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_onCancel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._promise=new Promise((function(t){r._resolve=t,e(r._onResolve.bind(r))})),this._onCancel=t}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}(),dr=function(){function e(e,t,r){Object.defineProperty(this,"isOk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"msg",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.isOk=0===e,this.code=e,this.msg=t,this.data=r}return Object.defineProperty(e,"from",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n){return new e(t,r||"fail: ".concat(t),n)}}),Object.defineProperty(e,"ok",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return new e(0,r||"success",t)}}),Object.defineProperty(e,"fail",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n){return new e(t,r||"fail: ".concat(t),n)}}),Object.defineProperty(e.prototype,"next",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return 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?fr(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?fr(void 0,this.msg):_r(this.code,this.msg)}}),e}(),fr=dr.ok,_r=dr.fail,pr=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,r){return void 0===r&&(r=!1),this.isFailed&&(0===this._code||r)&&(this._code=e,this._errmsg=t||this._errmsg),this}}),Object.defineProperty(e.prototype,"setFailed",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._isValid=!1,this.fail(e,t)}}),Object.defineProperty(e.prototype,"result",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.isFailed&&0===this._code)throw new Error("Validator: result() should not be called without fail()");return this.isFailed?_r(this._code,this._errmsg):fr()}}),Object.defineProperty(e.prototype,"check",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.isFailed||e(this),this}}),Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){if(void 0===n&&(n=!1),this.isFailed)return this;var i=n?r(t):null==t||r(t);return this._isValid=i,this.isFailed&&(this._errmsg="param '".concat(e,"' is invalid")),this}}),Object.defineProperty(e.prototype,"assert",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){if(void 0===n&&(n=!1),this.isFailed)return this;if(this.validate(e,t,r,n),this.isFailed)throw ar.InvalidParameters("'".concat(e,"' at '").concat(this._apiName,"'"));return this}}),Object.defineProperty(e.prototype,"isString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(){return"string"==typeof t}),r)}}),Object.defineProperty(e.prototype,"assertString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(){return"string"==typeof t}),r)}}),Object.defineProperty(e.prototype,"isHttpUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.isNotEmptyString(e,t,r).validate(e,t,(function(e){return/^https?:\/\//.test(e)}))}}),Object.defineProperty(e.prototype,"isNotEmptyString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.isString(e,t,r).validate(e,t,(function(e){return e.trim().length>0}),r)}}),Object.defineProperty(e.prototype,"assertNotEmptyString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assertString(e,t,r),this.assert(e,t,(function(e){return e.trim().length>0}),r)}}),Object.defineProperty(e.prototype,"isLimitedString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.isString(e,t,i).validate(e,t,(function(e){return e.length>=r&&e.length<=n}),i)}}),Object.defineProperty(e.prototype,"assertLimitedString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.assertString(e,t,i),this.assert(e,t,(function(e){return e.length>=r&&e.length<=n}),i)}}),Object.defineProperty(e.prototype,"isBoolean",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"boolean"==typeof e}),r)}}),Object.defineProperty(e.prototype,"assertBoolean",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"boolean"==typeof e}),r)}}),Object.defineProperty(e.prototype,"isNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"number"==typeof e&&!Number.isNaN(e)}),r)}}),Object.defineProperty(e.prototype,"assertNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"number"==typeof e&&!Number.isNaN(e)}),r)}}),Object.defineProperty(e.prototype,"isLimitedNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.isNumber(e,t,i).validate(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"assertLimitedNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.assertNumber(e,t,i),this.assert(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"isInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return Number.isInteger(e)}),r)}}),Object.defineProperty(e.prototype,"assertInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return Number.isInteger(e)}),r)}}),Object.defineProperty(e.prototype,"isLimitedInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.isInteger(e,t,i).validate(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"isTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.isLimitedInteger(e,t,0,Number.MAX_SAFE_INTEGER,r)}}),Object.defineProperty(e.prototype,"assertLimitedInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.assertInteger(e,t,i),this.assert(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"isArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")}),r)}}),Object.defineProperty(e.prototype,"assertArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")}),r)}}),Object.defineProperty(e.prototype,"isLimitedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===n&&(n=!1),void 0===i&&(i=1),this.isArray(e,t,n).validate(e,t,(function(e){return e.length>=i&&e.length<=r}),n)}}),Object.defineProperty(e.prototype,"assertLimitedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===n&&(n=!1),void 0===i&&(i=1),this.assertArray(e,t,n),this.assert(e,t,(function(e){return e.length>=i&&e.length<=r}),n)}}),Object.defineProperty(e.prototype,"isTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.isArray(e,t,n).validate(e,t,(function(e){return e.every(r)}),n)}}),Object.defineProperty(e.prototype,"assertTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.assertArray(e,t,n),this.assert(e,t,(function(e){return e.every(r)}),n)}}),Object.defineProperty(e.prototype,"isLimitedTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){return void 0===i&&(i=!1),void 0===o&&(o=1),this.isLimitedArray(e,t,r,i,o).validate(e,t,(function(e){return e.every(n)}),i)}}),Object.defineProperty(e.prototype,"assertLimitedTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){return void 0===i&&(i=!1),void 0===o&&(o=1),this.assertLimitedArray(e,t,r,i,o),this.assert(e,t,(function(e){return e.every(n)}),i)}}),Object.defineProperty(e.prototype,"isObject",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"[object Object]"===Object.prototype.toString.call(e)}),r)}}),Object.defineProperty(e.prototype,"assertObject",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"[object Object]"===Object.prototype.toString.call(e)}),r)}}),Object.defineProperty(e.prototype,"isStringEnum",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.isString(e,t,n).validate(e,t,(function(e){return Object.values(r).includes(e)}),n)}}),Object.defineProperty(e.prototype,"isNumberEnum",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.isNumber(e,t,n).validate(e,t,(function(e){return Object.values(r).includes(e)}),n)}}),Object.defineProperty(e.prototype,"assertValueOf",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.assert(e,t,(function(){return Object.values(r).includes(t)}),n)}}),Object.defineProperty(e.prototype,"isFunction",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"function"==typeof e}),r)}}),Object.defineProperty(e.prototype,"assertFunction",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"function"==typeof e}),r)}}),e}(),hr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function gr(e){var t,r,n,i,o,a,s="",u=0;for(e=e.replace(/[^A-Za-z0-9+/=]/g,"");u<e.length;)t=hr.indexOf(e.charAt(u++))<<2|(i=hr.indexOf(e.charAt(u++)))>>4,r=(15&i)<<4|(o=hr.indexOf(e.charAt(u++)))>>2,n=(3&o)<<6|(a=hr.indexOf(e.charAt(u++))),s+=String.fromCharCode(t),64!==o&&(s+=String.fromCharCode(r)),64!==a&&(s+=String.fromCharCode(n));return s}var Er,br=function(){var e,t=new Promise((function(t){e=t}));return{resolve:e,promise:t}},Ir=1732584193,Tr=4023233417,vr=2562383102,Rr=271733878,mr=[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],yr=[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 Ar(e,t){return e<<t|e>>>32-t}function Or(e,t,r){return e&r|t&~r}function Sr(e,t,r){return e^t^r}function Cr(e,t,r){return t^(e|~r)}function Nr(e){for(var t=[],r=0;r<e.length;r+=4)t.push((e[r]||0)|(e[r+1]||0)<<8|(e[r+2]||0)<<16|(e[r+3]||0)<<24);return t}function Mr(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 Pr(e){var t=8*e.length,r=e.length%64<56?56-e.length%64:120-e.length%64,n=new Uint8Array(e.length+r+8);n.set(e),n[e.length]=128;for(var i=1;i<r;i++)n[e.length+i]=0;var o=new Uint8Array(8),a=4294967295&t,s=4294967295&Math.floor(t/4294967296);o.set(Mr(a),0),o.set(Mr(s),4),n.set(o,e.length+r);var u,l=Ir,c=Tr,d=vr,f=Rr;for(i=0;i<n.length;i+=64){for(var _=Nr(n.slice(i,i+64)),p=l,h=c,g=d,E=f,b=0;b<64;b++){var I=void 0,T=void 0;b<16?(I=(u=c)&d|~u&f,T=b):b<32?(I=Or(c,d,f),T=(5*b+1)%16):b<48?(I=Sr(c,d,f),T=(3*b+5)%16):(I=Cr(c,d,f),T=7*b%16);var v=f;f=d,d=c,c+=Ar(l+I+yr[b]+_[T]&4294967295,mr[b]),l=v}l=l+p&4294967295,c=c+h&4294967295,d=d+g&4294967295,f=f+E&4294967295}var R=new Uint8Array(16);return R.set(Mr(l),0),R.set(Mr(c),4),R.set(Mr(d),8),R.set(Mr(f),12),function(e){return Array.from(e).map((function(e){return e.toString(16).padStart(2,"0")})).join("")}(R)}function Lr(e){var t=function(e){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);var t=unescape(encodeURIComponent(e)).split("").map((function(e){return e.charCodeAt(0)}));return new Uint8Array(t)}(e);return Pr(t)}function wr(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||Be,n=e.headers,i=e.query,o=e.body,a=e.onProgress,s=Wt(e.url,i),u=new XMLHttpRequest;if(u.open(t,s),n&&u.setRequestHeader)for(var l in n)u.setRequestHeader(l,n[l]);return function(e,t,r,n){return new cr((function(i){e.onreadystatechange=function(){4===e.readyState&&i({data:e.responseText,status:e.status,xhr:e})},e.onerror=function(){i({status:e.status})},n&&(e.upload.onprogress=function(e){return n(e)}),0!==t&&setTimeout((function(){e.abort(),i({status:e.status})}),t),e.send(r)}),(function(t){e.abort(),t({status:-1})}))}(u,r,o,a)}!function(e){e[e.add=1]="add",e[e.update=2]="update",e[e.delete=3]="delete"}(Er||(Er={}));var Ur,Dr,xr={SUCCESS:0,UPDATING:1,FAILED:2},Gr={DEFAULT:0,MODIFIED:1,RECALLED:2,DELETE:3},Vr={TranslationLanguage:0,AutoTranslateEnable:1};exports.AreaCode=void 0,(Dr=exports.AreaCode||(exports.AreaCode={}))[Dr.BJ=1]="BJ",Dr[Dr.SG=2]="SG",Dr[Dr.NA=3]="NA",Dr[Dr.SG_A=4]="SG_A",Dr[Dr.SG_B=4]="SG_B",Dr[Dr.SA=5]="SA",Dr[Dr.OM=6]="OM";var jr=((Ur={})[exports.AreaCode.BJ]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5yb25nLWVkZ2UuY29t","bmF2LWIucm9uZy1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ucm9uZy1lZGdlLmNvbQ==",protocol:H.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnJvbmctZWRnZS5jb20=","d3MtYi5yb25nLWVkZ2UuY29t"],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWMtMS5vc3MtY24tYmVpamluZy5hbGl5dW5jcy5jb20="],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5yb25nLWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIucm9uZy1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5yb25nLWVkZ2UuY29t"]},Ur[exports.AreaCode.SG]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zZy1saWdodC1lZGdlLmNvbQ==","bmF2LWIuc2ctbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2ctbGlnaHQtZWRnZS5jb20=",protocol:H.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWxpZ2h0LWVkZ2UuY29t","d3MtYi5zZy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWItMi5zMy5hcC1zb3V0aGVhc3QtMS5hbWF6b25hd3MuY29t"],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIuc2ctbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1saWdodC1lZGdlLmNvbQ=="]},Ur[exports.AreaCode.NA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi51cy1saWdodC1lZGdlLmNvbQ==","bmF2LWIudXMtbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24udXMtbGlnaHQtZWRnZS5jb20=",protocol:H.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnVzLWxpZ2h0LWVkZ2UuY29t","d3MtYi51cy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC51cy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIudXMtbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy51cy1saWdodC1lZGdlLmNvbQ=="]},Ur[exports.AreaCode.SG_B]={naviUrlBase64:["bmF2LnNnLWItbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zZy1iLWxpZ2h0LWVkZ2UuY29t",protocol:H.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWItbGlnaHQtZWRnZS5jb20=","d3MtYi5zZy1iLWxpZ2h0LWVkZ2UuY29t"],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1iLWxpZ2h0LWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1iLWxpZ2h0LWVkZ2UuY29t"]},Ur[exports.AreaCode.SA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zYXUtbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2F1LWxpZ2h0LWVkZ2UuY29t",protocol:H.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNhdS1saWdodC1lZGdlLmNvbQ==","d3MtYi5zYXUtbGlnaHQtZWRnZS5jb20="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zYXUtbGlnaHQtZWRnZS5jb20=","Y2xvdWRjb250cm9sLWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zYXUtbGlnaHQtZWRnZS5jb20="]},Ur[exports.AreaCode.OM]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5vbS1saWdodC1lZGdlLmNvbQ==","bmF2LWIub20tbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ub20tbGlnaHQtZWRnZS5jb20=",protocol:H.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLm9tLWxpZ2h0LWVkZ2UuY29t","d3MtYi5vbS1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5vbS1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIub20tbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9kdWFsc3RhY2stc3RhdHMub20tbGlnaHQtZWRnZS5jb20="]},Ur);function kr(e){return exports.AreaCode[e]?e:exports.AreaCode.BJ}var Fr,Br=function(){function e(){Object.defineProperty(this,"initOption",{enumerable:!0,configurable:!0,writable:!0,value:{}})}return Object.defineProperty(e.prototype,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.initOption=e}}),Object.defineProperty(e.prototype,"getNaviUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n=this.initOption||{},i=n.areaCode,o=n.navigators,a=(r=i,void 0===r&&(r=exports.AreaCode.BJ),jr[kr(r)].naviUrlBase64).map((function(e){return gr(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 rr(e)}))}}),Object.defineProperty(e.prototype,"getLogUrlPolicyList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,i=e||{},o=i.log,a=i.logPolicy,s=this.initOption||{},c=s.areaCode,d=s.logServerUrl,f=(r=c,void 0===r&&(r=exports.AreaCode.BJ),jr[kr(r)].logUrlBase64).map((function(e){return n(n({},e),{addr:gr(e.addr)})})),_=[],p={level:1,itv:6,times:5};if(o)_.push.apply(_,l([],u(o.addrs),!1)),Object.assign(p,o.policy);else if(a)try{var h=JSON.parse(a);_.push({addr:h.url,protocol:H.HTTPS,weight:1}),p.level=h.level,p.itv=h.itv,p.times=h.times}catch(r){t.warn(B.L_REPORT_LOG_POLICY_E,JSON.stringify({policy:e.logPolicy}))}var g=d?l([{addr:d,protocol:H.HTTPS,weight:101}],u(_),!1):l(l([],u(_),!1),u(f),!1);return{policy:p,addrs:g.filter((function(e,t){return g.findIndex((function(t){return t.addr===e.addr&&t.protocol===e.protocol}))===t})).map((function(e){return n(n({},e),{addr:rr(e.addr,e.protocol)})})).sort((function(e,t){return t.weight-e.weight}))}}}),Object.defineProperty(e.prototype,"getMiniCmpUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t,r=(t=null===(e=this.initOption)||void 0===e?void 0:e.areaCode,void 0===t&&(t=exports.AreaCode.BJ),jr[kr(t)].miniCmpBase64).map((function(e){return gr(e)})),n=(this.initOption||{}).miniCMPProxy;return n&&n.length>0?n:r}}),Object.defineProperty(e.prototype,"getStaticConfigUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;return(t=null===(e=this.initOption)||void 0===e?void 0:e.areaCode,void 0===t&&(t=exports.AreaCode.BJ),jr[kr(t)].staticConfigUrlBase64).map((function(e){return gr(e)}))}}),Object.defineProperty(e.prototype,"getCloudControllerUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n=null!=e?e:null===(t=this.initOption)||void 0===t?void 0:t.areaCode;return(r=n,void 0===r&&(r=exports.AreaCode.BJ),jr[kr(r)].cloudControllerUrlBase64).map((function(e){return gr(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:exports.AreaCode.BJ}}),Object.defineProperty(e.prototype,"setAreaCode",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!(!e||!exports.AreaCode[e]||e===this.initOption.areaCode)&&(this.initOption.areaCode=e,!0)}}),Object.defineProperty(e.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n=e||{},i=n.active,o=n.activeServer,a=(null==i?void 0:i.addrs)||[],s=(r=null===(t=this.initOption)||void 0===t?void 0:t.areaCode,void 0===r&&(r=exports.AreaCode.BJ),jr[kr(r)].statsUrlBase64).map((function(e){return gr(e)})),c=[];return 0!==a.length?c.push.apply(c,l([],u(a.sort((function(e,t){return t.weight-e.weight})).map((function(e){return rr(e.addr,e.protocol)}))),!1)):o&&c.push(rr(o,H.HTTPS)),s.forEach((function(e){c.includes(e)||c.push(e)})),c}}),e}(),Hr=new Br,Yr=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,r,n,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]),r=JSON.parse(t),Date.now()-(null==r?void 0:r.time)<18e5?[4,this.decryptData(r.val)]:[3,3];case 2:return n=a.sent(),(i=n.resources.navi.slice()).sort((function(e,t){return t.weight-e.weight})),[2,{navi:i.map((function(e){return rr(e.addr,e.protocol)}))||[]}];case 3:return[3,5];case 4:return o=a.sent(),this.logger.error(B.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)!==Hr.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 rr(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,r,n,i,o,c,d,f,_,p;return a(this,(function(a){switch(a.label){case 0:e=(e=l(l([],u(this.staticUrls),!1),u(Hr.getStaticConfigUrl()),!1).map((function(e){return rr(e)}))).filter((function(t,r){return e.indexOf(t)===r})),a.label=1;case 1:a.trys.push([1,6,7,8]),t=s(e),r=t.next(),a.label=2;case 2:return r.done?[3,5]:(n=r.value,this.logger.info(B.L_GET_STATIC_CONF_T,JSON.stringify({url:n})),i=Date.now(),[4,this.sendRequest("".concat(n,"/").concat(this.appkey))]);case 3:if(o=a.sent(),c=o.code,d=o.data,200===c)return this.logger.info(B.L_GET_STATIC_CONF_R,JSON.stringify({url:n,code:c,duration:Date.now()-i})),[2,d];this.logger.warn(B.L_GET_STATIC_CONF_R,JSON.stringify({url:n,code:c,duration:Date.now()-i})),a.label=4;case 4:return r=t.next(),[3,2];case 5:return[3,8];case 6:return f=a.sent(),_={error:f},[3,8];case 7:try{r&&!r.done&&(p=t.return)&&p.call(t)}finally{if(_)throw _.error}return[7];case 8:return[2]}}))}))}}),e}();exports.LogL=void 0,(Fr=exports.LogL||(exports.LogL={}))[Fr.STATISTICS=-2]="STATISTICS",Fr[Fr.RECORD=-1]="RECORD",Fr[Fr.FATAL=0]="FATAL",Fr[Fr.ERROR=1]="ERROR",Fr[Fr.WARN=2]="WARN",Fr[Fr.INFO=3]="INFO",Fr[Fr.DEBUG=4]="DEBUG";var Wr,Jr,qr=function(){function e(e,t,r,n){Object.defineProperty(this,"_appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_id",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_type",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"proxy",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"outputLevel",{enumerable:!0,configurable:!0,writable:!0,value:exports.LogL.WARN}),Object.defineProperty(this,"debug",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.DEBUG)}),Object.defineProperty(this,"info",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.INFO)}),Object.defineProperty(this,"warn",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.WARN)}),Object.defineProperty(this,"error",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.ERROR)}),Object.defineProperty(this,"__statistics",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.STATISTICS)}),Object.defineProperty(this,"record",{enumerable:!0,configurable:!0,writable:!0,value:this.__statistics})}return Object.defineProperty(e.prototype,"_write",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.tag,r=e.level,n=e.content,i=e.traceId;/^[\w-]+$/.test(t)?r!==exports.LogL.DEBUG&&this.proxy.write(e):console.error("".concat((new Date).toISOString(),"[").concat(this._id,"]['ERROR']: ").concat(t," | ").concat(n," | ").concat(i))}}),Object.defineProperty(e.prototype,"createTraceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"".concat(++e._traceIdCount)}}),Object.defineProperty(e.prototype,"getSessionId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return pt}}),Object.defineProperty(e.prototype,"_stdout",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.time,r=e.tag,n=e.content,i=e.traceId,o=e.level,a=e.loggerId;if(console&&!(o<=exports.LogL.FATAL||o>this.outputLevel)){var s=["error","warn","info","debug"][o-1],u="".concat(new Date(t).toISOString(),"[").concat(null!=a?a:this._id,"][").concat((s||"stat").toUpperCase(),"]: ").concat(r," | ").concat(n," | ").concat(i);console[s||"warn"](u)}}}),Object.defineProperty(e.prototype,"setOutputLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){(function(e){return[exports.LogL.DEBUG,exports.LogL.INFO,exports.LogL.WARN,exports.LogL.ERROR].some((function(t){return t===e}))})(e)&&(this.outputLevel=e)}}),Object.defineProperty(e.prototype,"_log",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i={time:Date.now(),level:e,tag:t,content:r,traceId:n,loggerId:this._id,sessionId:this.getSessionId(),type:this._type};this._stdout(i),this._write(i)}}),Object.defineProperty(e.prototype,"summary",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i,o,a){if(void 0===i&&(i={}),t.isOk){var s=null==o?void 0:o(t.data);this.info(e,JSON.stringify(n(n({isOk:!0},i),s)),r)}else{s=null==a?void 0:a(t.data);this.warn(e,JSON.stringify(n(n({code:t.code,msg:t.msg},i),s)),r)}}}),Object.defineProperty(e,"_traceIdCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),e}(),Kr=function(){function e(e,t,r,n,i){void 0===i&&(i=!1),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"deviceInfo",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"disableLogReport",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"userId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"started",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"reportFailedNumber",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"itvByNavi",{enumerable:!0,configurable:!0,writable:!0,value:6}),Object.defineProperty(this,"timesByNavi",{enumerable:!0,configurable:!0,writable:!0,value:5})}return Object.defineProperty(e.prototype,"_getLogs",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,s){return o(this,void 0,void 0,(function(){var i,o;return a(this,(function(a){switch(a.label){case 0:i=[],a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.logDB.read(e,t,r,n,s)];case 2:return o=a.sent(),It(o.logs)&&(i=o.logs.filter((function(e){return!(!e||"object"!=typeof e)}))),[3,4];case 3:return a.sent(),[3,4];case 4:return[2,{logs:i}]}}))}))}}),Object.defineProperty(e.prototype,"checkStart",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i;return a(this,(function(o){return this.started?[2]:(this.userId=e.userId,!e.logSwitch||this.disableLogReport||(r=Hr.getLogUrlPolicyList(e,this.logger),n=r.policy,i=r.addrs,this.started=!0,this.itvByNavi=n.itv,this.timesByNavi=n.times,i.length>0&&this.realtimeReport(i[0].addr,n.level,n.itv,t)),[2])}))}))}}),Object.defineProperty(e.prototype,"_sendLogs2Realtime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return 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[4,this.compressLogs(e)];case 1:return i=a.sent(),o=i.success,s=i.data,o?(u=At(r)?r:"https://".concat(r),u+="?version=".concat("5.42.0","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.getDeviceId(),"&deviceInfo=").concat(this.deviceInfo,"&platform=Web"),[4,this.send({url:u,body:s,method:"POST"})]):[2,{isOk:!1,itv:n}];case 2:if(l=a.sent(),c=l.status,d=l.data,200!==c)return this.reportFailedNumber>this.timesByNavi&&this.itvByNavi<60&&(n+=n),this.reportFailedNumber++,[2,{isOk:!1,itv:n}];if(this.reportFailedNumber=0,d)try{(p=JSON.parse(d)).nextTime&&(n=p.nextTime),f=p.level,_=p.logSwitch}catch(e){this.logger.warn(B.L_PARSE_JSON_E,JSON.stringify({error:null==e?void 0:e.stack}),t)}return[2,{isOk:!0,itv:n,level:f,logSwitch:_}]}}))}))}}),Object.defineProperty(e.prototype,"realtimeReport",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,s,c,d,f,_,p,h,g,E=this;return a(this,(function(a){switch(a.label){case 0:return i=Date.now(),o=this.logger.getTimestamp4RealtimeLog()||ht,s=Math.max(i-3e4,o+1),c=this.logger.createTraceId(),[4,this._getLogs(o,s,t,!0,c,n)];case 1:return 0!==(d=a.sent().logs).length?[3,2]:[3,4];case 2:return d.length>0?[4,this._sendLogs2Realtime(d,c,e,r)]:[3,4];case 3:f=a.sent(),_=f.itv,p=f.level,h=f.logSwitch,f.isOk&&(g=Math.max.apply(Math,l([],u(d.map((function(e){return e.time}))),!1)),this.logger.setTimestamp4RealtimeLog(g+1),0===h&&(this.started=!1),void 0!==p&&(t=p)),r=_,a.label=4;case 4:return this.started&&(r>=60&&this.itvByNavi<60&&(r=60),this.timer=setTimeout((function(){return E.realtimeReport(e,t,r,n)}),1e3*r)),[2]}}))}))}}),Object.defineProperty(e.prototype,"report",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,s,u){return void 0===u&&(u=!1),o(this,void 0,void 0,(function(){var o,l,c,d,f,_,p,h;return a(this,(function(a){switch(a.label){case 0:return"web"!==r.toLowerCase()||this.disableLogReport?[2]:(o=this.logger.createTraceId(),this.logger.info(B.L_REPORT_FULL_LOG_T,JSON.stringify({startTime:e,endTime:t,logId:i,messageUId:s,isCloudControl:u}),o),[4,this._getLogs(e,t,exports.LogL.DEBUG,!1,o)]);case 1:return l=a.sent().logs,this.logger.info(B.L_REPORT_FULL_LOG_O,JSON.stringify({count:l.length}),o),c=At(n)?n:"https://".concat(n),c+="?version=".concat("5.42.0","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.getDeviceId(),"&deviceInfo=").concat(this.deviceInfo,"&platform=Web&logId=").concat(i),l.length>0?[4,this.compressLogs(l)]:[3,3];case 2:return f=a.sent(),_=f.success,p=f.data,d=_?p:"compress failed",[3,4];case 3:d="no data or no database",a.label=4;case 4:return this.logger.debug(B.L_REPORT_FULL_LOG_O,"compress done",o),u&&(c+="&source=cloud"),[4,this.send({url:c,body:d,method:"POST"})];case 5:return h=a.sent().status,this.logger.info(B.L_REPORT_FULL_LOG_R,JSON.stringify({status:h}),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}(),Qr=function(e){var t=e.sessionId,r=e.level,n=e.loggerId,i=e.traceId,o=e.time,a=e.tag,s=e.type,u=e.content;gt(u)||(u=JSON.stringify(u));var l=r<0?u||"":JSON.stringify({content:u,traceId:i,from:n});return l='"'.concat(l.replace(/"/g,'""'),'"'),"".concat(t,",").concat(o,",").concat(s,",").concat(r,",").concat(a,",").concat(l,"\n")};function Xr(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 Zr(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,{logs:[]}]}))}))}function zr(){}var $r=function(){function e(e,t){Wr.set(this,void 0),Jr.set(this,void 0),d(this,Wr,e,"f"),d(this,Jr,t,"f")}return Object.defineProperty(e.prototype,"read",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,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,Wr,"f").call(this,e,t,r,n,i)];case 1:return(o=a.sent())&&Array.isArray(o.logs)?[2,{logs:o.logs.filter(Xr)}]:[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,Jr,"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,Wr,e,"f"),this}}),Object.defineProperty(e.prototype,"setLogWriter",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"function"==typeof e&&d(this,Jr,e,"f"),this}}),e}();function en(){return new $r(Zr,zr)}Wr=new WeakMap,Jr=new WeakMap;var tn=function(){function e(){}var t,r,n,i,o,a;return Object.defineProperty(e,"start",{enumerable:!1,configurable:!0,writable:!0,value:function(e){c(this,t,"f",r)||(d(this,t,e,"f",r),e.info(B.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",r)&&(c(this,t,"f",r).info(B.L_EVENT_LOOP_BLOCKING_S,"stop"),d(this,t,null,"f",r),c(this,t,"f",n)&&(clearTimeout(c(this,t,"f",n)),d(this,t,null,"f",n)))}}),t=e,a=function e(){var a=this,s=Date.now();d(this,t,setTimeout((function(){var n=Date.now()-s;n>=c(a,t,"f",o)&&c(a,t,"f",r).warn(B.L_EVENT_LOOP_BLOCKING_S,"delta time: ".concat(n,"ms")),c(a,t,"m",e).call(a)}),c(this,t,"f",i)),"f",n)},r={value:null},n={value:null},i={value:30},o={value:1500},e}(),rn=1,nn=2,on=3,an=function(){function e(e){Object.defineProperty(this,"reporter",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"uploadTask",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"taskLock",{enumerable:!0,configurable:!0,writable:!0,value:!0})}return Object.defineProperty(e.prototype,"uploadLogCmdTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.uploadTask.push(e),this.enqueueTask()}}),Object.defineProperty(e.prototype,"reportLogCmdTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n,i,o=this;this.taskLock=!1;var a=null!==(t=e.startTime)&&void 0!==t?t:0,s=null!==(r=e.endTime)&&void 0!==r?r:0,u=null!==(n=e.platform)&&void 0!==n?n:"",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 sn,un,ln,cn,dn=function(){function e(e,t,r){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"reporter",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"isEable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"expire",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"interval",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"lastRequestTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"uploadTaskManage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"changeAreaCode",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_cache",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.uploadTaskManage=new an(r)}return Object.defineProperty(e.prototype,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(){try{var e=this.getLocalCloudControllerCache();this._cache=e?JSON.parse(e):{timestamp:0,lastRequestTime:0,cc:{temporary:!1,enable:!0,expire:72e5,interval:6e5},uploadLog:{temporary:!0,tasks:[]},mrtr:{chatroom:0,group:0,private:0,ultraGroup:0,temporary:!1}}}catch(e){this._cache={timestamp:0,lastRequestTime:0,cc:{temporary:!1,enable:!0,expire:72e5,interval:6e5},uploadLog:{temporary:!0,tasks:[]},mrtr:{chatroom:0,group:0,private:0,ultraGroup:0,temporary:!1}}}this._cache&&(this.interval=this._cache.cc.interval,this.expire=this._cache.cc.expire,this.timestamp=this._cache.timestamp||0,this.isEable=this._cache.cc.enable,this.lastRequestTime=this._cache.lastRequestTime,this.logCmdMsgTasks(this._cache),this.setMRTRConfig(this._handleMrtrData(this._cache.mrtr)))}}),Object.defineProperty(e.prototype,"isExire",{enumerable:!1,configurable:!0,writable:!0,value:function(){return(new Date).getTime()-this.timestamp<this.expire}}),Object.defineProperty(e.prototype,"isOverclock",{enumerable:!1,configurable:!0,writable:!0,value:function(){return(new Date).getTime()-this.lastRequestTime<this.interval}}),Object.defineProperty(e.prototype,"logCmdMsgTasks",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.uploadLog&&e.uploadLog.tasks.forEach((function(e){e.objectName===me.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,r){return o(this,void 0,void 0,(function(){var n,i,o,s,u,l,c,d,f,_;return a(this,(function(a){switch(a.label){case 0:return!this.isEable&&t===rn&&this.isExire()?(this.logger.info(B.L_CLOUD_DISABLED,JSON.stringify({msg:"cloud controller is disabled"})),[2,this.timestamp]):!this.isEable&&t===nn&&this.isOverclock()?(this.logger.info(B.L_CLOUD_OVERCLOCK,JSON.stringify({msg:"cloud controller is overclock"})),[2,this.timestamp]):(n=rr(e),this.lastRequestTime=(new Date).getTime(),i="".concat(n,"/v1/config"),o={"Content-Type":"application/json","RC-App-Key":this.appkey},r&&(o["RC-Token"]=r),s={platform:"web",version:"5.42.0",timestamp:this.timestamp},this.logger.record(Te.L_CLOUD_INFO_FETCH_T,JSON.stringify({appKey:this.appkey,timestamp:this.timestamp,token:!!r,uri:i})),[4,this.httpRequest(i,exports.HttpMethod.POST,o,s)]);case 1:return u=a.sent(),l=u.code,c=u.data,this.logger.record(Te.L_CLOUD_INFO_FETCH_R,JSON.stringify({appkey:this.appkey,info:c})),l===exports.ErrorCode.CLOUD_DATA_CENTER_INVALID&&c&&c.targetRegion?(d=c.targetRegion,this.changeAreaCode===d?[2,this.timestamp]:(f=Hr.setAreaCode(d),this.logger.info(B.L_CLOUD_SET_AREA_CODE_O,JSON.stringify({isChangeSuccess:f,originAreaCode:Hr.getAreaCode(),newAreaCode:d})),this.changeAreaCode=d,(_=Hr.getCloudControllerUrl(d))[0]?[2,this.request(_[0],on)]:(this.logger.info(B.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}(),fn=function(e){return e===exports.ErrorCode.RC_CONN_REDIRECTED},_n=function(e){function r(t,r,n){var i=e.call(this)||this;return sn.add(i),Object.defineProperty(i,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,"navi",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"logger",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"_fromSuspend",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(i,"token",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(i,"curCmpUrl",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(i,"retryCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"uuid",{enumerable:!0,configurable:!0,writable:!0,value:""}),cn.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:exports.RCConnectionStatus.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(r,e),Object.defineProperty(r.prototype,"getToken",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.token}}),Object.defineProperty(r.prototype,"cid",{get:function(){return"".concat(this.uuid,"_").concat(this.retryCount)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"getCurrentUserId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._crtUserId}}),Object.defineProperty(r.prototype,"setConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this._crtConnectionStatus!==e){if(this._crtConnectionStatus===exports.RCConnectionStatus.DISCONNECTED&&e===exports.RCConnectionStatus.CONNECTING&&(this._doConnectReason=Me.CONNECT,c(this,sn,"m",ln).call(this)),this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTED&&e===exports.RCConnectionStatus.SUSPENDED&&(t===exports.ErrorCode.RC_PING_EXCEED_LIMIT?this._doConnectReason=Me.TIMEOUT:t===exports.ErrorCode.RC_CONN_REDIRECTED?this._doConnectReason=Me.REDIRECTED:this._doConnectReason=Me.RECONNECT),this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTED){var r={bid:er(),cod:t,net:this.getNetwork().type,dur:Date.now()-c(this,cn,"f"),cid:this.cid};this.logger.record(Te.IM_CONNECTION_DURATION,JSON.stringify(r)),e===exports.RCConnectionStatus.SUSPENDED&&c(this,sn,"m",ln).call(this)}switch(this._crtConnectionStatus=e,e){case exports.RCConnectionStatus.CONNECTED:this.logger.info(B.L_CONNECT_S,"status: ".concat(e)),this.checkAlive(),c(this,sn,"m",un).call(this).emit("onConnected",this._fromSuspend);break;case exports.RCConnectionStatus.CONNECTING:this.logger.warn(B.L_CONNECT_S,"status: ".concat(e)),c(this,sn,"m",un).call(this).emit("onConnecting");break;case exports.RCConnectionStatus.SUSPENDED:this._fromSuspend=!0,this.logger.warn(B.L_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),fn(t)&&this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),c(this,sn,"m",un).call(this).emit("onSuspend",t);break;default:this._fromSuspend=!1,this._crtUserId="",this.logger.warn(B.L_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),c(this,sn,"m",un).call(this).emit("onDisconnected",t)}}}}),Object.defineProperty(r.prototype,"getConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._crtConnectionStatus}}),Object.defineProperty(r.prototype,"isConnected",{get:function(){return this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTED},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"setNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(!t){var r={cid:this.cid,cn:e.type,on:this._network.type};this.logger.record(Te.IM_NETWORK_CHANGE,JSON.stringify(r))}this._network=e}}),Object.defineProperty(r.prototype,"getNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._network}}),Object.defineProperty(r.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){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===exports.RCConnectionStatus.CONNECTED?[2,fr(this._crtUserId)]:this._crtConnectionTask?[2,this._crtConnectionTask]:(this._openCallPlus=r,this.token=e,this.setConnectionStatus(exports.RCConnectionStatus.CONNECTING),[4,this.try2Connect(e,t,!1,n,!0)]);case 1:return i=a.sent(),o=i.code,s=i.data,o!==exports.ErrorCode.SUCCESS?(this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,o),[2,_r(o)]):(this.setConnectionStatus(exports.RCConnectionStatus.CONNECTED),[2,fr(s)])}}))}))}}),Object.defineProperty(r.prototype,"try2Connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,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,r,n,i),[4,this._crtConnectionTask]);case 1:return o=a.sent(),this._crtConnectionTask=null,[2,o]}}))}))}}),Object.defineProperty(r.prototype,"createConnectionTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,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(Te.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,r,!1,n,s)];case 1:return u=a.sent(),l=u.code,c=u.data,l!==exports.ErrorCode.SUCCESS?[2,_r(l)]:1===(f=c).type?[2,_r(exports.ErrorCode.PACKAGE_ENVIRONMENT_ERROR)]:(this.logger.info(B.L_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),n),[4,this._connectWithToken(e.replace(/@.+$/,"@"),f,t,n)]);case 2:return _=a.sent(),p=_.code,h=_.data,i||p===exports.ErrorCode.SUCCESS||(this.retryCount+=1),fn(p)?(this.logger.warn(B.L_CONNECT_R,"redirect code: ".concat(p),n),this.clearCmpWeightCache(),[2,this.createConnectionTask(e,t,!0,n,i)]):[exports.ErrorCode.RC_TCP_RESET,exports.ErrorCode.RC_CONN_ACK_TIMEOUT,exports.ErrorCode.RC_TCP_DISCONNECTED_NO_RMTP,exports.ErrorCode.CONNECTION_REFUSED].includes(p)&&this.cmpWeightCache&&this.cmpWeightCache.length>1?(this.updateCmpWeight(this.curCmpUrl,!1),g=this.cmpWeightCache.every((function(e){return e.failed})),i&&g?(this.logger.warn(B.L_CONNECT_R,"cpp code:".concat(p,",reture code:").concat(exports.ErrorCode.SERVER_UNAVAILABLE),n),[2,_r(exports.ErrorCode.SERVER_UNAVAILABLE)]):(this.logger.warn(B.L_CONNECT_R,"cmp ack timeout, code: ".concat(p),n),this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,p),this.setConnectionStatus(exports.RCConnectionStatus.CONNECTING),[2,this.createConnectionTask(e,t,!1,n,i)])):p!==exports.ErrorCode.SUCCESS?(this.logger.warn(B.L_CONNECT_R,"code: ".concat(p),n),[2,_r(p)]):(this.logger.info(B.L_CONNECT_R,"userId: ".concat(h),n),d(this,cn,Date.now(),"f"),this._crtUserId=h,[2,fr(h)])}}))}))}}),Object.defineProperty(r.prototype,"try2Reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(s){return r=this.logger.createTraceId(),this.logger.debug(B.T,"try2Reconnect -> ignoreNaviCache: ".concat(e,", reason: ").concat(t),r),this.stopReconnectTimer(),n=function(){return o(i,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){switch(a.label){case 0:return this._crtConnectionStatus!==exports.RCConnectionStatus.SUSPENDED?[2]:(this.setConnectionStatus(exports.RCConnectionStatus.CONNECTING,t),[4,this.try2Connect(this.token,!0,e,r,!1)]);case 1:return i=a.sent(),o=i.code,s=i.isOk,this.reconnectTimer=null,s?(this.setConnectionStatus(exports.RCConnectionStatus.CONNECTED),[2]):[exports.ErrorCode.SERVER_UNAVAILABLE,exports.ErrorCode.TIMEOUT,exports.ErrorCode.RC_SOCKET_DISCONNECTED,exports.ErrorCode.RC_SOCKET_NOT_CREATED,exports.ErrorCode.RC_CONN_ACK_TIMEOUT,exports.ErrorCode.RC_TCP_RESET,exports.ErrorCode.RC_NAVI_REQ_FAILED,exports.ErrorCode.RC_NETWORK_DOWN,exports.ErrorCode.RC_TCP_DISCONNECTED_NO_RMTP].includes(o)?(this._crtConnectionStatus!==exports.RCConnectionStatus.CONNECTING||(this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,o),this.reconnectTimer=setTimeout(n,5e3)),[2]):(this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,o),[2])}}))}))},n(),[2]}))}))}}),Object.defineProperty(r.prototype,"onDisconnectByServer",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return fn(e)?(this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,e),void this.try2Reconnect(!0,e)):e===exports.ErrorCode.RC_UDP_DISCONNECTED?(this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,e),void setTimeout((function(){r.try2Reconnect(!0,e)}),1e3*(t||0))):void this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,e)}}),Object.defineProperty(r.prototype,"onDisconenctUnusual",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,e),this.try2Reconnect(!1,e)}}),Object.defineProperty(r.prototype,"checkAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return this._crtConnectionStatus!==exports.RCConnectionStatus.CONNECTED?(this._failedCount=0,this.logger.debug(B.L_CHECK_ALIVE_IM_S,"stop ping because of no connection"),[2]):(e=this.logger.createTraceId(),this.logger.debug(B.L_CHECK_ALIVE_IM_T,null,e),[4,this.sendPing(15e3)]);case 1:return(t=n.sent())===exports.ErrorCode.SUCCESS?(this.logger.debug(B.L_CHECK_ALIVE_IM_R,t,e),this._failedCount=0,this._checkAliveTimer=setTimeout((function(){return r.checkAlive()}),15e3),[2]):this._crtConnectionStatus!==exports.RCConnectionStatus.CONNECTED?[2]:(this._failedCount+=1,this.logger.debug(B.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(B.L_CHECK_ALIVE_IM_S,"ping timeout, close connection to reconnect!"),[4,this.close(!0)]));case 2:return n.sent(),this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,exports.ErrorCode.RC_PING_EXCEED_LIMIT),this.try2Reconnect(!1,exports.ErrorCode.RC_PING_EXCEED_LIMIT),[2]}}))}))}}),Object.defineProperty(r.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(r){switch(r.label){case 0:return this.stopReconnectTimer(),this._crtConnectionTask?[4,this._crtConnectionTask]:[3,2];case 1:r.sent(),r.label=2;case 2:return this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,exports.ErrorCode.ACTIVE_DISCONNECT),[2,this.close(!1,e,t)]}}))}))}}),Object.defineProperty(r.prototype,"stopReconnectTimer",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}}),Object.defineProperty(r.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 r=xt(e,t);return this.cmpWeightCache=l([],u(r),!1),l([],u(r),!1)}}),Object.defineProperty(r.prototype,"updateCmpWeight",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){if(this.cmpWeightCache){var n=this.cmpWeightCache.find((function(t){return r?t.addr===e&&t.protocol===H.QUIC:t.addr===e}));if(n)if(t){var i=Math.max.apply(Math,l([],u(this.cmpWeightCache.map((function(e){return e.weight}))),!1));n.weight!==i&&(n.weight=i+1)}else{var o=Math.min.apply(Math,l([],u(this.cmpWeightCache.map((function(e){return e.weight}))),!1));n.weight!==o&&(n.weight=o-1),n.failed=!0}}}}),Object.defineProperty(r.prototype,"clearCmpWeightCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.cmpWeightCache=void 0}}),Object.defineProperty(r.prototype,"reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){this.token=e,this._openCallPlus=r,this.onDisconenctUnusual(n)}}),r}(ur);cn=new WeakMap,sn=new WeakSet,un=function(){return this},ln=function(){this.uuid=_t.gen(),this.retryCount=0};var pn=function(e){return e.replace(/@.+$/,"@")},hn=function(){function e(e,t,r,n,i,o){void 0===n&&(n=!0),void 0===i&&(i=!0),void 0===o&&(o=!1),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"staticConfigManager",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"isRequestProfile",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"isUseDynamicNaviUrl",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"useNaviV2",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"crtRequest",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_environment",{enumerable:!0,configurable:!0,writable:!0,value:"default"})}return Object.defineProperty(e.prototype,"getCatchKey",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e+(this._environment?"-".concat(this._environment):"")}}),Object.defineProperty(e.prototype,"request",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return 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,r,n,i),[4,this.crtRequest]);case 1:return o=a.sent(),this.crtRequest=null,[2,o]}}))}))}}),Object.defineProperty(e.prototype,"sendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){var s;return o(this,void 0,void 0,(function(){var o,u,l,c,d,f,_,p,h,g,E,b,I,T,v,R,m;return a(this,(function(a){switch(a.label){case 0:return o=pn(e),u=this.getNaviCache(o),!t&&u&&(l=u.timestamp,c=u.naviInfo,r||Date.now()-l<Fe)?(this.logger.info(B.L_REQUEST_T,JSON.stringify({fromCache:!0,naviInfo:c}),n),i&&(d=i.uuid,f=i.retryCount,_=i.reason,p={bid:er(),ptc:Oe.NAVI,cod:exports.ErrorCode.SUCCESS,net:i.type,dur:0,spr:0,pr:null!==(s=c.type)&&void 0!==s?s:0,hos:"",cache:Se.LOCAL,v:Ce.CURRENT,rsn:_,cid:"".concat(d,"_").concat(f),count:f},this.logger.record(Te.IM_NAVI,JSON.stringify(p),n)),[2,fr(c)]):(h=Hr.getNaviUrlList(e,this.isUseDynamicNaviUrl),this.logger.info(B.L_GET_NAVI_T,JSON.stringify({token:e,uris:h}),n),[4,this.requestHandler(h,e,n,i)]);case 1:return g=a.sent(),E=g.code,b=g.data,E===exports.ErrorCode.RC_NAVI_REQ_FAILED&&this.isRequestProfile?[4,this.staticConfigManager.getStaticConfig()]:[3,4];case 2:return(null==(I=a.sent())?void 0:I.navi)&&(null==I?void 0:I.navi.length)>0?(T=I.navi,[4,this.requestHandler(T,e,n,i)]):[3,4];case 3:v=a.sent(),E=v.code,b=v.data,a.label=4;case 4:return E!==exports.ErrorCode.SUCCESS?(this.logger.warn(B.L_GET_NAVI_R,E,n),[2,_r(E)]):(R=b).code&&200!==R.code?(this.logger.warn(B.L_GET_NAVI_R,R.code,n),[2,_r(this.transHttpCode(R.code))]):xt(R).length>0?(this.logger.info(B.L_GET_NAVI_R,JSON.stringify({naviInfo:R}),n),this.setNaviCache(o,R),[2,fr(R)]):(m={server:R.server,backupServer:R.backupServer,serverAddr:R.serverAddr,bs:R.bs},this.logger.warn(B.L_GET_NAVI_R,"navi server address invalid: ".concat(JSON.stringify(m)),n),[2,_r(exports.ErrorCode.SERVER_UNAVAILABLE)])}}))}))}}),Object.defineProperty(e.prototype,"requestHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,s,u,l,c,d,f,_;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,r,s)]):[3,4];case 2:if(c=a.sent(),d=c.code,f=c.data,_={bid:er(),ptc:Oe.NAVI,cod:d,net:null==n?void 0:n.type,dur:Date.now()-l,spr:0,pr:(null==f?void 0:f.type)||0,hos:e[i],cache:Se.REQUEST,v:Ce.CURRENT,rsn:null==n?void 0:n.reason,cid:"".concat(null==n?void 0:n.uuid,"_").concat(null==n?void 0:n.retryCount),count:null==n?void 0:n.retryCount},this.logger.record(Te.IM_NAVI,JSON.stringify(_),r),[exports.ErrorCode.SUCCESS,exports.ErrorCode.RC_CONN_TOKEN_INCORRECT,exports.ErrorCode.RC_LICENSE_EXPIRED].includes(d))return[2,d===exports.ErrorCode.SUCCESS?fr(f):_r(d)];a.label=3;case 3:return i+=1,[3,1];case 4:return[2,_r(exports.ErrorCode.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 exports.ErrorCode.RC_CONN_TOKEN_INCORRECT;case 416:return exports.ErrorCode.RC_LICENSE_EXPIRED;default:return exports.ErrorCode.RC_NAVI_REQ_FAILED}}}),Object.defineProperty(e.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getNaviCache(pn(e));return t?t.naviInfo:null}}),Object.defineProperty(e.prototype,"updateVoipCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.getNaviInfoFromCache(e);r&&this.setNaviCache(pn(e),n(n({},r),{voipCallInfo:t}))}}),Object.defineProperty(e.prototype,"getNaviV2RequestOption",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=e.uri,n=e.token,i=e.platform,o=e.protocol,a=e.mac;t="".concat(r,"/v2/navi.json?cloud=").concat(0);var s="token=".concat(encodeURIComponent(n),"&v=").concat(Ye,"&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}(),gn=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 En(e){return gn.get(e)}function bn(e){return gn.has(e)}var In,Tn,vn,Rn={MECHANICAL:0,INTELLIGENT:1},mn=function(){function e(e,t,r,n){Object.defineProperty(this,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sourceLanguage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"targetLanguage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.identifier=e,this.sourceLanguage=t||"auto",this.targetLanguage=r,this.text=n}return Object.defineProperty(e.prototype,"isValid",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"string"==typeof this.identifier&&this.identifier.length>0&&"string"==typeof this.sourceLanguage&&(void 0===this.targetLanguage||"string"==typeof this.targetLanguage)&&(e?"string"==typeof this.text:void 0===this.text||"string"==typeof this.text)}}),Object.defineProperty(e.prototype,"toInnerParam",{enumerable:!1,configurable:!0,writable:!0,value:function(){return{identifier:this.identifier,sourceLanguage:this.sourceLanguage,targetLanguage:this.targetLanguage,content:this.text}}}),e}(),yn=function(e){function r(t,r,n,i){return e.call(this,t,r,n,i)||this}return t(r,e),r}(mn),An=function(e){function r(t,r,n){return e.call(this,Lr(t),r,n,t)||this}return t(r,e),r}(mn),On={NONE:0,TRANSLATING:1,SUCCESS:2,FAILED:3},Sn={DEFAULT:0,AUTO_ON:1,AUTO_OFF:2},Cn=function(){function e(){}return Object.defineProperty(e,"enable",{enumerable:!1,configurable:!0,writable:!0,value:function(){return!0}}),e}(),Nn=48,Mn=64,Pn=80,Ln=96,wn=112,Un="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Dn=function(e){for(var t={},r=0;r<e.length-1;r++){var n=e.charAt(r)+e.charAt(r+1);t.hasOwnProperty(n)?t[n].push(r):t[n]=[r]}for(var i=[],o=[],a=function(){if(o.length>0){var e=o.join("");if(o=[],e.length>26){var t=Gn(e.length),r=String.fromCharCode(Pn|t.length);i.push(r+t)}else{var n=String.fromCharCode(Ln|e.length);i.push(n)}i.push(e)}},s=0;s<e.length;){var u=xn(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=Gn(s-u.offset),c=Gn(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(Mn|l.length<<2|c.length);i.push(d+l+c),s+=u.length}}}a();var f=Gn(e.length),_=String.fromCharCode(Nn|f.length);return i.push(_+f),i.join("")},xn=function(e,t,r){var n={length:0,offset:-1};if(t.length,r>=t.length-1)return n;var i=e[t.charAt(r)+t.charAt(r+1)];if(i[0]===r)return n;for(var o=t.length-r,a=0,s=i.length;a<s;a++){var u=i[a],l=r-u;if(!(l>238327)){var c=Math.min(o,l);if(c<=n.length)break;if(!(n.length>2&&t.charAt(u+n.length-1)!==t.charAt(r+n.length-1))){for(var d=2,f=d;f<c&&t.charAt(u+f)===t.charAt(r+f);f++)d++;d>=n.length&&(n.length=d,n.offset=u)}}}return n},Gn=function(e){var t=[],r=0;do{r=e%62,t.push(Un.charAt(r)),e=(e-r)/62}while(e>0);return t.join("")},Vn=function(e){for(var t=0,r=0,n=e.length-1;n>=0;n--){if(-1===(r=Un.indexOf(e.charAt(n))))throw new Error('decode number error, data is "'+e+'"');t=62*t+r}return t},jn=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],r=0,n=t.length;r<n;r++)if(!e[t[r]])return!1;return!0}(uni))},kn=function(e){return["setItem","getItem","removeItem"].forEach((function(t){var r=e[t];e[t]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return r.apply(e,t)}catch(e){null===console||void 0===console||console.error(e)}}})),e},Fn=function(){function e(e){In.add(this),Tn.set(this,void 0),Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),d(this,Tn,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,In,"m",vn).call(this,e,c(this,Tn,"f"))]}))}))}}),e}();Tn=new WeakMap,In=new WeakSet,vn=function e(t,r){return o(this,void 0,void 0,(function(){var n,i,s,u=this;return a(this,(function(l){switch(l.label){case 0:return 0===t.length?[2,_r(exports.ErrorCode.STREAM_MESSAGE_REQUEST_FAIL,"All addrs failed")]:(n=t.shift(),i=rr(n.addr,n.protocol),i="".concat(i,"/v3/message/get_stream.json?sdkVersion=").concat("5.42.0","&platform=Websocket&messageUID=").concat(r.msgUId),this._logger.info(B.L_REQ_STREAM_MSG_CONTENT_O,"try open -> ".concat(i)),[4,this._openHandler(i,r)]);case 1:return[2,(s=l.sent()).or((function(n){return o(u,void 0,void 0,(function(){return a(this,(function(i){return-1===n?[2,c(this,In,"m",e).call(this,t,r)]:[2,s]}))}))}))]}}))}))};var Bn=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"_openHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,s,u,l,c=this;return a(this,(function(a){return r=br(),n=r.resolve,i=r.promise,o=new XMLHttpRequest,s=!1,u=null,l=function(e){s||(s=!0,u&&(clearTimeout(u),u=null),e.isOk||(c._logger.warn(B.L_REQ_STREAM_MSG_CONTENT_E,"req fail -> code: ".concat(e.code)),o.abort()),n(e))},u=setTimeout((function(){return l(_r(-1,"timeout"))}),t.timeout),o.onerror=function(e){return l(_r(-1,"network error"))},o.onreadystatechange=function(r){if(o.readyState===XMLHttpRequest.HEADERS_RECEIVED){var n=o.getResponseHeader("Content-Type"),i=null==n?void 0:n.startsWith("text/event-stream");if(200===o.status&&i){l(fr());var a=0;o.onprogress=function(e){var r=o.response.slice(a);a=o.response.length,t.onRawContent(r)},o.onerror=function(r){c._logger.warn(B.L_REQ_STREAM_MSG_CONTENT_E,"network error in transit -> ".concat(e)),o.onprogress=null,o.abort(),t.onNetworkError(exports.ErrorCode.STREAM_MESSAGE_REQUEST_FAIL)}}else o.onloadend=function(){var e=JSON.parse(o.response);l(_r(e.code,e.message))}}},o.open("GET",e,!0),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]}))}))}}),r}(Fn),Hn=jn();var Yn=null,Wn=function(e){return o(void 0,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return[4,qn.getNetworkType()];case 1:return t=r.sent(),Yn({status:"online"===e.type,type:t}),[2]}}))}))};var Jn,qn={tag:"browser",httpReq:function(e){return wr(e).result()},get localStorage(){return localStorage},get sessionStorage(){return sessionStorage},useNavi:!0,connectPlatform:"",isFromUniapp:Hn,createWebSocket:function(e,t){var r=new WebSocket(e,t);return r.binaryType="arraybuffer",Promise.resolve(fr({id:Date.now(),onClose:function(e){r.onclose=function(t){var r=t.code,n=t.reason;e(r,n)}},onError:function(e){r.onerror=e},onMessage:function(e){r.onmessage=function(t){e(t.data)}},onOpen:function(e){r.onopen=e},send:function(e){r.send(e)},close:function(e,t){r.close()}}))},getNetworkType:function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection||{effectiveType:Ue.UNKONWN},t=e.type,r=e.effectiveType,n=t||r||Ue.UNKONWN;return Promise.resolve(n)},setNetworkStatusListener:function(e){Yn=e,"undefined"!=typeof window&&window&&(window.addEventListener("offline",Wn),window.addEventListener("online",Wn))},removeNetworkStatusListener:function(){"undefined"!=typeof window&&window&&(window.removeEventListener("offline",Wn),window.removeEventListener("online",Wn)),Yn=null},createSSEClient:function(e){return fr(new Bn(e))},getApiVer:function(){var e=qn.runtimeInfo,t=e.type,r=e.version;return"".concat("browser","|").concat(t,"|").concat(r)},get runtimeInfo(){var e,t,r=navigator.userAgent,n={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 n)if(n.hasOwnProperty(i)){var o=r.match(n[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.qryRLBatch=31]="qryRLBatch",e[e.chatMsgS=32]="chatMsgS",e[e.qrySessionsAtt=33]="qrySessionsAtt",e[e.pullMsg=34]="pullMsg",e[e.qrySessions=35]="qrySessions",e[e.delSessions=36]="delSessions",e[e.delMsg=37]="delMsg",e[e.delUgMsg=38]="delUgMsg",e[e.delUgSe=39]="delUgSe",e[e.updRRTime=40]="updRRTime",e[e.qrySessionsUnread=41]="qrySessionsUnread",e[e.setTypeUnpush=42]="setTypeUnpush",e[e.chrmPull=43]="chrmPull",e[e.joinChrm=44]="joinChrm",e[e.joinChrmR=45]="joinChrmR",e[e.exitChrm=46]="exitChrm",e[e.queryChrmI=47]="queryChrmI",e[e.setKV=48]="setKV",e[e.delKV=49]="delKV",e[e.setKVS=50]="setKVS",e[e.delKVS=51]="delKVS",e[e.pullKV=52]="pullKV",e[e.qryRelation=53]="qryRelation",e[e.qryRelationR=54]="qryRelationR",e[e.qryRelationFilter=55]="qryRelationFilter",e[e.delRelation=56]="delRelation",e[e.delRelationBatch=57]="delRelationBatch",e[e.pullSe=58]="pullSe",e[e.pullSeAtts=59]="pullSeAtts",e[e.setSeAtt=60]="setSeAtt",e[e.qnTkn=61]="qnTkn",e[e.qnUrl=62]="qnUrl",e[e.aliUrl=63]="aliUrl",e[e.s3Url=64]="s3Url",e[e.stcUrl=65]="stcUrl",e[e.minioUrl=66]="minioUrl",e[e.cleanPMsg=67]="cleanPMsg",e[e.cleanGMsg=68]="cleanGMsg",e[e.cleanCMsg=69]="cleanCMsg",e[e.cleanSMsg=70]="cleanSMsg",e[e.cleanMCMsg=71]="cleanMCMsg",e[e.cleanMPMsg=72]="cleanMPMsg",e[e.cleanMsgBatch=73]="cleanMsgBatch",e[e.rtcPing=74]="rtcPing",e[e.rtc_ntf=75]="rtc_ntf",e[e.rtcSetOutData=76]="rtcSetOutData",e[e.rtcQryUserOutData=77]="rtcQryUserOutData",e[e.addSeTag=78]="addSeTag",e[e.delSeTag=79]="delSeTag",e[e.addTag=80]="addTag",e[e.delTag=81]="delTag",e[e.reportsdk=82]="reportsdk",e[e.pullUgSes=83]="pullUgSes",e[e.pullUgMsg=84]="pullUgMsg",e[e.ugMsg=85]="ugMsg",e[e.qryUgMsg=86]="qryUgMsg",e[e.updUgRTime=87]="updUgRTime",e[e.upMsgEx=88]="upMsgEx",e[e.modifyMsg=89]="modifyMsg",e[e.qryMsgChange=90]="qryMsgChange",e[e.qryMsg=91]="qryMsg",e[e.operate=92]="operate",e[e.s_opNtf=93]="s_opNtf",e[e.ugUnpushQuery=94]="ugUnpushQuery",e[e.ugUnpushSet=95]="ugUnpushSet",e[e.setRtcRoomId=96]="setRtcRoomId",e[e.qryUgUal=97]="qryUgUal",e[e.updUserSub=98]="updUserSub",e[e.pullUserSub=99]="pullUserSub",e[e.pullSubData=100]="pullSubData",e[e.qrySubData=101]="qrySubData",e[e.pullUserProfile=102]="pullUserProfile",e[e.pullOwnProfile=103]="pullOwnProfile",e[e.updProfilePermiss=104]="updProfilePermiss",e[e.qProfilePermiss=105]="qProfilePermiss",e[e.searchUserProfile=106]="searchUserProfile",e[e.updUserProfile=107]="updUserProfile",e[e.pullEventChange=108]="pullEventChange",e[e.channelCreate=109]="channelCreate",e[e.upChannelInfo=110]="upChannelInfo",e[e.qChannelInfo=111]="qChannelInfo",e[e.channelMemKick=112]="channelMemKick",e[e.channelMemQuit=113]="channelMemQuit",e[e.channelDismiss=114]="channelDismiss",e[e.channelTransfer=115]="channelTransfer",e[e.upChannelManager=116]="upChannelManager",e[e.qChannelMem=117]="qChannelMem",e[e.qChannelSpeMem=118]="qChannelSpeMem",e[e.upChannelMem=119]="upChannelMem",e[e.channelMemJoin=120]="channelMemJoin",e[e.channelMemInvite=121]="channelMemInvite",e[e.channelApplyResp=122]="channelApplyResp",e[e.qChannelApplyList=123]="qChannelApplyList",e[e.qChannelMemJoin=124]="qChannelMemJoin",e[e.qChannelMemSpeJoin=125]="qChannelMemSpeJoin",e[e.upChannelRemark=126]="upChannelRemark",e[e.qChannelRemark=127]="qChannelRemark",e[e.upChannelFollow=128]="upChannelFollow",e[e.qChannelFollow=129]="qChannelFollow",e[e.qSimpleUserProfile=130]="qSimpleUserProfile",e[e.friendAdd=131]="friendAdd",e[e.friendDel=132]="friendDel",e[e.friendHandle=133]="friendHandle",e[e.friendSetPf=134]="friendSetPf",e[e.friendCheck=135]="friendCheck",e[e.friendsQuery=136]="friendsQuery",e[e.friendApplyDel=137]="friendApplyDel",e[e.friendsInfoQry=138]="friendsInfoQry",e[e.friendAuthSet=139]="friendAuthSet",e[e.friendAuthGet=140]="friendAuthGet",e[e.addUnpush=141]="addUnpush",e[e.qryUnpush=142]="qryUnpush",e[e.delUnpush=143]="delUnpush",e[e.s_pubCall=144]="s_pubCall",e[e.reqCall=145]="reqCall",e[e.pullKvMsg=146]="pullKvMsg",e[e.readReceipt=147]="readReceipt",e[e.qryReceipt=148]="qryReceipt",e[e.qryReceiptBatch=149]="qryReceiptBatch",e[e.upConvertMsg=150]="upConvertMsg",e[e.pullModifyMsg=151]="pullModifyMsg",e[e.qAppBot=152]="qAppBot",e[e.qBot=153]="qBot",e[e.addPReaction=154]="addPReaction",e[e.rmPReaction=155]="rmPReaction",e[e.addGReaction=156]="addGReaction",e[e.rmGReaction=157]="rmGReaction",e[e.addUgReaction=158]="addUgReaction",e[e.rmUgReaction=159]="rmUgReaction",e[e.mReactBQ=160]="mReactBQ",e[e.ugMReactBQ=161]="ugMReactBQ",e[e.mReactQ=162]="mReactQ",e[e.ugMReactQ=163]="ugMReactQ",e[e.mReactUQ=164]="mReactUQ",e[e.ugMReactUQ=165]="ugMReactUQ"}(Jn||(Jn={}));var Kn=function(e){var t=Jn[e];return t},Qn=function(e){return Jn[e]},Xn=0,Zn=1,zn=2,$n=3,ei=4,ti=5,ri=6,ni=7,ii=12,oi=13,ai=14,si=4,ui=3,li="rtcRJoin_data",ci="rtcRExit",di="rtcUPut",fi="rtcUDel",_i="rtcSetData",pi="userSetData",hi="rtcQryData",gi="rtcDelData",Ei="rtcToken",bi="rtcUserState",Ii="rtcUList",Ti="viewerJoinR",vi="viewerExitR",Ri="rtcIdentityChange",mi="rtcInvite",yi="rtcCancelInvite",Ai="rtcInviteAnswer",Oi="rtcEndInvite",Si="rtcQueryJoined",Ci=0,Ni=1,Mi=2,Pi=3,Li=4,wi=5,Ui=6,Di=7,xi=8,Gi=9,Vi=10,ji=11,ki=12,Fi=13,Bi=14,Hi=15,Yi=16,Wi=17,Ji=18,qi=19,Ki=20,Qi=1,Xi=2,Zi=4,zi=5,$i=6,eo=7,to=8,ro=9,no=function(){function e(){}return Object.defineProperty(e,"writeUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=this._getBackAndByteSize(e),r=t.back,n=t.byteSize,i=0,o=r.length;i<o;i++)r[i]>255&&(r[i]&=255);return n<=255?[0,n].concat(r):[n>>8,255&n].concat(r)}}),Object.defineProperty(e,"_getBackAndByteSize",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=[],r=0;if("string"==typeof e)for(var n=0,i=e.length;n<i;n++){var o=e.charCodeAt(n);o>=0&&o<=127?(r+=1,t.push(o)):o>=128&&o<=2047?(r+=2,t.push(192|31&o>>6),t.push(128|63&o)):o>=2048&&o<=65535&&(r+=3,t.push(224|15&o>>12),t.push(128|63&o>>6),t.push(128|63&o))}return{byteSize:r,back:t}}}),Object.defineProperty(e,"readUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t,r,n=[],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?n.push(s):(t=(s-=65536)>>10|55296,r=s%1024|56320,n.push(t,r)),(i+1===o.length||n.length>16384)&&(a+=String.fromCharCode.apply(null,n),n.length=0)}return a}}),e}(),io=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="",r=0;r<2;r++){var n=e._pool[e._position++].toString(16);1===n.length&&(n="0".concat(n)),t+=n.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="",r=0;r<8;r++){var n=e._pool[e._position++].toString(16);1===n.length&&(n="0".concat(n)),t+=n}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 r=this._pool.subarray(t,this._position);return no.readUTF(r)}}),Object.defineProperty(e.prototype,"readAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._pool.subarray(this._position,this._poolLen)}}),e}(),oo=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=no.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}(),ao=function(){function e(e,t,r,n){void 0===t&&(t=Zn),void 0===r&&(r=!1),void 0===n&&(n=!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:r}),Object.defineProperty(this,"dup",{enumerable:!0,configurable:!0,writable:!0,value:n})}return Object.defineProperty(e,"parse",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return new e(t>>4,(6&t)>>1,!(1&~t),(8&t)>0)}}),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}(),so=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,r){this.readMessage(e,t,r)}}),Object.defineProperty(e.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return{stream:e,length:t}}}),e}(),uo=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 ao(e,Xn)}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 oo;this.write(e);var t=e.getBytesArray();return new Int8Array(t).buffer}}),e}(),lo=function(e){function r(){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(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){if(e.readByte(),this.status=e.readByte(),t<=r.MESSAGE_LENGTH)return{stream:e,length:t};if(n===si){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(r,"MESSAGE_LENGTH",{enumerable:!0,configurable:!0,writable:!0,value:2}),r}(so),co=function(e){function r(t){var r=e.call(this,ai)||this;return Object.defineProperty(r,"status",{enumerable:!0,configurable:!0,writable:!0,value:t}),r}return t(r,e),Object.defineProperty(r.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e.writeArr([0,this.status])}}),r}(uo),fo=function(e){function r(){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(r,e),Object.defineProperty(r.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(r,"MESSAGE_LENGTH",{enumerable:!0,configurable:!0,writable:!0,value:2}),r}(so),_o=function(e){function r(){return e.call(this,ii)||this}return t(r,e),Object.defineProperty(r.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){}}),r}(uo),po=function(e){function r(t){return e.call(this,t)||this}return t(r,e),r}(so),ho=function(e){function r(){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(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=256*e.readByte()+e.readByte();return this.messageId=parseInt(r.toString(),10),{stream:e,length:t}}}),r}(so),go=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.messageId,r=255&t,n=(65280&t)>>8;e.writeByte(n),e.writeByte(r)}}),r}(uo),Eo=function(e){function r(t){var r=e.call(this,t)||this;return Object.defineProperty(r,"topic",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(r,"pbData",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"targetId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(r,"date",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(r,"syncMsg",{enumerable:!0,configurable:!0,writable:!0,value:!1}),r.syncMsg=t.dup,r}return t(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return this.date=t.readInt32(),this.topic=t.readUTF(),this.targetId=t.readUTF(),e.prototype.readMessage.call(this,t,r),this.pbData=t.readAll(),{stream:t,length:r}}}),r}(ho),bo=function(e){function r(t,r,n,i){var o=e.call(this,t)||this;return Object.defineProperty(o,"targetId",{enumerable:!0,configurable:!0,writable:!0,value:n}),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 r?r:Qn(r),o}return t(r,e),Object.defineProperty(r.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)}}),r}(go),Io=function(e){function r(t,r,n){return e.call(this,ti,t,n,r)||this}return t(r,e),r}(bo),To=function(e){function r(t,r,n){return e.call(this,$n,t,n,r)||this}return t(r,e),r}(bo),vo=function(e){function r(){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(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return e.prototype.readMessage.call(this,t,r),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:r}}}),r}(ho),Ro=function(e){function r(t){var r=e.call(this,ei)||this;return r.messageId=t,r}return t(r,e),r}(go),mo=function(e){function r(t){var r=e.call(this,ni)||this;return r.messageId=t,r}return t(r,e),r}(go),yo=function(e){function r(){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(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return e.prototype.readMessage.call(this,t,r),this.date=t.readInt32(),this.status=256*t.readByte()+t.readByte(),this.pbData=t.readAll(),{stream:t,length:r}}}),r}(ho),Ao=function(e,t){var r=new Uint8Array(e),n=new io(r),i=n.readByte(),o=function(e){var t,r=e.command;switch(r){case zn:t=new lo(e);break;case $n:t=new Eo(e);break;case ei:t=new vo(e);break;case ri:t=new yo(e);break;case oi:t=new po(e);break;case ai:t=new fo(e);break;default:console.error("No support for deserializing ".concat(r," messages"))}return t}(ao.parse(i));return o&&o.read(n,r.length-1,t),o},Oo=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"_openHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=br(),n=r.resolve,i=r.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")))n(fr());else{var r=JSON.parse(e.data),i=r.code,o=r.message;n(_r(i,o))}},fail:function(t){var r=t.errMsg,i=t.errno;o.warn(B.L_REQ_STREAM_MSG_CONTENT_E,JSON.stringify({url:e,errMsg:r,errno:i})),n(_r(-1,t.errMsg))},complete:function(){o.debug(B.L_REQ_STREAM_MSG_CONTENT_O,"req complete -> ".concat(e))}});return a.onChunkReceived((function(e){var r=no.readUTF(new Uint8Array(e.data));o.debug(B.L_REQ_STREAM_MSG_CONTENT_O,"chunk received -> ".concat(r)),t.onRawContent(r)})),i}}),r}(Fn),So=jn(),Co=kn({setItem:function(e,t){wx.setStorage({key:e,data:t})},getItem:function(e){return wx.getStorageSync(e)},removeItem:function(e){wx.removeStorage({key:e})}}),No=null,Mo=function(e){var t=e.isConnected,r=e.networkType;No({status:t,type:r})};var Po={tag:"wechat",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||Be,n=e.headers,i=e.query,o=e.body,a=Wt(e.url,i);return new Promise((function(e){wx.request({url:a,method:t,header:n,timeout:r,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:Co,sessionStorage:Co,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:So,createWebSocket:function(e,t){var r=wx.connectSocket({url:e,protocols:t});return Promise.resolve(fr({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),r.close()}))},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){wx.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(Ue.UNKONWN)}})}))},setNetworkStatusListener:function(e){No=e,wx.onNetworkStatusChange(Mo)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(Mo),No=null},createSSEClient:function(e){return fr(new Oo(e))},get runtimeInfo(){return{type:Po.tag,version:"Unknown"}}},Lo=jn(),wo=kn({setItem:function(e,t){my.setStorage({key:e,data:t})},getItem:function(e){return my.getStorageSync({key:e}).data},removeItem:function(e){my.removeStorage({key:e})}}),Uo=null,Do=function(e){var t=e.isConnected,r=e.networkType;Uo({status:t,type:r})};var xo={tag:"alipay",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||Be,n=e.headers,i=e.query,o=e.body,a=Wt(e.url,i),s=e.dataType||"json";return new Promise((function(e){my.request({url:a,method:t,headers:n,timeout:r,data:o,dataType:s,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:wo,sessionStorage:wo,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Lo,createWebSocket:function(e){var t=my.connectSocket({url:e,multiple:!0});return Promise.resolve(fr({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 r=t.networkType;e(r)},fail:function(){e(Ue.UNKONWN)}})}))},setNetworkStatusListener:function(e){Uo=e,my.onNetworkStatusChange(Do)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(Do),Uo=null},createSSEClient:function(e){return _r(exports.ErrorCode.NOT_SUPPORT,"Not supported yet")},get runtimeInfo(){return{type:xo.tag,version:"Unknown"}}},Go=jn(),Vo=kn({setItem:function(e,t){tt.setStorage({key:e,data:t})},getItem:function(e){return tt.getStorageSync(e)},removeItem:function(e){tt.removeStorage({key:e})}}),jo=null,ko=function(e){var t=e.isConnected,r=e.networkType;jo({status:t,type:r})};var Fo={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Go,localStorage:Vo,sessionStorage:Vo,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 r=(null==e?void 0:e.data)||{},n={data:JSON.stringify(r),status:e.statusCode};t(n)},fail:function(e){t({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){return new Promise((function(r){var n=tt.connectSocket({url:e,protocols:t,fail:function(e){return r(_r(exports.ErrorCode.RC_SOCKET_DISCONNECTED,e.errMsg))}});r(fr({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){n.close(),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 r=t.networkType;e(r)},fail:function(){e(Ue.UNKONWN)}})}))},setNetworkStatusListener:function(e){jo=e,tt.onNetworkStatusChange(ko)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(ko),jo=null},createSSEClient:function(e){return _r(exports.ErrorCode.NOT_SUPPORT)},get runtimeInfo(){return{type:Fo.tag,version:"Unknown"}}},Bo=jn(),Ho=kn({setItem:function(e,t){swan.setStorage({key:e,data:t})},getItem:function(e){return swan.getStorageSync(e)},removeItem:function(e){swan.removeStorage({key:e})}}),Yo=null,Wo=function(e){var t=e.isConnected,r=e.networkType;Yo({status:t,type:r})};var Jo={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Bo,localStorage:Ho,sessionStorage:Ho,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 r=(null==e?void 0:e.data)||{},n={data:JSON.stringify(r),status:e.statusCode};t(n)},fail:function(e){t({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var r=swan.connectSocket({url:e,protocols:t});return Promise.resolve(fr({id:Date.now(),onOpen:function(e){r.onOpen(e)},onClose:function(e){r.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){r.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){r.onMessage((function(t){return e(t.data)}))},send:function(e){r.send({data:e})},close:function(e,t){r.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 r=t.networkType;e(r)},fail:function(){e(Ue.UNKONWN)}})}))]}))}))},setNetworkStatusListener:function(e){Yo=e,swan.onNetworkStatusChange(Wo)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(Wo),Yo=null},createSSEClient:function(e){return _r(exports.ErrorCode.NOT_SUPPORT)},get runtimeInfo(){return{type:Jo.tag,version:"Unknown"}}},qo=jn(),Ko=kn({setItem:function(e,t){jd.setStorage({key:e,data:t})},getItem:function(e){return jd.getStorageSync(e)},removeItem:function(e){jd.removeStorage({key:e})}}),Qo=null,Xo=function(e){var t=e.isConnected,r=e.networkType;Qo({status:t,type:r})};var Zo={tag:"jingdong",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||Be,n=e.headers,i=e.query,o=e.body,a=Wt(e.url,i);return new Promise((function(e){jd.request({url:a,method:t,header:n,timeout:r,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:Ko,sessionStorage:Ko,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:qo,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),Promise.resolve(fr({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 r=t.networkType;e(r)},fail:function(){e(Ue.UNKONWN)}})}))},setNetworkStatusListener:function(e){Qo=e,jd.onNetworkStatusChange(Xo)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(Xo),Qo=null},createSSEClient:function(e){return _r(exports.ErrorCode.NOT_SUPPORT)},get runtimeInfo(){return{type:Zo.tag,version:"Unknown"}}},zo=jn(),$o=kn({setItem:function(e,t){ks.setStorage({key:e,data:t})},getItem:function(e){return ks.getStorageSync(e)},removeItem:function(e){ks.removeStorage({key:e})}}),ea=null,ta=function(e){var t=e.isConnected,r=e.networkType;ea({status:t,type:r})};var ra={tag:"kuaishou",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:zo,localStorage:$o,sessionStorage:$o,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 r=(null==e?void 0:e.data)||{},n={data:JSON.stringify(r),status:e.statusCode};t(n)},fail:function(e){t({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var r=ks.connectSocket({url:e,protocols:t});return Promise.resolve(fr({id:Date.now(),onOpen:function(e){r.onOpen(e)},onClose:function(e){r.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){r.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){r.onMessage((function(t){return e(t.data)}))},send:function(e){r.send({data:e})},close:function(e,t){r.close({code:e,reason:t})}}))},getNetworkType:function(){return new Promise((function(e){ks.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(Ue.UNKONWN)}})}))},setNetworkStatusListener:function(e){ea=e,ks.onNetworkStatusChange(ta)},removeNetworkStatusListener:function(){ks.offNetworkStatusChange(ta),ea=null},createSSEClient:function(e){return _r(exports.ErrorCode.NOT_SUPPORT)},get runtimeInfo(){return{type:ra.tag,version:"Unknown"}}},na=kn({setItem:function(e,t){uni.setStorage({key:e,data:t})},getItem:function(e){return uni.getStorageSync(e)},removeItem:function(e){uni.removeStorage({key:e,success:function(){}})}}),ia=null,oa=function(e){var t=e.isConnected,r=e.networkType;ia({status:t,type:r})};var aa={tag:"uniapp",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||Be,n=e.headers,i=e.query,o=e.body,a=Wt(e.url,i);return new Promise((function(e){uni.request({url:a,method:t,header:n,timeout:r,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:na,sessionStorage:na,useNavi:!0,get connectPlatform(){var e=uni.getSystemInfoSync(),t=e.uniPlatform,r=e.osName;return["app","app-plus"].includes(t)&&r||""},isFromUniapp:!0,createWebSocket:function(e,t){var r={complete:function(){},url:e,protocols:t},n=uni.connectSocket(r);return Promise.resolve(fr({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){uni.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(Ue.UNKONWN)}})}))},setNetworkStatusListener:function(e){ia=e,uni.onNetworkStatusChange(oa)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(oa),ia=null},createSSEClient:function(e){return _r(exports.ErrorCode.NOT_SUPPORT)},getApiVer:function(){var e=uni.getSystemInfoSync(),t=e.osAndroidAPILevel,r=e.deviceModel,n=e.deviceBrand,i=e.osVersion,o="android"===e.osName?t:i;return"".concat(n||"","|").concat(r||"","|").concat(o||"","|||uniapp").replace(/-/g,"_")},get runtimeInfo(){return{type:aa.tag,version:"Unknown"}}},sa=function(e){return e&&e.request&&e.getSystemInfo},ua="undefined"!=typeof uni&&sa(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":case"app":case"app-harmony":return aa;case"mp-jd":return Zo;case"mp-baidu":return Jo;case"mp-toutiao":return Fo;case"mp-alipay":return xo;case"mp-weixin":return Po;case"mp-kuaishou":return ra;default:return qn}}():"undefined"!=typeof jd&&sa(jd)?Zo:"undefined"!=typeof my&&sa(my)?xo:"undefined"!=typeof tt&&sa(tt)?Fo:"undefined"!=typeof ks&&sa(ks)?ra:"undefined"!=typeof swan&&sa(swan)?Jo:"undefined"!=typeof wx&&sa(wx)?Po:qn;const la=function(){var e,t={},r=function(e){var t=function(e,r,i){if(void 0===e&&(e=t.DEFAULT_CAPACITY),void 0===r&&(r=t.DEFAULT_ENDIAN),void 0===i&&(i=t.DEFAULT_NOASSERT),!i){if((e|=0)<0)throw RangeError("Illegal capacity");r=!!r,i=!!i}this.buffer=0===e?n:new ArrayBuffer(e),this.view=0===e?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=e,this.littleEndian=r,this.noAssert=i};t.VERSION="5.0.1",t.LITTLE_ENDIAN=!0,t.BIG_ENDIAN=!1,t.DEFAULT_CAPACITY=16,t.DEFAULT_ENDIAN=t.BIG_ENDIAN,t.DEFAULT_NOASSERT=!1,t.Long=e||null;var r=t.prototype;r.__isByteBuffer__,Object.defineProperty(r,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1});var n=new ArrayBuffer(0),i=String.fromCharCode;function o(e){var t=0;return function(){return t<e.length?e.charCodeAt(t++):null}}function a(){var e=[],t=[];return function(){if(0===arguments.length)return t.join("")+i.apply(String,e);e.length+arguments.length>1024&&(t.push(i.apply(String,e)),e.length=0),Array.prototype.push.apply(e,arguments)}}function s(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,l=u>>1,c=-7,d=r?i-1:0,f=r?-1:1,_=e[t+d];for(d+=f,o=_&(1<<-c)-1,_>>=-c,c+=s;c>0;o=256*o+e[t+d],d+=f,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;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*(_?-1:1);a+=Math.pow(2,n),o-=l}return(_?-1:1)*a*Math.pow(2,o-n)}function u(e,t,r,n,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,_=n?0:o-1,p=n?1:-1,h=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(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[r+_]=255&s,_+=p,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;e[r+_]=255&a,_+=p,a/=256,l-=8);e[r+_-p]|=128*h}t.accessor=function(){return Uint8Array},t.allocate=function(e,r,n){return new t(e,r,n)},t.concat=function(e,r,n,i){"boolean"!=typeof r&&"string"==typeof r||(i=n,n=r,r=void 0);for(var o,a=0,s=0,u=e.length;s<u;++s)t.isByteBuffer(e[s])||(e[s]=t.wrap(e[s],r)),(o=e[s].limit-e[s].offset)>0&&(a+=o);if(0===a)return new t(0,n,i);var l,c=new t(a,n,i);for(s=0;s<u;)(o=(l=e[s++]).limit-l.offset)<=0||(c.view.set(l.view.subarray(l.offset,l.limit),c.offset),c.offset+=o);return c.limit=c.offset,c.offset=0,c},t.isByteBuffer=function(e){return!0===(e&&e.__isByteBuffer__)},t.type=function(){return ArrayBuffer},t.wrap=function(e,n,i,o){if("string"!=typeof n&&(o=i,i=n,n=void 0),"string"==typeof e)switch(void 0===n&&(n="utf8"),n){case"base64":return t.fromBase64(e,i);case"hex":return t.fromHex(e,i);case"binary":return t.fromBinary(e,i);case"utf8":return t.fromUTF8(e,i);case"debug":return t.fromDebug(e,i);default:throw Error("Unsupported encoding: "+n)}if(null===e||"object"!=typeof e)throw TypeError("Illegal buffer");var a;if(t.isByteBuffer(e))return(a=r.clone.call(e)).markedOffset=-1,a;if(e instanceof Uint8Array)a=new t(0,i,o),e.length>0&&(a.buffer=e.buffer,a.offset=e.byteOffset,a.limit=e.byteOffset+e.byteLength,a.view=new Uint8Array(e.buffer));else if(e instanceof ArrayBuffer)a=new t(0,i,o),e.byteLength>0&&(a.buffer=e,a.offset=0,a.limit=e.byteLength,a.view=e.byteLength>0?new Uint8Array(e):null);else{if("[object Array]"!==Object.prototype.toString.call(e))throw TypeError("Illegal buffer");(a=new t(e.length,i,o)).limit=e.length;for(var s=0;s<e.length;++s)a.view[s]=e[s]}return a},r.writeBitSet=function(e,t){var r=void 0===t;if(r&&(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)}var n,i=t,o=e.length,a=o>>3,s=0;for(t+=this.writeVarint32(o,t);a--;)n=1&!!e[s++]|(1&!!e[s++])<<1|(1&!!e[s++])<<2|(1&!!e[s++])<<3|(1&!!e[s++])<<4|(1&!!e[s++])<<5|(1&!!e[s++])<<6|(1&!!e[s++])<<7,this.writeByte(n,t++);if(s<o){var u=0;for(n=0;s<o;)n|=(1&!!e[s++])<<u++;this.writeByte(n,t++)}return r?(this.offset=t,this):t-i},r.readBitSet=function(e){var t=void 0===e;t&&(e=this.offset);var r,n=this.readVarint32(e),i=n.value,o=i>>3,a=0,s=[];for(e+=n.length;o--;)r=this.readByte(e++),s[a++]=!!(1&r),s[a++]=!!(2&r),s[a++]=!!(4&r),s[a++]=!!(8&r),s[a++]=!!(16&r),s[a++]=!!(32&r),s[a++]=!!(64&r),s[a++]=!!(128&r);if(a<i){var u=0;for(r=this.readByte(e++);a<i;)s[a++]=!!(r>>u++&1)}return t&&(this.offset=e),s},r.readBytes=function(e,t){var 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)}var n=this.slice(t,t+e);return r&&(this.offset+=e),n},r.writeBytes=r.append,r.writeInt8=function(e,t){var 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)}t+=1;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=1,this.view[t]=e,r&&(this.offset+=1),this},r.writeByte=r.writeInt8,r.readInt8=function(e){var t=void 0===e;if(t&&(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)}var r=this.view[e];return 128&~r||(r=-(255-r+1)),t&&(this.offset+=1),r},r.readByte=r.readInt8,r.writeUint8=function(e,t){var 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)}t+=1;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=1,this.view[t]=e,r&&(this.offset+=1),this},r.writeUInt8=r.writeUint8,r.readUint8=function(e){var t=void 0===e;if(t&&(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)}var r=this.view[e];return t&&(this.offset+=1),r},r.readUInt8=r.readUint8,r.writeInt16=function(e,t){var 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)}t+=2;var n=this.buffer.byteLength;return t>n&&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},r.writeShort=r.writeInt16,r.readInt16=function(e){var t=void 0===e;if(t&&(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)}var r=0;return this.littleEndian?(r=this.view[e],r|=this.view[e+1]<<8):(r=this.view[e]<<8,r|=this.view[e+1]),32768&~r||(r=-(65535-r+1)),t&&(this.offset+=2),r},r.readShort=r.readInt16,r.writeUint16=function(e,t){var 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)}t+=2;var n=this.buffer.byteLength;return t>n&&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},r.writeUInt16=r.writeUint16,r.readUint16=function(e){var t=void 0===e;if(t&&(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)}var r=0;return this.littleEndian?(r=this.view[e],r|=this.view[e+1]<<8):(r=this.view[e]<<8,r|=this.view[e+1]),t&&(this.offset+=2),r},r.readUInt16=r.readUint16,r.writeInt32=function(e,t){var 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)}t+=4;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=4,this.littleEndian?(this.view[t+3]=e>>>24&255,this.view[t+2]=e>>>16&255,this.view[t+1]=e>>>8&255,this.view[t]=255&e):(this.view[t]=e>>>24&255,this.view[t+1]=e>>>16&255,this.view[t+2]=e>>>8&255,this.view[t+3]=255&e),r&&(this.offset+=4),this},r.writeInt=r.writeInt32,r.readInt32=function(e){var t=void 0===e;if(t&&(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)}var r=0;return this.littleEndian?(r=this.view[e+2]<<16,r|=this.view[e+1]<<8,r|=this.view[e],r+=this.view[e+3]<<24>>>0):(r=this.view[e+1]<<16,r|=this.view[e+2]<<8,r|=this.view[e+3],r+=this.view[e]<<24>>>0),r|=0,t&&(this.offset+=4),r},r.readInt=r.readInt32,r.writeUint32=function(e,t){var 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)}t+=4;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=4,this.littleEndian?(this.view[t+3]=e>>>24&255,this.view[t+2]=e>>>16&255,this.view[t+1]=e>>>8&255,this.view[t]=255&e):(this.view[t]=e>>>24&255,this.view[t+1]=e>>>16&255,this.view[t+2]=e>>>8&255,this.view[t+3]=255&e),r&&(this.offset+=4),this},r.writeUInt32=r.writeUint32,r.readUint32=function(e){var t=void 0===e;if(t&&(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)}var r=0;return this.littleEndian?(r=this.view[e+2]<<16,r|=this.view[e+1]<<8,r|=this.view[e],r+=this.view[e+3]<<24>>>0):(r=this.view[e+1]<<16,r|=this.view[e+2]<<8,r|=this.view[e+3],r+=this.view[e]<<24>>>0),t&&(this.offset+=4),r},r.readUInt32=r.readUint32,e&&(r.writeInt64=function(t,r){var n=void 0===r;if(n&&(r=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 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)}"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),r+=8;var i=this.buffer.byteLength;r>i&&this.resize((i*=2)>r?i:r),r-=8;var o=t.low,a=t.high;return this.littleEndian?(this.view[r+3]=o>>>24&255,this.view[r+2]=o>>>16&255,this.view[r+1]=o>>>8&255,this.view[r]=255&o,r+=4,this.view[r+3]=a>>>24&255,this.view[r+2]=a>>>16&255,this.view[r+1]=a>>>8&255,this.view[r]=255&a):(this.view[r]=a>>>24&255,this.view[r+1]=a>>>16&255,this.view[r+2]=a>>>8&255,this.view[r+3]=255&a,r+=4,this.view[r]=o>>>24&255,this.view[r+1]=o>>>16&255,this.view[r+2]=o>>>8&255,this.view[r+3]=255&o),n&&(this.offset+=8),this},r.writeLong=r.writeInt64,r.readInt64=function(t){var 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+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var n=0,i=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,i=this.view[t+2]<<16,i|=this.view[t+1]<<8,i|=this.view[t],i+=this.view[t+3]<<24>>>0):(i=this.view[t+1]<<16,i|=this.view[t+2]<<8,i|=this.view[t+3],i+=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);var o=new e(n,i,!1);return r&&(this.offset+=8),o},r.readLong=r.readInt64,r.writeUint64=function(t,r){var n=void 0===r;if(n&&(r=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 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)}"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),r+=8;var i=this.buffer.byteLength;r>i&&this.resize((i*=2)>r?i:r),r-=8;var o=t.low,a=t.high;return this.littleEndian?(this.view[r+3]=o>>>24&255,this.view[r+2]=o>>>16&255,this.view[r+1]=o>>>8&255,this.view[r]=255&o,r+=4,this.view[r+3]=a>>>24&255,this.view[r+2]=a>>>16&255,this.view[r+1]=a>>>8&255,this.view[r]=255&a):(this.view[r]=a>>>24&255,this.view[r+1]=a>>>16&255,this.view[r+2]=a>>>8&255,this.view[r+3]=255&a,r+=4,this.view[r]=o>>>24&255,this.view[r+1]=o>>>16&255,this.view[r+2]=o>>>8&255,this.view[r+3]=255&o),n&&(this.offset+=8),this},r.writeUInt64=r.writeUint64,r.readUint64=function(t){var 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+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var n=0,i=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,i=this.view[t+2]<<16,i|=this.view[t+1]<<8,i|=this.view[t],i+=this.view[t+3]<<24>>>0):(i=this.view[t+1]<<16,i|=this.view[t+2]<<8,i|=this.view[t+3],i+=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);var o=new e(n,i,!0);return r&&(this.offset+=8),o},r.readUInt64=r.readUint64),r.writeFloat32=function(e,t){var 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)}t+=4;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=4,u(this.view,e,t,this.littleEndian,23,4),r&&(this.offset+=4),this},r.writeFloat=r.writeFloat32,r.readFloat32=function(e){var t=void 0===e;if(t&&(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)}var r=s(this.view,e,this.littleEndian,23,4);return t&&(this.offset+=4),r},r.readFloat=r.readFloat32,r.writeFloat64=function(e,t){var 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)}t+=8;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=8,u(this.view,e,t,this.littleEndian,52,8),r&&(this.offset+=8),this},r.writeDouble=r.writeFloat64,r.readFloat64=function(e){var t=void 0===e;if(t&&(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)}var r=s(this.view,e,this.littleEndian,52,8);return t&&(this.offset+=8),r},r.readDouble=r.readFloat64,t.MAX_VARINT32_BYTES=5,t.calculateVarint32=function(e){return(e>>>=0)<128?1:e<16384?2:e<1<<21?3:e<1<<28?4:5},t.zigZagEncode32=function(e){return((e|=0)<<1^e>>31)>>>0},t.zigZagDecode32=function(e){return e>>>1^-(1&e)},r.writeVarint32=function(e,r){var n=void 0===r;if(n&&(r=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+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)}var i,o=t.calculateVarint32(e);r+=o;var a=this.buffer.byteLength;for(r>a&&this.resize((a*=2)>r?a:r),r-=o,e>>>=0;e>=128;)i=127&e|128,this.view[r++]=i,e>>>=7;return this.view[r++]=e,n?(this.offset=r,this):o},r.writeVarint32ZigZag=function(e,r){return this.writeVarint32(t.zigZagEncode32(e),r)},r.readVarint32=function(e){var t=void 0===e;if(t&&(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)}var r,n=0,i=0;do{if(!this.noAssert&&e>this.limit){var o=Error("Truncated");throw o.truncated=!0,o}r=this.view[e++],n<5&&(i|=(127&r)<<7*n),++n}while(128&r);return i|=0,t?(this.offset=e,i):{value:i,length:n}},r.readVarint32ZigZag=function(e){var r=this.readVarint32(e);return"object"==typeof r?r.value=t.zigZagDecode32(r.value):r=t.zigZagDecode32(r),r},e&&(t.MAX_VARINT64_BYTES=10,t.calculateVarint64=function(t){"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t));var r=t.toInt()>>>0,n=t.shiftRightUnsigned(28).toInt()>>>0,i=t.shiftRightUnsigned(56).toInt()>>>0;return 0==i?0==n?r<16384?r<128?1:2:r<1<<21?3:4:n<16384?n<128?5:6:n<1<<21?7:8:i<128?9:10},t.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()},t.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()},r.writeVarint64=function(r,n){var i=void 0===n;if(i&&(n=this.offset),!this.noAssert){if("number"==typeof r)r=e.fromNumber(r);else if("string"==typeof r)r=e.fromString(r);else if(!(r&&r instanceof e))throw TypeError("Illegal value: "+r+" (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)}"number"==typeof r?r=e.fromNumber(r,!1):"string"==typeof r?r=e.fromString(r,!1):!1!==r.unsigned&&(r=r.toSigned());var o=t.calculateVarint64(r),a=r.toInt()>>>0,s=r.shiftRightUnsigned(28).toInt()>>>0,u=r.shiftRightUnsigned(56).toInt()>>>0;n+=o;var l=this.buffer.byteLength;switch(n>l&&this.resize((l*=2)>n?l:n),n-=o,o){case 10:this.view[n+9]=u>>>7&1;case 9:this.view[n+8]=9!==o?128|u:127&u;case 8:this.view[n+7]=8!==o?s>>>21|128:s>>>21&127;case 7:this.view[n+6]=7!==o?s>>>14|128:s>>>14&127;case 6:this.view[n+5]=6!==o?s>>>7|128:s>>>7&127;case 5:this.view[n+4]=5!==o?128|s:127&s;case 4:this.view[n+3]=4!==o?a>>>21|128:a>>>21&127;case 3:this.view[n+2]=3!==o?a>>>14|128:a>>>14&127;case 2:this.view[n+1]=2!==o?a>>>7|128:a>>>7&127;case 1:this.view[n]=1!==o?128|a:127&a}return i?(this.offset+=o,this):o},r.writeVarint64ZigZag=function(e,r){return this.writeVarint64(t.zigZagEncode64(e),r)},r.readVarint64=function(t){var 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+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var n=t,i=0,o=0,a=0,s=0;if(i=127&(s=this.view[t++]),128&s&&(i|=(127&(s=this.view[t++]))<<7,(128&s||this.noAssert&&void 0===s)&&(i|=(127&(s=this.view[t++]))<<14,(128&s||this.noAssert&&void 0===s)&&(i|=(127&(s=this.view[t++]))<<21,(128&s||this.noAssert&&void 0===s)&&(o=127&(s=this.view[t++]),(128&s||this.noAssert&&void 0===s)&&(o|=(127&(s=this.view[t++]))<<7,(128&s||this.noAssert&&void 0===s)&&(o|=(127&(s=this.view[t++]))<<14,(128&s||this.noAssert&&void 0===s)&&(o|=(127&(s=this.view[t++]))<<21,(128&s||this.noAssert&&void 0===s)&&(a=127&(s=this.view[t++]),(128&s||this.noAssert&&void 0===s)&&(a|=(127&(s=this.view[t++]))<<7,128&s||this.noAssert&&void 0===s))))))))))throw Error("Buffer overrun");var u=e.fromBits(i|o<<28,o>>>4|a<<24,!1);return r?(this.offset=t,u):{value:u,length:t-n}},r.readVarint64ZigZag=function(r){var n=this.readVarint64(r);return n&&n.value instanceof e?n.value=t.zigZagDecode64(n.value):n=t.zigZagDecode64(n),n}),r.writeCString=function(e,t){var r=void 0===t;r&&(t=this.offset);var n,i=e.length;if(!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");for(n=0;n<i;++n)if(0===e.charCodeAt(n))throw RangeError("Illegal str: Contains NULL-characters");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)}i=c.calculateUTF16asUTF8(o(e))[1],t+=i+1;var a=this.buffer.byteLength;return t>a&&this.resize((a*=2)>t?a:t),t-=i+1,c.encodeUTF16toUTF8(o(e),function(e){this.view[t++]=e}.bind(this)),this.view[t++]=0,r?(this.offset=t,this):i},r.readCString=function(e){var t=void 0===e;if(t&&(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)}var r,n=e,i=-1;return c.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=a(),!0),t?(this.offset=e,r()):{string:r(),length:e-n}},r.writeIString=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");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)}var n,i=t;n=c.calculateUTF16asUTF8(o(e),this.noAssert)[1],t+=4+n;var a=this.buffer.byteLength;if(t>a&&this.resize((a*=2)>t?a:t),t-=4+n,this.littleEndian?(this.view[t+3]=n>>>24&255,this.view[t+2]=n>>>16&255,this.view[t+1]=n>>>8&255,this.view[t]=255&n):(this.view[t]=n>>>24&255,this.view[t+1]=n>>>16&255,this.view[t+2]=n>>>8&255,this.view[t+3]=255&n),t+=4,c.encodeUTF16toUTF8(o(e),function(e){this.view[t++]=e}.bind(this)),t!==i+4+n)throw RangeError("Illegal range: Truncated data, "+t+" == "+(t+4+n));return r?(this.offset=t,this):t-i},r.readIString=function(e){var r=void 0===e;if(r&&(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)}var n=e,i=this.readUint32(e),o=this.readUTF8String(i,t.METRICS_BYTES,e+=4);return e+=o.length,r?(this.offset=e,o.string):{string:o.string,length:e-n}},t.METRICS_CHARS="c",t.METRICS_BYTES="b",r.writeUTF8String=function(e,t){var r,n=void 0===t;if(n&&(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+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var i=t;r=c.calculateUTF16asUTF8(o(e))[1],t+=r;var a=this.buffer.byteLength;return t>a&&this.resize((a*=2)>t?a:t),t-=r,c.encodeUTF16toUTF8(o(e),function(e){this.view[t++]=e}.bind(this)),n?(this.offset=t,this):t-i},r.writeString=r.writeUTF8String,t.calculateUTF8Chars=function(e){return c.calculateUTF16asUTF8(o(e))[0]},t.calculateUTF8Bytes=function(e){return c.calculateUTF16asUTF8(o(e))[1]},t.calculateString=t.calculateUTF8Bytes,r.readUTF8String=function(e,r,n){"number"==typeof r&&(n=r,r=void 0);var i=void 0===n;if(i&&(n=this.offset),void 0===r&&(r=t.METRICS_CHARS),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");if(e|=0,"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)}var o,s=0,u=n;if(r===t.METRICS_CHARS){if(o=a(),c.decodeUTF8(function(){return s<e&&n<this.limit?this.view[n++]:null}.bind(this),(function(e){++s,c.UTF8toUTF16(e,o)})),s!==e)throw RangeError("Illegal range: Truncated data, "+s+" == "+e);return i?(this.offset=n,o()):{string:o(),length:n-u}}if(r===t.METRICS_BYTES){if(!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+"+e+") <= "+this.buffer.byteLength)}var l=n+e;if(c.decodeUTF8toUTF16(function(){return n<l?this.view[n++]:null}.bind(this),o=a(),this.noAssert),n!==l)throw RangeError("Illegal range: Truncated data, "+n+" == "+l);return i?(this.offset=n,o()):{string:o(),length:n-u}}throw TypeError("Unsupported metrics: "+r)},r.readString=r.readUTF8String,r.writeVString=function(e,r){var n=void 0===r;if(n&&(r=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("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)}var i,a,s=r;i=c.calculateUTF16asUTF8(o(e),this.noAssert)[1],a=t.calculateVarint32(i),r+=a+i;var u=this.buffer.byteLength;if(r>u&&this.resize((u*=2)>r?u:r),r-=a+i,r+=this.writeVarint32(i,r),c.encodeUTF16toUTF8(o(e),function(e){this.view[r++]=e}.bind(this)),r!==s+i+a)throw RangeError("Illegal range: Truncated data, "+r+" == "+(r+i+a));return n?(this.offset=r,this):r-s},r.readVString=function(e){var r=void 0===e;if(r&&(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)}var n=e,i=this.readVarint32(e),o=this.readUTF8String(i.value,t.METRICS_BYTES,e+=i.length);return e+=o.length,r?(this.offset=e,o.string):{string:o.string,length:e-n}},r.append=function(e,r,n){"number"!=typeof r&&"string"==typeof r||(n=r,r=void 0);var i=void 0===n;if(i&&(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)}e instanceof t||(e=t.wrap(e,r));var o=e.limit-e.offset;if(o<=0)return this;n+=o;var a=this.buffer.byteLength;return n>a&&this.resize((a*=2)>n?a:n),n-=o,this.view.set(e.view.subarray(e.offset,e.limit),n),e.offset+=o,i&&(this.offset+=o),this},r.appendTo=function(e,t){return e.append(this,t),this},r.assert=function(e){return this.noAssert=!e,this},r.capacity=function(){return this.buffer.byteLength},r.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},r.clone=function(e){var r=new t(0,this.littleEndian,this.noAssert);return e?(r.buffer=new ArrayBuffer(this.buffer.byteLength),r.view=new Uint8Array(r.buffer)):(r.buffer=this.buffer,r.view=this.view),r.offset=this.offset,r.markedOffset=this.markedOffset,r.limit=this.limit,r},r.compact=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(0===e&&t===this.buffer.byteLength)return this;var r=t-e;if(0===r)return this.buffer=n,this.view=null,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=0,this;var i=new ArrayBuffer(r),o=new Uint8Array(i);return o.set(this.view.subarray(e,t)),this.buffer=i,this.view=o,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=r,this},r.copy=function(e,r){if(void 0===e&&(e=this.offset),void 0===r&&(r=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal end: Not an integer");if(r>>>=0,e<0||e>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+r+" <= "+this.buffer.byteLength)}if(e===r)return new t(0,this.littleEndian,this.noAssert);var n=r-e,i=new t(n,this.littleEndian,this.noAssert);return i.offset=0,i.limit=n,i.markedOffset>=0&&(i.markedOffset-=e),this.copyTo(i,0,e,r),i},r.copyTo=function(e,r,n,i){var o,a;if(!this.noAssert&&!t.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(r=(a=void 0===r)?e.offset:0|r,n=(o=void 0===n)?this.offset:0|n,i=void 0===i?this.limit:0|i,r<0||r>e.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+r+" <= "+e.buffer.byteLength);if(n<0||i>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+n+" <= "+this.buffer.byteLength);var s=i-n;return 0===s?e:(e.ensureCapacity(r+s),e.view.set(this.view.subarray(n,i),r),o&&(this.offset+=s),a&&(e.offset+=s),this)},r.ensureCapacity=function(e){var t=this.buffer.byteLength;return t<e?this.resize((t*=2)>e?t:e):this},r.fill=function(e,t,r){var n=void 0===t;if(n&&(t=this.offset),"string"==typeof e&&e.length>0&&(e=e.charCodeAt(0)),void 0===t&&(t=this.offset),void 0===r&&(r=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 r||r%1!=0)throw TypeError("Illegal end: Not an integer");if(r>>>=0,t<0||t>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+r+" <= "+this.buffer.byteLength)}if(t>=r)return this;for(;t<r;)this.view[t++]=e;return n&&(this.offset=t),this},r.flip=function(){return this.limit=this.offset,this.offset=0,this},r.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},r.order=function(e){if(!this.noAssert&&"boolean"!=typeof e)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!e,this},r.LE=function(e){return this.littleEndian=void 0===e||!!e,this},r.BE=function(e){return this.littleEndian=void 0!==e&&!e,this},r.prepend=function(e,r,n){"number"!=typeof r&&"string"==typeof r||(n=r,r=void 0);var i=void 0===n;if(i&&(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)}e instanceof t||(e=t.wrap(e,r));var o=e.limit-e.offset;if(o<=0)return this;var a=o-n;if(a>0){var s=new ArrayBuffer(this.buffer.byteLength+a),u=new Uint8Array(s);u.set(this.view.subarray(n,this.buffer.byteLength),o),this.buffer=s,this.view=u,this.offset+=a,this.markedOffset>=0&&(this.markedOffset+=a),this.limit+=a,n+=a}else new Uint8Array(this.buffer);return this.view.set(e.view.subarray(e.offset,e.limit),n-o),e.offset=e.limit,i&&(this.offset-=o),this},r.prependTo=function(e,t){return e.prepend(this,t),this},r.printDebug=function(e){"function"!=typeof e&&(e=console.log.bind(console)),e(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},r.remaining=function(){return this.limit-this.offset},r.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},r.resize=function(e){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)}if(this.buffer.byteLength<e){var t=new ArrayBuffer(e),r=new Uint8Array(t);r.set(this.view),this.buffer=t,this.view=r}return this},r.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},r.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},r.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 r=this.clone();return r.offset=e,r.limit=t,r},r.toBuffer=function(e){var t=this.offset,r=this.limit;if(!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: Not an integer");if(t>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal limit: Not an integer");if(r>>>=0,t<0||t>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+r+" <= "+this.buffer.byteLength)}if(!e&&0===t&&r===this.buffer.byteLength)return this.buffer;if(t===r)return n;var i=new ArrayBuffer(r-t);return new Uint8Array(i).set(new Uint8Array(this.buffer).subarray(t,r),0),i},r.toArrayBuffer=r.toBuffer,r.toString=function(e,t,r){if(void 0===e)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof e&&(r=t=e="utf8"),e){case"utf8":return this.toUTF8(t,r);case"base64":return this.toBase64(t,r);case"hex":return this.toHex(t,r);case"binary":return this.toBinary(t,r);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+e)}};var l=function(){for(var e={},t=[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],r=[],n=0,i=t.length;n<i;++n)r[t[n]]=n;return e.encode=function(e,r){for(var n,i;null!==(n=e());)r(t[n>>2&63]),i=(3&n)<<4,null!==(n=e())?(r(t[63&((i|=n>>4&15)|n>>4&15)]),i=(15&n)<<2,null!==(n=e())?(r(t[63&(i|n>>6&3)]),r(t[63&n])):(r(t[63&i]),r(61))):(r(t[63&i]),r(61),r(61))},e.decode=function(e,t){var n,i,o;function a(e){throw Error("Illegal character code: "+e)}for(;null!==(n=e());)if(void 0===(i=r[n])&&a(n),null!==(n=e())&&(void 0===(o=r[n])&&a(n),t(i<<2>>>0|(48&o)>>4),null!==(n=e()))){if(void 0===(i=r[n])){if(61===n)break;a(n)}if(t((15&o)<<4>>>0|(60&i)>>2),null!==(n=e())){if(void 0===(o=r[n])){if(61===n)break;a(n)}t((3&i)<<6>>>0|o)}}},e.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)},e}();r.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 l.encode(function(){return e<t?this.view[e++]:null}.bind(this),r=a()),r()},t.fromBase64=function(e,r){if("string"!=typeof e)throw TypeError("str");var n=new t(e.length/4*3,r),i=0;return l.decode(o(e),(function(e){n.view[i++]=e})),n.limit=i,n},t.btoa=function(e){return t.fromBinary(e).toBase64()},t.atob=function(e){return t.fromBase64(e).toBinary()},r.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 r=[],n=[];e<t;)r.push(this.view[e++]),r.length>=1024&&(n.push(String.fromCharCode.apply(String,r)),r=[]);return n.join("")+String.fromCharCode.apply(String,r)},t.fromBinary=function(e,r){if("string"!=typeof e)throw TypeError("str");for(var n,i=0,o=e.length,a=new t(o,r);i<o;){if((n=e.charCodeAt(i))>255)throw RangeError("illegal char code: "+n);a.view[i++]=n}return a.limit=o,a},r.toDebug=function(e){for(var t,r=-1,n=this.buffer.byteLength,i="",o="",a="";r<n;){if(-1!==r&&(i+=(t=this.view[r])<16?"0"+t.toString(16).toUpperCase():t.toString(16).toUpperCase(),e&&(o+=t>32&&t<127?String.fromCharCode(t):".")),++r,e&&r>0&&r%16==0&&r!==n){for(;i.length<51;)i+=" ";a+=i+o+"\n",i=o=""}r===this.offset&&r===this.limit?i+=r===this.markedOffset?"!":"|":r===this.offset?i+=r===this.markedOffset?"[":"<":r===this.limit?i+=r===this.markedOffset?"]":">":i+=r===this.markedOffset?"'":e||0!==r&&r!==n?" ":""}if(e&&" "!==i){for(;i.length<51;)i+=" ";a+=i+o+"\n"}return e?a:i},t.fromDebug=function(e,r,n){for(var i,o,a=e.length,s=new t((a+1)/3|0,r,n),u=0,l=0,c=!1,d=!1,f=!1,_=!1,p=!1;u<a;){switch(i=e.charAt(u++)){case"!":if(!n){if(d||f||_){p=!0;break}d=f=_=!0}s.offset=s.markedOffset=s.limit=l,c=!1;break;case"|":if(!n){if(d||_){p=!0;break}d=_=!0}s.offset=s.limit=l,c=!1;break;case"[":if(!n){if(d||f){p=!0;break}d=f=!0}s.offset=s.markedOffset=l,c=!1;break;case"<":if(!n){if(d){p=!0;break}d=!0}s.offset=l,c=!1;break;case"]":if(!n){if(_||f){p=!0;break}_=f=!0}s.limit=s.markedOffset=l,c=!1;break;case">":if(!n){if(_){p=!0;break}_=!0}s.limit=l,c=!1;break;case"'":if(!n){if(f){p=!0;break}f=!0}s.markedOffset=l,c=!1;break;case" ":c=!1;break;default:if(!n&&c){p=!0;break}if(o=parseInt(i+e.charAt(u++),16),!n&&(isNaN(o)||o<0||o>255))throw TypeError("Illegal str: Not a debug encoded string");s.view[l++]=o,c=!0}if(p)throw TypeError("Illegal str: Invalid symbol at "+u)}if(!n){if(!d||!_)throw TypeError("Illegal str: Missing offset or limit");if(l<s.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+l+" < "+a)}return s},r.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 r,n=new Array(t-e);e<t;)(r=this.view[e++])<16?n.push("0",r.toString(16)):n.push(r.toString(16));return n.join("")},t.fromHex=function(e,r,n){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(var i,o=e.length,a=new t(o/2|0,r),s=0,u=0;s<o;s+=2){if(i=parseInt(e.substring(s,s+2),16),!n&&(!isFinite(i)||i<0||i>255))throw TypeError("Illegal str: Contains non-hex characters");a.view[u++]=i}return a.limit=u,a};var c=function(){var e={MAX_CODEPOINT:1114111,encodeUTF8:function(e,t){var r=null;for("number"==typeof e&&(r=e,e=function(){return null});null!==r||null!==(r=e());)r<128?t(127&r):r<2048?(t(r>>6&31|192),t(63&r|128)):r<65536?(t(r>>12&15|224),t(r>>6&63|128),t(63&r|128)):(t(r>>18&7|240),t(r>>12&63|128),t(r>>6&63|128),t(63&r|128)),r=null},decodeUTF8:function(e,t){for(var r,n,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!==(r=e());)if(128&r)if(192==(224&r))null===(n=e())&&a([r,n]),t((31&r)<<6|63&n);else if(224==(240&r))(null===(n=e())||null===(i=e()))&&a([r,n,i]),t((15&r)<<12|(63&n)<<6|63&i);else{if(240!=(248&r))throw RangeError("Illegal starting byte: "+r);(null===(n=e())||null===(i=e())||null===(o=e()))&&a([r,n,i,o]),t((7&r)<<18|(63&n)<<12|(63&i)<<6|63&o)}else t(r)},UTF16toUTF8:function(e,t){for(var r,n=null;null!==(r=null!==n?n:e());)r>=55296&&r<=57343&&null!==(n=e())&&n>=56320&&n<=57343?(t(1024*(r-55296)+n-56320+65536),n=null):t(r);null!==n&&t(n)},UTF8toUTF16:function(e,t){var r=null;for("number"==typeof e&&(r=e,e=function(){return null});null!==r||null!==(r=e());)r<=65535?t(r):(t(55296+((r-=65536)>>10)),t(r%1024+56320)),r=null},encodeUTF16toUTF8:function(t,r){e.UTF16toUTF8(t,(function(t){e.encodeUTF8(t,r)}))},decodeUTF8toUTF16:function(t,r){e.decodeUTF8(t,(function(t){e.UTF8toUTF16(t,r)}))},calculateCodePoint:function(e){return e<128?1:e<2048?2:e<65536?3:4},calculateUTF8:function(e){for(var t,r=0;null!==(t=e());)r+=t<128?1:t<2048?2:t<65536?3:4;return r},calculateUTF16asUTF8:function(t){var r=0,n=0;return e.UTF16toUTF8(t,(function(e){++r,n+=e<128?1:e<2048?2:e<65536?3:4})),[r,n]}};return e}();return r.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{c.decodeUTF8toUTF16(function(){return e<t?this.view[e++]:null}.bind(this),r=a())}catch(r){if(e!==t)throw RangeError("Illegal range: Truncated data, "+e+" != "+t)}return r()},t.fromUTF8=function(e,r,n){if(!n&&"string"!=typeof e)throw TypeError("Illegal str: Not a string");var i=new t(c.calculateUTF16asUTF8(o(e),!0)[1],r,n),a=0;return c.encodeUTF16toUTF8(o(e),(function(e){i.view[a++]=e})),i.limit=a,i},t}(function(){function e(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function t(e){return!0===(e&&e.__isLong__)}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t;var r={},n={};function i(e,t){var i,o,s;return t?(s=0<=(e>>>=0)&&e<256)&&(o=n[e])?o:(i=a(e,(0|e)<0?-1:0,!0),s&&(n[e]=i),i):(s=-128<=(e|=0)&&e<128)&&(o=r[e])?o:(i=a(e,e<0?-1:0,!1),s&&(r[e]=i),i)}function o(e,t){if(isNaN(e)||!isFinite(e))return t?h:p;if(t){if(e<0)return h;if(e>=d)return T}else{if(e<=-f)return v;if(e+1>=f)return I}return e<0?o(-e,t).neg():a(e%c|0,e/c|0,t)}function a(t,r,n){return new e(t,r,n)}e.fromInt=i,e.fromNumber=o,e.fromBits=a;var s=Math.pow;function u(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return p;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return u(e.substring(1),t,r).neg();for(var i=o(s(r,8)),a=p,l=0;l<e.length;l+=8){var c=Math.min(8,e.length-l),d=parseInt(e.substring(l,l+c),r);if(c<8){var f=o(s(r,c));a=a.mul(f).add(o(d))}else a=(a=a.mul(i)).add(o(d))}return a.unsigned=t,a}function l(t){return t instanceof e?t:"number"==typeof t?o(t):"string"==typeof t?u(t):a(t.low,t.high,t.unsigned)}e.fromString=u,e.fromValue=l;var c=4294967296,d=c*c,f=d/2,_=i(1<<24),p=i(0);e.ZERO=p;var h=i(0,!0);e.UZERO=h;var g=i(1);e.ONE=g;var E=i(1,!0);e.UONE=E;var b=i(-1);e.NEG_ONE=b;var I=a(-1,2147483647,!1);e.MAX_VALUE=I;var T=a(-1,-1,!0);e.MAX_UNSIGNED_VALUE=T;var v=a(0,-2147483648,!1);e.MIN_VALUE=v;var R=e.prototype;return R.toInt=function(){return this.unsigned?this.low>>>0:this.low},R.toNumber=function(){return this.unsigned?(this.high>>>0)*c+(this.low>>>0):this.high*c+(this.low>>>0)},R.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(v)){var t=o(e),r=this.div(t),n=r.mul(t).sub(this);return r.toString(e)+n.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var i=o(s(e,6),this.unsigned),a=this,u="";;){var l=a.div(i),c=(a.sub(l.mul(i)).toInt()>>>0).toString(e);if((a=l).isZero())return c+u;for(;c.length<6;)c="0"+c;u=""+c+u}},R.getHighBits=function(){return this.high},R.getHighBitsUnsigned=function(){return this.high>>>0},R.getLowBits=function(){return this.low},R.getLowBitsUnsigned=function(){return this.low>>>0},R.getNumBitsAbs=function(){if(this.isNegative())return this.eq(v)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<<t);t--);return 0!=this.high?t+33:t+1},R.isZero=function(){return 0===this.high&&0===this.low},R.isNegative=function(){return!this.unsigned&&this.high<0},R.isPositive=function(){return this.unsigned||this.high>=0},R.isOdd=function(){return!(1&~this.low)},R.isEven=function(){return!(1&this.low)},R.equals=function(e){return t(e)||(e=l(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},R.eq=R.equals,R.notEquals=function(e){return!this.eq(e)},R.neq=R.notEquals,R.lessThan=function(e){return this.comp(e)<0},R.lt=R.lessThan,R.lessThanOrEqual=function(e){return this.comp(e)<=0},R.lte=R.lessThanOrEqual,R.greaterThan=function(e){return this.comp(e)>0},R.gt=R.greaterThan,R.greaterThanOrEqual=function(e){return this.comp(e)>=0},R.gte=R.greaterThanOrEqual,R.compare=function(e){if(t(e)||(e=l(e)),this.eq(e))return 0;var r=this.isNegative(),n=e.isNegative();return r&&!n?-1:!r&&n?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},R.comp=R.compare,R.negate=function(){return!this.unsigned&&this.eq(v)?v:this.not().add(g)},R.neg=R.negate,R.add=function(e){t(e)||(e=l(e));var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,o=65535&this.low,s=e.high>>>16,u=65535&e.high,c=e.low>>>16,d=0,f=0,_=0,p=0;return _+=(p+=o+(65535&e.low))>>>16,f+=(_+=i+c)>>>16,d+=(f+=n+u)>>>16,d+=r+s,a((_&=65535)<<16|(p&=65535),(d&=65535)<<16|(f&=65535),this.unsigned)},R.subtract=function(e){return t(e)||(e=l(e)),this.add(e.neg())},R.sub=R.subtract,R.multiply=function(e){if(this.isZero())return p;if(t(e)||(e=l(e)),e.isZero())return p;if(this.eq(v))return e.isOdd()?v:p;if(e.eq(v))return this.isOdd()?v:p;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(_)&&e.lt(_))return o(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,s=65535&this.low,u=e.high>>>16,c=65535&e.high,d=e.low>>>16,f=65535&e.low,h=0,g=0,E=0,b=0;return E+=(b+=s*f)>>>16,g+=(E+=i*f)>>>16,E&=65535,g+=(E+=s*d)>>>16,h+=(g+=n*f)>>>16,g&=65535,h+=(g+=i*d)>>>16,g&=65535,h+=(g+=s*c)>>>16,h+=r*f+n*d+i*c+s*u,a((E&=65535)<<16|(b&=65535),(h&=65535)<<16|(g&=65535),this.unsigned)},R.mul=R.multiply,R.divide=function(e){if(t(e)||(e=l(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?h:p;var r,n,i;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return h;if(e.gt(this.shru(1)))return E;i=h}else{if(this.eq(v))return e.eq(g)||e.eq(b)?v:e.eq(v)?g:(r=this.shr(1).div(e).shl(1)).eq(p)?e.isNegative()?g:b:(n=this.sub(e.mul(r)),i=r.add(n.div(e)));if(e.eq(v))return this.unsigned?h:p;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();i=p}for(n=this;n.gte(e);){r=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(r)/Math.LN2),u=a<=48?1:s(2,a-48),c=o(r),d=c.mul(e);d.isNegative()||d.gt(n);)d=(c=o(r-=u,this.unsigned)).mul(e);c.isZero()&&(c=g),i=i.add(c),n=n.sub(d)}return i},R.div=R.divide,R.modulo=function(e){return t(e)||(e=l(e)),this.sub(this.div(e).mul(e))},R.mod=R.modulo,R.not=function(){return a(~this.low,~this.high,this.unsigned)},R.and=function(e){return t(e)||(e=l(e)),a(this.low&e.low,this.high&e.high,this.unsigned)},R.or=function(e){return t(e)||(e=l(e)),a(this.low|e.low,this.high|e.high,this.unsigned)},R.xor=function(e){return t(e)||(e=l(e)),a(this.low^e.low,this.high^e.high,this.unsigned)},R.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?a(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):a(0,this.low<<e-32,this.unsigned)},R.shl=R.shiftLeft,R.shiftRight=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?a(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):a(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},R.shr=R.shiftRight,R.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0===(e&=63))return this;var r=this.high;return e<32?a(this.low>>>e|r<<32-e,r>>>e,this.unsigned):a(32===e?r:r>>>e-32,0,this.unsigned)},R.shru=R.shiftRightUnsigned,R.toSigned=function(){return this.unsigned?a(this.low,this.high,!1):this},R.toUnsigned=function(){return this.unsigned?this:a(this.low,this.high,!0)},R.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},R.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},R.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e}());return t.ByteBuffer=r,t.Long=r.Long||null,t.VERSION="5.0.3",t.WIRE_TYPES={},t.WIRE_TYPES.VARINT=0,t.WIRE_TYPES.BITS64=1,t.WIRE_TYPES.LDELIM=2,t.WIRE_TYPES.STARTGROUP=3,t.WIRE_TYPES.ENDGROUP=4,t.WIRE_TYPES.BITS32=5,t.PACKABLE_WIRE_TYPES=[t.WIRE_TYPES.VARINT,t.WIRE_TYPES.BITS64,t.WIRE_TYPES.BITS32],t.TYPES={int32:{name:"int32",wireType:t.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:"uint32",wireType:t.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:"sint32",wireType:t.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:"int64",wireType:t.WIRE_TYPES.VARINT,defaultValue:t.Long?t.Long.ZERO:void 0},uint64:{name:"uint64",wireType:t.WIRE_TYPES.VARINT,defaultValue:t.Long?t.Long.UZERO:void 0},sint64:{name:"sint64",wireType:t.WIRE_TYPES.VARINT,defaultValue:t.Long?t.Long.ZERO:void 0},bool:{name:"bool",wireType:t.WIRE_TYPES.VARINT,defaultValue:!1},double:{name:"double",wireType:t.WIRE_TYPES.BITS64,defaultValue:0},string:{name:"string",wireType:t.WIRE_TYPES.LDELIM,defaultValue:""},bytes:{name:"bytes",wireType:t.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:"fixed32",wireType:t.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:"sfixed32",wireType:t.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:"fixed64",wireType:t.WIRE_TYPES.BITS64,defaultValue:t.Long?t.Long.UZERO:void 0},sfixed64:{name:"sfixed64",wireType:t.WIRE_TYPES.BITS64,defaultValue:t.Long?t.Long.ZERO:void 0},float:{name:"float",wireType:t.WIRE_TYPES.BITS32,defaultValue:0},enum:{name:"enum",wireType:t.WIRE_TYPES.VARINT,defaultValue:0},message:{name:"message",wireType:t.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:"group",wireType:t.WIRE_TYPES.STARTGROUP,defaultValue:null}},t.MAP_KEY_TYPES=[t.TYPES.int32,t.TYPES.sint32,t.TYPES.sfixed32,t.TYPES.uint32,t.TYPES.fixed32,t.TYPES.int64,t.TYPES.sint64,t.TYPES.sfixed64,t.TYPES.uint64,t.TYPES.fixed64,t.TYPES.bool,t.TYPES.string,t.TYPES.bytes],t.ID_MIN=1,t.ID_MAX=536870911,t.convertFieldsToCamelCase=!1,t.populateAccessors=!0,t.populateDefaults=!0,t.Util=((e={}).IS_NODE=!("object"!=typeof process||process+""!="[object process]"||process.browser),e.toCamelCase=function(e){return e.replace(/_([a-zA-Z])/g,(function(e,t){return t.toUpperCase()}))},e),t.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]*)(?:\.[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},t.DotProto=function(e,t){var r={},n=function(e){this.source=e+"",this.index=0,this.line=1,this.stack=[],this._stringOpen=null},i=n.prototype;i._readString=function(){var e='"'===this._stringOpen?t.STRING_DQ:t.STRING_SQ;e.lastIndex=this.index-1;var r=e.exec(this.source);if(!r)throw Error("unterminated string");return this.index=e.lastIndex,this.stack.push(this._stringOpen),this._stringOpen=null,r[1]},i.next=function(){if(this.stack.length>0)return this.stack.shift();if(this.index>=this.source.length)return null;if(null!==this._stringOpen)return this._readString();var e,r,n;do{for(e=!1;t.WHITESPACE.test(n=this.source.charAt(this.index));)if("\n"===n&&++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("*"!==(n=this.source.charAt(this.index)))return"/";do{if("\n"===n&&++this.line,++this.index===this.source.length)return null;r=n,n=this.source.charAt(this.index)}while("*"!==r||"/"!==n);++this.index,e=!0}}while(e);if(this.index===this.source.length)return null;var i=this.index;if(t.DELIM.lastIndex=0,!t.DELIM.test(this.source.charAt(i++)))for(;i<this.source.length&&!t.DELIM.test(this.source.charAt(i));)++i;var o=this.source.substring(this.index,this.index=i);return'"'!==o&&"'"!==o||(this._stringOpen=o),o},i.peek=function(){if(0===this.stack.length){var e=this.next();if(null===e)return null;this.stack.push(e)}return this.stack[0]},i.skip=function(e){var t=this.next();if(t!==e)throw Error("illegal '"+t+"', '"+e+"' expected")},i.omit=function(e){return this.peek()===e&&(this.next(),!0)},i.toString=function(){return"Tokenizer ("+this.index+"/"+this.source.length+" at line "+this.line+")"},r.Tokenizer=n;var o=function(e){this.tn=new n(e),this.proto3=!1},a=o.prototype;function s(e,r){var n=-1,i=1;if("-"==e.charAt(0)&&(i=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))n=parseInt(e);else if(t.NUMBER_HEX.test(e))n=parseInt(e.substring(2),16);else{if(!t.NUMBER_OCT.test(e))throw Error("illegal id value: "+(i<0?"-":"")+e);n=parseInt(e.substring(1),8)}if(n=i*n|0,!r&&n<0)throw Error("illegal id value: "+(i<0?"-":"")+e);return n}function u(e){var r=1;if("-"==e.charAt(0)&&(r=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))return r*parseInt(e,10);if(t.NUMBER_HEX.test(e))return r*parseInt(e.substring(2),16);if(t.NUMBER_OCT.test(e))return r*parseInt(e.substring(1),8);if("inf"===e)return r*(1/0);if("nan"===e)return NaN;if(t.NUMBER_FLT.test(e))return r*parseFloat(e);throw Error("illegal number value: "+(r<0?"-":"")+e)}function l(e,t,r){void 0===e[t]?e[t]=r:(Array.isArray(e[t])||(e[t]=[e[t]]),e[t].push(r))}return a.parse=function(){var e,r,n={name:"[ROOT]",package:null,messages:[],enums:[],imports:[],options:{},services:[]},i=!0;try{for(;e=this.tn.next();)switch(e){case"package":if(!i||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(!i)throw Error("unexpected 'import'");("public"===(e=this.tn.peek())||(r="weak"===e))&&this.tn.next(),e=this._readString(),this.tn.skip(";"),r||n.imports.push(e);break;case"syntax":if(!i)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),i=!1;break;case"enum":this._parseEnum(n),i=!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,r="";do{if("'"!==(t=this.tn.next())&&'"'!==t)throw Error("illegal string delimiter: "+t);r+=this.tn.next(),this.tn.skip(t),e=this.tn.peek()}while('"'===e||'"'===e);return r},a._readValue=function(e){var r=this.tn.peek();if('"'===r||"'"===r)return this._readString();if(this.tn.next(),t.NUMBER.test(r))return u(r);if(t.BOOL.test(r))return"true"===r.toLowerCase();if(e&&t.TYPEREF.test(r))return r;throw Error("illegal value: "+r)},a._parseOption=function(e,r){var n=this.tn.next(),i=!1;if("("===n&&(i=!0,n=this.tn.next()),!t.TYPEREF.test(n))throw Error("illegal option name: "+n);var o=n;i&&(this.tn.skip(")"),o="("+o+")",n=this.tn.peek(),t.FQTYPEREF.test(n)&&(o+=n,this.tn.next())),this.tn.skip("="),this._parseOptionValue(e,o),r||this.tn.skip(";")},a._parseOptionValue=function(e,r){var n=this.tn.peek();if("{"!==n)l(e.options,r,this._readValue(!0));else for(this.tn.skip("{");"}"!==(n=this.tn.next());){if(!t.NAME.test(n))throw Error("illegal option name: "+r+"."+n);this.tn.omit(":")?l(e.options,r+"."+n,this._readValue(!0)):this._parseOptionValue(e,r+"."+n)}},a._parseService=function(e){var r=this.tn.next();if(!t.NAME.test(r))throw Error("illegal service name at line "+this.tn.line+": "+r);var n={name:r,rpc:{},options:{}};for(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 r="rpc",n=this.tn.next();if(!t.NAME.test(n))throw Error("illegal rpc service method name: "+n);var i=n,o={request:null,response:null,request_stream:!1,response_stream:!1,options:{}};if(this.tn.skip("("),"stream"===(n=this.tn.next()).toLowerCase()&&(o.request_stream=!0,n=this.tn.next()),!t.TYPEREF.test(n))throw Error("illegal rpc service request type: "+n);if(o.request=n,this.tn.skip(")"),"returns"!==(n=this.tn.next()).toLowerCase())throw Error("illegal rpc service request type delimiter: "+n);if(this.tn.skip("("),"stream"===(n=this.tn.next()).toLowerCase()&&(o.response_stream=!0,n=this.tn.next()),o.response=n,this.tn.skip(")"),"{"===(n=this.tn.peek())){for(this.tn.next();"}"!==(n=this.tn.next());){if("option"!==n)throw Error("illegal rpc service token: "+n);this._parseOption(o)}this.tn.omit(";")}else this.tn.skip(";");void 0===e[r]&&(e[r]={}),e[r][i]=o},a._parseMessage=function(e,r){var n=!!r,i=this.tn.next(),o={name:"",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!t.NAME.test(i))throw Error("illegal "+(n?"group":"message")+" name: "+i);for(o.name=i,n&&(this.tn.skip("="),r.id=s(this.tn.next()),o.isGroup=!0),"["===(i=this.tn.peek())&&r&&this._parseFieldOptions(r),this.tn.skip("{");"}"!==(i=this.tn.next());)if(t.RULE.test(i))this._parseMessageField(o,i);else if("oneof"===i)this._parseMessageOneOf(o);else if("enum"===i)this._parseEnum(o);else if("message"===i)this._parseMessage(o);else if("option"===i)this._parseOption(o);else if("service"===i)this._parseService(o);else if("extensions"===i)o.hasOwnProperty("extensions")?o.extensions=o.extensions.concat(this._parseExtensionRanges()):o.extensions=this._parseExtensionRanges();else if("reserved"===i)this._parseIgnored();else if("extend"===i)this._parseExtend(o);else{if(!t.TYPEREF.test(i))throw Error("illegal message token: "+i);if(!this.proto3)throw Error("illegal field rule: "+i);this._parseMessageField(o,"optional",i)}return this.tn.omit(";"),e.messages.push(o),o},a._parseIgnored=function(){for(;";"!==this.tn.peek();)this.tn.next();this.tn.skip(";")},a._parseMessageField=function(e,r,n){if(!t.RULE.test(r))throw Error("illegal message field rule: "+r);var i,o={rule:r,type:"",name:"",options:{},id:0};if("map"===r){if(n)throw Error("illegal type: "+n);if(this.tn.skip("<"),i=this.tn.next(),!t.TYPE.test(i)&&!t.TYPEREF.test(i))throw Error("illegal message field type: "+i);if(o.keytype=i,this.tn.skip(","),i=this.tn.next(),!t.TYPE.test(i)&&!t.TYPEREF.test(i))throw Error("illegal message field: "+i);if(o.type=i,this.tn.skip(">"),i=this.tn.next(),!t.NAME.test(i))throw Error("illegal message field name: "+i);o.name=i,this.tn.skip("="),o.id=s(this.tn.next()),"["===(i=this.tn.peek())&&this._parseFieldOptions(o),this.tn.skip(";")}else if("group"===(n=void 0!==n?n:this.tn.next())){var a=this._parseMessage(e,o);if(!/^[A-Z]/.test(a.name))throw Error("illegal group name: "+a.name);o.type=a.name,o.name=a.name.toLowerCase(),this.tn.omit(";")}else{if(!t.TYPE.test(n)&&!t.TYPEREF.test(n))throw Error("illegal message field type: "+n);if(o.type=n,i=this.tn.next(),!t.NAME.test(i))throw Error("illegal message field name: "+i);o.name=i,this.tn.skip("="),o.id=s(this.tn.next()),"["===(i=this.tn.peek())&&this._parseFieldOptions(o),this.tn.skip(";")}return e.fields.push(o),o},a._parseMessageOneOf=function(e){var r=this.tn.next();if(!t.NAME.test(r))throw Error("illegal oneof name: "+r);var n,i=r,o=[];for(this.tn.skip("{");"}"!==(r=this.tn.next());)(n=this._parseMessageField(e,"optional",r)).oneof=i,o.push(n.id);this.tn.omit(";"),e.oneofs[i]=o},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={name:"",values:[],options:{}},n=this.tn.next();if(!t.NAME.test(n))throw Error("illegal name: "+n);for(r.name=n,this.tn.skip("{");"}"!==(n=this.tn.next());)if("option"===n)this._parseOption(r);else{if(!t.NAME.test(n))throw Error("illegal name: "+n);this.tn.skip("=");var i={name:n,id:s(this.tn.next(),!0)};"["===(n=this.tn.peek())&&this._parseFieldOptions({options:{}}),this.tn.skip(";"),r.values.push(i)}this.tn.omit(";"),e.enums.push(r)},a._parseExtensionRanges=function(){var t,r,n,i=[];do{for(r=[];;){switch(t=this.tn.next()){case"min":n=e.ID_MIN;break;case"max":n=e.ID_MAX;break;default:n=u(t)}if(r.push(n),2===r.length)break;if("to"!==this.tn.peek()){r.push(n);break}this.tn.next()}i.push(r)}while(this.tn.omit(","));return this.tn.skip(";"),i},a._parseExtend=function(e){var r=this.tn.next();if(!t.TYPEREF.test(r))throw Error("illegal extend reference: "+r);var n={ref:r,fields:[]};for(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},r.Parser=o,r}(t,t.Lang),t.Reflect=function(e){var t={},n=function(e,t,r){this.builder=e,this.parent=t,this.name=r,this.className},i=n.prototype;i.fqn=function(){for(var e=this.name,t=this;;){if(null==(t=t.parent))break;e=t.name+"."+e}return e},i.toString=function(e){return(e?this.className+" ":"")+this.fqn()},i.build=function(){throw Error(this.toString(!0)+" cannot be built directly")},t.T=n;var o=function(e,t,r,i,o){n.call(this,e,t,r),this.className="Namespace",this.children=[],this.options=i||{},this.syntax=o||"proto2"},a=o.prototype=Object.create(n.prototype);a.getChildren=function(e){if(null==(e=e||null))return this.children.slice();for(var t=[],r=0,n=this.children.length;r<n;++r)this.children[r]instanceof e&&t.push(this.children[r]);return t},a.addChild=function(e){var t;if(t=this.getChild(e.name))if(t instanceof c.Field&&t.name!==t.originalName&&null===this.getChild(t.originalName))t.name=t.originalName;else{if(!(e instanceof c.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){for(var t="number"==typeof e?"id":"name",r=0,n=this.children.length;r<n;++r)if(this.children[r][t]===e)return this.children[r];return null},a.resolve=function(e,r){var n,i="string"==typeof e?e.split("."):e,o=this,a=0;if(""===i[a]){for(;null!==o.parent;)o=o.parent;a++}do{do{if(!(o instanceof t.Namespace)){o=null;break}if(!(n=o.getChild(i[a]))||!(n instanceof t.T)||r&&!(n instanceof t.Namespace)){o=null;break}o=n,a++}while(a<i.length);if(null!=o)break;if(null!==this.parent)return this.parent.resolve(e,r)}while(null!=o);return o},a.qn=function(e){var r=[],n=e;do{r.unshift(n.name),n=n.parent}while(null!==n);for(var i=1;i<=r.length;i++){var o=r.slice(r.length-i);if(e===this.resolve(o,e instanceof t.Namespace))return o.join(".")}return e.fqn()},a.build=function(){for(var e,t={},r=this.children,n=0,i=r.length;n<i;++n)(e=r[n])instanceof o&&(t[e.name]=e.build());return Object.defineProperty&&Object.defineProperty(t,"$options",{value:this.buildOpt()}),t},a.buildOpt=function(){for(var e={},t=Object.keys(this.options),r=0,n=t.length;r<n;++r){var i=t[r],o=this.options[t[r]];e[i]=o}return e},a.getOption=function(e){return void 0===e?this.options:void 0!==this.options[e]?this.options[e]:null},t.Namespace=o;var s=function(t,r,n,i,o){if(this.type=t,this.resolvedType=r,this.isMapKey=n,this.syntax=i,this.name=o,n&&e.MAP_KEY_TYPES.indexOf(t)<0)throw Error("Invalid map key type: "+t.name)},u=s.prototype;function l(t,r){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===r?t.unsigned:r);if("string"==typeof t)return e.Long.fromString(t,r||!1,10);if("number"==typeof t)return e.Long.fromNumber(t,r||!1);throw Error("not convertible to Long")}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.toString=function(){return(this.name||"")+(this.isMapKey?"map":"value")+" element"},u.verifyValue=function(t){var n=this;function i(e,t){throw Error("Illegal value for "+n.toString(!0)+" of type "+n.type.name+": "+e+" ("+t+")")}switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:return("number"!=typeof t||t==t&&t%1!=0)&&i(typeof t,"not an integer"),t>4294967295?0|t:t;case e.TYPES.uint32:case e.TYPES.fixed32:return("number"!=typeof t||t==t&&t%1!=0)&&i(typeof t,"not an integer"),t<0?t>>>0:t;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:if(e.Long)try{return l(t,!1)}catch(e){i(typeof t,e.message)}else i(typeof t,"requires Long.js");case e.TYPES.uint64:case e.TYPES.fixed64:if(e.Long)try{return l(t,!0)}catch(e){i(typeof t,e.message)}else i(typeof t,"requires Long.js");case e.TYPES.bool:return"boolean"!=typeof t&&i(typeof t,"not a boolean"),t;case e.TYPES.float:case e.TYPES.double:return"number"!=typeof t&&i(typeof t,"not a number"),t;case e.TYPES.string:return"string"==typeof t||t&&t instanceof String||i(typeof t,"not a string"),""+t;case e.TYPES.bytes:return r.isByteBuffer(t)?t:r.wrap(t,"base64");case e.TYPES.enum:var o=this.resolvedType.getChildren(e.Reflect.Enum.Value);for(s=0;s<o.length;s++){if(o[s].name==t)return o[s].id;if(o[s].id==t)return o[s].id}if("proto3"===this.syntax)return("number"!=typeof t||t==t&&t%1!=0)&&i(typeof t,"not an integer"),(t>4294967295||t<0)&&i(typeof t,"not in range for uint32"),t;i(t,"not a valid enum value");case e.TYPES.group:case e.TYPES.message:if(t&&"object"==typeof t||i(typeof t,"object expected"),t instanceof this.resolvedType.clazz)return t;if(t instanceof e.Builder.Message){var a={};for(var s in t)t.hasOwnProperty(s)&&(a[s]=t[s]);t=a}return new this.resolvedType.clazz(t)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+t+" (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){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");var o=n.offset;i.writeVarint32(n.remaining()),i.append(n),n.offset=o;break;case e.TYPES.message:var 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,r,n){if(r!=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,n)}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()},t.Element=s;var c=function(e,t,r,n,i,a){o.call(this,e,t,r,n,a),this.className="Message",this.extensions=void 0,this.clazz=null,this.isGroup=!!i,this._fields=null,this._fieldsById=null,this._fieldsByName=null},d=c.prototype=Object.create(o.prototype);function f(t,r){var n=r.readVarint32(),i=7&n,o=n>>>3;switch(i){case e.WIRE_TYPES.VARINT:do{n=r.readUint8()}while(!(128&~n));break;case e.WIRE_TYPES.BITS64:r.offset+=8;break;case e.WIRE_TYPES.LDELIM:n=r.readVarint32(),r.offset+=n;break;case e.WIRE_TYPES.STARTGROUP:f(o,r);break;case e.WIRE_TYPES.ENDGROUP:if(o===t)return!1;throw Error("Illegal GROUPEND after unknown group: "+o+" ("+t+" expected)");case e.WIRE_TYPES.BITS32:r.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+t+": "+i)}return!0}d.build=function(t){if(this.clazz&&!t)return this.clazz;var n=function(e,t){var n=t.getChildren(e.Reflect.Message.Field),i=t.getChildren(e.Reflect.Message.OneOf),o=function(a,s){e.Builder.Message.call(this);for(var u=0,l=i.length;u<l;++u)this[i[u].name]=null;for(u=0,l=n.length;u<l;++u){var c=n[u];this[c.name]=c.repeated?[]:c.map?new e.Map(c):null,!c.required&&"proto3"!==t.syntax||null===c.defaultValue||(this[c.name]=c.defaultValue)}var d;if(arguments.length>0)if(1!==arguments.length||null===a||"object"!=typeof a||!("function"!=typeof a.encode||a instanceof o)||Array.isArray(a)||a instanceof e.Map||r.isByteBuffer(a)||a instanceof ArrayBuffer||e.Long&&a instanceof e.Long)for(u=0,l=arguments.length;u<l;++u)void 0!==(d=arguments[u])&&this.$set(n[u].name,d);else this.$set(a)},a=o.prototype=Object.create(e.Builder.Message.prototype);a.add=function(r,n,i){var o=t._fieldsByName[r];if(!i){if(!o)throw Error(this+"#"+r+" is undefined");if(!(o instanceof e.Reflect.Message.Field))throw Error(this+"#"+r+" is not a field: "+o.toString(!0));if(!o.repeated)throw Error(this+"#"+r+" is not a repeated field");n=o.verifyValue(n,!0)}return null===this[r]&&(this[r]=[]),this[r].push(n),this},a.$add=a.add,a.set=function(r,n,i){if(r&&"object"==typeof r){for(var o in i=n,r)r.hasOwnProperty(o)&&void 0!==(n=r[o])&&void 0===t._oneofsByName[o]&&this.$set(o,n,i);return this}var a=t._fieldsByName[r];if(i)this[r]=n;else{if(!a)throw Error(this+"#"+r+" is not a field: undefined");if(!(a instanceof e.Reflect.Message.Field))throw Error(this+"#"+r+" is not a field: "+a.toString(!0));this[a.name]=n=a.verifyValue(n)}if(a&&a.oneof){var s=this[a.oneof.name];null!==n?(null!==s&&s!==a.name&&(this[s]=null),this[a.oneof.name]=a.name):s===r&&(this[a.oneof.name]=null)}return this},a.$set=a.set,a.get=function(r,n){if(n)return this[r];var i=t._fieldsByName[r];if(!(i&&i instanceof e.Reflect.Message.Field))throw Error(this+"#"+r+" is not a field: undefined");if(!(i instanceof e.Reflect.Message.Field))throw Error(this+"#"+r+" is not a field: "+i.toString(!0));return this[i.name]},a.$get=a.get;for(var s=0;s<n.length;s++){var u=n[s];u instanceof e.Reflect.Message.ExtensionField||t.builder.options.populateAccessors&&function(e){var r=e.originalName.replace(/(_[a-zA-Z])/g,(function(e){return e.toUpperCase().replace("_","")}));r=r.substring(0,1).toUpperCase()+r.substring(1);var n=e.originalName.replace(/([A-Z])/g,(function(e){return"_"+e})),i=function(t,r){return this[e.name]=r?t:e.verifyValue(t),this},o=function(){return this[e.name]};null===t.getChild("set"+r)&&(a["set"+r]=i),null===t.getChild("set_"+n)&&(a["set_"+n]=i),null===t.getChild("get"+r)&&(a["get"+r]=o),null===t.getChild("get_"+n)&&(a["get_"+n]=o)}(u)}function l(t,n,i,o){if(null===t||"object"!=typeof t){if(o&&o instanceof e.Reflect.Enum){var a=e.Reflect.Enum.getName(o.object,t);if(null!==a)return a}return t}if(r.isByteBuffer(t))return n?t.toBase64():t.toBuffer();if(e.Long.isLong(t))return i?t.toString():e.Long.fromValue(t);var s;if(Array.isArray(t))return s=[],t.forEach((function(e,t){s[t]=l(e,n,i,o)})),s;if(s={},t instanceof e.Map){for(var u=t.entries(),c=u.next();!c.done;c=u.next())s[t.keyElem.valueToString(c.value[0])]=l(c.value[1],n,i,t.valueElem.resolvedType);return s}var d=t.$type,f=void 0;for(var _ in t)t.hasOwnProperty(_)&&(d&&(f=d.getChild(_))?s[_]=l(t[_],n,i,f.resolvedType):s[_]=l(t[_],n,i));return s}return a.encode=function(e,n){"boolean"==typeof e&&(n=e,e=void 0);var i=!1;e||(e=new r,i=!0);var o=e.littleEndian;try{return t.encode(this,e.LE(),n),(i?e.flip():e).LE(o)}catch(t){throw e.LE(o),t}},o.encode=function(e,t,r){return new o(e).encode(t,r)},a.calculate=function(){return t.calculate(this)},a.encodeDelimited=function(e,n){var i=!1;e||(e=new r,i=!0);var o=(new r).LE();return t.encode(this,o,n).flip(),e.writeVarint32(o.remaining()),e.append(o),i?e.flip():e},a.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toArrayBuffer()),e}},a.toArrayBuffer=a.encodeAB,a.encodeNB=function(){try{return this.encode().toBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBuffer()),e}},a.toBuffer=a.encodeNB,a.encode64=function(){try{return this.encode().toBase64()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBase64()),e}},a.toBase64=a.encode64,a.encodeHex=function(){try{return this.encode().toHex()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toHex()),e}},a.toHex=a.encodeHex,a.toRaw=function(e,t){return l(this,!!e,!!t,this.$type)},a.encodeJSON=function(){return JSON.stringify(l(this,!0,!0,this.$type))},o.decode=function(e,n,i){"string"==typeof n&&(i=n,n=-1),"string"==typeof e?e=r.wrap(e,i||"base64"):r.isByteBuffer(e)||(e=r.wrap(e));var o=e.littleEndian;try{var a=t.decode(e.LE(),n);return e.LE(o),a}catch(t){throw e.LE(o),t}},o.decodeDelimited=function(e,n){if("string"==typeof e?e=r.wrap(e,n||"base64"):r.isByteBuffer(e)||(e=r.wrap(e)),e.remaining()<1)return null;var i=e.offset,o=e.readVarint32();if(e.remaining()<o)return e.offset=i,null;try{var a=t.decode(e.slice(e.offset,e.offset+o).LE());return e.offset+=o,a}catch(t){throw e.offset+=o,t}},o.decode64=function(e){return o.decode(e,"base64")},o.decodeHex=function(e){return o.decode(e,"hex")},o.decodeJSON=function(e){return new o(JSON.parse(e))},a.toString=function(){return t.toString()},Object.defineProperty&&(Object.defineProperty(o,"$options",{value:t.buildOpt()}),Object.defineProperty(a,"$options",{value:o.$options}),Object.defineProperty(o,"$type",{value:t}),Object.defineProperty(a,"$type",{value:t})),o}(e,this);this._fields=[],this._fieldsById={},this._fieldsByName={},this._oneofsByName={};for(var i,o=0,a=this.children.length;o<a;o++)if((i=this.children[o])instanceof g||i instanceof c||i instanceof I){if(n.hasOwnProperty(i.name))throw Error("Illegal reflect child of "+this.toString(!0)+": "+i.toString(!0)+" cannot override static property '"+i.name+"'");n[i.name]=i.build()}else if(i instanceof c.Field)i.build(),this._fields.push(i),this._fieldsById[i.id]=i,this._fieldsByName[i.name]=i;else if(i instanceof c.OneOf)this._oneofsByName[i.name]=i;else if(!(i instanceof c.OneOf||i instanceof b))throw Error("Illegal reflect child of "+this.toString(!0)+": "+this.children[o].toString(!0));return this.clazz=n},d.encode=function(e,t,r){for(var n,i,o=null,a=0,s=this._fields.length;a<s;++a)i=e[(n=this._fields[a]).name],n.required&&null===i?null===o&&(o=n):n.encode(r?i:n.verifyValue(i),t,e);if(null!==o){var u=Error("Missing at least one required field for "+this.toString(!0)+": "+o);throw u.encoded=t,u}return t},d.calculate=function(e){for(var t,r,n=0,i=0,o=this._fields.length;i<o;++i){if(r=e[(t=this._fields[i]).name],t.required&&null===r)throw Error("Missing at least one required field for "+this.toString(!0)+": "+t);n+=t.calculate(r,e)}return n},d.decode=function(t,r,n){"number"!=typeof r&&(r=-1);for(var i,o,a,s,u=t.offset,l=new this.clazz;t.offset<u+r||-1===r&&t.remaining()>0;){if(a=(i=t.readVarint32())>>>3,(o=7&i)===e.WIRE_TYPES.ENDGROUP){if(a!==n)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+a+" ("+(n?n+" expected":"not a group")+")");break}if(s=this._fieldsById[a]){if(s.repeated&&!s.options.packed)l[s.name].push(s.decode(o,t));else if(s.map){var c=s.decode(o,t);l[s.name].set(c[0],c[1])}else if(l[s.name]=s.decode(o,t),s.oneof){var d=l[s.oneof.name];null!==d&&d!==s.name&&(l[d]=null),l[s.oneof.name]=s.name}}else switch(o){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:var _=t.readVarint32();t.offset+=_;break;case e.WIRE_TYPES.STARTGROUP:for(;f(a,t););break;default:throw Error("Illegal wire type for unknown field "+a+" in "+this.toString(!0)+"#decode: "+o)}}for(var p=0,h=this._fields.length;p<h;++p)if(null===l[(s=this._fields[p]).name])if("proto3"===this.syntax)l[s.name]=s.defaultValue;else{if(s.required){var g=Error("Missing at least one required field for "+this.toString(!0)+": "+s.name);throw g.decoded=l,g}e.populateDefaults&&null!==s.defaultValue&&(l[s.name]=s.defaultValue)}return l},t.Message=c;var _=function(t,r,i,o,a,s,u,l,d,f){n.call(this,t,r,s),this.className="Message.Field",this.required="required"===i,this.repeated="repeated"===i,this.map="map"===i,this.keyType=o||null,this.type=a,this.resolvedType=null,this.id=u,this.options=l||{},this.defaultValue=null,this.oneof=d||null,this.syntax=f||"proto2",this.originalName=this.name,this.element=null,this.keyElement=null,!this.builder.options.convertFieldsToCamelCase||this instanceof c.ExtensionField||(this.name=e.Util.toCamelCase(this.name))},p=_.prototype=Object.create(n.prototype);p.build=function(){this.element=new s(this.type,this.resolvedType,!1,this.syntax,this.name),this.map&&(this.keyElement=new s(this.keyType,void 0,!0,this.syntax,this.name)),"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)},p.verifyValue=function(t,r){r=r||!1;var n,i=this;function o(e,t){throw Error("Illegal value for "+i.toString(!0)+" of type "+i.type.name+": "+e+" ("+t+")")}if(null===t)return this.required&&o(typeof t,"required"),"proto3"===this.syntax&&this.type!==e.TYPES.message&&o(typeof t,"proto3 field without field presence cannot be null"),null;if(this.repeated&&!r){Array.isArray(t)||(t=[t]);var a=[];for(n=0;n<t.length;n++)a.push(this.element.verifyValue(t[n]));return a}return this.map&&!r?t instanceof e.Map?t:(t instanceof Object||o(typeof t,"expected ProtoBuf.Map or raw object for map field"),new e.Map(this,t)):(!this.repeated&&Array.isArray(t)&&o(typeof t,"no array expected"),this.element.verifyValue(t))},p.hasWirePresence=function(t,r){if("proto3"!==this.syntax)return null!==t;if(this.oneof&&r[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}},p.encode=function(t,n,i){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{var o;if(this.repeated)if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){n.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),n.ensureCapacity(n.offset+=1);var a=n.offset;for(o=0;o<t.length;o++)this.element.encodeValue(this.id,t[o],n);var s=n.offset-a,u=r.calculateVarint32(s);if(u>1){var 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,o){var a=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(a),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},p.calculate=function(t,n){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;var i=0;try{var o,a;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,o){var a=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(a),i+=a}),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},p.decode=function(t,r,n){var i,o;if(!(!this.map&&t==this.type.wireType||!n&&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&&!n){o=r.readVarint32(),o=r.offset+o;for(var a=[];r.offset<o;)a.push(this.decode(this.type.wireType,r,!0));return a}if(this.map){var u=s.defaultFieldValue(this.keyType);if(i=s.defaultFieldValue(this.type),o=r.readVarint32(),r.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+r.remaining());var l=r.clone();for(l.limit=l.offset+o,r.offset+=o;l.remaining()>0;){var c=l.readVarint32();t=7&c;var d=c>>>3;if(1===d)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(r,t,this.id)},t.Message.Field=_;var h=function(e,t,r,n,i,o,a){_.call(this,e,t,r,null,n,i,o,a),this.extension};h.prototype=Object.create(_.prototype),t.Message.ExtensionField=h;t.Message.OneOf=function(e,t,r){n.call(this,e,t,r),this.fields=[]};var g=function(e,t,r,n,i){o.call(this,e,t,r,n,i),this.className="Enum",this.object=null};g.getName=function(e,t){for(var r,n=Object.keys(e),i=0;i<n.length;++i)if(e[r=n[i]]===t)return r;return null},(g.prototype=Object.create(o.prototype)).build=function(t){if(this.object&&!t)return this.object;for(var r=new e.Builder.Enum,n=this.getChildren(g.Value),i=0,o=n.length;i<o;++i)r[n[i].name]=n[i].id;return Object.defineProperty&&Object.defineProperty(r,"$options",{value:this.buildOpt(),enumerable:!1}),this.object=r},t.Enum=g;var E=function(e,t,r,i){n.call(this,e,t,r),this.className="Enum.Value",this.id=i};E.prototype=Object.create(n.prototype),t.Enum.Value=E;var b=function(e,t,r,i){n.call(this,e,t,r),this.field=i};b.prototype=Object.create(n.prototype),t.Extension=b;var I=function(e,t,r,n){o.call(this,e,t,r,n),this.className="Service",this.clazz=null};(I.prototype=Object.create(o.prototype)).build=function(t){return this.clazz&&!t?this.clazz:this.clazz=function(e,t){for(var n=function(t){e.Builder.Service.call(this),this.rpcImpl=t||function(e,t,r){setTimeout(r.bind(this,Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")),0)}},i=n.prototype=Object.create(e.Builder.Service.prototype),o=t.getChildren(e.Reflect.Service.RPCMethod),a=0;a<o.length;a++)!function(e){i[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(r,n){if(r)i(r);else{null===n&&(n="");try{n=e.resolvedResponseType.clazz.decode(n)}catch(e){}n&&n instanceof e.resolvedResponseType.clazz?i(null,n):i(Error("Illegal response type received in service method "+t.name+"#"+e.name))}}))}catch(e){setTimeout(i.bind(this,e),0)}},n[e.name]=function(t,r,i){new n(t)[e.name](r,i)},Object.defineProperty&&(Object.defineProperty(n[e.name],"$options",{value:e.buildOpt()}),Object.defineProperty(i[e.name],"$options",{value:n[e.name].$options}))}(o[a]);return Object.defineProperty&&(Object.defineProperty(n,"$options",{value:t.buildOpt()}),Object.defineProperty(i,"$options",{value:n.$options}),Object.defineProperty(n,"$type",{value:t}),Object.defineProperty(i,"$type",{value:t})),n}(e,this)},t.Service=I;var T=function(e,t,r,i){n.call(this,e,t,r),this.className="Service.Method",this.options=i||{}};(T.prototype=Object.create(n.prototype)).buildOpt=a.buildOpt,t.Service.Method=T;var v=function(e,t,r,n,i,o,a,s){T.call(this,e,t,r,s),this.className="Service.RPCMethod",this.requestName=n,this.responseName=i,this.requestStream=o,this.responseStream=a,this.resolvedRequestType=null,this.resolvedResponseType=null};return v.prototype=Object.create(T.prototype),t.Service.RPCMethod=v,t}(t),t.Builder=function(e,t,r){var n=function(e){this.ns=new r.Namespace(this,null,""),this.ptr=this.ns,this.resolved=!1,this.result=null,this.files={},this.importRoot=null,this.options=e||{}},i=n.prototype;function o(e){e.messages&&e.messages.forEach((function(t){t.syntax=e.syntax,o(t)})),e.enums&&e.enums.forEach((function(t){t.syntax=e.syntax}))}return n.isMessage=function(e){return"string"==typeof e.name&&(void 0===e.values&&void 0===e.rpc)},n.isMessageField=function(e){return"string"==typeof e.rule&&"string"==typeof e.name&&"string"==typeof e.type&&void 0!==e.id},n.isEnum=function(e){return"string"==typeof e.name&&!(void 0===e.values||!Array.isArray(e.values)||0===e.values.length)},n.isService=function(e){return!("string"!=typeof e.name||"object"!=typeof e.rpc||!e.rpc)},n.isExtend=function(e){return"string"==typeof e.ref},i.reset=function(){return this.ptr=this.ns,this},i.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 r.Namespace(this,this.ptr,e)),this.ptr=t}),this),this},i.create=function(t){if(!t)return this;if(Array.isArray(t)){if(0===t.length)return this;t=t.slice()}else t=[t];for(var i=[t];i.length>0;){if(t=i.pop(),!Array.isArray(t))throw Error("not a valid namespace: "+JSON.stringify(t));for(;t.length>0;){var o=t.shift();if(n.isMessage(o)){var a=new r.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 r.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 r.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);var u=[];if(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&&("number"==typeof o.extensions[0]?a.extensions=[o.extensions]:a.extensions=o.extensions),this.ptr.addChild(a),u.length>0){i.push(t),t=u,u=null,this.ptr=a,a=null;continue}u=null}else if(n.isEnum(o))a=new r.Enum(this,this.ptr,o.name,o.options,o.syntax),o.values.forEach((function(e){a.addChild(new r.Enum.Value(this,a,e.name,e.id))}),this),this.ptr.addChild(a);else if(n.isService(o))a=new r.Service(this,this.ptr,o.name,o.options),Object.keys(o.rpc).forEach((function(e){var t=o.rpc[e];a.addChild(new r.Service.RPCMethod(this,a,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))}),this),this.ptr.addChild(a);else{if(!n.isExtend(o))throw Error("not a valid definition: "+JSON.stringify(o));if(a=this.ptr.resolve(o.ref,!0))o.fields.forEach((function(t){if(null!==a.getChild(0|t.id))throw Error("duplicate extended field id in "+a.name+": "+t.id);if(a.extensions){var n=!1;if(a.extensions.forEach((function(e){t.id>=e[0]&&t.id<=e[1]&&(n=!0)})),!n)throw Error("illegal extended field id in "+a.name+": "+t.id+" (not within valid ranges)")}var i=t.name;this.options.convertFieldsToCamelCase&&(i=e.Util.toCamelCase(i));var o=new r.Message.ExtensionField(this,a,t.rule,t.type,this.ptr.fqn()+"."+i,t.id,t.options),s=new r.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},i.import=function(t,r){var n="/";if("string"==typeof r){if(e.Util.IS_NODE&&(r=require("path").resolve(r)),!0===this.files[r])return this.reset();this.files[r]=!0}else if("object"==typeof r){var i,a=r.root;if(e.Util.IS_NODE&&(a=require("path").resolve(a)),(a.indexOf("\\")>=0||r.file.indexOf("\\")>=0)&&(n="\\"),i=e.Util.IS_NODE?require("path").join(a,r.file):a+n+r.file,!0===this.files[i])return this.reset();this.files[i]=!0}if(t.imports&&t.imports.length>0){var s,u=!1;"object"==typeof r?(this.importRoot=r.root,u=!0,s=this.importRoot,r=r.file,(s.indexOf("\\")>=0||r.indexOf("\\")>=0)&&(n="\\")):"string"==typeof r?this.importRoot?s=this.importRoot:r.indexOf("/")>=0?""===(s=r.replace(/\/[^\/]*$/,""))&&(s="/"):r.indexOf("\\")>=0?(s=r.replace(/\\[^\\]*$/,""),n="\\"):s=".":s=null;for(var l=0;l<t.imports.length;l++)if("string"==typeof t.imports[l]){if(!s)throw Error("cannot determine import root");var c=t.imports[l];if("google/protobuf/descriptor.proto"===c)continue;if(c=e.Util.IS_NODE?require("path").join(s,c):s+n+c,!0===this.files[c])continue;/\.proto$/i.test(c)&&!e.DotProto&&(c=c.replace(/\.proto$/,".json"));var d=e.Util.fetch(c);if(null===d)throw Error("failed to import '"+c+"' in '"+r+"': file not found");/\.json$/i.test(c)?this.import(JSON.parse(d+""),c):this.import(e.DotProto.Parser.parse(d),c)}else r?/\.(\w+)$/.test(r)?this.import(t.imports[l],r.replace(/^(.+)\.(\w+)$/,(function(e,t,r){return t+"_import"+l+"."+r}))):this.import(t.imports[l],r+"_import"+l):this.import(t.imports[l]);u&&(this.importRoot=null)}t.package&&this.define(t.package),t.syntax&&o(t);var f=this.ptr;return t.options&&Object.keys(t.options).forEach((function(e){f.options[e]=t.options[e]})),t.messages&&(this.create(t.messages),this.ptr=f),t.enums&&(this.create(t.enums),this.ptr=f),t.services&&(this.create(t.services),this.ptr=f),t.extends&&this.create(t.extends),this.reset()},i.resolveAll=function(){var n;if(null==this.ptr||"object"==typeof this.ptr.type)return this;if(this.ptr instanceof r.Namespace)this.ptr.children.forEach((function(e){this.ptr=e,this.resolveAll()}),this);else if(this.ptr instanceof r.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(!(n=(this.ptr instanceof r.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=n,n instanceof r.Enum){if(this.ptr.type=e.TYPES.enum,"proto3"===this.ptr.syntax&&"proto3"!==n.syntax)throw Error("proto3 message cannot reference proto2 enum")}else{if(!(n instanceof r.Message))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);this.ptr.type=n.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]}"proto3"===this.ptr.syntax&&this.ptr.repeated&&void 0===this.ptr.options.packed&&-1!==e.PACKABLE_WIRE_TYPES.indexOf(this.ptr.type.wireType)&&(this.ptr.options.packed=!0)}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(!((n=this.ptr.parent.resolve(this.ptr.requestName,!0))&&n instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.requestName);if(this.ptr.resolvedRequestType=n,!((n=this.ptr.parent.resolve(this.ptr.responseName,!0))&&n instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.responseName);this.ptr.resolvedResponseType=n}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()},i.build=function(e){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(var t="string"==typeof e?e.split("."):e,r=this.result,n=0;n<t.length;n++){if(!r[t[n]]){r=null;break}r=r[t[n]]}return r},i.lookup=function(e,t){return e?this.ns.resolve(e,t):this.ns},i.toString=function(){return"Builder"},n.Message=function(){},n.Enum=function(){},n.Service=function(){},n}(t,t.Lang,t.Reflect),t.Map=function(e,t){var r=function(e,r){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}}),r)for(var n=Object.keys(r),i=0;i<n.length;i++){var o=this.keyElem.valueFromString(n[i]),a=this.valueElem.verifyValue(r[n[i]]);this.map[this.keyElem.valueToString(o)]={key:o,value:a}}},n=r.prototype;function i(e){var t=0;return{next:function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}}return n.clear=function(){this.map={}},n.delete=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e)),r=t in this.map;return delete this.map[t],r},n.entries=function(){for(var e,t=[],r=Object.keys(this.map),n=0;n<r.length;n++)t.push([(e=this.map[r[n]]).key,e.value]);return i(t)},n.keys=function(){for(var e=[],t=Object.keys(this.map),r=0;r<t.length;r++)e.push(this.map[t[r]].key);return i(e)},n.values=function(){for(var e=[],t=Object.keys(this.map),r=0;r<t.length;r++)e.push(this.map[t[r]].value);return i(e)},n.forEach=function(e,t){for(var r,n=Object.keys(this.map),i=0;i<n.length;i++)e.call(t,(r=this.map[n[i]]).value,r.key,this)},n.set=function(e,t){var r=this.keyElem.verifyValue(e),n=this.valueElem.verifyValue(t);return this.map[this.keyElem.valueToString(r)]={key:r,value:n},this},n.get=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e));if(t in this.map)return this.map[t].value},n.has=function(e){return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map},r}(0,t.Reflect),t.loadProto=function(e,r,n){return("string"==typeof r||r&&"string"==typeof r.file&&"string"==typeof r.root)&&(n=r,r=void 0),t.loadJson(t.DotProto.Parser.parse(e),r,n)},t.newBuilder=function(e){return void 0===(e=e||{}).convertFieldsToCamelCase&&(e.convertFieldsToCamelCase=t.convertFieldsToCamelCase),void 0===e.populateAccessors&&(e.populateAccessors=t.populateAccessors),new t.Builder(e)},t.loadJson=function(e,r,n){return("string"==typeof r||r&&"string"==typeof r.file&&"string"==typeof r.root)&&(n=r,r=null),r&&"object"==typeof r||(r=t.newBuilder()),"string"==typeof e&&(e=JSON.parse(e)),r.import(e,n),r.resolveAll(),r},t}();var ca,da,fa,_a,pa,ha,ga,Ea,ba,Ia="NotifyMsg",Ta="SyncRequestMsg",va="UpStreamMessage",Ra="DownStreamMessages",ma="ChrmDownStreamMessages",ya="DownStreamMessage",Aa="ExtMsgData",Oa="GetQNupTokenInput",Sa="GetDownloadUrlInput",Ca="GetQNupTokenOutput",Na="GetDownloadUrlOutput",Ma="ChrmInput",Pa="ChrmOutput",La="ChrmPullMsg",wa="RelationQryInput",Ua="RelationQryFilter",Da="RelationsOutput",xa="QryRemindListReq",Ga="QryRemindListResp",Va="CleanHisMsgInput",ja="CleanMsgBatchReq",ka="QueryChatRoomInfoInput",Fa="QueryChatRoomInfoOutput",Ba="HistoryMsgInput",Ha="HistoryMsgOuput",Ya="SessionsAttQryInput",Wa="SessionsAttOutput",Ja="SessionMsgReadInput",qa="DeleteSessionsInput",Ka="QuerySessionsInput",Qa="QuerySessionsOutPut",Xa="RelationDelBatchReq",Za="DeleteMsgInput",za="SetChrmKV",$a="SetChrmKVS",es="ChrmKVOutput",ts="ChrmKVSOutput",rs="QueryChrmKV",ns="SetUserSettingInput",is="SetUserSettingOutput",os="PullUserSettingInput",as="PullUserSettingOutput",ss="SessionReq",us="SessionStates",ls="SessionStateModifyReq",cs="GroupUnpushQuery",ds="GroupUnpushSet",fs="GroupUnpushResult",_s="SessionStateModifyResp",ps="TypeUnpushInput",hs="TypeUnpushOutput",gs="GrpReadReceiptMsg",Es="ReadReceipt",bs="QueryReceiptReq",Is="QueryReceiptBatchReq",Ts="ReceiptResp",vs="QueryReceiptBatchResp",Rs="GrpReadReceiptQryResp",ms="SessionTagAddInput",ys="SessionTagDelInput",As="UserSettingNotification",Os="ReportSDKInput",Ss="UltraGrpPullSes",Cs="UltraGrpPullMsg",Ns="MsgChangeReq",Ms="ModifyMsgResp",Ps="QueryMsgChange",Ls="EventChangeList",ws="MsgChangeList",Us="MsgQuery",Ds="MsgQueryAck",xs="OperateStatus",Gs="OperateStatusNotify",Vs="SetRtcRoomIdInput",js="CallInfoUpStream",Fs="CallInfoDownStream",Bs="KvInput",Hs="KvOutput",Ys="ReadReceiptMsg",Ws="ReceiptQryReq",Js="QueryReceiptResp",qs="ReceiptCntQryReq",Ks="ReceiptCntQryResp",Qs="UpdateUserSubReq",Xs="UpdateUserSubResp",Zs="PullUserSubReq",zs="PUllUserSubResp",$s="PullSubDataReq",eu="PullSubDataResp",tu="SubDataDetail",ru="QrySubDataReq",nu="UserProfile",iu="SetUserProfileResp",ou="PullUserProfileReq",au="UserProfiles",su="UserProfileInput",uu="UserProfilePermission",lu="SearchUserProfile",cu="ChannelsInput",du="ChannelsOutput",fu="MultiChannels",_u="ModifyChannelsInput",pu="ChannelsQueryInput",hu="ChannelsListResult",gu="ChannelsInviteStatusInfos",Eu="ChannelsUserInfos",bu="ChannelsJoinedInfos",Iu="ChannelsMemberUpdateInput",Tu="ChannelsMemberResponseInput",vu="ChannelsMembersInput",Ru="FriendInput",mu="FriendsInput",yu="FriendsCheckOutput",Au="FriendProfileInput",Ou="FriendProfileOutput",Su="FriendQueryInput",Cu="FriendsListInput",Nu="FriendLevelSet",Mu="FriendUserInfos",Pu="FriendInviteInfos",Lu="ChannelApplyInfo",wu="AddUnpushPeriodInput",Uu="DeleteUnpushPeriodInput",Du="QueryUnpushPeriodInput",xu="QueryUnpushPeriodOutput",Gu="MsgReadEvent",Vu="ConvertMsgInput",ju="SpeechToTextInfo",ku="ConvertMsgOutput",Fu="SpeechToTextResult",Bu="TransReq",Hu="TransResp",Yu="PullModifyMsgReq",Wu="PullModifyMsgResp",Ju="SessionQryInput",qu="SessionsOutput",Ku="SetUserStatusInput",Qu="MCFollowInput",Xu="RtcQueryListInput",Zu="RtcKeyDeleteInput",zu="RtcValueInfo",$u="RtcUserListOutput",el="RtcInput",tl="RtcQryOutput",rl="RtcDataInput",nl="RtcSetDataInput",il="RtcUserSetDataInput",ol="RtcOutput",al="RtcTokenOutput",sl="RtcQueryUserJoinedInput",ul="RtcQueryUserJoinedOutput",ll="RtcViewerJoinedOutput",cl="RtcInviteInput",dl="RtcCancelInviteInput",fl="RtcInviteAnswerInput",_l="RtcEndInviteInput",pl="BotInput",hl="BotOutput",gl="ReactionInput",El="ReactionAck",bl="ReactionBatchQry",Il="ReactionsOutput",Tl="ReactionQry",vl="ReactionOutput",Rl="ReactionUserOutput",ml="ReactionEvent",yl=function(e){var t=0,r="";e:do{var n=e.charCodeAt(t++),i=n&wn,o=15&n,a=void 0;switch(i){case Mn:var s=o>>2,u=3&o;if(0===s||0===u)throw new Error("Data parsing error,at "+t);var l=Vn(e.substr(t,s)),c=Vn(e.substr(t+=s,u));if((l=r.length-l)+c>r.length)throw new Error("Data parsing error,at "+t);t+=u,r+=r.substr(l,c);break;case Nn:if((a=Vn(e.substr(t,o)))!==r.length)throw console.log(r.length),console.log(a),new Error("Data parsing error,at "+t);t+=o;break e;case Pn:a=Vn(e.substr(t,o)),r+=e.substr(t+=o,a),t+=a;break;case Ln:r+=e.substr(t,o),t+=o;break;case wn:if(o>10)throw new Error("Data parsing error,at "+t);r+=e.substr(t,16+o),t+=16+o;break;default:throw new Error("Data parsing error,at "+t+" header:"+i)}}while(t<e.length);return r}("upackage Modules;\nmessEH4kprobuf {\n EJ8sSetUserStatusOutputEW5QV optional int32 nothing=1;\n }I41BaGI41CbInJ3111I72Mistring stEZ4I416EUJbubIA14dId=2Ib1GaSER6Ie2IhrepeatedI618guserid If2II41DIm4rkVoipDynamicI62Egquired I116n engineType = Im37Ea9Ig27jchannelNamEb4Iq35IN4IEb7iExtra = 3IK2RIM3DIl1GadEa6cKeyIQ3IjNotifyMsg IJ3LatIC3DIn4Ce64 tiI43UermId=Iw25Ik5HgdestroyIj44b=4Is6HjyncRequestIT2Mh64 syncTI426Ij5Gkbool ispollIC24Ib2IEX7cwebIY2HER7iPullSend=IW25EWIdKeepIp84a5IW4LgsendBoxID34Id24b=6EcLibroadcastEe9a7EeLcendIl37a8IH2KucompressioEnabled = 9IS5GiUpStreamMEG7Iw7LbseI814cnIdIDBRglassnamI78BEZHfontentI6B8Ie8IkpushText = Ie5GEY7fappDatIBC4Ig57I4GGbtoI9H6ds = Id5MfdelMsgI257IY5GIlC8Ea5Ir35Ia5GIP46iconfigFlaIN94IU55Ig1HlclientUniqueI356a0Il1MfextraCIa49a1IiDGdPushI9G6Ie44cExtEb4IqDNdbusCIxG6Eb4In5NhsystemIdEZ4Ii4GEZ8lenderPortraiIp14a2I8GMEF6cBitIw54a2IP2GfExtMsgIz65cextEB8c= 2IT2NemetadEZ7IH8GiReferenceI615crefIE18IP85IeBCEgEIXQMamIi77IYQNdfromIQ96IhJRI9CBIiMHI27AI42MetitleIeLMIQP4otemplateIdNoUseI82PIX84Ie25IhDRfConfigIi64IkDNIl1AInD8IG3CdDownI4HDbs IQUFEYHe listICHJIDNHIgMLffinishIJJ5IJPJI8LKIX3JIj18I1C4EZ7IzMMmcredibleStartEg7IQHMEg8bEnIXM8IVHGIXMPICNHeytes Eg8bedIXB7IANHdChrmIC6YIG16I06zIv2KIuSHIv2MIXVHIV8II1ZMI0EDIx2GIhJ7Iqb5IjY7IRCNegroupISCCIFRSIt87IFRQIAQ9I95DIuI4Ii8EIg5GIEg5IZ8JIcV7Ird7IO8GInIFIwPJIQb4direcEI4IrPKEZ6lplantform =1IqHMgisRemovId75IkPOfsourceIgPKI9SOIpHNI9SGIMEGI3JEEc8IIEJIbUGa1If5GILTLIm5NILTEIoVMcextIdn6I4A4Is57IcYSIGTKc32 IeA5bUnIO24IHTKIrTKIlNNgconvertIW36IETHISUPIy5NISUCIv5GISUPI065I1GCIu1BIHsIIyi5aqIOULISjAIlICIS14eenum IJGCIQ16fPERSONIC1AEG6aSIiGAeGROUPIQGAdTEMPEJ8Ip47oCUSTOMERSERVICEI2GAfNOTIFYIlFAbMCI2l8cMP=IK97eULTRAIJ18INE6ICNDkreateDiscusIuj5MR01KI667IaI7IItHI61GITuTIqy4I51JI256gInvitatIC2FIzzKI4A4I81HeLeaveID19IwyPIxz7IC2RcEviIKJ5I71LIA2BI51KbReIm44IA2SIP5WEx8bfoIB3zI314IN6MIFRJMA31UINgCMj31UIsRNeadminIZT9IuR9Ic7EhfirstTenI1JAI2SJg32 openIAK9IJC5I64NMN91FI71Depage IKiOdnumbIi75MuA1HIW1CId5FIJ37IA6IIg47I9B9ME61Ieotal Im1JbMeIC24ID14IPARIBzSEW4MLA1EEYKIFsBIE7NeextenIwF4ItbKaGISP4Il26Jy5L1IW1CIy5MIk4BbmeEe5Iq5oM7K17IHEwI31BIeKTJ07O1IE2FbSeMr717II3vI419IJ3MMW91NI2T9dFileIzSBdIMAGIkR4Iw37eAUDIOId3AdVIDEEF4IGA7cFILEi4I7H7eSIGHTIhGAlCOMBINE_HTMLIUGKlGetQNupTokenI54LIU29MVK1NIl57ckeyIFmQjhttpMethodIkyQhqueryStrIj56IvgNburIXA4InaNMQD16IuuMcsizIjuKI4k7bpTIY36I5X5Ic4HkdownloadUrlIg4iIRAGIg4Te fileI5PCIA2FIEt4J82Y1I72GIi5OMr11NIi56Ml11JIi5CIKATILDPMZJ15eadlinIY3RetokenIa3QcbosId15Ia3QfbosDatMV51KIaq8batIxm4c5;\nEVLfosskeyIxF5M1I1NhossPolicIH64MjM1NfossSigIg24IwqNiossBucketIt67c9;\nIBvMi3CredentiIlN5MmM1Oms3Algorithm =MlM1IEc9IY47IxwPa3IV39MfM1Pa3IV34eatureIxwRbs3Ia3DIxw4MHk1NicAuthorizIQj5M3O1SbtcIex7fSha256IAxKEhAIl38IB6NcstcIb2EIC6OeminioId2GILx8EjLIf2GIUxHEjCIh27ITxHEaCIj2DIZx4MpW1MIzH7Im24IMX5IgxJIGAAM1M16MpQ1LINLGMUl1UEeAIEUNIRKBIC1ymAdd2BlackListI8qWIOVEIAqAhmoveFromJB111aQISS4I61UImYXI61EIneMID2DIivLI319Mnw1KIL3eiBlockPushI11SgblockeeI41MkModifyPermiMC11HIjqSI29IMrK15M001KEQ7cfo MRL16IuB6I31MICeSIHfSIR19M531WIFzPIcmMcHasIc5TIsjWIu35I714dCodeIe1TI24MEV9IyV5eresulMdU19IJi9EbEI416ME915n_SUCCESS = 0x0IYK7EQ6fFAILURIEi4c0x0MG21JcrmIIrCfMpM1NI5yMbrmIo7hM2o1KIXmAM5K1MdjoinM6G17M1Q1NMHC15MEe1Qc32 I5u6cCouMOV1CMHP1GjhatroomBanIkC4MEe1Nh32 whiteIAG8IUj9IU4GdPullMU52qMYR18Il26IR4JI2z4IU16IKf7Ma52LMLd1KMp01HIi2BcNewIG7MIE28MWf1nMnA2JIpOEilationQryMMK1LMsC1QMNW1HIp4PMRc16Mhl19MvC2MeorderIC9JMLA27hEraseMsgMZY1AMWn1MM2R1AI89GIS6PIesMcqryIfsCMgB1IEU5MaB17Eg7M1f1MdbotTI457McQ1HIB6BgFilter MRD1MIC6zIe5BMeB19MCb1FbagM5x1KI867fTagTopIOyQdpageIfp8I26TI3FKIA48MbB1NEV8IwQ5binISSAIh2IbFiMTx19IPAMIEF4IOANIBFRa MXs1bIZ4eI34KIUUKMCR1gIcT9Ix3GMdu1Iemsg =IiNMdreadMZH27M501ObunEb4IiN5Is3PMnl1DMw61McverIVQ4Mm12NII28cminIj16MJJ2PIj1AIQENbUnIR37MrK16E87MXt1PIs16bMeIu18IdwHIv97bBoMHJ2AMdQ2DIn1DIWaMMzE2FIqNFcmsgIC66IYFMIb26M6Y25Mi31OMM025I4s7IRQHiQryRemindIlT4cReqIe2NMz12AIlXOIp7DI7EMIH37IUOPMZ917Ie2WbspImGGIZ7PItDSdReadIJ25I1EoIsCJM0R1NgtargetIMkK19IYWDgleanHisIy25IEKAI71TIE27M572SIE27MX12KI2E4I845I29DIQ7VIWZIIy24hMsgBatchI59AIMRCIW3GbinE64IT6JgHistoryImI7IWnSID4IIB4PIO6GIm9BIK6AI92PcsOuIdQJNgO231II2FbhaIc44IKkSMQN2HIjMMMQN2IIoMGIzRPb6;IzRcITVHMM215hChatRoomMZf1VI9Z5IcZOI8Z5IZq9Ia1SMZy2SIbS4iTotalNumsIV6CIvb9brmMSj16IIT6dnfosITsOEe7IynLMSv27IlUNIoz5M8q1IgPFollowInBSMp32CExJIqusaMMa216Ieb6Ih5IbMCJV1U1Ma41SdmpidM7838Ma41SIZGJI2tDIf6JMXy2HIzc8Mkn17cUrlMby2HM411EITd7MlD3DdarchIO34Im4PIS24IO3Ocid=Ie4IIM18I96ZIQ1AMxu18I76CIKDJIew5Io2PIn48Io2NIe65IM1OMIr1TMiF3DIn2UIbMIIvSEMLm2HIgOHMIA3cIjrCIOxnI4TKI5MhItfKggnoreCmMS03AIvQLbsgIqQhIM7HIoQEI4TNImQ6IMnNJkQf1IjQsMo127dsAttMa61FMgN1gI61BMbp1SeinboxMSC1QMVW27EaAIr5JIlA4IDR4Irh6Ido8IQfHIL27cMsgIfh4IR3LIghfI1lAMqM2UM813SIGfUIo2EMuT3rgDeleteSIK67M4W1LMh928IRH4MlM17M8X1LEeCNrR2E1IWzQI25uIQa5Jw371IC1DeOutPuID1vIM6EIR7rI1t8cDelIpnFM1B1HaOIDR7breEG6M8B1ObclI7p6IbPKIE1GIeYMIMrCMp13XI5sGMO52RIm7CIcFHIN56I5SOMMJ1ZI33OIfF9IyO8Ih18IFG4Ic74IbArI81AMUL3kIDI9IJN4MOU1NMH33CIrzLlhrmKVEntity IH7MMJF26IGFNevalueIw1PMh639IQSMInX4estampMUM2RInl5M5U1MM5F17MUJ1KcSetIW36ImIIIs3BeentryIKCOabMbl36IY3JMAe3GgnotificIaD8Io3GI4AJIwNJIq27bS MQU1HJr2P2IAB6Ju2o2IR26Men2OIt2FbieIvyBIv2FiFullUpdatIICNMz51EN9W1O1IV3IbSVIeC6IhFDIDDPMKc2YIljDIb17I75SET7IE58grrorKeyMB41OIq2HdkeysEI7MN41OIc1GIPLMIMJDIrIFIQ25MI22OMr717IPHKIMJIIgTMIa7JM594IMgA47fettingIKwRIv67INwOIdM5Izo8ICrKIO5AI4jJI82CISlSI92OIg15greserveI92MbupIwC4I92RI7z4II4rIg1EI92OMDf2FI32WInBMIa2Chtem itemMdy2NIi2BM8d1II91FMAQ1UMbd3iIiVMMyc3GIiH6IhV8Mvc3MI338Msc3JMU51AMdj17IuiGcTagIU35dtagsMmq2JEc7MYe1JMoJ1IEuJMD925MTl3AIqAUIT2EMAA26I334MXb18IY1OJUqU1Ic37MLz1GI32CI955Ii25EA5MK81hIN3OIx9KEWCIW35Iwp7EHAIweeII8SI3fTIOVCMlN25IO2HMC637esSileMeD2CbIsMc326I627cTagIi1BgAutoTraICt5Md01OIb15MqW26IVAPIY9nIeMnMdR25Mxh36IcQ5IzRNMJk3EI71RcSetI41eIqFHbunI414dLeveM6I3MIe1AgResult M1u1WM0u1hIF2TMiA1OIH7DMgt1BIXPgIDRGIx3HIOA4Iw36NMC101IucAIt3fIU9WIlBHIm2AI4WZIyZOIQ4XmGrpReadReceipM6b4DM6J2EIXy5MXk4OIGLHIa1QMX125M771HJd131Ia1BMTW1rMEh4AMpj4UMrJ1LM9M47dreadIKM6b4 MLO2MIc35ds= 5EW7MHP4KMtB3AIOiHId37IA5AIg3hIBFJIXcMMMj1GI83KMpg2PMnV2AMlg2MMFb17MPR2bMQE2JIg58MqI2NMRO25MkI28b EZObSiMIC25MHF3OMZP2CMcI28Mbv3PIFpMIr67MDJ1OEaCIChGIS4PIi1TJW871MxB1NIX8iIlEEI4B7MbH2IIaBEbspIYY5cresIhtXMSQ4KM711DM5117MzZ4OIf7BMoT1MI87EI03UEb9IYo9J53F1Ml62IIw1LJA8q1IC7LMXa25IV5UIt2VMtO1XMpO1TMQj15aCM2c1LMpP2AEW6Mn34GIZ27Iuu4Ec5E95Mxv4PMmd16dListMic2PMLe17Il15I3tGIl1CEe6In17Mtj3IIoTIIVbLI548MdD26cNumMcA1JcGrpMak17Im15MuL27IfVKEdCIrYLIoM5MuE2TMfj2EIveJfTagAddMg81iIAyRMn81uIC1DMq21OILZRdnameIzTKMOA39Ik45M2C5OcTopMTE5JIP29cDelJd482fDisTagI0eQIf4BMU81NMuS15MFS18NTE111IHQEgportSDKMxl1SgsdkInfoMlo1KI017Mlp1rhUltraGrpMKJ56M6718MrF3ZMY93aMrD1IIm1BMbH3hMdN1pIC24ehangeM2q2QMAt4TIlQII9sGIEtJM5K4NfmsgUIDMAG1JI0PGM203qMEu4HMJC2HIyx6IqK5IWM9I7RGEZ5I16NMx33NILeNI569Ih7nI0B7eeedCoIdYPMvn47fnlineTM4e1MI97II3JHeEventIh26IrS5IoGFEVBNt4501ehasNeML845a3IIsNIg2GInDIIL4BIPt6IF3NMlA1QeinessILZLMaM3QM6L1aMhY3IcngeI217MAw3OjriginalId MVw1PEa8MfQ3NMhc39hcondaryIMbQ3KI657eAdminM0b5OdaddiEG6dMarkIMt6Iv2MgperatorMRV5MMlU17bubIJ66M7N18IqBMIw29Ed8Mig5NM0736bMeMm84BIcRGcextMXu37ItyMMoB3AMb55KIBm6eeventI8m7MV846IkLLIyCKI8GAIwCzIxCHI52LMS33oMJd1ZMlW1MMvx2EIfBJIEONMvd1PIFOAIWBNIFODIVBqeisDelMSN3JJLBK1MJP3HIMBxIsk4MA046JSBZ1MvV1CJM991Mzn49Id15IZ15MkT25Mbd45IY95c //MSt4HEjFISTLI29AMPt2OI5A9MXQ2rIO48cAckM5F3oIH7EhnotExistMjr58IKXHbOpIFA4heStatus MW31XIMRTMzN1NM6C48Mdw3NM9S2bIh2DM2G27IZj8M5V2ZIuRHMSG25IJO8M6Q39I859In17MRz2CIXX8EcIjSummary suE86c= 4IILHIJ1CNH91N1M901GME03NIH68Mev2MEF4I1jAI634Eb4IJ6JIm37NXC1T1MT33WIF3DMHA3FdtRtcM4M35Mt31MM9q48brtEc7Md02LI71AMkL4tcCalMNC55MhQ28MMb2QIgHPddataISu7ICyIIY18IpGAJa161ILKIaaM2035MJ94IbKvMu41RIfoGEvEMwk1SIo17IvJJIp14M9E3REV7M8h2RMB22UMvi1SM601JIJRyI1PYMKY6LbrtIrN8MEm5OcndMEY7MP96JMln1KMQu3TMjx1jMpn3ZMGR1GML81NMvL1LMpN1CMsL1CMBi1LMBR1BIB4JMLM1BMdR1HEX5IuzNM364WMaW3EMQb1OMPJ5AI4xLimentionedIH7QcCntIK7DMzx2qM4I2RIeARMWh1LMVh1RIk28Mbe1IMiS17Ir64MJd46Mpf3LEbAM8a1nIrP4M1L4RbtmMnM1LMXl26MtL15bubIi5JIfl9M1K2GMSW2ChubDetailM7n68Mn81NIUbSMlg27cxpiIKY6MVO1LIg19Mdp6NM9p68ImMKIl3FMv54JIG3OMzv5NcubTMyv5FMVb2HIS5OMfo2aMho1CIa1IbUlIa1AIH3PMV015IAkEIA2PM1D1WMMr1dMXR4JcullICNKIe2CIM6xInADMxw2NIs69I9AaI9BQI93HMQV15fubDataIs7WMoT1SgneedAllMx668Iq5YMal2LID29IV8IER7IQ57IX8aMcL1dJb8J1Ik2EMj57ScStrMLv4RIfGBMtc2HIb16IQf5MYN4QIb99IClJI317IJLLhplatformMPN4CEbHMKK3RIF6HINYIcrySI8ASISNxIxEGgProfileIdJtIuXGI929IP17Ih45Myq55If17InUIEgGcExtEjAILPHEkCMW73iMwl2KMg33JIX17Mxd1QMiC3iIUYIpcensorFailedFielMPE15Mk13PIH29MYs1OMMK5QI11BMWh6HI68CII8CI91UMcu3sI31BMZL5AImDNEWAIB1UInytMGB46IBCRMdA29M7c6AMrC6NMKQ7MMi41YMwJ1ZIsBCbseMqz15ILDccextIHDFIx1IdBaseEj5abE98MrE2QIMH7MuH4IIE1GIE4MM4725MlS18MLT1NbwnIPpNMXI5JInNMMXI5EIrNIIy68MU22PMoC15MHC15M4s1TafMoi66MOi5OMOb4OIiB4hrocessCoMuP35Ia6NgsJoinedIP55Iiq8Ig6MEn8McE68MOX4DMha1GkFriendInvitIt66bfrEHFMxa1IEq6IX19Eo6EF9MJD5II1KSMc077IbrCdultiIA38IQvgI74HISE6MbM2EMp12HJBFR1EZ9dQuitIe18M1F27IJF8It47MDd1RMQn2QIcA8IehDMt51DIv1IIb3FIHd7Eg4MtD5QM0445IwnPEW5eWhiteMp13PEY4cAttMU316ITETM5d17JL6Q1If18jPageParam MAV67IC6NbidIA6QbroMsE67Mbt2OMiO5AI7LPID2BIDeMMXs27IAwdMa72hM8X6EMt038MyX4NMT728I73JMu657MaF3AI51FIOE4IMhEMwn1FMVl59Iu6kIgU4IjULIQJ4Mov58INK4MGU5MEfHIqrDIV1NI7K8IN1PIeK9IF1ZIvNAIH1PIUOBIJ1EIW2RIpZOMnP2FIm5HI214cExtIbX8MtJ2QbpTMpJ2TMxI7EMEq4RIOJLII2KIf9LIPE4ImyPMNq5BMkD3UdNickMJT6UMNE2AIR3QfremarkIA17Mof4LcisBIgL5M8s7NbanM0V7VMjQ58MMq27Iv4JMjp26MnF16JfLS1M8p1WIe5PMcr7OIe5CMMF3NISSDMUz6OI5DCI14eIdkcIMlSIdkDMID4NIdkKIkeOIECCI0e8MgA4MIgJNI48uIWHAILD4IMeBI2NOEZ9binI724El8ME91NMYR48I4UMMGX79I9UTIoF5IL8BMSz7KMI715Mhg5OdapplMDg28M3J2GIT3HIil7IT37MMU7MEa7Ion8MtL7IItEDgResponsJvET1IAD8IhU8Mo02OIjV8IoEPIK89MZX4KIZb8I887Mkj6RIS6EIY4QNX01T1MfT6HMH91HIbr8MhA5uMEe3XMHD28Ix1MMpz5NET6ES7IGYGI41EMvU8TIsWPICzKMnw6OIDz6I73OMPV7SI55jIU1JeCheckIg4SEXCIibPEhIIt7tIkJ9Iq2NMTG1JMqG2oIHYDInQkIM2PMWg6TMI21LI1ANIEuQMZl37EW4IGnNIlmPIkJMMN516Mfq5BII2IIDjuMh328Ma156MSW3TIA2AIxLPIuC7IkfqIFkEInLNIFkEMLW3GIY8PIRS7INKNMhB19I55lMGe5LIs2UI05MMko4CI5EQMr13NITJDI15NIaM7M2v3MIb7DM9b3HIYI7Mwu6IJ6KF1MpA45cSetMp01NMJB47IrJOMy41GM051VMC12lIwDEIOyHIREFIcMVI2AAIB1NIZABMq01REi6aAIMe4MYD35I25MIse6MgX6SIC8DIpVZJTz71M6A2GIrK5MmR18MBO1MMWS1QIbmXIWoBMlq1IMAC29I02SID1AEl5MDS1CI22XcoptIcoGIFfJIN75MmZ2DMnA1WIsG6MNK6OMi289MW138IW3WIh2EIS3OIH6PIPVGMnY1TIGwNIW1JdFullIQwCIoEIIGB4ME836IVCLMvb39IqD5I3JQIVCIIXGJID85If1SINS6M678CIIRaIn1HcAddMeU46ePerioMNq2TMrs6CM8d4MispanMinutM0E55IOWMIBM8MKZ3OgimezoneM2J5QIp2XMJK7cJ9191I91CMav1SbisMrR89MzC2OIf5BMoU5NIf5DIUWMIf58M3q8OIf5AMje2JMyg59J7wU1MHp2TMqh5GIK8HMWd27IoCSNgD4U1M1n2DIFcMMTC4CM4s1GMEE4GMeD46MvH1IMhZ86M3j5OMOQ39M9i35Mda1TMki39I5PNmSpeechToTextIEa4MX39sfobjectMIQ9VM7F9PIqB7fampleRMMs7MMhY3AdnelNMyE88IsmNfformatIthQMsN78Mg81II469Me44SI56jM6C19I76TMRi1MIQO9MQT7CMRh8KIJ16Mfv4KdransMvI2JEO5I085ctraEA6MWe2QcmodM5H3LMZ596dorceMi658IYwHI427MDb2IEP8IV34Ic36I42dIW1HIusREe7MQ546IDoNI514IehUbteMfc2SI315dFileIBh6Mqx7OMyv85aLMKd15IBBNI8M6EZ6MkU7MM9r65aSMAx86IKBKIU5CIP4pIN3CICBEIM3UMT54TEZ6IiFNM5E26MiB8NIp3BM7d1JMrG45M2B4Acq {MWr4IMNI77MUO4AMvh4dIvA9IJA9MhZ3AM3X2LMFD4KMk53AET8MWI27ICRMdnextMr65FMfJ9hIF3GM8n2HMMp5dIm2AIXKLII4DMQG4jMJ09DbacEB4I2W6creaMRA98MAV4OMbb7OMre2WMMV7UIx4DMpZ4HMg21GMvZ4PMyT1NEU7ET7MAV57MO92xIg7BMiL9uIN2EN8g3N1MUS4QI37MMrs6HMBa66Iqu6EB5Mc22LEcBIxALMMI36I0QNMfK26Iid6IJfMEZ7cMeCM3t4RIvh4brTM1w6KEW7eutOffEX5I8KGMjL7EMUx85EJ9IJKCMGc55IVy4M8c5BhKICK = 0IL16eREFUSMZi8BgCOEXISTMTC9HbTaIb74I91BgROOM =1MMI27MgC99MCz5PMvAAWM8u6CIoHDM3477ICxVM7P86IrpHbtcIGt5MnK1GMlB7LI01KcKeyIcw6MnL1Sdkey=EzKeValueMZi3UM236ZIN1FMGC1FMqw4MM8r4HII2DEa4I3G4IY1PMWJ8QI52CMUa25MKv4OM0f85Mjs4HMp68GIVL8Ii2MdroomMs52EEeCMoI6JMb7ANMgq3AIVbMkofflineKickMTF2CIX4FM4K7UI6l8MUx35MGj3KIV3GM1L3NMEL7AMam6FIF6LMO175M4e3IbtcMM61RI124Mhh15MVM4NMjq98Ea5IsUHID3CIkr5eInnerMWL5NMtO39bSyIZO4MfC85IVYJbIdIPL4btyM4P4BbidEJHIj7II1K9Me92II46MbinIm27McX5BEgMeouterEg8Mhc1HIvH4bryIwCPI91DM315NMXi85caInIp6JMUP26fnterioIwI7EUBIrMBIdU6Mm34AIwIIIQZNMf11AMmM7OMd117IjQ6Iz2FcSetJ23K1I4LIMNz4NI4L6MHn4OIV3AIFsNIV38MC38IInD6IZ3LIf7KIC25MtU1EIl2GMS71KIF1MMY71FI0AIIt5RcsInJx8B1ItAGbelIL4PIwRRIS2GIp7GIS2II12KMrD5fIjfPINSKMJ79RInN8Eb7IJFLfSetOutINCPIW3IIuOTIM99IZTOIcBBMst9QIcB5IrOKcQryIfB4Ir2LMIU3eIlC7I617INXcIA1NMBiAZMsX7SMF51PImU6IM9LdPullM5i6hIR8HIEW8IS9KI6Z9NR47Z2Ix2HIJ7PNIv6R1MMB28Iko5IkWJIF26mAnchorToVieweMmr3BEG6bToEW6IQ6NMPg16cserMtp18MF59rbtcMep2HMeY4HdevicMsb3BI89WMep8XIF3UIv6PIj2BMKY8CIfpGI655ID1LIUKSIe8XMN37cIhhHMo826MQ18REY5Mi226MLk5IMEdA8fimeoutMFk7LIA1EMhj47IEYNEb6IhM5Mv95NEY6MJk99IhDMeCanceMm7A6IY3oIz2UIa3TIz25IX3TIz2AI7oMEa4hAnswerInIy2WIx2NIV67janswerCodeIu2UIT6aIw2FMJXAPIoeOIOZ4M9i1NIGg6IFvKcEndIG7eIA37IF7TIA3AIN4TMKq48MnV3OIo19dKeysIJ7IcBotILWSMoW36MwK9IbotIgG6EsFIG15ffo botEuOEW4IozMMnG87MCW5MMiY2yMZD8EMB41GcMetMkTA5Mi4A7MxTA9MpoAPMrY2QMAA67IES5MA41OIn1CMQA4UIH4MMRA4PMDW18NRp201N9Q121MYj4KMps1KIm27MU53KM6fAKMij2OMcDBAM4j9NMcDBAM3j9NM4x5DMHuAHIV58MXM5AMqJ6IMCF36MT35NI318MUP65cQryJb6o1M9q4TMZa1RMtV3LcallMFL67IS6OM9c1BMf79JIJ46MT54NI62GME32MMfc1HMQW5HMjE25IYC7M4s86EG8MMZ6tIK1FMdt4qIs88Mqa1DMYE2BIq2BMal1SEf8JQ9r1J1GE1IU9VMUq2DIrFNIz6CMPXBTIpFSJSAM1Msl4XI88ZM355JES6M4117Jv2s1Mew1HIv2fMfC2RIs8DMiA3OICMDMdW1RM6o1LMCA76cserII25M9h6KIa5AM0618MFZ2JEbBMuD3tIC3IIa1KMBY2SJvFf2MF05FMAY1HIv5GMh57QIY7AMvX17b}\n3Q4C"),Al=function(){function e(e){ca.add(this),Object.defineProperty(this,"pbModules",{enumerable:!0,configurable:!0,writable:!0,value:void 0});var t=la.loadProto(e);this.pbModules=t.build("Modules").probuf}return Object.defineProperty(e.prototype,"encode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this.pbModules[e].encode(t).toArrayBuffer()}}),Object.defineProperty(e.prototype,"decode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){try{var r=this.pbModules[e].decode(t);return c(this,ca,"m",da).call(this,r)}catch(t){var n="name: ".concat(e,", stack: ").concat(t.stack);throw null===console||void 0===console||console.error("pb decode error!",n),t}}}),e}();ca=new WeakSet,da=function e(t,r){var n,i=this;if(t instanceof Array)return t.map((function(t){return c(i,ca,"m",e).call(i,t)}));if(n=t,"[object Object]"!==Object.prototype.toString.call(n))return t;if(t instanceof la.ByteBuffer)return t.toArrayBuffer();if(t instanceof la.Long)return r?t.toString():t.toNumber();var o={};return Object.keys(t).forEach((function(r){var n=t[r],a=t.$type.name===Aa&&"seqId"===r;o[r]=c(i,ca,"m",e).call(i,n,a)})),o},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"}(fa||(fa={})),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"}(_a||(_a={})),function(e){e[e.GROUP_SUCCESS=0]="GROUP_SUCCESS",e[e.GROUP_FAILURE=1]="GROUP_FAILURE"}(pa||(pa={})),function(e){e[e.IsSilent=1]="IsSilent",e[e.IsTop=2]="IsTop",e[e.Tags=3]="Tags",e[e.AutoTrans=4]="AutoTrans"}(ha||(ha={})),function(e){e[e.KICK=0]="KICK",e[e.REFUSE=1]="REFUSE",e[e.COEXIST=2]="COEXIST"}(ga||(ga={})),function(e){e[e.ROOM=1]="ROOM",e[e.PERSON=2]="PERSON"}(Ea||(Ea={})),function(e){e[e.AnchorToViewer=1]="AnchorToViewer",e[e.ViewerToAnchor=2]="ViewerToAnchor"}(ba||(ba={}));var Ol,Sl,Cl,Nl,Ml,Pl,Ll,wl,Ul,Dl=new Al(yl);exports.LogLevel=void 0,(Ol=exports.LogLevel||(exports.LogLevel={}))[Ol.LOG=0]="LOG",Ol[Ol.DEBUG=0]="DEBUG",Ol[Ol.INFO=1]="INFO",Ol[Ol.WARN=2]="WARN",Ol[Ol.ERROR=3]="ERROR",Ol[Ol.FATAL=4]="FATAL",Ol[Ol.STATISTICS=6]="STATISTICS",Ol[Ol.NONE=1e3]="NONE",exports.LogSource=void 0,(Sl=exports.LogSource||(exports.LogSource={})).IM="IM",Sl.RTC="RTC",exports.ConnectionStatus=void 0,(Cl=exports.ConnectionStatus||(exports.ConnectionStatus={}))[Cl.CONNECTED=0]="CONNECTED",Cl[Cl.CONNECTING=1]="CONNECTING",Cl[Cl.DISCONNECTED=2]="DISCONNECTED",Cl[Cl.NETWORK_UNAVAILABLE=3]="NETWORK_UNAVAILABLE",Cl[Cl.CONNECTION_CLOSED=4]="CONNECTION_CLOSED",Cl[Cl.KICKED_OFFLINE_BY_OTHER_CLIENT=6]="KICKED_OFFLINE_BY_OTHER_CLIENT",Cl[Cl.WEBSOCKET_UNAVAILABLE=7]="WEBSOCKET_UNAVAILABLE",Cl[Cl.WEBSOCKET_ERROR=8]="WEBSOCKET_ERROR",Cl[Cl.BLOCKED=9]="BLOCKED",Cl[Cl.DOMAIN_INCORRECT=12]="DOMAIN_INCORRECT",Cl[Cl.DISCONNECT_BY_SERVER=13]="DISCONNECT_BY_SERVER",Cl[Cl.REDIRECT=14]="REDIRECT",Cl[Cl.USER_LOGOUT=19]="USER_LOGOUT",Cl[Cl.APPKEY_IS_FAKE=20]="APPKEY_IS_FAKE",Cl[Cl.FORBID_RECONNECT_BY_OTHER_SAME_CLIENT=31023]="FORBID_RECONNECT_BY_OTHER_SAME_CLIENT",Cl[Cl.ULTRALIMIT=1101]="ULTRALIMIT",Cl[Cl.REQUEST_NAVI=201]="REQUEST_NAVI",Cl[Cl.RESPONSE_NAVI=202]="RESPONSE_NAVI",Cl[Cl.RESPONSE_NAVI_ERROR=203]="RESPONSE_NAVI_ERROR",Cl[Cl.RESPONSE_NAVI_TIMEOUT=204]="RESPONSE_NAVI_TIMEOUT",Cl[Cl.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",Cl[Cl.RC_CONN_USER_OR_PASSWD_ERROR=31004]="RC_CONN_USER_OR_PASSWD_ERROR",exports.RTCMode=void 0,(Nl=exports.RTCMode||(exports.RTCMode={}))[Nl.RTC=0]="RTC",Nl[Nl.LIVE=2]="LIVE",Nl[Nl.SIP=4]="SIP",Nl[Nl.CALL=5]="CALL",Nl[Nl.MEETING=6]="MEETING",Nl[Nl.CROSS_MUTI=7]="CROSS_MUTI",Nl[Nl.CROSS_LIVE=8]="CROSS_LIVE",function(e){e[e.AUDIO_AND_VIDEO=0]="AUDIO_AND_VIDEO",e[e.AUDIO=1]="AUDIO"}(Ml||(Ml={})),function(e){e[e.ANCHOR=1]="ANCHOR",e[e.AUDIENCE=2]="AUDIENCE"}(Pl||(Pl={})),exports.RTCApiType=void 0,(Ll=exports.RTCApiType||(exports.RTCApiType={}))[Ll.ROOM=1]="ROOM",Ll[Ll.PERSON=2]="PERSON",function(e){e[e.AnchorToViewer=1]="AnchorToViewer",e[e.ViewerToAnchor=2]="ViewerToAnchor"}(wl||(wl={})),exports.RTCJoinType=void 0,(Ul=exports.RTCJoinType||(exports.RTCJoinType={}))[Ul.KICK=0]="KICK",Ul[Ul.REFUSE=1]="REFUSE",Ul[Ul.COEXIST=2]="COEXIST";var xl,Gl,Vl,jl,kl,Fl,Bl,Hl,Yl,Wl,Jl,ql=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,r){var n=this._map[e]||(this._map[e]=[]);n.some((function(e){return e.listener===t&&e.target===r}))||n.push({listener:t,target:r})}}),Object.defineProperty(e.prototype,"once",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._map[e]||(this._map[e]=[]);n.some((function(e){return e.listener===t&&e.target===r}))||n.push({listener:t,target:r,once:!0})}}),Object.defineProperty(e.prototype,"off",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._map[e];n&&((n=n.filter((function(e){return e.listener!==t||e.target!==r}))).length?this._map[e]=n:delete this._map[e])}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=this._map[e];if(n)for(var i=0;i<n.length;i+=1){var o=n[i],a=o.target,s=o.once,c=o.listener;s&&(n.splice(i,1),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}(),Kl=function(e,t,r){var n=null==r?void 0:r.isReverse;Rt(e)&&function(){for(var r in e)t(e[r],r,e)}(),(It(e)||gt(e))&&function(){if(n)for(var r=e.length-1;r>=0;r--)t(e[r],r);else for(var i=0,o=e.length;i<o;i++)t(e[i],i)}()},Ql=function(){function e(e){Object.defineProperty(this,"pbCodec",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.pbCodec=new Al(e)}return Object.defineProperty(e.prototype,"encode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return r?t:this.pbCodec.encode(e,t)}}),Object.defineProperty(e.prototype,"decode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this.pbCodec.decode(e,t)}}),e}(),Xl=function(e,t,r,n,i){var o=n?Object.keys(n).map((function(e){return{key:e,value:n[e]}})):void 0,a=i?Object.keys(i).map((function(e){return{key:e,value:i[e]}})):void 0;return Dl.encode(el,{roomType:e,broadcastType:t,joinType:r,innerDatas:o,outerDatas:a})},Zl=function(e){var t=Dl.decode($u,e),r=t.users,n=t.token,i=t.sessionId,o=t.roomInfo,a=t.entries,s=t.offlineKickTime,u={};return Kl(r,(function(e){var t=e.userId,r=e.userData,n={};Kl(r,(function(e){var t=e.key,r=e.value;n[t]=r})),u[t]=n})),{users:u,token:n,sessionId:i,roomInfo:o,kvEntries:a,offlineKickTime:s}};exports.StreamMessageResponseEventType=void 0,(xl=exports.StreamMessageResponseEventType||(exports.StreamMessageResponseEventType={})).INIT="INIT",xl.DATA="DATA",xl.END="END";var zl=function(e){function r(t,r){var n=e.call(this)||this;return Gl.add(n),Vl.set(n,void 0),jl.set(n,new Map),kl.set(n,void 0),d(n,Vl,t,"f"),d(n,kl,r,"f"),n}return t(r,e),Object.defineProperty(r.prototype,"requestStreamMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=c(this,Gl,"a",Fl).createTraceId(),c(this,Gl,"a",Fl).info(B.L_REQ_STREAM_MSG_CONTENT_T,"messageUId: ".concat(e),t),[4,pr.create("requestStreamMessageContent").isLimitedString("messageUId",e,1,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID,"messageUId is invalid.").result().tryTrans(c(this,Vl,"f").validateConnected).tryTrans((function(e){var t,r;return(null===(r=null===(t=null==e?void 0:e.streamServer)||void 0===t?void 0:t.addrs)||void 0===r?void 0:r.length)?fr(e.streamServer.addrs):_r(exports.ErrorCode.STREAM_MESSAGE_DISABLE)})).next((function(t){return c(n,Gl,"m",Jl).call(n,e,t)}))];case 1:return r=i.sent(),c(this,Gl,"a",Fl).summary(B.L_REQ_STREAM_MSG_CONTENT_R,r,t,{messageUId:e}),[2,r.wipe()]}}))}))}}),r}(ur);Vl=new WeakMap,jl=new WeakMap,kl=new WeakMap,Gl=new WeakSet,Fl=function(){return c(this,Vl,"f").logger},Bl=function(e,t,r){var n=c(this,jl,"f").get(e);n&&(c(this,jl,"f").delete(e),c(this,Gl,"m",Hl).call(this,e,exports.StreamMessageResponseEventType.END,t,n.msg))},Hl=function(e,t,r,n,i){this.emit("message",{code:r,messageUId:e,type:t,chunk:i,message:n})},Yl=function(e,t){e.content=n(n({},e.content),t),c(this,Vl,"f")._innerSetMessageContent(e.messageId,JSON.stringify(e.content),e.messageType)},Wl=function(e,t,r){var n,i,o=c(this,jl,"f").get(t);switch(e){case"init":o.msg&&c(this,Gl,"m",Yl).call(this,o.msg,{content:"",stopReason:0,completeReason:0,isSynced:!1}),c(this,Gl,"m",Hl).call(this,t,exports.StreamMessageResponseEventType.INIT,exports.ErrorCode.SUCCESS,o.msg);break;case"complete":i=(n=r.length?JSON.parse(r):{}).complete||!1,o.msg&&c(this,Gl,"m",Yl).call(this,o.msg,{stopReason:n.stopReason||0,completeReason:n.completeReason||0,complete:i,isSynced:i}),c(this,Gl,"m",Bl).call(this,t,n.stopReason||0,i);break;default:n=JSON.parse(r),o.cached+=n.content,o.msg&&c(this,Gl,"m",Yl).call(this,o.msg,{content:o.cached}),c(this,Gl,"m",Hl).call(this,t,exports.StreamMessageResponseEventType.DATA,exports.ErrorCode.SUCCESS,o.msg,{content:n.content,fullContent:o.cached})}},Jl=function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,s,u,l,d=this;return a(this,(function(a){switch(a.label){case 0:return c(this,jl,"f").has(e)?[2,_r(exports.ErrorCode.STREAM_MESSAGE_REQUEST_IN_PROCESS,"Request in process, msgUId: ".concat(e))]:c(this,jl,"f").size>=3?[2,_r(exports.ErrorCode.STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED,"The request queue is full")]:(r=ua.createSSEClient({logger:c(this,Gl,"a",Fl),msgUId:e,appkey:c(this,Vl,"f").appkey,token:c(this,Vl,"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 r=t.indexOf("\n"),n=t.slice(0,r).replace("event:",""),i=t.slice(r+1+5);c(d,Gl,"m",Wl).call(d,n,e,i.trim())}}))},onNetworkError:function(t){c(d,Gl,"m",Bl).call(d,e,t,!1)}}),r.isOk?(n=r.data,i={client:n,cached:"",msg:void 0},c(this,jl,"f").set(e,i),c(this,kl,"f")?[4,c(this,Vl,"f").getLocalMessage(e)]:[3,2]):[2,r.wipe()]);case 1:if(o=a.sent(),s=o.code,!(u=o.data))return c(this,jl,"f").delete(e),[2,_r(s,"message not found, msgUId: ".concat(e))];if(u.content.isSynced)return c(this,jl,"f").delete(e),[2,_r(exports.ErrorCode.STREAM_MESSAGE_SYNCED,"synced")];i.msg=u,a.label=2;case 2:return[4,n.open(t.slice())];case 3:return(l=a.sent()).isOk||c(this,jl,"f").delete(e),[2,l.wipe()]}}))}))};var $l,ec,tc=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 Ql(t)}}),Object.defineProperty(e.prototype,"createPBCodec",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return new Al(e)}}),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.42.0"}}),Object.defineProperty(e.prototype,"getAPIVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"5.42.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,r){return console.warn('[PluginContext] sendMessage is deprecated, please use "sendMessageTo" instead'),this.sendMessageTo({conversationType:e,targetId:t,channelId:r.channelId},r)}}),Object.defineProperty(e.prototype,"sendMessageTo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._context.sendMessageByPlugin(e,t)}}),Object.defineProperty(e.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){void 0===n&&(n=[]),this._context.registerMessageType(e,t,r,n)}}),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,r){return this._context.setCallInfo(e,t,r)}}),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}(),rc=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"joinRTCRoom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,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=Xl(t,r,n,i,s),[4,this.rtcSignaling(e,li,!0,o)];case 1:return u=a.sent(),l=u.code,c=u.buffer,l===exports.ErrorCode.SUCCESS&&c&&(d=Zl(c)),[2,{code:l,data:d}]}}))}))}}),Object.defineProperty(r.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(r){switch(r.label){case 0:return t=Dl.encode(Ku,{status:0}),[4,this.rtcSignaling(e,ci,!0,t)];case 1:return[2,r.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return a(this,(function(n){switch(n.label){case 0:return[4,this._context.rtcPing(e,t,r)];case 1:return[2,n.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"rtcPingResVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._context.rtcPing(e,t,r)}}),Object.defineProperty(r.prototype,"getRTCUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){throw new Error("Method not implemented.")}}),Object.defineProperty(r.prototype,"setRTCUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return n=Dl.encode(zu,{key:t,value:r}),[4,this.rtcSignaling(e,di,!0,n)];case 1:return[2,i.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"removeRTCUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return r=Dl.encode(Zu,{key:t}),[4,this.rtcSignaling(e,fi,!1,r)];case 1:return[2,n.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"setRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,s){return o(this,void 0,void 0,(function(){var o;return a(this,(function(a){switch(a.label){case 0:return o=Dl.encode(nl,{interior:n,target:i,key:t,value:r,objectName:null==s?void 0:s.name,content:null==s?void 0:s.content}),[4,this.rtcSignaling(e,_i,!1,o)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"setRTCTotalRes",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,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:n,content:[{key:t.name,value:t.content}],valueInfo:[{key:"uris",value:r},{key:"mcu_uris",value:i}]},s=Dl.encode(il,o),[4,this.rtcSignaling(e,pi,!0,s)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"setRTCCDNUris",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return n=Dl.encode(il,{objectName:t,valueInfo:[{key:"cdn_uris",value:r}]}),[4,this.rtcSignaling(e,pi,!0,n)];case 1:return[2,i.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"getRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){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=Dl.encode(rl,{interior:r,target:n,key:t}),[4,this.rtcSignaling(e,hi,!0,i)];case 1:return o=a.sent(),s=o.code,u=o.buffer,s===exports.ErrorCode.SUCCESS&&u?(l=Dl.decode(tl,u).outInfo,c={},l.forEach((function(e){c[e.key]=e.value})),[2,{code:s,data:c}]):[2,{code:s}]}}))}))}}),Object.defineProperty(r.prototype,"removeRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o;return a(this,(function(a){switch(a.label){case 0:return o=Dl.encode(rl,{interior:r,target:n,key:t,objectName:null==i?void 0:i.name,content:null==i?void 0:i.content}),[4,this.rtcSignaling(e,gi,!1,o)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"setRTCOutData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){return a(this,(function(e){throw new Error("JSEngine's method not implemented.")}))}))}}),Object.defineProperty(r.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(r.prototype,"getRTCToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return n=Xl(t,r),[4,this.rtcSignaling(e,Ei,!0,n)];case 1:return i=a.sent(),o=i.code,s=i.buffer,o===exports.ErrorCode.SUCCESS&&s?(u=Dl.decode(al,s).rtcToken,[2,{code:o,data:{rtcToken:u}}]):[2,{code:o}]}}))}))}}),Object.defineProperty(r.prototype,"setRTCState",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return r=Dl.encode(Qu,{state:t}),[4,this.rtcSignaling(e,bi,!0,r)];case 1:return[2,n.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"getRTCUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o;return a(this,(function(a){switch(a.label){case 0:return t=Dl.encode(Xu,{order:2}),[4,this.rtcSignaling(e,Ii,!0,t)];case 1:return r=a.sent(),n=r.code,i=r.buffer,n===exports.ErrorCode.SUCCESS&&i?(o=Zl(i),[2,{code:n,data:o}]):[2,{code:n}]}}))}))}}),Object.defineProperty(r.prototype,"joinLivingRoomAsAudience",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return n=Xl(t,r),[4,this.rtcSignaling(e,Ti,!0,n)];case 1:return i=a.sent(),o=i.code,s=i.buffer,o===exports.ErrorCode.SUCCESS&&s?(u=Dl.decode(ll,s),l=u.rtcToken,c=u.entries,[2,{code:o,data:{token:l,kvEntries:c}}]):[2,{code:o}]}}))}))}}),Object.defineProperty(r.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(r){switch(r.label){case 0:return t=Dl.encode(Ku,{status:0}),[4,this.rtcSignaling(e,vi,!0,t)];case 1:return[2,r.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"rtcIdentityChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return n=Dl.encode(el,{roomType:exports.RTCMode.LIVE,broadcastType:r,identityChangeType:t,needSysChatroom:!1}),[4,this.rtcSignaling(e,Ri,!0,n)];case 1:return i=a.sent(),o=i.code,s=i.buffer,o===exports.ErrorCode.SUCCESS&&s?(u=Zl(s),[2,{code:o,data:u}]):[2,{code:o}]}}))}))}}),Object.defineProperty(r.prototype,"requestRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=e.invitedRoomId,r=e.invitedUserId,n=e.inviteSessionId,i=e.inviteTimeout,o=e.inviteInfo,s=e.roomId,u=Dl.encode(cl,{invitedRoomId:t,invitedUserId:r,inviteSessionId:n,timeoutTime:i,inviteInfo:o}),[4,this.rtcSignaling(s,mi,!0,u)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"cancelRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=e.invitedRoomId,r=e.invitedUserId,n=e.inviteSessionId,i=e.inviteInfo,o=e.roomId,s=Dl.encode(dl,{invitedRoomId:t,invitedUserId:r,inviteSessionId:n,inviteInfo:i}),[4,this.rtcSignaling(o,yi,!0,s)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"responseRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return t=e.inviteUserId,r=e.inviteRoomId,n=e.inviteSessionId,i=e.content,o=e.key,s=e.value,u=e.agree,l=e.roomId,c=Dl.encode(fl,{inviteUserId:t,inviteRoomId:r,inviteSessionId:n,content:i,key:o,value:s,answerCode:u?1:0}),[4,this.rtcSignaling(l,Ai,!0,c)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"endRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=e.endRoomId,r=e.sessionId,n=e.content,i=e.keys,o=e.roomId,s=Dl.encode(_l,{inviteRoomId:t,inviteSessionId:r,inviteContent:n,inviteRoomKeys:i}),[4,this.rtcSignaling(o,Oi,!0,s)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"registerRTCSignalListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._context.registerRTCSignalingListener(e)}}),Object.defineProperty(r.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i;return a(this,(function(o){switch(o.label){case 0:return[4,this._context.rtcSignaling(e,t,r,n)];case 1:return[2,{code:(i=o.sent()).code,buffer:i.data}]}}))}))}}),Object.defineProperty(r.prototype,"getRTCJoinedUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o;return a(this,(function(a){switch(a.label){case 0:return t=Dl.encode(sl,{userId:e}),[4,this.rtcSignaling("",Si,!0,t)];case 1:return r=a.sent(),n=r.code,i=r.buffer,n===exports.ErrorCode.SUCCESS&&i?(o=Dl.decode(ul,i).info,[2,{code:n,data:o.map((function(e){return{deviceId:e.deviceId,roomId:e.roomId,joinTime:e.joinTime}}))}]):[2,{code:n}]}}))}))}}),r}(tc);exports.AssertRules=void 0,(ec=exports.AssertRules||(exports.AssertRules={}))[ec.STRING=0]="STRING",ec[ec.ONLY_STRING=1]="ONLY_STRING",ec[ec.NUMBER=2]="NUMBER",ec[ec.BOOLEAN=3]="BOOLEAN",ec[ec.OBJECT=4]="OBJECT",ec[ec.ARRAY=5]="ARRAY",ec[ec.CALLBACK=6]="CALLBACK",ec[ec.CHANNEL_ID=7]="CHANNEL_ID";var nc=(($l={})[exports.AssertRules.STRING]=vt,$l[exports.AssertRules.ONLY_STRING]=gt,$l[exports.AssertRules.NUMBER]=Et,$l[exports.AssertRules.BOOLEAN]=function(e){return"boolean"==typeof e},$l[exports.AssertRules.OBJECT]=Rt,$l[exports.AssertRules.ARRAY]=It,$l[exports.AssertRules.CALLBACK]=function(e){var t=!0;return Rt(e)||(t=!1),(e=e||{}).onSuccess&&!mt(e.onSuccess)&&(t=!1),e.onError&&!mt(e.onError)&&(t=!1),t},$l[exports.AssertRules.CHANNEL_ID]=Ct,$l),ic=function(e){function r(t){var r=e.call(this,t)||this;return r.name="RCAssertError",r}return t(r,e),r}(Error),oc=function(e,t,r,n){void 0===n&&(n=!1),r=nc[r]||r;var i=n?r(t):yt(t)||null==t||r(t);return i||null===console||void 0===console||console.error("'".concat(e,"' is invalid: ").concat(JSON.stringify(t))),i},ac=function(e,t){if(!vt(e))return _r(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE);if(!bn(e))return _r(exports.ErrorCode.MESSAGE_NOT_REGISTERED);var r=En(e).searchProps;return r&&0!==r.length?r.every((function(e){return void 0!==t[e]}))?fr():_r(exports.ErrorCode.SEARCH_PROPS_LIMIT_ERROR):fr()},sc=function(e,t,r){return uc(pr.create(e),t,r)},uc=function(e,t,r){return e.isFailed||e.isObject("conversation",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION).validate("conversationType",null==t?void 0:t.conversationType,(function(){return te(null==t?void 0:t.conversationType,r)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE).validate("targetId",null==t?void 0:t.targetId,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("channelId",null==t?void 0:t.channelId,Ct).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID),e},lc=function(e,t,r){return e.check((function(e){return uc(e,t,Z)})).check((function(e){var n=null==t?void 0:t.messageType;vt(n)?n===me.STREAM_MESSAGE&&r.includes("RC_Ext_StreamMsgSummary")&&e.setFailed(exports.ErrorCode.STREAM_MESSAGE_EXPANSION_KEY_ERROR):e.setFailed(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE)})).check((function(e){(null==t?void 0:t.canIncludeExpansion)||e.setFailed(exports.ErrorCode.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION)})).isNotEmptyString("messageUId",null==t?void 0:t.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isTimestamp("sentTime",null==t?void 0:t.sentTime,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP),e},cc=function(e,t,r){return e.check((function(e){r||e.setFailed(exports.ErrorCode.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION)})).isObject("expansion",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_EXPANSION).check((function(e){var r=Object.keys(t);if(r.length>20||0===r.length)e.setFailed(exports.ErrorCode.EXPANSION_LIMIT_EXCEET);else if(r.some((function(e){return!/^[A-Za-z0-9_=+-]+$/.test(e)||"string"!=typeof t[e]})))e.setFailed(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_EXPANSION);else{r.some((function(e){return e.length>32||t[e].length>4096}))&&e.setFailed(exports.ErrorCode.EXPANSION_LIMIT_EXCEET)}})),e},dc=function(e,t){return t?(e.isObject("proxy",t,!0).isString("socketHost",t.socksHost,!0).isNumber("socketPort",t.socksPort,!0).isString("socketUsername",t.socksUsername).isString("socketPassword",t.socksPassword).fail(exports.ErrorCode.INVALID_PARAMETER_PROXY),e):e};var fc=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},_c=function(e){return{isPersited:!!(16&e),isCounted:!!(32&e),disableNotification:!!(512&e),receivedStatus:!!(2&e)?exports.ReceivedStatus.RETRIEVED:exports.ReceivedStatus.UNREAD,canIncludeExpansion:!!(1024&e)}},pc=function(e,t,r,n,i){var o=0;return e&&(o|=16),t&&(o|=32),r&&(o|=64),n&&(o|=512),i&&(o|=1024),o},hc=function(e){var t={};try{var r=JSON.parse(e);Object.entries(r).forEach((function(e){var r=u(e,2),n=r[0],i=r[1];t[n]=i.v}))}catch(t){console.error("parseMessageExpansion error: ".concat(e),t)}return t},gc=function(e,t,r,n){var i,o,a=Dl.decode(va,e.pbData),s=Kn(e.topic);if(s===Jn.recallMsg){var u=JSON.parse(a.content);i=u.conversationType,o=u.targetId}else i=function(e){var t;return((t={})[Jn.ppMsgP]=exports.ConversationType.PRIVATE,t[Jn.pgMsgP]=exports.ConversationType.GROUP,t[Jn.chatMsg]=exports.ConversationType.CHATROOM,t[Jn.ugMsg]=exports.ConversationType.ULTRA_GROUP,t[Jn.pcMsgP]=exports.ConversationType.CUSTOMER_SERVICE,t[Jn.pbMsgP]=exports.ConversationType.SYSTEM,t)[e]||exports.ConversationType.PRIVATE}(s),o=e.targetId;var l=![exports.ConversationType.GROUP,exports.ConversationType.CHATROOM,exports.ConversationType.RTC_ROOM,exports.ConversationType.ULTRA_GROUP].includes(i),c=l?o:t,d=l?"":o,f=Tc(a.sessionId),_=f.isPersited,p=f.isCounted,h=f.isMentioned,g=f.disableNotification,E=f.canIncludeExpansion;return{fromUserId:c,type:i,groupId:d,classname:a.classname,content:a.content,dataTime:r,status:pc(_,p,h,g,E),msgId:n,direction:exports.MessageDirection.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,refData:a.refData}},Ec=function(e,t,r,i){void 0===r&&(r=!1);var o,a,s,u,l,c=e.type,d=e.classname,f=![exports.ConversationType.GROUP,exports.ConversationType.CHATROOM,exports.ConversationType.RTC_ROOM,exports.ConversationType.ULTRA_GROUP].includes(c)?i||e.fromUserId:e.groupId||i,_=_c(e.status),p=_.disableNotification,h=_.receivedStatus,g=_.canIncludeExpansion,E=e.direction===exports.MessageDirection.SEND?exports.MessageDirection.SEND:exports.MessageDirection.RECEIVE,b=function(e,t,r){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=Xt(null==r?void 0:r.pushConfigs,null==r?void 0:r.pushId);return n({pushTitle:(null==r?void 0:r.title)||"",pushContent:t||"",pushData:"",disablePushTitle:o,forceShowDetailContent:a,templateId:null==r?void 0:r.templateId},s)}(e.configFlag||0,e.pushContent,e.pushExt),I=(o=e.extStatus,{isInterrupt:!!(2&(a=o||0)),isModifyMessage:!!(4&a),isPrivateChannel:!!(8&a),isStatusMessage:!!(64&a)}),T=I.isInterrupt,v=I.isModifyMessage,R=I.isPrivateChannel,m=I.isStatusMessage;if(bn(e.classname)){var y=En(e.classname);s=y.isCounted,u=y.isPersited,l=!!y.isStatusMessage}else{var A=_c(e.status);s=A.isCounted,u=A.isPersited,l=m||!1}var O=function(e){var t;try{t=JSON.parse(e)}catch(r){t=e}if(null==t?void 0:t.user){var r=t.user,n=r.portrait,i=r.portraitUri,o=n||i;o&&(t.user.portrait=t.user.portraitUri=o)}return t}(e.content),S=e.optionBits||0,C={conversationType:c,targetId:f,senderUserId:E===exports.MessageDirection.SEND?t:e.fromUserId,messageType:d,messageUId:e.msgId,isPersited:u,isCounted:s,isMentioned:!!O.mentionedInfo,sentTime:e.dataTime,messageDirection:E,receivedTime:Date.now(),disableNotification:p,receivedStatus:h,receivedStatusInfo:Lt(h),canIncludeExpansion:g,content:O,expansion:e.extraContent?hc(e.extraContent):null,pushConfig:b,channelId:e.busChannel||"",isInterrupt:T,isModifyMessage:v,messageId:e.clientUniqueId||0,sentStatus:exports.SentStatus.SENT,isOffLineMessage:r,channelType:R?exports.UltraGroupChannelType.PRIVATE:exports.UltraGroupChannelType.PUBLIC,isStatusMessage:l,readReceiptInfo:void 0,directedUserIds:e.toUserIds,disableUpdateLastMessage:(1&S)>0,needReceipt:(2&S)>0,sendReceipt:!!(4&S)||void 0,modifyInfo:vc(e.convertExt),extraData:e.extMsgData?{seqId:e.extMsgData.seqId,sentTime:e.extMsgData.sendTime}:void 0,hasReactions:(64&S)>0};return e.refData&&(C.quoteInfo={messageUId:e.refData.msgId,senderId:e.refData.fromUserId,objectName:e.refData.classname,quoteMessageStatus:je.DEFAULT}),C},bc=function(e,t,r,n,i){void 0===n&&(n=!1);var o=Ec(t,r,n,i);return o.messageType===me.RECALL&&e.serverSaveUnread?(o.__innerData__={keepUnreadCount:!(16&t.optionBits)},o):o},Ic=function(e,t,r,n,i){var o=0,a=En(e),s=a.isPersited,u=a.isCounted,l=a.isStatusMessage,c=i||l;return s&&!c&&(o|=1),u&&!c&&(o|=2),t&&(o|=4),r&&(o|=32),n&&(o|=64),o},Tc=function(e){return{isPersited:!!(1&e),isCounted:!!(2&e),disableNotification:!!(32&e),canIncludeExpansion:!!(64&e),isMentioned:!!(4&e)}},vc=function(e){if(e)try{var t=JSON.parse(e).modify;if(t.time)return{timestamp:t.time,content:{},status:xr.SUCCESS}}catch(t){console.error("parse message modify info error: ".concat(e),t)}},Rc=function(e,t){var r=e.content,i=r.sentTime,o=r.messageUId,a=r.isDelete,s=r.isAdmin,u=r.directionalUserIdList,l=r.extra,c={recallTime:i,recallActionTime:e.sentTime,admin:!!s,delete:!!a,isDelete:!!a,operatorId:e.senderUserId,extra:l},d=n(n({},e),{content:c,messageType:me.RECALL_NOTIFICATION_MESSAGE});return t&&(d.messageUId=o,d.sentTime=i,d.directedUserIds=u),d};function mc(e){return 1&~((null==e?void 0:e.sessionMode)||0)?_r(exports.ErrorCode.RC_REAL_TIME_CONVERSATION_UNAVAILABLE):fr()}function yc(e){return Math.min(e,999)}var Ac,Oc,Sc=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[exports.SubscribeType.ONLINE_STATUS]={},t[exports.SubscribeType.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={})[exports.SubscribeType.ONLINE_STATUS]={},e[exports.SubscribeType.USER_PROFILE]={},e)}}),Object.defineProperty(e.prototype,"clearSubscribeStatusData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e===exports.SubscribeType.ONLINE_STATUS?Object.keys(this.subscribeData[e]).forEach((function(r){t.subscribeData[e][r].statusMap={}})):e===exports.SubscribeType.USER_PROFILE&&Object.keys(this.subscribeData[e]).forEach((function(r){t.subscribeData[e][r].profile=void 0}))}}),Object.defineProperty(e.prototype,"getSubscribeUserData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.subscribeData[e][t];return r?n({},r):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,r){this.subscribeData[e][t]=r}}),Object.defineProperty(e.prototype,"clearExpiredData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t in this.subscribeData[e]){var r=this.subscribeData[e][t];r.expiry<(Date.now()+this._delayTime-r.subscribeTime)/1e3&&delete this.subscribeData[e][t]}}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l([],u(Object.values(this.subscribeData[e])),!1).sort((function(e,t){return e.subscribeTime-t.subscribeTime})).slice(r,r+t)}}),Object.defineProperty(e.prototype,"updateOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=n(n({},null===(t=this._ownProfile)||void 0===t?void 0:t.extraProfile),e.extraProfile);this._ownProfile=n(n(n({},this._ownProfile),e),{extraProfile:r})}}),Object.defineProperty(e.prototype,"getOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._ownProfile?n(n({},this._ownProfile),{extraProfile:n({},this._ownProfile.extraProfile)}):null}}),e}(),Cc=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 Sc(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(r){var n=e.find((function(e){return e.subscribeType===t.subType&&e.userId===r.subUserId}));n?n.subscribeTime<t.subTime&&(n.expiry=t.expiry,n.operationType=t.opType,n.subscribeTime=t.subTime):e.push({userId:r.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 r=this;void 0===t&&(t=!1);var n=[],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===exports.SubscribeOperationType.UNSUBSCRIBE)return r._subStore.removeSubscribeUserData(l,s),void o.push(e);var d=r._subStore.getSubscribeUserData(l,s);if(!(d&&d.subscribeTime>=u)){if(l===exports.SubscribeType.ONLINE_STATUS){n.push(s);var f=(null===(t=d)||void 0===t?void 0:t.statusMap)||{};r._subStore.updateSubscribeUserData(l,s,{subscribeTime:u,expiry:c,userId:s,subscribeType:l,statusMap:f})}else{i.push(s);var _=null===(a=d)||void 0===a?void 0:a.profile;r._subStore.updateSubscribeUserData(l,s,{subscribeTime:u,expiry:c,userId:s,subscribeType:l,profile:_,isSubscribed:!0})}o.push(e)}})),{newSubscribeOnlineStatusList:n,newSubscribeUserProfileList:i,subscribeUserChangeList:o}}}),Object.defineProperty(e.prototype,"clearSubscribeStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._subStore.clearSubscribeStatusData(exports.SubscribeType.ONLINE_STATUS),this._subStore.clearSubscribeStatusData(exports.SubscribeType.USER_PROFILE)}}),Object.defineProperty(e.prototype,"updateSubscribeUserOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=[];return e.forEach((function(e){var i=e.subUserId,o=e.data,a=t._subStore.getSubscribeUserData(exports.SubscribeType.ONLINE_STATUS,i);if(a){var s=[],u=n({},a.statusMap);o.forEach((function(e){var t=e.platformInfo,r=e.versionTime,i=u[t];if(!(i&&i.changeTime>r)){var o={eventValue:e.value,changeTime:r};u[t]=o,s.push(n(n({},o),{platform:t}))}})),t._subStore.updateSubscribeUserData(exports.SubscribeType.ONLINE_STATUS,i,{subscribeTime:a.subscribeTime,expiry:a.expiry,userId:i,subscribeType:exports.SubscribeType.ONLINE_STATUS,statusMap:u}),r.push({userId:i,subscribeType:exports.SubscribeType.ONLINE_STATUS,subscribeTime:a.subscribeTime,expiry:a.expiry,details:s})}})),r}}),Object.defineProperty(e.prototype,"updateSubscribeUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=[];return e.forEach((function(e){var i=e.userId,o=e.version,a=e.userProfile,s=e.userExtProfile,u=t._subStore.getSubscribeUserData(exports.SubscribeType.USER_PROFILE,i),l=Ut(i,a,s);u?u.profile&&u.profile.version>=o||(t._subStore.updateSubscribeUserData(exports.SubscribeType.USER_PROFILE,i,{subscribeTime:u.subscribeTime,expiry:u.expiry,userId:i,subscribeType:exports.SubscribeType.USER_PROFILE,profile:{info:l,version:o},isSubscribed:u.isSubscribed}),u.isSubscribed&&r.push({userId:i,subscribeType:exports.SubscribeType.USER_PROFILE,subscribeTime:u.subscribeTime,expiry:u.expiry,userProfile:n({},l)})):t._subStore.updateSubscribeUserData(exports.SubscribeType.USER_PROFILE,i,{subscribeTime:0,expiry:0,userId:i,subscribeType:exports.SubscribeType.USER_PROFILE,profile:{info:l,version:o},isSubscribed:!1})})),r}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,i=[];return t.forEach((function(t){var o=r._subStore.getSubscribeUserData(e,t);if(!o||o.expiry<(Date.now()+r._delayTime-o.subscribeTime)/1e3)r._subStore.removeSubscribeUserData(e,t);else{var a={subscribeTime:o.subscribeTime,expiry:o.expiry,userId:o.userId,subscribeType:o.subscribeType};if(e===exports.SubscribeType.ONLINE_STATUS){var s=o.statusMap,u=Object.keys(s).map((function(e){return n({platform:~~e},s[~~e])}));a.details=wt(u)}else if(e===exports.SubscribeType.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,r=[],i=[];return e.forEach((function(e){var o=t._subStore.getSubscribeUserData(exports.SubscribeType.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 r.push(n(n({},u),{extraProfile:n({},u.extraProfile)}));t._delayTime+Date.now()-s>6e5?i.push(e):r.push(n(n({},u),{extraProfile:n({},u.extraProfile)}))}else i.push(e)})),{list:r,needQueryUserIds:i}}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._subStore.clearExpiredData(e),this._subStore.getSubscribeUserList(e,t,r).map((function(t){var r={subscribeTime:t.subscribeTime,expiry:t.expiry,userId:t.userId,subscribeType:t.subscribeType};if(e===exports.SubscribeType.ONLINE_STATUS){var i=Object.keys(t.statusMap).map((function(e){return n({platform:~~e},t.statusMap[~~e])}));r.details=wt(i)}return r}))}}),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}(),Nc=function(){function e(e,t,r,n,i,o,a){Object.defineProperty(this,"_ctx",{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:r}),Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:n}),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 Cc(n)}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(exports.SubscribeType.ONLINE_STATUS),2&this._subDriven&&this._event.syncSubscribeUserStatusFinished(exports.SubscribeType.USER_PROFILE),3&this._subDriven&&this._event.syncSubscribeUserStatusFinished(exports.SubscribeType.FRIEND_ONLINE_STATUS),4&this._subDriven&&this._event.syncSubscribeUserStatusFinished(exports.SubscribeType.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 r,n,i,o,s,u,l,c,d,f,_,p,h;return a(this,(function(a){switch(a.label){case 0:return r=this._subscribeService.getRelationshipStatusVersion(),n=this._logger.createTraceId(),this._logger.info(B.L_PULL_SUBSCRIBED_USER_RELATION_T,JSON.stringify({version:r,_pageToken:t}),n),i=Dl.encode(Zs,{version:r,pageToken:t}),[4,this._ctx.query(Jn.pullUserSub,this._currentUserId,i,zs)];case 1:return o=a.sent(),this._logger.summary(B.L_PULL_SUBSCRIBED_USER_RELATION_R,o,n),o.isOk?(this._pullRelationshipFailTime=0,s=o.data,u=s.list,l=s.version,c=s.hasNext,d=s.pageToken,e?(f=this._subscribeService.updateSubscribeRelation(u),_=f.newSubscribeOnlineStatusList,p=f.newSubscribeUserProfileList,(h=f.subscribeUserChangeList).length>0&&this._event.subscribeRelationChanged(h),_.length>0&&this._queryAndUpdateUserOnlineStatus(_),p.length>0&&this._queryAndUpdateUserProfile(p)):this._subscribeService.updateSubscribeRelation(u,!t),this._subscribeService.updateRelationshipStatusVersion(l),this._pullRelationshipQueue=this._pullRelationshipQueue.filter((function(e){return e>l})),c?[4,this._pullSubscribeRelationship(e,d)]:[3,3]):(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 r,n,i,o,s,u,l,c,d,f,_,p;return a(this,(function(a){switch(a.label){case 0:return r=this._subscribeService.getSubscribeUserStatusVersion(),n=this._logger.createTraceId(),this._logger.info(B.L_PULL_SUBSCRIBED_USER_STATUS_T,JSON.stringify({version:r,_pageToken:t,needAllData:e}),n),i=Dl.encode($s,{versionTime:r,needAllData:e,pageToken:t}),[4,this._ctx.query(Jn.pullSubData,this._currentUserId,i,eu)];case 1:return(o=a.sent()).isOk?(this._pullSubUserStatusFailTime=0,s=o.data,u=s.list,l=s.versionTime,c=s.hasNext,d=s.pageToken,f=s.isFull,this._logger.info(B.L_PULL_SUBSCRIBED_USER_STATUS_R,JSON.stringify({code:o.code}),n),this._pullSubUserStatusQueue=this._pullSubUserStatusQueue.filter((function(e){return e>l})),this._subscribeService.updateSubscribeUserStatusVersion(l),_=[],p=[],u.forEach((function(e){switch(e.subType){case exports.SubscribeType.ONLINE_STATUS:_.push(e);break;case exports.SubscribeType.USER_PROFILE:p.push(e.subUserId);case exports.SubscribeType.FRIEND_ONLINE_STATUS:case exports.SubscribeType.FRIEND_USER_PROFILE:}})),f&&""===t&&this._subscribeService.clearSubscribeStatus(),_.length>0&&this._updateUserOnlineStatus(_,!f),p.length>0?[4,this._queryAndUpdateUserProfile(p,!f)]:[3,3]):(this._logger.warn(B.L_PULL_SUBSCRIBED_USER_STATUS_R,JSON.stringify({code:o.code,failTime:this._pullSubUserStatusFailTime}),n),this._pullSubUserStatusFailTime++,this._pullSubUserStatusFailTime>5?(this._pullSubUserStatusFailTime=0,[2]):[2,this._pullSubscribeUserStatus(e,t)]);case 2:a.sent(),a.label=3;case 3:return c?[4,this._pullSubscribeUserStatus(e,d)]:[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,r,n;return a(this,(function(i){switch(i.label){case 0:return t=this._logger.createTraceId(),this._logger.info(B.L_QUERY_SUBSCRIBE_DATA_T,JSON.stringify(e),t),r=Dl.encode(ru,{subType:exports.SubscribeType.ONLINE_STATUS,subUsers:e.map((function(e){return{subUserId:e}}))}),[4,this._ctx.query(Jn.qrySubData,this._currentUserId,r,eu)];case 1:return n=i.sent(),this._logger.summary(B.L_QUERY_SUBSCRIBE_DATA_R,n,t),n.isOk?(this._updateUserOnlineStatus(n.data.list),[2]):[2]}}))}))}}),Object.defineProperty(e.prototype,"_updateUserOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){void 0===t&&(t=!0);var r=this._subscribeService.updateSubscribeUserOnlineStatus(e);r=r.filter((function(e){return e.details&&e.details.length>0})),t&&r.length>0&&this._event.subscribeUserStatusChanged(r)}}),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 r,n,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return r=this._logger.createTraceId(),this._logger.info(B.L_PULL_USER_PROFILE_T,JSON.stringify(e),r),n=Dl.encode(ou,{userId:e}),i=new Io(Jn.pullUserProfile,n,this._currentUserId),[4,this._ctx.send(i,au)];case 1:return o=a.sent(),s=o.code,u=o.data,this._logger.info(B.L_PULL_USER_PROFILE_R,JSON.stringify({code:s,data:u}),r),s!==exports.ErrorCode.SUCCESS?[2,_r(s)]:(l=this._subscribeService.updateSubscribeUserProfile(u.UserProfile),t&&l.length>0&&this._event.subscribeUserStatusChanged(l),[2,fr(u.UserProfile)])}}))}))}}),Object.defineProperty(e.prototype,"updateUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i;return a(this,(function(o){switch(o.label){case 0:return(t=Dl.decode(tu,e.pbData)).subType!==exports.SubscribeType.ONLINE_STATUS?[3,1]:(this._updateUserOnlineStatus([t]),[3,5]);case 1:return t.subType!==exports.SubscribeType.USER_PROFILE?[3,2]:(this._queryAndUpdateUserProfile([t.subUserId]),[3,5]);case 2:return t.subType!==exports.SubscribeType.FRIEND_ONLINE_STATUS?[3,3]:(r=t.data.map((function(e){return{changeTime:e.versionTime,eventValue:e.value,platform:e.platformInfo}})),this._event.subscribeUserStatusChanged([{userId:t.subUserId,subscribeType:t.subType,subscribeTime:0,expiry:0,details:r}]),[3,5]);case 3:return t.subType!==exports.SubscribeType.FRIEND_USER_PROFILE?[3,5]:[4,this._queryAndUpdateUserProfile([t.subUserId])];case 4:n=o.sent(),(i=n.data)&&this._event.subscribeUserStatusChanged([{userId:t.subUserId,subscribeType:t.subType,subscribeTime:0,expiry:0,userProfile:Ut(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,r){return this._subscribeService.getSubscribeUserList(e,t,r)}}),Object.defineProperty(e.prototype,"updateSubscribeRelation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=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=Dl.encode(Qs,{subType:t,opType:r,expiry:n,subUsers:e.map((function(e){return{subUserId:e}}))}),[4,this._ctx.query(Jn.updUserSub,this._currentUserId,i,Xs)];case 1:return o=a.sent(),s=o.code,u=o.data,l=o.isOk,s===exports.ErrorCode.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT?[2,_r(s,"",u.subUsers.map((function(e){return e.subUserId})))]:l?(c=u.subTime,this._subscribeService.updateSubscribeRelation([{subType:t,subTime:c,expiry:n,opType:r,subUsers:e.map((function(e){return{subUserId:e}}))}]),r===exports.SubscribeOperationType.SUBSCRIBE&&(t===exports.SubscribeType.ONLINE_STATUS?this._queryAndUpdateUserOnlineStatus(e):t===exports.SubscribeType.USER_PROFILE&&this._queryAndUpdateUserProfile(e,!1)),[2,o.wipe()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o;return a(this,(function(a){switch(a.label){case 0:return t=this._subscribeService.getUserProfiles(e),r=t.needQueryUserIds,n=t.list,0===r.length?[2,fr(n)]:[4,this._queryAndUpdateUserProfile(r,!1)];case 1:return(i=a.sent()).isOk?(o=i.data.map((function(e){return Ut(e.userId,e.userProfile,e.userExtProfile)})),[2,fr(l(l([],u(n),!1),u(o),!1))]):[2,i.wipe()]}}))}))}}),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,r,n,i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return this._isOpenUserProfile?(t=this._logger.createTraceId(),this._logger.info(B.L_PULL_OWN_PROFILE_T,"",t),r=Dl.encode(su,{nothing:1}),[4,this._ctx.query(Jn.pullOwnProfile,this._currentUserId,r,nu)]):[2,_r(exports.ErrorCode.RC_USER_PROFILE_SERVICE_UNAVAILABLE)];case 1:return n=a.sent(),this._logger.summary(B.L_PULL_OWN_PROFILE_R,n,t),n.isOk?(i=n.data,o=i.userExtProfile,s=i.userProfile,u=i.version,l=i.userId,c=Ut(l,s,o),this._subscribeService.updateOwnProfile(c,u),e&&this._event.ownUserProfileChanged(c),[2,fr(c)]):[2,n.wipe()]}}))}))}}),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,fr(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(r){return this._subscribeService.updateOwnProfile(e,t),[2]}))}))}}),e}(),Mc=function(e){function r(t,r,n,i){var o=e.call(this,t,r,n,i)||this;return Ac.set(o,ht),o}return t(r,e),Object.defineProperty(r.prototype,"setTimestamp4RealtimeLog",{enumerable:!1,configurable:!0,writable:!0,value:function(e){d(this,Ac,e,"f")}}),Object.defineProperty(r.prototype,"getTimestamp4RealtimeLog",{enumerable:!1,configurable:!0,writable:!0,value:function(){return c(this,Ac,"f")}}),r}(qr);Ac=new WeakMap;var Pc=null,Lc="RC_LOGS",wc="RC_STATISTICS",Uc=((Oc={})[Lc]=["level","time"],Oc[wc]=["level","time"],Oc),Dc=function(e,t,r){return new Promise((function(n){var i=e.transaction(t,"readwrite").objectStore(t).index("time"),o=IDBKeyRange.upperBound(Date.now()-r),a=i.openCursor(o);a.onsuccess=function(e){var t=e.target.result;t?(t.delete(),t.continue()):n()},a.onerror=function(){n()}}))},xc=null,Gc=function(e){return o(void 0,void 0,void 0,(function(){var t,r;return a(this,(function(n){switch(n.label){case 0:return[4,Pc];case 1:return(t=n.sent())?(r=t.db,[4,Dc(r,Lc,e)]):[2];case 2:return n.sent(),[4,Dc(r,wc,e)];case 3:return n.sent(),xc=setTimeout((function(){return Gc(e)}),6e5),[2]}}))}))},Vc=function(e,t,r){void 0===r&&(r=168),Pc||("undefined"!=typeof window&&window&&window.indexedDB&&"IE"!==ua.runtimeInfo.type?Pc=new Promise((function(n){var i=window.indexedDB;!function(e){var t=window.indexedDB;t.databases&&t.databases().then((function(r){r.forEach((function(r){r.name&&e.includes(r.name)&&t.deleteDatabase(r.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(B.L_LOGDB_OPEN_FAILED_E,e.target.error),n(null)},a.onsuccess=function(i){var o=i.target.result;o?(o.onclose=function(e){Pc=null,t.warn(B.L_LOGDB_CLOSED_S)},o.onerror=function(e){Pc=null,t.error(B.L_LOGDB_ERROR_E,e.target.error)},o.onabort=function(e){t.info(B.L_LOGDB_ABORT_S,e.target.error)},Gc(3600*Math.max(24,Math.min(168,r))*1e3),n({appkey:e,db:o})):n(null)},a.onupgradeneeded=function(e){var t=e.target.result;Object.keys(Uc).forEach((function(e){t.objectStoreNames.contains(e)&&t.deleteObjectStore(e);var r=t.createObjectStore(e,{autoIncrement:!0});Uc[e].forEach((function(e){return r.createIndex(e,e,{unique:!1})}))}))}})):t.warn(B.L_UNSUPPORT_INDEXDB_O))},jc=[],kc=function(e,t,r){return new Promise((function(n){var i=e.transaction(t,"readwrite");i.oncomplete=n,i.onabort=n;var o=i.objectStore(t);r.forEach((function(e){try{o.add(e)}catch(t){null===console||void 0===console||console.error("write failed ->",e,t)}}))}))},Fc=[],Bc=!1,Hc=function(e){return o(void 0,void 0,void 0,(function(){var t,r;return a(this,(function(n){switch(n.label){case 0:return Bc||0===Fc.length?[2]:(Bc=!0,t=Fc.filter((function(e){return e.level<exports.LogL.FATAL})),r=Fc.filter((function(e){return e.level>=exports.LogL.FATAL})),Fc.length=0,[4,kc(e,Lc,r)]);case 1:return n.sent(),[4,kc(e,wc,t)];case 2:return n.sent(),Bc=!1,0===Fc.length&&jc.length>0&&(jc.forEach((function(e){return e.close()})),jc.length=0),setTimeout((function(){return Hc(e)})),[2]}}))}))},Yc=function(){var e=en();return e.setLogReader((function(e,t,r,n,i){return void 0===i&&(i=Lc),o(void 0,void 0,void 0,(function(){var o;return a(this,(function(a){switch(a.label){case 0:return[4,Pc];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<=r&&(n?i.sessionId===pt: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(r){switch(r.label){case 0:return[4,Pc];case 1:if(!(t=r.sent()))return[2];if(e.content&&gt(e.content))try{e.content=JSON.parse(e.content)}catch(e){}return Fc.push(e),Hc(t.db),[2]}}))}))}(e)})),e},Wc=function(e,t){return o(void 0,void 0,void 0,(function(){var r;return a(this,(function(n){return(r=t.get("logReporter"))["REPORT_SESSION_".concat(e)]={sessionId:pt},t.set("logReporter",r),[2]}))}))},Jc=function(e,t){return o(void 0,void 0,void 0,(function(){var r,n;return a(this,(function(i){return r=t.get("logReporter"),[2,(null==(n=r["REPORT_SESSION_".concat(e)])?void 0:n.sessionId)===pt]}))}))},qc=144e5;if("undefined"!=typeof window){window.__rongcloud_devtools__={logger:{get:function(e,t,r){return void 0===t&&(t=Date.now()-qc),void 0===r&&(r=Date.now()),o(this,void 0,void 0,(function(){var n,i,o;return a(this,(function(a){switch(a.label){case 0:return t=t<0?Date.now()+t:t,(r=r<=0?Date.now():r)-t>qc&&(t=r-qc),n=en(),(i=new Mc(e,"RC-IM","IM",n)).debug(B.T,"get logs: startTime ".concat(t," endTime ").concat(r)),Vc(e,i),[4,n.read(t,r,exports.LogL.DEBUG,!1)];case 1:return o=a.sent().logs,i.debug(B.T,"get logs ".concat(o.length)),function(e,t){var r=t.map((function(e){var t=e.sessionId,r=e.time,n=e.type,i=e.level,o=e.tag,a=e.traceId,s=e.loggerId,u=e.content;return"".concat(t,",").concat(r,",").concat(n,",").concat(i,",").concat(o,",").concat(a,",").concat(s,',"').concat(u,'"\n')})),n=new Blob(r,{type:"text/csv"}),i=URL.createObjectURL(n),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(r),o),[2]}}))}))}}}}var Kc,Qc,Xc,Zc,zc,$c=function(e){function r(t,r,n,i,o){var a,s=ua.runtimeInfo,u=s.type,l=s.version,c="".concat(u,"|").concat(l,"|").concat(r.getSessionId(),"|").concat(ua.connectPlatform);return a=e.call(this,t,c,i,r)||this,Object.defineProperty(a,"tableName",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"appStorage",{enumerable:!0,configurable:!0,writable:!0,value:o}),a}return t(r,e),Object.defineProperty(r.prototype,"getDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.appStorage.deviceId}}),Object.defineProperty(r.prototype,"send",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return ua.httpReq(e)}}),Object.defineProperty(r.prototype,"checkStart",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return o(this,void 0,void 0,(function(){return a(this,(function(r){switch(r.label){case 0:return[4,Wc(t.userId,this.appStorage)];case 1:return r.sent(),[2,e.prototype.checkStart.call(this,t,this.tableName)]}}))}))}}),Object.defineProperty(r.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:Dn(e.map(Qr).join(""))}]}))}))}}),Object.defineProperty(r.prototype,"realtimeReport",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n){return o(this,void 0,void 0,(function(){return a(this,(function(i){return[2,e.prototype.realtimeReport.call(this,t,r,n,this.tableName)]}))}))}}),r}(Kr),ed=function(e){function r(t,r,n){return e.call(this,t,r,Lc,r.proxy,n)||this}return t(r,e),Object.defineProperty(r.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,Jc(this.userId,this.appStorage)];case 1:return[2,e.sent()]}}))}))}}),Object.defineProperty(r.prototype,"report",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n,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,r,n,i,s,u,l)]}}))}))}}),r}($c),td=function(e){function r(t,r,n){return e.call(this,t,r,wc,r.proxy,n)||this}return t(r,e),r}($c),rd=function(e){function r(t,r,n){var i=e.call(this,"WebConversationSettings")||this;return Kc.add(i),Object.defineProperty(i,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:n}),Qc.set(i,!1),i._ctx.on("sCmd",c(i,Kc,"m",Zc),i),i._ctx.on("onConnected",c(i,Kc,"m",Xc),i),i}return t(r,e),Object.defineProperty(r.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(r){switch(r.label){case 0:return[4,c(this,Kc,"m",zc).call(this,e)];case 1:return[2,r.sent().trans((function(){return{version:t._storage.get("conversationStatusVersion")}}))]}}))}))}}),Object.defineProperty(r.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,Kc,"m",zc).call(this,e)];case 1:return t.sent(),[2,this._storage.get("conversationStatusVersion")]}}))}))}}),r}(lr);Qc=new WeakMap,Kc=new WeakSet,Xc=function(){d(this,Qc,!0,"f")},Zc=function(e,t){var r=t.type,n=t.time;if(3===r)this.push(n),e.stopPropagation()},zc=function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx.logger,r=t.createTraceId(),t.info(B.L_PULL_CONVERSATION_SETTINGS_T,JSON.stringify({version:e}),r),n=Dl.encode(ss,{time:e}),[4,this._ctx.query(Jn.pullSeAtts,this._ctx.currentUserId,n,us)];case 1:return(i=a.sent()).isOk&&(o=this._storage.updateBySessionStates(i.data.state)).length&&this._emitter.emit("conversationStatusChanged",o),s=this._storage.get("conversationStatusVersion"),t.summary(B.L_PULL_CONVERSATION_SETTINGS_R,i,r,{version:e,nextVersion:s},(function(e){return{respVer:e.version}})),c(this,Qc,"f")&&(d(this,Qc,!1,"f"),this._emitter.emit("conversationStatusSynced",i.code)),[2,i.wipe()]}}))}))};var nd,id,od,ad,sd,ud=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 r=this._memData[e],n=r.key,i=r.stringify;r.value=t;var o=i?JSON.stringify(t):t;ua.localStorage.setItem(n,o)}}),Object.defineProperty(e.prototype,"delete",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._memData[e];delete this._memData[e];var r=t.key;ua.localStorage.removeItem(r)}}),e}(),ld=function(e){var t;return"".concat(null!==(t=e.channelId)&&void 0!==t?t:"","_").concat(e.conversationType,"_").concat(e.targetId)},cd=function(e){var t=u(e.split("_")),r=t[0],n=t[1],i=t.slice(2);return{channelId:r,conversationType:parseInt(n,10),targetId:i.join("_")}};function dd(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 fd=function(){return{latestMessage:null,lastReadTime:0,firstUnreadMessageType:"",firstUnreadMessageUId:"",firstUnreadTime:0,unreadCount:0,unreadMentionedCount:0,unreadMentionedMeCount:0,hasMentioned:!1,mentionedInfo:void 0,isTop:!1,notificationLevel:exports.NotificationLevel.NOT_SET,translateStrategy:Sn.DEFAULT,tags:[],channelType:exports.UltraGroupChannelType.PUBLIC,operationTime:0,draft:"",hidden:!1,includeRobot:!1,version:0}},_d=function(){function e(e){nd.set(this,void 0),id.set(this,void 0),od.set(this,void 0),ad.set(this,fd()),sd.set(this,[]),d(this,nd,e.conversationType,"f"),d(this,id,e.targetId,"f"),d(this,od,e.channelId||"","f")}return Object.defineProperty(e.prototype,"conversationType",{get:function(){return c(this,nd,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"targetId",{get:function(){return c(this,id,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"channelId",{get:function(){return c(this,od,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return c(this,ad,"f").version||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"channelType",{get:function(){return c(this,ad,"f").channelType},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hidden",{get:function(){return!!c(this,ad,"f").hidden},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isTop",{get:function(){return!!c(this,ad,"f").isTop},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"notificationLevel",{get:function(){return c(this,ad,"f").notificationLevel||exports.NotificationLevel.NOT_SET},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"translateStrategy",{get:function(){return c(this,ad,"f").translateStrategy||Sn.DEFAULT},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tags",{get:function(){return(c(this,ad,"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,ad,"f").unreadCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadMentionedCount",{get:function(){return c(this,ad,"f").unreadMentionedCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadMentionedMeCount",{get:function(){return c(this,ad,"f").unreadMentionedMeCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasMentioned",{get:function(){return!!c(this,ad,"f").hasMentioned},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mentionedInfo",{get:function(){return c(this,ad,"f").mentionedInfo},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastReadTime",{get:function(){return c(this,ad,"f").lastReadTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadTime",{get:function(){return c(this,ad,"f").firstUnreadTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadMessageUId",{get:function(){return c(this,ad,"f").firstUnreadMessageUId||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadMessageType",{get:function(){return c(this,ad,"f").firstUnreadMessageType||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"latestMessage",{get:function(){return c(this,ad,"f").latestMessage||null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"operationTime",{get:function(){return c(this,ad,"f").operationTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"draft",{get:function(){return c(this,ad,"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,"identifier",{get:function(){return{conversationType:c(this,nd,"f"),targetId:c(this,id,"f"),channelId:c(this,od,"f")}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"key",{get:function(){return ld(this.identifier)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"includeRobot",{get:function(){return!!c(this,ad,"f").includeRobot},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"toIReceivedConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(){return n(n({},this.identifier),{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:we(this.notificationLevel),isTop:this.isTop,operationTime:this.operationTime,firstUnreadMessage:this.firstUnreadMessage,versionTime:0,draft:this.draft,includeRobot:this.includeRobot})}}),Object.defineProperty(e.prototype,"toStoragItem",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={};return this.hidden&&(t.h=1),e||(this.isTop&&(t.to=1),this.notificationLevel!==exports.NotificationLevel.NOT_SET&&(t.nl=this.notificationLevel),this.tags.length>0&&(t.tg=this.tags),this.translateStrategy!==Sn.DEFAULT&&(t.ts=this.translateStrategy)),t}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.updateAttrs(n(n({},fd()),{tags:this.tags,isTop:this.isTop,notificationLevel:this.notificationLevel,translateStrategy:this.translateStrategy,hidden:!0}))}}),Object.defineProperty(e.prototype,"clearUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={unreadCount:0,unreadMentionedCount:0,unreadMentionedMeCount:0,hasMentioned:!1,mentionedInfo:void 0,lastReadTime:e,firstUnreadTime:0,firstUnreadMessageType:void 0,firstUnreadMessageUId:void 0};return t.version=Math.max(this.version,e),this.updateAttrs(t,e)}}),Object.defineProperty(e.prototype,"updateAttrs",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;void 0===t&&(t=0);var n={},i={latestMessage:"latestMessage",unreadCount:"unreadMessageCount",hasMentioned:"hasMentioned",mentionedInfo:"mentionedInfo",notificationLevel:"notificationLevel",tags:"tags",isTop:"isTop",translateStrategy:"translateStrategy",unreadMentionedCount:"unreadMentionedCount",unreadMentionedMeCount:"unreadMentionedMeCount",lastReadTime:void 0,firstUnreadMessageType:void 0,firstUnreadMessageUId:void 0,firstUnreadTime:void 0,channelType:void 0,operationTime:void 0,draft:void 0,includeRobot:void 0,hidden:void 0,version: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(r,ad,"f")[l]!==d&&(c(r,ad,"f")[l]=d,s&&(n[s]={time:t,val:d}))}})),Object.keys(n).length>0?n:null}}),Object.defineProperty(e.prototype,"addRecvMessageRecord",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){c(this,sd,"f").push([e,t,r]),this.removeRecvMessageRecords(e-12e4)}}),Object.defineProperty(e.prototype,"removeRecvMessageRecords",{enumerable:!1,configurable:!0,writable:!0,value:function(e){d(this,sd,c(this,sd,"f").filter((function(t){return u(t,1)[0]<=e})),"f")}}),Object.defineProperty(e.prototype,"calibrateUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e.mentionCnt,n=e.mentionMeCnt,i=e.clearTime,o=e.firstUnreadMsg,a=e.cnt,s=e.cutOffTime,l=r>0,d=n>0,f=l?{type:d?exports.MentionedType.SINGAL:exports.MentionedType.ALL,userIdList:d?[t]:void 0}:void 0,_={unreadCount:a,unreadMentionedCount:r,unreadMentionedMeCount:n,lastReadTime:i,firstUnreadTime:null==o?void 0:o.msgTime,firstUnreadMessageType:null==o?void 0:o.className,firstUnreadMessageUId:null==o?void 0:o.msgId,hasMentioned:l,mentionedInfo:f,version:s};c(this,sd,"f").forEach((function(e){var t=u(e,3),r=t[0],n=t[1],i=t[2];r<=s||(_.version=Math.max(_.version,r),_.unreadCount+=n,i===exports.MentionedType.SINGAL?_.unreadMentionedMeCount+=n:i===exports.MentionedType.ALL&&(_.unreadMentionedCount+=n))}));var p=this.updateAttrs(_,i);return this.removeRecvMessageRecords(s),p}}),e}();nd=new WeakMap,id=new WeakMap,od=new WeakMap,ad=new WeakMap,sd=new WeakMap;var pd,hd,gd,Ed=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"toStoragItem",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=e.prototype.toStoragItem.call(this,t);return this.unreadCount>0&&(r.c=this.unreadCount),this.unreadMentionedCount>0&&(r.mc=this.unreadMentionedCount),this.unreadMentionedMeCount>0&&(r.mmc=this.unreadMentionedMeCount),this.hasMentioned&&(r.hm=1),this.mentionedInfo&&(r.m=this.mentionedInfo),this.firstUnreadMessageUId&&(r.fuid=this.firstUnreadMessageUId),this.firstUnreadMessageType&&(r.fumt=this.firstUnreadMessageType),this.firstUnreadTime&&(r.fut=this.firstUnreadTime),this.lastReadTime&&(r.rt=this.lastReadTime),this.version&&(r.v=this.version),r}}),r}(_d),bd=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.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(r.prototype,"isDefaultChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(){return!this.channelId||"RCDefault"===this.channelId}}),r}(_d),Id=function(e){return"".concat(e.targetId,"_").concat(e.channelId||"")},Td=function(e){function r(t){var r=e.call(this)||this;pd.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"_conversationCachePolicy",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"models",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(r,"ugSentRecord",{enumerable:!0,configurable:!0,writable:!0,value:new Map});var n=r._ctx.initOptions.conversationCachePolicy;return r._conversationCachePolicy=n?{limit:"number"==typeof n.limit?n.limit:1e3,ultraGroupLimit:"number"==typeof n.ultraGroupLimit?n.ultraGroupLimit:5e3,customEviction:"function"==typeof n.customEviction?n.customEviction:void 0}:void 0,r}return t(r,e),Object.defineProperty(r.prototype,"enableReadReceiptStorage",{get:function(){return this._ctx.initOptions.enableReadReceiptStorage},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"_syncDataHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=ua.localStorage,n=e.appkey,i=e.currentUserId,o=e.isDisableEmptyUGChannelId,a=e.isMemSesAttrs,s=et(n,i),l=$e(n,i),d=rt(n,i),f=Xe(n,i),_=Qe(n,i),p=Ze(n,i),h=ze(n,i),g=nt(n,i),E=st(n,i);r.removeItem("RC-con-s-ver-".concat(n,"-").concat(i)),a&&r.removeItem(_),this.ugSentRecord.clear();var b=r.getItem(s)||"0",I=r.getItem(l)||"0",T=r.getItem(d)||"1",v=r.getItem(_)||"0",R=JSON.parse(r.getItem(h)||"{}"),m=JSON.parse(r.getItem(f)||"{}"),y=JSON.parse(r.getItem(p)||"{}"),A=JSON.parse(r.getItem(g)||"{}"),O=JSON.parse(r.getItem(E)||"{}");c(this,pd,"m",hd).call(this,m,y,R,o);var S=Object.entries(O);return S.length>0&&S.forEach((function(e){var r=u(e,2),n=r[0],i=r[1];Object.entries(i).forEach((function(e){var r=u(e,2),n=r[0],o=r[1];delete o.d,o.t<t._ctx.serverTime-Je&&delete i[n]})),0===Object.keys(i).length&&delete O[n]})),{inboxTime:{value:parseInt(b,10)||0,key:s},outboxTime:{value:parseInt(I,10)||0,key:l},broadcastTime:{value:parseInt(T,10)||0,key:d},conversationStatus:{value:m,key:f,stringify:!0},ultraGroupStatus:{value:y,key:p,stringify:!0},conversationStatusVersion:{value:parseInt(v,10)||0,key:_},conversationTypeGlobalSettings:{value:R,key:h,stringify:!0},sentRecord:{value:A,key:g,stringify:!0},readReceiptRecord:{value:O,key:E,stringify:!0}}}}),Object.defineProperty(r.prototype,"addUGSentRecord",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this.ugSentRecord.set(e,t)}}),Object.defineProperty(r.prototype,"removeUGSentRecordByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;Array.from(this.ugSentRecord.entries()).forEach((function(r){var n=u(r,2),i=n[0];n[1]<=e&&t.ugSentRecord.delete(i)}))}}),Object.defineProperty(r.prototype,"isLocalSentUGMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.ugSentRecord.has(e)}}),Object.defineProperty(r.prototype,"addSentRecord",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.get("sentRecord");r[e]=t,this.set("sentRecord",r)}}),Object.defineProperty(r.prototype,"removeSentRecord",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.get("sentRecord");delete t[e],this.set("sentRecord",t)}}),Object.defineProperty(r.prototype,"removeSentRecordByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.get("sentRecord");Object.keys(t).forEach((function(r){t[r]<=e&&delete t[r]})),this.set("sentRecord",t)}}),Object.defineProperty(r.prototype,"isLocalSent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!!this.get("sentRecord")[e]}}),Object.defineProperty(r.prototype,"addReadReceiptRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e.conversationType,n=e.content,i=e.senderUserId,o=e.sentTime,a=n.messageUId;if(r!==exports.ConversationType.GROUP||!a)return!1;if(!this.enableReadReceiptStorage)return!0;if(o<this._ctx.serverTime-Je)return!1;var s=this.get("readReceiptRecord"),l=Id(e),c=s[l]=s[l]||{};c[a]={t:e.sentTime,sId:i===t?void 0:i};var d=Object.entries(c);if(d.length>30){var f=u(d.sort((function(e,t){return e[1].t-t[1].t})).pop(),2),_=f[0];f[1],delete c[_]}return this.set("readReceiptRecord",s),!0}}),Object.defineProperty(r.prototype,"handleReadReceiptResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e.conversationType,n=e.content,i=e.senderUserId;if(e.sentTime,r!==exports.ConversationType.GROUP||!n.receiptMessageDic)return!1;if(!this.enableReadReceiptStorage)return!0;var o=i===t,a=n.receiptMessageDic,s=Id(e),l=this.get("readReceiptRecord"),c=l[s]=l[s]||{};o?(Object.entries(a).forEach((function(e){var t=u(e,2);t[0],t[1].forEach((function(e){delete c[e]}))})),0===Object.keys(c).length&&delete l[s]):(a[t]||[]).forEach((function(e){var t=c[e];t&&(t.us=(t.us||[]).concat(i))}));return this.set("readReceiptRecord",l),!0}}),Object.defineProperty(r.prototype,"getReadReceiptResponseUsers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;return(null===(r=(this.get("readReceiptRecord")[Id(e)]||{})[t])||void 0===r?void 0:r.us)||[]}}),Object.defineProperty(r.prototype,"createReadReceiptResponseContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.get("readReceiptRecord")[Id(e)]||{},r={receiptMessageDic:{}};return Object.entries(t).forEach((function(e){var t=u(e,2),n=t[0],i=t[1];i.sId&&(r.receiptMessageDic[i.sId]=r.receiptMessageDic[i.sId]||[],r.receiptMessageDic[i.sId].push(n))})),r}}),Object.defineProperty(r.prototype,"syncDataFromLocalStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(t){e.prototype.syncDataFromLocalStorage.call(this,t),this.models.clear(),c(this,pd,"m",gd).call(this)}}),Object.defineProperty(r.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.get("conversationTypeGlobalSettings");t===exports.NotificationLevel.NOT_SET?delete r[e]:r[e]={nl:t},this.set("conversationTypeGlobalSettings",r)}}),Object.defineProperty(r.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)||exports.NotificationLevel.NOT_SET}}),Object.defineProperty(r.prototype,"getOrCreateModel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e.conversationType,n=e.targetId;e.channelId;var i=this.getModel(e);if(!i){i=e.conversationType===exports.ConversationType.ULTRA_GROUP?new bd(e):new Ed(e);var o=(r===exports.ConversationType.PRIVATE||r===exports.ConversationType.SYSTEM)&&this._ctx.robots.some((function(e){return e.robotId===n}));i.updateAttrs({includeRobot:o}),t&&this.models.set(i.key,i)}return i}}),Object.defineProperty(r.prototype,"updateConversationStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.get("ultraGroupStatus"),r=this.get("conversationStatus"),n=!1,i=!1,o=this._ctx.isMemSesAttrs;e.forEach((function(e){var a=e.conversationType,s=e.key,u=e.toStoragItem(o),l=Object.keys(u),c=0===l.length||1===l.length&&"h"===l[0],d=a===exports.ConversationType.ULTRA_GROUP;d?i=!0:n=!0;var f=d?t:r;c?delete f[s]:f[s]=u})),n&&this._updateConversationStorage("conversationStatus",r),i&&this._updateConversationStorage("ultraGroupStatus",t)}}),Object.defineProperty(r.prototype,"_updateConversationStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;if(this._conversationCachePolicy){var n=this._conversationCachePolicy,i=n.limit,o=n.ultraGroupLimit,a=n.customEviction;if("ultraGroupStatus"!==e||!this._ctx.isMemSesAttrs){var s="conversationStatus"===e?i:o,l=Object.entries(t);if(l.length<=s)this.set(e,t);else{var c=l.map((function(e){var t=u(e,2),n=t[0];return t[1],r.getModel(cd(n))})).filter((function(e){return!!e}));if(a){var d=c.map((function(e){return e.toIReceivedConversation()}));try{l=a(d).map((function(e){var r=ld(e);return[r,t[r]]})).filter((function(e){return!!e[1]}))}catch(e){this._ctx.logger.error(B.L_EXEC_CUSTOM_CONVERSATION_STORAGE_EVICTION_E,(null==e?void 0:e.message)||"unknown error")}}else l=(c=this._defaultEviction(c,s)).map((function(e){var r=e.key;return[r,t[r]]})).filter((function(e){return!!e[1]}));this.set(e,Object.fromEntries(l))}}}else this.set(e,t)}}),Object.defineProperty(r.prototype,"_defaultEviction",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return e.sort((function(e,t){var r=e.version,n=t.version,i=e.isTop?1:0;return(t.isTop?1:0)-i||n-r})).slice(0,t)}}),Object.defineProperty(r.prototype,"updateBySessionStates",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;if(!(null==e?void 0:e.length))return[];var r=this.get("conversationStatusVersion"),n=new Map,i=new Set;e.forEach((function(e){var o=e.channelId,a=e.busChannel,s=e.type,u=e.stateItem,l=e.time;r=Math.max(r,l);var c={};if(null==u||u.forEach((function(e){var t=e.tags,r=e.sessionStateType,n=e.value;switch(r){case ha.IsSilent:c.notificationLevel=parseInt(n,10);break;case ha.IsTop:c.isTop="1"===n;break;case ha.Tags:c.tags=t;break;case ha.AutoTrans:c.translateStrategy=parseInt(n,10)}})),o){var d={conversationType:s,targetId:o,channelId:a},f=t.getOrCreateModel(d,!0);i.add(f);var _=f.updateAttrs(c,l);if(_)if(n.has(f)){var p=n.get(f);Object.assign(p,_)}else n.set(f,_)}else void 0!==c.notificationLevel&&t.setConversationTypeNotificationLevel(s,c.notificationLevel)})),this.set("conversationStatusVersion",r),this.updateConversationStorage(Array.from(i));var o=Array.from(n.entries()).map((function(e){var t=u(e,2),r=t[0],n=t[1];return{conversation:r.toIReceivedConversation(),updatedItems:n}}));return o}}),Object.defineProperty(r.prototype,"addRelations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;e.forEach((function(e){var n=e.userId,i=e.type,o={conversationType:i,targetId:n,channelId:e.busChannel},a=r.getOrCreateModel(o,!0),s=function(e,t){var r,n,i,o=e.msg,a=e.isBot;return{latestMessage:o?Ec(o,t,!1,e.userId):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===(n=e.msgInfo)||void 0===n?void 0:n.msgId,firstUnreadTime:null===(i=e.msgInfo)||void 0===i?void 0:i.msgTime,includeRobot:!!a}}(e,t);i===exports.ConversationType.ULTRA_GROUP?a.updateAttrs(s):a.updateAttrs({latestMessage:s.latestMessage,operationTime:s.operationTime,includeRobot:s.includeRobot,hidden:!1})}))}}),Object.defineProperty(r.prototype,"getDrafts",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getModel(e);return(null==t?void 0:t.draft)||""}}),Object.defineProperty(r.prototype,"setDrafts",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this.getOrCreateModel(e,!0).updateAttrs({draft:t})}}),Object.defineProperty(r.prototype,"deleteDrafts",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getModel(e);t&&t.updateAttrs({draft:""})}}),Object.defineProperty(r.prototype,"getCachedUGConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r={conversationType:exports.ConversationType.ULTRA_GROUP,targetId:e,channelId:t},n=this.getModel(r);return(null==n?void 0:n.toIReceivedConversation())||null}}),Object.defineProperty(r.prototype,"getAllUGModels",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.models.values();return Array.from(e).filter((function(e){return e.conversationType===exports.ConversationType.ULTRA_GROUP})).map((function(e){return e}))}}),Object.defineProperty(r.prototype,"getAllSGModels",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.models.values();return Array.from(e).filter((function(e){return e.conversationType!==exports.ConversationType.ULTRA_GROUP})).map((function(e){return e}))}}),Object.defineProperty(r.prototype,"getAllModels",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Array.from(this.models.values())}}),Object.defineProperty(r.prototype,"getModel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.targetId,n=ld(e),i=this.models.get(n);if(!i)return null;var o=(t===exports.ConversationType.PRIVATE||t===exports.ConversationType.SYSTEM)&&this._ctx.robots.some((function(e){return e.robotId===r}));return i.updateAttrs({includeRobot:o}),i}}),Object.defineProperty(r.prototype,"removeConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getModel(e);t&&(t.remove(),this.updateConversationStorage([t]))}}),Object.defineProperty(r.prototype,"getAllUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=0;return this.getAllSGModels().forEach((function(n){var i,o=n.conversationType;e.includes(o)&&(n.notificationLevel>exports.NotificationLevel.NOT_SET&&!t||(r+=null!==(i=n.unreadCount)&&void 0!==i?i:0))})),r}}),Object.defineProperty(r.prototype,"getTagConversationCountMap",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=new Map;return this.getAllModels().forEach((function(t){var r=t.tags;r.length>0&&r.forEach((function(r){e.set(r.tagId,(e.get(r.tagId)||[]).concat(t.identifier))}))})),e}}),Object.defineProperty(r.prototype,"clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.getModel(e);if(!r)return null;var n=r.clearUnreadCount(t);return this.updateConversationStorage([r]),n?{conversation:r.toIReceivedConversation(),updatedItems:n}:null}}),r}(ud);pd=new WeakSet,hd=function(e,t,r,n){Object.keys(e).forEach((function(t){var n=cd(t);te(n.conversationType,J)?n.targetId||(r[n.conversationType]={nl:e[t].nl||exports.NotificationLevel.NOT_SET},delete e[t]):delete e[t]})),Object.keys(t).forEach((function(e){var i=cd(e);if(i.conversationType===exports.ConversationType.ULTRA_GROUP)return i.targetId?void(n&&!i.channelId&&delete t[e]):(r[i.conversationType]={nl:t[e].nl||exports.NotificationLevel.NOT_SET},void delete t[e]);delete t[e]}))},gd=function(){var e=this,t=Object.entries(this.get("conversationStatus")),r=Object.entries(this.get("ultraGroupStatus"));l(l([],u(t),!1),u(r),!1).forEach((function(t){var r,n,i,o,a,s,l,c,d,f,_,p,h,g,E,b,I=u(t,2),T=I[0],v=I[1],R=cd(T);te(R.conversationType,K)&&e.getOrCreateModel(R,!0).updateAttrs((n=(r=v).c,i=r.mc,o=r.mmc,a=r.hm,s=r.m,l=r.fut,c=r.fuid,d=r.fumt,f=r.nl,_=r.to,p=r.tg,h=r.rt,g=r.h,E=r.ts,b=r.v,{isTop:!!_,notificationLevel:f,tags:dd(p),unreadCount:n,unreadMentionedCount:i,unreadMentionedMeCount:o,hasMentioned:!!a,mentionedInfo:s,firstUnreadTime:l,firstUnreadMessageUId:c,firstUnreadMessageType:d,lastReadTime:h,hidden:!!g,translateStrategy:E,version:b||h}),0)}))};function vd(e){let t=e.length;for(;--t>=0;)e[t]=0}const Rd=256,md=286,yd=30,Ad=15,Od=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]),Sd=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]),Cd=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Nd=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Md=new Array(576);vd(Md);const Pd=new Array(60);vd(Pd);const Ld=new Array(512);vd(Ld);const wd=new Array(256);vd(wd);const Ud=new Array(29);vd(Ud);const Dd=new Array(yd);function xd(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}let Gd,Vd,kd;function Fd(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}vd(Dd);const Bd=e=>e<256?Ld[e]:Ld[256+(e>>>7)],Hd=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},Yd=(e,t,r)=>{e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,Hd(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)},Wd=(e,t,r)=>{Yd(e,r[2*t],r[2*t+1])},Jd=(e,t)=>{let r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1},qd=(e,t,r)=>{const n=new Array(16);let i,o,a=0;for(i=1;i<=Ad;i++)a=a+r[i-1]<<1,n[i]=a;for(o=0;o<=t;o++){let t=e[2*o+1];0!==t&&(e[2*o]=Jd(n[t]++,t))}},Kd=e=>{let t;for(t=0;t<md;t++)e.dyn_ltree[2*t]=0;for(t=0;t<yd;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},Qd=e=>{e.bi_valid>8?Hd(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Xd=(e,t,r,n)=>{const i=2*t,o=2*r;return e[i]<e[o]||e[i]===e[o]&&n[t]<=n[r]},Zd=(e,t,r)=>{const n=e.heap[r];let i=r<<1;for(;i<=e.heap_len&&(i<e.heap_len&&Xd(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!Xd(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n},zd=(e,t,r)=>{let n,i,o,a,s=0;if(0!==e.sym_next)do{n=255&e.pending_buf[e.sym_buf+s++],n+=(255&e.pending_buf[e.sym_buf+s++])<<8,i=e.pending_buf[e.sym_buf+s++],0===n?Wd(e,i,t):(o=wd[i],Wd(e,o+Rd+1,t),a=Od[o],0!==a&&(i-=Ud[o],Yd(e,i,a)),n--,o=Bd(n),Wd(e,o,r),a=Sd[o],0!==a&&(n-=Dd[o],Yd(e,n,a)))}while(s<e.sym_next);Wd(e,256,t)},$d=(e,t)=>{const r=t.dyn_tree,n=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!==r[2*a]?(e.heap[++e.heap_len]=l=a,e.depth[a]=0):r[2*a+1]=0;for(;e.heap_len<2;)u=e.heap[++e.heap_len]=l<2?++l:0,r[2*u]=1,e.depth[u]=0,e.opt_len--,i&&(e.static_len-=n[2*u+1]);for(t.max_code=l,a=e.heap_len>>1;a>=1;a--)Zd(e,r,a);u=o;do{a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Zd(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,r[2*u]=r[2*a]+r[2*s],e.depth[u]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,r[2*a+1]=r[2*s+1]=u,e.heap[1]=u++,Zd(e,r,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const r=t.dyn_tree,n=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=0;for(f=0;f<=Ad;f++)e.bl_count[f]=0;for(r[2*e.heap[e.heap_max]+1]=0,l=e.heap_max+1;l<573;l++)c=e.heap[l],f=r[2*r[2*c+1]+1]+1,f>u&&(f=u,h++),r[2*c+1]=f,c>n||(e.bl_count[f]++,_=0,c>=s&&(_=a[c-s]),p=r[2*c],e.opt_len+=p*(f+_),o&&(e.static_len+=p*(i[2*c+1]+_)));if(0!==h){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]--,h-=2}while(h>0);for(f=u;0!==f;f--)for(c=e.bl_count[f];0!==c;)d=e.heap[--l],d>n||(r[2*d+1]!==f&&(e.opt_len+=(f-r[2*d+1])*r[2*d],r[2*d+1]=f),c--)}})(e,t),qd(r,l,e.bl_count)},ef=(e,t,r)=>{let n,i,o=-1,a=t[1],s=0,u=7,l=4;for(0===a&&(u=138,l=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=t[2*(n+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))},tf=(e,t,r)=>{let n,i,o=-1,a=t[1],s=0,u=7,l=4;for(0===a&&(u=138,l=3),n=0;n<=r;n++)if(i=a,a=t[2*(n+1)+1],!(++s<u&&i===a)){if(s<l)do{Wd(e,i,e.bl_tree)}while(0!=--s);else 0!==i?(i!==o&&(Wd(e,i,e.bl_tree),s--),Wd(e,16,e.bl_tree),Yd(e,s-3,2)):s<=10?(Wd(e,17,e.bl_tree),Yd(e,s-3,3)):(Wd(e,18,e.bl_tree),Yd(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 rf=!1;const nf=(e,t,r,n)=>{Yd(e,0+(n?1:0),3),Qd(e),Hd(e,r),Hd(e,~r),r&&e.pending_buf.set(e.window.subarray(t,t+r),e.pending),e.pending+=r};var of=(e,t,r,n)=>{let i,o,a=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&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<Rd;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),$d(e,e.l_desc),$d(e,e.d_desc),a=(e=>{let t;for(ef(e,e.dyn_ltree,e.l_desc.max_code),ef(e,e.dyn_dtree,e.d_desc.max_code),$d(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*Nd[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=r+5,r+4<=i&&-1!==t?nf(e,t,r,n):4===e.strategy||o===i?(Yd(e,2+(n?1:0),3),zd(e,Md,Pd)):(Yd(e,4+(n?1:0),3),((e,t,r,n)=>{let i;for(Yd(e,t-257,5),Yd(e,r-1,5),Yd(e,n-4,4),i=0;i<n;i++)Yd(e,e.bl_tree[2*Nd[i]+1],3);tf(e,e.dyn_ltree,t-1),tf(e,e.dyn_dtree,r-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),zd(e,e.dyn_ltree,e.dyn_dtree)),Kd(e),n&&Qd(e)},af={_tr_init:e=>{rf||((()=>{let e,t,r,n,i;const o=new Array(16);for(r=0,n=0;n<28;n++)for(Ud[n]=r,e=0;e<1<<Od[n];e++)wd[r++]=n;for(wd[r-1]=n,i=0,n=0;n<16;n++)for(Dd[n]=i,e=0;e<1<<Sd[n];e++)Ld[i++]=n;for(i>>=7;n<yd;n++)for(Dd[n]=i<<7,e=0;e<1<<Sd[n]-7;e++)Ld[256+i++]=n;for(t=0;t<=Ad;t++)o[t]=0;for(e=0;e<=143;)Md[2*e+1]=8,e++,o[8]++;for(;e<=255;)Md[2*e+1]=9,e++,o[9]++;for(;e<=279;)Md[2*e+1]=7,e++,o[7]++;for(;e<=287;)Md[2*e+1]=8,e++,o[8]++;for(qd(Md,287,o),e=0;e<yd;e++)Pd[2*e+1]=5,Pd[2*e]=Jd(e,5);Gd=new xd(Md,Od,257,md,Ad),Vd=new xd(Pd,Sd,0,yd,Ad),kd=new xd(new Array(0),Cd,0,19,7)})(),rf=!0),e.l_desc=new Fd(e.dyn_ltree,Gd),e.d_desc=new Fd(e.dyn_dtree,Vd),e.bl_desc=new Fd(e.bl_tree,kd),e.bi_buf=0,e.bi_valid=0,Kd(e)},_tr_stored_block:nf,_tr_flush_block:of,_tr_tally:(e,t,r)=>(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++]=r,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(wd[r]+Rd+1)]++,e.dyn_dtree[2*Bd(t)]++),e.sym_next===e.sym_end),_tr_align:e=>{Yd(e,2,3),Wd(e,256,Md),(e=>{16===e.bi_valid?(Hd(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 sf=(e,t,r,n)=>{let i=65535&e,o=e>>>16&65535,a=0;for(;0!==r;){a=r>2e3?2e3:r,r-=a;do{i=i+t[n++]|0,o=o+i|0}while(--a);i%=65521,o%=65521}return i|o<<16};const uf=new Uint32Array((()=>{let e,t=[];for(var r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t})());var lf=(e,t,r,n)=>{const i=uf,o=n+r;e^=-1;for(let r=n;r<o;r++)e=e>>>8^i[255&(e^t[r])];return~e},cf={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"},df={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:ff,_tr_stored_block:_f,_tr_flush_block:pf,_tr_tally:hf,_tr_align:gf}=af,{Z_NO_FLUSH:Ef,Z_PARTIAL_FLUSH:bf,Z_FULL_FLUSH:If,Z_FINISH:Tf,Z_BLOCK:vf,Z_OK:Rf,Z_STREAM_END:mf,Z_STREAM_ERROR:yf,Z_DATA_ERROR:Af,Z_BUF_ERROR:Of,Z_DEFAULT_COMPRESSION:Sf,Z_FILTERED:Cf,Z_HUFFMAN_ONLY:Nf,Z_RLE:Mf,Z_FIXED:Pf,Z_DEFAULT_STRATEGY:Lf,Z_UNKNOWN:wf,Z_DEFLATED:Uf}=df,Df=258,xf=262,Gf=42,Vf=113,jf=666,kf=(e,t)=>(e.msg=cf[t],t),Ff=e=>2*e-(e>4?9:0),Bf=e=>{let t=e.length;for(;--t>=0;)e[t]=0},Hf=e=>{let t,r,n,i=e.w_size;t=e.hash_size,n=t;do{r=e.head[--n],e.head[n]=r>=i?r-i:0}while(--t);t=i,n=t;do{r=e.prev[--n],e.prev[n]=r>=i?r-i:0}while(--t)};let Yf=(e,t,r)=>(t<<e.hash_shift^r)&e.hash_mask;const Wf=e=>{const t=e.state;let r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+r),e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))},Jf=(e,t)=>{pf(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Wf(e.strm)},qf=(e,t)=>{e.pending_buf[e.pending++]=t},Kf=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},Qf=(e,t,r,n)=>{let i=e.avail_in;return i>n&&(i=n),0===i?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),r),1===e.state.wrap?e.adler=sf(e.adler,t,i,r):2===e.state.wrap&&(e.adler=lf(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)},Xf=(e,t)=>{let r,n,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match;const u=e.strstart>e.w_size-xf?e.strstart-(e.w_size-xf):0,l=e.window,c=e.w_mask,d=e.prev,f=e.strstart+Df;let _=l[o+a-1],p=l[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(r=t,l[r+a]===p&&l[r+a-1]===_&&l[r]===l[o]&&l[++r]===l[o+1]){o+=2,r++;do{}while(l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&o<f);if(n=Df-(f-o),o=f-Df,n>a){if(e.match_start=t,a=n,n>=s)break;_=l[o+a-1],p=l[o+a]}}}while((t=d[t&c])>u&&0!=--i);return a<=e.lookahead?a:e.lookahead},Zf=e=>{const t=e.w_size;let r,n,i;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-xf)&&(e.window.set(e.window.subarray(t,t+t-n),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),Hf(e),n+=t),0===e.strm.avail_in)break;if(r=Qf(e.strm,e.window,e.strstart+e.lookahead,n),e.lookahead+=r,e.lookahead+e.insert>=3)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=Yf(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=Yf(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<xf&&0!==e.strm.avail_in)},zf=(e,t)=>{let r,n,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(r=65535,i=e.bi_valid+42>>3,e.strm.avail_out<i)break;if(i=e.strm.avail_out-i,n=e.strstart-e.block_start,r>n+e.strm.avail_in&&(r=n+e.strm.avail_in),r>i&&(r=i),r<o&&(0===r&&t!==Tf||t===Ef||r!==n+e.strm.avail_in))break;a=t===Tf&&r===n+e.strm.avail_in?1:0,_f(e,0,0,a),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,Wf(e.strm),n&&(n>r&&(n=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+n),e.strm.next_out),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n,e.block_start+=n,r-=n),r&&(Qf(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}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!==Ef&&t!==Tf&&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&&(Qf(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,n=e.strstart-e.block_start,(n>=o||(n||t===Tf)&&t!==Ef&&0===e.strm.avail_in&&n<=i)&&(r=n>i?i:n,a=t===Tf&&0===e.strm.avail_in&&r===n?1:0,_f(e,e.block_start,r,a),e.block_start+=r,Wf(e.strm)),a?3:1)},$f=(e,t)=>{let r,n;for(;;){if(e.lookahead<xf){if(Zf(e),e.lookahead<xf&&t===Ef)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=Yf(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-xf&&(e.match_length=Xf(e,r)),e.match_length>=3)if(n=hf(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=Yf(e,e.ins_h,e.window[e.strstart+3-1]),r=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=Yf(e,e.ins_h,e.window[e.strstart+1]);else n=hf(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(Jf(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===Tf?(Jf(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Jf(e,!1),0===e.strm.avail_out)?1:2},e_=(e,t)=>{let r,n,i;for(;;){if(e.lookahead<xf){if(Zf(e),e.lookahead<xf&&t===Ef)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=Yf(e,e.ins_h,e.window[e.strstart+3-1]),r=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!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-xf&&(e.match_length=Xf(e,r),e.match_length<=5&&(e.strategy===Cf||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,n=hf(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=Yf(e,e.ins_h,e.window[e.strstart+3-1]),r=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++,n&&(Jf(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(n=hf(e,0,e.window[e.strstart-1]),n&&Jf(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&&(n=hf(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===Tf?(Jf(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Jf(e,!1),0===e.strm.avail_out)?1:2};function t_(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}const r_=[new t_(0,0,0,0,zf),new t_(4,4,8,4,$f),new t_(4,5,16,8,$f),new t_(4,6,32,32,$f),new t_(4,4,16,16,e_),new t_(8,16,32,32,e_),new t_(8,16,128,128,e_),new t_(8,32,128,256,e_),new t_(32,128,258,1024,e_),new t_(32,258,258,4096,e_)];function n_(){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=Uf,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),Bf(this.dyn_ltree),Bf(this.dyn_dtree),Bf(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),Bf(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Bf(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 i_=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==Gf&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==Vf&&t.status!==jf?1:0},o_=e=>{if(i_(e))return kf(e,yf);e.total_in=e.total_out=0,e.data_type=wf;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?Gf:Vf,e.adler=2===t.wrap?0:1,t.last_flush=-2,ff(t),Rf},a_=e=>{const t=o_(e);var r;return t===Rf&&((r=e.state).window_size=2*r.w_size,Bf(r.head),r.max_lazy_match=r_[r.level].max_lazy,r.good_match=r_[r.level].good_length,r.nice_match=r_[r.level].nice_length,r.max_chain_length=r_[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=2,r.match_available=0,r.ins_h=0),t},s_=(e,t,r,n,i,o)=>{if(!e)return yf;let a=1;if(t===Sf&&(t=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),i<1||i>9||r!==Uf||n<8||n>15||t<0||t>9||o<0||o>Pf||8===n&&1!==a)return kf(e,yf);8===n&&(n=9);const s=new n_;return e.state=s,s.strm=e,s.status=Gf,s.wrap=a,s.gzhead=null,s.w_bits=n,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=r,a_(e)};var u_={deflateInit:(e,t)=>s_(e,t,Uf,15,8,Lf),deflateInit2:s_,deflateReset:a_,deflateResetKeep:o_,deflateSetHeader:(e,t)=>i_(e)||2!==e.state.wrap?yf:(e.state.gzhead=t,Rf),deflate:(e,t)=>{if(i_(e)||t>vf||t<0)return e?kf(e,yf):yf;const r=e.state;if(!e.output||0!==e.avail_in&&!e.input||r.status===jf&&t!==Tf)return kf(e,0===e.avail_out?Of:yf);const n=r.last_flush;if(r.last_flush=t,0!==r.pending){if(Wf(e),0===e.avail_out)return r.last_flush=-1,Rf}else if(0===e.avail_in&&Ff(t)<=Ff(n)&&t!==Tf)return kf(e,Of);if(r.status===jf&&0!==e.avail_in)return kf(e,Of);if(r.status===Gf&&0===r.wrap&&(r.status=Vf),r.status===Gf){let t=Uf+(r.w_bits-8<<4)<<8,n=-1;if(n=r.strategy>=Nf||r.level<2?0:r.level<6?1:6===r.level?2:3,t|=n<<6,0!==r.strstart&&(t|=32),t+=31-t%31,Kf(r,t),0!==r.strstart&&(Kf(r,e.adler>>>16),Kf(r,65535&e.adler)),e.adler=1,r.status=Vf,Wf(e),0!==r.pending)return r.last_flush=-1,Rf}if(57===r.status)if(e.adler=0,qf(r,31),qf(r,139),qf(r,8),r.gzhead)qf(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),qf(r,255&r.gzhead.time),qf(r,r.gzhead.time>>8&255),qf(r,r.gzhead.time>>16&255),qf(r,r.gzhead.time>>24&255),qf(r,9===r.level?2:r.strategy>=Nf||r.level<2?4:0),qf(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(qf(r,255&r.gzhead.extra.length),qf(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=lf(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69;else if(qf(r,0),qf(r,0),qf(r,0),qf(r,0),qf(r,0),qf(r,9===r.level?2:r.strategy>=Nf||r.level<2?4:0),qf(r,3),r.status=Vf,Wf(e),0!==r.pending)return r.last_flush=-1,Rf;if(69===r.status){if(r.gzhead.extra){let t=r.pending,n=(65535&r.gzhead.extra.length)-r.gzindex;for(;r.pending+n>r.pending_buf_size;){let i=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+i),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>t&&(e.adler=lf(e.adler,r.pending_buf,r.pending-t,t)),r.gzindex+=i,Wf(e),0!==r.pending)return r.last_flush=-1,Rf;t=0,n-=i}let i=new Uint8Array(r.gzhead.extra);r.pending_buf.set(i.subarray(r.gzindex,r.gzindex+n),r.pending),r.pending+=n,r.gzhead.hcrc&&r.pending>t&&(e.adler=lf(e.adler,r.pending_buf,r.pending-t,t)),r.gzindex=0}r.status=73}if(73===r.status){if(r.gzhead.name){let t,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(e.adler=lf(e.adler,r.pending_buf,r.pending-n,n)),Wf(e),0!==r.pending)return r.last_flush=-1,Rf;n=0}t=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,qf(r,t)}while(0!==t);r.gzhead.hcrc&&r.pending>n&&(e.adler=lf(e.adler,r.pending_buf,r.pending-n,n)),r.gzindex=0}r.status=91}if(91===r.status){if(r.gzhead.comment){let t,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(e.adler=lf(e.adler,r.pending_buf,r.pending-n,n)),Wf(e),0!==r.pending)return r.last_flush=-1,Rf;n=0}t=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,qf(r,t)}while(0!==t);r.gzhead.hcrc&&r.pending>n&&(e.adler=lf(e.adler,r.pending_buf,r.pending-n,n))}r.status=103}if(103===r.status){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(Wf(e),0!==r.pending))return r.last_flush=-1,Rf;qf(r,255&e.adler),qf(r,e.adler>>8&255),e.adler=0}if(r.status=Vf,Wf(e),0!==r.pending)return r.last_flush=-1,Rf}if(0!==e.avail_in||0!==r.lookahead||t!==Ef&&r.status!==jf){let n=0===r.level?zf(r,t):r.strategy===Nf?((e,t)=>{let r;for(;;){if(0===e.lookahead&&(Zf(e),0===e.lookahead)){if(t===Ef)return 1;break}if(e.match_length=0,r=hf(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(Jf(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Tf?(Jf(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Jf(e,!1),0===e.strm.avail_out)?1:2})(r,t):r.strategy===Mf?((e,t)=>{let r,n,i,o;const a=e.window;for(;;){if(e.lookahead<=Df){if(Zf(e),e.lookahead<=Df&&t===Ef)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(i=e.strstart-1,n=a[i],n===a[++i]&&n===a[++i]&&n===a[++i])){o=e.strstart+Df;do{}while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&i<o);e.match_length=Df-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=hf(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=hf(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(Jf(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Tf?(Jf(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Jf(e,!1),0===e.strm.avail_out)?1:2})(r,t):r_[r.level].func(r,t);if(3!==n&&4!==n||(r.status=jf),1===n||3===n)return 0===e.avail_out&&(r.last_flush=-1),Rf;if(2===n&&(t===bf?gf(r):t!==vf&&(_f(r,0,0,!1),t===If&&(Bf(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),Wf(e),0===e.avail_out))return r.last_flush=-1,Rf}return t!==Tf?Rf:r.wrap<=0?mf:(2===r.wrap?(qf(r,255&e.adler),qf(r,e.adler>>8&255),qf(r,e.adler>>16&255),qf(r,e.adler>>24&255),qf(r,255&e.total_in),qf(r,e.total_in>>8&255),qf(r,e.total_in>>16&255),qf(r,e.total_in>>24&255)):(Kf(r,e.adler>>>16),Kf(r,65535&e.adler)),Wf(e),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?Rf:mf)},deflateEnd:e=>{if(i_(e))return yf;const t=e.state.status;return e.state=null,t===Vf?kf(e,Af):Rf},deflateSetDictionary:(e,t)=>{let r=t.length;if(i_(e))return yf;const n=e.state,i=n.wrap;if(2===i||1===i&&n.status!==Gf||n.lookahead)return yf;if(1===i&&(e.adler=sf(e.adler,t,r,0)),n.wrap=0,r>=n.w_size){0===i&&(Bf(n.head),n.strstart=0,n.block_start=0,n.insert=0);let e=new Uint8Array(n.w_size);e.set(t.subarray(r-n.w_size,r),0),t=e,r=n.w_size}const o=e.avail_in,a=e.next_in,s=e.input;for(e.avail_in=r,e.next_in=0,e.input=t,Zf(n);n.lookahead>=3;){let e=n.strstart,t=n.lookahead-2;do{n.ins_h=Yf(n,n.ins_h,n.window[e+3-1]),n.prev[e&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=e,e++}while(--t);n.strstart=e,n.lookahead=2,Zf(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,e.next_in=a,e.input=s,e.avail_in=o,n.wrap=i,Rf},deflateInfo:"pako deflate (from Nodeca project)"};const l_=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var c_={assign:function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(const t in r)l_(r,t)&&(e[t]=r[t])}}return e},flattenChunks:e=>{let t=0;for(let r=0,n=e.length;r<n;r++)t+=e[r].length;const r=new Uint8Array(t);for(let t=0,n=0,i=e.length;t<i;t++){let i=e[t];r.set(i,n),n+=i.length}return r}};let d_=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){d_=!1}const f_=new Uint8Array(256);for(let e=0;e<256;e++)f_[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;f_[254]=f_[254]=1;var __={string2buf:e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,r,n,i,o,a=e.length,s=0;for(i=0;i<a;i++)r=e.charCodeAt(i),55296==(64512&r)&&i+1<a&&(n=e.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(s),o=0,i=0;o<s;i++)r=e.charCodeAt(i),55296==(64512&r)&&i+1<a&&(n=e.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?t[o++]=r:r<2048?(t[o++]=192|r>>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|63&r);return t},buf2string:(e,t)=>{const r=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let n,i;const o=new Array(2*r);for(i=0,n=0;n<r;){let t=e[n++];if(t<128){o[i++]=t;continue}let a=f_[t];if(a>4)o[i++]=65533,n+=a-1;else{for(t&=2===a?31:3===a?15:7;a>1&&n<r;)t=t<<6|63&e[n++],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&&d_)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let r="";for(let n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r})(o,i)},utf8border:(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let r=t-1;for(;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+f_[e[r]]>t?r:t}};var p_=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 h_=Object.prototype.toString,{Z_NO_FLUSH:g_,Z_SYNC_FLUSH:E_,Z_FULL_FLUSH:b_,Z_FINISH:I_,Z_OK:T_,Z_STREAM_END:v_,Z_DEFAULT_COMPRESSION:R_,Z_DEFAULT_STRATEGY:m_,Z_DEFLATED:y_}=df;function A_(e){this.options=c_.assign({level:R_,method:y_,chunkSize:16384,windowBits:15,memLevel:8,strategy:m_},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 p_,this.strm.avail_out=0;let r=u_.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==T_)throw new Error(cf[r]);if(t.header&&u_.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?__.string2buf(t.dictionary):"[object ArrayBuffer]"===h_.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,r=u_.deflateSetDictionary(this.strm,e),r!==T_)throw new Error(cf[r]);this._dict_set=!0}}A_.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize;let i,o;if(this.ended)return!1;for(o=t===~~t?t:!0===t?I_:g_,"string"==typeof e?r.input=__.string2buf(e):"[object ArrayBuffer]"===h_.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(o===E_||o===b_)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(i=u_.deflate(r,o),i===v_)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=u_.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===T_;if(0!==r.avail_out){if(o>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},A_.prototype.onData=function(e){this.chunks.push(e)},A_.prototype.onEnd=function(e){e===T_&&(this.result=c_.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const O_=16209;var S_=function(e,t){let r,n,i,o,a,s,u,l,c,d,f,_,p,h,g,E,b,I,T,v,R,m,y,A;const O=e.state;r=e.next_in,y=e.input,n=r+(e.avail_in-5),i=e.next_out,A=e.output,o=i-(t-e.avail_out),a=i+(e.avail_out-257),s=O.dmax,u=O.wsize,l=O.whave,c=O.wnext,d=O.window,f=O.hold,_=O.bits,p=O.lencode,h=O.distcode,g=(1<<O.lenbits)-1,E=(1<<O.distbits)-1;e:do{_<15&&(f+=y[r++]<<_,_+=8,f+=y[r++]<<_,_+=8),b=p[f&g];t:for(;;){if(I=b>>>24,f>>>=I,_-=I,I=b>>>16&255,0===I)A[i++]=65535&b;else{if(!(16&I)){if(64&I){if(32&I){O.mode=16191;break e}e.msg="invalid literal/length code",O.mode=O_;break e}b=p[(65535&b)+(f&(1<<I)-1)];continue t}for(T=65535&b,I&=15,I&&(_<I&&(f+=y[r++]<<_,_+=8),T+=f&(1<<I)-1,f>>>=I,_-=I),_<15&&(f+=y[r++]<<_,_+=8,f+=y[r++]<<_,_+=8),b=h[f&E];;){if(I=b>>>24,f>>>=I,_-=I,I=b>>>16&255,16&I){if(v=65535&b,I&=15,_<I&&(f+=y[r++]<<_,_+=8,_<I&&(f+=y[r++]<<_,_+=8)),v+=f&(1<<I)-1,v>s){e.msg="invalid distance too far back",O.mode=O_;break e}if(f>>>=I,_-=I,I=i-o,v>I){if(I=v-I,I>l&&O.sane){e.msg="invalid distance too far back",O.mode=O_;break e}if(R=0,m=d,0===c){if(R+=u-I,I<T){T-=I;do{A[i++]=d[R++]}while(--I);R=i-v,m=A}}else if(c<I){if(R+=u+c-I,I-=c,I<T){T-=I;do{A[i++]=d[R++]}while(--I);if(R=0,c<T){I=c,T-=I;do{A[i++]=d[R++]}while(--I);R=i-v,m=A}}}else if(R+=c-I,I<T){T-=I;do{A[i++]=d[R++]}while(--I);R=i-v,m=A}for(;T>2;)A[i++]=m[R++],A[i++]=m[R++],A[i++]=m[R++],T-=3;T&&(A[i++]=m[R++],T>1&&(A[i++]=m[R++]))}else{R=i-v;do{A[i++]=A[R++],A[i++]=A[R++],A[i++]=A[R++],T-=3}while(T>2);T&&(A[i++]=A[R++],T>1&&(A[i++]=A[R++]))}break}if(64&I){e.msg="invalid distance code",O.mode=O_;break e}b=h[(65535&b)+(f&(1<<I)-1)]}}break}}while(r<n&&i<a);T=_>>3,r-=T,_-=T<<3,f&=(1<<_)-1,e.next_in=r,e.next_out=i,e.avail_in=r<n?n-r+5:5-(r-n),e.avail_out=i<a?a-i+257:257-(i-a),O.hold=f,O.bits=_};const C_=15,N_=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]),M_=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]),P_=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]),L_=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 w_=(e,t,r,n,i,o,a,s)=>{const u=s.bits;let l,c,d,f,_,p,h=0,g=0,E=0,b=0,I=0,T=0,v=0,R=0,m=0,y=0,A=null;const O=new Uint16Array(16),S=new Uint16Array(16);let C,N,M,P=null;for(h=0;h<=C_;h++)O[h]=0;for(g=0;g<n;g++)O[t[r+g]]++;for(I=u,b=C_;b>=1&&0===O[b];b--);if(I>b&&(I=b),0===b)return i[o++]=20971520,i[o++]=20971520,s.bits=1,0;for(E=1;E<b&&0===O[E];E++);for(I<E&&(I=E),R=1,h=1;h<=C_;h++)if(R<<=1,R-=O[h],R<0)return-1;if(R>0&&(0===e||1!==b))return-1;for(S[1]=0,h=1;h<C_;h++)S[h+1]=S[h]+O[h];for(g=0;g<n;g++)0!==t[r+g]&&(a[S[t[r+g]]++]=g);if(0===e?(A=P=a,p=20):1===e?(A=N_,P=M_,p=257):(A=P_,P=L_,p=0),y=0,g=0,h=E,_=o,T=I,v=0,d=-1,m=1<<I,f=m-1,1===e&&m>852||2===e&&m>592)return 1;for(;;){C=h-v,a[g]+1<p?(N=0,M=a[g]):a[g]>=p?(N=P[a[g]-p],M=A[a[g]-p]):(N=96,M=0),l=1<<h-v,c=1<<T,E=c;do{c-=l,i[_+(y>>v)+c]=C<<24|N<<16|M}while(0!==c);for(l=1<<h-1;y&l;)l>>=1;if(0!==l?(y&=l-1,y+=l):y=0,g++,0==--O[h]){if(h===b)break;h=t[r+a[g]]}if(h>I&&(y&f)!==d){for(0===v&&(v=I),_+=E,T=h-v,R=1<<T;T+v<b&&(R-=O[T+v],!(R<=0));)T++,R<<=1;if(m+=1<<T,1===e&&m>852||2===e&&m>592)return 1;d=y&f,i[d]=I<<24|T<<16|_-o}}return 0!==y&&(i[_+y]=h-v<<24|64<<16),s.bits=I,0};const{Z_FINISH:U_,Z_BLOCK:D_,Z_TREES:x_,Z_OK:G_,Z_STREAM_END:V_,Z_NEED_DICT:j_,Z_STREAM_ERROR:k_,Z_DATA_ERROR:F_,Z_MEM_ERROR:B_,Z_BUF_ERROR:H_,Z_DEFLATED:Y_}=df,W_=16180,J_=16190,q_=16191,K_=16192,Q_=16194,X_=16199,Z_=16200,z_=16206,$_=16209,ep=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function tp(){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 rp=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<W_||t.mode>16211?1:0},np=e=>{if(rp(e))return k_;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=W_,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,G_},ip=e=>{if(rp(e))return k_;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,np(e)},op=(e,t)=>{let r;if(rp(e))return k_;const n=e.state;return t<0?(r=0,t=-t):(r=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?k_:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,ip(e))},ap=(e,t)=>{if(!e)return k_;const r=new tp;e.state=r,r.strm=e,r.window=null,r.mode=W_;const n=op(e,t);return n!==G_&&(e.state=null),n};let sp,up,lp=!0;const cp=e=>{if(lp){sp=new Int32Array(512),up=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(w_(1,e.lens,0,288,sp,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;w_(2,e.lens,0,32,up,0,e.work,{bits:5}),lp=!1}e.lencode=sp,e.lenbits=9,e.distcode=up,e.distbits=5},dp=(e,t,r,n)=>{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)),n>=o.wsize?(o.window.set(t.subarray(r-o.wsize,r),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>n&&(i=n),o.window.set(t.subarray(r-n,r-n+i),o.wnext),(n-=i)?(o.window.set(t.subarray(r-n,r),0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0};var fp={inflateReset:ip,inflateReset2:op,inflateResetKeep:np,inflateInit:e=>ap(e,15),inflateInit2:ap,inflate:(e,t)=>{let r,n,i,o,a,s,u,l,c,d,f,_,p,h,g,E,b,I,T,v,R,m,y=0;const A=new Uint8Array(4);let O,S;const C=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(rp(e)||!e.output||!e.input&&0!==e.avail_in)return k_;r=e.state,r.mode===q_&&(r.mode=K_),a=e.next_out,i=e.output,u=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,l=r.hold,c=r.bits,d=s,f=u,m=G_;e:for(;;)switch(r.mode){case W_:if(0===r.wrap){r.mode=K_;break}for(;c<16;){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}if(2&r.wrap&&35615===l){0===r.wbits&&(r.wbits=15),r.check=0,A[0]=255&l,A[1]=l>>>8&255,r.check=lf(r.check,A,2,0),l=0,c=0,r.mode=16181;break}if(r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",r.mode=$_;break}if((15&l)!==Y_){e.msg="unknown compression method",r.mode=$_;break}if(l>>>=4,c-=4,R=8+(15&l),0===r.wbits&&(r.wbits=R),R>15||R>r.wbits){e.msg="invalid window size",r.mode=$_;break}r.dmax=1<<r.wbits,r.flags=0,e.adler=r.check=1,r.mode=512&l?16189:q_,l=0,c=0;break;case 16181:for(;c<16;){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}if(r.flags=l,(255&r.flags)!==Y_){e.msg="unknown compression method",r.mode=$_;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=$_;break}r.head&&(r.head.text=l>>8&1),512&r.flags&&4&r.wrap&&(A[0]=255&l,A[1]=l>>>8&255,r.check=lf(r.check,A,2,0)),l=0,c=0,r.mode=16182;case 16182:for(;c<32;){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}r.head&&(r.head.time=l),512&r.flags&&4&r.wrap&&(A[0]=255&l,A[1]=l>>>8&255,A[2]=l>>>16&255,A[3]=l>>>24&255,r.check=lf(r.check,A,4,0)),l=0,c=0,r.mode=16183;case 16183:for(;c<16;){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}r.head&&(r.head.xflags=255&l,r.head.os=l>>8),512&r.flags&&4&r.wrap&&(A[0]=255&l,A[1]=l>>>8&255,r.check=lf(r.check,A,2,0)),l=0,c=0,r.mode=16184;case 16184:if(1024&r.flags){for(;c<16;){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}r.length=l,r.head&&(r.head.extra_len=l),512&r.flags&&4&r.wrap&&(A[0]=255&l,A[1]=l>>>8&255,r.check=lf(r.check,A,2,0)),l=0,c=0}else r.head&&(r.head.extra=null);r.mode=16185;case 16185:if(1024&r.flags&&(_=r.length,_>s&&(_=s),_&&(r.head&&(R=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(o,o+_),R)),512&r.flags&&4&r.wrap&&(r.check=lf(r.check,n,_,o)),s-=_,o+=_,r.length-=_),r.length))break e;r.length=0,r.mode=16186;case 16186:if(2048&r.flags){if(0===s)break e;_=0;do{R=n[o+_++],r.head&&R&&r.length<65536&&(r.head.name+=String.fromCharCode(R))}while(R&&_<s);if(512&r.flags&&4&r.wrap&&(r.check=lf(r.check,n,_,o)),s-=_,o+=_,R)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=16187;case 16187:if(4096&r.flags){if(0===s)break e;_=0;do{R=n[o+_++],r.head&&R&&r.length<65536&&(r.head.comment+=String.fromCharCode(R))}while(R&&_<s);if(512&r.flags&&4&r.wrap&&(r.check=lf(r.check,n,_,o)),s-=_,o+=_,R)break e}else r.head&&(r.head.comment=null);r.mode=16188;case 16188:if(512&r.flags){for(;c<16;){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}if(4&r.wrap&&l!==(65535&r.check)){e.msg="header crc mismatch",r.mode=$_;break}l=0,c=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=q_;break;case 16189:for(;c<32;){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}e.adler=r.check=ep(l),l=0,c=0,r.mode=J_;case J_:if(0===r.havedict)return e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,r.hold=l,r.bits=c,j_;e.adler=r.check=1,r.mode=q_;case q_:if(t===D_||t===x_)break e;case K_:if(r.last){l>>>=7&c,c-=7&c,r.mode=z_;break}for(;c<3;){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}switch(r.last=1&l,l>>>=1,c-=1,3&l){case 0:r.mode=16193;break;case 1:if(cp(r),r.mode=X_,t===x_){l>>>=2,c-=2;break e}break;case 2:r.mode=16196;break;case 3:e.msg="invalid block type",r.mode=$_}l>>>=2,c-=2;break;case 16193:for(l>>>=7&c,c-=7&c;c<32;){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",r.mode=$_;break}if(r.length=65535&l,l=0,c=0,r.mode=Q_,t===x_)break e;case Q_:r.mode=16195;case 16195:if(_=r.length,_){if(_>s&&(_=s),_>u&&(_=u),0===_)break e;i.set(n.subarray(o,o+_),a),s-=_,o+=_,u-=_,a+=_,r.length-=_;break}r.mode=q_;break;case 16196:for(;c<14;){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}if(r.nlen=257+(31&l),l>>>=5,c-=5,r.ndist=1+(31&l),l>>>=5,c-=5,r.ncode=4+(15&l),l>>>=4,c-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=$_;break}r.have=0,r.mode=16197;case 16197:for(;r.have<r.ncode;){for(;c<3;){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}r.lens[C[r.have++]]=7&l,l>>>=3,c-=3}for(;r.have<19;)r.lens[C[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,O={bits:r.lenbits},m=w_(0,r.lens,0,19,r.lencode,0,r.work,O),r.lenbits=O.bits,m){e.msg="invalid code lengths set",r.mode=$_;break}r.have=0,r.mode=16198;case 16198:for(;r.have<r.nlen+r.ndist;){for(;y=r.lencode[l&(1<<r.lenbits)-1],g=y>>>24,E=y>>>16&255,b=65535&y,!(g<=c);){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}if(b<16)l>>>=g,c-=g,r.lens[r.have++]=b;else{if(16===b){for(S=g+2;c<S;){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}if(l>>>=g,c-=g,0===r.have){e.msg="invalid bit length repeat",r.mode=$_;break}R=r.lens[r.have-1],_=3+(3&l),l>>>=2,c-=2}else if(17===b){for(S=g+3;c<S;){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}l>>>=g,c-=g,R=0,_=3+(7&l),l>>>=3,c-=3}else{for(S=g+7;c<S;){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}l>>>=g,c-=g,R=0,_=11+(127&l),l>>>=7,c-=7}if(r.have+_>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=$_;break}for(;_--;)r.lens[r.have++]=R}}if(r.mode===$_)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=$_;break}if(r.lenbits=9,O={bits:r.lenbits},m=w_(1,r.lens,0,r.nlen,r.lencode,0,r.work,O),r.lenbits=O.bits,m){e.msg="invalid literal/lengths set",r.mode=$_;break}if(r.distbits=6,r.distcode=r.distdyn,O={bits:r.distbits},m=w_(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,O),r.distbits=O.bits,m){e.msg="invalid distances set",r.mode=$_;break}if(r.mode=X_,t===x_)break e;case X_:r.mode=Z_;case Z_:if(s>=6&&u>=258){e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,r.hold=l,r.bits=c,S_(e,f),a=e.next_out,i=e.output,u=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,l=r.hold,c=r.bits,r.mode===q_&&(r.back=-1);break}for(r.back=0;y=r.lencode[l&(1<<r.lenbits)-1],g=y>>>24,E=y>>>16&255,b=65535&y,!(g<=c);){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}if(E&&!(240&E)){for(I=g,T=E,v=b;y=r.lencode[v+((l&(1<<I+T)-1)>>I)],g=y>>>24,E=y>>>16&255,b=65535&y,!(I+g<=c);){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}l>>>=I,c-=I,r.back+=I}if(l>>>=g,c-=g,r.back+=g,r.length=b,0===E){r.mode=16205;break}if(32&E){r.back=-1,r.mode=q_;break}if(64&E){e.msg="invalid literal/length code",r.mode=$_;break}r.extra=15&E,r.mode=16201;case 16201:if(r.extra){for(S=r.extra;c<S;){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}r.length+=l&(1<<r.extra)-1,l>>>=r.extra,c-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=16202;case 16202:for(;y=r.distcode[l&(1<<r.distbits)-1],g=y>>>24,E=y>>>16&255,b=65535&y,!(g<=c);){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}if(!(240&E)){for(I=g,T=E,v=b;y=r.distcode[v+((l&(1<<I+T)-1)>>I)],g=y>>>24,E=y>>>16&255,b=65535&y,!(I+g<=c);){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}l>>>=I,c-=I,r.back+=I}if(l>>>=g,c-=g,r.back+=g,64&E){e.msg="invalid distance code",r.mode=$_;break}r.offset=b,r.extra=15&E,r.mode=16203;case 16203:if(r.extra){for(S=r.extra;c<S;){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}r.offset+=l&(1<<r.extra)-1,l>>>=r.extra,c-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=$_;break}r.mode=16204;case 16204:if(0===u)break e;if(_=f-u,r.offset>_){if(_=r.offset-_,_>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=$_;break}_>r.wnext?(_-=r.wnext,p=r.wsize-_):p=r.wnext-_,_>r.length&&(_=r.length),h=r.window}else h=i,p=a-r.offset,_=r.length;_>u&&(_=u),u-=_,r.length-=_;do{i[a++]=h[p++]}while(--_);0===r.length&&(r.mode=Z_);break;case 16205:if(0===u)break e;i[a++]=r.length,u--,r.mode=Z_;break;case z_:if(r.wrap){for(;c<32;){if(0===s)break e;s--,l|=n[o++]<<c,c+=8}if(f-=u,e.total_out+=f,r.total+=f,4&r.wrap&&f&&(e.adler=r.check=r.flags?lf(r.check,i,f,a-f):sf(r.check,i,f,a-f)),f=u,4&r.wrap&&(r.flags?l:ep(l))!==r.check){e.msg="incorrect data check",r.mode=$_;break}l=0,c=0}r.mode=16207;case 16207:if(r.wrap&&r.flags){for(;c<32;){if(0===s)break e;s--,l+=n[o++]<<c,c+=8}if(4&r.wrap&&l!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=$_;break}l=0,c=0}r.mode=16208;case 16208:m=V_;break e;case $_:m=F_;break e;case 16210:return B_;default:return k_}return e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,r.hold=l,r.bits=c,(r.wsize||f!==e.avail_out&&r.mode<$_&&(r.mode<z_||t!==U_))&&dp(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,r.total+=f,4&r.wrap&&f&&(e.adler=r.check=r.flags?lf(r.check,i,f,e.next_out-f):sf(r.check,i,f,e.next_out-f)),e.data_type=r.bits+(r.last?64:0)+(r.mode===q_?128:0)+(r.mode===X_||r.mode===Q_?256:0),(0===d&&0===f||t===U_)&&m===G_&&(m=H_),m},inflateEnd:e=>{if(rp(e))return k_;let t=e.state;return t.window&&(t.window=null),e.state=null,G_},inflateGetHeader:(e,t)=>{if(rp(e))return k_;const r=e.state;return 2&r.wrap?(r.head=t,t.done=!1,G_):k_},inflateSetDictionary:(e,t)=>{const r=t.length;let n,i,o;return rp(e)?k_:(n=e.state,0!==n.wrap&&n.mode!==J_?k_:n.mode===J_&&(i=1,i=sf(i,t,r,0),i!==n.check)?F_:(o=dp(e,t,r,r),o?(n.mode=16210,B_):(n.havedict=1,G_)))},inflateInfo:"pako inflate (from Nodeca project)"};var _p=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:Ep,Z_STREAM_END:bp,Z_NEED_DICT:Ip,Z_STREAM_ERROR:Tp,Z_DATA_ERROR:vp,Z_MEM_ERROR:Rp}=df;function mp(e){this.options=c_.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 p_,this.strm.avail_out=0;let r=fp.inflateInit2(this.strm,t.windowBits);if(r!==Ep)throw new Error(cf[r]);if(this.header=new _p,fp.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=__.string2buf(t.dictionary):"[object ArrayBuffer]"===pp.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=fp.inflateSetDictionary(this.strm,t.dictionary),r!==Ep)))throw new Error(cf[r])}function yp(e,t){const r=new mp(t);if(r.push(e),r.err)throw r.msg||cf[r.err];return r.result}mp.prototype.push=function(e,t){const r=this.strm,n=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)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),o=fp.inflate(r,a),o===Ip&&i&&(o=fp.inflateSetDictionary(r,i),o===Ep?o=fp.inflate(r,a):o===vp&&(o=Ip));r.avail_in>0&&o===bp&&r.state.wrap>0&&0!==e[r.next_in];)fp.inflateReset(r),o=fp.inflate(r,a);switch(o){case Tp:case vp:case Ip:case Rp:return this.onEnd(o),this.ended=!0,!1}if(s=r.avail_out,r.next_out&&(0===r.avail_out||o===bp))if("string"===this.options.to){let e=__.utf8border(r.output,r.next_out),t=r.next_out-e,i=__.buf2string(r.output,e);r.next_out=t,r.avail_out=n-t,t&&r.output.set(r.output.subarray(e,e+t),0),this.onData(i)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(o!==Ep||0!==s){if(o===bp)return o=fp.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},mp.prototype.onData=function(e){this.chunks.push(e)},mp.prototype.onEnd=function(e){e===Ep&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=c_.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Ap={Inflate:mp,inflate:yp,inflateRaw:function(e,t){return(t=t||{}).raw=!0,yp(e,t)},ungzip:yp,constants:df};const{Inflate:Op,inflate:Sp,inflateRaw:Cp,ungzip:Np}=Ap;var Mp=Np;function Pp(e){return Object.keys(e).map((function(t){var r=e[t];return"string"!=typeof r&&(r="".concat(r)),{key:t,value:r}}))}function Lp(e,t,r,n){return Dl.encode(cu,{targetId:e,type:exports.ConversationType.GROUP,users:n,extProfile:r?Pp(r):void 0,settingProfile:Pp(t)})}var wp,Up,Dp,xp,Gp,Vp,jp,kp,Fp,Bp,Hp,Yp,Wp,Jp=function(e,t){return Dl.encode(Ja,{type:e.conversationType,msgTime:t,channelId:e.targetId,busChannel:e.channelId||""})},qp=function(e){var t=Dl.decode(Da,e),r=t.compressioEnabled,n=t.compressedData,i=t.info,o=t.pullTime,a=t.isFinished,s=t.pageToken;if(r){var u=Mp(n);return qp(u)}return{info:i,pullTime:o,isFinished:a,pageToken:s}},Kp=function(e){var t=Dl.decode(Ra,e);if(t.compressioEnabled){var r=Mp(t.compressedData);return Kp(r)}return t},Qp=function(e){var t=Dl.decode(ma,e);if(t.compressioEnabled){var r=Mp(t.compressedData);return Qp(r)}return{syncTime:t.syncTime,list:t.list.map((function(e){return Dl.decode(ya,new Uint8Array(e))}))}},Xp=function(e){return Dl.encode(bs,n(n({},e),{compress:Cn.enable()}))},Zp=function(e){var t=Dl.decode(Ts,e);if(t.compress){var r=Mp(t.compressData);return Zp(r)}return t},zp=function(e){var t=Dl.decode(vs,e);if(t.compress){var r=Mp(t.compressData);return zp(r)}return t},$p=function(e){var t=e.listType,r=e.result,i=e.page,o=new Uint8Array(r),a=[];switch(t){case 1:a=Dl.decode(Eu,o).list;break;case 2:a=Dl.decode(gu,o).list;break;case 3:a=Dl.decode(bu,o).list;break;case 11:a=Dl.decode(Mu,o).list;break;case 12:a=Dl.decode(Pu,o).list}return n(n({},i),{list:a})},eh=function(e){return Dl.encode(Ba,n(n({},e),{compressioEnabled:Cn.enable(),ignoreCmd:!0}))},th=function(e){var t=Dl.decode(Ha,e);if(t.compressioEnabled){var r=Mp(t.compressedData);return th(r)}return t},rh=function(e,t){return Dl.encode(ls,{ignoreVersion:!0,version:e,state:t})},nh=function(e){var t=Dl.decode(Wu,e);if(t.compress){var r=Mp(t.compressedData);return nh(r)}return t},ih=function(e){return Dl.encode(rs,{timestamp:e,compressioEnabled:Cn.enable()})},oh=function(e){var t=Dl.decode(es,e);if(t.compressioEnabled){var r=Mp(t.compressedData);return oh(r)}return t},ah=function(e){if(e){var t=e.pushTitle,r=e.iOSConfig,n=e.androidConfig,i=e.templateId,o=e.harmonyOSConfig;return{title:t,pushConfigs:Qt(r,n,o),pushId:null==n?void 0:n.notificationId,templateId:i}}},sh=function(e,t){var r,n,i,o=e.targetId,a=e.conversationType,l=e.channelId,c=t.messageType,d=t.isMentioned,f=t.disableNotification,_=t.canIncludeExpansion,p=t.pushConfig,h=t.directionalUserIdList,g=t.isVoipPush,E=t.isFilerWhiteBlacklist,b=t.content,I=t.pushContent,T=t.pushData,v=t.expansion,R=t.messageId,m=t.needReceipt,y=t.disableUpdateLastMessage,A=t.isStatusMessage,O=t.quoteInfo,S=Ic(c,d,f,_,A),C=function(e,t,r,n){var i=0;return e&&(i|=1),t&&(i|=2),r&&(i|=4),n&&(i|=8),i}(!!g,!E,!!(null==p?void 0:p.disablePushTitle),!!(null==p?void 0:p.forceShowDetailContent));if(b.user&&b.user.portraitUri&&(b.user.portrait=b.user.portraitUri),_&&v){i={};try{for(var N=s(Object.entries(v)),M=N.next();!M.done;M=N.next()){var P=u(M.value,2),L=P[0],w=P[1];i[L]={v:w}}}catch(e){r={error:e}}finally{try{M&&!M.done&&(n=N.return)&&n.call(N)}finally{if(r)throw r.error}}}var U=ah(p),D=a===exports.ConversationType.SYSTEM?o:void 0,x=0;En(c).isPersited&&y&&(x|=1),m&&(x|=2);var G=O?{msgId:O.messageUId,fromUserId:O.senderId,classname:O.objectName}:void 0;return Dl.encode(va,{sessionId:S,pushText:(null==p?void 0:p.pushContent)||I,appData:(null==p?void 0:p.pushData)||T,toUserIds:h,configFlag:C,classname:c,content:JSON.stringify(b),extraContent:i?JSON.stringify(i):void 0,pushExt:U,clientUniqueId:R,busChannel:l,systemId:D,optionBits:x,refData:G})},uh=function(e){return Dl.encode(pu,n(n({},e),{type:exports.ConversationType.GROUP}))},lh=function(e){return Dl.encode(Iu,n(n({},e),{type:exports.ConversationType.GROUP}))},ch=function(e){return Dl.encode(_u,n(n({},e),{type:exports.ConversationType.GROUP}))},dh=function(e){var t=Dl.decode(qu,e);if(t.compress){var r=Mp(t.compressedData);return dh(r)}return t},fh=function(e){var t=Dl.decode(Il,e);if(t.compress){var r=Mp(t.compressedData);return fh(r)}return t},_h=function(e){var t=Dl.decode(vl,e);if(t.compress){var r=Mp(t.compressedData);return _h(r)}return t},ph=function(e){var t=Dl.decode(Rl,e);if(t.compress){var r=Mp(t.compressedData);return ph(r)}return t},hh=function(e,t){var r=[];return e.forEach((function(e){var n=e,i=n.reactionId,o=n.reactionTime,a=n.userReact,s=n.user,u=n.userCnt,l={messageUId:t,reactionId:i,reactionTime:o,hasCurrentUserReacted:a,totalCount:u,users:s.map((function(e){return{userId:e.userId,reactionTime:e.reactionTime}}))};r.push(l)})),r},gh=function(e){var t=e,r=t.targetId,n=t.type,i=t.busChannel,o=t.opType;return{conversationIdentifier:{targetId:r,conversationType:n,channelId:i||""},messageUId:t.msgId,reactionId:t.reactionId,operationType:o,totalCount:t.userCnt,users:t.users.map((function(e){var t=e.userId;return{reactionTime:e.reactionTime,userId:t}}))}},Eh=((wp={})[Qi]=exports.ErrorCode.RC_DISCONN_KICK,wp[Xi]=exports.ErrorCode.RC_DISCONN_EXCEPTION,wp[zi]=exports.ErrorCode.RC_DISCONN_EXCEPTION,wp[$i]=exports.ErrorCode.RC_CONN_REDIRECTED,wp[eo]=exports.ErrorCode.RC_CONN_TOKEN_EXPIRED,wp[to]=exports.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,wp[ro]=exports.ErrorCode.RC_ACCOUNT_CANCELLATION,wp),bh=((Up={})[Ci]=exports.ErrorCode.SUCCESS,Up[Ni]=exports.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,Up[Mi]=exports.ErrorCode.RC_CONN_IDENTIFIER_REJECTED,Up[Pi]=exports.ErrorCode.RC_CONN_SERVER_UNAVAILABLE,Up[Li]=exports.ErrorCode.RC_CONN_TOKEN_INCORRECT,Up[wi]=exports.ErrorCode.RC_CONN_NOT_AUTHRORIZED,Up[Ui]=exports.ErrorCode.RC_CONN_REDIRECTED,Up[Di]=exports.ErrorCode.RC_CONN_PACKAGE_NAME_INVALID,Up[xi]=exports.ErrorCode.RC_CONN_APP_BLOCKED_OR_DELETED,Up[Gi]=exports.ErrorCode.RC_CONN_USER_BLOCKED,Up[Vi]=exports.ErrorCode.RC_CONN_TOKEN_EXPIRED,Up[ji]=exports.ErrorCode.RC_CONN_DEVICE_ERROR,Up[ki]=exports.ErrorCode.RC_CONN_HOSTNAME_ERROR,Up[Fi]=exports.ErrorCode.RC_DISCONN_SAME_CLIENT_ON_LINE,Up[Bi]=exports.ErrorCode.RC_LISCENSE_COUNT_OUT_OF_LIMIT,Up[Hi]=exports.ErrorCode.RC_CONN_WRONG_CLUSTER,Up[Yi]=exports.ErrorCode.RC_APP_AUTH_NOT_PASS,Up[Wi]=exports.ErrorCode.RC_OTP_USED,Up[Ji]=exports.ErrorCode.RC_PLATFORM_ERROR,Up[qi]=exports.ErrorCode.RC_ACCOUNT_CANCELLATION,Up[Ki]=exports.ErrorCode.RC_LICENSE_EXPIRED,Up),Ih=function(e){return[Jn.ppMsgS,Jn.pgMsgS,Jn.chatMsgS,Jn.prMsgS].includes(e)},Th=function(e){function r(t,r,n){var i=e.call(this,"WebSGMsgReceiver")||this;return Dp.add(i),Object.defineProperty(i,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"_recvRecord",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),i._ctx.on("sMsg",c(i,Dp,"m",Vp),i),i._ctx.on("syncMsg",c(i,Dp,"m",Gp),i),i}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var r,n,i,o,s,u,l,d,f,_,p,h,g,E,b,I,T,v,R,m,y,A,O=this;return a(this,(function(a){switch(a.label){case 0:return r=this._ctx,n=r.logger,i=r.currentUserId,o=r.connectedTime,s=this._ctx.getNaviInfoFromCache(),u=this._storage.get("inboxTime"),l=this._storage.get("outboxTime"),d=this._storage.get("broadcastTime"),f=n.createTraceId(),n.info(B.L_PULL_MSG_T,JSON.stringify({inboxTime:u,outboxTime:l,broadcastTime:d}),f),_=Dl.encode(Ta,{ispolling:!1,isPullSend:!0,syncTime:u,sendBoxSyncTime:l,broadcastSyncTime:d,compressioEnabled:Cn.enable()}),[4,this._ctx.query(Jn.pullMsg,i,_)];case 1:return(p=a.sent()).isOk?(h=Kp(p.data.pbData),E=(g=h).list,b=g.finished,I=g.syncTime,T=g.broadcastSyncTime,v=l,R=E.map((function(e){var t=bc(s,e,i,e.dataTime<o);return t.messageDirection===exports.MessageDirection.SEND&&(v=Math.max(v,t.sentTime)),t})),m=c(this,Dp,"a",xp),y=R.filter((function(e){if(e.senderUserId===i){var t=e.messageType===me.RECALL?"Cmd:".concat(e.content.messageUId):e.messageUId;return!O._storage.isLocalSent(t)}if(m)return!0;var r=!O._recvRecord.has(e.messageUId);return r&&O._recvRecord.set(e.messageUId,e.sentTime),r})),this._storage.set("inboxTime",I),this._storage.set("broadcastTime",T||1),this._storage.set("outboxTime",v),n.info(B.L_PULL_MSG_R,JSON.stringify({code:0,inboxTime:I,broadcastTime:T,outboxTime:v,msgCount:R.length,afterFilteredCount:y.length,hasNext:!b}),f),A=Math.max(I,T||1,v),0===e&&this._emitter.emit("__firstOfflineMessageTime__",(null===(t=R[0])||void 0===t?void 0:t.sentTime)||0),this._storage.removeSentRecordByTimestamp(v),c(this,Dp,"m",jp).call(this,"pullMsg",y,!!b),c(this,Dp,"m",kp).call(this,I),[2,fr({version:A,hasNext:!b})]):(n.warn(B.L_PULL_MSG_R,JSON.stringify({code:p.code}),f),[2,p.wipe()])}}))}))}}),r}(lr);Dp=new WeakSet,xp=function(){var e;return 0!==(null===(e=this._ctx.getNaviInfoFromCache())||void 0===e?void 0:e.openHistoryMsg)},Gp=function(e,t,r){var n=t.conversationType,i=t.sentTime,o=t.messageUId;n!==exports.ConversationType.ULTRA_GROUP&&n!==exports.ConversationType.CHATROOM&&(e.stopPropagation(),n===exports.ConversationType.RTC_ROOM||Ih(r)||this._storage.addSentRecord(o,i),c(this,Dp,"m",jp).call(this,"syncMsg",[t],!0))},Vp=function(e,t){var r=t.conversationType,n=t.sentTime,i=t.isStatusMessage,o=t.messageUId;r!==exports.ConversationType.CHATROOM&&r!==exports.ConversationType.ULTRA_GROUP&&(e.stopPropagation(),i||r===exports.ConversationType.RTC_ROOM?c(this,Dp,"m",jp).call(this,"smsg",[t],!0):c(this,Dp,"a",xp)?this.push(n):(this._recvRecord.has(o)||(this._recvRecord.set(o,n),c(this,Dp,"m",jp).call(this,"smsg",[t],!0)),c(this,Dp,"m",kp).call(this,n)))},jp=function(e,t,r){this._emitter.emit("messages",e,t,r)},kp=function(e){var t=this;if(!c(this,Dp,"a",xp)){var r=e-18e4;Array.from(this._recvRecord.entries()).forEach((function(e){var n=u(e,2),i=n[0];n[1]<=r&&t._recvRecord.delete(i)}))}};var vh,Rh,mh=function(e){function r(t,r){var n=e.call(this,"WebUGMsgReceiver")||this;return Fp.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:r}),n._ctx.on("syncMsg",c(n,Fp,"m",Hp),n),n._ctx.on("sCmd",c(n,Fp,"m",Bp),n),n}return t(r,e),Object.defineProperty(r.prototype,"markOnline",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,n,i,o;return a(this,(function(a){switch(a.label){case 0:return[4,c(this,Fp,"m",Wp).call(this,0)];case 1:return(e=a.sent()).isOk?(this._ctx.logger.info(B.L_NOTIFY_ULTRA_ONLINE_S,"success"),t=e.data.syncTime,[4,c(this,Fp,"m",Yp).call(this,0,[])]):(this._ctx.logger.warn(B.L_NOTIFY_ULTRA_ONLINE_S,"fail to pull ug msg, code: ".concat(e.code)),[2,e.wipe()]);case 2:return(r=a.sent()).isOk?(n=r.data,i=n.length>0?n[n.length-1].versionTime:0,o=Math.max(t,i),[2,fr({relations:n,msgVersion:o})]):[2,r.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,s,u,l=this;return a(this,(function(a){switch(a.label){case 0:return[4,c(this,Fp,"m",Wp).call(this,e)];case 1:return(t=a.sent()).isOk?(r=t.data,n=r.syncTime,i=r.finished,(null==(o=r.list)?void 0:o.length)&&(s=this._ctx.currentUserId,(u=o.filter((function(e){return!l._storage.isLocalSentUGMessage(e.msgId)})).map((function(e){return Ec(e,s,!1)}))).length>0&&this._ctx.emit("messagesFromUG",u,n)),this._storage.removeUGSentRecordByTimestamp(n),[2,fr({version:n,hasNext:!i})]):[2,t.wipe()]}}))}))}}),r}(lr);Fp=new WeakSet,Bp=function(e,t){if(6===t.type)this.push(t.time),e.stopPropagation()},Hp=function(e,t){t.conversationType===exports.ConversationType.ULTRA_GROUP&&(this.push(t.sentTime),e.stopPropagation())},Yp=function e(t,r){return o(this,void 0,void 0,(function(){var n,i,o,s,d,f,_,p,h,g;return a(this,(function(a){switch(a.label){case 0:return n=this._ctx,i=n.currentUserId,o=n.logger,s=o.createTraceId(),o.info(B.L_PULL_UG_RELATIONS_T,JSON.stringify({ver:t}),s),d=Dl.encode(Ss,{syncTime:t,isEraseMsgContent:!1}),[4,this._ctx.query(Jn.pullUgSes,i,d,void 0)];case 1:return f=a.sent(),o.summary(B.L_PULL_UG_RELATIONS_R,f,s,{ver:t}),f.isOk?(_=qp(f.data.pbData),p=_.info,h=_.isFinished,r.push.apply(r,l([],u(p),!1)),h?[2,fr(r)]:(g=p[p.length-1].versionTime,[2,c(this,Fp,"m",e).call(this,g,r)])):[2,f.wipe()]}}))}))},Wp=function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx,r=t.currentUserId,n=t.logger,i=n.createTraceId(),n.info(B.L_PULL_ULTRA_MSG_T,JSON.stringify({version:e}),i),l=e,o=Dl.encode(Cs,{syncTime:l,compressioEnabled:Cn.enable()}),[4,this._ctx.query(Jn.pullUgMsg,r,o)];case 1:return s=a.sent(),n.summary(B.L_PULL_ULTRA_MSG_R,s,i,{version:e}),s.isOk?(u=s.data,[2,fr(Kp(u.pbData))]):[2,s.wipe()]}var l}))}))};var yh,Ah,Oh,Sh=13,Ch=36,Nh=41,Mh=function(e){function r(t,r){var n=e.call(this,"WebServerEventHandler")||this;return vh.add(n),Object.defineProperty(n,"_con",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:r}),n}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,s,l,d=this;return a(this,(function(a){switch(a.label){case 0:return t=this._logger.createTraceId(),this._logger.info(B.L_PULL_EVENT_CHANGE_T,JSON.stringify({version:e}),t),[4,c(this,vh,"m",Rh).call(this,e)];case 1:return r=a.sent(),this._logger.summary(B.L_PULL_EVENT_CHANGE_R,r,t,{version:e}),r.isOk?(n=r.data,i=n.list,o=n.syncTime,s=n.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),r=t[0],n=t[1];d.emit("serverEvent",r,n)}))),[2,fr({version:o,hasNext:s})]):[2,r.wipe()]}}))}))}}),Object.defineProperty(r.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(r){switch(r.label){case 0:return e=this._logger.createTraceId(),this._logger.info(B.L_SERVER_EVENT_NOTIFY_ONLINE_T,JSON.stringify({version:0}),e),[4,c(this,vh,"m",Rh).call(this,0)];case 1:return t=r.sent(),this._logger.summary(B.L_SERVER_EVENT_NOTIFY_ONLINE_R,t,e,{version:0}),[2,t]}}))}))}}),r}(lr);vh=new WeakSet,Rh=function(e){var t=Dl.encode(Ps,{syncTime:e});return this._con.query(Jn.pullEventChange,this._con.getCurrentUserId(),t,Ls)};var Ph=function(e){function r(t){var r=e.call(this,"WebUGServerEventHandler")||this;return yh.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),r}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=Dl.encode(Ps,{syncTime:e}),[4,this._ctx.query(Jn.qryMsgChange,this._ctx.currentUserId,t,ws)];case 1:return(r=a.sent()).isOk?(n=r.data,i=n.list,o=n.syncTime,s=n.hasNext,i&&i.length&&c(this,yh,"m",Ah).call(this,i),[2,fr({version:o,hasNext:s})]):[2,r.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"_handleReactions",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Object.values(ke),r=e.map((function(e){var t=Dl.decode(ml,new Uint8Array(e));return gh(t)})).filter((function(e){var r=e.operationType;return t.includes(r)}));r.length&&this._ctx.emit("messageReaction",{reactions:r})}}),r}(lr);yh=new WeakSet,Ah=function(e){var t=[],r=[],n=[],i=[],o=[],a=[];e.forEach((function(e){switch(e.changeType){case 1:r.push(e);break;case 2:t.push(e);break;case 3:n.push(e);break;case 4:i.push(e);break;case 5:o.push(e);break;case 6:break;case 7:a.push(e.eventData)}})),r.length&&c(this,yh,"m",Oh).call(this,r,1),t.length&&c(this,yh,"m",Oh).call(this,t,2),n.length&&this.emit("ugMsgRecalled",n),i.length&&this._ctx.emit("ugChannelChanged",i),o.length&&this._ctx.emit("ugUserGroupChanged",o),this._handleReactions(a)},Oh=function(e,t){var r=this,n=new Map;e.forEach((function(e){var t=e.targetId,r=e.busChannel,i=e.msgUID,o="".concat(t,"-").concat(r),a=n.get(o);a?a.messageUIds.push(i):n.set(o,{conversationIdentifier:{conversationType:exports.ConversationType.ULTRA_GROUP,targetId:t,channelId:r},messageUIds:[i]})})),Array.from(n.entries()).forEach((function(e){var n=u(e,2);n[0];var i=n[1];1===t?r.emit("ugMsgExpansion",i.conversationIdentifier,i.messageUIds):r.emit("ugMsgModify",i.conversationIdentifier,i.messageUIds)}))};var Lh,wh,Uh,Dh,xh,Gh,Vh,jh,kh,Fh,Bh,Hh,Yh,Wh,Jh,qh,Kh,Qh,Xh,Zh,zh,$h,eg,tg,rg,ng,ig,og,ag,sg,ug,lg,cg,dg,fg,_g,pg,hg,gg,Eg,bg,Ig,Tg,vg,Rg,mg,yg,Ag,Og=function(){return o(void 0,void 0,void 0,(function(){return a(this,(function(e){return[2,_r(exports.ErrorCode.NOT_SUPPORT,"Not support")]}))}))},Sg=function(e){function r(t,r){var n=e.call(this,"WebSGMsgModifyReceiver")||this;return Lh.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:r}),wh.set(n,!0),n._ctx.on("onConnected",c(n,Lh,"m",Uh),n),n}return t(r,e),Object.defineProperty(r.prototype,"_handleModifyNotifies",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;if(0!==e.length){var r=this._ctx.currentUserId,n=[];e.forEach((function(e){e.modifyType;var i=e.msg,o=Ec(i,r,!1);n.push(o);var a=o.conversationType,s=o.targetId,u=o.channelId,l=t.storage.getModel({conversationType:a,targetId:s,channelId:u});if(l&&l.latestMessage){var c=l.latestMessage,d=c.messageUId,f=c.messageType,_=c.content;if(d!==o.messageUId){if(f===me.REFERENCE){if(_.referMsgUid!==o.messageUId)return;_.referMsg=o.content}}else l.updateAttrs({latestMessage:o})}})),this._ctx.emit("messageModified",n)}}}),Object.defineProperty(r.prototype,"_handleReactionNotifies",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(0!==e.length){var t=Object.values(ke),r=e.filter((function(e){var r=e.reaction;return t.includes(r.opType)})).map((function(e){var t=e.reaction;return gh(t)}));r.length&&this._ctx.emit("messageReaction",{reactions:r})}}}),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx.logger.createTraceId(),this._ctx.logger.info(B.L_PULL_MODIFY_MSG_T,JSON.stringify({time:e}),t),r=Dl.encode(Yu,{pullVersion:e,modifyType:[1,3],compress:Cn.enable()}),[4,this._ctx.query(Jn.pullModifyMsg,this._ctx.currentUserId,r,void 0)];case 1:return n=a.sent(),this._ctx.logger.summary(B.L_PULL_MODIFY_MSG_R,n,t),n.isOk?(i=nh(n.data.pbData),o=i.msg,s=i.nextVersion,u=i.finished,o&&o.length&&c(this,Lh,"m",Dh).call(this,o),c(this,wh,"f")&&(this._ctx.emit("messageModifiedSyncCompleted",!u),d(this,wh,!1,"f")),[2,fr({version:s,hasNext:!u})]):[2,n.wipe()]}}))}))}}),r}(lr);wh=new WeakMap,Lh=new WeakSet,Uh=function(e,t){d(this,wh,!0,"f"),t||this.reset()},Dh=function(e){var t=[],r=[];e.forEach((function(e){var n=e.modifyType;1===n?t.push(e):3===n&&r.push(e)})),this._handleModifyNotifies(t),this._handleReactionNotifies(r)};var Cg=18e4,Ng=function(e){function r(t,r,n){var i=e.call(this)||this;return Gh.add(i),Object.defineProperty(i,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,"_userSettins",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"storage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Vh.set(i,void 0),jh.set(i,void 0),kh.set(i,void 0),Fh.set(i,void 0),Bh.set(i,void 0),Hh.set(i,!1),Yh.set(i,void 0),Wh.set(i,!1),og.set(i,1),Object.defineProperty(i,"getConversationListByPageIndex",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(i,"getUntaggedConversationListByPage",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Tg.set(i,new Set),Object.defineProperty(i,"searchConversationByContent",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(i,"setMessageSpeechToTextVisible",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(i,"syncRemoteConversations",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(i,"getHistoryMessagesByObjectNames",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(i,"getContinuousMessages",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(i,"getMessagesAroundTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(i,"deleteLocalUGMessagesForAllChannel",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(i,"getUnreadMentionedMessages",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(i,"getFirstUnreadMessage",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(i,"getConversations",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(i,"clearConversations",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(i,"saveEditedMessageDraft",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(i,"getEditedMessageDraft",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(i,"clearEditedMessageDraft",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(i,"clearUnreadCountByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:Og}),d(i,Yh,new ur,"f"),d(i,Bh,n,"f"),i.storage=new Td(t),i.settings=new rd(i._ctx,i.storage,i),d(i,Vh,new mh(i._ctx,i.storage),"f"),d(i,jh,new Th(i._ctx,i.storage,c(i,Yh,"f")),"f"),d(i,kh,new Ph(i._ctx),"f"),d(i,Fh,new Sg(i._ctx,i.storage),"f"),c(i,Yh,"f").on("messages",c(i,Gh,"m",$h),i),c(i,Yh,"f").on("__firstOfflineMessageTime__",(function(e,t){c(i,Fh,"f").setInitVersion(t||i._ctx.connectedTime)}),i),c(i,kh,"f").on("ugMsgModify",c(i,Gh,"m",ug),i),c(i,kh,"f").on("ugMsgExpansion",c(i,Gh,"m",lg),i),c(i,kh,"f").on("ugMsgRecalled",c(i,Gh,"m",cg),i),i._ctx.on("onConnected",c(i,Gh,"m",ig),i),i._ctx.on("onDisconnected",c(i,Gh,"m",_g),i),i._ctx.on("onSuspend",c(i,Gh,"m",_g),i),i._ctx.on("sCmd",c(i,Gh,"m",pg),i),i._ctx.on("sNtf",c(i,Gh,"m",hg),i),i._ctx.on("signal",c(i,Gh,"m",gg),i),i._ctx.on("serverEvent",c(i,Gh,"m",eg),i),i._ctx.on("robotsSynced",c(i,Gh,"m",Jh),i),i}return t(r,e),Object.defineProperty(r.prototype,"ugSynced",{get:function(){return c(this,Hh,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"getConversationListByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,s,u,l,d;return a(this,(function(a){return r=e.count,n=e.startTime,i=e.order,o=e.conversationTypes,t?(s=0!==n||i?n:Number.MAX_SAFE_INTEGER,u=this.storage.getAllModels().filter((function(e){return!e.hidden&&(e.conversationType!==exports.ConversationType.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId)&&(i?e.operationTime>s:e.operationTime<s)})).sort((function(e,t){return e.operationTime-t.operationTime})),l=Math.min(u.length,r),d=i?u.slice(0,l):u.slice(u.length-l),i||d.reverse(),[2,fr(d.map((function(e){return e.toIReceivedConversation()})))]):[2,c(this,Gh,"m",Eg).call(this,n,r,i||0,o)]}))}))}}),Object.defineProperty(r.prototype,"getTopConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o;return a(this,(function(a){return n=((null==t?void 0:t.length)||0)>0?t:ee(e?K:J),i="string"==typeof r&&""!==r,o=this.storage.getAllModels().filter((function(t){return t.isTop&&!t.hidden&&n.includes(t.conversationType)&&(t.conversationType!==exports.ConversationType.ULTRA_GROUP&&(!i||t.channelId===r)||e&&(!t.channelId||"RCDefault"===t.channelId))})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,c(this,Gh,"m",bg).call(this,o)]}))}))}}),Object.defineProperty(r.prototype,"getBlockedConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return a(this,(function(r){return e=this._ctx.includeUg,t=this.storage.getAllModels().filter((function(t){return!t.hidden&&t.notificationLevel>exports.NotificationLevel.NOT_SET&&(t.conversationType!==exports.ConversationType.ULTRA_GROUP||e&&(!t.channelId||"RCDefault"===t.channelId))})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,c(this,Gh,"m",bg).call(this,t)]}))}))}}),Object.defineProperty(r.prototype,"getUnreadConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return a(this,(function(i){return r=((null==t?void 0:t.length)||0)>0?t:ee(e?K:J),n=this.storage.getAllModels().filter((function(t){return t.unreadCount>0&&r.includes(t.conversationType)&&(t.conversationType!==exports.ConversationType.ULTRA_GROUP||e&&(!t.channelId||"RCDefault"===t.channelId))})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,c(this,Gh,"m",bg).call(this,n)]}))}))}}),Object.defineProperty(r.prototype,"getAllConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return a(this,(function(i){switch(i.label){case 0:return r="string"==typeof t,e?(n=this.storage.getAllModels().filter((function(e){return!(e.hidden||(e.conversationType===exports.ConversationType.ULTRA_GROUP||r&&e.channelId!==t)&&e.channelId&&"RCDefault"!==e.channelId)})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,fr(n)]):[4,c(this,Gh,"m",Eg).call(this,0,1e3,0)];case 1:return[2,i.sent().trans((function(e){return e.filter((function(e){return!r||e.channelId===t}))}))]}}))}))}}),Object.defineProperty(r.prototype,"getTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return a(this,(function(i){return n=0,this.storage.getAllModels().forEach((function(i){i.unreadCount>0&&e.includes(i.conversationType)&&(i.conversationType!==exports.ConversationType.ULTRA_GROUP&&(!r&&!i.channelId||i.channelId===r)||i.conversationType===exports.ConversationType.ULTRA_GROUP&&(""===i.channelId||"RCDefault"===i.channelId))&&(t||i.notificationLevel<=exports.NotificationLevel.NOT_SET)&&(n+=i.unreadCount)})),[2,fr(n)]}))}))}}),Object.defineProperty(r.prototype,"getConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return a(this,(function(i){switch(i.label){case 0:return t=this.storage.getOrCreateModel(e,!1),r=t.toIReceivedConversation(),[4,c(this,Gh,"m",bg).call(this,[r])];case 1:return(n=i.sent()).isOk?[2,n.trans((function(e){return e[0]}))]:[2,fr(r)]}}))}))}}),Object.defineProperty(r.prototype,"batchSetConversationToTop",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u,l,d=this;return a(this,(function(a){switch(a.label){case 0:return r=this.storage.get("conversationStatusVersion"),[4,c(this,Gh,"m",Ig).call(this,e,r,t)];case 1:return(i=a.sent()).isOk?(o=i.data,s=o.version,u=o.updateVersion,l=e.map((function(e){var r=d.storage.getOrCreateModel(e,!0);return r.updateAttrs({isTop:t,hidden:!n&&r.hidden,operationTime:r.hidden&&n?Date.now():r.operationTime}),r})),this.storage.updateConversationStorage(l),u&&this.storage.set("conversationStatusVersion",s),[2,fr()]):[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"batchSetConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,s,u,l=this;return a(this,(function(a){switch(a.label){case 0:return r=this.storage.get("conversationStatusVersion"),[4,c(this,Gh,"m",Ig).call(this,e,r,void 0,t)];case 1:return(n=a.sent()).isOk?(i=n.data,o=i.version,s=i.updateVersion,u=e.map((function(e){var r=l.storage.getOrCreateModel(e,!0);return r.updateAttrs({notificationLevel:t}),r})),this.storage.updateConversationStorage(u),s&&this.storage.set("conversationStatusVersion",o),[2,fr()]):[2,n.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"batchSetConversationTranslateStrategy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,s,u,l=this;return a(this,(function(a){switch(a.label){case 0:return r=this.storage.get("conversationStatusVersion"),[4,c(this,Gh,"m",Ig).call(this,e,r,void 0,void 0,t)];case 1:return(n=a.sent()).isOk?(i=n.data,o=i.version,s=i.updateVersion,u=e.map((function(e){var r=l.storage.getOrCreateModel(e,!0);return r.updateAttrs({translateStrategy:t}),r})),this.storage.updateConversationStorage(u),s&&this.storage.set("conversationStatusVersion",o),[2,fr()]):[2,n.wipe()]}}))}))}}),Object.defineProperty(r.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(r){return t=this.storage.getOrCreateModel(e,!1),[2,fr(t.notificationLevel)]}))}))}}),Object.defineProperty(r.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(r){return t=this.storage.getConversationTypeNotificationLevel(e),[2,fr(t)]}))}))}}),Object.defineProperty(r.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return r=this.storage.get("conversationStatusVersion"),n=this._ctx.currentUserId,i=Dl.encode(ps,{type:e,unpushLevel:t,version:r,ignoreVersion:!0}),[4,this._ctx.query(Jn.setTypeUnpush,n,i,hs)];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,fr()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"clearAllSGUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return a(this,(function(r){return e=this.storage.getAllSGModels(),t=this._ctx.serverTime,e.forEach((function(e){return e.clearUnreadCount(t)})),this.storage.updateConversationStorage(e),[2,fr()]}))}))}}),Object.defineProperty(r.prototype,"deleteRemoteMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return r=t.map((function(e){return{msgDataTime:e.sentTime,msgId:e.messageUId,direct:e.messageDirection}})),n=Dl.encode(Za,{type:e.conversationType,busChannel:e.channelId,conversationId:e.targetId,msgs:r}),i=e.conversationType===exports.ConversationType.ULTRA_GROUP?Jn.delUgMsg:Jn.delMsg,[4,this._ctx.query(i,this._ctx.currentUserId,n)];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,fr()]):[2,fr()]:[2,o.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"deleteRemoteMessageByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return r=Dl.encode(Va,{conversationType:e.conversationType,targetId:e.targetId,busChannel:e.channelId,dataTime:t}),n=Mg[e.conversationType],[4,this._ctx.query(n,this._ctx.currentUserId,r)];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,fr()]):[2,fr()]:[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"batchClearRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=Dl.encode(ja,{input:e.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,busChannel:e.channelId,dataTime:e.timestamp||0}}))}),[4,this._ctx.query(Jn.cleanMsgBatch,this._ctx.currentUserId,t)];case 1:return(r=i.sent()).isOk?(e.forEach((function(e){var t=n.storage.getModel(e);if(t){var r=t.latestMessage;r&&(!e.timestamp||r.sentTime<=e.timestamp)&&t.updateAttrs({latestMessage:null})}})),[2,fr()]):[2,r.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"sendReadReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return a(this,(function(i){switch(i.label){case 0:return r=Dl.encode(Es,{targetId:e.targetId,type:e.conversationType,channelId:e.channelId,readType:0,msgIds:t}),n=t[0],[4,this._ctx.query(Jn.readReceipt,n,r)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getMessageReadReceiptInfoV5ByIdentifiers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,s,l;return a(this,(function(a){switch(a.label){case 0:return t=new Map,e.forEach((function(e){var r=ld(e.identifier),n=t.get(r)||new Set;n.add(e.messageUId),t.set(r,n)})),r=Array.from(t.entries()).map((function(e){var t=u(e,2),r=t[0],n=t[1],i=cd(r);return{targetId:i.targetId,type:i.conversationType,busChannel:i.channelId,msgIds:Array.from(n)}})),n=function(e){return Dl.encode(Is,{items:e,compress:Cn.enable()})}(r),[4,this._ctx.query(Jn.qryReceiptBatch,e[0].messageUId,n)];case 1:return(i=a.sent()).isOk?(o=i.data,s=zp(o.pbData).item,l=[],s.forEach((function(e){var t,r={conversationType:e.type,targetId:e.targetId,channelId:e.busChannel};null===(t=e.msg)||void 0===t||t.forEach((function(e){var t=e.msgId,n=e.unreadCnt,i=e.readCnt,o=e.totalCnt;l.push({identifier:r,messageUId:t,unreadCount:n,readCount:i,totalCount:o})}))})),[2,fr(l)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getMessagesReadReceiptUsersByPageV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,s,u,l,c,d;return a(this,(function(a){switch(a.label){case 0:return n=0===r.readStatus?1:2,i=Xp({targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgIds:[t],qryType:1,pageType:1,pageToken:r.pageToken,pageSize:r.pageCount,readType:n,order:r.order?0:1}),[4,this._ctx.query(Jn.qryReceipt,t,i)];case 1:return(o=a.sent()).isOk?(s=o.data,u=Zp(s.pbData),l=u.resp,c=u.pageToken,d=l[0],[2,fr({pageToken:c||"",totalCount:1===n?d.readCnt:d.unreadCnt,users:(1===n?d.readUser:d.unreadUser).map((function(e){var t=e.userId,r=e.mentioned;return{userId:t,timestamp:e.receiptTime||0,isMentioned:!!r}}))})]):[2,o.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getMessagesReadReceiptByUsersV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,s,c;return a(this,(function(a){switch(a.label){case 0:return n=Xp({targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgIds:[t],qryType:2,users:r}),[4,this._ctx.query(Jn.qryReceipt,t,n)];case 1:return(i=a.sent()).isOk?(o=i.data,s=Zp(o.pbData).resp,c=s[0],[2,fr({pageToken:"",totalCount:0,users:l(l([],u(c.readUser),!1),u(c.unreadUser),!1).map((function(e){var t=e.userId,r=e.mentioned;return{userId:t,timestamp:e.receiptTime||0,isMentioned:!!r}}))})]):[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"requestSpeechToTextForMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return a(this,(function(n){return(r=pr.create("requestSpeechToTextForMessage").isObject("option",t,!0).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,"option type error").validate("messageType",null==t?void 0:t.messageType,(function(e){return e===me.HQ_VOICE||e===me.VOICE}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).check((function(e){if(t.messageType===me.HQ_VOICE)e.validate("numberOfChannels",t.numberOfChannels,(function(e){return 1===e}),!0).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"numberOfChannels invalid").validate("sampleRate",t.sampleRate,(function(e){return 16e3===e||8e3===e}),!0).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"sampleRate invalid").isString("format",t.format).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"format invalid").isHttpUrl("remoteUrl",t.remoteUrl,!0).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"remoteUrl invalid");else{var r=t.content;e.isNotEmptyString("content",r,!0).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"content invalid")}})).isLimitedInteger("duration",t.duration,1,60,!0).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"duration invalid").result()).isOk?c(this,Tg,"f").has(e)?[2,_r(exports.ErrorCode.SPEECH_TO_TEXT_REQUEST_IN_PROCESS,"speech to text request in process")]:(c(this,Gh,"m",vg).call(this,e,t),[2,fr()]):[2,r.wipe()]}))}))}}),Object.defineProperty(r.prototype,"modifyMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return t=e.messageUId,r=e.messageContent,n=e.conversation,i=Dl.encode(Ns,{targetId:n.targetId,type:n.conversationType,busChannel:n.channelId,msgUID:t,msgTime:0,content:JSON.stringify(r),fromUserId:""}),[4,this._ctx.query(Jn.modifyMsg,this._ctx.currentUserId,i,Ms)];case 1:return(o=a.sent()).isOk?((s=this.storage.getModel(n))&&(u=s.latestMessage,l=s.conversationType,u&&u.messageUId===t&&(u.content=r,u.isModifyMessage=!0,u.modifyInfo=l===exports.ConversationType.ULTRA_GROUP?void 0:{timestamp:o.data.modifyTime,status:xr.SUCCESS,content:{}},s.updateAttrs({latestMessage:u}))),[2,fr()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"refreshReferenceMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o,s=this;return a(this,(function(a){return(o=pr.create("refreshReferenceMessageWithParams").validate("messageInfoMap",i,(function(t){return t&&e.every((function(e){return t[e]&&vt(t[e])}))}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_INFO_MAP).result()).isOk?(setTimeout((function(){n([]),c(s,Gh,"m",mg).call(s,e,t,r,i)}),0),[2,fr()]):[2,o.wipe()]}))}))}}),Object.defineProperty(r.prototype,"addTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,s,l,c,d,f,_,p,h,g=this;return a(this,(function(a){switch(a.label){case 0:return this._userSettins.hasTag(e)?(r=this.storage.get("conversationStatusVersion"),n=Date.now(),i=this._ctx.currentUserId,o=t.map((function(t){return{type:t.conversationType,channelId:t.targetId,busChannel:t.channelId,time:n,stateItem:[{sessionStateType:ha.Tags,value:"",tags:[{tagId:e}]}]}})),s=rh(r,o),[4,this._ctx.query(Jn.addTag,i,s,_s)]):[2,_r(exports.ErrorCode.TAG_NOT_EXIST)];case 1:return(l=a.sent()).isOk?(c=l.data,d=c.version,f=c.updateVersion,_=new Map,t.forEach((function(t){var r=g.storage.getOrCreateModel(t,!0),n={},i=r.tags;i.some((function(t){return t.tagId===e}))||(n.tags=i.concat({tagId:e}),_.set(r,n))})),p=[],h=[],Array.from(_.entries()).forEach((function(e){var t=u(e,2),r=t[0],n=t[1];h.push(r);var i=r.updateAttrs(n,d);i&&p.push({conversation:r.toIReceivedConversation(),updatedItems:i})})),this.storage.updateConversationStorage(h),f&&this.storage.set("conversationStatusVersion",d),p.length>0&&this.emit("conversationStatusChanged",p),[2,fr()]):[2,l.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return a(this,(function(i){return t=this.storage.getOrCreateModel(e,!1),r=this._userSettins.getTags(),n=t.tags.map((function(e){var t;return{tagId:e.tagId,tagName:null===(t=r[e.tagId])||void 0===t?void 0:t.tagName}})),[2,fr(n)]}))}))}}),Object.defineProperty(r.prototype,"setConversationStatusInTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,s,u,l,c,d,f,_,p;return a(this,(function(a){switch(a.label){case 0:return n=this.storage.get("conversationStatusVersion"),i=r.isTop,o=this.storage.getOrCreateModel(t,!1),s=o.tags,(u=s.find((function(t){return t.tagId===e})))?(l=rh(n,[{type:t.conversationType,channelId:t.targetId,busChannel:t.channelId,time:Date.now(),stateItem:[{sessionStateType:ha.Tags,value:"",tags:[{tagId:e,isTop:i}]}]}]),c=this._ctx.currentUserId,[4,this._ctx.query(Jn.addTag,c,l,_s)]):[2,_r(exports.ErrorCode.NO_TAG_IN_CONVER)];case 1:return(d=a.sent()).isOk?(f=d.data,_=f.version,p=f.updateVersion,u.isTop=i,o.updateAttrs({tags:s},_),this.storage.updateConversationStorage([o]),p&&this.storage.set("conversationStatusVersion",_),[2,fr()]):[2,d.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"removeTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,s,u,l,c,d=this;return a(this,(function(a){switch(a.label){case 0:return r=this.storage.get("conversationStatusVersion"),n=rh(r,t.map((function(t){return{type:t.conversationType,channelId:t.targetId,busChannel:t.channelId,time:Date.now(),stateItem:[{sessionStateType:ha.Tags,value:"",tags:[{tagId:e}]}]}}))),i=this._ctx.currentUserId,[4,this._ctx.query(Jn.delTag,i,n,_s)];case 1:return(o=a.sent()).isOk?(s=o.data,u=s.version,l=s.updateVersion,c=t.map((function(t){var r=d.storage.getOrCreateModel(t,!0),n={tags:r.tags.filter((function(t){return t.tagId!==e}))};return r.updateAttrs(n,u),r})),this.storage.updateConversationStorage(c),l&&this.storage.set("conversationStatusVersion",u),[2,fr()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"removeTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,s,u,l,c,d,f;return a(this,(function(a){switch(a.label){case 0:return r=this._ctx.currentUserId,n=this.storage.get("conversationStatusVersion"),i=rh(n,[{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId,time:Date.now(),stateItem:[{sessionStateType:ha.Tags,value:"",tags:t.map((function(e){return{tagId:e}}))}]}]),[4,this._ctx.query(Jn.delTag,r,i,_s)];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,fr()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getConversationListByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){return this._userSettins.hasTag(e)?(i=t||Number.MAX_SAFE_INTEGER,0===(o=this.storage.getAllSGModels().filter((function(t){return t.operationTime<i&&t.tags.some((function(t){return t.tagId===e}))})).sort((function(e,t){return t.operationTime-e.operationTime})).slice(0,r)).length?[2,fr([])]:(s=o.map((function(t){return n(n({},t.toIReceivedConversation()),{isTopInTag:t.tags.some((function(t){return t.tagId===e&&t.isTop}))})})),[2,c(this,Gh,"m",bg).call(this,s)])):[2,fr([])]}))}))}}),Object.defineProperty(r.prototype,"getUnreadCountByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return a(this,(function(n){return r=0,this.storage.getAllSGModels().forEach((function(n){var i;if(n.tags.some((function(t){return t.tagId===e}))){if(n.notificationLevel>exports.NotificationLevel.NOT_SET&&!t)return;r+=null!==(i=n.unreadCount)&&void 0!==i?i:0}})),[2,fr(r)]}))}))}}),Object.defineProperty(r.prototype,"batchDeleteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return t=e.identifiers,r=e.deleteMessages,n=Dl.encode(Xa,{relation:t.map((function(e){return{conversationType:e.conversationType,conversationId:e.targetId,busChannel:e.channelId}})),cleanMsg:r}),[4,this._ctx.query(Jn.delRelationBatch,this._ctx.currentUserId,n,void 0)];case 1:return(i=a.sent()).isOk&&t.forEach((function(e){var t=o.storage.getModel(e);t&&o.storage.removeConversation(t)})),[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"sendReadReceiptV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return n=Dl.encode(gs,{msgId:t,channelId:r}),[4,this._ctx.query(Jn.rrMsg,e,n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"sendUltraGroupTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o;return a(this,(function(a){switch(a.label){case 0:return t=e.conversationType,r=e.channelId,n=e.targetId,i=Dl.encode(xs,{targetId:n,type:t,busChannel:r||"",opType:0}),(o=new To(Jn.operate,i,n)).setHeaderQos(Zn),[4,this._ctx.send(o)];case 1:return[2,a.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i;return a(this,(function(o){return r=(t=e||{}).targetId,n=t.channelType,i=this.storage.getAllUGModels().filter((function(e){return!(void 0!==r&&r!==e.targetId||void 0!==n&&n!==e.channelType)})).sort((function(e,t){var r,n,i=(null===(r=e.latestMessage)||void 0===r?void 0:r.sentTime)||0;return((null===(n=t.latestMessage)||void 0===n?void 0:n.sentTime)||0)-i})).map((function(e){var t=e.toIReceivedConversation();return t.unreadMentionedCount=yc(t.unreadMentionedCount||0),t.unreadMessageCount=yc(t.unreadMessageCount||0),t.unreadMentionedMeCount=yc(t.unreadMentionedMeCount||0),t})),[2,fr(i)]}))}))}}),Object.defineProperty(r.prototype,"getRemoteMessagesByUIds",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return r=this._ctx.currentUserId,[4,c(this,Gh,"m",Rg).call(this,e,t)];case 1:return(n=a.sent()).isOk?(i=n.data,o=i.list,i.notExistMsgId,s=o.map((function(t){return Ec(t,r,!1,e.targetId)})),[2,fr(s)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getUGUnreadMentionedDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=e.targetId,r=e.channelId,n=e.sentTime,i=e.count,o=Dl.encode(xa,{groupId:t,busChannel:r,msgTime:n,size:i}),[4,this._ctx.query(Jn.qryUgUal,this._ctx.currentUserId,o,Ga)];case 1:return(s=a.sent()).isOk?(u=s.data.msgInfo,[2,fr(u.map((function(e){return{messageUId:e.msgId,sentTime:e.msgTime,messageType:e.className,mentionedType:e.remindType}})))]):[2,s.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"updateUGMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var i;return o(this,void 0,void 0,(function(){var o,s,u,l,c,d,f,_;return a(this,(function(a){switch(a.label){case 0:return o=this._ctx.currentUserId,s=t.mid,u=t.put,l=t.del,c=t.clear,d=Dl.encode(Ns,{fromUserId:o,targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgUID:s,msgTime:r,content:JSON.stringify(t)}),[4,this._ctx.query(Jn.upMsgEx,e.targetId,d)];case 1:return(f=a.sent()).isOk&&(null==(_=null===(i=this.storage.getModel(e))||void 0===i?void 0:i.latestMessage)?void 0:_.messageUId)===s&&(c?_.expansion={}:u?_.expansion=n(n({},_.expansion),u):l&&_.expansion&&l.forEach((function(e){delete _.expansion[e]}))),[2,f.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"setUGDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return n=Dl.encode(ds,{unpushLevel:t,busChannel:r}),[4,this._ctx.query(Jn.ugUnpushSet,e,n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getUGDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i;return a(this,(function(o){switch(o.label){case 0:return r=Dl.encode(cs,{busChannel:t}),[4,this._ctx.query(Jn.ugUnpushQuery,e,r,fs)];case 1:return(n=o.sent()).isOk?(i=n.data.unpushLevel,[2,fr(i)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var r;return a(this,(function(n){return r=this.storage.getModel(e),[2,fr(null!==(t=null==r?void 0:r.unreadMentionedCount)&&void 0!==t?t:0)]}))}))}}),Object.defineProperty(r.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.storage.getAllSGModels().reduce((function(e,t){return e+t.unreadMentionedCount}),0),[2,fr(e)]}))}))}}),Object.defineProperty(r.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return a(this,(function(i){return n=0,this.storage.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))&&(n+=r?s:a)}})),[2,fr(n)]}))}))}}),Object.defineProperty(r.prototype,"getConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(r){return t=this.storage.getModel(e),[2,fr(t?t.unreadCount:0)]}))}))}}),Object.defineProperty(r.prototype,"getFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r;return a(this,(function(n){return(t=this.storage.getModel(e))?(r=t.firstUnreadMessage,[2,fr(r?{messageUId:r.messageUId||"",sentTime:r.sentTime}:null)]):[2,fr(null)]}))}))}}),Object.defineProperty(r.prototype,"getUGUnreadCountForAllChannels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i;return a(this,(function(o){return n=this.storage.getAllUGModels(),i=n.reduce((function(n,i){var o=r?i.unreadMentionedCount:i.unreadCount;if(!o||i.targetId!==e)return n;var a=i.notificationLevel||exports.NotificationLevel.NOT_SET;return!t.length||t.includes(a)?n+o:n}),0),[2,fr(yc(i))]}))}))}}),Object.defineProperty(r.prototype,"getUGUnreadInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(r){return t=this.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:yc(e.unreadCount||0),mentionedCount:yc(e.unreadMentionedCount||0),mentionedMeCount:yc(e.unreadMentionedMeCount||0),notificationLevel:e.notificationLevel||exports.NotificationLevel.NOT_SET}})),[2,fr(t)]}))}))}}),Object.defineProperty(r.prototype,"getUGFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r;return a(this,(function(n){return t=this.storage.getModel(e),(r=null==t?void 0:t.firstUnreadMessage)?[2,fr(r)]:[2,_r(exports.ErrorCode.RC_DB_DATA_NOT_FOUND)]}))}))}}),Object.defineProperty(r.prototype,"getBlockedUGList",{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.storage.getAllUGModels().filter((function(e){return e.notificationLevel>exports.NotificationLevel.NOT_SET})).map((function(e){return e.toIReceivedConversation()})),[2,fr(e)]}))}))}}),Object.defineProperty(r.prototype,"clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i;return a(this,(function(o){switch(o.label){case 0:return t=this._ctx.serverTime,e.conversationType!==exports.ConversationType.ULTRA_GROUP?[3,2]:(r=Jp(e,t),(n=new To(Jn.updUgRTime,r,this._ctx.currentUserId)).setHeaderQos(Zn),[4,this._ctx.send(n)]);case 1:if(!(i=o.sent()).isOk)return[2,i.wipe()];o.label=2;case 2:return this.storage.clearConversationUnreadCount(e,t),[2,fr()]}}))}))}}),Object.defineProperty(r.prototype,"getRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return[4,c(this,Gh,"m",Ag).call(this,t,r,e,[],xe.ALL,Jn.qrySessions)];case 1:return(i=a.sent()).isOk?(o=this._ctx.currentUserId,s=i.data.info.map((function(e){var t=e.unreadCount,r=e.busChannel,i=e.type,a=e.userId,s=e.versionTime,l=e.msg,c=u.storage.getOrCreateModel({conversationType:i,targetId:a,channelId:r||""},!1);return n(n({},c.toIReceivedConversation()),{unreadMessageCount:t,operationTime:s,latestMessage:l?Ec(l,o,!1,a):null})})).sort((function(e,t){var n,i,o=(null===(n=e.latestMessage)||void 0===n?void 0:n.sentTime)||0,a=(null===(i=t.latestMessage)||void 0===i?void 0:i.sentTime)||0;return 0===r?a-o:o-a})),[2,fr(s)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(r.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=Dl.encode(Ya,{nothing:1}),[4,this._ctx.query(Jn.qrySessionsAtt,this._ctx.currentUserId,e,Wa)];case 1:return[2,t.sent().trans((function(e){return e.totalUnreadCount}))]}}))}))}}),Object.defineProperty(r.prototype,"clearRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return a(this,(function(i){switch(i.label){case 0:return t=this._ctx.serverTime,this.storage.clearConversationUnreadCount(e,this._ctx.serverTime),r=Jp(e,t),n=new To(Jn.updRRTime,r,this._ctx.currentUserId),[4,this._ctx.send(n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"removeRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return t=Dl.encode(qa,{sessions:e.map((function(e){return{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId}}))}),[4,this._ctx.query(Jn.delSessions,this._ctx.currentUserId,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"batchGetRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return t=Dl.encode(Ka,{sessions:e.map((function(e){return{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId}}))}),[4,this._ctx.query(Jn.qrySessionsUnread,this._ctx.currentUserId,t,Qa)];case 1:return[2,r.sent().trans((function(e){return e.sessions.map((function(e){return{conversationType:e.type,targetId:e.channelId,channelId:e.busChannel||"",unreadCount:e.unreadCount||0}}))}))]}}))}))}}),Object.defineProperty(r.prototype,"getUnreadMentionMeConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,s,u;return a(this,(function(a){return r=e.count,n=e.conversationTypes,i=e.timestamp||Number.MAX_SAFE_INTEGER,t?(o=this.storage.getAllModels().filter((function(e){return e.operationTime<i&&e.unreadMentionedCount>0&&n.includes(e.conversationType)&&(e.conversationType!==exports.ConversationType.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId)})).sort((function(e,t){return t.operationTime-e.operationTime})).slice(0,r),[2,fr(o.map((function(e){return e.toIReceivedConversation()})))]):(s=this.storage.getAllSGModels().filter((function(e){return e.operationTime<i&&e.unreadMentionedCount>0&&n.includes(e.conversationType)})).sort((function(e,t){return t.operationTime-e.operationTime})).slice(0,r),u=s.map((function(e){return e.toIReceivedConversation()})),[2,c(this,Gh,"m",bg).call(this,u)])}))}))}}),Object.defineProperty(r.prototype,"loadConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,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=function(e,t,r){var n=r.conversationTypes,i=r.tagFilter,o=void 0===i?{}:i,a=r.order;r.channelId;var s=o.tagIds,u=o.topPriority;return Dl.encode(Ua,{type:n,count:t,order:a,tags:s,isTagTop:!!u,pageToken:e,compress:Cn.enable()})}(e,t,r),[4,this._ctx.query(Jn.qryRelationFilter,this._ctx.currentUserId,i,void 0)];case 1:return(o=a.sent()).isOk?(s=qp(o.data.pbData),u=s.pageToken,l=s.isFinished,c=s.info,d=c.map((function(e){var t=e.busChannel,r=e.type,i=e.userId,o={conversationType:r,targetId:i,channelId:t||""},a=f.storage.getOrCreateModel(o,!1);return n(n({},a.toIReceivedConversation()),{operationTime:e.versionTime,latestMessage:e.msg?Ec(e.msg,f._ctx.currentUserId,!1,i):null})})),[2,fr({pageToken:u||"",finished:!!l,list:d})]):[2,o.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"updateConversationReadTime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return a(this,(function(i){switch(i.label){case 0:return r=Jp(e,t),n=new To(Jn.updRTime,r,this._ctx.currentUserId),[4,this._ctx.send(n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return n=Dl.encode(gs,{msgId:[t],channelId:r}),[4,this._ctx.query(Jn.rrList,e,n,Rs)];case 1:return[2,i.sent().trans((function(e){return{totalMemberCount:e.totalMemberNum,list:e.list}}))]}}))}))}}),Object.defineProperty(r.prototype,"sendReadReceiptMessageV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return n=e.conversationType,i=e.targetId,o=e.channelId,s=Dl.encode(Ys,{targetId:i,type:n,busChannel:o,startMsgId:t,endMsgId:r}),u=new To(Jn.sendMsgRead,s,i),[4,this._ctx.send(u)];case 1:return[2,a.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getMessageReadReceiptV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o;return a(this,(function(a){switch(a.label){case 0:return r=e.targetId,n=e.channelId,i=void 0===n?"":n,o=Dl.encode(Ws,{targetId:r,busChannel:i,msgId:t}),[4,this._ctx.query(Jn.qryMsgRead,r,o,Js)];case 1:return[2,a.sent().trans((function(e){var t=e.list,r=e.num,n=e.readCnt;return{list:t.map((function(e){return{userId:e.userId,readTime:e.receiptTime}})),totalCount:r,readCount:n}}))]}}))}))}}),Object.defineProperty(r.prototype,"batchGetMessageReadReceiptInfoV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){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=e.targetId,i=e.conversationType,o=e.channelId,s=Dl.encode(qs,{type:i,busChannel:o,msgId:t}),[4,this._ctx.query(Jn.qryMsgReadCntBatch,r,s,Ks)];case 1:return[2,a.sent().trans((function(t){return t.result.map((function(t){return n({messageUId:t.msgId,readedCount:t.cnt,totalCount:t.tmn},e)}))}))]}}))}))}}),Object.defineProperty(r.prototype,"getConversationsIncludingRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i;return a(this,(function(o){return t=e.count,r=e.conversationTypes,this._ctx.includeUg?(n=e.timestamp||Number.MAX_SAFE_INTEGER,i=this.storage.getAllSGModels().filter((function(e){return e.includeRobot&&e.operationTime<n&&r.includes(e.conversationType)})).sort((function(e,t){return t.operationTime-e.operationTime})).slice(0,t),[2,fr(i.map((function(e){return e.toIReceivedConversation()})))]):[2,c(this,Gh,"m",Eg).call(this,e.timestamp,t,0,r,xe.ROBOT_ONLY)]}))}))}}),Object.defineProperty(r.prototype,"markRemoteConversationAsRead",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o;return a(this,(function(a){switch(a.label){case 0:return[4,c(this,Bh,"f").sendMessage(e,t,r)];case 1:return(n=a.sent()).isOk?(i=n.data.sentTime,(o=this.storage.getModel(e))&&(o.clearUnreadCount(i),this.storage.updateConversationStorage([o])),[2,n.wipe()]):[2,n.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"_updateMessageReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,s,u,l,c,d;return a(this,(function(a){switch(a.label){case 0:return r=t.conversationIdentifier,n=t.pushConfig,i=t.reactionId,o=t.messageUId,s=r.targetId,u=r.conversationType,l=r.channelId,c=ah(n),d=Dl.encode(gl,{targetId:s,type:u,busChannel:l,msgId:o,reactionId:i,pushExt:c,appData:null==n?void 0:n.pushData,pushText:null==n?void 0:n.pushContent}),[4,this._ctx.query(e,s,d,El)];case 1:return[2,a.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"addMessageReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r;return a(this,(function(n){return(r={})[exports.ConversationType.PRIVATE]=Jn.addPReaction,r[exports.ConversationType.GROUP]=Jn.addGReaction,r[exports.ConversationType.ULTRA_GROUP]=Jn.addUgReaction,t=r[e.conversationIdentifier.conversationType],[2,this._updateMessageReaction(t,e)]}))}))}}),Object.defineProperty(r.prototype,"removeMessageReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=((t={})[exports.ConversationType.PRIVATE]=Jn.rmPReaction,t[exports.ConversationType.GROUP]=Jn.rmGReaction,t[exports.ConversationType.ULTRA_GROUP]=Jn.rmUgReaction,t)[e.conversationIdentifier.conversationType];return this._updateMessageReaction(r,e)}}),Object.defineProperty(r.prototype,"batchGetMessageReactionSummaries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var r,n,i,o,s,u,l,c,d,f;return a(this,(function(a){switch(a.label){case 0:return r=e.conversationIdentifier,n=e.messageUIds,i=r.targetId,o=r.conversationType,s=r.channelId,u=o===exports.ConversationType.ULTRA_GROUP?Jn.ugMReactBQ:Jn.mReactBQ,l=Dl.encode(bl,{targetId:i,type:o,busChannel:s,msgId:n,compress:Cn.enable(),allUser:!1}),[4,this._ctx.query(u,n[0],l,void 0)];case 1:return(c=a.sent()).isOk?(d=fh(c.data.pbData).msgReaction,f={},n.forEach((function(e){f[e]=[]})),null===(t=d)||void 0===t||t.forEach((function(e){f[e.msgId]=hh(e.reaction,e.msgId)})),[2,fr(f)]):[2,c.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getMessageReactions",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,s,u,l,c,d,f,_,p,h;return a(this,(function(a){switch(a.label){case 0:return t=e.conversationIdentifier,r=e.pageToken,n=e.count,i=e.messageUId,o=t.targetId,s=t.conversationType,u=t.channelId,l=s===exports.ConversationType.ULTRA_GROUP?Jn.ugMReactQ:Jn.mReactQ,c=Dl.encode(Tl,{targetId:o,type:s,busChannel:u,msgId:i,size:n,pageToken:r,compress:Cn.enable(),allUser:!1}),[4,this._ctx.query(l,i,c,void 0)];case 1:return(d=a.sent()).isOk?(f=_h(d.data.pbData),_=f.pageToken,p=f.reaction,h={pageToken:_||"",reactions:hh(p,i)},[2,fr(h)]):[2,d.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getMessageReactionUsers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,s,u,l,c,d,f,_,p,h,g,E;return a(this,(function(a){switch(a.label){case 0:return t=e.conversationIdentifier,r=e.pageToken,n=e.count,i=e.messageUId,o=e.reactionId,s=t.targetId,u=t.conversationType,l=t.channelId,c=u===exports.ConversationType.ULTRA_GROUP?Jn.ugMReactUQ:Jn.mReactUQ,d=Dl.encode(Tl,{targetId:s,type:u,busChannel:l,msgId:i,reactionId:o,size:n,pageToken:r,compress:Cn.enable()}),[4,this._ctx.query(c,i,d,void 0)];case 1:return(f=a.sent()).isOk?(_=ph(f.data.pbData),p=_.pageToken,h=_.reaction,g=h.user,E={pageToken:p||"",totalCount:h.userCnt,users:g.map((function(e){return{userId:e.userId,reactionTime:e.reactionTime}}))},[2,fr(E)]):[2,f.wipe()]}}))}))}}),r}(ur);Vh=new WeakMap,jh=new WeakMap,kh=new WeakMap,Fh=new WeakMap,Bh=new WeakMap,Hh=new WeakMap,Yh=new WeakMap,Wh=new WeakMap,og=new WeakMap,Tg=new WeakMap,Gh=new WeakSet,Jh=function(e,t,r){if(t===exports.ErrorCode.SUCCESS&&this._ctx.includeUg&&0!==r.length){var n=[exports.ConversationType.PRIVATE,exports.ConversationType.SYSTEM];this.storage.getAllSGModels().filter((function(e){return n.includes(e.conversationType)&&r.some((function(t){return t.robotId===e.targetId}))})).forEach((function(e){return e.updateAttrs({includeRobot:!0})}))}},qh=function(e,t){var r=e.conversationType,i=e.targetId,o=e.channelId,a=e.senderUserId;if(r!==exports.ConversationType.PRIVATE)return!1;if(a===this._ctx.currentUserId){var s={conversationType:r,targetId:i,channelId:o},u=this.storage.getOrCreateModel(s,!0);if(u.version<e.sentTime){var l=u.clearUnreadCount(e.sentTime);l&&t.set(u,n(n({},t.get(u)),l))}}return!0},Kh=function(e,t,r,i){var o=t.conversationType,a=t.targetId,s=t.channelId,u=t.senderUserId,l=t.content;if(u!==this._ctx.currentUserId)return!1;var c={conversationType:o,targetId:a,channelId:s},d=this.storage.getOrCreateModel(c,!0);if(d.version>=t.sentTime)return!1;var f=d.clearUnreadCount(t.sentTime);return f&&r.set(d,n(n({},r.get(d)),f)),d.removeRecvMessageRecords(t.sentTime),1!==e.sesDriven||(t.isOffLineMessage&&i.push(n(n({},c),{timestamp:l.lastMessageSendTime})),!1)},Qh=function(e,t){var r=e.conversationType,i=e.targetId,o=e.channelId,a=e.content,s={conversationType:r,targetId:i,channelId:o},u=r===exports.ConversationType.PRIVATE?{privateReadReceipt:n(n({},s),{endMsgTime:a.endMsgTime})}:{groupReadReceipt:n(n({},s),{totalCount:a.tmn,readedCount:a.rrn,messageUId:a.msgId})};t.push(u)},Xh=function(e,t,r,i){var o,a=e.content,s=e.conversationType,u=e.targetId,l=e.channelId,c=e.isPersited,d=e.isStatusMessage,f=e.isCounted,_=e.messageType;e.isMentioned;var p=e.senderUserId,h=e.disableUpdateLastMessage;if(te(s,K)&&!d&&c&&!mc(r).isOk){var g={conversationType:s,targetId:u,channelId:l},E=this.storage.getOrCreateModel(g,!0),b=p===i,I=_===me.RECALL,T={hidden:!1},v=function(){var r=E.updateAttrs(T,e.sentTime);r&&t.set(E,n(n({},t.get(E)),r))};if(I&&!E.hidden||(T.operationTime=e.sentTime),h||(T.latestMessage=r.supportRecallRefactor&&I?Rc(e,!0):e),E.version>=e.sentTime)v();else{if(T.version=e.sentTime,I){var R=a,m=R.sentTime,y=R.originalFromUserId;return y||(y=p),m&&m>E.lastReadTime&&!(null===(o=e.__innerData__)||void 0===o?void 0:o.keepUnreadCount)&&y!==i&&(T.unreadCount=Math.max(E.unreadCount-1,0),0===T.unreadCount&&(T.firstUnreadMessageUId="",T.firstUnreadTime=0,T.firstUnreadMessageType="",T.unreadMentionedCount=0,T.unreadMentionedMeCount=0,T.hasMentioned=!1,T.mentionedInfo=void 0),E.addRecvMessageRecord(m,-1)),void v()}if(!b&&f){var A;if(T.unreadCount=E.unreadCount+1,0===E.unreadCount&&(T.firstUnreadMessageUId=e.messageUId,T.firstUnreadTime=e.sentTime,T.firstUnreadMessageType=e.messageType),a.mentionedInfo){var O=a.mentionedInfo,S=O.type,C=O.userIdList,N=S===exports.MentionedType.ALL||S===exports.MentionedType.SINGAL&&(null==C?void 0:C.includes(i));N&&(A=S,T.hasMentioned=N,T.mentionedInfo={type:S,userIdList:C},T.unreadMentionedCount=E.unreadMentionedCount+1,S===exports.MentionedType.SINGAL&&(T.unreadMentionedMeCount=E.unreadMentionedMeCount+1))}E.addRecvMessageRecord(e.sentTime,1,A),v()}else v()}}},Zh=function(e,t){var r=e.conversationType,i=e.targetId,o=e.channelId,a=e.content,s={conversationType:r,targetId:i,channelId:o||""},u=a.put,l=a.del,c=a.mid,d=a.clear;if(u?t.push({updatedExpansion:n(n({},s),{messageUId:c,expansion:u})}):l&&t.push({deletedExpansion:n(n({},s),{messageUId:c,deletedKeys:l})}),this._ctx.includeUg){var f=this.storage.getModel(s);f&&f.latestMessage&&f.latestMessage.messageUId===c&&(d?f.latestMessage.expansion={}:u?f.latestMessage.expansion=n(n({},f.latestMessage.expansion),u):l&&f.latestMessage.expansion&&l.forEach((function(e){delete f.latestMessage.expansion[e]})))}},zh=function(e){var t=this,r=this._ctx.currentUserId,n=this._ctx.getNaviInfoFromCache(),i={v4ReadReceipts:[],v4SyncNotify:[],expansions:[],logCmdMessages:[],cloudControllerMessages:[],messages:[],updateModels:new Map};return i.messages=e.filter((function(e){switch(e.messageType){case me.DELIVERED:case me.DELIVERED_MSG:return!1;case me.LOG_COMMAND:return i.logCmdMessages.push(e),!1;case me.CLOUD_CONTROL:return i.cloudControllerMessages.push(e),!1;case me.READ_RECEIPT:return c(t,Gh,"m",qh).call(t,e,i.updateModels);case me.SYNC_READ_STATUS:return c(t,Gh,"m",Kh).call(t,n,e,i.updateModels,i.v4SyncNotify);case me.READ_STATE:return c(t,Gh,"m",Qh).call(t,e,i.v4ReadReceipts),!1;case me.READ_RECEIPT_REQUEST:return t.storage.addReadReceiptRequest(e,r);case me.READ_RECEIPT_RESPONSE:return t.storage.handleReadReceiptResponse(e,r);case me.EXPANSION_NOTIFY:return c(t,Gh,"m",Zh).call(t,e,i.expansions),!1;default:return c(t,Gh,"m",Xh).call(t,e,i.updateModels,n,r),!0}})),i},$h=function(e,t,r,n){e.stopPropagation(),this._ctx.recordReceivedMessagesForStatistics(r);var i=c(this,Gh,"m",zh).call(this,r),o=i.messages,a=i.v4ReadReceipts,s=i.v4SyncNotify,l=i.expansions,f=i.logCmdMessages,_=i.cloudControllerMessages,p=i.updateModels;if(s.length&&this.emit("syncReadStatusV4",s),o.length&&this.emit("messages",t,o,n),!c(this,Wh,"f")&&"pullMsg"===t&&n&&(d(this,Wh,!0,"f"),this.emit("offlineFinished"),c(this,Fh,"f").startInterval(Cg,!0)),l.length&&this.emit("expansions",l),a.length&&this.emit("readReceiptV4",a),p.size){var h=[],g=[];Array.from(p.entries()).forEach((function(e){var t=u(e,2),r=t[0],n=t[1];g.push(r),h.push({conversation:r.toIReceivedConversation(),updatedItems:n})})),this.storage.updateConversationStorage(g),this.emit("conversationStatusChanged",h)}this._ctx.handleLogCmdMessages(f),this._ctx.handleCloudControllerMessage(_)},eg=function(e,t,r){if(t===Ch){e.stopPropagation();var n=[];r.forEach((function(e){if(0===e.subChangeType){var t=Dl.decode(Gu,new Uint8Array(e.eventData)),r=t.msgId,i=t.unreadCnt,o=t.readCnt,a=t.readList,s=t.totalCnt;n.push({identifier:{conversationType:e.channelType,targetId:e.businessId,channelId:e.secondaryId},messageUId:r,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",n)}},tg=function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return d(this,Wh,!1,"f"),e||(c(this,jh,"f").setInitVersion(0),this._ctx.includeUg&&c(this,Gh,"m",ag).call(this)),this._ctx.svrUnread?(e||this.storage.getAllSGModels().forEach((function(e){return e.clearUnreadCount(0)})),[4,c(this,Gh,"m",rg).call(this,0)]):[3,2];case 1:t.sent(),this.emit("syncServerSaveUnreadCompleted"),t.label=2;case 2:return c(this,jh,"f").startInterval(Cg,!0),[2]}}))}))},rg=function e(t,r,i){return void 0===r&&(r=new Map),o(this,void 0,void 0,(function(){var o,s,u,l,d,f,_,p,h,g=this;return a(this,(function(a){switch(a.label){case 0:return o=this._ctx,s=o.logger,u=o.currentUserId,l=s.createTraceId(),s.info(B.L_PULL_SG_UNREAD_COUNT_T,JSON.stringify({version:t,pageToken:i}),l),d=function(e,t){return Dl.encode(Ju,{version:e,compress:Cn.enable(),pageToken:t})}(t,i),[4,this._ctx.query(Jn.pullSe,u,d,void 0)];case 1:return(f=a.sent()).isOk?(_=dh(f.data.pbData),p=_.session,h=_.pageToken,s.summary(B.L_PULL_SG_UNREAD_COUNT_R,f,l,{nextPageToken:h}),p.forEach((function(e){var t=e.targetId,i=e.type,o=e.busChannel,a=e.unread,s={conversationType:i,targetId:t,channelId:o},l=g.storage.getOrCreateModel(s,!0),c=l.calibrateUnreadCount(a,u);c&&r.set(l,n(n({},r.get(l)),c))})),h?[2,c(this,Gh,"m",e).call(this,t,r,h)]:(this.storage.updateConversationStorage(Array.from(r.keys())),[2])):(s.warn(B.L_PULL_SG_UNREAD_COUNT_R,f.errmsg(),l),[2])}}))}))},ng=function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return e?[3,2]:(this.settings.reset(),[4,this.settings.syncDataFromServer()]);case 1:t=r.sent(),this.settings.setInitVersion(t),r.label=2;case 2:return this._ctx.isConnected&&this.settings.startInterval(Cg,!0),[2]}}))}))},ig=function(e,t){d(this,Hh,!1,"f"),t||this.storage.syncDataFromLocalStorage(this._ctx),c(this,Gh,"m",ng).call(this,t),c(this,Gh,"m",tg).call(this,t),this._ctx.ugEnabel&&c(this,Gh,"m",fg).call(this,t)},ag=function e(){return o(this,void 0,void 0,(function(){var t,r,n,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,r=t.createTraceId(),n=c(this,og,"f"),t.info(B.L_PULL_SG_RELATIONS_T,JSON.stringify({startTime:n}),r),[4,c(this,Gh,"m",Ag).call(this,n,1,1e3)]):[2];case 1:return(i=a.sent()).isOk?(o=i.data,s=o.info,u=o.isFinished,l=o.pullTime,d(this,og,l,"f"),t.info(B.L_PULL_SG_RELATIONS_R,JSON.stringify({startTime:n,isFinished:u,pullTime:l}),r),this.storage.addRelations(s,this._ctx.currentUserId),u?(this.emit("sgRelationsSynced",exports.ErrorCode.SUCCESS),[2]):[2,c(this,Gh,"m",e).call(this)]):(t.warn(B.L_PULL_SG_RELATIONS_R,i.errmsg(),r),setTimeout((function(){return c(f,Gh,"m",e).call(f)}),1e3),[2])}}))}))},sg=function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return[4,c(this,Gh,"m",Rg).call(this,e,t)];case 1:return(n=a.sent()).isOk?(i=n.data.list.map((function(t){return Ec(t,u._ctx.currentUserId,!1,e.targetId)})),(o=this.storage.getModel(e))&&o.latestMessage&&(s=i.find((function(e){return e.messageUId===o.latestMessage.messageUId})))&&o.updateAttrs({latestMessage:s}),2===r?this._ctx.emit("messageModified",i):1===r&&this._ctx.emit("ugMsgExpansionUpdated",i),[2]):[2]}}))}))},ug=function(e,t,r){c(this,Gh,"m",sg).call(this,t,r,2)},lg=function(e,t,r){c(this,Gh,"m",sg).call(this,t,r,1)},cg=function(e,t){var r=this,i=t.map((function(e){var t=e.targetId,i=e.busChannel,o=e.msgUID,a=e.msgTime,s=e.operatorId,u=e.remindType,l={conversationType:exports.ConversationType.ULTRA_GROUP,targetId:t,channelId:i||""},d=n(n({},l),{messageUId:o,sentTime:a}),f=n(n({},l),{sentTime:a,messageUId:o,senderUserId:s,content:d,messageDirection:1,messageType:me.RECALL,isOffLineMessage:!1,receivedTime:Date.now(),isPersited:!1,isCounted:!1,isMentioned:!1,disableNotification:!1,isStatusMessage:!1,canIncludeExpansion:!1,expansion:null,receivedStatus:exports.ReceivedStatus.UNREAD,receivedStatusInfo:Lt(exports.ReceivedStatus.UNREAD)}),_=r.storage.getModel(l);return _&&c(r,Gh,"m",dg).call(r,_,f,u),f}));this._ctx.emit("ugMsgRecalled",i)},dg=function(e,t,r){var n={},i=t.content,o=i.messageUId,a=i.sentTime,s=e.latestMessage;s&&s.messageUId===o&&(n.latestMessage=Rc(t,!0)),a&&e.lastReadTime<a&&e.unreadCount&&(n.unreadCount=e.unreadCount-1,r!==exports.MentionedType.ALL&&r!==exports.MentionedType.SINGAL||!e.unreadMentionedCount||(n.unreadMentionedCount=e.unreadMentionedCount-1),r===exports.MentionedType.SINGAL&&e.unreadMentionedCount&&(n.unreadMentionedMeCount=e.unreadMentionedMeCount-1));var u=e.updateAttrs(n,a);this.storage.updateConversationStorage([e]),u&&this.emit("conversationStatusChanged",[{conversation:e.toIReceivedConversation(),updatedItems:u}])},fg=function(e){return o(this,void 0,void 0,(function(){var e,t,r,n;return a(this,(function(i){switch(i.label){case 0:return[4,c(this,Vh,"f").markOnline()];case 1:return(e=i.sent()).isOk?(t=e.data,r=t.relations,n=t.msgVersion,this.storage.addRelations(r,this._ctx.currentUserId),d(this,Hh,!0,"f"),this.emit("ultraGroupEnable"),c(this,Vh,"f").setInitVersion(n),c(this,Vh,"f").startInterval(Cg,!0),c(this,kh,"f").setInitVersion(n),c(this,kh,"f").startInterval(Cg,!0),[2]):[2]}}))}))},_g=function(){d(this,Hh,!1,"f"),this.settings.stopInterval(),c(this,Vh,"f").reset(),c(this,jh,"f").reset(),c(this,kh,"f").reset()},pg=function(e,t){return o(this,void 0,void 0,(function(){var r,n;return a(this,(function(i){switch(i.label){case 0:return 3===t.type?(e.stopPropagation(),this.settings.push(t.time),[2]):7===t.type?(e.stopPropagation(),c(this,kh,"f").push(t.time),[2]):12===t.type?(e.stopPropagation(),c(this,Fh,"f").push(t.time),[2]):13!==t.type?[3,2]:(e.stopPropagation(),r=new Map,[4,c(this,Gh,"m",rg).call(this,t.time,r)]);case 1:i.sent(),r.size>0&&(n=Array.from(r.entries()).map((function(e){var t=u(e,2),r=t[0],n=t[1];return{conversation:r.toIReceivedConversation(),updatedItems:n}})),this.emit("conversationStatusChanged",n)),i.label=2;case 2:return[2]}}))}))},hg=function(e,t){1===t.type&&(e.stopPropagation(),c(this,jh,"f").push(t.time))},gg=function(e,t,r){var n=t.syncMsg,i=Kn(t.topic);if(n&&i===Jn.updUgRTime){e.stopPropagation();var o=Dl.decode(Ja,t.pbData),a=o.channelId,s=o.busChannel,u=o.msgTime,l=this.storage.clearConversationUnreadCount({conversationType:exports.ConversationType.ULTRA_GROUP,targetId:a,channelId:s||""},u);l&&this.emit("conversationStatusChanged",[l])}},Eg=function(e,t,r,i,s){return o(this,void 0,void 0,(function(){var o,u,l,d,f,_=this;return a(this,(function(a){switch(a.label){case 0:return o=this._ctx.currentUserId,[4,c(this,Gh,"m",Ag).call(this,e,r||0,t,i,s)];case 1:return(u=a.sent()).isOk?(l=u.data,d=l.info,l.isFinished,l.pullTime,f=d.map((function(e){var t=e.userId,r=e.type,i=e.busChannel,a=_.storage.getOrCreateModel({conversationType:r,targetId:t,channelId:i},!1);return n(n({},a.toIReceivedConversation()),{operationTime:e.versionTime,latestMessage:e.msg?Ec(e.msg,o,!1,t):null})})),[2,fr(f)]):[2,u.wipe()]}}))}))},bg=function(e){return o(this,void 0,void 0,(function(){var t,r,n,i;return a(this,(function(o){switch(o.label){case 0:return this._ctx.includeUg?[2,fr(e)]:(t=this._ctx.currentUserId,r=e.filter((function(e){return e.conversationType!==exports.ConversationType.ULTRA_GROUP})).map((function(e){return{conversationType:e.conversationType,conversationId:e.targetId,busChannel:e.channelId}})),0===r.length?[2,fr(e)]:(n=Dl.encode(Xa,{relation:r.slice(0,100)}),[4,this._ctx.query(Jn.qryRLBatch,this._ctx.currentUserId,n,void 0)]));case 1:return(i=o.sent()).isOk?(c(this,Gh,"m",yg).call(this,i.data.pbData).info.forEach((function(r){if(r.msg){var n=e.find((function(e){return(e.channelId||"")===(r.busChannel||"")&&e.targetId===r.userId&&e.conversationType===r.type}));n.latestMessage=Ec(r.msg,t,!1,r.userId),n.includeRobot=!!r.isBot}})),[2,fr(e)]):[2,i.wipe()]}}))}))},Ig=function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o,s;return a(this,(function(a){return o=[],void 0!==r&&o.push({sessionStateType:ha.IsTop,value:r?"1":"0"}),void 0!==n&&o.push({sessionStateType:ha.IsSilent,value:n.toString()}),void 0!==i&&o.push({sessionStateType:ha.AutoTrans,value:i.toString()}),s=rh(t,e.map((function(e){return{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId,stateItem:o}}))),[2,this._ctx.query(Jn.setSeAtt,this._ctx.currentUserId,s,_s)]}))}))},vg=function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return c(this,Tg,"f").add(e),r=t.messageType===me.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},n=Dl.encode(Vu,{businessType:1,businessInfo:Dl.encode(ju,r)}),[4,this._ctx.query(Jn.upConvertMsg,e,n,ku)];case 1:return i=a.sent(),c(this,Tg,"f").delete(e),o=i.code,i.isOk?(u=Dl.decode(Fu,new Uint8Array(i.data.businessResult)),s={status:Ge.SUCCESS,text:u.result}):s={status:Ge.FAILED,text:""},this._ctx.emit("speechToTextResponse",{code:o,messageUId:e,sttInfo:s}),[2]}}))}))},Rg=function(e,t){var r=e.targetId,n=e.conversationType,i=e.channelId,o=Dl.encode(Us,{targetId:r,type:n,query:t.map((function(e){return{msgTime:0,msgUID:e,busChannel:i}}))});return this._ctx.query(Jn.qryMsg,this._ctx.currentUserId,o,Ds)},mg=function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,s,d,f,_,p,h,g,E,b,I=this;return a(this,(function(a){switch(a.label){case 0:return i=Object.values(n),o=l([],u(new Set(l(l([],u(e),!1),u(i),!1))),!1),[4,c(this,Gh,"m",Rg).call(this,t,o)];case 1:return s=a.sent(),d=s.isOk,f=s.code,_=s.data,d?(h=(p=_).list,g=p.notExistMsgId,E=new Map(h.map((function(e){var r=Ec(e,I._ctx.currentUserId,!1,t.targetId);return[r.messageUId,r]}))),b=e.map((function(e){var t=E.get(e);if(!t)return g.includes(e)?{messageUId:e,code:exports.ErrorCode.RC_DB_DATA_NOT_FOUND}:{messageUId:e,code:exports.ErrorCode.SERVER_DATA_ERROR};if(t.messageType!==me.REFERENCE)return{messageUId:e,code:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE};var r=n[e],i=E.get(r),o=t.content;return i?(o.referMsg=i.content,o.referMsgStatus=i.isModifyMessage?Gr.MODIFIED:Gr.DEFAULT,{messageUId:e,message:t,code:exports.ErrorCode.SUCCESS}):g.includes(r)?(o.referMsgStatus=Gr.DELETE,{messageUId:e,code:exports.ErrorCode.RC_DB_DATA_NOT_FOUND,message:t}):(o.referMsgStatus=Gr.DEFAULT,{messageUId:e,code:exports.ErrorCode.SERVER_DATA_ERROR,message:t})})),r(b),[2]):(r(e.map((function(e){return{messageUId:e,code:f}}))),[2])}}))}))},yg=function(e){var t=qp(e);return this._ctx.getNaviInfoFromCache().supportRecallRefactor&&t.info.forEach((function(e){var t=e.msg;if(t&&t.classname===me.RECALL){var r=JSON.parse(t.content),n=r.messageUId,i=r.sentTime,o=r.extra,a={recallTime:i,recallActionTime:t.dataTime,admin:!!r.isAdmin,delete:!!r.isDelete,isDelete:!!r.isDelete,operatorId:t.fromUserId,extra:o};t.classname=me.RECALL_NOTIFICATION_MESSAGE,t.content=JSON.stringify(a),t.msgId=n,t.dataTime=i||t.dataTime}})),t},Ag=function(e,t,r,n,i,s){return void 0===s&&(s=Jn.qryRelationR),o(this,void 0,void 0,(function(){var o,u,l=this;return a(this,(function(a){switch(a.label){case 0:return o=this._ctx.currentUserId,u=function(e,t,r,n,i){return Dl.encode(wa,{startTime:e,order:t,count:r,compressioEnabled:Cn.enable(),channelType:n,botType:i})}(e,t,r,n,i),[4,this._ctx.query(s,o,u)];case 1:return[2,a.sent().trans((function(e){return c(l,Gh,"m",yg).call(l,e.pbData)}))]}}))}))};var Mg=((xh={})[exports.ConversationType.PRIVATE]=Jn.cleanPMsg,xh[exports.ConversationType.GROUP]=Jn.cleanGMsg,xh[exports.ConversationType.CUSTOMER_SERVICE]=Jn.cleanCMsg,xh[exports.ConversationType.SYSTEM]=Jn.cleanSMsg,xh[exports.ConversationType.APP_PUBLIC_SERVICE]=Jn.cleanMCMsg,xh[exports.ConversationType.PUBLIC_SERVICE]=Jn.cleanMPMsg,xh[exports.ConversationType.ULTRA_GROUP]=Jn.cleanGMsg,xh),Pg=function(e){function r(t,r,n,i){var o=e.call(this,t,r,n)||this;return Object.defineProperty(o,"appStorage",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"_socket",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(o,"_connectedTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(o,"_socketIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(o,"_serverSessionId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(o,"_localConnectedTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(o,"_idCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(o,"_generateMessageId",{enumerable:!0,configurable:!0,writable:!0,value:function(){return o._idCount>=65535&&(o._idCount=0),++o._idCount}}),Object.defineProperty(o,"_pingResolve",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_messageIds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(o,"_syncMessageIds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),o}return t(r,e),Object.defineProperty(r.prototype,"getConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._connectedTime}}),Object.defineProperty(r.prototype,"getLocalConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._localConnectedTime}}),Object.defineProperty(r.prototype,"getCrtServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Date.now()-this._localConnectedTime+this._connectedTime}}),Object.defineProperty(r.prototype,"getDelayTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._localConnectedTime-this._connectedTime}}),Object.defineProperty(r.prototype,"_connectWithToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var r,i,o,s,u,l,c,d,f,_;return a(this,(function(p){switch(p.label){case 0:if(r=t.openAnti,i=t.type,o=t.baggageEnabled,s=this.getCmpList(t),this.logger.debug(B.L_NAVI_CMP_R,JSON.stringify(s),n),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(B.L_NAVI_CONF_E,"no service available",n),[2,_r(exports.ErrorCode.SERVER_UNAVAILABLE)];l=1===r?si:ui,c=function(t){var r,s,c,f,_,p,h,g,E,b,I;return a(this,(function(a){switch(a.label){case 0:return r=u[t],s=r.protocol,c=r.addr,f=r.weight,_=function(e,t,r,n,i,o,a,s,u,l){var c,d=u?"&protocolVer=".concat(u):"";return"".concat(r,"://").concat(n,"/websocket?appId=").concat(i,"&token=").concat(encodeURIComponent(o),"&sdkVer=").concat(Ye,"&pid=").concat(s,"&deviceId=").concat(encodeURIComponent(e)).concat(1===l?"&baggage=".concat(encodeURIComponent("cid=".concat(a))):"","&apiVer=").concat(encodeURIComponent((null===(c=ua.getApiVer)||void 0===c?void 0:c.call(ua))||"".concat(ua.tag,"||"))).concat(ua.connectPlatform?"&platform=".concat(ua.connectPlatform):"").concat(d).concat(ua.isFromUniapp?"&appIdentifier=".concat(encodeURIComponent(t)):"")}(d.appStorage.deviceId,d.appStorage.packageName,s===H.WS?"ws":"wss",c,d.appkey,e,d.cid,"",l,o),p=Date.now(),[4,d.connectWebSocket(_,l,n)];case 1:return h=a.sent(),g=h.code,E=h.data,b=d.cmpWeightCache.findIndex((function(e){return e.addr===c})),I={bid:er(),ptc:Oe.WS,cod:g,net:d.getNetwork().type,dur:Date.now()-p,spr:0,pr:i||0,hos:c,idx:b,rct:d.retryCount?Ne.RECONNECT:Ne.CONNECT,cid:d.cid,v:Ce.CURRENT,rsn:d._doConnectReason,count:d.retryCount,weight:f,ssid:d._serverSessionId},d.logger.record(Te.IM_WEBSOCKET,JSON.stringify(I),n),g===exports.ErrorCode.RC_SOCKET_DISCONNECTED||g===exports.ErrorCode.TIMEOUT?[2,"continue"]:g!==exports.ErrorCode.SUCCESS?[2,{value:_r(g)}]:(d._localConnectedTime=Math.floor((Date.now()+p)/2),d._socket=E.socket,d.updateCmpWeight(u[t].addr,!0),d.curCmpUrl=u[t].addr,[2,{value:fr(E.userId)}])}}))},d=this,f=0,p.label=1;case 1:return f<u.length?[5,c(f)]:[3,4];case 2:if("object"==typeof(_=p.sent()))return[2,_.value];p.label=3;case 3:return f+=1,[3,1];case 4:return[2,_r(exports.ErrorCode.SERVER_UNAVAILABLE)]}}))}))}}),Object.defineProperty(r.prototype,"connectWebSocket",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,s,u,l,c,d,f,_=this;return a(this,(function(a){switch(a.label){case 0:return this.logger.info(B.L_CONNECT_O,"connect start: ".concat(e),r),n=br(),i=n.resolve,o=n.promise,[4,ua.createWebSocket(e)];case 1:return s=a.sent(),u=s.data,l=s.code,c=s.msg,l===exports.ErrorCode.SUCCESS&&u?(this._socketIndex=u.id,d=exports.ErrorCode.SUCCESS,f=setTimeout((function(){_.logger.warn(B.L_CONNECT_S,"timeout",r),d=exports.ErrorCode.TIMEOUT,"wechat"===ua.tag?u.close():(i(_r(exports.ErrorCode.TIMEOUT)),_.onSocketEnd(u,exports.ErrorCode.TIMEOUT,r))}),5e3),u.onOpen((function(){_.logger.info(B.L_CONNECT_S,"socket opened",r),clearTimeout(f)})),u.onError((function(e){_.logger.info(B.L_CONNECT_S,"socket error",r),clearTimeout(f);var t=exports.ErrorCode.RC_SOCKET_DISCONNECTED;i(_r(t)),_.onSocketEnd(u,t,r)})),u.onClose((function(){_.logger.info(B.L_CONNECT_S,"socket close",r);var e=d===exports.ErrorCode.SUCCESS?exports.ErrorCode.RC_SOCKET_DISCONNECTED:d;i(_r(e)),_.onSocketEnd(u,e,r)})),u.onMessage((function(e){if(_._socketIndex===u.id){if("[object ArrayBuffer]"===Object.prototype.toString.call(e)){var n=Ao(e,t);if(n){if(n instanceof lo){var o=n.status;if(o!==Ci)return _.logger.warn(B.L_CONNECT_O,"connect failed: ".concat(o),r),d=bh[o],u.close(),void i(_r(d));_.logger.info(B.L_CONNECT_O,"connect success",r);var a=n.timestamp,s=n.userId,l=n.messageId,c=n.sessionId;return _._serverSessionId=c,_._connectedTime=a,_._idCount=l,void i(fr({userId:s,socket:u}))}if(n instanceof fo){var f=n.status;return _.logger.info(B.T,"recv disconnect signal -> status: ".concat(f)),void _.onRecvDisconnect(f,u)}_._onReceiveSignal(n)}}}else _.logger.warn(B.L_WS_DISACCORD_E,JSON.stringify({socketIndex:_._socketIndex,curSocketId:u.id}))})),[2,o]):[2,_r(l,c)]}}))}))}}),Object.defineProperty(r.prototype,"_qosNeedAck",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.header.qos!==Xn)return e instanceof Eo&&!e.syncMsg?(this.logger.debug(B.O,"send pubAck -> ".concat(e.messageId," ").concat(e.topic)),void this.sendOnly(new Ro(e.messageId))):void(e instanceof yo&&this._messageIds[e.messageId]&&(this.logger.debug(B.O,"send queryCon -> ".concat(e.messageId)),this.sendOnly(new mo(e.messageId))))}}),Object.defineProperty(r.prototype,"_publishReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return t=e.syncMsg,r=e.topic,n=e.messageId,this.logger.debug(B.O,"recv PublishReader -> messageId: ".concat(n," ").concat(r)),r===pi?[2]:!t||Ih(Kn(r))?(this.emit("signal",e),[2]):[4,new Promise((function(e){o._syncMessageIds[n]=e}))];case 1:return i=a.sent(),delete this._syncMessageIds[n],this.emit("signal",e,i),[2]}}))}))}}),Object.defineProperty(r.prototype,"_onReceiveSignal",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return a(this,(function(i){switch(i.label){case 0:return e instanceof po&&this._pingResolve?(this._pingResolve(exports.ErrorCode.SUCCESS),this._pingResolve=void 0,[2]):(this._qosNeedAck(e),(e instanceof vo||e instanceof yo)&&(t=e.messageId,this.logger.debug(B.O,"recv ack -> messageId: ".concat(t)),(r=this._messageIds[t])&&(r(e),delete this._messageIds[t]),(n=this._syncMessageIds[t])&&(delete this._syncMessageIds[t],n(e))),e instanceof Eo?[4,this._publishReader(e)]:[3,2]);case 1:i.sent(),i.label=2;case 2:return[2]}}))}))}}),Object.defineProperty(r.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 Eh[e]}(e)))}}),Object.defineProperty(r.prototype,"onSocketEnd",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){this._socket&&this._socket===e?(this._socket=null,this.clearResolves(),this.onDisconenctUnusual(t),this._pingResolve&&(this._pingResolve(t),this._pingResolve=void 0)):this.logger.warn(B.L_CONNECT_S,"socket end but not the current socket",r)}}),Object.defineProperty(r.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(exports.ErrorCode.RC_SOCKET_DISCONNECTED)}}}),Object.defineProperty(r.prototype,"sendPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(r){t._pingResolve=r,setTimeout((function(){return r(exports.ErrorCode.TIMEOUT)}),e),t.sendOnly(new _o)}))}}),Object.defineProperty(r.prototype,"sendOnly",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._socket&&((e instanceof To||e instanceof Io)&&(e.messageId=this._generateMessageId()),this._socket.send(e.getArrayBuffer()))}}),Object.defineProperty(r.prototype,"_sendHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,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(exports.ErrorCode.TIMEOUT)}),3e4)}))]):[2,_r(exports.ErrorCode.RC_NET_CHANNEL_INVALID)];case 1:return r=o.sent(),n="number"==typeof r?r:r.status,exports.ErrorCode.SUCCESS,"number"==typeof r?[2,_r(r)]:[2,n===exports.ErrorCode.SUCCESS?fr(r):_r(n,"",r)]}}))}))}}),Object.defineProperty(r.prototype,"query",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o,s,u;return a(this,(function(a){switch(a.label){case 0:return this.logger.createTraceId(),Qn(e),o=new Io(e,r,t),i&&o.setHeaderQos(i),[4,this._sendHandler(o)];case 1:return s=a.sent(),u=s.data,s.isOk&&void 0!==n?[2,fr(Dl.decode(n,u.pbData))]:[2,s]}}))}))}}),Object.defineProperty(r.prototype,"send",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o;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 vo?[2,r]:(n=r.data,i=t&&n.pbData&&[exports.ErrorCode.SUCCESS,exports.ErrorCode.CHATROOM_KV_STORE_NOT_ALL_SUCCESS,exports.ErrorCode.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT,exports.ErrorCode.RC_USER_PROFILE_KEY_NOT_EXIST,exports.ErrorCode.RC_USER_PROFILE_EXT_KEY_NOT_EXIST,exports.ErrorCode.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS,exports.ErrorCode.RC_USER_PROFILE_VALUE_EXCEED_RANGE,exports.ErrorCode.RC_GROUP_PARAMETER_FORMAT_ERROR].indexOf(n.status)>=0,o=i?Dl.decode(t,n.pbData):n,0!==n.status?[2,_r(n.status,void 0,t&&n.pbData?o:null)]:[2,fr(o)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"close",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return r?[4,this.sendOnly(new co(Zi))]:[3,2];case 1:e.sent(),e.label=2;case 2:return this._socket&&(this._socket.close(),this._socket=null),this.clearResolves(),[2]}}))}))}}),r}(_n),Lg={};function wg(){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:Hr.getMiniCmpUrlList().join(",")}}var Ug=function(e){function r(t,r,n,i,o,a){void 0===o&&(o="default");var s=e.call(this,t,r,n,ua.useNavi&&"https:"===(null===window||void 0===window?void 0:window.location.protocol),ua.useNavi,a)||this;return Object.defineProperty(s,"_appStorage",{enumerable:!0,configurable:!0,writable:!0,value:i}),s._environment=o,s}return t(r,e),Object.defineProperty(r.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,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(r),"&callBack=x&v=").concat(Ye,"&r=").concat(Date.now(),"&env=").concat(this._environment,"&p=").concat(ua.tag),this.logger.debug(B.L_REQUEST_T,"req navi => ".concat(o),n),[4,ua.httpReq({url:o,timeout:1e4,dataType:"text"})];case 1:if(200!==(s=a.sent()).status)return this.logger.debug(B.L_REQUEST_R,"request navi failed: ".concat(s.status),n),!ua.useNavi&&i?[2,fr(wg())]:[2,_r(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,_r(this.transHttpCode(l.code))]:(ua.useNavi||(l.server="",l.backupServer=Hr.getMiniCmpUrlList().join(","),l.logSwitch=0),[2,fr(l)])}catch(e){this.logger.error(B.L_PARSE_NAVI_E,s.data,n)}return[2,_r(exports.ErrorCode.RC_NAVI_REQ_FAILED)]}}))}))}}),Object.defineProperty(r.prototype,"httpRequestV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,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:r,uri:e,platform:ua.tag,protocol:(/^https/.test(e)?H.WSS:H.WS).toString()}),this.logger.debug(B.L_REQUEST_T,"req navi => ".concat(o.url),n),[4,ua.httpReq(o)];case 1:if(200!==(s=a.sent()).status)return this.logger.debug(B.L_REQUEST_R,"request navi failed: ".concat(s.status),n),!ua.useNavi&&i?[2,fr(wg())]:[2,_r(this.transHttpCode(s.status))];try{return u=s.data,(l="object"!=typeof u?JSON.parse(u):u).protocol=/^https/.test(o.url)?"https":"http",ua.useNavi||(l.logSwitch=0,c=Hr.getMiniCmpUrlList(),l.serverAddr=c.map((function(e,t){return{addr:e,protocol:/^https/.test(o.url)?H.WSS:H.WS,weight:c.length-t}}))),[2,fr(l)]}catch(e){this.logger.error(B.L_PARSE_NAVI_E,s.data,n)}return[2,_r(exports.ErrorCode.RC_NAVI_REQ_FAILED)]}}))}))}}),Object.defineProperty(r.prototype,"getNaviCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=this.getCatchKey(e);if(Lg[r])return Lg[r];var n,i=this._appStorage.get("naviInfo");if(!i)return null;try{n=JSON.parse(i)}catch(e){n=[]}if(0===n.length)return null;var o=n.find((function(r){return r.token===e&&r.environment===t._environment}))||null;return Lg[r]=o,o}}),Object.defineProperty(r.prototype,"setNaviCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,n=[],i=Date.now(),o=this._appStorage.get("naviInfo");if(o){try{n=JSON.parse(o)}catch(e){n=[]}n.length>0&&(n=n.filter((function(t){return i-t.timestamp<Fe&&(e!==t.token||r._environment!==t.environment)})))}var a={timestamp:i,naviInfo:t,token:e,environment:this._environment};n.push(a),this._appStorage.set("naviInfo",JSON.stringify(n)),Lg[this.getCatchKey(e)]=a}}),r}(hn),Dg=function(){Object.defineProperty(this,"recallMsgMap",{enumerable:!0,configurable:!0,writable:!0,value:new Set})};function xg(e){var t=!(1&~(e.ugMsg||0)),r=!(1&~(e.sessionCfg||0));return t&&r}var Gg,Vg,jg,kg,Fg,Bg,Hg,Yg,Wg,Jg,qg,Kg,Qg,Xg=function(e){function r(t,r,n,i){var o=e.call(this,r,t,n)||this;Object.defineProperty(o,"_appStorage",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"model",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_mrtr",{enumerable:!0,configurable:!0,writable:!0,value:{chatroom:0,group:0,private:0,ultraGroup:0,temporary:!1}});var a=ua.runtimeInfo,s=a.type,u=a.version;return o.model="Web|".concat(s,"|").concat(u),o.init(),o}return t(r,e),Object.defineProperty(r.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,s,u,l,c,d,f,_;return a(this,(function(a){switch(a.label){case 0:return(i=n).deviceId=this._appStorage.deviceId,i.model=this.model,o={url:e,method:t,headers:r,body:JSON.stringify(i)},s=this.logger.createTraceId(),this.logger.info(B.L_REQUEST_T,JSON.stringify(o),s),[4,ua.httpReq(o)];case 1:u=a.sent(),l=u.status,c=u.data,d=void 0===c?"":c,this.logger.info(B.L_REQUEST_R,JSON.stringify({status:l,data:d}),s);try{return f=JSON.parse(d),_=f.data,[2,{code:parseInt(f.code,10),data:_}]}catch(e){return this.logger.warn(B.L_CLOUD_CONFIG_DATA_E,JSON.stringify({status:l,data:d,error:e})),[2,{code:l,msg:e}]}return[2]}}))}))}}),Object.defineProperty(r.prototype,"setCloudControllerCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._appStorage.set("cloudControllerData",JSON.stringify(e))}}),Object.defineProperty(r.prototype,"getLocalCloudControllerCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._appStorage.get("cloudControllerData")}}),Object.defineProperty(r.prototype,"setMRTRConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.logger.info(B.L_CLOUD_SET_MRTR_O,JSON.stringify(e)),this._mrtr=e}}),Object.defineProperty(r.prototype,"getMRTRConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._mrtr}}),r}(dn),Zg=function(e){function r(t,r,n){var i=e.call(this,t,r)||this;return Object.defineProperty(i,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,"logger",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"_appStorage",{enumerable:!0,configurable:!0,writable:!0,value:n}),i}return t(r,e),Object.defineProperty(r.prototype,"getCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._appStorage.get("staticConf")}}),Object.defineProperty(r.prototype,"setCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._appStorage.set("staticConf",e)}}),Object.defineProperty(r.prototype,"clearCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._appStorage.delete("staticConf")}}),Object.defineProperty(r.prototype,"sendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return a(this,(function(i){switch(i.label){case 0:return[4,ua.httpReq({url:e})];case 1:return t=i.sent(),r=t.status,n=t.data,[2,{code:r,data:n}]}}))}))}}),Object.defineProperty(r.prototype,"decryptData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r;return a(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,tr(e,"cd4936151214ce45dc1d12673a59d94c","51ad078e5eb17a91")];case 1:return t=n.sent(),[2,JSON.parse(t)];case 2:return r=n.sent(),this.logger.error(B.L_GET_STATIC_CONF_E,JSON.stringify({error:null==r?void 0:r.stack})),[3,3];case 3:return[2]}}))}))}}),r}(Yr),zg=function(e){function r(){var t=e.call(this)||this;Object.defineProperty(t,"_deviceId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(t,"_customDeviceId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(t,"_packageName",{enumerable:!0,configurable:!0,writable:!0,value:""});var r="",n=ua.localStorage;return"browser"!==ua.tag?(r=n.getItem(qe)||"")||(r=_t.genWithLen(22),n.setItem(qe,r)):r=pt,t._deviceId=r,t}return t(r,e),Object.defineProperty(r.prototype,"setPackageName",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._packageName=e}}),Object.defineProperty(r.prototype,"deviceId",{get:function(){return this._customDeviceId||this._deviceId},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"packageName",{get:function(){return this._packageName},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"setCustomDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._customDeviceId=e}}),Object.defineProperty(r.prototype,"_syncDataHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.appkey,r=ua.localStorage,n=at(t),i=r.getItem(n),o=ot(t),a=r.getItem(o),s=Ke(t),u=r.getItem(s),l=ut(t),c=r.getItem(l);return{cloudControllerData:{value:i,key:n},staticConf:{value:a,key:o},naviInfo:{value:u,key:s},logReporter:{value:c?JSON.parse(c):{},key:l,stringify:!0}}}}),r}(ud),$g=[Jn.chatMsg,Jn.ugMsg,Jn.recallMsg,Jn.ppMsgS,Jn.pgMsgS,Jn.ppMsgP,Jn.pgMsgP,Jn.pcMsgP,Jn.prMsgS,Jn.pbMsgP,Jn.chatMsgS],eE=function(e){function r(t){var r,n,i=e.call(this)||this;Gg.add(i),Object.defineProperty(i,"_initOptions",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,"navi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_connection",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"send",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"query",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"sendOnly",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"connect",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"disconnect",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"appStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"userStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Vg.set(i,void 0),jg.set(i,void 0),kg.set(i,void 0),Fg.set(i,void 0),Bg.set(i,void 0),Object.defineProperty(i,"_robots",{enumerable:!0,configurable:!0,writable:!0,value:{robots:[],isSynced:!1}}),i.appStorage=new zg,i.appStorage.syncDataFromLocalStorage(i);var o=t.appkey,a=t.loggerProxy,s=t.environment,l=t.useNaviV2,f=t.logOutputLevel,_=t.logExpireTime,p=t.areaCode,h=t.navigators,g=t.logServerUrl,E=t.miniCMPProxy,b=a||Yc(),I=i.logger=new Mc(t.appkey,"IMLib","IM",b);I.setOutputLevel(f),a||Vc(o,i.logger,_),Hr.init({areaCode:p,navigators:h,logServerUrl:g,miniCMPProxy:E}),i.navi=new Ug(o,i.logger,new Zg(o,i.logger,i.appStorage),i.appStorage,s||"default",!!l);var T=i._connection=new Pg(o,i.navi,i.logger,i.appStorage);return i.send=i._connection.send.bind(i._connection),i.query=i._connection.query.bind(i._connection),i.sendOnly=i._connection.sendOnly.bind(i._connection),i.connect=i._connection.connect.bind(i._connection),i.disconnect=i._connection.disconnect.bind(i._connection),T.on("onConnected",c(i,Gg,"m",Hg),i),T.on("onDisconnected",c(i,Gg,"m",Wg),i),T.on("onSuspend",c(i,Gg,"m",Yg),i),T.on("signal",c(i,Gg,"m",Jg),i),T.pipe(i),d(i,jg,new ed(o,I,i.appStorage),"f"),d(i,kg,new td(o,I,i.appStorage),"f"),d(i,Fg,new Xg(o,I,c(i,jg,"f"),i.appStorage),"f"),n=i,r=u(Hr.getCloudControllerUrl(),1),{set value(e){d(n,Bg,e,"f")}}.value=r[0],i.userStorage=new Dg,d(i,Vg,new Mh(T,I),"f"),c(i,Vg,"f").pipe(i),"browser"===ua.tag&&c(i,Fg,"f").request(c(i,Bg,"f"),rn),i}return t(r,e),Object.defineProperty(r.prototype,"isConnected",{get:function(){return this._connection.isConnected},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"connectionStatus",{get:function(){return this._connection.getConnectionStatus()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"currentUserId",{get:function(){return this._connection.getCurrentUserId()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"currentToken",{get:function(){return this._connection.getToken()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"serverTime",{get:function(){return this._connection.getCrtServerTime()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"delayTime",{get:function(){return this._connection.getDelayTime()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"connectedTime",{get:function(){return this._connection.getConnectedTime()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ugEnabel",{get:function(){return!(1&~(this.getNaviInfoFromCache().ugMsg||0))},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isDisableEmptyUGChannelId",{get:function(){return!(2&~(this.getNaviInfoFromCache().ugDriven||0))},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"includeUg",{get:function(){return xg(this.getNaviInfoFromCache())},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isMemSesAttrs",{get:function(){var e;return(8&((null===(e=this.getNaviInfoFromCache())||void 0===e?void 0:e.sessionCfg)||0))>0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"svrUnread",{get:function(){return 1===this.getNaviInfoFromCache().serverSaveUnread},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"logReporter",{get:function(){return c(this,jg,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"statisticReporter",{get:function(){return c(this,kg,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"appkey",{get:function(){return this.initOptions.appkey},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"initOptions",{get:function(){return this._initOptions},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.navi.getNaviInfoFromCache(this.currentToken)}}),Object.defineProperty(r.prototype,"robots",{get:function(){return this._robots.robots.slice()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"getAllRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,s,c;return a(this,(function(a){switch(a.label){case 0:return t=this._robots.robots.slice(),!e&&this._robots.isSynced?[2,fr(t)]:(r=Dl.encode(pl,{ids:[]}),[4,this._connection.query(Jn.qAppBot,this.currentUserId,r,hl)]);case 1:return(n=a.sent()).isOk?(i=Math.max.apply(Math,l([],u(t.map((function(e){return e.updateTime}))),!1)),o=[],s=n.data.bots.map((function(e){var t={robotId:e.id,name:e.name,portraitUri:e.portraitUrl,robotType:e.type||"",metadata:Object.fromEntries(e.metadata.map((function(e){return[e.key,e.value]}))),createTime:e.createTime,updateTime:e.updateTime};return t.updateTime>i&&o.push(t),t})),c=t.filter((function(e){return!s.some((function(t){return t.robotId===e.robotId}))})),this._robots.isSynced=!0,this._robots.robots=s,e&&this.emit("robotsSynced",n.code,s.slice(),o,c),[2,fr(s.slice())]):(e&&this.emit("robotsSynced",n.code,[],[],[]),[2,_r(n.code,n.msg,t)])}}))}))}}),Object.defineProperty(r.prototype,"handleCloudControllerMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return a(this,(function(i){switch(i.label){case 0:return 0===e.length?[2]:e.shift().senderUserId!==We?[2,this.handleCloudControllerMessage(e)]:(t=this._connection.getToken(),[4,c(this,Fg,"f").request(c(this,Bg,"f"),on,t)]);case 1:return r=i.sent()||0,n=e.filter((function(e){return e.sentTime>r})),[2,this.handleCloudControllerMessage(n)]}}))}))}}),Object.defineProperty(r.prototype,"handleLogCmdMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){if(e.senderUserId===We){var r=e.content,n=r.startTime,i=r.endTime,o=r.platform,a=r.logId,s=r.uri;c(t,jg,"f").report(parseInt(n,10),parseInt(i,10),o,s,a,e.messageUId)}}))}}),Object.defineProperty(r.prototype,"handleNetworkChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this._connection.setNetwork(e,t),e.status&&c(this,Bg,"f")){var r=this._connection.getToken();c(this,Fg,"f").request(c(this,Bg,"f"),nn,r)}}}),Object.defineProperty(r.prototype,"checkIfNeedRecordMessageUId",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=c(this,Fg,"f").getMRTRConfig();if(!r)return!1;var n=function(e){if(!e)return Math.floor(4294967296*Math.random());var t=0;if(0===e.length)return t;for(var r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return Math.abs(t)}(t),i=0;switch(e){case exports.ConversationType.PRIVATE:i=r.private;break;case exports.ConversationType.GROUP:i=r.group;break;case exports.ConversationType.CHATROOM:i=r.chatroom;break;case exports.ConversationType.ULTRA_GROUP:i=r.ultraGroup}return!!i&&n%(1/i)==0}}),Object.defineProperty(r.prototype,"recordReceivedMessagesForStatistics",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;if(0!==e.length){var r=this.connectedTime,n=e.filter((function(e){return e.sentTime>=r&&t.checkIfNeedRecordMessageUId(e.conversationType,e.messageUId)})).map((function(e){return e.messageUId}));if(0!==n.length){var i=Date.now();this.logger.record(Te.IM_MSG_RECEIVE,JSON.stringify({client_ts:i,server_deltatime:i-this.serverTime,msg_ids:n.join(",")}))}}}}),r}(ur);Vg=new WeakMap,jg=new WeakMap,kg=new WeakMap,Fg=new WeakMap,Bg=new WeakMap,Gg=new WeakSet,Hg=function(e,t){return o(this,void 0,void 0,(function(){var e,r,n,i,o;return a(this,(function(a){switch(a.label){case 0:return t||this.getAllRobots(!0),[4,c(this,Vg,"f").noticeOnline()];case 1:return(e=a.sent()).isOk?(t?c(this,Vg,"f").startInterval(18e4,!0):(r=e.data,n=r.syncTime,i=r.hasNext,c(this,Vg,"f").setInitVersion(n),c(this,Vg,"f").startInterval(18e4,!!i)),o=this.getNaviInfoFromCache(),c(this,jg,"f").checkStart(o),c(this,kg,"f").checkStart(o),[2]):[2]}}))}))},Yg=function(e,t){c(this,Vg,"f").stopInterval()},Wg=function(e){this._robots.isSynced=!1,this._robots.robots=[],c(this,Vg,"f").reset(),c(this,jg,"f").stop(),c(this,kg,"f").stop()},Jg=function(e,t,r){var n=t.topic,i=t.syncMsg,o=Kn(n),a=this.getNaviInfoFromCache();if(o||(this.logger.warn(B.L_RECV_RMTP_E,"unknown topic: ".concat(n)),e.stopPropagation()),this.logger.debug(B.L_RECV_RMTP_O,n),i&&$g.includes(o)){e.stopPropagation();var s=r||{},u=s.timestamp,l=void 0===u?this.serverTime:u,d=s.messageUId,f=void 0===d?"":d,_=gc(t,this.currentUserId,l,f),p=bc(a,_,this.currentUserId,!1,t.targetId);this.emit("syncMsg",p,o)}else{if(o===Jn.s_ntf){e.stopPropagation();var h=(b=Dl.decode(Ia,t.pbData)).type,g=b.chrmId,E=b.time;return this.logger.info(B.L_RECV_S_NTF_O,"type: ".concat(h,", chrmId: ").concat(g,", time: ").concat(E)),void this.emit("sNtf",b)}if(o===Jn.s_cmd){e.stopPropagation();var b;h=(b=Dl.decode(Ia,t.pbData)).type,g=b.chrmId,E=b.time;if(this.logger.info(B.L_RECV_S_CMD_O,"type: ".concat(h,", chrmId: ").concat(g,", time: ").concat(E)),11===h)return void c(this,Vg,"f").push(E);this.emit("sCmd",b)}if(o===Jn.s_msg){e.stopPropagation();_=Dl.decode(ya,t.pbData),p=bc(a,_,this.currentUserId,!1);this.emit("sMsg",p)}}};var tE,rE=function(e,t,r){var n=0;return e&&(n|=1),t&&(n|=2),r&&(n|=4),n},nE=function(e,t,r){return{chatroomId:e,key:t.key,value:t.value,timestamp:t.version,type:r?exports.ChatroomEntryType.DELETE:exports.ChatroomEntryType.UPDATE}},iE=function(e){function r(t,r,n){var i=e.call(this,"WebChatroomKVStore")||this;return qg.add(i),Object.defineProperty(i,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,"_chatroomId",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:n}),Kg.set(i,new Map),Object.defineProperty(i,"_emittedEntriesSynced",{enumerable:!0,configurable:!0,writable:!0,value:!1}),i}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,i,o,s,u,l,d,f,_,p=this;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx.logger,r=t.createTraceId(),i=this._chatroomId,o={chatroomId:i,timestamp:e},t.info(B.L_PULL_CHATROOM_KV_T,JSON.stringify(o),r),[4,this._ctx.query(Jn.pullKV,i,ih(e),void 0)];case 1:return(s=a.sent()).isOk?(u=oh(s.data.pbData),l=u.bFullUpdate,d=u.entries,f=u.syncTime,t.info(B.L_PULL_CHATROOM_KV_R,JSON.stringify(n(n({},o),{newVersion:f})),r),_=new Map,l&&(Array.from(c(this,Kg,"f").values()).forEach((function(e){_.set(e.key,nE(i,e,!0))})),c(this,Kg,"f").clear()),Array.from(d.values()).forEach((function(e){var t,r=(t=e.status,{isAutoDelete:!!(1&t),isOverwrite:!!(2&t),isDelete:!!(4&t)}).isDelete,n=function(e){var t=e.key,r=e.value;return e.timestamp,{key:t,value:r,userId:e.uid,version:e.version}}(e);r?c(p,Kg,"f").delete(n.key):c(p,Kg,"f").set(n.key,n),_.set(n.key,nE(i,n,r))})),this._emittedEntriesSynced||(this._emittedEntriesSynced=!0,this._emitter.emit("chatroom",{entriesSynced:i})),_.size>0&&this._emitter.emit("chatroom",{updatedEntries:Array.from(_.values())}),[2,fr({version:f})]):(t.warn(B.L_PULL_CHATROOM_KV_R,JSON.stringify(n(n({},o),{code:s.code})),r),[2,s.wipe()])}}))}))}}),Object.defineProperty(r.prototype,"setEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return[4,c(this,qg,"m",Qg).call(this,e,t,!1)];case 1:return(r=n.sent()).isOk&&c(this,Kg,"f").set(e.key,{key:e.key,value:e.value,userId:this._ctx.currentUserId,version:this._ctx.serverTime}),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"removeEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return[4,c(this,qg,"m",Qg).call(this,{key:e.key,value:"",isAutoDelete:!1,isSendNotification:e.isSendNotification,notificationExtra:e.notificationExtra},t,!0)];case 1:return(r=n.sent()).isOk&&c(this,Kg,"f").delete(e.key),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"setEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,s,u,l=this;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx.serverTime,r=e.entries.map((function(r){var n,i=c(l,Kg,"f").get(r.key);return{key:r.key,value:r.value,uid:l._ctx.currentUserId,version:null!==(n=null==i?void 0:i.version)&&void 0!==n?n:t,status:rE(!!e.isAutoDelete,e.isForce||!1,!1)}})),n=Dl.encode($a,{entry:r}),[4,this._ctx.query(Jn.setKVS,this._chatroomId,n,ts)];case 1:return(i=a.sent()).isOk||i.code===exports.ErrorCode.CHATROOM_KV_STORE_NOT_ALL_SUCCESS?((o=i.data).errorKeys,s=o.keysVersion,u=new Map,null==s||s.forEach((function(e){u.set(e.key,e.version)})),e.entries.forEach((function(e){var t=e.key,r=u.get(t);r&&c(l,Kg,"f").set(t,{key:t,value:e.value,userId:l._ctx.currentUserId,version:r})})),[2,i.wipe()]):[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"removeEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return t=rE(!1,!1,!0),r=this._ctx.serverTime,n=Dl.encode($a,{entry:e.keys.map((function(e){var n,i=c(u,Kg,"f").get(e);return{key:e,status:t,value:"",uid:u._ctx.currentUserId,version:null!==(n=null==i?void 0:i.version)&&void 0!==n?n:r}}))}),[4,this._ctx.query(Jn.delKVS,this._chatroomId,n,ts)];case 1:return(i=a.sent()).isOk||i.code===exports.ErrorCode.CHATROOM_KV_STORE_NOT_ALL_SUCCESS?(o=i.data.errorKeys,s=new Set,null==o||o.forEach((function(e){return s.add(e.key)})),e.keys.forEach((function(e){s.has(e)||c(u,Kg,"f").delete(e)})),[2,i.wipe()]):[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,Kg,"f").has(e)?c(this,Kg,"f").get(e).value:null}}),Object.defineProperty(r.prototype,"getAllEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=Array.from(c(this,Kg,"f").entries()).map((function(e){var t=u(e,2);return[t[0],t[1].value]}));return Object.fromEntries(e)}}),r}(lr);Kg=new WeakMap,qg=new WeakSet,Qg=function(e,t,r){var n;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._ctx.serverTime,o=c(this,Kg,"f").get(e.key),s=rE(!!e.isAutoDelete,t,r),u={entry:{key:e.key,value:e.value,uid:this._ctx.currentUserId,version:null!==(n=null==o?void 0:o.version)&&void 0!==n?n:i,status:s}},e.isSendNotification&&(u.type=exports.ConversationType.CHATROOM,u.bNotify=!0,u.notification={sessionId:Ic(me.CHRM_KV_NOTIFY,!1,!1,!1),classname:me.CHRM_KV_NOTIFY,content:JSON.stringify({key:e.key,value:e.value,extra:e.notificationExtra,type:r?exports.ChatroomEntryType.DELETE:exports.ChatroomEntryType.UPDATE})}),l=Dl.encode(za,u),[4,this._ctx.query(r?Jn.delKV:Jn.setKV,this._chatroomId,l)];case 1:return[2,a.sent().wipe()]}}))}))};var oE,aE,sE,uE,lE=function(e){function r(t,r,n,i){var o=e.call(this,"WebChatroomMessageReceiver")||this;return Object.defineProperty(o,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(o,"_chatroomId",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:i}),tE.set(o,0),d(o,tE,n,"f"),o}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,s,u,l,d,f,_=this;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx.logger,r=t.createTraceId(),n={chatroomId:this._chatroomId,version:e},t.info(B.L_PULL_CHATROOM_MSG_T,JSON.stringify(n),r),i=function(e,t){return Dl.encode(La,{syncTime:e,count:t,compressioEnabled:Cn.enable()})}(e,c(this,tE,"f")),[4,this._ctx.query(Jn.chrmPull,this._chatroomId,i,void 0)];case 1:return o=a.sent(),t.summary(B.L_PULL_CHATROOM_MSG_R,o,r,n),o.isOk?(s=this._ctx.currentUserId,u=Qp(o.data.pbData),l=u.list,d=u.syncTime,l.length>0&&(f=l.map((function(e){return Ec(e,s,!1,_._chatroomId)})),this._emitter.emit("message",f,this._chatroomId)),[2,fr({version:d})]):[2,o.wipe()]}}))}))}}),r}(lr);tE=new WeakMap;var cE,dE,fE,_E,pE,hE,gE,EE,bE,IE,TE,vE,RE,mE,yE,AE,OE,SE=function(){function e(e,t,r,n,i){oE.add(this),Object.defineProperty(this,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"roomId",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"initCount",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"extra",{enumerable:!0,configurable:!0,writable:!0,value:i}),aE.set(this,void 0),sE.set(this,void 0),d(this,aE,new lE(this._ctx,this.roomId,r,n),"f"),d(this,sE,new iE(this._ctx,this.roomId,n),"f")}return Object.defineProperty(e.prototype,"startInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=18e4;c(this,aE,"f").setInitVersion(0),c(this,aE,"f").startInterval(e,!0),c(this,oE,"a",uE)&&(c(this,sE,"f").setInitVersion(0),c(this,sE,"f").startInterval(e,!0))}}),Object.defineProperty(e.prototype,"restartInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=18e4;this.stopInterval(),c(this,sE,"f").startInterval(e,!0),c(this,aE,"f").startInterval(e,!0)}}),Object.defineProperty(e.prototype,"stopInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){c(this,aE,"f").stopInterval(),c(this,sE,"f").stopInterval()}}),Object.defineProperty(e.prototype,"handleMessageNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){c(this,aE,"f").push(e)}}),Object.defineProperty(e.prototype,"handleKVNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){c(this,sE,"f").push(e)}}),Object.defineProperty(e.prototype,"setEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(r){return[2,c(this,sE,"f").setEntry(e,t)]}))}))}}),Object.defineProperty(e.prototype,"setEntries",{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,sE,"f").setEntries(e)]}))}))}}),Object.defineProperty(e.prototype,"removeEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(r){return[2,c(this,sE,"f").removeEntry(e,t)]}))}))}}),Object.defineProperty(e.prototype,"removeEntries",{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,sE,"f").removeEntries(e)]}))}))}}),Object.defineProperty(e.prototype,"getEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,sE,"f").getEntry(e)}}),Object.defineProperty(e.prototype,"getAllEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(){return c(this,sE,"f").getAllEntries()}}),e}();aE=new WeakMap,sE=new WeakMap,oE=new WeakSet,uE=function(){var e;return!!(null===(e=this._ctx.getNaviInfoFromCache())||void 0===e?void 0:e.kvStorage)};var CE,NE,ME,PE,LE=function(e){var t=e.joinTime,r=e.createTime,n=e.memberCount,i=e.chatroomBanState;return{createTime:r,joinTime:t,memberCount:n,isAllChatroomBanned:!(1&~(i||0)),isCurrentUserBanned:!(2&~(i||0)),isCurrentChatroomBanned:!(4&~(i||0)),isCurrentChatroomInWhitelist:!(1&~(e.whiteListState||0))}},wE=function(e){function r(t){var r=e.call(this)||this;return cE.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),dE.set(r,new Map),Object.defineProperty(r,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),fE.set(r,void 0),Object.defineProperty(r,"setCheckChatRoomDuplicateMessage",{enumerable:!0,configurable:!0,writable:!0,value:Og}),r.logger=t.logger,d(r,fE,new ur,"f"),c(r,fE,"f").on("message",c(r,cE,"m",pE),r),c(r,fE,"f").on("chatroom",c(r,cE,"m",_E),r),r._ctx.on("onConnected",c(r,cE,"m",EE),r),r._ctx.on("onDisconnected",c(r,cE,"m",hE),r),r._ctx.on("onSuspend",c(r,cE,"m",gE),r),r._ctx.on("sNtf",c(r,cE,"m",IE),r),r._ctx.on("sCmd",c(r,cE,"m",TE),r),r._ctx.on("syncMsg",c(r,cE,"m",bE),r),r._ctx.on("sMsg",c(r,cE,"m",bE),r),r}return t(r,e),Object.defineProperty(r.prototype,"joinChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o;return a(this,(function(a){switch(a.label){case 0:return[4,c(this,cE,"m",mE).call(this,e,r,n)];case 1:return(i=a.sent()).isOk?((o=c(this,dE,"f").get(e))||(o=new SE(this._ctx,e,t,c(this,fE,"f"),n),c(this,dE,"f").set(e,o),o.startInterval()),[2,i.trans(LE)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"quitChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return c(this,dE,"f").get(e)?(c(this,cE,"m",yE).call(this,e),r=Dl.encode(Ma,{nothing:1,extra:t}),[4,this._ctx.query(Jn.exitChrm,e,r)]):[2,fr()];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getChatroomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return n=Dl.encode(ka,{count:t,order:r}),[4,this._ctx.query(Jn.queryChrmI,e,n,Fa)];case 1:return[2,i.sent().trans((function(e){return{userCount:e.userTotalNums,userInfos:e.userInfos.map((function(e){return{id:e.id,time:e.time}}))}}))]}}))}))}}),Object.defineProperty(r.prototype,"setChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return a(this,(function(n){return[2,c(this,cE,"m",AE).call(this,e).next((function(e){return e.setEntry(t,r)}))]}))}))}}),Object.defineProperty(r.prototype,"setChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(r){return[2,c(this,cE,"m",AE).call(this,e).next((function(e){return e.setEntries(t)}))]}))}))}}),Object.defineProperty(r.prototype,"removeChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return a(this,(function(n){return[2,c(this,cE,"m",AE).call(this,e).next((function(e){return e.removeEntry(t,r)}))]}))}))}}),Object.defineProperty(r.prototype,"removeChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(r){return[2,c(this,cE,"m",AE).call(this,e).next((function(e){return e.removeEntries(t)}))]}))}))}}),Object.defineProperty(r.prototype,"getChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return a(this,(function(i){switch(i.label){case 0:return(r=c(this,dE,"f").get(e))?null===(n=r.getEntry(t))?[2,_r(exports.ErrorCode.CHATROOM_KEY_NOT_EXIST)]:[2,fr(n)]:[4,c(this,cE,"m",OE).call(this,e)];case 1:return[2,i.sent().tryTrans((function(e){var r=e[t];return void 0===r?_r(exports.ErrorCode.CHATROOM_KEY_NOT_EXIST):fr(r)}))]}}))}))}}),Object.defineProperty(r.prototype,"getAllChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(r){return(t=c(this,dE,"f").get(e))?[2,fr(t.getAllEntries())]:[2,c(this,cE,"m",OE).call(this,e)]}))}))}}),Object.defineProperty(r.prototype,"getChatroomHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){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=eh({targetId:e,time:t,count:r,order:n}),o=this._ctx.currentUserId,[4,this._ctx.query(Jn.qryCHMsg,e,i)];case 1:return(s=a.sent()).isOk?(u=th(s.data.pbData),[2,fr({hasMore:!!u.hasMsg,list:u.list.map((function(t){return Ec(t,o,!1,e)}))})]):[2,s.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"bindRTCRoomForChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return t=Dl.encode(Vs,{rtcRoomId:e.rtcRoomId}),[4,this._ctx.query(Jn.setRtcRoomId,e.chatRoomId,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),r}(ur);dE=new WeakMap,fE=new WeakMap,cE=new WeakSet,_E=function(e,t){e.stopPropagation(),this.emit("chatroom",t)},pE=function(e,t,r){e.stopPropagation(),this._ctx.recordReceivedMessagesForStatistics(t),c(this,cE,"m",vE).call(this,t,r,!1)},hE=function(){var e,t;try{for(var r=s(c(this,dE,"f").values()),n=r.next();!n.done;n=r.next()){n.value.stopInterval()}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}c(this,dE,"f").clear()},gE=function(){var e,t;try{for(var r=s(c(this,dE,"f").values()),n=r.next();!n.done;n=r.next()){n.value.stopInterval()}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},EE=function(e,t){var r,n;if(t)try{for(var i=s(c(this,dE,"f").values()),o=i.next();!o.done;o=i.next()){var a=o.value;c(this,cE,"m",RE).call(this,a)}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}},bE=function(e,t){t.conversationType===exports.ConversationType.CHATROOM&&(e.stopPropagation(),c(this,cE,"m",vE).call(this,[t],t.targetId,!0))},IE=function(e,t){var r=t.type,n=t.chrmId,i=t.time;if(2===r){e.stopPropagation();var o=c(this,dE,"f").get(n);o&&o.handleMessageNotify(i)}},TE=function(e,t){var r=t.type,n=t.chrmId,i=t.time,o=t.destroyType;if(2===r||4===r){e.stopPropagation();var a=c(this,dE,"f").get(n);if(a)return 4===r?(c(this,dE,"f").delete(n),void this.emit("chatroom",{chatroomDestroyed:n,chatroomDestroyedType:o})):void a.handleKVNotify(i)}},vE=function(e,t,r){var n=this;if(c(this,dE,"f").get(t)||r&&e[0].messageType===me.CHATROOM_MERGE_BLOCK){var i=e.filter((function(e){var r,i=e.messageType;if(i===me.CHATROOM_MERGE_CHANGE){var o=function(e){var t={},r=[],n=e.content.memberCount||0;return Array.isArray(e.content.userList)&&e.content.userList.forEach((function(e){t[e.userId]=e.status,r.push({userId:e.userId,action:e.status,extra:e.extra})})),{users:t,chatroomId:e.targetId,memberCount:n,userList:r}}(e);return n.emit("chatroom",{userChange:o}),!1}if(i===me.CHATROOM_MERGE_BAN){var a=function(e){var t=e.content;return{chatroomId:t.chatroomId,banType:t.operateType,durationTime:t.durationTime,operateTime:t.operateTime,userIdList:t.userList,extra:t.extra||""}}(e);return n.emit("chatroom",{chatroomNotifyBan:a}),!1}if(i===me.CHATROOM_SYNC_MSG){var s=function(e){var t=e.content;return{chatroomId:t.chatroomId,status:t.status,reason:t.reason,time:t.time,extra:t.extra||""}}(e);return n.emit("chatroom",{chatroomNotifyMultiLoginSync:s}),!1}if(i===me.CHATROOM_MERGE_BLOCK){var u=function(e){var t=e.content;return{chatroomId:t.chatroomId,operateType:t.operateType,durationTime:t.durationTime,operateTime:t.operateTime,userIdList:t.userList,extra:t.extra||""}}(e);return u.operateType===exports.ChrmMemOperateType.Blocked&&(null===(r=null==u?void 0:u.userIdList)||void 0===r?void 0:r.includes(n._ctx.currentUserId))&&c(n,cE,"m",yE).call(n,t),n.emit("chatroom",{chatroomNotifyBlock:u}),!1}return!0}));i.length>0&&this.emit("message",i,t)}},RE=function(e){return o(this,void 0,void 0,(function(){var t,r,i,o,s,u,l,d;return a(this,(function(a){switch(a.label){case 0:return t=e.roomId,r=e.extra,i=this.logger.createTraceId(),this.logger.info(B.L_REJOIN_CHATROOM_T,JSON.stringify({chatroomId:t}),i),[4,c(this,cE,"m",mE).call(this,t,!1,r)];case 1:return o=a.sent(),this.logger.summary(B.L_REJOIN_CHATROOM_R,o,i,{chatroomId:t}),s=o.code,u=o.isOk,l=o.data,u?(e.restartInterval(),d=LE(l),this.emit("chatroom",{rejoinedRoom:n(n({chatroomId:t},d),{count:e.initCount})}),[2]):(s!==exports.ErrorCode.RC_CHATROOM_USER_KICKED&&s!==exports.ErrorCode.RC_CHATROOM_NOT_EXIST||c(this,dE,"f").delete(t),this.emit("chatroom",{rejoinedRoom:{chatroomId:t,errorCode:s}}),[2])}}))}))},mE=function(e,t,r){var n=Dl.encode(Ma,{extra:r,nothing:1}),i=t?Jn.joinChrm:Jn.joinChrmR;return this._ctx.query(i,e,n,Pa)},yE=function(e){var t=c(this,dE,"f").get(e);t&&(t.stopInterval(),c(this,dE,"f").delete(e))},AE=function(e){var t=c(this,dE,"f").get(e);return t?fr(t):_r(exports.ErrorCode.NOT_IN_CHATROOM)},OE=function(e){return o(this,void 0,void 0,(function(){var t,r;return a(this,(function(n){switch(n.label){case 0:return[4,this._ctx.query(Jn.pullKV,e,ih(0),void 0)];case 1:return(t=n.sent()).isOk?(r=oh(t.data.pbData).entries,[2,fr(r.reduce((function(e,t){return e[t.key]=t.value,e}),{}))]):[2,t.wipe()]}}))}))};var UE=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"_syncDataHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=ua.localStorage,r=e.appkey,n=e.currentUserId,i=it(r,n),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(r.prototype,"version",{get:function(){return this.get("value").version||0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"tags",{get:function(){return this.get("value").tags||{}},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"forceUpdate",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.set("value",e)}}),Object.defineProperty(r.prototype,"addTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.get("value"),n=r.tags,i=r.autoTrans,o=r.transLan;n[e.tagId]={tagName:e.tagName,createdTime:t},this.set("value",{version:t,tags:n,autoTrans:i,transLan:o})}}),Object.defineProperty(r.prototype,"deleteTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.get("value"),n=r.tags,i=r.autoTrans,o=r.transLan;delete n[e],this.set("value",{version:t,tags:n,autoTrans:i,transLan:o})}}),r}(ud),DE=function(e){function r(t){var r=e.call(this,"UserSettings")||this;return CE.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:void 0}),NE.set(r,!1),r.storage=new UE,r._ctx.on("onConnected",r._handleConnected,r),r._ctx.on("onDisconnected",r._handleDisconnected,r),r._ctx.on("onSuspend",r._handleDisconnected,r),r._ctx.on("signal",r._handleSignal,r),r}return t(r,e),Object.defineProperty(r.prototype,"_handleConnected",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.storage.syncDataFromLocalStorage(this._ctx),d(this,NE,!0,"f");var e=this.storage.version;this.setInitVersion(e),this.push(e)}}),Object.defineProperty(r.prototype,"_handleDisconnected",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.reset()}}),Object.defineProperty(r.prototype,"_handleSignal",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(Kn(t.topic)===Jn.s_us){var r=Dl.decode(As,t.pbData).version;this.push(r),e.stopPropagation()}}}),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,s,u,l,d,f,_,p,h,g,E,b,I,T,v;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx,r=t.currentUserId,n=t.logger,i=this._ctx.getNaviInfoFromCache(),o=n.createTraceId(),n.info(B.L_SYNC_USER_SETTINGS_T,"version: ".concat(e),o),s=Dl.encode(os,{version:e,ipType:i.ipType||0}),[4,this._ctx.query(Jn.pullUS,r,s,as)];case 1:return u=a.sent(),n.summary(B.L_SYNC_USER_SETTINGS_R,u,o),u.isOk?(l=u.data,d=l.version,f=l.items,_=!1,p=!1,h=!1,g="",E=this.storage.get("value"),b=E.transLan,I=E.autoTrans,T=E.tags,v={version:d,transLan:b,autoTrans:I,tags:T},null==f||f.forEach((function(e){var t=e.key,r=e.value;switch(t){case"Tag":v.tags={},e.tags.forEach((function(e){v.tags[e.tagId]={tagName:e.name,createdTime:e.createdTime}})),_=!0;break;case"transLan":h=!0,v.transLan=no.readUTF(new Uint8Array(r));break;case"autoTrans":p=!0,v.autoTrans="1"===no.readUTF(new Uint8Array(r));break;case"VoipInfo":g=no.readUTF(new Uint8Array(r))}})),this.storage.set("value",v),_&&this.emit("tagsChanged"),h&&this.emit("userSettingsChanged",{key:Vr.TranslationLanguage,value:v.transLan}),p&&this.emit("userSettingsChanged",{key:Vr.AutoTranslateEnable,value:v.autoTrans}),g&&this.emit("voipInfoChanged",g),c(this,CE,"m",ME).call(this,u.code),[2,fr({version:d})]):(c(this,CE,"m",ME).call(this,u.code),[2,u.wipe()])}}))}))}}),Object.defineProperty(r.prototype,"hasTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!!this.storage.tags[e]}}),Object.defineProperty(r.prototype,"getTags",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.storage.tags}}),Object.defineProperty(r.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=this.storage.version,r=this._ctx.currentUserId,n=Dl.encode(ms,{version:t,tags:[{tagId:e.tagId,name:e.tagName}],ignoreVersion:!0}),[4,this._ctx.query(Jn.addSeTag,r,n,is)];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(r.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=this.storage.version,r=this._ctx.currentUserId,n=Dl.encode(ys,{version:t,tags:[{tagId:e}],ignoreVersion:!0}),[4,this._ctx.query(Jn.delSeTag,r,n,is)];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(r.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,CE,"m",PE).call(this,Jn.transLan,e)]}))}))}}),Object.defineProperty(r.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,fr(this.storage.get("value").transLan||"zh")]}))}))}}),Object.defineProperty(r.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,CE,"m",PE).call(this,Jn.autoTrans,e?"1":"0")]}))}))}}),Object.defineProperty(r.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,fr(this.storage.get("value").autoTrans)]}))}))}}),r}(lr);NE=new WeakMap,CE=new WeakSet,ME=function(e){c(this,NE,"f")&&(d(this,NE,!1,"f"),this.emit("userSettingsSynced",e))},PE=function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,s,u,l,c,d,f,_,p,h;return a(this,(function(a){switch(a.label){case 0:return r=this.storage.version,n=this._ctx.currentUserId,i=Dl.encode(ns,{version:r,value:t,ignoreVersion:!0}),[4,this._ctx.query(e,n,i,is)];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,_=c.tags,p=c.version,h={version:l?u:p,transLan:d,autoTrans:f,tags:_},e){case Jn.transLan:h.transLan=t;break;case Jn.autoTrans:h.autoTrans="1"===t}this.storage.set("value",h)}return[2,o.wipe()]}}))}))};var xE,GE,VE,jE,kE,FE,BE,HE,YE,WE,JE,qE,KE,QE,XE=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:Object.fromEntries(e.extProfile.map((function(e){return[e.key,e.value]}))),addTime:e.relationTime,inBlackList:!!e.flag}},ZE=function(e){var t,r,n=e.targetId,i=e.settingProfile,o=e.extProfile,a=e.baseInfo,s=e.userInfo,u=Yt(i||[]),l=Yt(o||[]);return{groupId:n,groupName:u.name||"",portraitUri:u.portraitUrl||"",introduction:u.introduction||"",notice:u.announcement||"",extProfile:l,joinPermission:~~u.joinPerm,removeMemberPermission:~~u.removePerm,invitePermission:~~u.memInvitePerm,inviteHandlePermission:~~u.invitePerm,groupInfoEditPermission:~~u.profilePerm,memberInfoEditPermission:~~u.memProfilePerm,creatorId:(null==a?void 0:a.creatorId)||"",ownerId:(null==a?void 0:a.ownerId)||"",createTime:(null==a?void 0:a.createTime)||0,membersCount:(null==a?void 0:a.memberCount)||0,remark:null!==(t=null==s?void 0:s.remarkName)&&void 0!==t?t:"",joinedTime:(null==s?void 0:s.joinTime)||0,role:null!==(r=null==s?void 0:s.role)&&void 0!==r?r:exports.GroupMemberRole.UNDEF}},zE=function(){function e(e){Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"searchFriendsInfo",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(this,"searchGroupMembers",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(this,"searchJoinedGroups",{enumerable:!0,configurable:!0,writable:!0,value:Og})}return Object.defineProperty(e.prototype,"updateMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return t=Dl.encode(uu,{permission:e}),[4,this.ctx.query(Jn.updProfilePermiss,this.ctx.currentUserId,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMyUserProfileVisibility",{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=Dl.encode(su,{nothing:1}),[4,this.ctx.query(Jn.qProfilePermiss,this.ctx.currentUserId,e,uu)];case 1:return[2,t.sent().trans((function(e){return e.permission}))]}}))}))}}),Object.defineProperty(e.prototype,"searchUserProfileByUniqueId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=Dl.encode(lu,{uniqueId:e}),[4,this.ctx.query(Jn.searchUserProfile,this.ctx.currentUserId,t,nu)];case 1:return(r=a.sent()).isOk?(n=r.data,i=n.userId,o=n.userProfile,s=n.userExtProfile,u=Ut(i,o,s),[2,fr(u)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"createGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){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=Lp(e,t,r,n),[4,this.ctx.query(Jn.channelCreate,e,i,void 0)];case 1:return(o=a.sent()).isOk||!o.data?[2,o.wipe()]:(s=Dl.decode(du,o.data.pbData),u={errorKeys:s.censorFailedFields,processCode:s.processCode||0},[2,_r(o.code,o.msg,u)])}}))}))}}),Object.defineProperty(e.prototype,"updateGroupInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o;return a(this,(function(a){switch(a.label){case 0:return n=Lp(e,t,r),[4,this.ctx.query(Jn.upChannelInfo,e,n,void 0)];case 1:return(i=a.sent()).isOk||!i.data?[2,i.wipe()]:(o=Dl.decode(du,i.data.pbData),[2,_r(i.code,i.msg,{errorKeys:o.censorFailedFields})])}}))}))}}),Object.defineProperty(e.prototype,"getGroupsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return a(this,(function(i){switch(i.label){case 0:return t=Dl.encode(fu,{type:exports.ConversationType.GROUP,list:e.map((function(e){return{targetId:e}}))}),[4,this.ctx.query(Jn.qChannelInfo,e[0],t,hu)];case 1:return(r=i.sent()).isOk?(n=$p(r.data).list,[2,fr(n.map(ZE))]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"kickGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return n=ch({targetId:e,users:t,settingInfo:{isQuit:!0,isDelBan:r.removeMuteStatus,isDelAttention:r.removeFollow,isDelWhite:r.removeWhiteList}}),[4,this.ctx.query(Jn.channelMemKick,e,n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"quitGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return r=ch({targetId:e,settingInfo:{isQuit:!0,isDelBan:t.removeMuteStatus,isDelAttention:t.removeFollow,isDelWhite:t.removeWhiteList}}),[4,this.ctx.query(Jn.channelMemQuit,e,r)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"dismissGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return t=ch({targetId:e}),[4,this.ctx.query(Jn.channelDismiss,e,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"transferGroupOwner",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i;return a(this,(function(o){switch(o.label){case 0:return i=ch({targetId:e,settingInfo:{isQuit:r,isDelBan:n.removeMuteStatus,isDelAttention:n.removeFollow,isDelWhite:n.removeWhiteList},users:[t]}),[4,this.ctx.query(Jn.channelTransfer,e,i)];case 1:return[2,o.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return n=Dl.encode(_u,{targetId:t,type:exports.ConversationType.GROUP,users:r,operateType:e}),[4,this.ctx.query(Jn.upChannelManager,t,n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return n=Dl.encode(_u,{targetId:t,type:exports.ConversationType.GROUP,users:r,operateType:e}),[4,this.ctx.query(Jn.upChannelFollow,t,n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i;return a(this,(function(o){switch(o.label){case 0:return t=uh({targetId:e}),[4,this.ctx.query(Jn.qChannelFollow,this.ctx.currentUserId,t,hu)];case 1:return(r=o.sent()).isOk?(n=$p(r.data).list,i=n.map((function(e){return{userId:e.userId,time:e.opTime}})),[2,fr(i)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return r=lh({targetId:e,operateType:t?exports.GroupOperationType.ADD:exports.GroupOperationType.REMOVE,channelNickName:t}),[4,this.ctx.query(Jn.upChannelRemark,e,r)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"addFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return n=Dl.encode(Ru,{targetId:e,type:t,info:r}),[4,this.ctx.query(Jn.friendAdd,this.ctx.currentUserId,n,du)];case 1:return[2,i.sent().trans((function(e){return{processCode:e.processCode||0}}))]}}))}))}}),Object.defineProperty(e.prototype,"deleteFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return r=Dl.encode(mu,{targetId:e,type:t}),[4,this.ctx.query(Jn.friendDel,this.ctx.currentUserId,r)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"acceptFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return t=Dl.encode(Ru,{targetId:e,type:1}),[4,this.ctx.query(Jn.friendHandle,this.ctx.currentUserId,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"refuseFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return r=Dl.encode(Ru,{targetId:e,type:2,info:t}),[4,this.ctx.query(Jn.friendHandle,this.ctx.currentUserId,r)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setFriendInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o;return a(this,(function(a){switch(a.label){case 0:return n=Dl.encode(Au,{targetId:e,remarkName:t,extProfile:Object.entries(r).map((function(e){var t=u(e,2);return{key:t[0],value:t[1]}}))}),[4,this.ctx.query(Jn.friendSetPf,this.ctx.currentUserId,n,void 0)];case 1:return(i=a.sent()).isOk||!i.data?[2,i.wipe()]:(o=Dl.decode(Ou,i.data.pbData),[2,_r(i.code,"",{errorKeys:o.censorFailedFields})])}}))}))}}),Object.defineProperty(e.prototype,"checkFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return r=Dl.encode(mu,{targetId:e,type:t}),[4,this.ctx.query(Jn.friendCheck,this.ctx.currentUserId,r,yu)];case 1:return[2,n.sent().trans((function(e){return e.list.map((function(e){return{userId:e.targetId,relationType:e.status}}))}))]}}))}))}}),Object.defineProperty(e.prototype,"getFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return r=Dl.encode(Su,{queryType:11,friendType:e,page:{size:t.count,order:t.order?0:1,pageToken:t.pageToken}}),[4,this.ctx.query(Jn.friendsQuery,this.ctx.currentUserId,r,hu)];case 1:return(n=a.sent()).isOk?(i=n.data.page,o=i.pageToken,s=i.hasNext,u=$p(n.data).list,l={pageToken:s&&o?o:"",data:u.map(XE)},[2,fr(l)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getFriendApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var t,r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=Dl.encode(Su,{queryType:12,page:{size:e.count,pageToken:e.pageToken,order:e.order?0:1}}),[4,this.ctx.query(Jn.friendsQuery,this.ctx.currentUserId,t,hu)];case 1:return(r=a.sent()).isOk?(n=r.data.page,i=n.pageToken,o=n.hasNext,s=$p(r.data).list,u={pageToken:o&&i?i:"",data:s.map((function(e){return{userId:e.userId,name:e.name,portraitUri:e.portraitUrl,applicationType:e.type,applicationStatus:e.status,operationTime:e.operateTime,extra:e.info||""}}))},[2,fr(u)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return t=Dl.encode(Cu,{targetId:e}),[4,this.ctx.query(Jn.friendsInfoQry,this.ctx.currentUserId,t,Mu)];case 1:return[2,r.sent().trans((function(e){return e.list.map(XE)}))]}}))}))}}),Object.defineProperty(e.prototype,"setFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return t=Dl.encode(Nu,{level:e}),[4,this.ctx.query(Jn.friendAuthSet,this.ctx.currentUserId,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return a(this,(function(r){switch(r.label){case 0:return e=this.ctx.currentUserId,t=Dl.encode(Ru,{targetId:e}),[4,this.ctx.query(Jn.friendAuthGet,e,t,Nu)];case 1:return[2,r.sent().trans((function(e){return e.level}))]}}))}))}}),Object.defineProperty(e.prototype,"getGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o;return a(this,(function(a){switch(a.label){case 0:return r=uh({targetId:e,ids:t}),[4,this.ctx.query(Jn.qChannelSpeMem,e,r,hu)];case 1:return(n=a.sent()).isOk?(i=$p(n.data).list,o=i.map(Bt),[2,fr(o)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setGroupMemberInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){switch(a.label){case 0:return i=lh({targetId:e,userId:t,channelNickName:r,additional:n}),[4,this.ctx.query(Jn.upChannelMem,e,i,void 0)];case 1:return(o=a.sent()).isOk||!o.data?[2,o.wipe()]:(s=Dl.decode(du,o.data.pbData),[2,_r(o.code,o.msg,{errorKeys:s.censorFailedFields})])}}))}))}}),Object.defineProperty(e.prototype,"getGroupMembersByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return n=uh({targetId:e,roleType:t,botType:r.filterRobotType,page:{size:r.count,order:r.order?0:1,pageToken:r.pageToken}}),[4,this.ctx.query(Jn.qChannelMem,e,n,hu)];case 1:return(i=a.sent()).isOk?(o=i.data.page,s=o.pageToken,u=o.hasNext,l=$p(i.data).list,c={pageToken:u&&s?s:"",data:l.map(Bt)},[2,fr(c)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"joinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return t=Dl.encode(vu,{targetId:e,type:exports.ConversationType.GROUP}),[4,this.ctx.query(Jn.channelMemJoin,e,t,du)];case 1:return[2,r.sent().trans((function(e){return{processCode:e.processCode||0}}))]}}))}))}}),Object.defineProperty(e.prototype,"inviteUsersToGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return r=Dl.encode(vu,{targetId:e,type:exports.ConversationType.GROUP,userIds:t}),[4,this.ctx.query(Jn.channelMemInvite,e,r,du)];case 1:return[2,n.sent().trans((function(e){return{processCode:e.processCode||0}}))]}}))}))}}),Object.defineProperty(e.prototype,"memberInviteResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=e.groupId,r=e.inviterId,n=e.optType,i=e.optResult,o=e.joinUserId,s=e.reason,u=Dl.encode(Tu,{targetId:t,type:exports.ConversationType.GROUP,optType:n,optResult:i,inviterId:r,joinUserId:o,detail:s}),[4,this.ctx.query(Jn.channelApplyResp,t,u,du)];case 1:return[2,a.sent().trans((function(e){return{processCode:e.processCode||0}}))]}}))}))}}),Object.defineProperty(e.prototype,"getGroupApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var t,r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=uh({page:{size:e.count,pageToken:e.pageToken,order:e.order?0:1}}),[4,this.ctx.query(Jn.qChannelApplyList,this.ctx.currentUserId,t,hu)];case 1:return(r=a.sent()).isOk?(n=$p(r.data),i=n.pageToken,o=n.hasNext,s=n.list,u=s.map(Ht),[2,fr({data:u,pageToken:o&&i?i:""})]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getJoinedGroupsByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return r=uh({roleType:e,page:{size:t.count,pageToken:t.pageToken,order:t.order?1:0}}),[4,this.ctx.query(Jn.qChannelMemJoin,this.ctx.currentUserId,r,hu)];case 1:return(n=a.sent()).isOk?(i=n.data.page,o=i.pageToken,s=i.hasNext,u=$p(n.data).list,l=u.map(ZE),[2,fr({data:l,pageToken:s&&o?o:""})]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i;return a(this,(function(o){switch(o.label){case 0:return t=Dl.encode(pu,{type:exports.ConversationType.GROUP,ids:e}),[4,this.ctx.query(Jn.qChannelMemSpeJoin,this.ctx.currentUserId,t,hu)];case 1:return(r=o.sent()).isOk?(n=$p(r.data).list,i=n.map(ZE),[2,fr(i)]):[2,r.wipe()]}}))}))}}),e}(),$E=((xE={})[P.GROUP_OPERATION]=function(e){return"ChannelEventData"},xE[P.GROUP_PROFILE_CHANGE]=function(e){return"ChannelEventData"},xE[b.FRIEND_APPLICATION]=function(e){return{0:"FriendApplyEvent",1:"FriendApplyEvent",2:"FriendUserInfo",3:"FriendsInput",5:"FriendTypeChangeEvent",6:"FriendUpdateEvent"}[e]},xE),eb=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,r){var n=e,i={}[t];try{n=e.length>0&&Dl.decode(t,e),mt(i)&&(n=i.call(this,n,r))}catch(e){this.logger.error(B.L_PB_DECODE_E,t)}return n}}),Object.defineProperty(e.prototype,"formatEventChangeList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return e.map((function(e){var r,n=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,_=e.secondaryType,p=e.remindType,h=e.isRemindMe,g=e.extIds,E=e.eventData;return E&&(r=t._formatEventData(E,o,f)),{businessId:n,changeType:o,originalId:a,time:i,originalTime:s,secondaryId:u||"",isAdmin:l,additionalMark:c,operatorId:d,subChangeType:f,userGroupIds:g,secondaryType:_,remindType:p,isRemindMe:h,eventData:r}}))}}),Object.defineProperty(e.prototype,"_formatEventData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n={};return e&&$E[t]&&$E[t](r)&&(n=Dl.decode($E[t](r),e)||{}),n}}),e}(),tb=((GE={})[exports.ConversationType.PRIVATE]=Jn.qryPMsg,GE[exports.ConversationType.GROUP]=Jn.qryGMsg,GE[exports.ConversationType.CHATROOM]=Jn.qryCHMsg,GE[exports.ConversationType.CUSTOMER_SERVICE]=Jn.qryCMsg,GE[exports.ConversationType.SYSTEM]=Jn.qrySMsg,GE[exports.ConversationType.APP_PUBLIC_SERVICE]=Jn.qryMCMsg,GE[exports.ConversationType.PUBLIC_SERVICE]=Jn.qryMPMsg,GE[exports.ConversationType.ULTRA_GROUP]=Jn.qryUgMsg,GE),rb=function(e,t,r,n,i,o){var a=En(t.messageType),s=a.isCounted,u=a.isPersited,l=a.isStatusMessage;return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId||"",senderUserId:i,messageDirection:exports.MessageDirection.SEND,isCounted:s,isMentioned:!!t.isMentioned,content:t.content,messageType:t.messageType,isOffLineMessage:!1,isPersited:u,messageUId:r,sentTime:n,receivedTime:0,disableNotification:!!t.disableNotification,isStatusMessage:!!l,canIncludeExpansion:!!t.canIncludeExpansion,expansion:t.canIncludeExpansion?t.expansion:null,receivedStatus:exports.ReceivedStatus.UNREAD,receivedStatusInfo:Lt(exports.ReceivedStatus.UNREAD),pushConfig:t.pushConfig,isInterrupt:t.isInterrupt,messageId:o||0,sentStatus:exports.SentStatus.SENT,directedUserIds:t.directionalUserIdList,disableUpdateLastMessage:t.disableUpdateLastMessage,needReceipt:t.needReceipt}},nb=[P.GROUP_OPERATION,P.GROUP_PROFILE_CHANGE,P.GROUP_APPLICATION_INVITATION,P.GROUP_FOLLOW_USER_CHANGE],ib=[b.FRIEND_APPLICATION],ob=function(){function e(e,t){var r=this;VE.add(this),Object.defineProperty(this,"_watcher",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_initOptions",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userSettings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subscribeManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_openCallPlus",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_chat",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_chatroom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dataHosting",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_codec",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_latestPullKVMsgTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_handleInnerMsgOptions",{enumerable:!0,configurable:!0,writable:!0,value:function(e,t){var n=t.messageType;return n===me.SYNC_READ_STATUS&&(t.directionalUserIdList=or(e.conversationType,[r.currentUserId])),n===me.READ_RECEIPT_RESPONSE&&(t.content.receiptMessageDic&&0!==Object.keys(t.content.receiptMessageDic).length||(t.content=r._chat.storage.createReadReceiptResponseContent(e)),t.directionalUserIdList=Object.keys(t.content.receiptMessageDic)),t}}),Object.defineProperty(this,"getOSInfo",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(this,"getProcessInfo",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(this,"getMainProcessInfo",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(this,"setProxy",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(this,"getProxy",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(this,"testProxy",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(this,"setUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(this,"getUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(this,"addToBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(this,"removeFromBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(this,"getBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(this,"getBlacklistStatus",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(this,"insertMessage",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(this,"batchInsertMessage",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(this,"getLocalMessageCount",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(this,"deleteLocalMessages",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(this,"deleteLocalMessagesByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(this,"batchClearLocalMessagesByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(this,"clearLocalMessages",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(this,"getMessage",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(this,"setMessageContent",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(this,"setMessageSearchField",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(this,"searchConversationByContentWithAllChannel",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(this,"searchMessagesWithParams",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(this,"setMessageSentStatus",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(this,"updateMessageReceiptStatus",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(this,"setMessageReceivedStatus",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(this,"clearLocalData",{enumerable:!0,configurable:!0,writable:!0,value:Og}),Object.defineProperty(this,"setCheckDuplicateMessage",{enumerable:!0,configurable:!0,writable:!0,value:Og});var n=this._ctx=new eE(t),i=n.logger;this._codec=new eb(i),this._userSettings=new DE(n),this._chat=new Ng(n,this._userSettings,this),this._chatroom=new wE(n),this._dataHosting=new zE(n),this._chat.on("messages",this._handleChatMessages,this),this._chat.on("offlineFinished",(function(){return r._watcher.pullFinished()}),this),this._chat.on("syncReadStatusV4",this._handleSyncReadStatusV4,this),this._chat.on("expansions",this._handleExpansions,this),this._chat.on("readReceiptV4",this._handleReadReceiptV4,this),this._chat.on("conversationStatusChanged",this._conversationStatusChanged,this),this._chat.on("conversationStatusSynced",(function(e,t){return r._watcher.conversationStatusSynced(t)}),this),this._chat.on("sgRelationsSynced",(function(e,t){return r._watcher.sgRelationsSynced(t)}),this),this._chat.on("ultraGroupEnable",(function(){return r._watcher.ultraGroupEnable()}),this),this._chat.on("syncServerSaveUnreadCompleted",(function(){return r._watcher.syncServerSaveUnreadCompleted()}),this),this._chatroom.on("message",this._handleChatroomMessages,this),this._chatroom.on("chatroom",this._handlerChatroomEvent,this),n.on("sCmd",this._handleSCmdNotify,this),n.on("signal",this._handleSignal,this),n.on("onConnected",this.onConnected,this),n.on("onDisconnected",this.onDisconnected,this),n.on("onConnecting",this.onConnecting,this),n.on("onSuspend",this.onSuspend,this),n.on("messagesFromUG",this._handleMessagesFromUltraGroup,this),n.on("serverEvent",c(this,VE,"m",JE),this),n.on("readReceiptResponseV5",c(this,VE,"m",kE),this),n.on("speechToTextResponse",c(this,VE,"m",FE),this),n.on("ugUserGroupChanged",this._handleUserGroupStatus,this),n.on("ugChannelChanged",this._handleUltraChannelChange,this),n.on("messageModified",c(this,VE,"m",BE),this),n.on("messageModifiedSyncCompleted",c(this,VE,"m",HE),this),n.on("ugMsgExpansionUpdated",c(this,VE,"m",YE),this),n.on("ugMsgRecalled",c(this,VE,"m",WE),this),n.on("robotsSynced",c(this,VE,"m",jE),this),n.on("messageReaction",(function(e,t){return r._watcher.messageReaction(t)})),this._userSettings.on("voipInfoChanged",this._naviChangeHandler,this),this._userSettings.on("tagsChanged",(function(){return r._watcher.tag()}),this),this._userSettings.on("userSettingsSynced",(function(e,t){return r._watcher.userSettingsSynced(t)}),this),this._userSettings.on("userSettingsChanged",(function(e,t){return r._watcher.userSettingsChanged(t)}),this)}return Object.defineProperty(e.prototype,"appkey",{get:function(){return this._initOptions.appkey},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"chat",{get:function(){return this._chat},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"chatroom",{get:function(){return this._chatroom},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userSettings",{get:function(){return this._userSettings},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataHosting",{get:function(){return this._dataHosting},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"usingCppEngine",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"logger",{get:function(){return this._ctx.logger},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onConnected",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._ctx.getNaviInfoFromCache();this._initSubscribeManager(r),this._openCallPlus&&this._syncCallPullKVMsg(),this._watcher.onConnected(t)}}),Object.defineProperty(e.prototype,"onDisconnected",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._resetMemoryState(),this._watcher.onDisconnected(t)}}),Object.defineProperty(e.prototype,"onSuspend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.onSuspend(t)}}),Object.defineProperty(e.prototype,"onConnecting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._watcher.onConnecting()}}),Object.defineProperty(e.prototype,"_handleSyncReadStatusV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;t.forEach((function(e){return r._watcher.syncReadStatus(e)}))}}),Object.defineProperty(e.prototype,"_handleReadReceiptV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;t.forEach((function(e){return r._watcher.messageReadReceipt(e)}))}}),Object.defineProperty(e.prototype,"_handleExpansions",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;t.forEach((function(e){return r._watcher.expansion(e)}))}}),Object.defineProperty(e.prototype,"_conversationStatusChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=t.some((function(e){var t;return void 0!==(null===(t=e.updatedItems)||void 0===t?void 0:t.tags)}));this._watcher.conversation(t),r&&this._watcher.conversationTag()}}),Object.defineProperty(e.prototype,"_initSubscribeManager",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;(e.subDriven||e.userProfile)&&(this._subscribeManager||(this._subscribeManager=new Nc(this._ctx,{syncSubscribeUserStatusFinished:function(e){var r,n;null===(n=(r=t._watcher).syncSubscribedUserStatusFinished)||void 0===n||n.call(r,e)},subscribeUserStatusChanged:function(e){var r,n;null===(n=(r=t._watcher).subscribedUserStatusChange)||void 0===n||n.call(r,e)},subscribeRelationChanged:function(e){var r,n;null===(n=(r=t._watcher).subscribedRelationChange)||void 0===n||n.call(r,e)},ownUserProfileChanged:function(e){var r,n;null===(n=(r=t._watcher).ownUserProfileChanged)||void 0===n||n.call(r,e)}},this.currentUserId,this._ctx.delayTime,this.logger,!!e.userProfile,e.subDriven||0)),this._subscribeManager.syncData())}}),Object.defineProperty(e.prototype,"createLogger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return new Mc(this.appkey,e,t,this.logger.proxy)}}),Object.defineProperty(e.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._ctx.navi.request(this._ctx.currentToken,!0,!0,this.logger.createTraceId())}}),Object.defineProperty(e.prototype,"naviInfo",{get:function(){return this._ctx.getNaviInfoFromCache()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"connectedTime",{get:function(){return this._ctx.connectedTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"connectionStatus",{get:function(){return this._ctx.connectionStatus},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){return a(this,(function(i){return this._openCallPlus=r,[2,this._ctx.connect(e,t,r,n)]}))}))}}),Object.defineProperty(e.prototype,"_handleMessagesFromUltraGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this,i=new Map,o=[];t.forEach((function(e){var t,r,a,s=e.targetId,u=e.content,l=e.messageUId,c=e.channelId,d=e.isMentioned,f=e.isCounted,_=e.senderUserId,p=e.messageType,h=e.sentTime,g=e.channelType,E=e.isPersited,b={conversationType:exports.ConversationType.ULTRA_GROUP,targetId:s,channelId:c||""},I=n._chat.storage.getOrCreateModel(b,!0),T=i.get(I)||{params:{channelType:g},time:h};i.set(I,T),T.time=h;var v=T.params;if(E&&(v.hidden=!1,v.latestMessage=e,v.operationTime=h),f&&_!==n.currentUserId&&p!==me.RECALL_NOTIFICATION_MESSAGE){v.unreadCount=(v.unreadCount||I.unreadCount)+1;var R=(null===(t=null==u?void 0:u.mentionedInfo)||void 0===t?void 0:t.type)===exports.MentionedType.ALL;d&&(R||(null===(a=null===(r=null==u?void 0:u.mentionedInfo)||void 0===r?void 0:r.userIdList)||void 0===a?void 0:a.includes(n.currentUserId)))&&(v.unreadMentionedCount=(v.unreadMentionedCount||I.unreadMentionedCount)+1,R||(v.unreadMentionedMeCount=(v.unreadMentionedMeCount||I.unreadMentionedMeCount)+1),v.hasMentioned=!0,v.mentionedInfo=null==u?void 0:u.mentionedInfo),I.firstUnreadMessage||v.firstUnreadMessageUId||(v.firstUnreadMessageType=p,v.firstUnreadMessageUId=l,v.firstUnreadTime=h)}o.push(e)}));var a=[],s=[];Array.from(i.entries()).forEach((function(e){var t=u(e,2),r=t[0],n=t[1],i=n.params,o=n.time;a.push(r);var l=r.updateAttrs(i,o);l&&s.push({conversation:r.toIReceivedConversation(),updatedItems:l})})),this._chat.storage.updateConversationStorage(a),s.length>0&&this._watcher.conversation(s),this._batchMessage(o)}}),Object.defineProperty(e.prototype,"_handleChatroomMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){this._watcher.batchMessage(t)}}),Object.defineProperty(e.prototype,"_handlerChatroomEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.chatroom(t)}}),Object.defineProperty(e.prototype,"_handleChatMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){this._watcher.batchMessage(r)}}),Object.defineProperty(e.prototype,"_handleSignal",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n,i=t.syncMsg,o=t.topic;if(i)this._receiveSyncMsg(t,r);else switch(Kn(o)){case Jn.rtc_ntf:this._watcher.onRTCDataChange(t.pbData);break;case Jn.s_opNtf:this._pullOperateStatusNotify(t);break;case Jn.s_pubCall:this._pubCallInfo(t);break;case Jn.s_stat:null===(n=this._subscribeManager)||void 0===n||n.updateUserStatus(t)}}}),Object.defineProperty(e.prototype,"_handleSCmdNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n,i,o=t.time;switch(t.type){case 8:null===(r=this._subscribeManager)||void 0===r||r.startsyncSubscribeUserStatus(o);break;case 9:null===(n=this._subscribeManager)||void 0===n||n.startSyncSubscribeRelationship(o);break;case 10:null===(i=this._subscribeManager)||void 0===i||i.syncOwnProfile(!0)}}}),Object.defineProperty(e.prototype,"_receiveMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.content,r=e.channelId,n=void 0===r?"":r,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:n,conversationType:i,targetId:o}}),s&&this._watcher.expansion({deletedExpansion:{messageUId:u,deletedKeys:s,channelId:n,conversationType:i,targetId:o}})}}),Object.defineProperty(e.prototype,"_clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){var o=this._chat.storage.clearConversationUnreadCount({conversationType:e,targetId:t,channelId:r},i);n&&o&&this._watcher.conversation([o])}}),Object.defineProperty(e.prototype,"_updateSGModelCacheAfterSent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.isPersited,i=e.targetId,o=e.channelId,a=e.sentTime,s=e.disableUpdateLastMessage,u=e.messageType,l=e.messageUId,c=e.content;if(te(t,J)){var d=this.naviInfo,f={conversationType:t,targetId:i,channelId:o},_=this._chat.storage.getOrCreateModel(f,!0),p={},h=u===me.RECALL;if(r){h&&!_.hidden||(p.operationTime=a),p.hidden=!1;var g=h?c.sentTime:a;s||_.latestMessage&&!(_.latestMessage.sentTime<=g)||(p.latestMessage=d.supportRecallRefactor&&h?Rc(e,!0):e)}if(this._ctx.includeUg&&u===me.EXPANSION_NOTIFY&&_.latestMessage&&_.latestMessage.messageUId===l){var E=c,b=E.put,I=E.del;E.clear?_.latestMessage.expansion={}:b?_.latestMessage.expansion=n(n({},_.latestMessage.expansion),b):I&&_.latestMessage.expansion&&I.forEach((function(e){delete _.latestMessage.expansion[e]}))}var T=_.updateAttrs(p,e.sentTime);this._chat.storage.updateConversationStorage([_]),T&&this._watcher.conversation([{conversation:_.toIReceivedConversation(),updatedItems:T}])}}}),Object.defineProperty(e.prototype,"_receiveSyncMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;switch(Kn(e.topic)){case Jn.updRTime:this._receivesyncReadStatus(e);break;case Jn.updUserSub:null===(r=this._subscribeManager)||void 0===r||r.startSyncSubscribeRelationship(t.timestamp)}}}),Object.defineProperty(e.prototype,"_batchMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._watcher.batchMessage(e)}}),Object.defineProperty(e.prototype,"_pubCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Dl.decode(Fs,e.pbData),r=t.key,n=t.dataContent,i=t.maxTime;this._latestPullKVMsgTimestamp=i,this._watcher.callInfo(JSON.stringify({list:[{key:r,value:n}]}))}}),Object.defineProperty(e.prototype,"_receivesyncReadStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Dl.decode(Ja,e.pbData),r=t.type,n=t.channelId,i=t.msgTime,o=t.busChannel;this._clearConversationUnreadCount(r,n,o||"",!0,i),this._watcher.syncReadStatus({conversationType:r,targetId:n,channelId:o,timestamp:i})}}),Object.defineProperty(e.prototype,"_syncCallPullKVMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,n;return a(this,(function(i){switch(i.label){case 0:return this._ctx.isConnected?(e=Dl.encode(Bs,{syncTime:this._latestPullKVMsgTimestamp}),[4,this._ctx.query(Jn.pullKvMsg,this.currentUserId,e,Hs)]):[2];case 1:return t=i.sent(),r=t.isOk,n=t.data,r&&n?(this._latestPullKVMsgTimestamp=n.maxTime,this._watcher.callInfo(JSON.stringify({list:n.info})),[2]):[2]}}))}))}}),Object.defineProperty(e.prototype,"getHistoryMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var r,n,i,o,s,u,l,c,d,f,_,p,h,g=this;return a(this,(function(a){switch(a.label){case 0:return r=e.conversationType,n=e.targetId,i=e.channelId,o=t.timestamp,s=t.count,u=t.order,l=tb[r],c=this.currentUserId,d=eh({targetId:n,busChannel:i,time:o||(1===u?1:this._ctx.serverTime+6e4),count:s,order:u}),f=r===exports.ConversationType.CHATROOM?n:c,[4,this._ctx.query(l,f,d,void 0)];case 1:return(_=a.sent()).isOk?(p=th(_.data.pbData),h=p.list.map((function(e){var t=Ec(e,c,!1,n);if(t.messageDirection===exports.MessageDirection.SEND){var r=g._chat.storage.getReadReceiptResponseUsers(t,t.messageUId);t.readReceiptInfo={isReceiptRequestMessage:!0,readerList:r}}return t})),[2,fr({hasMore:!!p.hasMsg,list:0===u?h.reverse():h})]):[2,_.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"reportSDKInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),r=JSON.stringify(e),this.logger.info(B.L_VER_REPORT_T,r,t),n=Dl.encode(Os,{sdkInfo:r}),[4,this._ctx.query(Jn.reportsdk,this._ctx.currentUserId,n)];case 1:return i=o.sent(),this.logger.summary(B.L_VER_REPORT_R,i,t),[2]}}))}))}}),Object.defineProperty(e.prototype,"saveTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(r){return this._chat.storage.setDrafts(e,t),[2,fr()]}))}))}}),Object.defineProperty(e.prototype,"getTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return a(this,(function(r){return t=this._chat.storage.getDrafts(e),[2,fr(t)]}))}))}}),Object.defineProperty(e.prototype,"clearTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return a(this,(function(t){return this._chat.storage.deleteDrafts(e),[2,fr()]}))}))}}),Object.defineProperty(e.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i){return o(this,void 0,void 0,(function(){var r,o,s,u,l,c,d,f,_,p,h,g,E,b,I,T,v,R;return a(this,(function(a){switch(a.label){case 0:return r=e.conversationType,o=e.targetId,t=this._handleInnerMsgOptions(e,t),s=!1,[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP].includes(r)&&(t.isStatusMessage||En(t.messageType).isStatusMessage)&&(s=!0),u=s?function(e){var t;return(t={},t[exports.ConversationType.PRIVATE]=Jn.ppMsgS,t[exports.ConversationType.GROUP]=Jn.pgMsgS,t)[e]}(r):function(e){var t;return(t={},t[exports.ConversationType.PRIVATE]=Jn.ppMsgP,t[exports.ConversationType.GROUP]=Jn.pgMsgP,t[exports.ConversationType.CHATROOM]=Jn.chatMsg,t[exports.ConversationType.CUSTOMER_SERVICE]=Jn.pcMsgP,t[exports.ConversationType.RTC_ROOM]=Jn.prMsgS,t[exports.ConversationType.SYSTEM]=Jn.pbMsgP,t)[e]}(r)||Jn.ppMsgP,t.messageId||(t.messageId=$t()),l=t.messageId,c=sh(e,t),(d=new To(Jn[u],c,r===exports.ConversationType.SYSTEM?this.currentUserId:o)).setHeaderQos(Zn),s?(this._ctx.sendOnly(d),[2,fr(rb(e,n(n({},t),{isStatusMessage:s}),"",0,this.currentUserId,l))]):(f=this._ctx.serverTime,_=rb(e,n(n({},t),{isStatusMessage:s}),"",f,this.currentUserId,l),null==i||i(l),p=Date.now(),[4,this._ctx.send(d)]);case 1:return h=a.sent(),g=h.code,E=h.isOk,b=h.msg,I=h.data,E?(v=(T=I).timestamp,R=T.messageUId,_.sentTime=v,_.messageUId=R,this._sendMessageSuccessHandle(_),this._ctx.checkIfNeedRecordMessageUId(r,R)&&this.logger.record(Te.IM_MSG_SEND,JSON.stringify({msg_id:R,channel:r,start_ts:p,client_ts:Date.now(),server_deltatime:Date.now()-this._ctx.serverTime,cod:g})),[2,fr(_)]):(this._ctx.checkIfNeedRecordMessageUId(r)&&this.logger.record(Te.IM_MSG_SEND,JSON.stringify({channel:r,start_ts:p,client_ts:Date.now(),server_deltatime:Date.now()-this._ctx.serverTime,cod:g})),_.sentStatus=exports.SentStatus.FAILED,[2,_r(g,b,_)])}}))}))}}),Object.defineProperty(e.prototype,"_sendMessageSuccessHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e.conversationType!==exports.ConversationType.CHATROOM&&this._chat.storage.addSentRecord(e.messageUId,e.sentTime),this._updateSGModelCacheAfterSent(e);var t=e.messageType;t===me.READ_RECEIPT_REQUEST&&this._chat.storage.addReadReceiptRequest(e,this.currentUserId),t===me.READ_RECEIPT_RESPONSE&&this._chat.storage.handleReadReceiptResponse(e,this.currentUserId)}}),Object.defineProperty(e.prototype,"recallMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,s,u,l,c,d,f,_,p,h,g,E,b,I,T,v,R,m;return a(this,(function(a){switch(a.label){case 0:return r=e.targetId,n=e.conversationType,i=e.channelId||"",o=t.user,s=t.extra,u=t.isDelete,l=t.directionalUserIdList,c=t.disableUpdateLastMessage,d=t.messageUId,f=t.sentTime,_=t.disableNotification,p=t.pushConfig,h=t.pushContent,g=t.isAdmin,E={conversationType:n,targetId:r,messageUId:d,sentTime:f,channelId:i,isDelete:!!u,isAdmin:!!g},o&&(E.user=o),s&&(E.extra=s),b={content:E,messageType:me.RECALL,disableNotification:_,pushConfig:p,pushContent:(null==p?void 0:p.pushContent)||h,disableUpdateLastMessage:c,directionalUserIdList:or(n,l)},I=sh(e,b),(T=new To(Jn.recallMsg,I,this.currentUserId)).setHeaderQos(Zn),[4,this._ctx.send(T)];case 1:return(v=a.sent()).isOk?(R=v.data,n!==exports.ConversationType.ULTRA_GROUP&&(R.messageUId="Cmd:".concat(d)),m=rb(e,b,R.messageUId,R.timestamp,this.currentUserId),n===exports.ConversationType.ULTRA_GROUP?(this._chat.storage.addUGSentRecord(R.messageUId,R.timestamp),this._updateUltraGroupWhenRecallMsg(m)):(this._chat.storage.addSentRecord(R.messageUId,R.timestamp),this._updateSGModelCacheAfterSent(m)),[2,fr(m)]):[2,v.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"_naviChangeHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._ctx.navi.updateVoipCallInfo(this._ctx.currentToken,t);var r=this._ctx.getNaviInfoFromCache();this._watcher.onNaviDataChange(n({},r))}}),Object.defineProperty(e.prototype,"getFileToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,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 o=i&&"uploads"!==i?t||"":Kt(e,t),l=this.naviInfo,c=nr(l,this.logger),d="",c||(d=JSON.stringify({uploadDomain:c})),f=Dl.encode(Oa,{type:e,key:o,httpMethod:r||"",queryString:i||"",url:s||"",ext:d,size:u?Math.ceil(u):0,ipType:l.ipType||0}),[4,this._ctx.query(Jn.qnTkn,this.currentUserId,f,Ca)];case 1:return[2,a.sent().trans((function(e){return n(n({},e),{fileName:o,downloadAuthInfo:e.downloadAuthInfo?JSON.parse(e.downloadAuthInfo):null})}))]}}))}))}}),Object.defineProperty(e.prototype,"getFileUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){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.naviInfo,s="",u="",t===exports.UploadMethod.QINIU?o=Jn.qnUrl:t===exports.UploadMethod.AWS?o=Jn.s3Url:t===exports.UploadMethod.STC?o=Jn.stcUrl:t===exports.UploadMethod.MINIO?(o=Jn.minioUrl,s=nr(i,this.logger),u=JSON.stringify({url:s})):o=Jn.aliUrl,l=Dl.encode(Sa,{type:e,key:r,fileName:n,ext:u,size:-1,ipType:i.ipType||0}),[4,this._ctx.query(o,this.currentUserId,l,Na)];case 1:return[2,a.sent().trans((function(e){return{downloadUrl:e.downloadUrl}}))]}}))}))}}),Object.defineProperty(e.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(r){switch(r.label){case 0:return[4,this._ctx.disconnect(e,t)];case 1:return r.sent(),this._resetMemoryState(),[2,fr()]}}))}))}}),Object.defineProperty(e.prototype,"_resetMemoryState",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._subscribeManager&&delete this._subscribeManager}}),Object.defineProperty(e.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){}}),Object.defineProperty(e.prototype,"serverTime",{get:function(){return this._ctx.serverTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userId",{get:function(){return this._ctx.currentUserId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentUserId",{get:function(){return this._ctx.currentUserId},enumerable:!1,configurable:!0}),Object.defineProperty(e.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,_r(exports.ErrorCode.TAG_EXISTS)]:[2,this._userSettings.createTag(e)]}))}))}}),Object.defineProperty(e.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,_r(exports.ErrorCode.TAG_NOT_EXIST)]}))}))}}),Object.defineProperty(e.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,_r(exports.ErrorCode.TAG_NOT_EXIST)]}))}))}}),Object.defineProperty(e.prototype,"getTagList",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;return o(this,void 0,void 0,(function(){var t,r,n,i;return a(this,(function(o){for(i in t=this._userSettings.getTags(),r=this._chat.storage.getTagConversationCountMap(),n=[],t)n.push({tagId:i,tagName:t[i].tagName,createdTime:t[i].createdTime,conversationCount:(null===(e=r.get(i))||void 0===e?void 0:e.length)||0});return[2,fr(n)]}))}))}}),Object.defineProperty(e.prototype,"sendUltraMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i){return o(this,void 0,void 0,(function(){var r,o,s,u,l,c,d,f,_,p,h,g,E,b,I;return a(this,(function(a){switch(a.label){case 0:return r=e.targetId,t.messageId||(t.messageId=$t()),o=t.messageId,s=sh(e,t),(u=new To(Jn.ugMsg,s,r)).setHeaderQos(Zn),l=this._ctx.serverTime,c=rb(e,n({},t),"",l,this.currentUserId,o),i&&i(o),d=Date.now(),[4,this._ctx.send(u)];case 1:return f=a.sent(),_=f.code,p=f.data,_!==exports.ErrorCode.SUCCESS?(this._ctx.checkIfNeedRecordMessageUId(exports.ConversationType.ULTRA_GROUP)&&this.logger.record(Te.IM_MSG_SEND,JSON.stringify({channel:exports.ConversationType.ULTRA_GROUP,start_ts:d,client_ts:Date.now(),server_deltatime:Date.now()-this._ctx.serverTime,cod:_})),c.sentStatus=exports.SentStatus.FAILED,[2,_r(_,void 0,c)]):(g=(h=p).timestamp,E=h.messageUId,c.sentTime=g,c.messageUId=E,this._ctx.checkIfNeedRecordMessageUId(exports.ConversationType.ULTRA_GROUP,E)&&this.logger.record(Te.IM_MSG_SEND,JSON.stringify({msg_id:E,channel:exports.ConversationType.ULTRA_GROUP,start_ts:d,client_ts:Date.now(),server_deltatime:Date.now()-this._ctx.serverTime,cod:_})),this._chat.storage.addUGSentRecord(E,g),b=this._chat.storage.getOrCreateModel(e,!0),(I=b.updateAttrs({operationTime:g,latestMessage:n({},c)},g))&&this._watcher.conversation([{conversation:b.toIReceivedConversation(),updatedItems:I}]),[2,fr(c)])}}))}))}}),Object.defineProperty(e.prototype,"_pullOperateStatusNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._ctx.isConnected){var t=function(e){var t=e,r=t.type,n=t.notifyType,i=t.info,o=t.summary,a=[],s=[],u=!(2&~n),l=!(1&~n);return l&&Array.isArray(i)&&i.forEach((function(e){var t=e,r=t.targetId,n=t.busChannel,i=t.userId,o=t.opType,s=t.optime;a.push({targetId:r,channelId:n,userId:i,operationType:o,operationTime:s})})),u&&Array.isArray(o)&&o.forEach((function(e){var t=e,r=t.targetId,n=t.busChannel,i=t.count,o=t.opType;s.push({targetId:r,channelId:n,count:i,operationType:o})})),{conversationType:r,info:a,summary:s,hasInfo:l,hasSummary:u}}(Dl.decode(Gs,e.pbData));this._watcher.operateStatus(t)}}}),Object.defineProperty(e.prototype,"_handleConvertEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n=[];e.filter((function(e){return 0===e.subChangeType})).forEach((function(e){var t=Dl.decode(Hu,new Uint8Array(e.eventData)).results;n.push.apply(n,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===exports.ErrorCode.SUCCESS?On.SUCCESS:On.FAILED}}}))),!1))})),n.length&&(null===(r=(t=this._watcher).translateResponse)||void 0===r||r.call(t,n))}}),Object.defineProperty(e.prototype,"_handleEventChangeList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={Group:{map:{},types:nb},Friend:{map:{},types:ib}},r=function(e,t,r){e[t]||(e[t]=[]),e[t].push(r)};e.forEach((function(e){var n=e.changeType;for(var i in t)if(t[i].types.includes(n)){r(t[i].map,n,e);break}}));var n={Group:this._processChangeMapGroup.bind(this),Friend:this._processChangeMapFriend.bind(this)};for(var i in t)Object.keys(t[i].map).length>0&&n[i](t[i].map)}}),Object.defineProperty(e.prototype,"_processChangeMapGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=P.GROUP_OPERATION,r=P.GROUP_PROFILE_CHANGE,n=P.GROUP_FOLLOW_USER_CHANGE;e[t]&&this._handleGroupOperation(e[t]),e[r]&&this._handleGroupProfileChange(e[r]),e[n]&&this._handleFollowUserChange(e[n])}}),Object.defineProperty(e.prototype,"_processChangeMapFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;(e[b.FRIEND_APPLICATION]||[]).forEach((function(e){var r,n,i,o,a,s,u,l,c,d,f=e.subChangeType,_=e.businessId,p=e.time,h=e.eventData,g=I.FRIEND_APPLY,E=I.FRIEND_REFUSE,b=I.FRIEND_USER_INFO,T=I.FRIENDS_INPUT,v=I.FRIEND_CLEAR,R=I.FRIEND_INFO_CHANGE,m=I.FRIEND_INFO_CHANGE_SYNC;switch(f){case g:case E:var y=f===g?exports.FriendApplicationStatus.UNHANDLED:exports.FriendApplicationStatus.REFUSED;null===(n=(r=t._watcher).friendApplicationStatusChanged)||void 0===n||n.call(r,{userId:_,applicationType:h.applyType,applicationStatus:y,directionType:h.friendType,operationTime:p,extra:h.info||""});break;case b:null===(o=(i=t._watcher).friendAdd)||void 0===o||o.call(i,{userId:_,name:h.name,portraitUri:h.portraitUrl,directionType:h.friendType,operationTime:p});break;case T:null===(s=(a=t._watcher).friendDelete)||void 0===s||s.call(a,{userIds:h.targetId,directionType:h.type,operationTime:p});break;case v:null===(l=(u=t._watcher).friendCleared)||void 0===l||l.call(u,p);break;case R:break;case m:null===(d=(c=t._watcher).friendInfoChangedSync)||void 0===d||d.call(c,{userId:_,remark:h.remarkname,extProfile:h.extProfile,operationTime:p})}}))}}),Object.defineProperty(e.prototype,"_handleGroupOperation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var r,n,i,o,a=e.subChangeType,s=e.businessId,l=e.time,c=e.eventData,d=c.optUserInfo,f=c.channelInfo,_=c.userInfos,p={groupId:s,operation:a,operationTime:l};d&&(r=u(kt([d]),1),p.operatorInfo=r[0]),a===exports.GroupOperation.CREATE&&(n=u(function(e){return void 0===e&&(e=[]),e.map((function(e){var t,r,n,i,o,a,s,u,l,c=Ft(e.settingProfile)||{},d=e.extProfile||[],f=e.targetId,_=e.baseInfo,p=e.userInfo;return{groupId:f,groupName:null!==(t=c.name)&&void 0!==t?t:"",portraitUri:null!==(r=c.portraitUrl)&&void 0!==r?r:"",introduction:null!==(n=c.introduction)&&void 0!==n?n:"",notice:null!==(i=c.announcement)&&void 0!==i?i:"",extProfile:Ft(d),joinPermission:~~c.joinPerm,removeMemberPermission:~~c.removePerm,invitePermission:~~c.memInvitePerm,inviteHandlePermission:~~c.invitePerm,groupInfoEditPermission:~~c.profilePerm,memberInfoEditPermission:~~c.memProfilePerm,creatorId:null!==(o=null==_?void 0:_.creatorId)&&void 0!==o?o:"",ownerId:null!==(a=null==_?void 0:_.ownerId)&&void 0!==a?a:"",createTime:(null==_?void 0:_.createTime)||0,membersCount:null!==(s=null==_?void 0:_.memberCount)&&void 0!==s?s:0,remark:null!==(u=null==p?void 0:p.remarkName)&&void 0!==u?u:"",joinedTime:(null==p?void 0:p.joinTime)||0,role:null!==(l=null==p?void 0:p.role)&&void 0!==l?l:exports.GroupMemberRole.UNDEF}}))}([f]),1),p.groupInfo=n[0]),[exports.GroupOperation.CREATE,exports.GroupOperation.DISMISS].includes(a)||(p.memberInfos=kt(_)),null===(o=(i=t._watcher).groupOperation)||void 0===o||o.call(i,p)}))}}),Object.defineProperty(e.prototype,"_handleGroupProfileChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var r,n,i,o,a,s,l=e.businessId,c=e.time,d=e.eventData,f=e.subChangeType,_=e.secondaryId;switch(f){case O.GROUP_INFO_CHANGE:var p=u(kt([d.optUserInfo]),1)[0],h=u(Gt([d.channelInfo]),1)[0],g=u(d.channelFullInfo?Gt([d.channelFullInfo]):[void 0],1)[0];null===(n=(r=t._watcher).groupInfoChanged)||void 0===n||n.call(r,{operatorInfo:p,groupInfo:h,changedGroupInfo:h,operationTime:c,fullGroupInfo:g});break;case O.MEMBER_PROFILE_CHANGE:p=u(kt([d.optUserInfo]),1)[0];var E=kt(d.userInfos)[0];null===(o=(i=t._watcher).groupMemberInfoChanged)||void 0===o||o.call(i,{groupId:l,operatorInfo:p,memberInfo:E,operationTime:c});break;case O.GROUP_REMARK_DELETE:case O.GROUP_REMARK_SET:var b=f===O.GROUP_REMARK_SET?exports.GroupOperationType.ADD:exports.GroupOperationType.REMOVE;null===(s=(a=t._watcher).groupRemarkChangedSync)||void 0===s||s.call(a,{groupId:l,operationType:b,operationTime:c,groupRemark:_})}}))}}),Object.defineProperty(e.prototype,"_handleFollowUserChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var r,n,i=e.subChangeType,o=e.businessId,a=e.time,s=e.userGroupIds,u=1===i?exports.GroupOperationType.ADD:exports.GroupOperationType.REMOVE;null===(n=(r=t._watcher).groupFollowsChangedSync)||void 0===n||n.call(r,{groupId:o,operationType:u,operationTime:a,userIds:s})}))}}),Object.defineProperty(e.prototype,"_handleUltraChannelChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,n=[],i=[],o=[];t.forEach((function(e){var t=e.subChangeType,a=e.targetId;e.msgTime;var s=e.operatorId,u=e.busChannelType,l=e.time,c=e.busChannel||"",d={conversationType:exports.ConversationType.ULTRA_GROUP,targetId:a,channelId:c},f=r._chat.storage.getModel(d);switch(t){case oe.PRIVATE_TO_PUBLIC:null==f||f.updateAttrs({channelType:exports.UltraGroupChannelType.PUBLIC}),n.push({targetId:a,channelId:c,changeType:exports.UltraGroupChannelChangeType.PRIVATE_TO_PUBLIC,channelType:exports.UltraGroupChannelType.PUBLIC});break;case oe.PUBLIC_TO_PRIVATE:null==f||f.updateAttrs({channelType:exports.UltraGroupChannelType.PRIVATE}),n.push({targetId:a,channelId:c,changeType:exports.UltraGroupChannelChangeType.PUBLIC_TO_PRIVATE,channelType:exports.UltraGroupChannelType.PRIVATE});break;case oe.PUBLIC_TO_PRIVATE_USER_NOT_IN:f&&r._chat.storage.removeConversation(f),n.push({targetId:a,channelId:c,changeType:exports.UltraGroupChannelChangeType.PUBLIC_TO_PRIVATE_USER_NOT_IN,channelType:u});break;case oe.CHANNEL_DELETE:f&&r._chat.storage.removeConversation(f),i.push({targetId:a,channelId:c,channelType:u,deleteTime:l});break;case oe.CHANNEL_USER_KICKED:o.push({targetId:a,channelId:c,userId:s,channelType:exports.UltraGroupChannelType.PRIVATE}),s===r.currentUserId&&f&&r._chat.storage.removeConversation(f);case oe.PRIVATE_CHANNEL_USER_JOIN_PUBLIC:}})),n.length>0&&this._watcher.ultraGroupChannelChangeType(n),i.length>0&&this._watcher.ultraGroupChannelDelete(i),o.length>0&&this._watcher.ultraGroupChannelUserKicked(o)}}),Object.defineProperty(e.prototype,"_handleUserGroupStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var e,r,n,i,o,s;return a(this,(function(a){return e=[],r=[],n=[],i=[],o=[],t.forEach((function(t){var a=t.type,s=t.targetId,u=t.busChannelType,l=t.busChannel,c=t.userGroupIds;switch(t.subChangeType){case ae.REMOVE_USER_GROUP:e.push({conversation:{conversationType:a,targetId:s},userGroupIds:c});break;case ae.JOIN_USER_GROUP:r.push({conversation:{conversationType:a,targetId:s},userGroupIds:c});break;case ae.EXIT_USER_GROUP:n.push({conversation:{conversationType:a,targetId:s},userGroupIds:c});break;case ae.CHANNEL_BIND_USER_GROUP:i.push({conversation:{conversationType:a,targetId:s,channelId:l},channelType:u,userGroupIds:c});break;case ae.CHANNEL_UNBIND_USER_GROUP:o.push({conversation:{conversationType:a,targetId:s,channelId:l},channelType:u,userGroupIds:c})}})),s={},e.length>0&&(s.userGroupDisband=e),r.length>0&&(s.userAdded=r),n.length>0&&(s.userRemoved=n),i.length>0&&(s.userGroupBindChannel=i),o.length>0&&(s.userGroupUnBindChannel=o),this._watcher.userGroupStatus(s),[2]}))}))}}),Object.defineProperty(e.prototype,"_updateUltraGroupWhenRecallMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._chat.storage.getModel(e);if(r){var n={},i=e.content,o=i.messageUId,a=i.sentTime,s=r.latestMessage;s&&s.messageUId===o&&(n.latestMessage=Rc(e,!0)),a&&r.lastReadTime<a&&r.unreadCount&&(n.unreadCount=r.unreadCount-1,t!==se.ALL&&t!==se.ME||!r.unreadMentionedCount||(n.unreadMentionedCount=r.unreadMentionedCount-1),t===se.ME&&r.unreadMentionedCount&&(n.unreadMentionedMeCount=r.unreadMentionedMeCount-1));var u=r.updateAttrs(n,e.sentTime);this._chat.storage.updateConversationStorage([r]),u&&this._watcher.conversation([{conversation:r.toIReceivedConversation(),updatedItems:u}])}}}),Object.defineProperty(e.prototype,"subscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return a(this,(function(n){return[2,this._subscribeManager.updateSubscribeRelation(e,t,exports.SubscribeOperationType.SUBSCRIBE,r)]}))}))}}),Object.defineProperty(e.prototype,"unSubscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(r){switch(r.label){case 0:return[4,this._subscribeManager.updateSubscribeRelation(e,t,exports.SubscribeOperationType.UNSUBSCRIBE)];case 1:return[2,r.sent()]}}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n;return o(this,void 0,void 0,(function(){var i;return a(this,(function(o){return i=null===(n=this._subscribeManager)||void 0===n?void 0:n.getSubscribeUserList(e,t,r),[2,fr(i)]}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;return o(this,void 0,void 0,(function(){var n;return a(this,(function(i){return n=null===(r=this._subscribeManager)||void 0===r?void 0:r.getSubscribeUserStatus(e,t),[2,fr(n||[])]}))}))}}),Object.defineProperty(e.prototype,"updateMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var r,n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return r=Dl.encode(nu,c(this,VE,"m",qE).call(this,e)),[4,this._ctx.query(Jn.updUserProfile,this.currentUserId,r,void 0)];case 1:return(n=a.sent()).data?(i=Dl.decode(iu,n.data.pbData),n.isOk?(o=i.version,null===(t=this._subscribeManager)||void 0===t||t.updateOwnProfile(e,o),[2,n.wipe()]):(s=i.censorFailedFields,[2,_r(n.code,"",s&&0!==s.length?{errorKeys:s,errorKey:s[0]}:void 0)])):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subscribeManager.getOwnProfile()}}),Object.defineProperty(e.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[2,this._subscribeManager.getUserProfiles(e)]}))}))}}),Object.defineProperty(e.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){return a(this,(function(i){switch(i.label){case 0:return r?[3,2]:[4,this._ctx.send(new To(t,n,e))];case 1:return[2,i.sent().wipe()];case 2:return[4,this._ctx.query(t,e,n,void 0)];case 3:return[2,i.sent().trans((function(e){return e.pbData}))]}}))}))}}),Object.defineProperty(e.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o;return a(this,(function(a){switch(a.label){case 0:return n=Xl(t,r),[4,this.rtcSignaling(e,Jn[Jn.rtcPing],!0,n)];case 1:return(i=a.sent()).isOk?(o=Dl.decode(ol,i.data),[2,fr(o)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"deviceId",{get:function(){return this._ctx.appStorage.deviceId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"setPushConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._ctx.appStorage.setCustomDeviceId(e.deviceId),this._ctx.appStorage.setPackageName(e.packageName)}}),Object.defineProperty(e.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(r){switch(r.label){case 0:return Pc?(xc&&(clearTimeout(xc),xc=null),[4,Pc]):[2];case 1:return(e=r.sent())&&(t=e.db,jc.push(t)),Pc=null,[2]}}))}))}}),Object.defineProperty(e.prototype,"setNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._ctx.handleNetworkChange(e,t)}}),Object.defineProperty(e.prototype,"setCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i;return a(this,(function(o){switch(o.label){case 0:return n=Dl.encode(js,{key:t,dataContent:r}),[4,this._ctx.query(Jn.reqCall,e,n,js)];case 1:return(i=o.sent()).isOk?[2,i.trans((function(e){return{key:e.key,value:e.dataContent}}))]:[2,i.wipe()]}}))}))}}),Object.defineProperty(e.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(r){switch(r.label){case 0:return t=Dl.encode(wu,e),[4,this._ctx.query(Jn.addUnpush,this.currentUserId,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(e.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=Dl.encode(Uu,{nothing:0}),[4,this._ctx.query(Jn.delUnpush,this.currentUserId,e)];case 1:return[2,t.sent().wipe()]}}))}))}}),Object.defineProperty(e.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=Dl.encode(Du,{nothing:0}),[4,this._ctx.query(Jn.qryUnpush,this.currentUserId,e,xu)];case 1:return[2,t.sent().trans((function(e){var t=e.isUnpush,r=e.spanMinutes,n=e.startTime,i=e.level,o=e.timezone;return t?{spanMinutes:r,startTime:n,level:i,timezone:o}:{spanMinutes:0,startTime:"",level:exports.PushNotificationQuietHoursLevel.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT}}))]}}))}))}}),Object.defineProperty(e.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,fr(Hr.getStatsUrlList(this.naviInfo))]}))}))}}),Object.defineProperty(e.prototype,"translateWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){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===n?e[0].identifier:this.currentUserId,o=this.userSettings.storage.get("value").transLan,s=[],u=[],e.forEach((function(e){var t=e.sourceLanguage,r=e.content,i=e.targetLanguage||o;t!==i?r?s.push({messageUID:e.identifier,sourceLan:e.sourceLanguage,targetLan:e.targetLanguage||o,text:e.content,inputSource:n,transType:1}):u.push({identifier:e.identifier,from:n,code:exports.ErrorCode.TRANSLATION_TEXT_INVALID,translateInfo:{targetLanguage:i,translatedText:"",status:On.NONE}}):u.push({identifier:e.identifier,from:n,code:exports.ErrorCode.TRANSLATION_LANGUAGE_SAME,translateInfo:{targetLanguage:i,translatedText:"",status:On.NONE}})})),0!==s.length?[3,1]:(l=fr(),[3,3]);case 1:return c=Dl.encode(Vu,{businessType:3,businessInfo:Dl.encode(Bu,{forceTrans:r,transInfos:s,model:t})}),[4,this._ctx.query(Jn.upConvertMsg,i,c,ku)];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]}}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUsersOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i;return a(this,(function(o){switch(o.label){case 0:return this._subscribeManager?(t=[],r=new Set,this._subscribeManager.getSubscribeUserStatus(exports.SubscribeType.ONLINE_STATUS,e).forEach((function(e){var n=e.userId,i=e.details,o=(void 0===i?[]:i).map((function(e){return{platform:e.platform,isOnline:!!e.eventValue,updateTime:e.changeTime}})),a=o.some((function(e){return e.isOnline})),s={userId:n,isOnline:a,details:o};t.push(s),r.add(n)})),0===(n=e.filter((function(e){return!r.has(e)}))).length?[2,fr(t)]:[4,c(this,VE,"m",KE).call(this,exports.SubscribeType.FRIEND_ONLINE_STATUS,n)]):[2,fr([])];case 1:return(i=o.sent()).isOk?(i.data.list.forEach((function(e){var r,n=e.subUserId,i=e.data.map((function(e){return{platform:e.platformInfo,isOnline:!!e.value,updateTime:e.versionTime}})),o=i.some((function(e){return e.isOnline}));t.push((r={userId:n,isOnline:o,details:i},[exports.Platform.iOS,exports.Platform.Android,exports.Platform.Web,exports.Platform.PC,exports.Platform.Mini,exports.Platform.HarmonyOS].forEach((function(e){r.details.some((function(t){return t.platform===e}))||r.details.push({platform:e,isOnline:!1,updateTime:0})})),r))})),[2,fr(t)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getAllRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,this._ctx.getAllRobots(!1)]}))}))}}),Object.defineProperty(e.prototype,"getMessagesByUIds",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,s,u,l,c,d,f;return a(this,(function(a){switch(a.label){case 0:return r=e.targetId,n=e.conversationType,i=e.channelId,o=Dl.encode(Us,{targetId:r,type:n,query:t.map((function(e){return{msgTime:0,msgUID:e,busChannel:i}}))}),[4,this._ctx.query(Jn.qryMsg,this._ctx.currentUserId,o,Ds)];case 1:return(s=a.sent()).isOk?(u=s.data,l=u.list,c=u.notExistMsgId,d=this.currentUserId,f=t.map((function(e){var t=l.findIndex((function(t){return t.msgId===e}));if(-1!==t){var n=l.splice(t,1)[0];return{message:Ec(n,d,!1,r),messageUId:n.msgId,code:exports.ErrorCode.SUCCESS}}return c.includes(e)?{messageUId:e,code:exports.ErrorCode.RC_DB_DATA_NOT_FOUND}:{messageUId:e,code:exports.ErrorCode.SERVER_DATA_ERROR}})),[2,fr(f)]):[2,s.wipe()]}}))}))}}),e}();VE=new WeakSet,jE=function(e,t,r,n,i){this._watcher.robotsSynced(t,n)},kE=function(e,t){this._watcher.readReceiptResponseV5(t)},FE=function(e,t){this._watcher.speechToTextResponse(t)},BE=function(e,t){this._watcher.messagesModified(t)},HE=function(e){this._watcher.messageModifiedSyncCompleted()},YE=function(e,t){this._watcher.ultraGroupMessageExpansionUpdated(t)},WE=function(e,t){this._watcher.ultraGroupMessageRecalled(t)},JE=function(e,t,r){var n=this;t!==Sh?t!==Nh?this._handleEventChangeList(this._codec.formatEventChangeList(r)):this._handleConvertEvent(r):r.forEach((function(e){Dl.decode(Lu,new Uint8Array(e.eventData)).statusInfo.forEach((function(e){var t,r,i=Ht(e);null===(r=(t=n._watcher).groupApplicationEvent)||void 0===r||r.call(t,i)}))}))},qE=function(e){var t={},r=e.extraProfile;return r&&(delete e.extraProfile,t.userExtProfile=Pp(r)),t.userProfile=Pp(e),t},KE=function(e,t){return o(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return r=Dl.encode(ru,{subType:e,subUsers:t.map((function(e){return{subUserId:e}}))}),[4,this._ctx.query(Jn.qrySubData,this.currentUserId,r,eu)];case 1:return[2,n.sent()]}}))}))};var ab=function(){function e(e){QE.set(this,void 0),d(this,QE,e,"f")}return Object.defineProperty(e.prototype,"isSpeechToTextEnabled",{get:function(){return!!(1&(c(this,QE,"f").AIBusinessSub||0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isConversationListIncludeUltraGroup",{get:function(){return xg(c(this,QE,"f"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"messageModifiableMinutes",{get:function(){return c(this,QE,"f").msgModifyMinute||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"readReceiptVersion",{get:function(){return e=(e=c(this,QE,"f").grpRRVer)||0,Object.values(Ve).includes(e)?e:Ve.UNKNOWN;var e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isServerSaveUnreadEnabled",{get:function(){return 1===c(this,QE,"f").serverSaveUnread},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"messageSizeLimit",{get:function(){return c(this,QE,"f").msgMaxLengthV2||0},enumerable:!1,configurable:!0}),e}();QE=new WeakMap;var sb,ub,lb,cb,db,fb,_b,pb=function(){function e(e){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.ctx=e,this.logger=e.logger}return Object.defineProperty(e.prototype,"validateConnected",{get:function(){var e=this;return function(){return e.checkAuthed(!1)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"validateLogin",{get:function(){var e=this;return function(){return e.checkAuthed(!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"checkAuthed",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.ctx.connectionStatus===exports.RCConnectionStatus.CONNECTED||this.ctx.userId&&e?fr(this.ctx.naviInfo):_r(exports.ErrorCode.RC_NET_UNAVAILABLE)}}),e}(),hb=function(e){function r(t,r){var n=e.call(this,t)||this;return Object.defineProperty(n,"svr",{enumerable:!0,configurable:!0,writable:!0,value:r}),n}return t(r,e),Object.defineProperty(r.prototype,"joinChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return i=this.logger.createTraceId(),this.logger.info(B.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t,extra:n,createIfNotExist:r}),i),[4,pr.create("joinChatroom").validate("chatroomId",e,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isNumber("count",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isString("extra",n).fail(exports.ErrorCode.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).next((function(){var i=Math.max(Math.min(t,50),-1)||10;return s.svr.joinChatroom(e,i,r,n)}))];case 1:return o=a.sent(),this.logger.summary(B.A_JOIN_CHATROOM_R,o,i),[2,o]}}))}))}}),Object.defineProperty(r.prototype,"quitChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_QUIT_CHATROOM_T,JSON.stringify({roomId:e}),r),[4,pr.create("quitChatroom").validate("roomId",e,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isString("extra",t).fail(exports.ErrorCode.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).next((function(){return i.svr.quitChatroom(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_QUIT_CHATROOM_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getChatroomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_CHATROOM_INFO_T,JSON.stringify({roomId:e,count:t,order:r}),n),[4,pr.create("getChatroomInfo").validate("roomId",e,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isLimitedInteger("count",t,0,20).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("order",r,0,2).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).result().tryTrans(this.validateConnected).next((function(){return o.svr.getChatroomInfo(e,t||0,r||1)}))];case 1:return i=a.sent(),this.logger.summary(B.A_GET_CHATROOM_INFO_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"setChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SET_CHATROOM_ENTRY_T,JSON.stringify({roomId:e,entry:t,isForce:r}),n),[4,pr.create("setChatroomEntry").validate("roomId",e,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("key",null==t?void 0:t.key,Zt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEY).validate("value",null==t?void 0:t.value,zt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_VALUE).isLimitedString("notificationExtra",null==t?void 0:t.notificationExtra,0,2048).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_EXTRA).isBoolean("isAutoDelete",null==t?void 0:t.isAutoDelete).fail(exports.ErrorCode.INVALID_PARAMETER_IS_AUTO_DELETE).isBoolean("isSendNotification",null==t?void 0:t.isSendNotification).fail(exports.ErrorCode.INVALID_PARAMETER_IS_SEND_NOTIFICATION).result().tryTrans(this.validateConnected).next((function(){return o.svr.setChatroomEntry(e,t,r)}))];case 1:return i=a.sent(),this.logger.summary(B.A_SET_CHATROOM_ENTRY_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"setChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SET_CHATROOM_ENTRIES_T,JSON.stringify({roomId:e,entryOptions:t}),r),[4,pr.create("setChatroomEntries").validate("roomId",e,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isTypedArray("entries",null==t?void 0:t.entries,(function(e){return Zt(null==e?void 0:e.key)&&zt(null==e?void 0:e.value)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_ENTRIES).isLimitedArray("entryOptions.entries",null==t?void 0:t.entries,10,!0).fail(exports.ErrorCode.CHATROOM_KV_STORE_OUT_LIMIT).isBoolean("entryOptions.isForce",null==t?void 0:t.isForce).fail(exports.ErrorCode.INVALID_PARAMETER_IS_FORCE).isBoolean("entryOptions.isAutoDelete",null==t?void 0:t.isAutoDelete).fail(exports.ErrorCode.INVALID_PARAMETER_IS_AUTO_DELETE).result().tryTrans(this.validateConnected).next((function(){return i.svr.setChatroomEntries(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_SET_CHATROOM_ENTRIES_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"removeChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_CHATROOM_ENTRY_T,JSON.stringify({roomId:e,entry:t,isForce:r}),n),[4,pr.create("removeChatroomEntry").validate("roomId",e,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("entry.key",null==t?void 0:t.key,Zt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEY).isBoolean("entry.isSendNotification",null==t?void 0:t.isSendNotification).fail(exports.ErrorCode.INVALID_PARAMETER_IS_SEND_NOTIFICATION).isLimitedString("entry.notificationExtra",null==t?void 0:t.notificationExtra,0,2048).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_EXTRA).result().tryTrans(this.validateConnected).next((function(){return o.svr.removeChatroomEntry(e,t,r)}))];case 1:return i=a.sent(),this.logger.summary(B.A_REMOVE_CHATROOM_ENTRY_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"removeChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_CHATROOM_ENTRIES_T,JSON.stringify({roomId:e,entryOptions:t}),r),[4,pr.create("removeChatroomEntries").validate("roomId",e,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isLimitedTypedArray("keys",null==t?void 0:t.keys,10,Zt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEYS).isLimitedString("notificationExtra",null==t?void 0:t.notificationExtra,0,2048).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_EXTRA).result().tryTrans(this.validateConnected).next((function(){return i.svr.removeChatroomEntries(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_REMOVE_CHATROOM_ENTRIES_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_CHATROOM_ENTRY_T,JSON.stringify({roomId:e,key:t}),r),[4,pr.create("getChatroomEntry").validate("roomId",e,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("key",t,Zt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEY).result().tryTrans(this.validateConnected).next((function(){return i.svr.getChatroomEntry(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_GET_CHATROOM_ENTRY_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getAllChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_CHATROOM_ENTRIES_T,JSON.stringify({roomId:e}),t),[4,pr.create("getAllChatroomEntries").validate("roomId",e,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateConnected).next((function(){return n.svr.getAllChatroomEntries(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_GET_CHATROOM_ENTRIES_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"getChatroomHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return i=this.logger.createTraceId(),this.logger.info(B.A_GET_CHATROOM_HISTORY_MESSAGES_T,JSON.stringify({roomId:e,count:t,order:r,timestamp:n}),i),[4,pr.create("getChatroomHistoryMessages").validate("roomId",e,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isLimitedInteger("count",t,1,100).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("order",r,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isTimestamp("timestamp",n).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){return s.svr.getChatroomHistoryMessages(e,n||0,t||20,r||0)}))];case 1:return o=a.sent(),this.logger.summary(B.A_GET_CHATROOM_HISTORY_MESSAGES_R,o,i),[2,o]}}))}))}}),Object.defineProperty(r.prototype,"setCheckChatRoomDuplicateMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.svr.setCheckChatRoomDuplicateMessage(e)}}),Object.defineProperty(r.prototype,"bindRTCRoomForChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_BIND_RTC_FOR_CHATROOM_T,JSON.stringify({option:e}),t),[4,pr.create("bindRTCRoomForChatroom").validate("chatRoomId",null==e?void 0:e.chatRoomId,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("rtcRoomId",null==e?void 0:e.rtcRoomId,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateConnected).next((function(){return n.svr.bindRTCRoomForChatroom(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_BIND_RTC_FOR_CHATROOM_R,r,t),[2,r]}}))}))}}),r}(pb),gb=function(e){e.groupId;var t=e.groupName,r=e.portraitUri,n=e.introduction,i=e.notice;e.extProfile;var o=e.joinPermission,a=e.removeMemberPermission,s=e.invitePermission,u=e.inviteHandlePermission,l=e.groupInfoEditPermission,c=e.memberInfoEditPermission;return JSON.parse(JSON.stringify({name:t,portraitUrl:r,introduction:n,announcement:i,joinPerm:o,removePerm:a,memInvitePerm:s,invitePerm:u,profilePerm:l,memProfilePerm:c}))},Eb=function(e){var t,r,n;return{removeMuteStatus:!(null!==(t=null==e?void 0:e.removeMuteStatus)&&void 0!==t&&!t),removeWhiteList:!(null!==(r=null==e?void 0:e.removeWhiteList)&&void 0!==r&&!r),removeFollow:!(null!==(n=null==e?void 0:e.removeFollow)&&void 0!==n&&!n)}},bb=function(e,t,r){return e.validate("groupId",null==t?void 0:t.groupId,Mt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedString("groupName",null==t?void 0:t.groupName,1,64,r).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_NAME).isString("portraitUri",null==t?void 0:t.portraitUri).isString("introduction",null==t?void 0:t.introduction).isString("notice",null==t?void 0:t.notice).validate("extProfile",null==t?void 0:t.extProfile,(function(e){if(!Rt(e))return!1;var t=Object.entries(e);return t.length<=10&&t.every((function(e){var t=u(e,2);t[0];var r=t[1];return gt(r)}))})).isNumberEnum("joinPermission",null==t?void 0:t.joinPermission,exports.GroupJoinPermission).isNumberEnum("removeMemberPermission",null==t?void 0:t.removeMemberPermission,exports.GroupOperationPermission).isNumberEnum("invitePermission",null==t?void 0:t.invitePermission,exports.GroupOperationPermission).isNumberEnum("inviteHandlePermission",null==t?void 0:t.inviteHandlePermission,exports.GroupInviteHandlePermission).isNumberEnum("groupInfoEditPermission",null==t?void 0:t.groupInfoEditPermission,exports.GroupOperationPermission).isNumberEnum("memberInfoEditPermission",null==t?void 0:t.memberInfoEditPermission,exports.GroupMemberInfoEditPermission).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_INFO)},Ib=function(e,t,r,n,i){return e.isObject("option",n,i).fail(exports.ErrorCode.INVALID_PARAMETER_PAGING_QUERY_OPTION).isLimitedInteger("count",null==n?void 0:n.count,1,t,r).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isString("pageToken",null==n?void 0:n.pageToken).fail(exports.ErrorCode.INVALID_PARAMETER_PAGING_QUERY_OPTION).isBoolean("order",null==n?void 0:n.order).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER)},Tb=function(e){function r(t,r){var n=e.call(this,t)||this;return Object.defineProperty(n,"svr",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"_userProfileEnabled",{enumerable:!0,configurable:!0,writable:!0,value:function(){var e;return 1===(null===(e=n.ctx.naviInfo)||void 0===e?void 0:e.userProfile)?fr():_r(exports.ErrorCode.RC_USER_PROFILE_SERVICE_UNAVAILABLE)}}),n}return t(r,e),Object.defineProperty(r.prototype,"updateMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_UPDATE_MY_USER_PROFILE_VISIBILITY_T,e,t),[4,pr.create("updateMyUserProfileVisibility").isNumberEnum("visibility",e,exports.UserProfileVisibility,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_PROFILE_VISIBILITY).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.updateMyUserProfileVisibility(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_UPDATE_MY_USER_PROFILE_VISIBILITY_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"getMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_MY_USER_PROFILE_VISIBILITY_T,"",e),[4,this.validateConnected().tryTrans(this._userProfileEnabled).next((function(){return r.svr.getMyUserProfileVisibility()}))];case 1:return t=n.sent(),this.logger.summary(B.A_GET_MY_USER_PROFILE_VISIBILITY_R,t,e),[2,t]}}))}))}}),Object.defineProperty(r.prototype,"searchUserProfileByUniqueId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_SEARCH_USER_PROFILE_BY_UNIQUE_ID_T,e,t),[4,pr.create("searchUserProfileByUniqueId").isNotEmptyString("uniqueId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_UNIQUE_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.searchUserProfileByUniqueId(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_SEARCH_USER_PROFILE_BY_UNIQUE_ID_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"addFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_ADD_FRIEND_T,JSON.stringify({userId:e,directionType:t,extra:r}),n),[4,pr.create("addFriend").validate("userId",e,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isNumberEnum("directionType",t,exports.DirectionType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_DIRECTION_TYPE).isLimitedString("extra",r,0,128).fail(exports.ErrorCode.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.addFriend(e,t,r||"")}))];case 1:return i=a.sent(),this.svr.addFriend(e,t,r||""),this.logger.summary(B.A_ADD_FRIEND_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"deleteFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_DELETE_FRIENDS_T,JSON.stringify({userIds:e,directionType:t}),r),[4,pr.create("deleteFriends").isLimitedTypedArray("userIds",e,100,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).isNumberEnum("directionType",t,exports.DirectionType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_DIRECTION_TYPE).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.deleteFriends(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_DELETE_FRIENDS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"acceptFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_ACCEPT_FRIEND_REQUEST_T,e,t),[4,pr.create("acceptFriendRequest").validate("userId",e,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.acceptFriendRequest(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_ACCEPT_FRIEND_REQUEST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"refuseFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_REFUSE_FRIEND_REQUEST_T,JSON.stringify({userId:e,reason:t}),r),[4,pr.create("refuseFriendApplication").validate("userId",e,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isString("reason",t).fail(exports.ErrorCode.INVALID_PARAMETER_REASON).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.refuseFriendRequest(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_REFUSE_FRIEND_REQUEST_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"setFriendInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SET_FRIEND_INFO_T,JSON.stringify({userId:e,remark:t,extProfile:r}),n),[4,pr.create("setFriendInfo").validate("userId",e,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isLimitedString("remark",t,0,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_REMARK).validate("extProfile",r,(function(e){if("object"!=typeof r)return!1;var t=Object.entries(r);return!(t.length>10||t.some((function(e){var t=u(e,2);t[0];var r=t[1];return!gt(r)})))})).fail(exports.ErrorCode.INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.setFriendInfo(e,t,r||{})}))];case 1:return i=a.sent(),this.logger.summary(B.A_SET_FRIEND_INFO_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"checkFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_CHECK_FRIENDS_T,JSON.stringify({userIds:e,directionType:t}),r),[4,pr.create("checkFriends").isLimitedTypedArray("userIds",e,20,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).isNumberEnum("directionType",t,exports.DirectionType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_DIRECTION_TYPE).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.checkFriends(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_CHECK_FRIENDS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_FRIENDS_T,JSON.stringify({directionType:e,option:t}),r),[4,pr.create("getFriends").isNumberEnum("directionType",e,exports.QueryFriendsDirectionType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE).check((function(e){return Ib(e,100,!1,t)})).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var r={count:(null==t?void 0:t.count)||50,pageToken:(null==t?void 0:t.pageToken)||"",order:!!(null==t?void 0:t.order)};return i.svr.getFriends(e,r)}))];case 1:return n=o.sent(),this.logger.summary(B.A_GET_FRIENDS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getFriendApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_FRIEND_APPLICATIONS_T,JSON.stringify({option:e,types:t,status:r}),n),[4,pr.create("getFriendApplications").check((function(t){return Ib(t,100,!1,e)})).check((function(e){e.isTypedArray("types",t,(function(t){return!e.isNumberEnum("type",t,exports.FriendApplicationType,!0).isFailed})).fail(exports.ErrorCode.INVALID_PARAMETER_FRIEND_APPLICATION_TYPE).isTypedArray("status",r,(function(t){return!e.isNumberEnum("status",t,exports.FriendApplicationStatus,!0).isFailed})).fail(exports.ErrorCode.INVALID_PARAMETER_FRIEND_APPLICATION_STATUS)})).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var n={count:(null==e?void 0:e.count)||50,pageToken:(null==e?void 0:e.pageToken)||"",order:!!(null==e?void 0:e.order)},i=t&&0!==t.length?t:[1,2],a=r&&0!==r.length?r:[0,1,2,3];return o.svr.getFriendApplications(n,i,a)}))];case 1:return i=a.sent(),this.logger.summary(B.A_GET_FRIEND_APPLICATIONS_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"getFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_FRIENDS_INFO_T,JSON.stringify({userIds:e}),t),[4,pr.create("getFriendsInfo").isLimitedTypedArray("userIds",e,100,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.getFriendsInfo(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_GET_FRIENDS_INFO_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"searchFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_SEARCH_FRIENDS_INFO_T,JSON.stringify({nickname:e}),t),[4,pr.create("searchFriendsInfo").isLimitedString("nickname",e,1,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NICK_NAME).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.searchFriendsInfo(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_SEARCH_FRIENDS_INFO_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"setFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_SET_FRIEND_ADD_PERMISSION_T,JSON.stringify({permission:e}),t),[4,pr.create("setFriendAddPermission").isNumberEnum("permission",e,exports.FriendAddPermission,!0).fail(exports.ErrorCode.INVALID_PARAMETER_FRIEND_ADD_PERMISSION).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.setFriendAddPermission(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_SET_FRIEND_ADD_PERMISSION_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"getFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_FRIEND_ADD_PERMISSION_T,JSON.stringify({}),e),[4,pr.create("getFriendAddPermission").result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return r.svr.getFriendAddPermission()}))];case 1:return t=n.sent(),this.logger.summary(B.A_GET_FRIEND_ADD_PERMISSION_R,t,e),[2,t]}}))}))}}),Object.defineProperty(r.prototype,"createGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_CREATE_GROUP_T,JSON.stringify({groupInfo:e,inviteeUserIds:t}),r),[4,pr.create("createGroup").check((function(t){return bb(t,e,!0)})).isLimitedTypedArray("inviteeUserIds",t,30,Nt,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var r=gb(e);return i.svr.createGroup(e.groupId,r,e.extProfile||{},t||[])}))];case 1:return n=o.sent(),this.logger.summary(B.A_CREATE_GROUP_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"updateGroupInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_UPDATE_GROUP_INFO_T,JSON.stringify({groupInfo:e}),t),[4,pr.create("updateGroupInfo").check((function(t){return bb(t,e,!1)})).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var t=gb(e);return n.svr.updateGroupInfo(e.groupId,t,e.extProfile)}))];case 1:return r=i.sent(),this.logger.summary(B.A_UPDATE_GROUP_INFO_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"getGroupsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_GROUPS_INFO_T,JSON.stringify({groupIds:e}),t),[4,pr.create("getGroupsInfo").isLimitedTypedArray("groupIds",e,20,Mt,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_IDS).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.getGroupsInfo(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_GET_GROUPS_INFO_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"kickGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_KICK_GROUP_MEMBERS_T,JSON.stringify({groupId:e,userIds:t,config:r}),n),[4,pr.create("kickGroupMembers").validate("groupId",e,Mt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,100,Nt,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.kickGroupMembers(e,t,Eb(r))}))];case 1:return i=a.sent(),this.logger.summary(B.A_KICK_GROUP_MEMBERS_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"quitGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_QUIT_GROUP_T,JSON.stringify({groupId:e,config:t}),r),[4,pr.create("quitGroup").validate("groupId",e,Mt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.quitGroup(e,Eb(t))}))];case 1:return n=o.sent(),this.logger.summary(B.A_QUIT_GROUP_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"dismissGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_DISMISS_GROUP_T,JSON.stringify({groupId:e}),t),[4,pr.create("dismissGroup").validate("groupId",e,Mt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.dismissGroup(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_DISMISS_GROUP_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"transferGroupOwner",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return i=this.logger.createTraceId(),this.logger.info(B.A_TRANSFER_GROUP_OWNER_T,JSON.stringify({groupId:e,newOwnerId:t,quit:r,config:n}),i),[4,pr.create("transferGroupOwner").validate("groupId",e,Mt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).validate("newOwnerId",t,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return s.svr.transferGroupOwner(e,t,!!r,Eb(n))}))];case 1:return o=a.sent(),this.logger.summary(B.A_TRANSFER_GROUP_OWNER_R,o,i),[2,o]}}))}))}}),Object.defineProperty(r.prototype,"addGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_ADD_GROUP_MANAGERS_T,JSON.stringify({groupId:e,userIds:t}),r),[4,pr.create("addGroupManagers").validate("groupId",e,Mt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,10,Nt,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupManagers(exports.GroupOperationType.ADD,e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_ADD_GROUP_MANAGERS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"removeGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_GROUP_MANAGERS_T,JSON.stringify({groupId:e,userIds:t}),r),[4,pr.create("removeGroupManagers").validate("groupId",e,Mt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,10,Nt,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupManagers(exports.GroupOperationType.REMOVE,e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_REMOVE_GROUP_MANAGERS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_GROUP_MEMBERS_T,JSON.stringify({groupId:e,userIds:t}),r),[4,pr.create("getGroupMembers").validate("groupId",e,Mt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,100,Nt,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.getGroupMembers(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_GET_GROUP_MEMBERS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"setGroupMemberInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return i=this.logger.createTraceId(),this.logger.info(B.A_SET_GROUP_MEMBER_INFO_T,JSON.stringify({groupId:e,userId:t,nickname:r,extra:n}),i),[4,pr.create("setGroupMemberInfo").validate("groupId",e,Mt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).validate("userId",t,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isLimitedString("nickname",r,0,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NICK_NAME).isLimitedString("extra",n,0,128).fail(exports.ErrorCode.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return s.svr.setGroupMemberInfo(e,t,r,n)}))];case 1:return o=a.sent(),this.logger.summary(B.A_SET_GROUP_MEMBER_INFO_R,o,i),[2,o]}}))}))}}),Object.defineProperty(r.prototype,"searchGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SEARCH_GROUP_MEMBERS_T,JSON.stringify({groupId:e,nickName:t,option:r}),n),[4,pr.create("searchGroupMembers").validate("groupId",e,Mt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedString("nickName",t,1,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NICK_NAME).check((function(e){return Ib(e,200,!0,r,!0)})).result().tryTrans(this.validateLogin).tryTrans(this._userProfileEnabled).next((function(){var n={count:r.count,pageToken:r.pageToken||"",order:!!r.order};return o.svr.searchGroupMembers(e,t,n)}))];case 1:return i=a.sent(),this.logger.summary(B.A_SEARCH_GROUP_MEMBERS_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"getGroupMembersByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_GROUP_MEMBERS_BY_ROLE_T,JSON.stringify({groupId:e,role:t,option:r}),n),[4,pr.create("getGroupMembersByRole").validate("groupId",e,Mt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isNumberEnum("role",t,exports.GroupMemberRole,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_MEMBER_ROLE).isLimitedInteger("count",r.count,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isString("pageToken",r.pageToken).fail(exports.ErrorCode.INVALID_PARAMETER_PAGING_QUERY_OPTION).isNumberEnum("filterRobotType",r.filterRobotType,xe).fail(exports.ErrorCode.INVALID_PARAMETER_PAGING_QUERY_OPTION).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var n={count:r.count,pageToken:r.pageToken||"",order:!!r.order,filterRobotType:r.filterRobotType||xe.ALL};return o.svr.getGroupMembersByRole(e,t,n)}))];case 1:return i=a.sent(),this.logger.summary(B.A_GET_GROUP_MEMBERS_BY_ROLE_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"addGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_ADD_GROUP_FOLLOWS_T,JSON.stringify({groupId:e,userIds:t}),r),[4,pr.create("addGroupFollows").validate("groupId",e,Mt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,100,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupFollows(exports.GroupOperationType.ADD,e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_ADD_GROUP_FOLLOWS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"removeGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_GROUP_FOLLOWS_T,JSON.stringify({groupId:e,userIds:t}),r),[4,pr.create("removeGroupFollows").validate("groupId",e,Mt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,100,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupFollows(exports.GroupOperationType.REMOVE,e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_REMOVE_GROUP_FOLLOWS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_GROUP_FOLLOWS_T,JSON.stringify({groupId:e}),t),[4,pr.create("getGroupFollows").validate("groupId",e,Mt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.getGroupFollows(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_GET_GROUP_FOLLOWS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"setGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SET_GROUP_REMARK_T,JSON.stringify({groupId:e,remark:t}),r),[4,pr.create("setGroupRemark").validate("groupId",e,Mt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedString("remark",t,0,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_REMARK).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupRemark(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_SET_GROUP_REMARK_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"joinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_JOIN_GROUP_T,JSON.stringify({groupId:e}),t),[4,pr.create("joinGroup").validate("groupId",e,Mt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.joinGroup(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_JOIN_GROUP_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"inviteUsersToGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_INVITE_USERS_TO_GROUP_T,JSON.stringify({groupId:e,userIds:t}),r),[4,pr.create("inviteUsersToGroup").validate("groupId",e,Mt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,30,Nt,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.inviteUsersToGroup(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_INVITE_USERS_TO_GROUP_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"acceptGroupInvite",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_ACCEPT_GROUP_INVITE_T,JSON.stringify({groupId:e,inviterId:t}),r),[4,pr.create("acceptGroupInvite").validate("groupId",e,Mt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).validate("inviterId",t,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.memberInviteResponse({groupId:e,inviterId:t,optType:exports.GroupOperationRole.APPLICANT,optResult:exports.GroupOperationStatus.ACCEPT})}))];case 1:return n=o.sent(),this.logger.summary(B.A_ACCEPT_GROUP_INVITE_R,n,r),[2,n.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"refuseGroupInvite",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_REFUSE_GROUP_INVITE_T,JSON.stringify({groupId:e,inviterId:t,reason:r}),n),[4,pr.create("refuseGroupInvite").validate("groupId",e,Mt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).validate("inviterId",t,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isLimitedString("reason",r,0,128).fail(exports.ErrorCode.INVALID_PARAMETER_REASON).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.memberInviteResponse({groupId:e,inviterId:t,optType:exports.GroupOperationRole.APPLICANT,optResult:exports.GroupOperationStatus.REFUSE,reason:r})}))];case 1:return i=a.sent(),this.logger.summary(B.A_REFUSE_GROUP_INVITE_R,i,n),[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"acceptGroupApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_ACCEPT_GROUP_APPLICATION_T,JSON.stringify({groupId:e,joinUserId:t,inviterId:r}),n),[4,pr.create("acceptGroupApplication").validate("groupId",e,Mt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).validate("joinUserId",t,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).validate("inviterId",r,Nt).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.memberInviteResponse({groupId:e,joinUserId:t,inviterId:r||"",optType:exports.GroupOperationRole.MANAGER,optResult:exports.GroupOperationStatus.ACCEPT})}))];case 1:return i=a.sent(),this.logger.summary(B.A_ACCEPT_GROUP_APPLICATION_R,i,n),[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"refuseGroupApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return i=this.logger.createTraceId(),this.logger.info(B.A_REFUSE_GROUP_APPLICATION_T,JSON.stringify({groupId:e,joinUserId:t,inviterId:r,reason:n}),i),[4,pr.create("refuseGroupApplication").validate("groupId",e,Mt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).validate("joinUserId",t,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).validate("inviterId",r,Nt).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isLimitedString("reason",n,0,128).fail(exports.ErrorCode.INVALID_PARAMETER_REASON).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return s.svr.memberInviteResponse({groupId:e,joinUserId:t,inviterId:r||"",optType:exports.GroupOperationRole.MANAGER,optResult:exports.GroupOperationStatus.REFUSE,reason:n})}))];case 1:return o=a.sent(),this.logger.summary(B.A_REFUSE_GROUP_APPLICATION_R,o,i),[2,o.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getGroupApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_GROUP_APPLICATIONS_T,JSON.stringify({option:e,directions:t,status:r}),n),i=this.ctx.usingCppEngine,[4,pr.create("getGroupApplications").check((function(t){return Ib(t,200,!0,e,!0)})).check((function(e){i&&e.isLimitedTypedArray("directions",t,Object.keys(exports.GroupApplicationDirection).length,(function(t){return!e.isNumberEnum("directions",t,exports.GroupApplicationDirection,!0).isFailed}),!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION).isLimitedTypedArray("status",r,Object.keys(exports.GroupApplicationStatus).length,(function(t){return!e.isNumberEnum("status",t,exports.GroupApplicationStatus,!0).isFailed}),!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_APPLICATION_STATUS)})).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var n={count:e.count,pageToken:e.pageToken||"",order:!!e.order};return s.svr.getGroupApplications(n,t||[],r||[])}))];case 1:return o=a.sent(),this.logger.summary(B.A_GET_GROUP_APPLICATIONS_R,o,n),[2,o]}}))}))}}),Object.defineProperty(r.prototype,"getJoinedGroupsByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_JOINED_GROUPS_BY_ROLES_T,JSON.stringify({role:e,option:t}),r),[4,pr.create("getJoinedGroupsByRole").isNumberEnum("role",e,exports.GroupMemberRole,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_MEMBER_ROLE).check((function(e){return Ib(e,100,!0,t,!0)})).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var r={count:t.count,pageToken:t.pageToken||"",order:!!t.order};return i.svr.getJoinedGroupsByRole(e,r)}))];case 1:return n=o.sent(),this.logger.summary(B.A_GET_JOINED_GROUPS_BY_ROLES_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"searchJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SEARCH_JOINED_GROUPS_T,JSON.stringify({groupName:e,option:t}),r),[4,pr.create("searchJoinedGroups").isLimitedString("groupName",e,1,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_NAME).check((function(e){return Ib(e,200,!0,t,!0)})).result().tryTrans(this.validateLogin).tryTrans(this._userProfileEnabled).next((function(){var r={count:t.count,pageToken:t.pageToken||"",order:!!t.order};return i.svr.searchJoinedGroups(e,r)}))];case 1:return n=o.sent(),this.logger.summary(B.A_SEARCH_JOINED_GROUPS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_JOINED_GROUPS_T,JSON.stringify({groupIds:e}),t),[4,pr.create("getJoinedGroups").isLimitedTypedArray("groupIds",e,20,Mt,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_IDS).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.getJoinedGroups(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_GET_JOINED_GROUPS_R,r,t),[2,r]}}))}))}}),r}(pb),vb=0,Rb=function(e){function r(t,r,i){var o=e.call(this,i)||this;return Object.defineProperty(o,"_svr",{enumerable:!0,configurable:!0,writable:!0,value:r}),sb.set(o,void 0),ub.set(o,!1),lb.set(o,!0),cb.set(o,""),Object.defineProperty(o,"_id",{enumerable:!0,configurable:!0,writable:!0,value:++vb}),d(o,sb,n(n({},t),{tagFilter:n({},t.tagFilter)}),"f"),o}return t(r,e),Object.defineProperty(r.prototype,"hasMore",{get:function(){return c(this,lb,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isLoading",{get:function(){return c(this,ub,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"load",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return c(this,ub,"f")?[2,_r(exports.ErrorCode.METHOD_BUSY)]:(d(this,ub,!0,"f"),t=this.logger.createTraceId(),this.logger.info(B.A_LOAD_CONVERSATION_LIST_T,JSON.stringify({count:e,loaderId:this._id,pageToken:c(this,cb,"f")}),t),[4,pr.create("ConversationListLoader.load").isLimitedInteger("count",e,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).next((function(){return u._svr.loadConversationList(c(u,cb,"f"),e,c(u,sb,"f"))}))]);case 1:return r=a.sent(),this.logger.summary(B.A_LOAD_CONVERSATION_LIST_R,r,t,{loaderId:this._id},(function(e){return{pageToken:e.pageToken,finished:e.finished}})),d(this,ub,!1,"f"),r.isOk?(n=r.data,i=n.pageToken,o=n.finished,s=n.list,d(this,cb,i,"f"),d(this,lb,!o,"f"),[2,fr(s)]):[2,r.wipe()]}}))}))}}),r}(pb);sb=new WeakMap,ub=new WeakMap,lb=new WeakMap,cb=new WeakMap;var mb=function(e){function r(t,r){var n=e.call(this,t)||this;return db.add(n),Object.defineProperty(n,"svr",{enumerable:!0,configurable:!0,writable:!0,value:r}),n}return t(r,e),Object.defineProperty(r.prototype,"saveEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SAVE_EDITED_MSG_DRAFT_T,JSON.stringify({draft:e,identifier:t}),r),[4,pr.create("saveEditedMessageDraft").check((function(e){return uc(e,t,Z)})).isString("draft",null==e?void 0:e.content,!0).fail(exports.ErrorCode.INVALID_PARAMETER_DRAFT).isNotEmptyString("messageUId",null==e?void 0:e.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateLogin).next((function(){return i.svr.saveEditedMessageDraft(e,c(i,db,"m",_b).call(i,t))}))];case 1:return n=o.sent(),this.logger.summary(B.A_SAVE_EDITED_MSG_DRAFT_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_EDITED_MSG_DRAFT_T,JSON.stringify({identifier:e}),t),[4,pr.create("getEditedMessageDraft").check((function(t){return uc(t,e,Z)})).result().next((function(){return n.svr.getEditedMessageDraft(c(n,db,"m",_b).call(n,e))}))];case 1:return r=i.sent(),this.logger.summary(B.A_GET_EDITED_MSG_DRAFT_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"clearEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_CLEAR_EDITED_MSG_DRAFT_T,JSON.stringify({identifier:e}),t),[4,pr.create("clearEditedMessageDraft").check((function(t){return uc(t,e,Z)})).result().next((function(){return n.svr.clearEditedMessageDraft(c(n,db,"m",_b).call(n,e))}))];case 1:return r=i.sent(),this.logger.summary(B.A_CLEAR_EDITED_MSG_DRAFT_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"createConversationListLoader",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return r=(t=e||{}).conversationTypes,i=t.order,o=t.channelId,s=t.tagFilter,[4,pr.create("createConversationListLoader").isTypedArray("conversationTypes",r,(function(e){return te(e,J)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isLimitedInteger("order",i,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).validate("channelId",o,Ct).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).check((function(e){if(s){var t=s.tagIds;e.isLimitedTypedArray("tagIds",t,20,vt,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID)}})).result().tryTrans(this.validateConnected).trans((function(){return new Rb(n(n({},e),{tagFilter:n({},s)}),u.svr,u.ctx)}))];case 1:return[2,a.sent()]}}))}))}}),Object.defineProperty(r.prototype,"sendUltraGroupTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),r=null==e?void 0:e.conversationType,this.logger.info(B.A_SEND_UG_TYPING_T,JSON.stringify(e),t),[4,pr.create("sendUltraGroupTypingStatus").check((function(t){return uc(t,e,X)})).validate("conversationType",r,(function(){return r===exports.ConversationType.ULTRA_GROUP}),!0).fail(exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT).result().tryTrans(this.validateConnected).next((function(){return i.svr.sendUltraGroupTypingStatus(c(i,db,"m",_b).call(i,e))}))];case 1:return n=o.sent(),this.logger.summary(B.A_SEND_UG_TYPING_R,n,t),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"sendTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SEND_TYPING_STATUS_T,JSON.stringify({identifier:e,typingContentType:t}),r),[4,pr.create("sendTypingStatus").check((function(t){return uc(t,e,J)})).isString("typingContentType",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).result().tryTrans(this.validateConnected).next((function(){var n={messageType:"RC:TypSts",content:{typingContentType:t}};return i.ctx.sendMessage(e,n,r)}))];case 1:return n=o.sent(),this.logger.summary(B.A_SEND_TYPING_STATUS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"sendSyncReadStatusMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(s){switch(s.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SYNC_READ_STATUS_T,JSON.stringify({identifier:e,timestamp:t}),r),[4,pr.create("sendSyncReadStatusMessage").check((function(t){return uc(t,e,J)})).isNumber("timestamp",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(n){return o(i,void 0,void 0,(function(){var i;return a(this,(function(o){switch(o.label){case 0:return n.serverSaveUnread?[2,_r(exports.ErrorCode.SERVER_RECORD_UNREAD_COUNT_ENABLED_FORBIDDEN)]:1===n.sesDriven?[2,this.svr.updateConversationReadTime(e,t)]:(i={messageType:me.SYNC_READ_STATUS,content:{lastMessageSendTime:t},directionalUserIdList:or(e.conversationType,[this.ctx.userId])},[4,this.ctx.sendMessage(e,i,r)]);case 1:return[2,o.sent().wipe()]}}))}))}))];case 1:return n=s.sent(),this.logger.summary(B.A_SYNC_READ_STATUS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"clearUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_CLEAR_UNREAD_COUNT_T,JSON.stringify(e),t),[4,pr.create("clearUnreadCount").check((function(t){return uc(t,e,X)})).result().tryTrans((function(){return n.checkAuthed(e.conversationType!==exports.ConversationType.ULTRA_GROUP)})).tryTrans((function(e){return e.serverSaveUnread?_r(exports.ErrorCode.SERVER_RECORD_UNREAD_COUNT_ENABLED_FORBIDDEN):fr()})).next((function(){return o(n,void 0,void 0,(function(){return a(this,(function(t){return e.conversationType!==exports.ConversationType.ULTRA_GROUP||this.svr.ugSynced?[2,this.svr.clearConversationUnreadCount(c(this,db,"m",_b).call(this,e))]:[2,_r(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(B.A_CLEAR_UNREAD_COUNT_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"clearAllUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_CLEAR_ALL_UNREAD_COUNT_T,null,e),[4,pr.create("clearAllUnreadCount").result().tryTrans(this.validateLogin).tryTrans((function(e){return e.serverSaveUnread?_r(exports.ErrorCode.SERVER_RECORD_UNREAD_COUNT_ENABLED_FORBIDDEN):fr()})).next((function(){return o(r,void 0,void 0,(function(){return a(this,(function(e){return[2,this.svr.clearAllSGUnreadCount()]}))}))}))];case 1:return t=n.sent(),this.logger.summary(B.A_CLEAR_ALL_UNREAD_COUNT_R,t,e),[2,t]}}))}))}}),Object.defineProperty(r.prototype,"clearUnreadCountByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_CLEAR_UNREAD_COUNT_BY_TIME_T,JSON.stringify({identifier:e,timestamp:t}),r),[4,pr.create("clearUnreadCountByTimestamp").check((function(t){return uc(t,e,J)})).isTimestamp("timestamp",t).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin).tryTrans((function(e){return e.serverSaveUnread?_r(exports.ErrorCode.SERVER_RECORD_UNREAD_COUNT_ENABLED_FORBIDDEN):fr()})).next((function(){return i.svr.clearUnreadCountByTimestamp(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_CLEAR_UNREAD_COUNT_BY_TIME_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"sendReadReceiptRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SEND_READ_RECEIPT_REQ_T,JSON.stringify({identifier:e,messageUId:t}),r),[4,pr.create("sendReadReceiptRequest").check((function(t){return uc(t,e,z)})).isNotEmptyString("messageUId",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).next((function(){var n={messageType:me.READ_RECEIPT_REQUEST,content:{messageUId:t}};return i.ctx.sendMessage(e,n,r)}))];case 1:return n=o.sent(),this.logger.summary(B.A_SEND_READ_RECEIPT_REQ_R,n,r),[2,n.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"sendReadReceiptMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SEND_READ_RECEIPT_T,JSON.stringify({identifier:e,messageUId:t,timestamp:r}),n),[4,pr.create("sendReadReceiptMessage").check((function(t){return uc(t,e,$)})).isNotEmptyString("messageUId",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("timestamp",r,1,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){var i={messageType:me.READ_RECEIPT,content:{messageUId:t,lastMessageSendTime:r,type:1}};return o.ctx.sendMessage(e,i,n)}))];case 1:return i=a.sent(),this.logger.summary(B.A_SEND_READ_RECEIPT_R,i,n),[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"sendReadReceipt",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(s){switch(s.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SEND_READ_RECEIPT_T,JSON.stringify({identifier:e,messageList:t}),r),[4,pr.create("sendReadReceipt").check((function(t){return uc(t,e,z)})).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).check((function(e){Rt(t)&&!Object.keys(t).some((function(r){var n=t[r];return e.isLimitedTypedArray("messageList",n,Number.MAX_SAFE_INTEGER,vt,!0).isFailed}))||e.setFailed(exports.ErrorCode.MSG_LIMIT_ERROR)})).result().tryTrans(this.validateConnected).next((function(n){return o(i,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){switch(a.label){case 0:return 0!==(i=n.grpRRVer||0)&&1!==i?[2,_r(exports.ErrorCode.READ_RECEIPT_ERROR)]:1===i?(o=[],Object.keys(t).forEach((function(e){o.push.apply(o,l([],u(t[e]),!1))})),[2,this.svr.sendReadReceiptV2(e.targetId,o,e.channelId)]):(s={receiptMessageDic:t},[4,this.ctx.sendMessage(e,{messageType:me.READ_RECEIPT_RESPONSE,content:s},r)]);case 1:return[2,a.sent().wipe()]}}))}))}))];case 1:return n=s.sent(),this.logger.summary(B.A_SEND_READ_RECEIPT_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,s=this;return a(this,(function(u){switch(u.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_MSG_READER_T,JSON.stringify({targetId:e,messageUId:t,channelId:r}),n),[4,pr.create("getMessageReader").validate("targetId",e,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isNotEmptyString("messageUId",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).validate("channelId",r,Ct).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(n){return o(s,void 0,void 0,(function(){return a(this,(function(i){return 1!==n.grpRRVer?[2,_r(exports.ErrorCode.READ_RECEIPT_ERROR)]:[2,this.svr.getMessageReader(e,t,r||"")]}))}))}))];case 1:return i=u.sent(),this.logger.summary(B.A_GET_MSG_READER_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"sendReadReceiptMessageV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,s=this;return a(this,(function(u){switch(u.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SEND_READ_RECEIPT_V4_T,JSON.stringify({conversation:e,endMsgUid:t,startMsgUid:r}),n),[4,pr.create("sendReadReceiptMessageV4").check((function(t){return uc(t,e,J)})).isNotEmptyString("endMsgUid",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_END_MESSAGE_UID).isNotEmptyString("startMsgUid",r).fail(exports.ErrorCode.INVALID_PARAMETER_START_MESSAGE_UID).result().tryTrans(this.validateConnected).next((function(n){return o(s,void 0,void 0,(function(){return a(this,(function(i){return 3!==n.grpRRVer?[2,_r(exports.ErrorCode.READ_RECEIPT_V4_NOT_SUPPORT)]:[2,this.svr.sendReadReceiptMessageV4(e,r||"",t)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(B.A_SEND_READ_RECEIPT_V4_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"getMessageReadReceiptV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(s){switch(s.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_READ_RECEIPT_V4_T,JSON.stringify({conversation:e,messageUId:t}),r),[4,pr.create("getMessageReadReceiptV4").check((function(t){return uc(t,e,z)})).isNotEmptyString("messageUId",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).next((function(r){return o(i,void 0,void 0,(function(){return a(this,(function(n){return 3!==r.grpRRVer?[2,_r(exports.ErrorCode.READ_RECEIPT_V4_NOT_SUPPORT)]:[2,this.svr.getMessageReadReceiptV4(e,t)]}))}))}))];case 1:return n=s.sent(),this.logger.summary(B.A_GET_READ_RECEIPT_V4_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"batchGetMessageReadReceiptInfoV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(s){switch(s.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_BATCH_GET_READ_RECEIPT_INFO_V4_T,JSON.stringify({conversation:e,messageUIds:t}),r),[4,pr.create("batchGetMessageReadReceiptInfoV4").check((function(t){return uc(t,e,z)})).isTypedArray("messageUIds",t,vt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).next((function(r){return o(i,void 0,void 0,(function(){return a(this,(function(n){return 3!==r.grpRRVer?[2,_r(exports.ErrorCode.READ_RECEIPT_V4_NOT_SUPPORT)]:[2,this.svr.batchGetMessageReadReceiptInfoV4(e,t)]}))}))}))];case 1:return n=s.sent(),this.logger.summary(B.A_BATCH_GET_READ_RECEIPT_INFO_V4_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getConversationsIncludingRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,i=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_CONVERSATIONS_INCLUDING_ROBOTS_T,JSON.stringify({options:e}),t),[4,pr.create("getConversationsIncludingRobots").isLimitedTypedArray("conversationTypes",null==e?void 0:e.conversationTypes,2,(function(e){return[exports.ConversationType.PRIVATE,exports.ConversationType.SYSTEM].includes(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isLimitedInteger("count",null==e?void 0:e.count,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isTimestamp("timestamp",null==e?void 0:e.timestamp,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){var t=n(n({},e),{topPriority:!!e.topPriority});return i.svr.getConversationsIncludingRobots(t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_GET_CONVERSATIONS_INCLUDING_ROBOTS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"markRemoteConversationAsRead",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_MARK_REMOTE_CONVERSATION_AS_READ_T,JSON.stringify(e),t),[4,pr.create("markRemoteConversationAsRead").check((function(t){return uc(t,e,K)})).result().tryTrans(this.validateConnected).tryTrans((function(e){return e.serverSaveUnread?fr():_r(exports.ErrorCode.SERVER_RECORD_UNREAD_COUNT_DISABLED)})).next((function(){if(e.conversationType===exports.ConversationType.ULTRA_GROUP)return n.svr.clearConversationUnreadCount(c(n,db,"m",_b).call(n,e));var r={lastMessageSendTime:n.ctx.serverTime},i={messageType:me.SYNC_READ_STATUS,content:r,directionalUserIdList:or(e.conversationType,[n.ctx.userId])};return n.svr.markRemoteConversationAsRead(e,i,t)}))];case 1:return r=i.sent(),this.logger.summary(B.A_MARK_REMOTE_CONVERSATION_AS_READ_R,r,t),[2,r.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"addMessageReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,o=this;return a(this,(function(a){switch(a.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_ADD_MSG_REACTION_T,JSON.stringify(e),t),[4,pr.create("addMessageReaction").check((function(t){return uc(t,null==e?void 0:e.conversationIdentifier,Z)})).isNotEmptyString("messageUId",null==e?void 0:e.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isLimitedString("reactionId",null==e?void 0:e.reactionId,1,16,!0).fail(exports.ErrorCode.REACTION_ID_INVALID).isObject("pushConfig",null==e?void 0:e.pushConfig).fail(exports.ErrorCode.INVALID_PARAMETER_PUSH_CONFIG).result().tryTrans(this.validateConnected).next((function(){var t=e.conversationIdentifier,r=i(e,["conversationIdentifier"]);return o.svr.addMessageReaction(n(n({},r),{conversationIdentifier:c(o,db,"m",_b).call(o,t)}))}))];case 1:return r=a.sent(),this.logger.summary(B.A_ADD_MSG_REACTION_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"removeMessageReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,o=this;return a(this,(function(a){switch(a.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_MSG_REACTION_T,JSON.stringify(e),t),[4,pr.create("removeMessageReaction").check((function(t){return uc(t,null==e?void 0:e.conversationIdentifier,Z)})).isNotEmptyString("messageUId",null==e?void 0:e.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isLimitedString("reactionId",null==e?void 0:e.reactionId,1,16,!0).fail(exports.ErrorCode.REACTION_ID_INVALID).isObject("pushConfig",null==e?void 0:e.pushConfig).fail(exports.ErrorCode.INVALID_PARAMETER_PUSH_CONFIG).result().tryTrans(this.validateConnected).next((function(){var t=e.conversationIdentifier,r=i(e,["conversationIdentifier"]);return o.svr.removeMessageReaction(n(n({},r),{conversationIdentifier:c(o,db,"m",_b).call(o,t)}))}))];case 1:return r=a.sent(),this.logger.summary(B.A_REMOVE_MSG_REACTION_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"batchGetMessageReactionSummaries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var r,o,s=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_BATCH_GET_MSG_REACTION_SUMMARIES_T,JSON.stringify(e),r),[4,pr.create("batchGetMessageReactionSummaries").check((function(t){return uc(t,null==e?void 0:e.conversationIdentifier,Z)})).isTypedArray("messageUIds",null==e?void 0:e.messageUIds,(function(e){return vt(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("messageUIds",null===(t=null==e?void 0:e.messageUIds)||void 0===t?void 0:t.length,1,100,!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).next((function(){var t=e.conversationIdentifier,r=i(e,["conversationIdentifier"]);return s.svr.batchGetMessageReactionSummaries(n({conversationIdentifier:c(s,db,"m",_b).call(s,t)},r))}))];case 1:return o=a.sent(),this.logger.summary(B.A_BATCH_GET_MSG_REACTION_SUMMARIES_R,o,r),[2,o]}}))}))}}),Object.defineProperty(r.prototype,"getMessageReactions",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,o=this;return a(this,(function(a){switch(a.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_MSG_REACTIONS_T,JSON.stringify(e),t),[4,pr.create("getMessageReactions").check((function(t){return uc(t,null==e?void 0:e.conversationIdentifier,Z)})).isNotEmptyString("messageUId",null==e?void 0:e.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("count",null==e?void 0:e.count,1,50,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isString("pageToken",null==e?void 0:e.pageToken).fail(exports.ErrorCode.INVALID_PARAMETER_PAGE_TOKEN).result().tryTrans(this.validateConnected).next((function(){var t=e.conversationIdentifier,r=i(e,["conversationIdentifier"]);return o.svr.getMessageReactions(n({conversationIdentifier:c(o,db,"m",_b).call(o,t)},r))}))];case 1:return r=a.sent(),this.logger.summary(B.A_GET_MSG_REACTIONS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"getMessageReactionUsers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,o=this;return a(this,(function(a){switch(a.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_MSG_REACTION_USERS_T,JSON.stringify(e),t),[4,pr.create("getMessageReactionUsers").check((function(t){return uc(t,null==e?void 0:e.conversationIdentifier,Z)})).isNotEmptyString("messageUId",null==e?void 0:e.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isLimitedString("reactionId",null==e?void 0:e.reactionId,1,16,!0).fail(exports.ErrorCode.REACTION_ID_INVALID).isLimitedInteger("count",null==e?void 0:e.count,1,50,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isString("pageToken",null==e?void 0:e.pageToken).fail(exports.ErrorCode.INVALID_PARAMETER_PAGE_TOKEN).result().tryTrans(this.validateConnected).next((function(){var t=e.conversationIdentifier,r=i(e,["conversationIdentifier"]);return o.svr.getMessageReactionUsers(n({conversationIdentifier:c(o,db,"m",_b).call(o,t)},r))}))];case 1:return r=a.sent(),this.logger.summary(B.A_GET_MSG_REACTION_USERS_R,r,t),[2,r]}}))}))}}),r}(pb);db=new WeakSet,fb=function(e){var t;return!!(2&((null===(t=this.ctx.naviInfo)||void 0===t?void 0:t.ugDriven)||0))&&!e?"RCDefault":e},_b=function(e){return e.conversationType!==exports.ConversationType.ULTRA_GROUP?e:n(n({},e),{channelId:c(this,db,"m",fb).call(this,e.channelId)})};var yb,Ab,Ob,Sb,Cb,Nb,Mb,Pb,Lb,wb,Ub,Db,xb,Gb,Vb=function(e){function r(t,r,n,i){var s=this,u=en();return u.setLogReader((function(e,t,r,n){return o(s,void 0,void 0,(function(){return a(this,(function(e){return[2,{logs:[]}]}))}))})),u.setLogWriter((function(e){i(e)})),s=e.call(this,t,r,n,u)||this}return t(r,e),Object.defineProperty(r.prototype,"getTimestamp4RealtimeLog",{enumerable:!1,configurable:!0,writable:!0,value:function(){return 0}}),Object.defineProperty(r.prototype,"setTimestamp4RealtimeLog",{enumerable:!1,configurable:!0,writable:!0,value:function(e){}}),r}(qr),jb=0,kb=Date.now(),Fb=function(e){var t=Date.now();return kb!==t&&(kb=t,jb=0),[e,window.__RCCppContextBridge__.process.pid,t,jb++].join("__")},Bb=function(){return o(void 0,void 0,void 0,(function(){return a(this,(function(e){return[2,_r(exports.ErrorCode.NOT_SUPPORT,"Not support")]}))}))},Hb=function(){function e(e,t){var r,n=this;yb.add(this),Object.defineProperty(this,"_initOptions",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_cache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Ab.set(this,void 0),Ob.set(this,void 0),Sb.set(this,!1),Object.defineProperty(this,"_resolveMaps",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"loadConversationList",{enumerable:!0,configurable:!0,writable:!0,value:Bb}),Object.defineProperty(this,"batchGetMessageReadReceiptInfoV4",{enumerable:!0,configurable:!0,writable:!0,value:Bb}),Object.defineProperty(this,"getRealtimeConversations",{enumerable:!0,configurable:!0,writable:!0,value:Bb}),Object.defineProperty(this,"getRealtimeConTotalUnreadCount",{enumerable:!0,configurable:!0,writable:!0,value:Bb}),Object.defineProperty(this,"clearRealtimeConUnreadCount",{enumerable:!0,configurable:!0,writable:!0,value:Bb}),Object.defineProperty(this,"removeRealtimeConversations",{enumerable:!0,configurable:!0,writable:!0,value:Bb}),Object.defineProperty(this,"batchGetRealtimeConUnreadCount",{enumerable:!0,configurable:!0,writable:!0,value:Bb});var i=t,o=function(e){return n._send2Main("onReceiveRendererLog",e)},a=d(this,Ob,new Vb(i.appkey,"IMLib","IM",o),"f");d(this,Ab,o,"f"),a.setOutputLevel(i.logOutputLevel);var s=window.__RCCppContextBridge__.ipcRenderer;s.on("__RC_CHANNEL_NOTIFICATION_FROM_MAIN__",(function(t,r){for(var i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];var a=e[r];if(a){switch(r){case"ultraGroupEnable":d(n,Sb,!0,"f");break;case"onNaviDataChange":n._cache.naviInfo=i[0];break;case"onRTCDataChange":i[0]=new Uint8Array(i[0]);break;case"onConnected":d(n,Sb,!1,"f"),n._cache=i[1];break;case"onSuspend":d(n,Sb,!1,"f"),n._setConnectionStatus(exports.RCConnectionStatus.SUSPENDED);break;case"onDisconnected":d(n,Sb,!1,"f"),n._setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED);break;case"onConnecting":n._setConnectionStatus(exports.RCConnectionStatus.CONNECTING)}a.apply(void 0,l([],u(i),!1))}else n.logger.error(B.L_UNSUPPORT_NTF_FROM_MAIN_E,r)})),s.on("__RC_CHANNEL_RESULT_FROM_MAIN__",(function(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];var o=n._resolveMaps[t];o&&(delete n._resolveMaps[t],o.apply(void 0,l([],u(r),!1)))})),i.httpInMainProcess&&(ua.httpReq=this.sendHTTPRequest.bind(this));var c={navigators:i.navigators,areaCode:i.areaCode,logServerUrl:i.logServerUrl,environment:i.environment,enableReadReceiptStorage:i.enableReadReceiptStorage,useNaviV2:null!==(r=i.useNaviV2)&&void 0!==r&&r,commitId:"57856dfc3403c77df9293fb0d5c8e476a8a301da"};if(s.send("__RC_INNER_COMMAND_INIT__",c),this._cache=this._callMainSync("getMainProcessCache"),"57856dfc3403c77df9293fb0d5c8e476a8a301da"!==this._cache.commitId)throw new Error("SDK version mismatch.")}return Object.defineProperty(e.prototype,"chat",{get:function(){return this},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"chatroom",{get:function(){return this},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userSettings",{get:function(){return this},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataHosting",{get:function(){return this},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"logger",{get:function(){return c(this,Ob,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ugSynced",{get:function(){return c(this,Sb,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_setConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._cache.connectionStatus=e,e===exports.RCConnectionStatus.DISCONNECTED&&(this._cache.crtUserId="")}}),Object.defineProperty(e.prototype,"sendHTTPRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._callMain("sendHTTPRequest",e)}}),Object.defineProperty(e.prototype,"_callMain",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=this,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var i=window.__RCCppContextBridge__.ipcRenderer;return new Promise((function(n){var o=Fb(e);t._resolveMaps[o]=n,i.send.apply(i,l(["__RC_CHANNEL_CALL_MAIN__",o,e],u(r),!1))}))}}),Object.defineProperty(e.prototype,"_send2Main",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];(t=window.__RCCppContextBridge__.ipcRenderer).send.apply(t,l(["__RC_CHANNEL_SEND_2_MAIN__",e],u(r),!1))}}),Object.defineProperty(e.prototype,"_callMainSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return(t=window.__RCCppContextBridge__.ipcRenderer).sendSync.apply(t,l(["__RC_CHANNEL_CALL_MAIN_SYNC__",e],u(r),!1))}}),Object.defineProperty(e.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return c(this,yb,"m",Cb).call(this,"refetchNaviInfo")}}),Object.defineProperty(e.prototype,"naviInfo",{get:function(){return this._cache.naviInfo},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"createLogger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return new Vb(this.appkey,e,t,c(this,Ab,"f"))}}),Object.defineProperty(e.prototype,"connectionStatus",{get:function(){return this._cache.connectionStatus},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"usingCppEngine",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){return a(this,(function(i){return[2,c(this,yb,"m",Cb).call(this,"connect",e,t,r,n)]}))}))}}),Object.defineProperty(e.prototype,"reportSDKInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._send2Main("reportSDKInfo",e)}}),Object.defineProperty(e.prototype,"connectedTime",{get:function(){return this._cache.connectedTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getHistoryMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"getHistoryMessage",e,t,r)}}),Object.defineProperty(e.prototype,"getContinuousMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"getContinuousMessages",e,t)}}),Object.defineProperty(e.prototype,"getHistoryMessagesByObjectNames",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"getHistoryMessagesByObjectNames",e,t)}}),Object.defineProperty(e.prototype,"deleteRemoteMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"deleteRemoteMessage",e,t)}}),Object.defineProperty(e.prototype,"recallMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"recallMsg",e,t)}}),Object.defineProperty(e.prototype,"deleteRemoteMessageByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"deleteRemoteMessageByTimestamp",e,t)}}),Object.defineProperty(e.prototype,"getTopConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"getTopConversationList",e,t,r)}}),Object.defineProperty(e.prototype,"getUnreadConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"getUnreadConversationList",e,t)}}),Object.defineProperty(e.prototype,"getConversationListByPageIndex",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"getConversationListByPageIndex",e,t)}}),Object.defineProperty(e.prototype,"getAllConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"getAllConversationList",e,t)}}),Object.defineProperty(e.prototype,"getConversationListByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"getConversationListByTimestamp",e,t)}}),Object.defineProperty(e.prototype,"getUntaggedConversationListByPage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"getUntaggedConversationListByPage",e,t,r)}}),Object.defineProperty(e.prototype,"getConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"getConversation",e)}}),Object.defineProperty(e.prototype,"batchDeleteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"batchDeleteConversations",e)}}),Object.defineProperty(e.prototype,"getTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"getTotalUnreadCount",e,t,r)}}),Object.defineProperty(e.prototype,"getConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"getConversationUnreadCount",e)}}),Object.defineProperty(e.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"getTotalUnreadCountByLevels",e,t,r)}}),Object.defineProperty(e.prototype,"clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"clearConversationUnreadCount",e)}}),Object.defineProperty(e.prototype,"markRemoteConversationAsRead",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"markRemoteConversationAsRead",e,t,r)}}),Object.defineProperty(e.prototype,"getFirstUnreadMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"getFirstUnreadMessage",e)}}),Object.defineProperty(e.prototype,"getFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"getFirstUnreadMessageDigest",e)}}),Object.defineProperty(e.prototype,"saveTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"saveTextMessageDraft",e,t)}}),Object.defineProperty(e.prototype,"getTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"getTextMessageDraft",e)}}),Object.defineProperty(e.prototype,"clearTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"clearTextMessageDraft",e)}}),Object.defineProperty(e.prototype,"batchSetConversationToTop",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return c(this,yb,"m",Cb).call(this,"batchSetConversationToTop",e,t,r,n)}}),Object.defineProperty(e.prototype,"batchSetConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"batchSetConversationNotificationLevel",e,t)}}),Object.defineProperty(e.prototype,"batchSetConversationTranslateStrategy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"batchSetConversationTranslateStrategy",e,t)}}),Object.defineProperty(e.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=this,o=["sendMessageBefore",Date.now(),Math.floor(Math.random()*Date.now())].join("_");return n&&(this._resolveMaps[o]=function(e){try{n(e)}catch(e){i.logger.error(B.L_CALLBACK_E,JSON.stringify({error:null==e?void 0:e.stack,pos:"sendMsgBefore"}))}}),c(this,yb,"m",Cb).call(this,"sendMessage",e,t,r,o)}}),Object.defineProperty(e.prototype,"sendReadReceiptV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"sendReadReceiptV2",e,t,r)}}),Object.defineProperty(e.prototype,"getMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"getMessageReader",e,t,r)}}),Object.defineProperty(e.prototype,"sendReadReceiptMessageV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"sendReadReceiptMessageV4",e,t,r)}}),Object.defineProperty(e.prototype,"getMessageReadReceiptV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"getMessageReadReceiptV4",e,t)}}),Object.defineProperty(e.prototype,"updateConversationReadTime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"updateConversationReadTime",e,t)}}),Object.defineProperty(e.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(r){return[2,c(this,yb,"m",Cb).call(this,"disconnect",e,t)]}))}))}}),Object.defineProperty(e.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._send2Main("registerMessageType",e,t)}}),Object.defineProperty(e.prototype,"joinChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return c(this,yb,"m",Cb).call(this,"joinChatroom",e,t,r,n)}}),Object.defineProperty(e.prototype,"quitChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"quitChatroom",e,t)}}),Object.defineProperty(e.prototype,"getChatroomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"getChatroomInfo",e,t,r)}}),Object.defineProperty(e.prototype,"getChatroomHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return c(this,yb,"m",Cb).call(this,"getChatroomHistoryMessages",e,t,r,n)}}),Object.defineProperty(e.prototype,"setChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"setChatroomEntry",e,t,r)}}),Object.defineProperty(e.prototype,"setChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"setChatroomEntries",e,t)}}),Object.defineProperty(e.prototype,"removeChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"removeChatroomEntry",e,t,r)}}),Object.defineProperty(e.prototype,"removeChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"removeChatroomEntries",e,t)}}),Object.defineProperty(e.prototype,"getChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"getChatroomEntry",e,t)}}),Object.defineProperty(e.prototype,"getAllChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"getAllChatroomEntries",e)}}),Object.defineProperty(e.prototype,"getFileToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){return c(this,yb,"m",Cb).call(this,"getFileToken",e,t,r,n,i,o)}}),Object.defineProperty(e.prototype,"getFileUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return c(this,yb,"m",Cb).call(this,"getFileUrl",e,t,r,n)}}),Object.defineProperty(e.prototype,"setUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"setUserStatus",e)}}),Object.defineProperty(e.prototype,"getUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"getUserStatus",e)}}),Object.defineProperty(e.prototype,"clearConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"clearConversations",e,t)}}),Object.defineProperty(e.prototype,"addToBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"addToBlacklist",e)}}),Object.defineProperty(e.prototype,"removeFromBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"removeFromBlacklist",e)}}),Object.defineProperty(e.prototype,"getBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(){return c(this,yb,"m",Cb).call(this,"getBlacklist")}}),Object.defineProperty(e.prototype,"getBlacklistStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"getBlacklistStatus",e)}}),Object.defineProperty(e.prototype,"insertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"insertMessage",e,t)}}),Object.defineProperty(e.prototype,"batchInsertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"batchInsertMessage",e,t)}}),Object.defineProperty(e.prototype,"getLocalMessageCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"getLocalMessageCount",e)}}),Object.defineProperty(e.prototype,"deleteLocalMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"deleteLocalMessages",e)}}),Object.defineProperty(e.prototype,"deleteLocalMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"deleteLocalMessagesByTimestamp",e,t,r)}}),Object.defineProperty(e.prototype,"batchClearLocalMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"batchClearLocalMessagesByTimestamp",e)}}),Object.defineProperty(e.prototype,"batchClearRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"batchClearRemoteHistoryMessages",e,t)}}),Object.defineProperty(e.prototype,"clearLocalMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"clearLocalMessages",e)}}),Object.defineProperty(e.prototype,"getMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"getMessage",e)}}),Object.defineProperty(e.prototype,"setMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"setMessageContent",e,t,r)}}),Object.defineProperty(e.prototype,"setMessageSearchField",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"setMessageSearchField",e,t,r)}}),Object.defineProperty(e.prototype,"searchConversationByContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return c(this,yb,"m",Cb).call(this,"searchConversationByContent",e,t,r,n)}}),Object.defineProperty(e.prototype,"searchConversationByContentWithAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"searchConversationByContentWithAllChannel",e,t,r)}}),Object.defineProperty(e.prototype,"searchMessagesWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"searchMessagesWithParams",e)}}),Object.defineProperty(e.prototype,"getUnreadMentionedMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"getUnreadMentionedMessages",e)}}),Object.defineProperty(e.prototype,"getUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"getUnreadMentionedCount",e)}}),Object.defineProperty(e.prototype,"getMessagesAroundTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return c(this,yb,"m",Cb).call(this,"getMessagesAroundTimestamp",e,t,r,n)}}),Object.defineProperty(e.prototype,"setMessageSentStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"setMessageSentStatus",e,t)}}),Object.defineProperty(e.prototype,"setMessageReceivedStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"setMessageReceivedStatus",e,t)}}),Object.defineProperty(e.prototype,"updateMessageReceiptStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return c(this,yb,"m",Cb).call(this,"updateMessageReceiptStatus",e,t,r,n)}}),Object.defineProperty(e.prototype,"clearUnreadCountByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"clearUnreadCountByTimestamp",e,t)}}),Object.defineProperty(e.prototype,"clearAllSGUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,c(this,yb,"m",Cb).call(this,"clearAllSGUnreadCount")]}))}))}}),Object.defineProperty(e.prototype,"serverTime",{get:function(){return Date.now()-this._cache.deltaTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"deviceId",{get:function(){return this._cache.deviceId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"setPushConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){}}),Object.defineProperty(e.prototype,"userId",{get:function(){return this._cache.crtUserId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bindRTCRoomForChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"bindRTCRoomForChatroom",e)}}),Object.defineProperty(e.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i;return a(this,(function(o){switch(o.label){case 0:return i=Array.prototype.slice.call(new Uint8Array(n)),[4,c(this,yb,"m",Cb).call(this,"rtcSignaling",e,t,r,i)];case 1:return[2,o.sent().trans((function(e){return new Uint8Array(e)}))]}}))}))}}),Object.defineProperty(e.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"rtcPing",e,t,r)}}),Object.defineProperty(e.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"createTag",e)}}),Object.defineProperty(e.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"removeTag",e)}}),Object.defineProperty(e.prototype,"updateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"updateTag",e)}}),Object.defineProperty(e.prototype,"getTagList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return c(this,yb,"m",Cb).call(this,"getTagList")}}),Object.defineProperty(e.prototype,"addTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"addTagForConversations",e,t)}}),Object.defineProperty(e.prototype,"removeTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"removeTagForConversations",e,t)}}),Object.defineProperty(e.prototype,"removeTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"removeTagsForConversation",e,t)}}),Object.defineProperty(e.prototype,"getConversationListByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"getConversationListByTag",e,t,r)}}),Object.defineProperty(e.prototype,"getUnreadCountByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"getUnreadCountByTag",e,t)}}),Object.defineProperty(e.prototype,"setConversationStatusInTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"setConversationStatusInTag",e,t,r)}}),Object.defineProperty(e.prototype,"getTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"getTagsForConversation",e)}}),Object.defineProperty(e.prototype,"clearLocalData",{enumerable:!1,configurable:!0,writable:!0,value:function(){return c(this,yb,"m",Cb).call(this,"clearLocalData")}}),Object.defineProperty(e.prototype,"setCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"setCallInfo",e,t,r)}}),Object.defineProperty(e.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return c(this,yb,"m",Cb).call(this,"getAllUnreadMentionedCount")}}),Object.defineProperty(e.prototype,"getUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"getUltraGroupList",e)}}),Object.defineProperty(e.prototype,"getBlockedUGList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return c(this,yb,"m",Cb).call(this,"getBlockedUGList")}}),Object.defineProperty(e.prototype,"getBlockedConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"getBlockedConversationList",e)}}),Object.defineProperty(e.prototype,"sendUltraMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return this.sendMessage(e,t,r,n)}}),Object.defineProperty(e.prototype,"getConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"getConversationNotificationLevel",e)}}),Object.defineProperty(e.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"setConversationTypeNotificationLevel",e,t)}}),Object.defineProperty(e.prototype,"getConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"getConversationTypeNotificationLevel",e)}}),Object.defineProperty(e.prototype,"getUGUnreadCountForAllChannels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"getUGUnreadCountForAllChannels",e,t,r)}}),Object.defineProperty(e.prototype,"setUGDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"setUGDefaultNotificationLevel",e,t,r)}}),Object.defineProperty(e.prototype,"getUGDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"getUGDefaultNotificationLevel",e,t)}}),Object.defineProperty(e.prototype,"getUGUnreadInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"getUGUnreadInfoList",e)}}),Object.defineProperty(e.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,c(this,yb,"m",Cb).call(this,"getOSInfo")]}))}))}}),Object.defineProperty(e.prototype,"getProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return a(this,(function(r){return e=window.__RCCppContextBridge__.process,t={title:e.title,pid:e.pid,ppid:e.ppid,platform:e.platform,arch:e.arch,uptime:e.uptime(),cpuUsage:e.cpuUsage(),memoryUsage:e.memoryUsage(),resourceUsage:e.resourceUsage()},[2,fr(t)]}))}))}}),Object.defineProperty(e.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,c(this,yb,"m",Cb).call(this,"getMainProcessInfo")]}))}))}}),Object.defineProperty(e.prototype,"setProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"setProxy",e)}}),Object.defineProperty(e.prototype,"getProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return c(this,yb,"m",Cb).call(this,"getProxy")}}),Object.defineProperty(e.prototype,"testProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"testProxy",e,t)}}),Object.defineProperty(e.prototype,"setCheckDuplicateMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"setCheckDuplicateMessage",e)}}),Object.defineProperty(e.prototype,"setCheckChatRoomDuplicateMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"setCheckChatRoomDuplicateMessage",e)}}),Object.defineProperty(e.prototype,"setNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._send2Main("setNetwork",e,t)}}),Object.defineProperty(e.prototype,"subscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"subscribeUser",e,t,r)}}),Object.defineProperty(e.prototype,"unSubscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"unSubscribeUser",e,t)}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"getSubscribeUserList",e,t,r)}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"getSubscribeUserStatus",e,t)}}),Object.defineProperty(e.prototype,"getConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"getConversations",e)}}),Object.defineProperty(e.prototype,"updateMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"updateMyUserProfile",e)}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"getUserProfiles",e)}}),Object.defineProperty(e.prototype,"getMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return c(this,yb,"m",Cb).call(this,"getMyUserProfile")}}),Object.defineProperty(e.prototype,"updateMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"updateMyUserProfileVisibility",e)}}),Object.defineProperty(e.prototype,"getMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(){return c(this,yb,"m",Cb).call(this,"getMyUserProfileVisibility")}}),Object.defineProperty(e.prototype,"searchUserProfileByUniqueId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"searchUserProfileByUniqueId",e)}}),Object.defineProperty(e.prototype,"createGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){return a(this,(function(i){return[2,c(this,yb,"m",Cb).call(this,"createGroup",e,t,r,n)]}))}))}}),Object.defineProperty(e.prototype,"updateGroupInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"updateGroupInfo",e,t,r)}}),Object.defineProperty(e.prototype,"getGroupsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"getGroupsInfo",e)}}),Object.defineProperty(e.prototype,"kickGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"kickGroupMembers",e,t,r)}}),Object.defineProperty(e.prototype,"quitGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"quitGroup",e,t)}}),Object.defineProperty(e.prototype,"dismissGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"dismissGroup",e)}}),Object.defineProperty(e.prototype,"transferGroupOwner",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return c(this,yb,"m",Cb).call(this,"transferGroupOwner",e,t,r,n)}}),Object.defineProperty(e.prototype,"setGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"setGroupManagers",e,t,r)}}),Object.defineProperty(e.prototype,"getGroupMembersByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"getGroupMembersByRole",e,t,r)}}),Object.defineProperty(e.prototype,"getGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"getGroupMembers",e,t)}}),Object.defineProperty(e.prototype,"setGroupMemberInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return c(this,yb,"m",Cb).call(this,"setGroupMemberInfo",e,t,r,n)}}),Object.defineProperty(e.prototype,"searchGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"searchGroupMembers",e,t,r)}}),Object.defineProperty(e.prototype,"joinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"joinGroup",e)}}),Object.defineProperty(e.prototype,"inviteUsersToGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"inviteUsersToGroup",e,t)}}),Object.defineProperty(e.prototype,"memberInviteResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"memberInviteResponse",e)}}),Object.defineProperty(e.prototype,"getGroupApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"getGroupApplications",e,t,r)}}),Object.defineProperty(e.prototype,"getJoinedGroupsByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"getJoinedGroupsByRole",e,t)}}),Object.defineProperty(e.prototype,"searchJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"searchJoinedGroups",e,t)}}),Object.defineProperty(e.prototype,"getJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"getJoinedGroups",e)}}),Object.defineProperty(e.prototype,"setGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"setGroupRemark",e,t)}}),Object.defineProperty(e.prototype,"setGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"setGroupFollows",e,t,r)}}),Object.defineProperty(e.prototype,"getGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"getGroupFollows",e)}}),Object.defineProperty(e.prototype,"addFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"addFriend",e,t,r)}}),Object.defineProperty(e.prototype,"deleteFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"deleteFriends",e,t)}}),Object.defineProperty(e.prototype,"acceptFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"acceptFriendRequest",e)}}),Object.defineProperty(e.prototype,"refuseFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"refuseFriendRequest",e,t)}}),Object.defineProperty(e.prototype,"setFriendInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"setFriendInfo",e,t,r)}}),Object.defineProperty(e.prototype,"checkFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"checkFriends",e,t)}}),Object.defineProperty(e.prototype,"getFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"getFriends",e,t)}}),Object.defineProperty(e.prototype,"getFriendApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"getFriendApplications",e,t,r)}}),Object.defineProperty(e.prototype,"getFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"getFriendsInfo",e)}}),Object.defineProperty(e.prototype,"searchFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"searchFriendsInfo",e)}}),Object.defineProperty(e.prototype,"setFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"setFriendAddPermission",e)}}),Object.defineProperty(e.prototype,"getFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(){return c(this,yb,"m",Cb).call(this,"getFriendAddPermission")}}),Object.defineProperty(e.prototype,"setNotificationQuietHoursWithSetting",{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,yb,"m",Cb).call(this,"setNotificationQuietHoursWithSetting",e)]}))}))}}),Object.defineProperty(e.prototype,"removeNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,c(this,yb,"m",Cb).call(this,"removeNotificationQuietHoursSetting")]}))}))}}),Object.defineProperty(e.prototype,"getNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,c(this,yb,"m",Cb).call(this,"getNotificationQuietHoursSetting")]}))}))}}),Object.defineProperty(e.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return c(this,yb,"m",Cb).call(this,"getStatsUrlList")}}),Object.defineProperty(e.prototype,"sendReadReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"sendReadReceiptResponseV5",e,t)}}),Object.defineProperty(e.prototype,"getMessageReadReceiptInfoV5ByIdentifiers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"getMessageReadReceiptInfoV5ByIdentifiers",e)}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptUsersByPageV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"getMessagesReadReceiptUsersByPageV5",e,t,r)}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptByUsersV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"getMessagesReadReceiptByUsersV5",e,t,r)}}),Object.defineProperty(e.prototype,"requestSpeechToTextForMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"requestSpeechToTextForMessage",e)}}),Object.defineProperty(e.prototype,"setMessageSpeechToTextVisible",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"setMessageSpeechToTextVisible",e,t)}}),Object.defineProperty(e.prototype,"translateWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return c(this,yb,"m",Cb).call(this,"translateWithParams",e,t,r,n)}}),Object.defineProperty(e.prototype,"setTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"setTranslationLanguage",e)}}),Object.defineProperty(e.prototype,"getTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(){return c(this,yb,"m",Cb).call(this,"getTranslationLanguage")}}),Object.defineProperty(e.prototype,"setAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"setAutoTranslateEnabled",e)}}),Object.defineProperty(e.prototype,"getAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(){return c(this,yb,"m",Cb).call(this,"getAutoTranslateEnabled")}}),Object.defineProperty(e.prototype,"modifyMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"modifyMessageWithParams",e)}}),Object.defineProperty(e.prototype,"refreshReferenceMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,s,u=this;return a(this,(function(a){return i=function(e,t){var r=[e,Date.now(),Math.floor(Math.random()*Date.now())].join("_");return u._resolveMaps[r]=function(r){try{t(r)}catch(t){u.logger.error(B.L_CALLBACK_E,JSON.stringify({error:null==t?void 0:t.stack,pos:e}))}},r},o=i("localMessageBlock",n),s=i("remoteMessageBlock",r),[2,c(this,yb,"m",Cb).call(this,"refreshReferenceMessageWithParams",e,t,s,o)]}))}))}}),Object.defineProperty(e.prototype,"syncRemoteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(){return c(this,yb,"m",Cb).call(this,"syncRemoteConversations")}}),Object.defineProperty(e.prototype,"sendUltraGroupTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"sendUltraGroupTypingStatus",e)}}),Object.defineProperty(e.prototype,"getRemoteMessagesByUIds",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"getRemoteMessagesByUIds",e,t)}}),Object.defineProperty(e.prototype,"getUGUnreadMentionedDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"getUGUnreadMentionedDigest",e)}}),Object.defineProperty(e.prototype,"deleteLocalUGMessagesForAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"deleteLocalUGMessagesForAllChannel",e,t)}}),Object.defineProperty(e.prototype,"updateUGMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return c(this,yb,"m",Cb).call(this,"updateUGMessageExpansion",e,t,r)}}),Object.defineProperty(e.prototype,"getUGFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"getUGFirstUnreadMessageDigest",e)}}),Object.defineProperty(e.prototype,"getSubscribeUsersOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"getSubscribeUsersOnlineStatus",e)}}),Object.defineProperty(e.prototype,"saveEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"saveEditedMessageDraft",e,t)}}),Object.defineProperty(e.prototype,"getEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"getEditedMessageDraft",e)}}),Object.defineProperty(e.prototype,"clearEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"clearEditedMessageDraft",e)}}),Object.defineProperty(e.prototype,"getUnreadMentionMeConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"getUnreadMentionMeConversationList",e,t)}}),Object.defineProperty(e.prototype,"getAllRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(){return c(this,yb,"m",Cb).call(this,"getAllRobots")}}),Object.defineProperty(e.prototype,"getConversationsIncludingRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"getConversationsIncludingRobots",e)}}),Object.defineProperty(e.prototype,"getMessagesByUIds",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return c(this,yb,"m",Cb).call(this,"getMessagesByUIds",e,t)}}),Object.defineProperty(e.prototype,"appkey",{get:function(){return this._initOptions.appkey},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){}}),Object.defineProperty(e.prototype,"addMessageReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"addMessageReaction",e)}}),Object.defineProperty(e.prototype,"removeMessageReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"removeMessageReaction",e)}}),Object.defineProperty(e.prototype,"batchGetMessageReactionSummaries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"batchGetMessageReactionSummaries",e)}}),Object.defineProperty(e.prototype,"getMessageReactions",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"getMessageReactions",e)}}),Object.defineProperty(e.prototype,"getMessageReactionUsers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,yb,"m",Cb).call(this,"getMessageReactionUsers",e)}}),e}();function Yb(e){return n({},e)}Ab=new WeakMap,Ob=new WeakMap,Sb=new WeakMap,yb=new WeakSet,Cb=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var i=br(),o=i.promise,a=i.resolve,s=Fb(e);return this._resolveMaps[s]=function(e){var t=e.code,r=e.msg,n=e.data;a(dr.from(t,r,n))},(t=window.__RCCppContextBridge__.ipcRenderer).send.apply(t,l(["__RC_CHANNEL_CALL_MAIN__",s,e],u(r),!1)),o};var Wb=function(){function e(e){var t,r,i=this;Nb.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,"chatroom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"chat",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dataHosting",{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,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_compatibleMessageProccessor",{enumerable:!0,configurable:!0,writable:!0,value:(t={},t[me.TYPING_STATUS]=this._processTypingStatusMessage.bind(this),t[me.INTERCEPT]=this._processInterceptMessage.bind(this),t)}),Object.defineProperty(this,"_messageProccessor",{enumerable:!0,configurable:!0,writable:!0,value:(r={},r[me.READ_RECEIPT]=this._processReadReceiptMessage.bind(this),r[me.READ_RECEIPT_REQUEST]=this._processReadReceiptRequestMessage.bind(this),r[me.READ_RECEIPT_RESPONSE]=this._processReadReceiptResponseMessage.bind(this),r)}),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,robotsSynced: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,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,databaseOpened: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,syncServerSaveUnreadCompleted:void 0,messageReaction: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:[]}),Object.defineProperty(this,"_rtcListener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._options=n({},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={onRTCDataChange:this._rtcDataChange.bind(this),onConnected:function(){return i._onConnectionStatusChange(exports.RCConnectionStatus.CONNECTED)},onConnecting:this._onConnectionStatusChange.bind(this,exports.RCConnectionStatus.CONNECTING),onSuspend:this._onConnectionStatusChange.bind(this,exports.RCConnectionStatus.SUSPENDED),onDisconnected:this._onConnectionStatusChange.bind(this,exports.RCConnectionStatus.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),robotsSynced:this._onRobotsSynced.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),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),databaseOpened:this._databaseOpened.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),syncServerSaveUnreadCompleted:this._syncServerSaveUnreadCompleted.bind(this),messageReaction:this._onMessageReaction.bind(this)},a=Pt();this._engine=a?new Hb(o,this._options):new ob(o,this._options),this.logger=this._engine.logger,this._options.eventLoopBlockingCheck&&tn.start(this.logger),this.sse=new zl(this,a),this.chatroom=new hb(this._engine,this._engine.chatroom),this.dataHosting=new Tb(this._engine,this._engine.dataHosting),this.chat=new mb(this._engine,this._engine.chat)}return Object.defineProperty(e,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this._context)return this._context.logger.warn(B.A_INIT_REPEAT_O),this._context;this._context=new e(t),this._context.logger.info(B.L_INIT_O,JSON.stringify({appkey:t.appkey,navigators:t.navigators,typingExpireTime:t.typingExpireTime,runtime:ua.tag})),this._context.logger.warn(B.L_IMSDK_VER_O,JSON.stringify({commitId:"57856dfc3403c77df9293fb0d5c8e476a8a301da",version:"5.42.0"}));var r=this._context._engine;return ua.setNetworkStatusListener(r.setNetwork.bind(r)),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(B.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 r=this.logger.createTraceId();if(this.logger.info(B.L_INSTALL_PLUGIN_T,JSON.stringify({tag:e.tag}),r),this._pluginInstanseMap[e.tag])return this.logger.warn(B.L_INSTALL_PLUGIN_R,"repeat install",r),this._pluginInstanseMap[e.tag];var n="RCRTC"===e.tag?new rc(this):new tc(this),i=null;try{if(!e.verify(ua))return null;i=e.setup(n,ua,t)}catch(e){this.logger.error(B.L_INSTALL_PLUGIN_R,null==e?void 0:e.stack,r)}return["RCRTC","RCCall"].includes(e.tag)&&e.version&&e.name&&(this._versionInfo[e.name]=e.version),i&&(this._pluginContextQueue.push(n),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 ab(e)}))}}),Object.defineProperty(e.prototype,"_onConnectionStatusChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n;this.logger.warn(B.A_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),null===(n=(r=this._watcher).connection)||void 0===n||n.call(r,e,t),this._pluginContextQueue.forEach((function(r){var n;null===(n=r.onconnectionstatechange)||void 0===n||n.call(r,e,t)}))}}),Object.defineProperty(e.prototype,"_processTypingStatusMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._addTypingInfo(Yb(e)),!!this._watcher.typingState}}),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===exports.ConversationType.ULTRA_GROUP){var r=e.content.sourceType;if(t.sourceType=r,(r===exports.MessageBlockSourceType.MSG_EXPANSION||r===exports.MessageBlockSourceType.MSG_MODIFY)&&e.content.sourceContent)try{t.sourceContent=JSON.parse(e.content.sourceContent)}catch(e){this.logger.warn(B.L_CALLBACK_E,JSON.stringify({source:"message.content.sourceContent",msg:e.message}))}}return this._MessageBlockedListener(t),!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,r=null===(t=e.content)||void 0===t?void 0:t.receiptMessageDic,n=this._engine.userId;r&&Array.isArray(r[n])&&"function"==typeof this._watcher.messageReceiptResponse&&this._watcher.messageReceiptResponse({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.senderUserId,r[n])}}),Object.defineProperty(e.prototype,"_messageReceiver",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n,i,o,a,s=this;if(!(null===(i=(n=this._compatibleMessageProccessor)[e.messageType])||void 0===i?void 0:i.call(n,e))&&!this._pluginContextQueue.some((function(t){if(!t.onmessage)return!1;try{return t.onmessage(Yb(e))}catch(e){return s.logger.error(B.A_MSG_LISTENER_E,null==e?void 0:e.stack),!1}})))return null===(a=(o=this._watcher).message)||void 0===a||a.call(o,Yb(e),t,r),e}}),Object.defineProperty(e.prototype,"_batchMessageReceiver",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this,i=[],o=[],a=[me.READ_RECEIPT,me.READ_RECEIPT_REQUEST,me.READ_RECEIPT_RESPONSE];e.forEach((function(e){var s=n._messageReceiver(e,t,r);s&&a.includes(s.messageType)?o.push(s):s&&i.push(s)})),i.length&&this._watcher.batchMessage&&(this.logger.debug(B.L_BATCH_MESSAGE_O,i.map((function(e){return e.messageUId})).join(",")),this._watcher.batchMessage(i)),o.length&&o.forEach((function(e){n._messageProccessor[e.messageType]&&n._messageProccessor[e.messageType](e)}))}}),Object.defineProperty(e.prototype,"_chatroomInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).chatroomState)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_conversationInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).conversationState)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_expansionInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).expansion)||void 0===r||r.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,r;null===(r=(t=this._watcher).userSettingsSynced)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_onUserSettingsChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).userSettingsChanged)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_onConversationStatusSynced",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).conversationStatusSynced)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_onRobotsSynced",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n;null===(n=(r=this._watcher).robotsSynced)||void 0===n||n.call(r,e,t)}}),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,r;null===(r=(t=this._watcher).typingState)||void 0===r||r.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,r;null===(r=(t=this._watcher).messageBlocked)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_callInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;this._pluginContextQueue.forEach((function(r){try{r.onCallInfo&&r.onCallInfo(e)}catch(e){t.logger.warn(B.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(e){var t,r;null===(r=(t=this._watcher).sgRelationsSynced)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_operateStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).operateStatus)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupMessageExpansionUpdatedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupMessageExpansionUpdated)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupMessageRecalledListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupMessageRecalled)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupChannelChangeTypeListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupChannelChangeType)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupChannelUserKickedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupChannelUserKicked)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupChannelDeleteListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupChannelDelete)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_userGroupStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).userGroupStatus)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_messageReadReceipt",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).messageReadReceipt)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_syncReadStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).syncReadStatus)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_subscribedUserStatusChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).subscribedUserStatusChange)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_subscribedRelationChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).subscribedRelationChange)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_syncSubscribedUserStatusFinished",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;this.logger.info(B.L_SYNC_SUBSCRIBED_USER_STATUS_FINISHED_S),null===(r=(t=this._watcher).syncSubscribedUserStatusFinished)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ownUserProfileChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;this.logger.info(B.L_OWN_USER_PROFILE_CHANGED_S),null===(r=(t=this._watcher).ownUserProfileChanged)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupOperation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupOperation)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupInfoChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupInfoChanged)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupMemberInfoChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupMemberInfoChanged)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupApplicationEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupApplicationEvent)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupRemarkChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupRemarkChangedSync)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupFollowsChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupFollowsChangedSync)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendAdd",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendAdd)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendDelete",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendDelete)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendApplicationStatusChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendApplicationStatusChanged)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendCleared",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendCleared)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendInfoChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendInfoChangedSync)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_naviDataChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._pluginContextQueue.forEach((function(t){var r;null===(r=t.onnavidatachange)||void 0===r||r.call(t,e)}))}}),Object.defineProperty(e.prototype,"_databaseOpened",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n;null===(n=(r=this._watcher).databaseOpened)||void 0===n||n.call(r,e,t)}}),Object.defineProperty(e.prototype,"_databaseUpgradeWillStart",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;this.logger.info(B.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,r;this.logger.info(B.L_DB_UPGRATING_S,e),null===(r=(t=this._watcher).databaseUpgrading)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_databaseUpgradeDidComplete",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;this.logger.info(B.L_DB_UPGRATE_COMPLETE_S),null===(r=(t=this._watcher).databaseUpgradeDidComplete)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_readReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).readReceiptResponseV5)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_speechToTextResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).speechToTextResponse)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_translateResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).translateResponse)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_messagesModified",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).messagesModified)||void 0===r||r.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,"_syncServerSaveUnreadCompleted",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).syncServerSaveUnreadCompleted)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_onMessageReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).messageReaction)||void 0===r||r.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(r){if(Object.prototype.hasOwnProperty.call(e,r)){var n=e[r];t._watcher[r]=mt(n)||Rt(n)?n: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,r=e.conversationType,n=e.targetId,i=e.content,o=e.channelId,a=i.typingContentType,s=o||"",u="".concat(r,"#").concat(n,"#").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 r=e._typingInfo[t].length;e._typingInfo[t]=e._typingInfo[t].filter((function(t){return Date.now()-t.timestamp<e._typingExpireTime})),e._typingInfo[t].length===r||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.connectedTime}}),Object.defineProperty(e.prototype,"getServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.serverTime}}),Object.defineProperty(e.prototype,"getDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.deviceId}}),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.userId}}),Object.defineProperty(e.prototype,"getConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.connectionStatus}}),Object.defineProperty(e.prototype,"isConnected",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.connectionStatus===exports.RCConnectionStatus.CONNECTED}}),Object.defineProperty(e.prototype,"_validateUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return 1!==e.userProfile?_r(exports.ErrorCode.RC_USER_PROFILE_SERVICE_UNAVAILABLE):fr(e)}}),Object.defineProperty(e.prototype,"validateConnected",{get:function(){var e=this;return function(){return e.checkAuthed(!1)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"validateLogin",{get:function(){var e=this;return function(){return e.checkAuthed(!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"checkAuthed",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.connectionStatus===exports.RCConnectionStatus.CONNECTED||this._engine.userId&&e?fr(this._engine.naviInfo):_r(exports.ErrorCode.RC_NET_UNAVAILABLE)}}),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){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),r),[4,pr.create("connect").isNotEmptyString("token",e).fail(exports.ErrorCode.RC_CONN_TOKEN_INCORRECT).result().next((function(){return c(i,Nb,"m",Mb).call(i,e,!!t,r)}))];case 1:return n=o.sent(),this.logger.summary(B.A_CONNECT_R,n,r,void 0,(function(e){return{userId:e}})),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return a(this,(function(r){return this.logger.info(B.A_DISCONNECT_O,JSON.stringify({closeDB:e,disablePush:t})),[2,c(this,Nb,"m",Pb).call(this,e,t)]}))}))}}),Object.defineProperty(e.prototype,"reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r;return a(this,(function(n){switch(n.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_RECONNECT_T,JSON.stringify({reconnectKickEnable:e}),t),[4,c(this,Nb,"m",Mb).call(this,this.token,!!e,t)];case 1:return r=n.sent(),this.logger.summary(B.A_RECONNECT_R,r,t,void 0,(function(e){return{userId:e}})),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"_channelIdConvert",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(e!==exports.ConversationType.ULTRA_GROUP)return t;var r=this.getNaviInfoFromCache();return!!(2&((null==r?void 0:r.ugDriven)||0))&&!t?"RCDefault":t}}),Object.defineProperty(e.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.naviInfo}}),Object.defineProperty(e.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i,o){void 0===i&&(i=[]),void 0===o&&(o=!1);var a,s,u,l={isPersited:t,isCounted:r,searchProps:i,isStatusMessage:o};a=e,s=l,(u=gn.get(a))&&!u.isCustom&&console.warn("Builtin message type '".concat(a,"' cannot be registered")),s.isStatusMessage&&(s.isCounted=s.isPersited=!1),gn.set(a,n(n({},s),{isCustom:!0})),this._engine.registerMessageType(e,l)}}),Object.defineProperty(e.prototype,"_rtcDataChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;null===(t=this._rtcListener)||void 0===t||t.call(this,e)}}),Object.defineProperty(e.prototype,"registerRTCSignalingListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._rtcListener=e}}),Object.defineProperty(e.prototype,"sendMessageByPlugin",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.L_SEND_MSG_T,JSON.stringify({identifier:e,messageType:t.messageType}),n),[4,c(this,Nb,"m",wb).call(this,e,t,n,r)];case 1:return i=o.sent(),this.logger.summary(B.L_SEND_MSG_R,i,n,void 0,(function(t){return{messageId:t.messageId,messageUId:t.messageUId,messageType:t.messageType,identifier:e}})),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i;return a(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SEND_MSG_T,JSON.stringify({identifier:e,messageType:t.messageType}),n),[4,c(this,Nb,"m",wb).call(this,e,t,n,r)];case 1:return i=o.sent(),this.logger.summary(B.A_SEND_MSG_R,i,n,void 0,(function(t){return{messageId:t.messageId,messageUId:t.messageUId,messageType:t.messageType,identifier:e}})),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"updateMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){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(B.A_UPDATE_MSG_EXPANSION_T,JSON.stringify({expansion:e,attrs:t}),r),[4,pr.create("updateMessageExpansion").check((function(r){return lc(r,t,Object.keys(e||{}))})).check((function(r){return cc(r,e,t.canIncludeExpansion)})).result().tryTrans(this.validateConnected).next((function(){var i={put:e,mid:t.messageUId},a=n(n({},t),{channelId:o._channelIdConvert(t.conversationType,t.channelId)});return t.conversationType===exports.ConversationType.ULTRA_GROUP?o._engine.chat.updateUGMessageExpansion(a,i,t.sentTime):c(o,Nb,"m",Db).call(o,a,i,r)}))];case 1:return i=a.sent(),this.logger.summary(B.A_UPDATE_MSG_EXPANSION_R,i,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"removeMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){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(B.A_REMOVE_MSG_EXPANSION_T,JSON.stringify({keys:e,attrs:t}),r),[4,pr.create("removeMessageExpansion").isLimitedTypedArray("keys",e,20,(function(e){return"string"==typeof e&&/^[A-Za-z0-9_=+-]+$/.test(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEYS).check((function(r){return lc(r,t,e)})).result().tryTrans(this.validateConnected).next((function(){var i={del:e,mid:t.messageUId},a=n(n({},t),{channelId:o._channelIdConvert(t.conversationType,t.channelId)});return t.conversationType===exports.ConversationType.ULTRA_GROUP?o._engine.chat.updateUGMessageExpansion(a,i,t.sentTime):c(o,Nb,"m",Db).call(o,a,i,r)}))];case 1:return i=a.sent(),this.logger.summary(B.A_REMOVE_MSG_EXPANSION_R,i,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"removeAllMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,i=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_ALL_MSG_EXPANSION_T,JSON.stringify({attrs:e}),t),[4,pr.create("removeAllMessageExpansion").check((function(t){return lc(t,e,[])})).check((function(t){e.conversationType!==exports.ConversationType.ULTRA_GROUP&&t.setFailed(exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT)})).result().tryTrans(this.validateConnected).next((function(){var r={clear:1,mid:e.messageUId},o=n(n({},e),{channelId:i._channelIdConvert(e.conversationType,e.channelId)});return e.conversationType===exports.ConversationType.ULTRA_GROUP?i._engine.chat.updateUGMessageExpansion(o,r,e.sentTime):c(i,Nb,"m",Db).call(i,o,r,t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_REMOVE_ALL_MSG_EXPANSION_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,s=this;return a(this,(function(u){switch(u.label){case 0:return n=n||this.logger.createTraceId(),this.logger.info(B.A_SEND_READ_RECEIPT_V2_T,JSON.stringify({targetId:e,messageUIds:t,channelId:r}),n),[4,pr.create("sendReadReceiptV2").validate("targetId",e,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isLimitedTypedArray("messageUIds",t,Number.MAX_SAFE_INTEGER,vt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).validate("channelId",r,Ct).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(n){return o(s,void 0,void 0,(function(){return a(this,(function(i){return 1!==n.grpRRVer?[2,_r(exports.ErrorCode.READ_RECEIPT_ERROR,"The read receipt switch is not on, please call the sendMessage method.")]:[2,this._engine.chat.sendReadReceiptV2(e,t,r)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(B.A_SEND_READ_RECEIPT_V2_R,i,n),[2,i]}}))}))}}),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 tn.stop(),this._resetWatcher(),this._engine.destroy(),ua.removeNetworkStatusListener(),[4,c(this,Nb,"m",Pb).call(this)];case 1:return t.sent(),this._pluginContextQueue.forEach((function(t){if(t.ondestroy)try{t.ondestroy()}catch(t){e.logger.error(B.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){return o(this,void 0,void 0,(function(){var r,n,i,o,s,u,l=this;return a(this,(function(a){switch(a.label){case 0:return r=null==t?void 0:t.timestamp,n=null==t?void 0:t.count,i=null==t?void 0:t.order,o=null==t?void 0:t.messageType,s=this.logger.createTraceId(),this.logger.info(B.A_GET_HISTORY_MSG_T,JSON.stringify({conversation:e,options:t}),s),[4,pr.create("getHistoryMessage").check((function(t){return uc(t,e,Q)})).isLimitedInteger("timestamp",r,0,Number.MAX_SAFE_INTEGER).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("order",i,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isLimitedInteger("count",n,1,100).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isNotEmptyString("messageType",o).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).result().tryTrans(this.validateConnected).next((function(){var t={timestamp:r||0,count:n||20,order:i||0,messageType:o||""},a=c(l,Nb,"m",Lb).call(l,e);return l._engine.getHistoryMessage(a,t,!0)}))];case 1:return u=a.sent(),this.logger.summary(B.A_GET_HISTORY_MSG_R,u,s),[2,u]}}))}))}}),Object.defineProperty(e.prototype,"getContinuousMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_CONTINUOUS_MSGS_T,JSON.stringify({conversation:e,options:t}),r),[4,pr.create("getContinuousMessages").check((function(t){return uc(t,e,q)})).isLimitedInteger("timestamp",null==t?void 0:t.timestamp,0,Number.MAX_SAFE_INTEGER).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("count",null==t?void 0:t.count,1,100).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("order",null==t?void 0:t.order,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).result().tryTrans(this.validateLogin).next((function(){var r=c(i,Nb,"m",Lb).call(i,e),n={timestamp:t.timestamp||0,count:t.count||20,order:t.order||0,messageType:""};return i._engine.chat.getContinuousMessages(r,n)}))];case 1:return n=o.sent(),this.logger.summary(B.A_GET_CONTINUOUS_MSGS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getHistoryMessagesByObjectNames",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_HIS_MSGS_BY_OBJ_NAMES_T,JSON.stringify({conversation:e,option:t}),r),[4,pr.create("getHistoryMessagesByObjectNames").check((function(t){return uc(t,e,X)})).isLimitedInteger("timestamp",null==t?void 0:t.timestamp,0,Number.MAX_SAFE_INTEGER).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("count",null==t?void 0:t.count,1,100).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("order",null==t?void 0:t.order,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isTypedArray("messageTypes",null==t?void 0:t.messageTypes,vt).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).result().tryTrans(this.validateLogin).next((function(){var r=c(i,Nb,"m",Lb).call(i,e),n={timestamp:t.timestamp||0,count:t.count||20,order:t.order||0,messageTypes:t.messageTypes||[]};return i._engine.chat.getHistoryMessagesByObjectNames(r,n)}))];case 1:return n=o.sent(),this.logger.summary(B.A_GET_HIS_MSGS_BY_OBJ_NAMES_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getTopConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(s){switch(s.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_TOP_CONVERSATION_LIST_T,JSON.stringify({conversationTypes:e,channelId:t}),r),[4,pr.create("getTopConversationList").isTypedArray("conversationTypes",e,(function(e){return te(e,K)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).validate("channelId",t,Ct).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(r){return o(i,void 0,void 0,(function(){var n;return a(this,(function(i){return(n=xg(r))&&!this._engine.chat.ugSynced?[2,_r(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getTopConversationList(n,e,t)]}))}))}))];case 1:return n=s.sent(),this.logger.summary(B.A_GET_TOP_CONVERSATION_LIST_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UNREAD_CONVERSATION_LIST_T,JSON.stringify({conversationTypes:e}),t),[4,pr.create("getUnreadConversationList").isTypedArray("conversationTypes",e,(function(e){return te(e,K)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateConnected).next((function(t){return o(n,void 0,void 0,(function(){var r;return a(this,(function(n){return(r=xg(t))&&!this._engine.chat.ugSynced?[2,_r(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getUnreadConversationList(r,e)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(B.A_GET_UNREAD_CONVERSATION_LIST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getBlockedConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_BLOCKED_CONVERSATION_LIST_T,"",e),[4,pr.create("getBlockedConversationList").result().tryTrans(this.validateConnected).next((function(e){return o(r,void 0,void 0,(function(){var t;return a(this,(function(r){return(t=xg(e))&&!this._engine.chat.ugSynced?[2,_r(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getBlockedConversationList(t)]}))}))}))];case 1:return t=n.sent(),this.logger.summary(B.A_GET_BLOCKED_CONVERSATION_LIST_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"getConversationListByPageIndex",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r=this;return a(this,(function(n){switch(n.label){case 0:return[4,pr.create("getConversationListByPageIndex").isInteger("index",e,!0).fail(exports.ErrorCode.CONVER_GET_ERROR,"page index must be an integer").isInteger("limit",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_LIMIT).result().tryTrans(this.validateLogin).next((function(){return r._engine.chat.getConversationListByPageIndex(e,t)}))];case 1:return[2,n.sent()]}}))}))}}),Object.defineProperty(e.prototype,"getAllConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_ALL_CONVERSATION_LIST_T,JSON.stringify({channelId:e}),t),[4,pr.create("getAllConversationList").validate("channelId",e,Ct).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateLogin).next((function(t){return o(n,void 0,void 0,(function(){var r;return a(this,(function(n){return(r=xg(t))&&!this._engine.chat.ugSynced?[2,_r(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getAllConversationList(r,e)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(B.A_GET_ALL_CONVERSATION_LIST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r;return a(this,(function(n){switch(n.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_CONVERSATION_LIST_OLD_T,JSON.stringify(e),t),[4,Pt()&&"string"!=typeof(null==e?void 0:e.channelId)?this.getAllConversationList(null==e?void 0:e.channelId):this.getConversationListByTimestamp(e)];case 1:return r=n.sent(),this.logger.summary(B.A_GET_CONVERSATION_LIST_OLD_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getConversationListByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_CONVERSATION_LIST_BY_TIME_T,JSON.stringify(e),t),[4,pr.create("getConversationListByTimestamp").isObject("params",e,!0).fail(exports.ErrorCode.CONVER_GET_ERROR,"params must be an object").isInteger("startTime",null==e?void 0:e.startTime,!0).fail(exports.ErrorCode.INVALID_PARAMETER_START_TIME).isInteger("count",null==e?void 0:e.count,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("order",null==e?void 0:e.order,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).validate("channelId",null==e?void 0:e.channelId,Ct).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",null==e?void 0:e.conversationTypes,(function(e){return te(e,K)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans((function(){return n.checkAuthed(Pt())})).next((function(t){return o(n,void 0,void 0,(function(){var r;return a(this,(function(n){return(r=xg(t))&&!this._engine.chat.ugSynced?[2,_r(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getConversationListByTimestamp(e,r)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(B.A_GET_CONVERSATION_LIST_BY_TIME_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_CONVERSATION_T,JSON.stringify(e),t),[4,pr.create("getConversation").check((function(t){return uc(t,e,Q)})).result().tryTrans(this.validateConnected).next((function(){var t=c(n,Nb,"m",Lb).call(n,e);return n._engine.chat.getConversation(t)}))];case 1:return r=i.sent(),this.logger.summary(B.A_GET_CONVERSATION_R,r,t,e),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"removeConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_CONVERSATION_T,JSON.stringify(e),r),[4,pr.create("removeConversation").check((function(t){return uc(t,e,K)})).result().tryTrans(this.validateConnected).next((function(){var r=c(i,Nb,"m",Lb).call(i,e);return i._engine.chat.batchDeleteConversations({identifiers:[r],deleteRemotely:!!t,deleteMessages:!1})}))];case 1:return n=o.sent(),this.logger.summary(B.A_REMOVE_CONVERSATION_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"batchDeleteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,s,u=this;return a(this,(function(l){switch(l.label){case 0:return t=null==e?void 0:e.identifiers,r=!!(null==e?void 0:e.deleteRemotely),n=!!(null==e?void 0:e.deleteMessages),i=this.logger.createTraceId(),this.logger.info(B.A_BATCH_DEL_CONVERS_T,JSON.stringify({identifiers:t,deleteRemotely:r,deleteMessages:n}),i),[4,pr.create("batchDeleteConversations").isLimitedArray("identifiers",t,100,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST).result().tryTrans(this.validateConnected).next((function(){return o(u,void 0,void 0,(function(){var e,i=this;return a(this,(function(o){return 0===(e=t.filter((function(e){return sc("",e,K).result().isOk})).map((function(e){return c(i,Nb,"m",Lb).call(i,e)}))).length?[2,fr()]:[2,this._engine.chat.batchDeleteConversations({identifiers:e,deleteRemotely:r,deleteMessages:n})]}))}))}))];case 1:return s=l.sent(),this.logger.summary(B.A_BATCH_DEL_CONVERS_R,s,i),[2,s.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,s=this;return a(this,(function(u){switch(u.label){case 0:return t=null==e?void 0:e.targetId,r=null==e?void 0:e.channelType,n=this.logger.createTraceId(),this.logger.info(B.A_GET_UG_LIST_T,JSON.stringify({targetId:t,channelType:r}),n),[4,pr.create("getUltraGroupList").validate("targetId",t,Nt).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isNumberEnum("channelType",r,exports.UltraGroupChannelType).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_TYPE).result().tryTrans(this.validateLogin).next((function(){return o(s,void 0,void 0,(function(){return a(this,(function(t){return this._engine.chat.ugSynced?[2,this._engine.chat.getUltraGroupList(e)]:[2,_r(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(B.A_GET_UG_LIST_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getBlockedUGList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_BLOCKED_UG_LIST_T,"",e),[4,pr.create("getBlockedUGList").result().tryTrans(this.validateConnected).next((function(){return o(r,void 0,void 0,(function(){return a(this,(function(e){return this._engine.chat.ugSynced?[2,this._engine.chat.getBlockedUGList()]:[2,_r(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return t=n.sent(),this.logger.summary(B.A_GET_BLOCKED_UG_LIST_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UNREAD_COUNT_T,JSON.stringify(e),t),[4,pr.create("getUnreadCount").check((function(t){return uc(t,e,X)})).result().tryTrans(this.validateLogin).next((function(){return o(n,void 0,void 0,(function(){var t;return a(this,(function(r){return e.conversationType!==exports.ConversationType.ULTRA_GROUP||this._engine.chat.ugSynced?(t=c(this,Nb,"m",Lb).call(this,e),[2,this._engine.chat.getConversationUnreadCount(t)]):[2,_r(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(B.A_GET_UNREAD_COUNT_R,r,t,void 0,(function(e){return{unreadCount:e}})),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,s=this;return a(this,(function(u){switch(u.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_TOTAL_UNREAD_COUNT_T,JSON.stringify({conversationTypes:e,includeMuted:t,channelId:r}),n),[4,pr.create("getTotalUnreadCount").validate("channelId",r,Ct).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",e,(function(e){return te(e,X)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateLogin).next((function(n){return o(s,void 0,void 0,(function(){var i,o;return a(this,(function(a){return!(i=xg(n))&&e&&e.includes(exports.ConversationType.ULTRA_GROUP)?[2,_r(exports.ErrorCode.METHOD_NOT_SUPPORT)]:(o=e&&e.length>0?e:ee(i?K:J)).includes(exports.ConversationType.ULTRA_GROUP)&&!this._engine.chat.ugSynced?[2,_r(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getTotalUnreadCount(o,!!t,r)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(B.A_GET_TOTAL_UNREAD_COUNT_R,i,n,void 0,(function(e){return{unreadCount:e}})),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,s=this;return a(this,(function(u){switch(u.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_TOTAL_UNREAD_COUNT_BY_LEVELS_T,JSON.stringify({conversationTypes:e,levels:t,isMentioned:r}),n),[4,pr.create("getTotalUnreadCountByLevels").isLimitedTypedArray("conversationTypes",e,20,(function(e){return te(e,K)}),!0).fail(exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT).isTypedArray("levels",t,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateLogin).next((function(){return o(s,void 0,void 0,(function(){return a(this,(function(n){return e.includes(exports.ConversationType.ULTRA_GROUP)&&!this._engine.chat.ugSynced?[2,_r(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getTotalUnreadCountByLevels(e,t,r)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(B.A_GET_TOTAL_UNREAD_COUNT_BY_LEVELS_R,i,n,void 0,(function(e){return{unreadCount:e}})),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getFirstUnreadMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_FIRST_UNREAD_MEG_T,JSON.stringify(e),t),[4,pr.create("getFirstUnreadMessage").check((function(t){return uc(t,e,X)})).result().tryTrans(this.validateLogin).next((function(){var t=c(n,Nb,"m",Lb).call(n,e);return n._engine.chat.getFirstUnreadMessage(t)}))];case 1:return r=i.sent(),this.logger.summary(B.A_GET_FIRST_UNREAD_MSG_R,r,t,e),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_FIRST_UNREAD_MSG_DIGEST_T,JSON.stringify(e),t),[4,pr.create("getFirstUnreadMessageDigest").check((function(t){return uc(t,e,X)})).result().tryTrans(this.validateLogin).next((function(){var t=c(n,Nb,"m",Lb).call(n,e);return n._engine.chat.getFirstUnreadMessageDigest(t)}))];case 1:return r=i.sent(),this.logger.summary(B.A_GET_FIRST_UNREAD_MSG_DIGEST_R,r,t,e),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_T,JSON.stringify({conversations:e,notificationLevel:t}),r),[4,pr.create("batchSetConversationNotificationLevel").isLimitedTypedArray("conversations",e,20,(function(e){return!sc("batchSetConversationNotificationLevel",e,K).isFailed}),!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST).isNumberEnum("notificationLevel",t,exports.NotificationLevel,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected).next((function(){var r=e.map((function(e){return c(i,Nb,"m",Lb).call(i,e)}));return i._engine.chat.batchSetConversationNotificationLevel(r,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationToTop",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){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=pr.create("batchSetConversationToTop"),(o=i.isLimitedTypedArray("conversations",e,20,(function(e){return sc("batchSetConversationToTop",e,K).result().isOk}),!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST).result().tryTrans((function(){return e.every((function(e){return e.conversationType!==exports.ConversationType.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId}))?fr():_r(exports.ErrorCode.ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING)})).tryTrans(this.validateConnected)).isOk?(s=this.logger.createTraceId(),u=e.map((function(e){return c(d,Nb,"m",Lb).call(d,e)})),this.logger.info(B.A_BATCH_SET_CONVERSATION_TO_TOP_T,JSON.stringify({conversations:u,isTop:t,isUpdateTime:r,isCreateConversation:n}),s),[4,this._engine.chat.batchSetConversationToTop(u,t,r,n)]):[2,o.wipe()];case 1:return l=a.sent(),this.logger.summary(B.A_BATCH_SET_CONVERSATION_TO_TOP_R,l,s),[2,l]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationTranslateStrategy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return r=pr.create("batchSetConversationTranslateStrategy"),(n=r.isLimitedTypedArray("conversations",e,20,(function(e){return sc("",e,K).result().isOk}),!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST).isNumberEnum("strategy",t,Sn,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TRANSLATE_STRATEGY).result().tryTrans(this.validateConnected)).isOk?(i=this.logger.createTraceId(),this.logger.info(B.A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_T,JSON.stringify({conversations:e,strategy:t}),i),o=e.map((function(e){return c(u,Nb,"m",Lb).call(u,e)})),[4,this._engine.chat.batchSetConversationTranslateStrategy(o,t)]):[2,n.wipe()];case 1:return s=a.sent(),this.logger.summary(B.A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_R,s,i),[2,s]}}))}))}}),Object.defineProperty(e.prototype,"saveTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r=this;return a(this,(function(n){switch(n.label){case 0:return[4,sc("saveTextMessageDraft",e,X).isString("draft",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_DRAFT).result().tryTrans(this.validateLogin).next((function(){var n=c(r,Nb,"m",Lb).call(r,e);return r._engine.saveTextMessageDraft(n,t)}))];case 1:return[2,n.sent()]}}))}))}}),Object.defineProperty(e.prototype,"getTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t=this;return a(this,(function(r){switch(r.label){case 0:return[4,sc("getTextMessageDraft",e,X).result().tryTrans(this.validateLogin).next((function(){var r=c(t,Nb,"m",Lb).call(t,e);return t._engine.getTextMessageDraft(r)}))];case 1:return[2,r.sent()]}}))}))}}),Object.defineProperty(e.prototype,"clearTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t=this;return a(this,(function(r){switch(r.label){case 0:return[4,sc("clearTextMessageDraft",e,X).result().tryTrans(this.validateLogin).next((function(){var r=c(t,Nb,"m",Lb).call(t,e);return t._engine.clearTextMessageDraft(r)}))];case 1:return[2,r.sent()]}}))}))}}),Object.defineProperty(e.prototype,"recallMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),n={conversation:e,messageUId:null==t?void 0:t.messageUId},this.logger.info(B.A_RECALL_MESSAGE_T,JSON.stringify(n),r),[4,pr.create("recallMessage").check((function(t){return uc(t,e,Q)})).isNotEmptyString("messageUId",t.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isInteger("sentTime",t.sentTime,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isBoolean("disableNotification",t.disableNotification).fail(exports.ErrorCode.INVALID_PARAMETER_DISABLE_NOTIFICATION).isObject("pushConfig",t.pushConfig).fail(exports.ErrorCode.INVALID_PARAMETER_PUSH_CONFIG).isBoolean("disableUpdateLastMessage",t.disableUpdateLastMessage).fail(exports.ErrorCode.INVALID_DISABLE_UPDATE_LAST_MESSAGE).isLimitedTypedArray("directionalUserIdList",t.directionalUserIdList,300,Nt,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).next((function(){var r=c(o,Nb,"m",Lb).call(o,e);return o._engine.recallMsg(r,t)}))];case 1:return i=a.sent(),this.logger.summary(B.A_RECALL_MESSAGE_R,i,r,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_DEL_REMOTE_MSGS_T,JSON.stringify({conversation:e,messages:t}),r),[4,pr.create("deleteRemoteMessage").check((function(t){return uc(t,e,K)})).isLimitedTypedArray("messages",t,100,(function(e){if(!e||"object"!=typeof e)return!1;var t=e.messageUId,r=e.sentTime,n=e.messageDirection;return vt(t)&&(n===exports.MessageDirection.SEND||n===exports.MessageDirection.RECEIVE)&&bt({min:0})(r)}),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).next((function(){var r=c(i,Nb,"m",Lb).call(i,e);return i._engine.chat.deleteRemoteMessage(r,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_DEL_REMOTE_MSGS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessageByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_DEL_REMOTE_MSGS_T,JSON.stringify({identifier:e,timestamp:t}),r),[4,pr.create("deleteRemoteMessageByTimestamp").check((function(t){return uc(t,e,Q)})).isInteger("timestamp",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){var r=c(i,Nb,"m",Lb).call(i,e);return i._engine.chat.deleteRemoteMessageByTimestamp(r,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_DEL_REMOTE_MSGS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getFileToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,s){return o(this,void 0,void 0,(function(){var u=this;return a(this,(function(l){return[2,pr.create("getFileToken").isNumberEnum("fileType",e,exports.FileType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MEDIA_TYPE).isString("fileName",t).fail(exports.ErrorCode.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME).validate("httpMethod",r,(function(e){return"POST"===e||"PUT"===e})).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,"`httpMethod` is invalid").isString("queryString",n).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,"`queryString` is invalid").isString("url",i).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,"`url` is invalid").isInteger("size",s).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,"`size` is invalid").result().tryTrans(this.validateConnected).next((function(l){return o(u,void 0,void 0,(function(){var o,u;return a(this,(function(a){switch(a.label){case 0:return o=l.uploadServer||"",u=l.ossConfig||"",[4,this._engine.getFileToken(e,t,r,n,i,s)];case 1:return[2,a.sent().trans((function(e){return Object.assign(e,{qiniu:o,ossConfig:e.ossConfig||u})}))]}}))}))}))]}))}))}}),Object.defineProperty(e.prototype,"getFileUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i=this;return a(this,(function(o){switch(o.label){case 0:return[4,pr.create("getFileUrl").isNumberEnum("fileType",e,exports.FileType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MEDIA_TYPE).isString("fileName",t).fail(exports.ErrorCode.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME).isString("saveName",n).fail(exports.ErrorCode.INVALID_PARAMETER_SAVE_NAME).isNumberEnum("serverType",r,exports.UploadMethod,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SERVER_TYPE).result().tryTrans(this.validateConnected).next((function(){return i._engine.getFileUrl(e,r,t,n||"")}))];case 1:return[2,o.sent()]}}))}))}}),Object.defineProperty(e.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_ADD_TAG_T,JSON.stringify({tagId:null==e?void 0:e.tagId,tagName:null==e?void 0:e.tagName}),t),[4,pr.create("createTag").isLimitedString("tagId",null==e?void 0:e.tagId,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isLimitedString("tagName",null==e?void 0:e.tagName,1,15,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_NAME).result().tryTrans(this.validateConnected).next((function(){return n._engine.createTag(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_ADD_TAG_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_TAG_T,JSON.stringify({tagId:e}),t),[4,pr.create("removeTag").isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).result().tryTrans(this.validateConnected).next((function(){return n._engine.removeTag(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_REMOVE_TAG_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"updateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_UPDATE_TAG_T,JSON.stringify({tagId:null==e?void 0:e.tagId,tagName:null==e?void 0:e.tagName}),t),[4,pr.create("updateTag").isLimitedString("tagId",null==e?void 0:e.tagId,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isLimitedString("tagName",null==e?void 0:e.tagName,1,15,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_NAME).result().tryTrans(this.validateConnected).next((function(){return n._engine.updateTag(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_UPDATE_TAG_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getTagList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_TAGS_T,"",e),[4,this.validateLogin().next((function(){return r._engine.getTagList()}))];case 1:return t=n.sent(),this.logger.summary(B.A_GET_TAGS_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"addTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return(r=pr.create("addTagForConversations").isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isTypedArray("conversations",t,(function(e){return sc("",e,J).result().isOk}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATIONS).isLimitedInteger("conversations",null==t?void 0:t.length,1,1e3,!0).fail(exports.ErrorCode.CONVER_OUT_LIMIT_ERROR).result().tryTrans(this.validateConnected)).isOk?(n=t.map((function(e){return c(s,Nb,"m",Lb).call(s,e)})),i=this.logger.createTraceId(),this.logger.info(B.A_ADD_TAG_FOR_CONVERSATIONS_T,JSON.stringify({tagId:e,conversations:n}),i),[4,this._engine.chat.addTagForConversations(e,n)]):[2,r.wipe()];case 1:return o=a.sent(),this.logger.summary(B.A_ADD_TAG_FOR_CONVERSATIONS_R,o,i),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"removeTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return(r=pr.create("removeTagForConversations").isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isLimitedTypedArray("conversations",t,1e3,(function(e){return sc("",e,J).result().isOk}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATIONS).result().tryTrans(this.validateConnected)).isOk?(n=t.map((function(e){return c(s,Nb,"m",Lb).call(s,e)})),i=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_TAG_FOR_CONVERS_T,JSON.stringify({tagId:e,conversations:n}),i),[4,this._engine.chat.removeTagForConversations(e,n)]):[2,r.wipe()];case 1:return o=a.sent(),this.logger.summary(B.A_REMOVE_TAG_FOR_CONVERS_R,o,i),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"removeTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o;return a(this,(function(a){switch(a.label){case 0:return(r=sc("removeTagsForConversation",e,J).isTypedArray("tagIds",t,(function(e){return gt(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).result().tryTrans(this.validateConnected)).isOk?(n=this.logger.createTraceId(),i=c(this,Nb,"m",Lb).call(this,e),this.logger.info(B.A_REMOVE_TAGS_FOR_CONVER_T,JSON.stringify({tagIds:t,conversation:i}),n),[4,this._engine.chat.removeTagsForConversation(i,t)]):[2,r.wipe()];case 1:return o=a.sent(),this.logger.summary(B.A_REMOVE_TAGS_FOR_CONVER_R,o,n),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"getConversationListByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){return(n=pr.create("getConversationListByTag").isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isInteger("count",r,!0).fail(exports.ErrorCode.CONVER_OUT_LIMIT_ERROR).isLimitedInteger("startTime",t,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_START_TIME).result().tryTrans((function(){return o.checkAuthed(Pt())}))).isOk?(i=r<=0?20:Math.min(r,1e3),[2,this._engine.chat.getConversationListByTag(e,t,i)]):[2,n.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 r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_UNREAD_COUNT_BY_TAG_T,JSON.stringify({tagId:e,containMuted:t}),r),[4,pr.create("getUnreadCountByTag").isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isBoolean("containMuted",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONTAIN_MUTED).result().tryTrans(this.validateLogin).next((function(){return i._engine.chat.getUnreadCountByTag(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_GET_UNREAD_COUNT_BY_TAG_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"setConversationStatusInTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return(n=sc("setConversationStatusInTag",t,J).isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isBoolean("isTop",null==r?void 0:r.isTop,!0).fail(exports.ErrorCode.INVALID_PARAMETER_IS_TOP).result().tryTrans(this.validateConnected)).isOk?(i=this.logger.createTraceId(),o=c(this,Nb,"m",Lb).call(this,t),this.logger.info(B.A_SET_CONVER_TO_TOP_IN_TAG_T,JSON.stringify({tagId:e,conversation:o,isTop:r.isTop}),i),[4,this._engine.chat.setConversationStatusInTag(e,o,r)]):[2,n.wipe()];case 1:return s=a.sent(),this.logger.summary(B.A_SET_CONVER_TO_TOP_IN_TAG_R,s,i),[2,s]}}))}))}}),Object.defineProperty(e.prototype,"getTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i;return a(this,(function(o){switch(o.label){case 0:return(t=sc("getTagsForConversation",e,J).result().tryTrans(this.validateLogin)).isOk?(r=this.logger.createTraceId(),n=c(this,Nb,"m",Lb).call(this,e),this.logger.info(B.A_GET_TAGS_OF_CONVERSATION_T,JSON.stringify(n),r),[4,this._engine.chat.getTagsForConversation(n)]):[2,t.wipe()];case 1:return i=o.sent(),this.logger.summary(B.A_GET_TAGS_OF_CONVERSATION_R,i,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UNREAD_MENTIONED_COUNT_T,JSON.stringify(e),t),[4,pr.create("getUnreadMentionedCount").check((function(t){return uc(t,e,Z)})).result().tryTrans(this.validateLogin).next((function(){return o(n,void 0,void 0,(function(){var t;return a(this,(function(r){return e.conversationType!==exports.ConversationType.ULTRA_GROUP||this._engine.chat.ugSynced?(t=c(this,Nb,"m",Lb).call(this,e),[2,this._engine.chat.getUnreadMentionedCount(t)]):[2,_r(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(B.A_GET_UNREAD_MENTIONED_COUNT_R,r,t),[2,r.trans(yc)]}}))}))}}),Object.defineProperty(e.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_ALL_UNREAD_MENTIONED_COUNT_T,"",e),[4,this.validateLogin().next((function(){return r._engine.chat.getAllUnreadMentionedCount()}))];case 1:return t=n.sent(),this.logger.summary(B.A_GET_ALL_UNREAD_MENTIONED_COUNT_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"getUltraGroupMessageListByMessageUId",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,s,u,l=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),n=t instanceof Array?t.map((function(e){return null==e?void 0:e.messageUId})):[],i=null==e?void 0:e.conversationType,o=null==e?void 0:e.targetId,s=null==e?void 0:e.channelId,this.logger.info(B.A_GET_UG_MSGS_BY_UID_T,JSON.stringify({conversationType:i,targetId:o,channelId:s,messageUIds:n}),r),[4,pr.create("getUltraGroupMessageListByMessageUId").check((function(t){return uc(t,e,K)})).isTypedArray("messages",t,(function(e){return vt(null==e?void 0:e.messageUId)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("messages",null==t?void 0:t.length,1,20,!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).next((function(){var r=c(l,Nb,"m",Lb).call(l,e);return l._engine.chat.getRemoteMessagesByUIds(r,t.map((function(e){return e.messageUId})))}))];case 1:return u=a.sent(),this.logger.summary(B.A_GET_UG_MSGS_BY_UID_R,u,r,u.isOk?{list:u.data.map((function(e){return e.messageUId}))}:void 0),[2,u.trans((function(e){var t={};return e.forEach((function(e){t[e.messageUId]=e})),t}))]}}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadCountForAllChannels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,s=this;return a(this,(function(u){switch(u.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_UG_UNREAD_COUNT_FOR_ALL_CHANNELS_T,JSON.stringify({targetId:e,levels:r,isGetMentioned:t}),n),[4,pr.create("getUGUnreadCountForAllChannels").validate("targetId",e,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).check((function(e){e.isTypedArray("levels",r,(function(t){return!e.isNumberEnum("",t,exports.NotificationLevel,!0).isFailed}))})).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateLogin).next((function(){return o(s,void 0,void 0,(function(){return a(this,(function(n){return this._engine.chat.ugSynced?[2,this._engine.chat.getUGUnreadCountForAllChannels(e,r||[],t)]:[2,_r(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(B.A_GET_UG_UNREAD_COUNT_FOR_ALL_CHANNELS_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadMentionedDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return t=null==e?void 0:e.targetId,r=null==e?void 0:e.channelId,n=null==e?void 0:e.sentTime,i=null==e?void 0:e.count,o=this.logger.createTraceId(),this.logger.info(B.A_GET_UG_UNREAD_MENTIONED_DIGEST_T,JSON.stringify({targetId:t,channelId:r,sentTime:n,count:i}),o),[4,pr.create("getUGUnreadMentionedDigest").validate("targetId",t,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("channelId",r,Ct).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isLimitedInteger("count",i,1,50,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("sentTime",n,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){return e.channelId=u._channelIdConvert(exports.ConversationType.ULTRA_GROUP,r),u._engine.chat.getUGUnreadMentionedDigest(e)}))];case 1:return s=a.sent(),this.logger.summary(B.A_GET_UG_UNREAD_MENTIONED_DIGEST_R,s,o),[2,s]}}))}))}}),Object.defineProperty(e.prototype,"getUGFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,i=this;return a(this,(function(s){switch(s.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UG_FIRST_UNREAD_MSG_DIGEST_T,JSON.stringify(e),t),[4,pr.create("getUGFirstUnreadMessageDigest").validate("targetId",null==e?void 0:e.targetId,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("channelId",null==e?void 0:e.channelId,Ct).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(){return o(i,void 0,void 0,(function(){var t;return a(this,(function(r){return this._engine.chat.ugSynced?(t=c(this,Nb,"m",Lb).call(this,n(n({},e),{conversationType:exports.ConversationType.ULTRA_GROUP})),[2,this._engine.chat.getUGFirstUnreadMessageDigest(t)]):[2,_r(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return r=s.sent(),this.logger.summary(B.A_GET_UG_FIRST_UNREAD_MSG_DIGEST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UG_UNREAD_INFO_LIST_T,JSON.stringify({targetIds:e}),t),[4,pr.create("getUGUnreadInfoList").isLimitedTypedArray("targetIds",e,20,(function(e){return Nt(e)}),!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateLogin).next((function(){return o(n,void 0,void 0,(function(){var t;return a(this,(function(r){return this._engine.chat.ugSynced?(t=new Set(e),[2,this._engine.chat.getUGUnreadInfoList(Array.from(t))]):[2,_r(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(B.A_GET_UG_UNREAD_INFO_LIST_R,r,t),[2,r]}}))}))}}),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,r){var n=this;return this.validateConnected().next((function(){return n._engine.setCallInfo(e,t,r)}))}}),Object.defineProperty(e.prototype,"_validateSubDriven",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e.subDriven,n=void 0===r?0:r;switch(t){case exports.SubscribeType.ONLINE_STATUS:return 1&n?fr(e):_r(exports.ErrorCode.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE);case exports.SubscribeType.USER_PROFILE:return 2&n?fr(e):_r(exports.ErrorCode.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE);default:return _r(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_TYPE)}}}),Object.defineProperty(e.prototype,"subscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SUBSCRIBE_USER_STATUS_T,JSON.stringify({userIds:e,subscribeType:t,expiry:r}),n),[4,pr.create("subscribeUser").isLimitedTypedArray("userIds",e,200,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS).isNumberEnum("subscribeType",t,exports.SubscribeType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_TYPE).isLimitedInteger("expiry",r,60,2592e3,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_EXPIRY).result().tryTrans(this.validateConnected).tryTrans((function(e){return o._validateSubDriven(e,t)})).next((function(){return o._engine.subscribeUser(e,t,r)}))];case 1:return i=a.sent(),this.logger.summary(B.A_SUBSCRIBE_USER_STATUS_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"unSubscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_UNSUBSCRIBE_USER_STATUS_T,JSON.stringify({userIds:e,subscribeType:t}),r),[4,pr.create("unSubscribeUser").isLimitedTypedArray("userIds",e,200,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS).isNumberEnum("subscribeType",t,exports.SubscribeType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_TYPE).result().tryTrans(this.validateConnected).tryTrans((function(e){return i._validateSubDriven(e,t)})).next((function(){return i._engine.unSubscribeUser(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_UNSUBSCRIBE_USER_STATUS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_SUBSCRIBE_USER_STATUS_LIST_T,JSON.stringify({subscribeType:e,count:t,offset:r}),n),[4,pr.create("getSubscribeUserList").isNumberEnum("subscribeType",e,exports.SubscribeType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_TYPE).isLimitedInteger("count",t,1,200,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE).isLimitedInteger("offset",r,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_OFFSET).result().tryTrans(this.validateConnected).tryTrans((function(t){return o._validateSubDriven(t,e)})).next((function(){return o._engine.getSubscribeUserList(e,t,r)}))];case 1:return i=a.sent(),this.logger.summary(B.A_GET_SUBSCRIBE_USER_STATUS_LIST_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_SUB_USERS_STATUS_T,JSON.stringify({subscribeType:e,userIds:t}),r),[4,pr.create("getSubscribeUserStatus").isNumberEnum("subscribeType",e,exports.SubscribeType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_TYPE).isLimitedTypedArray("userIds",t,200,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS).result().tryTrans(this.validateConnected).tryTrans((function(t){return i._validateSubDriven(t,e)})).next((function(){return i._engine.getSubscribeUserStatus(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_GET_SUB_USERS_STATUS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUsersOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_SUB_USERS_ONLINE_STATUS_T,JSON.stringify({userIds:e}),t),[4,pr.create("getSubscribeUsersOnlineStatus").isLimitedTypedArray("userIds",e,200,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).next((function(){return n._engine.getSubscribeUsersOnlineStatus(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_GET_SUB_USERS_ONLINE_STATUS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"updateMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,i=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_UPDATE_MY_USER_PROFILE_T,JSON.stringify({profile:e}),t),[4,pr.create("updateMyUserProfile").isObject("profile",e,!0).check((function(t){var r=e.name,n=e.portraitUri,i=e.email,o=e.birthday,a=e.gender,s=e.location,l=e.role,c=e.level,d=e.extraProfile;t.isString("name",r).isString("portraitUri",n).isString("email",i).isString("birthday",o).isNumber("gender",a).isString("location",s).isNumber("role",l).isNumber("level",c).isObject("extraProfile",d),!t.isFailed&&d&&Object.entries(d).forEach((function(e){var r=u(e,2);r[0];var n=r[1];t.isString("extraProfile",n,!0)}))})).fail(exports.ErrorCode.INVALID_PARAMETER_USER_PROFILE).result().tryTrans(this.validateConnected).tryTrans((function(e){return i._validateUserProfile(e)})).next((function(){var t={};return["name","portraitUri","email","birthday","gender","location","role","level"].forEach((function(r){var n=e[r];void 0!==n&&(t[r]=n)})),e.extraProfile&&(t.extraProfile=n({},e.extraProfile)),i._engine.updateMyUserProfile(t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_UPDATE_MY_USER_PROFILE_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_USER_PROFILES_T,JSON.stringify({userIds:e}),t),[4,pr.create("getUserProfiles").isLimitedTypedArray("userIds",e,100,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateLogin).tryTrans((function(e){return n._validateUserProfile(e)})).next((function(){return n._engine.getUserProfiles(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_GET_USER_PROFILES_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_MY_USER_PROFILE_T,void 0,e),[4,pr.create("getMyUserProfile").result().tryTrans(this.validateConnected).tryTrans((function(e){return r._validateUserProfile(e)})).next((function(){return r._engine.getMyUserProfile()}))];case 1:return t=n.sent(),this.logger.summary(B.A_GET_MY_USER_PROFILE_R,t,e),[2,t]}}))}))}}),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(r){return[2,this._engine.chat.clearConversations(e,t)]}))}))}}),Object.defineProperty(e.prototype,"addToBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_ADD_TO_BLACKLIST_T,JSON.stringify({userId:e}),t),[4,pr.create("addToBlacklist").validate("userId",e,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).next((function(){return n._engine.addToBlacklist(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_ADD_TO_BLACKLIST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"removeFromBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_FROM_BLACKLIST_T,JSON.stringify({userId:e}),t),[4,pr.create("removeFromBlacklist").validate("userId",e,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).next((function(){return n._engine.removeFromBlacklist(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_REMOVE_FROM_BLACKLIST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_BLACKLIST_T,void 0,e),[4,pr.create("getBlacklist").result().tryTrans(this.validateConnected).next((function(){return r._engine.getBlacklist()}))];case 1:return t=n.sent(),this.logger.summary(B.A_GET_BLACKLIST_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"getBlacklistStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_BLACKLIST_STATUS_T,JSON.stringify({userId:e}),t),[4,pr.create("getBlacklistStatus").validate("userId",e,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).next((function(){return n._engine.getBlacklistStatus(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_GET_BLACKLIST_STATUS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"insertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_INSERT_MSG_T,JSON.stringify({conversation:e,params:t}),r),[4,pr.create("insertMessage").check((function(t){return uc(t,e,X)})).validate("senderUserId",t.senderUserId,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isObject("content",t.content,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_CONTENT).check((function(e){var r=ac(t.messageType,t.content);r.isOk||e.setFailed(r.code)})).isNotEmptyString("messageType",t.messageType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).isNumberEnum("messageDirection",t.messageDirection,exports.MessageDirection,!0).fail(exports.ErrorCode.INVALID_MESSAGE_DIRECTION).check((function(e){t.canIncludeExpansion&&t.expansion&&cc(e,t.expansion,!0)})).isTimestamp("sentTime",t.sentTime).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isNumberEnum("sentStatus",t.sentStatus,exports.SentStatus).fail(exports.ErrorCode.INVALID_PARAMETER_SENT_STATUS).isTypedArray("directedUserIds",t.directedUserIds,Nt).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).isString("searchContent",t.searchContent).fail(exports.ErrorCode.SEARCH_PROPS_LIMIT_ERROR).check((function(e){var r=t.quoteInfo;r&&e.isObject("quoteInfo",r,!0).isNotEmptyString("quoteInfo.messageUId",r.messageUId,!0).isNotEmptyString("quoteInfo.senderId",r.senderId,!0).isNotEmptyString("quoteInfo.objectName",r.objectName,!0).isNumberEnum("quoteInfo.quoteMessageStatus",r.quoteMessageStatus,je).fail(exports.ErrorCode.INVALID_PARAMETER_QUOTE_INFO)})).result().tryTrans(this.validateLogin).next((function(){var r=c(i,Nb,"m",Lb).call(i,e);return i._engine.insertMessage(r,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_INSERT_MSG_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"batchInsertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_BATCH_INSERT_MSGS_T,JSON.stringify({count:null==e?void 0:e.length,checkDuplicate:t}),r),i=pr.create(""),[4,pr.create("batchInsertMessage").isLimitedTypedArray("messages",e,500,(function(e){return"object"==typeof e&&(uc(i,e,X),i.validate("senderUserId",e.senderUserId,Nt,!0).isNotEmptyString("messageType",e.messageType,!0).isObject("content",e.content,!0).isNumberEnum("messageDirection",e.messageDirection,exports.MessageDirection,!0).check((function(t){e.canIncludeExpansion&&e.expansion&&cc(t,e.expansion,!0)})).isTimestamp("sentTime",e.sentTime).isNumberEnum("sentStatus",e.sentStatus,exports.SentStatus).isString("searchContent",e.searchContent).isNumber("receivedStatus",e.receivedStatus).isObject("receivedStatusInfo",e.receivedStatusInfo).isTypedArray("directedUserIds",e.directedUserIds,Nt).check((function(t){var r=e.quoteInfo;r&&t.isObject("quoteInfo",r,!0).isNotEmptyString("quoteInfo.messageUId",r.messageUId,!0).isNotEmptyString("quoteInfo.senderId",r.senderId,!0).isNotEmptyString("quoteInfo.objectName",r.objectName,!0).isNumberEnum("quoteInfo.quoteMessageStatus",r.quoteMessageStatus,je).fail(exports.ErrorCode.INVALID_PARAMETER_QUOTE_INFO)})),!i.isFailed)}),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).result().tryTrans(this.validateLogin).next((function(){var r=e.map((function(e){return n(n({},e),{channelId:s._channelIdConvert(e.conversationType,e.channelId)})}));return s._engine.batchInsertMessage(r,t)}))];case 1:return o=a.sent(),this.logger.summary(B.A_BATCH_INSERT_MSGS_R,o,r),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"getLocalMessageCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_LOCAL_MSG_COUNT_T,JSON.stringify({conversation:e}),t),[4,pr.create("getMessageCount").check((function(t){return uc(t,e,X)})).result().tryTrans(this.validateLogin).next((function(){var t=c(n,Nb,"m",Lb).call(n,e);return n._engine.getLocalMessageCount(t)}))];case 1:return r=i.sent(),this.logger.summary(B.A_GET_LOCAL_MSG_COUNT_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"deleteLocalMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_DELETE_LOCAL_MSGS_T,JSON.stringify({messageIds:e}),t),[4,pr.create("deleteLocalMessages").isTypedArray("messageIds",e,(function(e){return Number.isInteger(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ARRAY).result().tryTrans(this.validateLogin).next((function(){return n._engine.deleteLocalMessages(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_DELETE_LOCAL_MSGS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"deleteLocalMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_DEL_LOCAL_MSGS_BY_TIME_T,JSON.stringify({conversation:e,timestamp:t,cleanSpace:r}),n),[4,pr.create("deleteLocalMessagesByTimestamp").check((function(t){return uc(t,e,X)})).isTimestamp("timestamp",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin).next((function(){var n=c(o,Nb,"m",Lb).call(o,e);return o._engine.deleteLocalMessagesByTimestamp(n,t,!!r)}))];case 1:return i=a.sent(),this.logger.summary(B.A_DEL_LOCAL_MSGS_BY_TIME_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"batchClearLocalMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,i=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_BATCH_CLEAR_LOCAL_MSGS_BY_TIME_T,JSON.stringify({options:e}),t),[4,pr.create("batchClearLocalMessagesByTimestamp").check((function(t){t.isLimitedTypedArray("options",e,20,(function(e){return uc(t,e,K),!t.isFailed&&bt({min:0})(e.timestamp)})).fail(exports.ErrorCode.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST)})).result().tryTrans(this.validateLogin).next((function(){var t=e.map((function(e){return n(n({},e),{channelId:i._channelIdConvert(e.conversationType,e.channelId)})}));return i._engine.batchClearLocalMessagesByTimestamp(t)}))];case 1:return r=o.sent(),this.logger.summary(B.A_BATCH_CLEAR_LOCAL_MSGS_BY_TIME_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"batchClearRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_BATCH_CLEAR_REMOTE_MSG_T,JSON.stringify({options:e,isDeleteLocal:t}),r),[4,pr.create("batchClearRemoteHistoryMessages").isLimitedArray("options",e,20,!0,1).check((function(t){e.forEach((function(e){uc(t,e,K).isTimestamp("timestamp",null==e?void 0:e.timestamp)}))})).fail(exports.ErrorCode.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST,void 0,!0).check((function(t){e.some((function(e){return e.conversationType===exports.ConversationType.ULTRA_GROUP}))&&t.setFailed(exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT)})).result().tryTrans(this.validateConnected).next((function(){return i._engine.chat.batchClearRemoteHistoryMessages(e,!!t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_BATCH_CLEAR_REMOTE_MSG_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"clearLocalMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_CLEAR_LOCAL_MSG_T,JSON.stringify({conversation:e}),t),[4,pr.create("clearLocalMessages").check((function(t){return uc(t,e,X)})).result().tryTrans(this.validateLogin).next((function(){return n._engine.clearLocalMessages(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_CLEAR_LOCAL_MSG_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getLocalMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_LOCAL_MESSAGE_T,JSON.stringify({messageId:e}),t),[4,pr.create("getLocalMessage").validate("messageId",e,(function(){return vt(e)||Et(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).result().next((function(){return n._engine.getMessage(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_GET_LOCAL_MESSAGE_R,r,t,{messageId:e}),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"_innerSetMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return a(this,(function(n){return[2,this._engine.setMessageContent(e,t,r)]}))}))}}),Object.defineProperty(e.prototype,"setMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SET_MSG_CONTENT_T,JSON.stringify({messageId:e,messageType:r}),n),[4,pr.create("setMessageContent").isInteger("messageId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).isNotEmptyString("messageType",r,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).isObject("content",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_CONTENT).result().tryTrans(this.validateLogin).next((function(){var n=JSON.stringify(t);return o._innerSetMessageContent(e,n,r)}))];case 1:return i=a.sent(),this.logger.summary(B.A_SET_MSG_CONTENT_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"setMessageSearchField",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return a(this,(function(n){return[2,this._engine.setMessageSearchField(e,t,r)]}))}))}}),Object.defineProperty(e.prototype,"setMessageSentStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_E_SET_MSG_SENT_STATUS_T,JSON.stringify({messageId:e,sentStatus:t}),r),[4,pr.create("setMessageSentStatus").isInteger("messageId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).isNumberEnum("sentStatus",t,exports.SentStatus,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SENT_STATUS).result().tryTrans(this.validateLogin).next((function(){return i._engine.setMessageSentStatus(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_E_SET_MSG_SENT_STATUS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"setMessageReceivedStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_E_SET_MSG_RECEIVED_STATUS_T,JSON.stringify({messageId:e,receivedStatus:t}),r),[4,pr.create("setMessageReceivedStatus").isInteger("messageId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).isInteger("receivedStatus",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_RECEIVED_STATUS).result().tryTrans(this.validateLogin).next((function(){return i._engine.setMessageReceivedStatus(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_E_SET_MSG_RECEIVED_STATUS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"setMessageStatusToRead",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return(r=sc("setMessageStatusToRead",e,J).isNumber("timestamp",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin)).isOk?(n=this.logger.createTraceId(),i=e.conversationType,o=e.targetId,s=e.channelId,this.logger.info(B.A_E_SET_MESSAGE_STATUS_TO_READ_T,JSON.stringify({conversation:e,timestamp:t}),n),[4,this._engine.updateMessageReceiptStatus(i,o,t,s)]):[2,r.wipe()];case 1:return u=a.sent(),this.logger.summary(B.A_E_SET_MESSAGE_STATUS_TO_READ_R,u,n),[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,"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,r,n){return o(this,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){switch(a.label){case 0:return(i=pr.create("searchConversationByContent").isNotEmptyString("keyword",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEYWORD).isTypedArray("messageTypes",t,(function(e){return vt(e)})).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).validate("channelId",r,Ct).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",n,(function(e){return te(e,K)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateLogin)).isOk?(o=this.logger.createTraceId(),this.logger.info(B.A_E_SEARCH_CONVERSATION_BY_CONTENT_T,JSON.stringify({keyword:e,messageTypes:t,channelId:r,conversationTypes:n}),o),[4,this._engine.chat.searchConversationByContent(e,t&&0!==t.length?t:[me.TEXT,me.FILE],r||"",n&&0!==n.length?n:ee(K))]):[2,i.wipe()];case 1:return s=a.sent(),this.logger.summary(B.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,r){return o(this,void 0,void 0,(function(){return a(this,(function(n){return[2,this._engine.searchConversationByContentWithAllChannel(e,t&&0!==t.length?t:[me.TEXT,me.FILE],r&&0!==r.length?r:ee(K))]}))}))}}),Object.defineProperty(e.prototype,"searchMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,i;return o(this,void 0,void 0,(function(){var o,s;return a(this,(function(a){switch(a.label){case 0:return(o=sc("searchMessages",e,X).isLimitedString("keyword",null==t?void 0:t.keyword,0,1e3,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEYWORD).isLimitedInteger("limit",null==t?void 0:t.limit,1,lt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_LIMIT).isLimitedInteger("offset",null==t?void 0:t.offset,0,lt).fail(exports.ErrorCode.INVALID_PARAMETER_OFFSET).isLimitedInteger("order",null==t?void 0:t.order,0,1,!0).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isObject("timeRange",t.timeRange).validate("timeRange",t.timeRange,(function(e){var t=e.startTime,r=e.endTime;return!t&&!r||!(t&&!Et(t)||r&&!Et(r))&&(t=null!=t?t:0,r=null!=r?r:Date.now(),t>=0&&t<=r)})).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isTypedArray("objectNames",null===(r=null==t?void 0:t.messageFilter)||void 0===r?void 0:r.objectNames,(function(e){return"string"==typeof e&&e.length>0&&e.length<=128})).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST).isTypedArray("senderIds",null===(i=null==t?void 0:t.messageFilter)||void 0===i?void 0:i.senderIds,Nt).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans((function(){return Pt()?fr():_r(exports.ErrorCode.NOT_SUPPORT,"Only support electron platform.")})).tryTrans(this.validateLogin)).isOk?(s=c(this,Nb,"m",Lb).call(this,e),[4,c(this,Nb,"m",xb).call(this,n(n({},t),{conversationFilter:{conversationTypes:[s.conversationType],targetIds:[s.targetId],channelIds:"string"==typeof s.channelId?[s.channelId]:[]}}))]):[2,o.wipe()];case 1:return[2,a.sent().orSync((function(){return fr({messages:[],totalMatched:0,conditionsMatched:0})}))]}}))}))}}),Object.defineProperty(e.prototype,"searchMessagesWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n,i,s,u;return o(this,void 0,void 0,(function(){var o;return a(this,(function(a){return(o=pr.create("searchMessagesWithParams").isObject("params",e,!0).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER).isLimitedString("keyword",null==e?void 0:e.keyword,0,1e3).fail(exports.ErrorCode.INVALID_PARAMETER_KEYWORD).isLimitedInteger("limit",null==e?void 0:e.limit,1,lt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_LIMIT).isLimitedInteger("offset",null==e?void 0:e.offset,0,lt).fail(exports.ErrorCode.INVALID_PARAMETER_OFFSET).isLimitedInteger("order",null==e?void 0:e.order,0,1,!0).fail(exports.ErrorCode.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,r=e.endTime;return!t&&!r||!(t&&!Et(t)||r&&!Et(r))&&(t=null!=t?t:0,r=null!=r?r:Date.now(),t>=0&&t<=r)})).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isTypedArray("conversationTypes",null===(t=null==e?void 0:e.conversationFilter)||void 0===t?void 0:t.conversationTypes,(function(e){return te(e,X)})).fail(exports.ErrorCode.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(exports.ErrorCode.INVALID_PARAMETER_TARGETID_LIST).isLimitedTypedArray("channelIds",null===(n=null==e?void 0:e.conversationFilter)||void 0===n?void 0:n.channelIds,10,Ct,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isLimitedTypedArray("senderIds",null===(i=null==e?void 0:e.messageFilter)||void 0===i?void 0:i.senderIds,20,Nt,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).isTypedArray("objectNames",null===(s=null==e?void 0:e.messageFilter)||void 0===s?void 0:s.objectNames,(function(e){return"string"==typeof e&&e.length>0&&e.length<=128})).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST).result().tryTrans(this.validateLogin)).isOk?(e.limit=Math.min(e.limit,100),(null===(u=e.messageFilter)||void 0===u?void 0:u.objectNames)&&e.messageFilter.objectNames.length>300&&(e.messageFilter.objectNames=e.messageFilter.objectNames.slice(0,300)),[2,c(this,Nb,"m",xb).call(this,e)]):[2,o.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesAroundTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return i=this.logger.createTraceId(),this.logger.info(B.A_GET_MSGS_AROUND_TIMESTAMP_T,JSON.stringify({conversation:e,timestamp:t,beforeCount:r,afterCount:n}),i),[4,pr.create("getMessagesAroundTimestamp").check((function(t){return uc(t,e,X)})).isLimitedInteger("timestamp",t,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("beforeCount",r,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_BEFORE).isLimitedInteger("afterCount",n,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_AFTER).result().tryTrans(this.validateLogin).next((function(){var i=c(s,Nb,"m",Lb).call(s,e);return s._engine.chat.getMessagesAroundTimestamp(i,t,r,n)}))];case 1:return o=a.sent(),this.logger.summary(B.A_GET_MSGS_AROUND_TIMESTAMP_R,o,i),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UNREAD_MENTIONED_MSGS_T,JSON.stringify(e),t),[4,pr.create("getUnreadMentionedMessages").check((function(t){return uc(t,e,X)})).result().tryTrans(this.validateLogin).next((function(){var t=c(n,Nb,"m",Lb).call(n,e);return n._engine.chat.getUnreadMentionedMessages(t)}))];case 1:return r=i.sent(),this.logger.summary(B.A_GET_UNREAD_MENTIONED_MSGS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_UG_DEFAULT_NTF_LEVEL_T,JSON.stringify({targetId:e,channelId:t}),r),[4,pr.create("getUltraGroupDefaultNotificationLevel").validate("targetId",e,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("channelId",t,Ct).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(){var r="string"==typeof t?i._channelIdConvert(exports.ConversationType.ULTRA_GROUP,t):t;return i._engine.chat.getUGDefaultNotificationLevel(e,r)}))];case 1:return n=o.sent(),this.logger.summary(B.A_GET_UG_DEFAULT_NTF_LEVEL_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"setUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SET_UG_DEFAULT_NTF_LEVEL_T,JSON.stringify({targetId:e,notificationLevel:t,channelId:r}),n),[4,pr.create("setUltraGroupDefaultNotificationLevel").validate("targetId",e,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("channelId",r,Ct).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isNumberEnum("notificationLevel",t,exports.NotificationLevel,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected).next((function(){var n="string"==typeof r?o._channelIdConvert(exports.ConversationType.ULTRA_GROUP,r):r;return o._engine.chat.setUGDefaultNotificationLevel(e,t,n)}))];case 1:return i=a.sent(),this.logger.summary(B.A_SET_UG_DEFAULT_NTF_LEVEL_R,i,n),[2,i]}}))}))}}),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(r){return(t=sc("getConversationNotificationLevel",e,K).result()).isOk?[2,this._engine.chat.getConversationNotificationLevel(c(this,Nb,"m",Lb).call(this,e))]:[2,t.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 r;return a(this,(function(n){return(r=pr.create("setConversationTypeNotificationLevel").validate("conversationType",e,(function(){return te(e,K)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE).isNumberEnum("level",t,exports.NotificationLevel,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected)).isOk?[2,this._engine.chat.setConversationTypeNotificationLevel(e,t)]:[2,r.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(r){return(t=pr.create("getConversationTypeNotificationLevel").validate("conversationType",e,(function(){return te(e,K)}),!0).fail(exports.ErrorCode.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){return o(this,void 0,void 0,(function(){var r,n,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return r=null==t?void 0:t.timestamp,n=null==t?void 0:t.count,i=null==t?void 0:t.order,o=this.logger.createTraceId(),this.logger.info(B.A_GET_REMOTE_HISTORY_MSG_T,JSON.stringify({conversation:e,options:t}),o),[4,pr.create("getRemoteHistoryMessages").check((function(t){return uc(t,e,Q)})).isLimitedInteger("timestamp",r,0,Number.MAX_SAFE_INTEGER).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("order",i,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isLimitedInteger("count",n,1,100).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).next((function(){var t={timestamp:r||0,count:n||20,order:i||0,messageType:""},o=c(u,Nb,"m",Lb).call(u,e);return u._engine.getHistoryMessage(o,t,!1)}))];case 1:return s=a.sent(),this.logger.summary(B.A_GET_REMOTE_HISTORY_MSG_R,s,o),[2,s]}}))}))}}),Object.defineProperty(e.prototype,"clearLocalData",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.logger.info(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_CONVERSATIONS_T,JSON.stringify({identifiers:e}),t),[4,pr.create("getConversations").check((function(t){t.isLimitedTypedArray("identifiers",e,100,(function(e){return!uc(t,e,X).isFailed}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST)})).result().tryTrans(this.validateLogin).next((function(){var t=e.map((function(e){return c(n,Nb,"m",Lb).call(n,e)}));return n._engine.chat.getConversations(t)}))];case 1:return r=i.sent(),this.logger.summary(B.A_GET_CONVERSATIONS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"setCheckDuplicateMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.setCheckDuplicateMessage(!!e)}}),Object.defineProperty(e.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i=this;return a(this,(function(o){switch(o.label){case 0:return[4,this.validateConnected().next((function(){return i._engine.rtcSignaling(e,t,r,n)}))];case 1:return[2,o.sent()]}}))}))}}),Object.defineProperty(e.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.rtcPing(e,t,r)}}),Object.defineProperty(e.prototype,"setProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_SET_PROXY_T,JSON.stringify({proxy:e}),t),[4,pr.create("setProxy").check((function(t){return dc(t,e)})).result().next((function(){return n._engine.setProxy(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_SET_PROXY_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_PROXY_T,JSON.stringify({}),e),[4,this._engine.getProxy()];case 1:return t=r.sent(),this.logger.summary(B.A_GET_PROXY_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"testProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_TEST_PROXY_T,JSON.stringify({proxy:e,testHost:t}),r),[4,pr.create("testProxy").check((function(t){return dc(t,e)})).isString("testHost",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TESTHOST).result().next((function(){return i._engine.testProxy(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_TEST_PROXY_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_REALTIME_CONVERSATIONS_T,JSON.stringify({count:e,startTime:t,order:r}),n),[4,pr.create("getRealtimeConversations").isLimitedInteger("count",e,1,50,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isTimestamp("startTime",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("order",r,0,1,!0).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).result().tryTrans(this.validateConnected).tryTrans(mc).next((function(){return o._engine.chat.getRealtimeConversations(e,t,r)}))];case 1:return i=a.sent(),this.logger.summary(B.A_GET_REALTIME_CONVERSATIONS_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getRealtimeConTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_REALTIM_CON_TOTAL_UNREAD_COUNT_T,"",e),[4,this.validateConnected().tryTrans(mc).next((function(){return r._engine.chat.getRealtimeConTotalUnreadCount()}))];case 1:return t=n.sent(),this.logger.summary(B.A_GET_REALTIM_CON_TOTAL_UNREAD_COUNT_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"clearRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_CLEAR_REALTIME_CON_UNREAD_COUNT_T,JSON.stringify(e),t),[4,this.validateConnected().tryTrans(mc).next((function(){return n._engine.chat.clearRealtimeConUnreadCount(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_CLEAR_REALTIME_CON_UNREAD_COUNT_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"removeRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_REALTIME_CONVERSATIONS_T,JSON.stringify(e),t),[4,pr.create("removeRealtimeConversations").check((function(t){t.isLimitedTypedArray("identifiers",e,20,(function(e){return!uc(t,e,X).isFailed}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST)})).result().tryTrans(this.validateConnected).tryTrans(mc).next((function(){return n._engine.chat.removeRealtimeConversations(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_REMOVE_REALTIME_CONVERSATIONS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"batchGetRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_BATCH_GET_REALTIME_CON_UNREAD_COUNT_T,JSON.stringify(e),t),[4,pr.create("batchGetRealtimeConUnreadCount").check((function(t){t.isLimitedTypedArray("identifiers",e,10,(function(e){return!uc(t,e,X).isFailed}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST)})).result().tryTrans(this.validateConnected).tryTrans(mc).next((function(){return n._engine.chat.batchGetRealtimeConUnreadCount(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_BATCH_GET_REALTIME_CON_UNREAD_COUNT_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"setNotificationQuietHoursWithSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return pr.create("setNotificationQuietHoursWithSetting").isObject("opts",e,!0).isString("timezone",e.timezone).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER).validate("startTime",e.startTime,(function(e){return/^\d{2}(:\d{2}){2}$/.test(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTRING).isLimitedNumber("spanMinutes",e.spanMinutes,1,1439,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SPAN_MINUTES).isNumberEnum("level",e.level,exports.PushNotificationQuietHoursLevel,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected).next((function(){return t._engine.setNotificationQuietHoursWithSetting(e)}))}}),Object.defineProperty(e.prototype,"removeNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;return this.validateConnected().next((function(){return e._engine.removeNotificationQuietHoursSetting()}))}}),Object.defineProperty(e.prototype,"getNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;return this.validateConnected().next((function(){return e._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 r;return a(this,(function(n){return(r=sc("sendReadReceiptResponseV5",e,q).isTypedArray("messageUIdArray",t,(function(e){return Nt(e)}),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",t.length,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?fr():_r(exports.ErrorCode.READ_RECEIPT_ERROR)}))).isOk?[2,this._engine.chat.sendReadReceiptResponseV5(e,t)]:[2,r.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 r,n;return a(this,(function(i){return(r=sc("getMessageReadReceiptInfoV5",e,q).isTypedArray("messageUIdArray",t,(function(e){return Nt(e)}),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",t.length,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?fr():_r(exports.ErrorCode.READ_RECEIPT_ERROR)}))).isOk?(n=t.map((function(t){return{identifier:e,messageUId:t}})),[2,this._engine.chat.getMessageReadReceiptInfoV5ByIdentifiers(n)]):[2,r.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,r;return a(this,(function(n){return t=pr.create(""),(r=pr.create("getMessageReadReceiptInfoV5ByIdentifiers").isTypedArray("identifiers",e,(function(e){return uc(t,e.identifier,q).isNotEmptyString("messageUId",e.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).result().isOk}),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",e.length,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?fr():_r(exports.ErrorCode.READ_RECEIPT_ERROR)}))).isOk?[2,this._engine.chat.getMessageReadReceiptInfoV5ByIdentifiers(e)]:[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptUsersByPageV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return a(this,(function(i){return(n=sc("getMessageReadReceiptInfoV5",e,q).isNotEmptyString("messageUId",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isObject("option",r,!0).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,"option type error").isString("pageToken",r.pageToken).fail(exports.ErrorCode.INVALID_PARAMETER_PAGING_QUERY_OPTION).isLimitedInteger("pageCount",r.pageCount,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?fr():_r(exports.ErrorCode.READ_RECEIPT_ERROR)}))).isOk?(r.order=1!==r.order?0:1,r.readStatus=1!==r.readStatus?0:1,[2,this._engine.chat.getMessagesReadReceiptUsersByPageV5(e,t,r)]):[2,n.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptByUsersV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return a(this,(function(i){return(n=sc("getMessagesReadReceiptByUsersV5",e,q).isNotEmptyString("messageUId",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isTypedArray("userList",r,(function(e){return Nt(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isLimitedInteger("userList",r.length,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?fr():_r(exports.ErrorCode.READ_RECEIPT_ERROR)}))).isOk?[2,this._engine.chat.getMessagesReadReceiptByUsersV5(e,t,r)]:[2,n.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 r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_REQUEST_SPEECH_TO_TEXT_FOR_MESSAGE_T,JSON.stringify({messageUId:e,option:t}),r),[4,pr.create("requestSpeechToTextForMessage").isNotEmptyString("messageUId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).tryTrans((function(e){return!!(1&(e.AIBusinessSub||0))?fr():_r(exports.ErrorCode.SPEECH_TO_TEXT_DISABLE)})).next((function(){return i._engine.chat.requestSpeechToTextForMessage(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_REQUEST_SPEECH_TO_TEXT_FOR_MESSAGE_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"setMessageSpeechToTextVisible",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r=this;return a(this,(function(n){switch(n.label){case 0:return[4,pr.create("setMessageSpeechToTextVisible").isNumber("messageId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).result().tryTrans(this.validateLogin).next((function(){return r._engine.chat.setMessageSpeechToTextVisible(e,!!t)}))];case 1:return[2,n.sent()]}}))}))}}),Object.defineProperty(e.prototype,"getUntaggedConversationListByPage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_UNTAGGED_CONVERSATION_LIST_BY_PAGE_T,JSON.stringify({timestamp:e,count:t,topPriority:r}),n),[4,pr.create("getUntaggedConversationListByPage").isLimitedInteger("timestamp",e,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isInteger("count",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateLogin).next((function(){var n=t<=0?20:Math.min(t,100);return o._engine.chat.getUntaggedConversationListByPage(e,n,!!r)}))];case 1:return i=a.sent(),this.logger.summary(B.A_GET_UNTAGGED_CONVERSATION_LIST_BY_PAGE_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"translateMessagesWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var r,n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return r=Pt(),[4,pr.create("translateMessagesWithParams").isTypedArray("list",null==e?void 0:e.list,(function(e){return e instanceof yn&&e.isValid(!r)}),!0).fail(exports.ErrorCode.TRANSLATION_PARAMS_TYPE_INVALID).isLimitedInteger("list",null===(t=null==e?void 0:e.list)||void 0===t?void 0:t.length,1,10,!0).fail(exports.ErrorCode.TRANSLATION_PARAMS_LIST_INVALID).isNumberEnum("mode",null==e?void 0:e.mode,Rn).fail(exports.ErrorCode.INVALID_PARAMETER_TRANSLATE_MODE).result().tryTrans(this.validateConnected)];case 1:return(n=a.sent()).isOk?(i=e.list,o=e.force,s=e.mode,[2,c(this,Nb,"m",Gb).call(this,i,0,s,o)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"translateTextsWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var r,n,i;return a(this,(function(o){switch(o.label){case 0:return[4,pr.create("translateTextsWithParams").isTypedArray("list",null==e?void 0:e.list,(function(e){return e instanceof An&&e.isValid(!0)}),!0).fail(exports.ErrorCode.TRANSLATION_PARAMS_TYPE_INVALID).isLimitedInteger("list",null===(t=null==e?void 0:e.list)||void 0===t?void 0:t.length,1,10,!0).fail(exports.ErrorCode.TRANSLATION_PARAMS_LIST_INVALID).isNumberEnum("mode",null==e?void 0:e.mode,Rn).fail(exports.ErrorCode.INVALID_PARAMETER_TRANSLATE_MODE).result().tryTrans(this.validateConnected)];case 1:return(r=o.sent()).isOk?(n=e.list,i=e.mode,[2,c(this,Nb,"m",Gb).call(this,n,1,i)]):[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,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_SET_TRANSLATION_LANGUAGE_T,JSON.stringify({language:e}),t),[4,pr.create("setTranslationLanguage").isLimitedString("language",e,1,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_LAUGUAGE).result().tryTrans(this.validateConnected).next((function(){return n._engine.userSettings.setTranslationLanguage(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_SET_TRANSLATION_LANGUAGE_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_TRANSLATION_LANGUAGE_T,void 0,e),[4,this.validateLogin().next((function(){return r._engine.userSettings.getTranslationLanguage()}))];case 1:return t=n.sent(),this.logger.summary(B.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,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_SET_AUTO_TRANSLATE_ENABLED_T,JSON.stringify({enabled:!!e}),t),[4,this.validateConnected().next((function(){return n._engine.userSettings.setAutoTranslateEnabled(!!e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_SET_AUTO_TRANSLATE_ENABLED_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_AUTO_TRANSLATE_ENABLED_T,void 0,e),[4,this.validateLogin().next((function(){return r._engine.userSettings.getAutoTranslateEnabled()}))];case 1:return t=n.sent(),this.logger.summary(B.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,r,n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return t=this.logger.createTraceId(),r=null==e?void 0:e.messageUId,n=null==e?void 0:e.messageContent,this.logger.info(B.A_MODIFY_MESSAGE_WITH_PARAMS_T,JSON.stringify({messageUId:r,conversation:null==e?void 0:e.conversation}),t),[4,pr.create("modifyMessageWithParams").check((function(t){return uc(t,null==e?void 0:e.conversation,Z)})).isNotEmptyString("messageUId",r,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isObject("messageContent",n,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_CONTENT).isLimitedInteger("messageContent",fc(JSON.stringify(n)),1,He,!0).fail(exports.ErrorCode.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(B.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,r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),r=null==e?void 0:e.messageUIds,this.logger.info(B.A_REFRESH_REFERENCE_MESSAGE_WITH_PARAMS_T,JSON.stringify({messageUIds:r}),t),[4,sc("refreshReferenceMessageWithParams",null==e?void 0:e.conversationIdentifier,Z).isObject("params",e,!0).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER).isTypedArray("messageUIds",r,(function(e){return vt(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("messageUIds",null==r?void 0:r.length,1,20,!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).next((function(){return i._engine.chat.refreshReferenceMessageWithParams(r,e.conversationIdentifier,e.remoteMessageBlock,e.localMessageBlock,e.messageInfoMap)}))];case 1:return n=o.sent(),this.logger.summary(B.A_REFRESH_REFERENCE_MESSAGE_WITH_PARAMS_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"syncRemoteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_SYNC_REMOTE_CONVERSATIONS_T,void 0,e),[4,this.validateConnected().next((function(){return r._engine.chat.syncRemoteConversations()}))];case 1:return t=n.sent(),this.logger.summary(B.A_SYNC_REMOTE_CONVERSATIONS_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"deleteLocalUGMessagesForAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_DEL_LOCAL_UG_MSGS_FOR_ALL_CHANNEL_T,JSON.stringify({targetId:e,timestamp:t}),r),[4,pr.create("deleteLocalUGMessagesForAllChannel").isNotEmptyString("targetId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isTimestamp("timestamp",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin).next((function(){return i._engine.chat.deleteLocalUGMessagesForAllChannel(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_DEL_LOCAL_UG_MSGS_FOR_ALL_CHANNEL_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionMeConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UNREAD_MENTION_ME_CONVERSATION_LIST_T,JSON.stringify({params:e}),t),[4,pr.create("getUnreadMentionMeConversationList").isLimitedTypedArray("conversationTypes",null==e?void 0:e.conversationTypes,Number.MAX_SAFE_INTEGER,(function(e){return te(e,K)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isTimestamp("timestamp",null==e?void 0:e.timestamp,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("count",null==e?void 0:e.count,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).next((function(t){return o(n,void 0,void 0,(function(){var r;return a(this,(function(n){if(r=xg(t)){if(!this._engine.chat.ugSynced)return[2,_r(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}else if(e.conversationTypes=e.conversationTypes.filter((function(e){return e!==exports.ConversationType.ULTRA_GROUP})),0===e.conversationTypes.length)return[2,fr([])];return[2,this._engine.chat.getUnreadMentionMeConversationList(e,r)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(B.A_GET_UNREAD_MENTION_ME_CONVERSATION_LIST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getAllRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_ALL_ROBOTS_T,void 0,e),[4,this.validateConnected().next((function(){return r._engine.getAllRobots()}))];case 1:return t=n.sent(),this.logger.summary(B.A_GET_ALL_ROBOTS_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"getRobotById",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i=this;return a(this,(function(s){switch(s.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_ROBOT_BY_ID_T,JSON.stringify({id:e}),t),[4,pr.create("getRobotById").validate("id",e,Nt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateConnected).next((function(){return o(i,void 0,void 0,(function(){return a(this,(function(e){return[2,this._engine.getAllRobots()]}))}))}))];case 1:return r=s.sent(),n=r.trans((function(t){return t.find((function(t){return t.robotId===e}))||null})),this.logger.summary(B.A_GET_ROBOT_BY_ID_R,r,t,{id:e,robot:n.data}),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getMessagesByUIds",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_MESSAGES_T,JSON.stringify({conversation:e,messageUIds:t}),r),[4,pr.create("getMessages").check((function(t){return uc(t,e,K)})).isTypedArray("messageUIds",t,vt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("messageUIds",null==t?void 0:t.length,1,20,!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).next((function(){var r=Array.from(new Set(t));return i._engine.getMessagesByUIds(e,r)}))];case 1:return n=o.sent(),this.logger.summary(B.A_GET_MESSAGES_R,n,r,void 0,(function(e){return{missingMessageUIds:Array.from(new Set(t)).filter((function(t){return!e.some((function(e){return e.messageUId===t}))}))}})),[2,n]}}))}))}}),e}();Nb=new WeakSet,Mb=function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,s=this;return a(this,(function(u){switch(u.label){case 0:return[4,pr.create("connect").isNotEmptyString("token",e).fail(exports.ErrorCode.RC_CONN_TOKEN_INCORRECT).result().next((function(){return o(s,void 0,void 0,(function(){var n,i;return a(this,(function(o){switch(o.label){case 0:return this._token=e,[4,ua.getNetworkType()];case 1:return n=o.sent(),this._engine.setNetwork({status:!0,type:n},!0),i=!!this._pluginInstanseMap.RCCallPlus,[2,this._engine.connect(e,t,i,r)]}}))}))}))];case 1:return(n=u.sent()).isOk&&1!==this._engine.naviInfo.type&&(i=ft.getInfo(),this._engine.reportSDKInfo(i)),[2,n]}}))}))},Pb=function(e,t){return o(this,void 0,void 0,(function(){var r=this;return a(this,(function(n){switch(n.label){case 0:return clearInterval(this._typingInternalTimer),this._typingInternalTimer=-1,this._typingInfo={},[4,this._engine.disconnect(e,t)];case 1:return n.sent(),this._pluginContextQueue.forEach((function(e){if(e.ondisconnect)try{e.ondisconnect()}catch(e){r.logger.error(B.L_CALLBACK_E,null==e?void 0:e.stack)}})),[2,Promise.resolve()]}}))}))},Lb=function(e){return n(n({},e),{channelId:this._channelIdConvert(e.conversationType,e.channelId)})},wb=function(e,t,r,n){return o(this,void 0,void 0,(function(){var i=this;return a(this,(function(o){switch(o.label){case 0:return[4,pr.create("sendMessage").check((function(t){return uc(t,e,X)})).isObject("content",t.content,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_CONTENT).check((function(e){var r=ac(t.messageType,t.content);r.isOk||e.setFailed(r.code)})).isNumber("messageId",t.messageId).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).isBoolean("isStatusMessage",t.isStatusMessage).fail(exports.ErrorCode.INVALID_PARAMETER_IS_STATUS_MESSAGE).isBoolean("disableNotification",t.disableNotification).fail(exports.ErrorCode.INVALID_PARAMETER_DISABLE_NOTIFICATION).isString("pushContent",t.pushContent).fail(exports.ErrorCode.INVALID_PARAMETER_PUSH_CONTENT).isString("pushData",t.pushData).fail(exports.ErrorCode.INVALID_PARAMETER_PUSH_DATA).isObject("pushConfig",t.pushConfig).fail(exports.ErrorCode.INVALID_PARAMETER_PUSH_CONFIG).isBoolean("isVoipPush",t.isVoipPush).fail(exports.ErrorCode.INVALID_PARAMETER_IS_VOIP_PUSH).isBoolean("canIncludeExpansion",t.canIncludeExpansion).fail(exports.ErrorCode.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION).check((function(e){t.canIncludeExpansion&&t.expansion&&cc(e,t.expansion,!0)})).check((function(r){r.isBoolean("disableUpdateLastMessage",t.disableUpdateLastMessage).fail(exports.ErrorCode.INVALID_DISABLE_UPDATE_LAST_MESSAGE),r.isFailed||e.conversationType===exports.ConversationType.ULTRA_GROUP&&t.disableUpdateLastMessage&&r.setFailed(exports.ErrorCode.INVALID_DISABLE_UPDATE_LAST_MESSAGE)})).check((function(r){if(!r.isLimitedTypedArray("directionalUserIdList",t.directionalUserIdList,300,Nt,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).isFailed&&t.directionalUserIdList&&0!==t.directionalUserIdList.length){var n=e.conversationType;[exports.ConversationType.GROUP,exports.ConversationType.ULTRA_GROUP,exports.ConversationType.APP_PUBLIC_SERVICE,exports.ConversationType.PUBLIC_SERVICE].includes(n)||r.setFailed(exports.ErrorCode.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE)}})).isBoolean("isMentioned",t.isMentioned).fail(exports.ErrorCode.INVALID_PARAMETER_IS_MENTIONED).check((function(e){if(t.isMentioned){var r=t.content.mentionedInfo||{type:t.mentionedType,userIdList:t.mentionedUserIdList};!e.isNumberEnum("mentionedType",null==r?void 0:r.type,exports.MentionedType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MENTIONED_TYPE).isTypedArray("mentionedUserIdList",null==r?void 0:r.userIdList,Nt,(null==r?void 0:r.type)===exports.MentionedType.SINGAL).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).isString("mentionedContent",null==r?void 0:r.mentionedContent).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_CONTENT).isFailed&&(t.content.mentionedInfo=r)}else delete t.content.mentionedInfo})).check((function(e){var r=t.quoteInfo;r&&e.isObject("quoteInfo",r,!0).isNotEmptyString("quoteInfo.messageUId",r.messageUId,!0).isNotEmptyString("quoteInfo.senderId",r.senderId,!0).isNotEmptyString("quoteInfo.objectName",r.objectName,!0).isNumberEnum("quoteInfo.quoteMessageStatus",r.quoteMessageStatus,je).fail(exports.ErrorCode.INVALID_PARAMETER_QUOTE_INFO)})).result().tryTrans(this.validateConnected).tryTrans((function(r){if(!t.needReceipt)return fr(r);if(r.grpRRVer!==Ve.V5)return _r(exports.ErrorCode.READ_RECEIPT_ERROR);var n=e.conversationType,i=En(t.messageType),o=i.isPersited,a=i.isStatusMessage;return(n!==exports.ConversationType.GROUP&&n!==exports.ConversationType.PRIVATE||t.isStatusMessage||a||!o||n===exports.ConversationType.GROUP&&t.directionalUserIdList&&t.directionalUserIdList.length>0)&&(t.needReceipt=!1),fr(r)})).tryTrans((function(r){var n=e.conversationType,i=t.messageType;if(n===exports.ConversationType.SYSTEM&&i!==me.SYNC_READ_STATUS)return _r(exports.ErrorCode.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE);if(i===me.STREAM_MESSAGE)return _r(exports.ErrorCode.MESSAGE_NOT_SUPPORT_SENDING);if(i===me.READ_RECEIPT_RESPONSE&&r.grpRRVer)return _r(exports.ErrorCode.READ_RECEIPT_ERROR);var o=fc(JSON.stringify(t.content));if(o>He)return _r(exports.ErrorCode.RC_MSG_CONTENT_EXCEED_LIMIT);var a=[me.VOICE,me.IMAGE,me.LOCATION,me.REFERENCE,me.SIGHT,me.COMBINE,me.COMBINE_V2,me.STREAM_MESSAGE],s=r.msgMaxLengthV2||0;return s&&!a.includes(i)&&o>s?_r(exports.ErrorCode.RC_MSG_CONTENT_EXCEED_LIMIT):fr()})).next((function(){return c(i,Nb,"m",Ub).call(i,e,t,r,n)}))];case 1:return[2,o.sent()]}}))}))},Ub=function(e,t,r,n){var i=c(this,Nb,"m",Lb).call(this,e);return i.conversationType===exports.ConversationType.ULTRA_GROUP?this._engine.sendUltraMessage(i,t,r,n):this._engine.sendMessage(i,t,r,n)},Db=function(e,t,r){return o(this,void 0,void 0,(function(){return a(this,(function(n){switch(n.label){case 0:return[4,this._engine.sendMessage(e,{content:t,messageType:me.EXPANSION_NOTIFY},r)];case 1:return[2,n.sent().wipe()]}}))}))},xb=function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=e.timeRange||{},r=t.startTime,n=t.endTime,i={startTime:null!=r?r:0,endTime:null!=n?n:Number.MAX_SAFE_INTEGER},e.timeRange=i,o=this.logger.createTraceId(),this.logger.info(B.A_SEARCH_MSGS_BY_PARAMS_T,JSON.stringify(e),o),[4,this._engine.searchMessagesWithParams(e)];case 1:return s=a.sent(),this.logger.summary(B.A_SEARCH_MSGS_BY_PARAMS_R,s,o),[2,s]}}))}))},Gb=function(e,t,r,n){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()})),r||Rn.MECHANICAL,!!n,t)]}))}))},exports.APIContext=Wb,exports.BaseTranslateParam=mn,exports.BasicLogger=qr,exports.Codec=Ql,exports.EventEmitter=ql,exports.FilterRobotType=xe,exports.GroupReadReceiptVersion=Ve,exports.LogDBProxy=$r,exports.LogTagId=B,exports.MAX_MESSAGE_CONTENT_BYTES=He,exports.MAX_U32_INTEGER=lt,exports.MAX_UPLOAD_FILE_SIZE=5368709120,exports.MessageAuditType={DISALLOW:0,ALLOW:1},exports.MessageModifyStatus=xr,exports.MessageReactionOperationType=ke,exports.MessageType=me,exports.PBCodec=Al,exports.PluginContext=tc,exports.QuoteMessageStatus=je,exports.RCResult=dr,exports.RTCPluginContext=rc,exports.ReferenceMessageStatus=Gr,exports.SpeechToTextStatus=Ge,exports.SuspendablePromise=cr,exports.TranslateMessageParam=yn,exports.TranslateMode=Rn,exports.TranslateStatus=On,exports.TranslateStrategy=Sn,exports.TranslateTextParam=An,exports.UPLOAD_FILE_CHUNK_SIZE=10485760,exports.UUId=_t,exports.UserSettingsChangedKey=Vr,exports.UserType={NORMAL:0,ROBOT:1},exports.Validator=pr,exports.VersionManage=ft,exports.assert=function(e,t,r,n){if(void 0===n&&(n=!1),!oc(e,t,r,n))throw new ic("'".concat(e,"' is invalid: ").concat(JSON.stringify(t)))},exports.createLogDBProxy=en,exports.fail=_r,exports.fixUrlProtocol=rr,exports.forEach=Kl,exports.getMessageTypeDescription=En,exports.getUUID=function(){return _t.gen()},exports.getUUID22=function(){return _t.genWithLen(22)},exports.hasMessageTypeDescription=bn,exports.httpRequest=wr,exports.isArray=It,exports.isBoolean=function(e){return"boolean"==typeof e},exports.isFunction=mt,exports.isHttpUrl=At,exports.isInteger=bt,exports.isLimitedString=Tt,exports.isNull=function(e){return"[object Null]"===Object.prototype.toString.call(e)},exports.isNumber=Et,exports.isObject=Rt,exports.isString=gt,exports.isUndefined=yt,exports.isValidConversationType=function(e){return Et(e)&&Object.prototype.hasOwnProperty.call(exports.ConversationType,e)},exports.isValidEnum=function(e){return Object.values(e.type).includes(e.value)},exports.isValidFileType=function(e){return Et(e)&&Object.prototype.hasOwnProperty.call(exports.FileType,e)},exports.isValidGroupId=Mt,exports.isValidTargetId=Nt,exports.map=function(e,t){return Kl(e,(function(r,n){e[n]=t(r,n)})),e},exports.notEmptyArray=function(e){return It(e)&&e.length>0},exports.notEmptyObject=Ot,exports.notEmptyString=vt,exports.ok=fr,exports.promiseWithResolvers=br,exports.runtime=ua,exports.trans2IReceivedStatusInfo=Lt,exports.trans2NotificationLevel=function(e){return e===exports.NotificationStatus.OPEN?exports.NotificationLevel.AT_MESSAGE_NOTIFICATION:exports.NotificationLevel.NOT_SET},exports.trans2NotificationStatus=we,exports.transformReceivedStatusFlag=function(e){var t=exports.ReceivedStatus.UNREAD;return(null==e?void 0:e.isRead)&&(t|=exports.ReceivedStatus.READ),(null==e?void 0:e.isListened)&&(t|=exports.ReceivedStatus.LISTENED),(null==e?void 0:e.isDownload)&&(t|=exports.ReceivedStatus.DOWNLOADED),(null==e?void 0:e.isRetrieved)&&(t|=exports.ReceivedStatus.RETRIEVED),t},exports.usingCppEngine=Pt,exports.validate=oc;
16
+ function e(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]])}return r}function t(e,t,r,i){return new(r||(r=Promise))((function(s,n){function o(e){try{l(i.next(e))}catch(e){n(e)}}function a(e){try{l(i.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}l((i=i.apply(e,t||[])).next())}))}function r(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}function i(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r}var s;Object.defineProperty(exports,"__esModule",{value:!0}),exports.UploadMethod=void 0,(s=exports.UploadMethod||(exports.UploadMethod={}))[s.QINIU=1]="QINIU",s[s.ALI=2]="ALI",s[s.AWS=3]="AWS",s[s.STC=4]="STC",s[s.MINIO=5]="MINIO";const n={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",A_SEND_TYPING_STATUS_T:"A-send_typing_status-T",A_SEND_TYPING_STATUS_R:"A-send_typing_status-R",A_SEND_READ_RECEIPT_REQ_T:"A-send_read_receipt_req-T",A_SEND_READ_RECEIPT_REQ_R:"A-send_read_receipt_req-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_LOCAL_MSGS_T:"A-delete_local_msgs-T",A_DELETE_LOCAL_MSGS_R:"A-delete_local_msgs-R",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_REJOIN_CHATROOM_T:"L-rejoin_chatroom-T",L_REJOIN_CHATROOM_R:"L-rejoin_chatroom-R",A_QUIT_CHATROOM_T:"A-quit_chatroom-T",A_QUIT_CHATROOM_R:"A-quit_chatroom-R",A_GET_CHATROOM_INFO_T:"A-get_chatroom_info-T",A_GET_CHATROOM_INFO_R:"A-get_chatroom_info-R",A_SET_CHATROOM_ENTRY_T:"A-set_chatroom_entry-T",A_SET_CHATROOM_ENTRY_R:"A-set_chatroom_entry-R",A_SET_CHATROOM_ENTRIES_T:"A-set_chatroom_entries-T",A_SET_CHATROOM_ENTRIES_R:"A-set_chatroom_entries-R",A_REMOVE_CHATROOM_ENTRY_T:"A-remove_chatroom_entry-T",A_REMOVE_CHATROOM_ENTRY_R:"A-remove_chatroom_entry-R",A_REMOVE_CHATROOM_ENTRIES_T:"A-remove_chatroom_entries-T",A_REMOVE_CHATROOM_ENTRIES_R:"A-remove_chatroom_entries-R",A_GET_CHATROOM_ENTRY_T:"A-get_chatroom_entry-T",A_GET_CHATROOM_ENTRY_R:"A-get_chatroom_entry-R",A_GET_CHATROOM_ENTRIES_T:"A-get_chatroom_entries-T",A_GET_CHATROOM_ENTRIES_R:"A-get_chatroom_entries-R",A_BIND_RTC_FOR_CHATROOM_T:"A-bind_rtc_for_chatroom-T",A_BIND_RTC_FOR_CHATROOM_R:"A-bind_rtc_for_chatroom-R",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",A_GET_REMOTE_HISTORY_MSG_T:"A-get_remote_history_msg-T",A_GET_REMOTE_HISTORY_MSG_R:"A-get_remote_history_msg-R",L_CALLBACK_E:"L-callback-E",A_SEND_READ_RECEIPT_T:"A-send_read_receipt-T",A_SEND_READ_RECEIPT_R:"A-send_read_receipt-R",A_SEND_READ_RECEIPT_V2_T:"A-send_read_receipt_v2-T",A_SEND_READ_RECEIPT_V2_R:"A-send_read_receipt_v2-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_UNSUPPORT_NTF_FROM_MAIN_E:"L_UNSUPPORT_NTF_FROM_MAIN_E",A_REMOVE_PROXY_O:"A-remove_proxy-O",L_SET_PROXY_O:"L-set_proxy-O",L_TEST_PROXY_T:"L-test_proxy-T",L_TEST_PROXY_R:"L-test_proxy-R",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_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_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_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_DEL_REMOTE_MSGS_T:"A-del_remote_msgs-T",A_DEL_REMOTE_MSGS_R:"A-del_remote_msgs-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",A_LOAD_CONVERSATION_LIST_T:"A-load_conversation_list-T",A_LOAD_CONVERSATION_LIST_R:"A-load_conversation_list-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_UNREAD_COUNT_T:"A-get_unread_count-T",A_GET_UNREAD_COUNT_R:"A-get_unread_count-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",L_PULL_OFFLINE_MESSAGE_FINISHED_S:"L-pull_offline_message_finished-S",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",A_BATCH_DEL_CONVERS_T:"A-batch_del_conversation-T",A_BATCH_DEL_CONVERS_R:"A-batch_del_conversation-R",A_SYNC_REMOTE_CONVERSATIONS_T:"A-e_sync_remote_conversations-T",A_SYNC_REMOTE_CONVERSATIONS_R:"A-e_sync_remote_conversations-R",L_UPDATE_MSG_BOX_TIME_O:"L-update_msg_box_time-O",A_SEND_UG_TYPING_T:"A-send_ug_typing-T",A_SEND_UG_TYPING_R:"A-send_ug_typing-R",A_GET_UG_LIST_T:"A-get_ug_list-T",A_GET_UG_LIST_R:"A-get_ug_list-R",A_GET_UG_MSGS_BY_UID_T:"A-get_ug_msgs_by_uid-T",A_GET_UG_MSGS_BY_UID_R:"A-get_ug_msgs_by_uid-R",A_GET_UG_UNREAD_MENTIONED_DIGEST_T:"A-get_ug_unread_mentioned_digest-T",A_GET_UG_UNREAD_MENTIONED_DIGEST_R:"A-get_ug_unread_mentioned_digest-R",A_GET_HIS_MSGS_BY_OBJ_NAMES_T:"A-get_his_msgs_by_obj_names-T",A_GET_HIS_MSGS_BY_OBJ_NAMES_R:"A-get_his_msgs_by_obj_names-R",A_GET_CONTINUOUS_MSGS_T:"A-get_continuous_msgs-T",A_GET_CONTINUOUS_MSGS_R:"A-get_continuous_msgs-R",A_GET_MSGS_AROUND_TIMESTAMP_T:"A-get_msgs_around_timestamp-T",A_GET_MSGS_AROUND_TIMESTAMP_R:"A-get_msgs_around_timestamp-R",A_CLEAR_LOCAL_MSG_T:"A-clear_local_msg-T",A_CLEAR_LOCAL_MSG_R:"A-clear_local_msg-R",A_DEL_LOCAL_MSGS_BY_TIME_T:"A-del_local_msgs_by_time-T",A_DEL_LOCAL_MSGS_BY_TIME_R:"A-del_local_msgs_by_time-R",A_BATCH_CLEAR_LOCAL_MSGS_BY_TIME_T:"A-batch_clear_local_msgs_by_time-T",A_BATCH_CLEAR_LOCAL_MSGS_BY_TIME_R:"A-batch_clear_local_msgs_by_time-R",A_DEL_LOCAL_UG_MSGS_FOR_ALL_CHANNEL_T:"A-del_local_ug_msgs_for_all_channel-T",A_DEL_LOCAL_UG_MSGS_FOR_ALL_CHANNEL_R:"A-del_local_ug_msgs_for_all_channel-R",A_UPDATE_MSG_EXPANSION_T:"A-update_msg_expansion-T",A_UPDATE_MSG_EXPANSION_R:"A-update_msg_expansion-R",A_REMOVE_MSG_EXPANSION_T:"A-remove_msg_expansion-T",A_REMOVE_MSG_EXPANSION_R:"A-remove_msg_expansion-R",A_REMOVE_ALL_MSG_EXPANSION_T:"A-remove_all_msg_expansion-T",A_REMOVE_ALL_MSG_EXPANSION_R:"A-remove_all_msg_expansion-R",A_INSERT_MSG_T:"A-insert_msg-T",A_INSERT_MSG_R:"A-insert_msg-R",A_BATCH_INSERT_MSGS_T:"A-batch_insert_msgs-T",A_BATCH_INSERT_MSGS_R:"A-batch_insert_msgs-R",A_SET_MSG_CONTENT_T:"A-set_msg_content-T",A_SET_MSG_CONTENT_R:"A-set_msg_content-R",A_SET_UG_DEFAULT_NTF_LEVEL_T:"A-set_ug_default_ntf_level-T",A_SET_UG_DEFAULT_NTF_LEVEL_R:"A-set_ug_default_ntf_level-R",A_GET_UG_DEFAULT_NTF_LEVEL_T:"A-get_ug_default_ntf_level-T",A_GET_UG_DEFAULT_NTF_LEVEL_R:"A-get_ug_default_ntf_level-R",A_GET_UG_UNREAD_COUNT_FOR_ALL_CHANNELS_T:"A-get_ug_unread_count_for_all_channels-T",A_GET_UG_UNREAD_COUNT_FOR_ALL_CHANNELS_R:"A-get_ug_unread_count_for_all_channels-R",A_GET_TOTAL_UNREAD_COUNT_BY_LEVELS_T:"A-get_total_unread_count_by_levels-T",A_GET_TOTAL_UNREAD_COUNT_BY_LEVELS_R:"A-get_total_unread_count_by_levels-R",A_GET_TOTAL_UNREAD_COUNT_T:"A-get_total_unread_count-T",A_GET_TOTAL_UNREAD_COUNT_R:"A-get_total_unread_count-R",A_GET_FIRST_UNREAD_MEG_T:"A-get_first_unread_msg-T",A_GET_FIRST_UNREAD_MSG_R:"A-get_first_unread_msg-R",A_GET_FIRST_UNREAD_MSG_DIGEST_T:"A-get_first_unread_msg_digest-T",A_GET_FIRST_UNREAD_MSG_DIGEST_R:"A-get_first_unread_msg_digest-R",A_GET_UNREAD_MENTIONED_MSGS_T:"A-get_unread_mentioned_msgs-T",A_GET_UNREAD_MENTIONED_MSGS_R:"A-get_unread_mentioned_msgs-R",A_GET_UG_UNREAD_INFO_LIST_T:"A-get_ug_unread_info_list-T",A_GET_UG_UNREAD_INFO_LIST_R:"A-get_ug_unread_info_list-R",A_GET_UG_FIRST_UNREAD_MSG_DIGEST_T:"A-get_ug_first_unread_msg_digest-T",A_GET_UG_FIRST_UNREAD_MSG_DIGEST_R:"A-get_ug_first_unread_msg_digest-R",A_GET_LOCAL_MSG_COUNT_T:"A-get_local_msg_count-T",A_GET_LOCAL_MSG_COUNT_R:"A-get_local_msg_count-R",A_GET_CONVERSATIONS_T:"A-get_conversations-T",A_GET_CONVERSATIONS_R:"A-get_conversations-R",A_GET_BLOCKED_UG_LIST_T:"A-get_blocked_ug_list-T",A_GET_BLOCKED_UG_LIST_R:"A-get_blocked_ug_list-R",A_CLEAR_UNREAD_COUNT_T:"A-clear_unread_count-T",A_CLEAR_UNREAD_COUNT_R:"A-clear_unread_count-R",A_CLEAR_ALL_UNREAD_COUNT_T:"A-clear_all_unread_count-T",A_CLEAR_ALL_UNREAD_COUNT_R:"A-clear_all_unread_count-R",A_GET_TOP_CONVERSATION_LIST_T:"A-get_top_conversation_list-T",A_GET_TOP_CONVERSATION_LIST_R:"A-get_top_conversation_list-R",A_GET_UNREAD_CONVERSATION_LIST_T:"A-get_unread_conversation_list-T",A_GET_UNREAD_CONVERSATION_LIST_R:"A-get_unread_conversation_list-R",A_GET_BLOCKED_CONVERSATION_LIST_T:"A-get_blocked_conversation_list-T",A_GET_BLOCKED_CONVERSATION_LIST_R:"A-get_blocked_conversation_list-R",A_GET_ALL_CONVERSATION_LIST_T:"A-get_all_conversation_list-T",A_GET_ALL_CONVERSATION_LIST_R:"A-get_all_conversation_list-R",A_GET_CONVERSATION_LIST_BY_TIME_T:"A-get_conversation_list_by_time-T",A_GET_CONVERSATION_LIST_BY_TIME_R:"A-get_conversation_list_by_time-R",A_GET_CONVERSATION_LIST_OLD_T:"A-get_conversation_list_old-T",A_GET_CONVERSATION_LIST_OLD_R:"A-get_conversation_list_old-R",A_GET_UNREAD_MENTIONED_COUNT_T:"A-get_unread_mentioned_count-T",A_GET_UNREAD_MENTIONED_COUNT_R:"A-get_unread_mentioned_count-R",A_GET_ALL_UNREAD_MENTIONED_COUNT_T:"A-get_all_unread_mentioned_count-T",A_GET_ALL_UNREAD_MENTIONED_COUNT_R:"A-get_all_unread_mentioned_count-R",A_GET_REALTIME_CONVERSATIONS_T:"A-get_realtime_conversations-T",A_GET_REALTIME_CONVERSATIONS_R:"A-get_realtime_conversations-R",A_GET_REALTIM_CON_TOTAL_UNREAD_COUNT_T:"A-get_realtime_con_total_unread_count-T",A_GET_REALTIM_CON_TOTAL_UNREAD_COUNT_R:"A-get_realtime_con_total_unread_count-R",A_CLEAR_REALTIME_CON_UNREAD_COUNT_T:"A-clear_realtime_con_unread_count-T",A_CLEAR_REALTIME_CON_UNREAD_COUNT_R:"A-clear_realtime_con_unread_count-R",A_REMOVE_REALTIME_CONVERSATIONS_T:"A-remove_realtime_conversations-T",A_REMOVE_REALTIME_CONVERSATIONS_R:"A-remove_realtime_conversations-R",A_BATCH_GET_REALTIME_CON_UNREAD_COUNT_T:"A-batch_get_realtime_con_unread_count-T",A_BATCH_GET_REALTIME_CON_UNREAD_COUNT_R:"A-batch_get_realtime_con_unread_count-R",A_GET_SUB_USERS_STATUS_T:"A-get_sub_users_status-T",A_GET_SUB_USERS_STATUS_R:"A-get_sub_users_status-R",A_GET_SUB_USERS_ONLINE_STATUS_T:"A-get_sub_users_online_status-T",A_GET_SUB_USERS_ONLINE_STATUS_R:"A-get_sub_users_online_status-R",A_SAVE_EDITED_MSG_DRAFT_T:"A-save_edited_msg_draft-T",A_SAVE_EDITED_MSG_DRAFT_R:"A-save_edited_msg_draft-R",A_GET_EDITED_MSG_DRAFT_T:"A-get_edited_msg_draft-T",A_GET_EDITED_MSG_DRAFT_R:"A-get_edited_msg_draft-R",A_CLEAR_EDITED_MSG_DRAFT_T:"A-clear_edited_msg_draft-T",A_CLEAR_EDITED_MSG_DRAFT_R:"A-clear_edited_msg_draft-R",A_GET_UNREAD_MENTION_ME_CONVERSATION_LIST_T:"A-get_unread_mention_me_conversation_list-T",A_GET_UNREAD_MENTION_ME_CONVERSATION_LIST_R:"A-get_unread_mention_me_conversation_list-R",A_GET_USER_PROFILES_T:"A-get_user_profiles-T",A_GET_USER_PROFILES_R:"A-get_user_profiles-R",A_ADD_TO_BLACKLIST_T:"A-add_to_blacklist-T",A_ADD_TO_BLACKLIST_R:"A-add_to_blacklist-R",A_REMOVE_FROM_BLACKLIST_T:"A-remove_from_blacklist-T",A_REMOVE_FROM_BLACKLIST_R:"A-remove_from_blacklist-R",A_GET_BLACKLIST_T:"A-get_blacklist-T",A_GET_BLACKLIST_R:"A-get_blacklist-R",A_GET_BLACKLIST_STATUS_T:"A-get_blacklist_status-T",A_GET_BLACKLIST_STATUS_R:"A-get_blacklist_status-R",A_E_SET_MSG_RECEIVED_STATUS_T:"A-e_set_msg_received_status-T",A_E_SET_MSG_RECEIVED_STATUS_R:"A-e_set_msg_received_status-R",A_E_SET_MSG_SENT_STATUS_T:"A-e_set_msg_sent_status-T",A_E_SET_MSG_SENT_STATUS_R:"A-e_set_msg_sent_status-R",A_E_SET_CHECK_DUPLICATE_MSG_T:"A-e_set_check_duplicate_msg-T",A_E_SET_CHECK_DUPLICATE_MSG_R:"A-e_set_check_duplicate_msg-R",A_SET_PROXY_T:"A-set_proxy-T",A_SET_PROXY_R:"A-set_proxy-R",A_GET_PROXY_T:"A-get_proxy-T",A_GET_PROXY_R:"A-get_proxy-R",A_TEST_PROXY_T:"A-test_proxy-T",A_TEST_PROXY_R:"A-test_proxy-R",A_CLEAR_UNREAD_COUNT_BY_TIME_T:"A-clear_unread_count_by_time-T",A_CLEAR_UNREAD_COUNT_BY_TIME_R:"A-clear_unread_count_by_time-R",A_GET_MSG_READER_T:"A-get_msg_reader-T",A_GET_MSG_READER_R:"A-get_msg_reader-R",A_SEND_READ_RECEIPT_V4_T:"A-send_read_receipt_v4-T",A_SEND_READ_RECEIPT_V4_R:"A-send_read_receipt_v4-R",A_GET_READ_RECEIPT_V4_T:"A-get_read_receipt_V4-T",A_GET_READ_RECEIPT_V4_R:"A-get_read_receipt_V4-R",A_BATCH_GET_READ_RECEIPT_INFO_V4_T:"A-batch_get_read_receipt_info_V4-T",A_BATCH_GET_READ_RECEIPT_INFO_V4_R:"A-batch_get_read_receipt_info_V4-R",A_GET_ALL_ROBOTS_T:"A-get_all_robots-T",A_GET_ALL_ROBOTS_R:"A-get_all_robots-R",A_GET_ROBOT_BY_ID_T:"A-get_robot_by_id-T",A_GET_ROBOT_BY_ID_R:"A-get_robot_by_id-R",A_ADD_FRIEND_T:"A-add_friend-T",A_ADD_FRIEND_R:"A-add_friend-R",A_DELETE_FRIENDS_T:"A-delete_friends-T",A_DELETE_FRIENDS_R:"A-delete_friends-R",A_ACCEPT_FRIEND_REQUEST_T:"A-accept_friend_request-T",A_ACCEPT_FRIEND_REQUEST_R:"A-accept_friend_request-R",A_REFUSE_FRIEND_REQUEST_T:"A-refuse_friend_request-T",A_REFUSE_FRIEND_REQUEST_R:"A-refuse_friend_request-R",A_SET_FRIEND_INFO_T:"A-set_friend_info-T",A_SET_FRIEND_INFO_R:"A-set_friend_info-R",A_CHECK_FRIENDS_T:"A-check_friends-T",A_CHECK_FRIENDS_R:"A-check_friends-R",A_GET_FRIENDS_T:"A-get_friends-T",A_GET_FRIENDS_R:"A-get_friends-R",A_GET_FRIEND_APPLICATIONS_T:"A-get_friend_applications-T",A_GET_FRIEND_APPLICATIONS_R:"A-get_friend_applications-R",A_GET_FRIENDS_INFO_T:"A-get_friends_info-T",A_GET_FRIENDS_INFO_R:"A-get_friends_info-R",A_SEARCH_FRIENDS_INFO_T:"A-search_friends_info-T",A_SEARCH_FRIENDS_INFO_R:"A-search_friends_info-R",A_SET_FRIEND_ADD_PERMISSION_T:"A-set_friend_add_permission-T",A_SET_FRIEND_ADD_PERMISSION_R:"A-set_friend_add_permission-R",A_GET_FRIEND_ADD_PERMISSION_T:"A-get_friend_add_permission-T",A_GET_FRIEND_ADD_PERMISSION_R:"A-get_friend_add_permission-R",A_CREATE_GROUP_T:"A-create_group-T",A_CREATE_GROUP_R:"A-create_group-R",A_UPDATE_GROUP_INFO_T:"A-update_group_info-T",A_UPDATE_GROUP_INFO_R:"A-update_group_info-R",A_GET_GROUPS_INFO_T:"A-get_groups_info-T",A_GET_GROUPS_INFO_R:"A-get_groups_info-R",A_KICK_GROUP_MEMBERS_T:"A-kick_group_members-T",A_KICK_GROUP_MEMBERS_R:"A-kick_group_members-R",A_QUIT_GROUP_T:"A-quit_group-T",A_QUIT_GROUP_R:"A-quit_group-R",A_DISMISS_GROUP_T:"A-dismiss_group-T",A_DISMISS_GROUP_R:"A-dismiss_group-R",A_TRANSFER_GROUP_OWNER_T:"A-transfer_group_owner-T",A_TRANSFER_GROUP_OWNER_R:"A-transfer_group_owner-R",A_ADD_GROUP_MANAGERS_T:"A-add_group_managers-T",A_ADD_GROUP_MANAGERS_R:"A-add_group_managers-R",A_REMOVE_GROUP_MANAGERS_T:"A-remove_group_managers-T",A_REMOVE_GROUP_MANAGERS_R:"A-remove_group_managers-R",A_GET_GROUP_MEMBERS_T:"A-get_group_members-T",A_GET_GROUP_MEMBERS_R:"A-get_group_members-R",A_SET_GROUP_MEMBER_INFO_T:"A-set_group_member_info-T",A_SET_GROUP_MEMBER_INFO_R:"A-set_group_member_info-R",A_SEARCH_GROUP_MEMBERS_T:"A-search_group_members-T",A_SEARCH_GROUP_MEMBERS_R:"A-search_group_members-R",A_JOIN_GROUP_T:"A-join_group-T",A_JOIN_GROUP_R:"A-join_group-R",A_INVITE_USERS_TO_GROUP_T:"A-invite_users_to_group-T",A_INVITE_USERS_TO_GROUP_R:"A-invite_users_to_group-R",A_ADD_GROUP_FOLLOWS_T:"A-add_group_follows-T",A_ADD_GROUP_FOLLOWS_R:"A-add_group_follows-R",A_REMOVE_GROUP_FOLLOWS_T:"A-remove_group_follows-T",A_REMOVE_GROUP_FOLLOWS_R:"A-remove_group_follows-R",A_GET_GROUP_FOLLOWS_T:"A-get_group_follows-T",A_GET_GROUP_FOLLOWS_R:"A-get_group_follows-R",A_SET_GROUP_REMARK_T:"A-set_group_remark-T",A_SET_GROUP_REMARK_R:"A-set_group_remark-R",A_GET_GROUP_MEMBERS_BY_ROLE_T:"A-get_group_members_by_role-T",A_GET_GROUP_MEMBERS_BY_ROLE_R:"A-get_group_members_by_role-R",A_ACCEPT_GROUP_INVITE_T:"A-accept_group_invite-T",A_ACCEPT_GROUP_INVITE_R:"A-accept_group_invite-R",A_REFUSE_GROUP_INVITE_T:"A-refuse_group_invite-T",A_REFUSE_GROUP_INVITE_R:"A-refuse_group_invite-R",A_ACCEPT_GROUP_APPLICATION_T:"A-accept_group_application-T",A_ACCEPT_GROUP_APPLICATION_R:"A-accept_group_application-R",A_REFUSE_GROUP_APPLICATION_T:"A-refuse_group_application-T",A_REFUSE_GROUP_APPLICATION_R:"A-refuse_group_application-R",A_GET_GROUP_APPLICATIONS_T:"A-get_group_applications-T",A_GET_GROUP_APPLICATIONS_R:"A-get_group_applications-R",A_GET_JOINED_GROUPS_BY_ROLES_T:"A-get_joined_groups_by_roles-T",A_GET_JOINED_GROUPS_BY_ROLES_R:"A-get_joined_groups_by_roles-R",A_SEARCH_JOINED_GROUPS_T:"A-search_joined_groups-T",A_SEARCH_JOINED_GROUPS_R:"A-search_joined_groups-R",A_GET_JOINED_GROUPS_T:"A-get_joined_groups-T",A_GET_JOINED_GROUPS_R:"A-get_joined_groups-R",A_SEARCH_USER_PROFILE_BY_UNIQUE_ID_T:"A-search_user_profile_by_unique_id-T",A_SEARCH_USER_PROFILE_BY_UNIQUE_ID_R:"A-search_user_profile_by_unique_id-R",A_UPDATE_MY_USER_PROFILE_VISIBILITY_T:"A-update_my_user_profile_visibility-T",A_UPDATE_MY_USER_PROFILE_VISIBILITY_R:"A-update_my_user_profile_visibility-R",A_GET_MY_USER_PROFILE_VISIBILITY_T:"A-get_my_user_profile_visibility-T",A_GET_MY_USER_PROFILE_VISIBILITY_R:"A-get_my_user_profile_visibility-R",A_SUBSCRIBE_USER_STATUS_T:"A-subscribe_user_status-T",A_SUBSCRIBE_USER_STATUS_R:"A-subscribe_user_status-R",A_UNSUBSCRIBE_USER_STATUS_T:"A-unsubscribe_user_status-T",A_UNSUBSCRIBE_USER_STATUS_R:"A-unsubscribe_user_status-R",A_GET_SUBSCRIBE_USER_STATUS_LIST_T:"A-get_subscribe_user_status_list-T",A_GET_SUBSCRIBE_USER_STATUS_LIST_R:"A-get_subscribe_user_status_list-R",A_GET_MY_USER_PROFILE_T:"A-get_my_user_profile-T",A_GET_MY_USER_PROFILE_R:"A-get_my_user_profile-R",A_UPDATE_MY_USER_PROFILE_T:"A-update_my_user_profile-T",A_UPDATE_MY_USER_PROFILE_R:"A-update_my_user_profile-R",A_GET_CONVERSATIONS_INCLUDING_ROBOTS_T:"A-get_conversations_including_robots-T",A_GET_CONVERSATIONS_INCLUDING_ROBOTS_R:"A-get_conversations_including_robots-R",L_PULL_SG_UNREAD_COUNT_T:"L-pull_sg_unread_count-T",L_PULL_SG_UNREAD_COUNT_R:"L-pull_sg_unread_count-R",A_MARK_REMOTE_CONVERSATION_AS_READ_T:"A-mark_remote_conversation_as_read-T",A_MARK_REMOTE_CONVERSATION_AS_READ_R:"A-mark_remote_conversation_as_read-R",A_ADD_MSG_REACTION_T:"A-add_msg_reaction-T",A_ADD_MSG_REACTION_R:"A-add_msg_reaction-R",A_REMOVE_MSG_REACTION_T:"A-remove_msg_reaction-T",A_REMOVE_MSG_REACTION_R:"A-remove_msg_reaction-R",A_BATCH_GET_MSG_REACTION_SUMMARIES_T:"A-batch_get_msg_reaction_summaries-T",A_BATCH_GET_MSG_REACTION_SUMMARIES_R:"A-batch_get_msg_reaction_summaries-R",A_GET_MSG_REACTIONS_T:"A-get_msg_reactions-T",A_GET_MSG_REACTIONS_R:"A-get_msg_reactions-R",A_GET_MSG_REACTION_USERS_T:"A-get_msg_reaction_users-T",A_GET_MSG_REACTION_USERS_R:"A-get_msg_reaction_users-R",L_EXEC_CUSTOM_CONVERSATION_STORAGE_EVICTION_E:"L-exec_custom_conversation_storage_eviction-E",A_GET_MESSAGES_T:"A-get_msgs-T",A_GET_MESSAGES_R:"A-get_msgs-R"};var o,a,l,c,d,_,u,h,E,g,I,p,T,R,f,A,m,S,v,C,y,O,N,M,b,L,U,P,D,x;exports.DirectionType=void 0,(o=exports.DirectionType||(exports.DirectionType={}))[o.BOTH=2]="BOTH",exports.QueryFriendsDirectionType=void 0,(a=exports.QueryFriendsDirectionType||(exports.QueryFriendsDirectionType={}))[a.BOTH=2]="BOTH",exports.FriendAddPermission=void 0,(l=exports.FriendAddPermission||(exports.FriendAddPermission={}))[l.FREE=1]="FREE",l[l.NEED_VERIFY=2]="NEED_VERIFY",l[l.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED",exports.FriendRelationType=void 0,(c=exports.FriendRelationType||(exports.FriendRelationType={}))[c.NONE=0]="NONE",c[c.IN_MY_FRIEND_LIST=1]="IN_MY_FRIEND_LIST",c[c.IN_OTHER_FRIEND_LIST=2]="IN_OTHER_FRIEND_LIST",c[c.BOTH_WAY=3]="BOTH_WAY",exports.FriendApplicationType=void 0,(d=exports.FriendApplicationType||(exports.FriendApplicationType={}))[d.SENT=1]="SENT",d[d.RECEIVED=2]="RECEIVED",exports.FriendApplicationStatus=void 0,(_=exports.FriendApplicationStatus||(exports.FriendApplicationStatus={}))[_.UNHANDLED=0]="UNHANDLED",_[_.ACCEPTED=1]="ACCEPTED",_[_.REFUSED=2]="REFUSED",_[_.EXPIRED=3]="EXPIRED",function(e){e[e.FRIEND_APPLICATION=31]="FRIEND_APPLICATION"}(u||(u={})),function(e){e[e.FRIEND_APPLY=0]="FRIEND_APPLY",e[e.FRIEND_REFUSE=1]="FRIEND_REFUSE",e[e.FRIEND_USER_INFO=2]="FRIEND_USER_INFO",e[e.FRIENDS_INPUT=3]="FRIENDS_INPUT",e[e.FRIEND_CLEAR=4]="FRIEND_CLEAR",e[e.FRIEND_INFO_CHANGE=5]="FRIEND_INFO_CHANGE",e[e.FRIEND_INFO_CHANGE_SYNC=6]="FRIEND_INFO_CHANGE_SYNC"}(h||(h={})),exports.GroupJoinPermission=void 0,(E=exports.GroupJoinPermission||(exports.GroupJoinPermission={}))[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",exports.GroupOperationPermission=void 0,(g=exports.GroupOperationPermission||(exports.GroupOperationPermission={}))[g.OWNER=0]="OWNER",g[g.OWNER_OR_MANAGER=1]="OWNER_OR_MANAGER",g[g.EVERYONE=2]="EVERYONE",exports.GroupMemberInfoEditPermission=void 0,(I=exports.GroupMemberInfoEditPermission||(exports.GroupMemberInfoEditPermission={}))[I.OWNER_OR_MANAGER_OR_SELF=0]="OWNER_OR_MANAGER_OR_SELF",I[I.OWNER_OR_SELF=1]="OWNER_OR_SELF",I[I.SELF=2]="SELF",exports.GroupInviteHandlePermission=void 0,(p=exports.GroupInviteHandlePermission||(exports.GroupInviteHandlePermission={}))[p.FREE=0]="FREE",p[p.INVITEE_VERIFY=1]="INVITEE_VERIFY",exports.GroupMemberRole=void 0,(T=exports.GroupMemberRole||(exports.GroupMemberRole={}))[T.UNDEF=0]="UNDEF",T[T.NORMAL=1]="NORMAL",T[T.MANAGER=2]="MANAGER",T[T.OWNER=3]="OWNER",exports.GroupOperation=void 0,(R=exports.GroupOperation||(exports.GroupOperation={}))[R.CREATE=0]="CREATE",R[R.JOIN=1]="JOIN",R[R.KICK=2]="KICK",R[R.QUIT=3]="QUIT",R[R.DISMISS=4]="DISMISS",R[R.ADD_MANAGER=5]="ADD_MANAGER",R[R.REMOVE_MANAGER=6]="REMOVE_MANAGER",R[R.TRANSFER_GROUP_OWNER=7]="TRANSFER_GROUP_OWNER",function(e){e[e.GROUP_INFO_CHANGE=0]="GROUP_INFO_CHANGE",e[e.MEMBER_PROFILE_CHANGE=1]="MEMBER_PROFILE_CHANGE",e[e.GROUP_REMARK_SET=2]="GROUP_REMARK_SET",e[e.GROUP_REMARK_DELETE=3]="GROUP_REMARK_DELETE"}(f||(f={})),exports.GroupOperationType=void 0,(A=exports.GroupOperationType||(exports.GroupOperationType={}))[A.ADD=1]="ADD",A[A.REMOVE=2]="REMOVE",exports.GroupApplicationStatus=void 0,(m=exports.GroupApplicationStatus||(exports.GroupApplicationStatus={}))[m.MANAGER_UNHANDLED=0]="MANAGER_UNHANDLED",m[m.MANAGER_REFUSED=1]="MANAGER_REFUSED",m[m.INVITEE_UNHANDLED=2]="INVITEE_UNHANDLED",m[m.INVITEE_REFUSED=3]="INVITEE_REFUSED",m[m.JOINED=4]="JOINED",m[m.EXPIRED=5]="EXPIRED",exports.GroupOperationStatus=void 0,(S=exports.GroupOperationStatus||(exports.GroupOperationStatus={}))[S.REFUSE=0]="REFUSE",S[S.ACCEPT=1]="ACCEPT",exports.GroupOperationRole=void 0,(v=exports.GroupOperationRole||(exports.GroupOperationRole={}))[v.APPLICANT=0]="APPLICANT",v[v.MANAGER=1]="MANAGER",function(e){e[e.GROUP_OPERATION=11]="GROUP_OPERATION",e[e.GROUP_PROFILE_CHANGE=12]="GROUP_PROFILE_CHANGE",e[e.GROUP_APPLICATION_INVITATION=13]="GROUP_APPLICATION_INVITATION",e[e.GROUP_FOLLOW_USER_CHANGE=14]="GROUP_FOLLOW_USER_CHANGE"}(C||(C={})),exports.GroupApplicationType=void 0,(y=exports.GroupApplicationType||(exports.GroupApplicationType={}))[y.APPLICATION=0]="APPLICATION",y[y.INVITATION=1]="INVITATION",exports.GroupApplicationDirection=void 0,(O=exports.GroupApplicationDirection||(exports.GroupApplicationDirection={}))[O.APPLICATION_SENT=0]="APPLICATION_SENT",O[O.INVITATION_SENT=1]="INVITATION_SENT",O[O.INVITATION_RECEIVED=2]="INVITATION_RECEIVED",O[O.APPLICATION_RECEIVED=3]="APPLICATION_RECEIVED",exports.ChatroomEntryType=void 0,(N=exports.ChatroomEntryType||(exports.ChatroomEntryType={}))[N.UPDATE=1]="UPDATE",N[N.DELETE=2]="DELETE",exports.ChrmSyncStatus=void 0,(M=exports.ChrmSyncStatus||(exports.ChrmSyncStatus={}))[M.QUIT=0]="QUIT",M[M.JOIN=1]="JOIN",exports.ChatroomSyncStatusReason=void 0,(b=exports.ChatroomSyncStatusReason||(exports.ChatroomSyncStatusReason={}))[b.LeaveOnMyOwn=1]="LeaveOnMyOwn",b[b.OtherDeviceLogin=2]="OtherDeviceLogin",exports.ChatroomUserChangeType=void 0,(L=exports.ChatroomUserChangeType||(exports.ChatroomUserChangeType={}))[L.QUIT=0]="QUIT",L[L.JOIN=1]="JOIN",exports.ChrmMemBanType=void 0,(U=exports.ChrmMemBanType||(exports.ChrmMemBanType={}))[U.UnmuteUsers=0]="UnmuteUsers",U[U.MuteUsers=1]="MuteUsers",U[U.UnmuteAll=2]="UnmuteAll",U[U.MuteAll=3]="MuteAll",U[U.RemoveWhitelist=4]="RemoveWhitelist",U[U.AddWhitelist=5]="AddWhitelist",U[U.UnmuteGloble=6]="UnmuteGloble",U[U.MuteGloble=7]="MuteGloble",exports.ChrmMemOperateType=void 0,(P=exports.ChrmMemOperateType||(exports.ChrmMemOperateType={}))[P.Deblock=0]="Deblock",P[P.Blocked=1]="Blocked",exports.ErrorCode=void 0,(D=exports.ErrorCode||(exports.ErrorCode={}))[D.SUCCESS=0]="SUCCESS",D[D.ACTIVE_DISCONNECT=2]="ACTIVE_DISCONNECT",D[D.REJECTED_BY_BLACKLIST=405]="REJECTED_BY_BLACKLIST",D[D.NOT_IN_WHITELIST=407]="NOT_IN_WHITELIST",D[D.FORBIDDEN_IN_PRIVATE=20106]="FORBIDDEN_IN_PRIVATE",D[D.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE=20109]="SYS_CONVERSATION_NOT_SUPPORT_MESSAGE",D[D.DANGEROUS_CONTENT=20112]="DANGEROUS_CONTENT",D[D.CONTENT_REVIEW_REJECTED=20113]="CONTENT_REVIEW_REJECTED",D[D.MESSAGE_OVER_MODIFY_TIME_FAIL=20114]="MESSAGE_OVER_MODIFY_TIME_FAIL",D[D.MESSAGE_SIZE_EXCEEDED=20115]="MESSAGE_SIZE_EXCEEDED",D[D.MESSAGE_UNSUPPORTED_MODIFY=20116]="MESSAGE_UNSUPPORTED_MODIFY",D[D.CLOUD_DATA_CENTER_INVALID=20512]="CLOUD_DATA_CENTER_INVALID",D[D.SEND_FREQUENCY_TOO_FAST=20604]="SEND_FREQUENCY_TOO_FAST",D[D.OPERATION_BLOCKED=20605]="OPERATION_BLOCKED",D[D.OPERATION_NOT_SUPPORT=20606]="OPERATION_NOT_SUPPORT",D[D.REQUEST_OVER_FREQUENCY=20607]="REQUEST_OVER_FREQUENCY",D[D.NOT_IN_DISCUSSION=21406]="NOT_IN_DISCUSSION",D[D.SENSITIVE_SHIELD=21501]="SENSITIVE_SHIELD",D[D.SENSITIVE_REPLACE=21502]="SENSITIVE_REPLACE",D[D.MESSAGE_EXPAND_NOT_EXIST=22201]="MESSAGE_EXPAND_NOT_EXIST",D[D.MESSAGE_EXPAND_NOT_SUPPORT=22202]="MESSAGE_EXPAND_NOT_SUPPORT",D[D.MESSAGE_EXPAND_FORMAT_ERROR=22203]="MESSAGE_EXPAND_FORMAT_ERROR",D[D.MESSAGE_EXPAND_NOT_AUTHORIZED=22204]="MESSAGE_EXPAND_NOT_AUTHORIZED",D[D.NOT_IN_GROUP=22406]="NOT_IN_GROUP",D[D.FORBIDDEN_IN_GROUP=22408]="FORBIDDEN_IN_GROUP",D[D.NOT_IN_CHATROOM=23406]="NOT_IN_CHATROOM",D[D.GET_USERINFO_ERROR=23407]="GET_USERINFO_ERROR",D[D.FORBIDDEN_IN_CHATROOM=23408]="FORBIDDEN_IN_CHATROOM",D[D.RC_CHATROOM_USER_KICKED=23409]="RC_CHATROOM_USER_KICKED",D[D.RC_CHATROOM_NOT_EXIST=23410]="RC_CHATROOM_NOT_EXIST",D[D.RC_CHATROOM_IS_FULL=23411]="RC_CHATROOM_IS_FULL",D[D.RC_CHATROOM_PATAMETER_INVALID=23412]="RC_CHATROOM_PATAMETER_INVALID",D[D.CHATROOM_GET_HISTORYMSG_ERROR=23413]="CHATROOM_GET_HISTORYMSG_ERROR",D[D.CHATROOM_NOT_OPEN_HISTORYMSG_STORE=23414]="CHATROOM_NOT_OPEN_HISTORYMSG_STORE",D[D.CHATROOM_KV_EXCEED=23423]="CHATROOM_KV_EXCEED",D[D.CHATROOM_KV_OVERWRITE_INVALID=23424]="CHATROOM_KV_OVERWRITE_INVALID",D[D.CHATROOM_SET_PROPERTY_OVER_FREQUENCY=23425]="CHATROOM_SET_PROPERTY_OVER_FREQUENCY",D[D.CHATROOM_KV_STORE_NOT_OPEN=23426]="CHATROOM_KV_STORE_NOT_OPEN",D[D.CHATROOM_KEY_NOT_EXIST=23427]="CHATROOM_KEY_NOT_EXIST",D[D.CHATROOM_KV_STORE_NOT_ALL_SUCCESS=23428]="CHATROOM_KV_STORE_NOT_ALL_SUCCESS",D[D.CHATROOM_KV_STORE_OUT_LIMIT=23429]="CHATROOM_KV_STORE_OUT_LIMIT",D[D.CHATROOM_KV_SET_ERROR=23431]="CHATROOM_KV_SET_ERROR",D[D.HAVNODEVICEID=24001]="HAVNODEVICEID",D[D.DEVICEIDISHAVE=24002]="DEVICEIDISHAVE",D[D.FEILD=24009]="FEILD",D[D.INTERNALERRROR=24015]="INTERNALERRROR",D[D.RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET=24360]="RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET",D[D.RC_USER_PROFILE_KEY_NOT_EXIST=24361]="RC_USER_PROFILE_KEY_NOT_EXIST",D[D.RC_USER_PROFILE_EXT_KEY_NOT_EXIST=24362]="RC_USER_PROFILE_EXT_KEY_NOT_EXIST",D[D.RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT=24363]="RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT",D[D.RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT=24364]="RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT",D[D.RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT=24365]="RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT",D[D.RC_USER_PROFILE_USER_NOT_EXIST=24366]="RC_USER_PROFILE_USER_NOT_EXIST",D[D.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS=24367]="RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS",D[D.RC_USER_PROFILE_VALUE_EXCEED_RANGE=24368]="RC_USER_PROFILE_VALUE_EXCEED_RANGE",D[D.RC_USER_PROFILE_SERVICE_UNAVAILABLE=24369]="RC_USER_PROFILE_SERVICE_UNAVAILABLE",D[D.ULTRA_GROUP_SERVICE_UNAVAILABLE=24401]="ULTRA_GROUP_SERVICE_UNAVAILABLE",D[D.ULTRA_GROUP_SERVICE_ERROR=24402]="ULTRA_GROUP_SERVICE_ERROR",D[D.ULTRA_GROUP_PARAMETER_ERROR=24403]="ULTRA_GROUP_PARAMETER_ERROR",D[D.ULTRA_GROUP_UNKNOWN_ERROR=24404]="ULTRA_GROUP_UNKNOWN_ERROR",D[D.NOT_IN_ULTRA_GROUP=24406]="NOT_IN_ULTRA_GROUP",D[D.FORBIDDEN_IN_ULTRA_GROUP=24408]="FORBIDDEN_IN_ULTRA_GROUP",D[D.ULTRA_GROUP_NOT_EXIST=24410]="ULTRA_GROUP_NOT_EXIST",D[D.ULTRA_GROUP_MEMBERS_OVERSIZE=24411]="ULTRA_GROUP_MEMBERS_OVERSIZE",D[D.ULTRA_GROUP_JOINED_OVERSIZE=24412]="ULTRA_GROUP_JOINED_OVERSIZE",D[D.ULTRA_GROUP_CHANNELS_OVERSIZE=24413]="ULTRA_GROUP_CHANNELS_OVERSIZE",D[D.ULTRA_GROUP_CHANNEL_ID_NOT_EXIST=24414]="ULTRA_GROUP_CHANNEL_ID_NOT_EXIST",D[D.ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY=24415]="ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY",D[D.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL=24416]="ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL",D[D.RECALL_MESSAGE=25101]="RECALL_MESSAGE",D[D.MESSAGE_STORAGE_SERVICE_UNAVAILABLE=25102]="MESSAGE_STORAGE_SERVICE_UNAVAILABLE",D[D.RC_SERVER_UNKOWN_ERROR=25104]="RC_SERVER_UNKOWN_ERROR",D[D.RECALL_MESSAGE_USER_INVALID=25107]="RECALL_MESSAGE_USER_INVALID",D[D.RC_ENTRUST_SERVER_ERROR=25402]="RC_ENTRUST_SERVER_ERROR",D[D.RC_ENTRUST_SERVER_PARAMETER_ERROR=25403]="RC_ENTRUST_SERVER_PARAMETER_ERROR",D[D.RC_GROUP_ILLEGAL_ERROR=25404]="RC_GROUP_ILLEGAL_ERROR",D[D.RC_GROUP_AUTHORITY_ERROR=25405]="RC_GROUP_AUTHORITY_ERROR",D[D.RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT=25406]="RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT",D[D.RC_GROUP_PARAMETER_FORMAT_ERROR=25407]="RC_GROUP_PARAMETER_FORMAT_ERROR",D[D.RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS=25408]="RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS",D[D.RC_GROUP_ID_ALREADY_EXIST=25409]="RC_GROUP_ID_ALREADY_EXIST",D[D.RC_GROUP_ID_NOT_EXIST=25410]="RC_GROUP_ID_NOT_EXIST",D[D.RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT=25411]="RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT",D[D.RC_GROUP_MEMBERS_ALREADY_IN_GROUP=25412]="RC_GROUP_MEMBERS_ALREADY_IN_GROUP",D[D.RC_GROUP_NOT_ALLOW_SDK_OPERATION=25413]="RC_GROUP_NOT_ALLOW_SDK_OPERATION",D[D.RC_GROUP_NOT_ALLOW_JOIN=25414]="RC_GROUP_NOT_ALLOW_JOIN",D[D.RC_GROUP_EXT_KEY_NOT_EXIST=25415]="RC_GROUP_EXT_KEY_NOT_EXIST",D[D.RC_GROUP_REQUEST_OVERFREQUENCY=25416]="RC_GROUP_REQUEST_OVERFREQUENCY",D[D.RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK=25417]="RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK",D[D.RC_GROUP_USER_NOT_IN_GROUP=25418]="RC_GROUP_USER_NOT_IN_GROUP",D[D.RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT=25419]="RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT",D[D.RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP=25420]="RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP",D[D.RC_GROUP_APPLICATION_NOT_EXIST=25421]="RC_GROUP_APPLICATION_NOT_EXIST",D[D.RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT=25422]="RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT",D[D.RC_GROUP_NAME_INVALID=25423]="RC_GROUP_NAME_INVALID",D[D.RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT=25424]="RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT",D[D.RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER=25425]="RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER",D[D.RC_GROUP_NO_INVITE_PERMISSION=25426]="RC_GROUP_NO_INVITE_PERMISSION",D[D.RC_GROUP_NEED_INVITEE_ACCEPT=25427]="RC_GROUP_NEED_INVITEE_ACCEPT",D[D.RC_GROUP_APPLICATION_ALREADY_HANDLE=25428]="RC_GROUP_APPLICATION_ALREADY_HANDLE",D[D.RC_GROUP_OLD_GROUP_NOT_ENTRUST=25429]="RC_GROUP_OLD_GROUP_NOT_ENTRUST",D[D.RC_GROUP_ID_INVALID=25430]="RC_GROUP_ID_INVALID",D[D.RC_PAGE_TOKEN_PARSING_FAILED=25432]="RC_PAGE_TOKEN_PARSING_FAILED",D[D.RC_FRIEND_ALREADY_FRIEND=25460]="RC_FRIEND_ALREADY_FRIEND",D[D.RC_FRIEND_NEED_ACCEPT=25461]="RC_FRIEND_NEED_ACCEPT",D[D.RC_FRIEND_IN_OTHER_BLACK_LIST=25462]="RC_FRIEND_IN_OTHER_BLACK_LIST",D[D.RC_FRIEND_NOT_IN_OTHER_WHITE_LIST=25463]="RC_FRIEND_NOT_IN_OTHER_WHITE_LIST",D[D.RC_FRIEND_IN_MY_BLACK_LIST=25464]="RC_FRIEND_IN_MY_BLACK_LIST",D[D.RC_FRIEND_NOT_IN_MY_WHITE_LIST=25465]="RC_FRIEND_NOT_IN_MY_WHITE_LIST",D[D.RC_FRIEND_APPLICATION_NOT_EXIST=25466]="RC_FRIEND_APPLICATION_NOT_EXIST",D[D.RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT=25467]="RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT",D[D.RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT=25468]="RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT",D[D.RC_FRIEND_NOT_FRIEND=25469]="RC_FRIEND_NOT_FRIEND",D[D.RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT=25470]="RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT",D[D.RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND=25471]="RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND",D[D.RC_FRIEND_NOT_EXIST=25472]="RC_FRIEND_NOT_EXIST",D[D.RC_FRIEND_NOT_ALLOW_ADD_SELF=25473]="RC_FRIEND_NOT_ALLOW_ADD_SELF",D[D.RC_FRIEND_NOT_SUPPORT_ROBOT=25474]="RC_FRIEND_NOT_SUPPORT_ROBOT",D[D.SERVICE_INFORMATION_AUDIT_FAILED=25480]="SERVICE_INFORMATION_AUDIT_FAILED",D[D.PUSH_PARAMETER_INVALID=26001]="PUSH_PARAMETER_INVALID",D[D.USER_SETTING_SYNCED_ERROR=26002]="USER_SETTING_SYNCED_ERROR",D[D.CONVERSATION_TAG_OVERSIZE=26004]="CONVERSATION_TAG_OVERSIZE",D[D.RC_READ_RECEIPT_V4_INVALID=26005]="RC_READ_RECEIPT_V4_INVALID",D[D.RC_SERVER_DRIVE_UNREAD_COUNT_INVALID=26006]="RC_SERVER_DRIVE_UNREAD_COUNT_INVALID",D[D.RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED=26007]="RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED",D[D.RC_SERVER_PARAMETER_MESSAGEUID_INVALID=26009]="RC_SERVER_PARAMETER_MESSAGEUID_INVALID",D[D.RC_SERVER_PARAMETER_INVALID=26010]="RC_SERVER_PARAMETER_INVALID",D[D.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE=26020]="RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE",D[D.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT=26021]="RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT",D[D.RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT=26022]="RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT",D[D.RC_FILE_SIZE_EXCEED_LIMIT=26106]="RC_FILE_SIZE_EXCEED_LIMIT",D[D.INVALID_PARAMETER_SIZE_NOT_FOUND=26107]="INVALID_PARAMETER_SIZE_NOT_FOUND",D[D.SERVICE_RRSV5_UNAVAILABLE=26314]="SERVICE_RRSV5_UNAVAILABLE",D[D.SERVICE_RRSV5_READ_RECEIPT_NOT_SUPPORT=26315]="SERVICE_RRSV5_READ_RECEIPT_NOT_SUPPORT",D[D.SERVICE_RRSV5_PARAM_LENGTH_EXCEED=26316]="SERVICE_RRSV5_PARAM_LENGTH_EXCEED",D[D.SERVICE_RRSV5_CONVERSATION_NOT_SUPPORT=26317]="SERVICE_RRSV5_CONVERSATION_NOT_SUPPORT",D[D.SERVICE_RRSV5_QUERY_NOT_SUPPORT=26318]="SERVICE_RRSV5_QUERY_NOT_SUPPORT",D[D.SERVICE_RRSV5_MESSAGE_SENDER_MISMATCH=26320]="SERVICE_RRSV5_MESSAGE_SENDER_MISMATCH",D[D.SERVICE_RRSV5_MESSAGE_RECEIPT_NEEDLESS=26321]="SERVICE_RRSV5_MESSAGE_RECEIPT_NEEDLESS",D[D.SERVICE_RRSV5_MESSAGE_NOT_EXIST=26322]="SERVICE_RRSV5_MESSAGE_NOT_EXIST",D[D.MSG_REACTION_LIMIT_REACHED=26323]="MSG_REACTION_LIMIT_REACHED",D[D.MSG_REACTION_USER_LIMIT_REACHED=26324]="MSG_REACTION_USER_LIMIT_REACHED",D[D.SERVICE_STT_UNAVAILABLE=28300]="SERVICE_STT_UNAVAILABLE",D[D.SERVICE_STT_CONVERTED_FAILED=28304]="SERVICE_STT_CONVERTED_FAILED",D[D.SERVICE_STT_INTERNAL_ERROR=28305]="SERVICE_STT_INTERNAL_ERROR",D[D.SERVICE_STT_PARAM_MISS=28306]="SERVICE_STT_PARAM_MISS",D[D.SERVICE_STT_USAGE_EXCEED=28307]="SERVICE_STT_USAGE_EXCEED",D[D.TRANS_SERVICE_NOT_OPEN=28400]="TRANS_SERVICE_NOT_OPEN",D[D.TRANS_FAILED=28401]="TRANS_FAILED",D[D.TRANS_INTERNAL_ERROR=28402]="TRANS_INTERNAL_ERROR",D[D.TRANS_PARAM_MISSING=28403]="TRANS_PARAM_MISSING",D[D.TRANS_PARAM_ERROR=28404]="TRANS_PARAM_ERROR",D[D.TRANS_QUOTA_LIMIT=28405]="TRANS_QUOTA_LIMIT",D[D.TRANS_TEXT_LENGTH_EXCEEDS_LIMIT=28406]="TRANS_TEXT_LENGTH_EXCEEDS_LIMIT",D[D.TRANS_LANGUAGE_NOT_SUPPORT=28407]="TRANS_LANGUAGE_NOT_SUPPORT",D[D.RC_NET_CHANNEL_INVALID=30001]="RC_NET_CHANNEL_INVALID",D[D.RC_NET_UNAVAILABLE=30002]="RC_NET_UNAVAILABLE",D[D.RC_MSG_RESP_TIMEOUT=30003]="RC_MSG_RESP_TIMEOUT",D[D.RC_HTTP_SEND_FAIL=30004]="RC_HTTP_SEND_FAIL",D[D.RC_HTTP_REQ_FAIL=30005]="RC_HTTP_REQ_FAIL",D[D.RC_HTTP_RECV_FAIL=30006]="RC_HTTP_RECV_FAIL",D[D.RC_NAVI_REQ_FAILED=30007]="RC_NAVI_REQ_FAILED",D[D.RC_NODE_NOT_FOUND=30008]="RC_NODE_NOT_FOUND",D[D.RC_DOMAIN_NOT_RESOLVE=30009]="RC_DOMAIN_NOT_RESOLVE",D[D.RC_SOCKET_NOT_CREATED=30010]="RC_SOCKET_NOT_CREATED",D[D.RC_SOCKET_DISCONNECTED=30011]="RC_SOCKET_DISCONNECTED",D[D.RC_PING_EXCEED_LIMIT=30012]="RC_PING_EXCEED_LIMIT",D[D.PONG_RECEIVED_ERROR=30013]="PONG_RECEIVED_ERROR",D[D.RC_MSG_SEND_FAIL=30014]="RC_MSG_SEND_FAIL",D[D.CONNECT_OVER_FREQUENCY=30015]="CONNECT_OVER_FREQUENCY",D[D.RC_MSG_CONTENT_EXCEED_LIMIT=30016]="RC_MSG_CONTENT_EXCEED_LIMIT",D[D.MESSAGE_NOT_SUPPORT_SENDING=30017]="MESSAGE_NOT_SUPPORT_SENDING",D[D.RC_NETWORK_DOWN=30019]="RC_NETWORK_DOWN",D[D.RC_TCP_DISCONNECTED_NO_RMTP=30021]="RC_TCP_DISCONNECTED_NO_RMTP",D[D.RC_CONN_ACK_TIMEOUT=31e3]="RC_CONN_ACK_TIMEOUT",D[D.RC_CONN_PROTO_VERSION_ERROR=31001]="RC_CONN_PROTO_VERSION_ERROR",D[D.RC_CONN_IDENTIFIER_REJECTED=31002]="RC_CONN_IDENTIFIER_REJECTED",D[D.RC_CONN_SERVER_UNAVAILABLE=31003]="RC_CONN_SERVER_UNAVAILABLE",D[D.RC_CONN_TOKEN_INCORRECT=31004]="RC_CONN_TOKEN_INCORRECT",D[D.RC_CONN_NOT_AUTHRORIZED=31005]="RC_CONN_NOT_AUTHRORIZED",D[D.RC_CONN_REDIRECTED=31006]="RC_CONN_REDIRECTED",D[D.RC_CONN_PACKAGE_NAME_INVALID=31007]="RC_CONN_PACKAGE_NAME_INVALID",D[D.RC_CONN_APP_BLOCKED_OR_DELETED=31008]="RC_CONN_APP_BLOCKED_OR_DELETED",D[D.RC_CONN_USER_BLOCKED=31009]="RC_CONN_USER_BLOCKED",D[D.RC_DISCONN_KICK=31010]="RC_DISCONN_KICK",D[D.RC_DISCONN_EXCEPTION=31011]="RC_DISCONN_EXCEPTION",D[D.CONNECTION_ENCRYPT_AUTHORIZED_ERROR=31012]="CONNECTION_ENCRYPT_AUTHORIZED_ERROR",D[D.RC_CONN_TOKEN_EXPIRED=31020]="RC_CONN_TOKEN_EXPIRED",D[D.RC_CONN_DEVICE_ERROR=31021]="RC_CONN_DEVICE_ERROR",D[D.RC_CONN_HOSTNAME_ERROR=31022]="RC_CONN_HOSTNAME_ERROR",D[D.RC_DISCONN_SAME_CLIENT_ON_LINE=31023]="RC_DISCONN_SAME_CLIENT_ON_LINE",D[D.RC_LISCENSE_COUNT_OUT_OF_LIMIT=31024]="RC_LISCENSE_COUNT_OUT_OF_LIMIT",D[D.RC_CONN_WRONG_CLUSTER=31025]="RC_CONN_WRONG_CLUSTER",D[D.RC_APP_AUTH_NOT_PASS=31026]="RC_APP_AUTH_NOT_PASS",D[D.RC_OTP_USED=31027]="RC_OTP_USED",D[D.RC_PLATFORM_ERROR=31028]="RC_PLATFORM_ERROR",D[D.RC_ACCOUNT_CANCELLATION=31029]="RC_ACCOUNT_CANCELLATION",D[D.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",D[D.RC_QUERY_ACK_NO_DATA=32001]="RC_QUERY_ACK_NO_DATA",D[D.RC_MSG_DATA_INCOMPLETE=32002]="RC_MSG_DATA_INCOMPLETE",D[D.RC_UDP_DISCONNECTED=32011]="RC_UDP_DISCONNECTED",D[D.RC_TCP_RESET=32054]="RC_TCP_RESET",D[D.CONNECTION_REFUSED=32061]="CONNECTION_REFUSED",D[D.PROTOCOL_DECODE_ERROR=32546]="PROTOCOL_DECODE_ERROR",D[D.PROTOCOL_MESSAGE_SAVED_ERROR=33e3]="PROTOCOL_MESSAGE_SAVED_ERROR",D[D.BIZ_ERROR_CLIENT_NOT_INIT=33001]="BIZ_ERROR_CLIENT_NOT_INIT",D[D.BIZ_ERROR_DATABASE_ERROR=33002]="BIZ_ERROR_DATABASE_ERROR",D[D.BIZ_ERROR_INVALID_PARAMETER=33003]="BIZ_ERROR_INVALID_PARAMETER",D[D.BIZ_ERROR_NO_CHANNEL=33004]="BIZ_ERROR_NO_CHANNEL",D[D.BIZ_ERROR_RECONNECT_SUCCESS=33005]="BIZ_ERROR_RECONNECT_SUCCESS",D[D.BIZ_ERROR_CONNECTING=33006]="BIZ_ERROR_CONNECTING",D[D.MSG_ROAMING_SERVICE_UNAVAILABLE=33007]="MSG_ROAMING_SERVICE_UNAVAILABLE",D[D.MSG_INSERT_ERROR=33008]="MSG_INSERT_ERROR",D[D.MSG_DEL_ERROR=33009]="MSG_DEL_ERROR",D[D.TAG_NOT_EXIST=33100]="TAG_NOT_EXIST",D[D.TAG_EXISTS=33101]="TAG_EXISTS",D[D.NO_TAG_IN_CONVER=33102]="NO_TAG_IN_CONVER",D[D.METHOD_BUSY=33103]="METHOD_BUSY",D[D.NOT_ALLOW_PULL_CONVERSATION=33301]="NOT_ALLOW_PULL_CONVERSATION",D[D.SDK_PULL_CONVERSATION=33302]="SDK_PULL_CONVERSATION",D[D.MODIFIED_MESSAGE_IS_NOT_SENT=33401]="MODIFIED_MESSAGE_IS_NOT_SENT",D[D.MODIFIED_MESSAGE_TIMEOUT=33402]="MODIFIED_MESSAGE_TIMEOUT",D[D.QUOTE_MSG_NOT_FOUND=33403]="QUOTE_MSG_NOT_FOUND",D[D.INVALID_PARAMETER_QUOTE_INFO=33404]="INVALID_PARAMETER_QUOTE_INFO",D[D.REACTION_ID_INVALID=33405]="REACTION_ID_INVALID",D[D.INVALID_PARAMETER_UNREAD_COUNT_FILTER=33406]="INVALID_PARAMETER_UNREAD_COUNT_FILTER",D[D.RC_CONNECTION_EXIST=34001]="RC_CONNECTION_EXIST",D[D.PACKAGE_ENVIRONMENT_ERROR=34005]="PACKAGE_ENVIRONMENT_ERROR",D[D.CONNECTION_TIMEOUT=34006]="CONNECTION_TIMEOUT",D[D.MESSAGE_KV_NOT_SUPPORT=34008]="MESSAGE_KV_NOT_SUPPORT",D[D.MESSAGE_EXPANDED_ERROR=34009]="MESSAGE_EXPANDED_ERROR",D[D.EXPANSION_LIMIT_EXCEET=34010]="EXPANSION_LIMIT_EXCEET",D[D.UPLOAD_FAIL=34011]="UPLOAD_FAIL",D[D.CONVER_OUT_LIMIT_ERROR=34013]="CONVER_OUT_LIMIT_ERROR",D[D.READ_RECEIPT_ERROR=34014]="READ_RECEIPT_ERROR",D[D.PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE=34016]="PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE",D[D.MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE=34017]="MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE",D[D.MEDIA_EXCEPTION=34018]="MEDIA_EXCEPTION",D[D.MESSAGE_NOT_REGISTERED=34021]="MESSAGE_NOT_REGISTERED",D[D.METHOD_NOT_SUPPORT=34022]="METHOD_NOT_SUPPORT",D[D.ULTRA_GROUP_CHANNEL_NOT_EXIST=34024]="ULTRA_GROUP_CHANNEL_NOT_EXIST",D[D.INCONSISTENT_CONVERSATION_TYPE=34025]="INCONSISTENT_CONVERSATION_TYPE",D[D.INVALID_PARAMETER_LAUGUAGE=34200]="INVALID_PARAMETER_LAUGUAGE",D[D.CONVERSATION_TYPE_NOT_SUPPORT=34201]="CONVERSATION_TYPE_NOT_SUPPORT",D[D.INVALID_PARAMETER_TIMESTAMP=34202]="INVALID_PARAMETER_TIMESTAMP",D[D.INVALID_PARAMETER_MESSAGE_UID=34203]="INVALID_PARAMETER_MESSAGE_UID",D[D.INVALID_PARAMETER_MESSAGE_ID=34204]="INVALID_PARAMETER_MESSAGE_ID",D[D.INVALID_PARAMETER_MESSAGE_CONTENT=34205]="INVALID_PARAMETER_MESSAGE_CONTENT",D[D.MSG_LIMIT_ERROR=34206]="MSG_LIMIT_ERROR",D[D.INVALID_PARAMETER_MEDIA_TYPE=34207]="INVALID_PARAMETER_MEDIA_TYPE",D[D.INVALID_PARAMETER_REQUEST_URL=34208]="INVALID_PARAMETER_REQUEST_URL",D[D.INVALID_PARAMETER_CONVERSATION_TYPE=34209]="INVALID_PARAMETER_CONVERSATION_TYPE",D[D.INVALID_PARAMETER_TARGET_ID=34210]="INVALID_PARAMETER_TARGET_ID",D[D.INVALID_PARAMETER_CHANNEL_ID=34211]="INVALID_PARAMETER_CHANNEL_ID",D[D.INVALID_PARAMETER_TAG_ID=34212]="INVALID_PARAMETER_TAG_ID",D[D.INVALID_PARAMETER_TAG_NAME=34213]="INVALID_PARAMETER_TAG_NAME",D[D.INVALID_PARAMETER_USER_ID=34214]="INVALID_PARAMETER_USER_ID",D[D.INVALID_PARAMETER_USERIDLIST=34215]="INVALID_PARAMETER_USERIDLIST",D[D.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME=34217]="INVALID_PARAMETER_DOWNLOADMEDIAFILENAME",D[D.INVALID_PARAMETER_MESSAGE_EXPANSION=34220]="INVALID_PARAMETER_MESSAGE_EXPANSION",D[D.INVALID_PARAMETER_NOTMEDIAMESSAGE=34223]="INVALID_PARAMETER_NOTMEDIAMESSAGE",D[D.INVALID_PARAMETER_TIMESTRING=34224]="INVALID_PARAMETER_TIMESTRING",D[D.INVALID_PARAMETER_CONVERSATION=34225]="INVALID_PARAMETER_CONVERSATION",D[D.INVALID_PARAMETER_NOTIFICATION_LEVEL=34228]="INVALID_PARAMETER_NOTIFICATION_LEVEL",D[D.INVALID_PARAMETER_MESSAGE_ARRAY=34229]="INVALID_PARAMETER_MESSAGE_ARRAY",D[D.INVALID_PARAMETER_RECEIVED_STATUS=34230]="INVALID_PARAMETER_RECEIVED_STATUS",D[D.INVALID_PARAMETER_CHANNEL_TYPE=34231]="INVALID_PARAMETER_CHANNEL_TYPE",D[D.INVALID_PARAMETER_COUNT=34232]="INVALID_PARAMETER_COUNT",D[D.INVALID_PARAMETER_MEDIA_URL=34235]="INVALID_PARAMETER_MEDIA_URL",D[D.INVALID_PARAMETER_UNIQUE_ID=34236]="INVALID_PARAMETER_UNIQUE_ID",D[D.INVALID_PARAMETER_PROXY=34238]="INVALID_PARAMETER_PROXY",D[D.INVALID_PARAMETER_TESTHOST=34239]="INVALID_PARAMETER_TESTHOST",D[D.INVALID_CONNECT_TESTHOST_FAILED=34240]="INVALID_CONNECT_TESTHOST_FAILED",D[D.INVALID_PARAMETER_CONVERSATIONS=34242]="INVALID_PARAMETER_CONVERSATIONS",D[D.INVALID_PARAMETER_SENT_STATUS=34244]="INVALID_PARAMETER_SENT_STATUS",D[D.RC_CONN_PROXY_UNAVAILABLE=34245]="RC_CONN_PROXY_UNAVAILABLE",D[D.INVALID_PARAMETER_RTCROOMID=34259]="INVALID_PARAMETER_RTCROOMID",D[D.INVALID_PARAMETER_KEY=34260]="INVALID_PARAMETER_KEY",D[D.INVALID_PARAMETER_KEYS=34261]="INVALID_PARAMETER_KEYS",D[D.INVALID_PARAMETER_VALUE=34262]="INVALID_PARAMETER_VALUE",D[D.INVALID_PARAMETER_ENTRIES=34263]="INVALID_PARAMETER_ENTRIES",D[D.INVALID_PARAMETER_NOTIFICATION_EXTRA=34264]="INVALID_PARAMETER_NOTIFICATION_EXTRA",D[D.INVALID_PARAMETER_MESSAGE_OBJECT_NAME=34271]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME",D[D.INVALID_PARAMETER_BEFORE=34272]="INVALID_PARAMETER_BEFORE",D[D.INVALID_PARAMETER_AFTER=34273]="INVALID_PARAMETER_AFTER",D[D.INVALID_PARAMETER_KEYWORD=34274]="INVALID_PARAMETER_KEYWORD",D[D.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST=34275]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST",D[D.INVALID_PARAMETER_OFFSET=34276]="INVALID_PARAMETER_OFFSET",D[D.INVALID_PARAMETER_START_TIME=34277]="INVALID_PARAMETER_START_TIME",D[D.INVALID_PARAMETER_END_TIME=34278]="INVALID_PARAMETER_END_TIME",D[D.INVALID_PARAMETER_LIMIT=34279]="INVALID_PARAMETER_LIMIT",D[D.INVALID_MESSAGE_DIRECTION=34280]="INVALID_MESSAGE_DIRECTION",D[D.INVALID_MESSAGE_SENT_STATUS=34281]="INVALID_MESSAGE_SENT_STATUS",D[D.INVALID_PARAMETER_TARGETID_LIST=34282]="INVALID_PARAMETER_TARGETID_LIST",D[D.INVALID_PARAMETER_SPAN_MINUTES=34283]="INVALID_PARAMETER_SPAN_MINUTES",D[D.INVALID_PARAMETER_CONVERSATION_TYPE_LIST=34284]="INVALID_PARAMETER_CONVERSATION_TYPE_LIST",D[D.INVALID_PARAMETER_CONVERSATION_LIST=34287]="INVALID_PARAMETER_CONVERSATION_LIST",D[D.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST=34288]="INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST",D[D.INVALID_PARAMETER_START_MESSAGE_UID=34289]="INVALID_PARAMETER_START_MESSAGE_UID",D[D.INVALID_PARAMETER_END_MESSAGE_UID=34290]="INVALID_PARAMETER_END_MESSAGE_UID",D[D.READ_RECEIPT_V4_NOT_SUPPORT=34291]="READ_RECEIPT_V4_NOT_SUPPORT",D[D.READ_RECEIPT_V4_UPDATE_NOT_SUPPORT=34292]="READ_RECEIPT_V4_UPDATE_NOT_SUPPORT",D[D.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE=34296]="RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE",D[D.RC_DB_NOT_INIT=34301]="RC_DB_NOT_INIT",D[D.RC_DB_CORRUPT=34302]="RC_DB_CORRUPT",D[D.RC_DB_SQL_ERROR=34303]="RC_DB_SQL_ERROR",D[D.RC_DB_DATA_NOT_FOUND=34304]="RC_DB_DATA_NOT_FOUND",D[D.RC_NET_DATA_ERROR=34305]="RC_NET_DATA_ERROR",D[D.INVALID_PARAMETER_SUBSCRIBE_TYPE=34306]="INVALID_PARAMETER_SUBSCRIBE_TYPE",D[D.INVALID_PARAMETER_SUBSCRIBE_EXPIRY=34307]="INVALID_PARAMETER_SUBSCRIBE_EXPIRY",D[D.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS=34308]="INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS",D[D.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE=34309]="INVALID_PARAMETER_SUBSCRIBE_PAGESIZE",D[D.SUB_PROCESS_EXIT=34310]="SUB_PROCESS_EXIT",D[D.ADDON_NOT_EXIST=34311]="ADDON_NOT_EXIST",D[D.INVALID_PARAMETER_USER_PROFILE=34312]="INVALID_PARAMETER_USER_PROFILE",D[D.INVALID_PARAMETER_USER_PROFILE_VISIBILITY=34313]="INVALID_PARAMETER_USER_PROFILE_VISIBILITY",D[D.INVALID_PARAMETER_EXTRA=34314]="INVALID_PARAMETER_EXTRA",D[D.DB_UPGRADE_FAILED=34315]="DB_UPGRADE_FAILED",D[D.INVALID_PARAMETER_GROUP_INFO=34318]="INVALID_PARAMETER_GROUP_INFO",D[D.INVALID_PARAMETER_GROUP_ID=34319]="INVALID_PARAMETER_GROUP_ID",D[D.INVALID_PARAMETER_GROUP_NAME=34320]="INVALID_PARAMETER_GROUP_NAME",D[D.INVALID_PARAMETER_GROUP_IDS=34321]="INVALID_PARAMETER_GROUP_IDS",D[D.INVALID_PARAMETER_GROUP_MEMBER_ROLE=34322]="INVALID_PARAMETER_GROUP_MEMBER_ROLE",D[D.INVALID_PARAMETER_GROUP_APPLICATION_STATUS=34323]="INVALID_PARAMETER_GROUP_APPLICATION_STATUS",D[D.INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION=34324]="INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION",D[D.INVALID_PARAMETER_NICK_NAME=34325]="INVALID_PARAMETER_NICK_NAME",D[D.INVALID_PARAMETER_REASON=34326]="INVALID_PARAMETER_REASON",D[D.INVALID_PARAMETER_REMARK=34327]="INVALID_PARAMETER_REMARK",D[D.INVALID_PARAMETER_PAGING_QUERY_OPTION=34328]="INVALID_PARAMETER_PAGING_QUERY_OPTION",D[D.NET_DATA_IS_SYNCHRONIZING=34329]="NET_DATA_IS_SYNCHRONIZING",D[D.INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE=34330]="INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE",D[D.INVALID_PARAMETER_DIRECTION_TYPE=34331]="INVALID_PARAMETER_DIRECTION_TYPE",D[D.INVALID_PARAMETER_FRIEND_APPLICATION_TYPE=34332]="INVALID_PARAMETER_FRIEND_APPLICATION_TYPE",D[D.INVALID_PARAMETER_FRIEND_APPLICATION_STATUS=34333]="INVALID_PARAMETER_FRIEND_APPLICATION_STATUS",D[D.INVALID_PARAMETER_FRIEND_ADD_PERMISSION=34334]="INVALID_PARAMETER_FRIEND_ADD_PERMISSION",D[D.INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS=34335]="INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS",D[D.RC_REAL_TIME_CONVERSATION_UNAVAILABLE=34336]="RC_REAL_TIME_CONVERSATION_UNAVAILABLE",D[D.SERVER_DATA_ERROR=34344]="SERVER_DATA_ERROR",D[D.INVALID_PARAMETER_MESSAGE_INFO_MAP=34345]="INVALID_PARAMETER_MESSAGE_INFO_MAP",D[D.INVALID_PARAMETER_PAGE_TOKEN=34346]="INVALID_PARAMETER_PAGE_TOKEN",D[D.SERVER_RECORD_UNREAD_COUNT_ENABLED_FORBIDDEN=34435]="SERVER_RECORD_UNREAD_COUNT_ENABLED_FORBIDDEN",D[D.SERVER_RECORD_UNREAD_COUNT_DISABLED=34436]="SERVER_RECORD_UNREAD_COUNT_DISABLED",D[D.DATABASEDISKFULL=34439]="DATABASEDISKFULL",D[D.GROUP_SYNC_ERROR=35001]="GROUP_SYNC_ERROR",D[D.GROUP_MATCH_ERROR=35002]="GROUP_MATCH_ERROR",D[D.NOT_SUPPORT=35004]="NOT_SUPPORT",D[D.MAIN_PROCESS_ERROR=35005]="MAIN_PROCESS_ERROR",D[D.CAN_NOT_RECONNECT=35007]="CAN_NOT_RECONNECT",D[D.SERVER_UNAVAILABLE=35008]="SERVER_UNAVAILABLE",D[D.HOSTNAME_ERROR=35009]="HOSTNAME_ERROR",D[D.HAS_OHTER_SAME_CLIENT_ON_LINE=35010]="HAS_OHTER_SAME_CLIENT_ON_LINE",D[D.METHOD_NOT_AVAILABLE=35011]="METHOD_NOT_AVAILABLE",D[D.METHOD_ONLY_SUPPORT_ULTRA_GROUP=35014]="METHOD_ONLY_SUPPORT_ULTRA_GROUP",D[D.DRAFT_SAVE_ERROR=35015]="DRAFT_SAVE_ERROR",D[D.DRAFT_REMOVE_ERROR=35016]="DRAFT_REMOVE_ERROR",D[D.CONVER_REMOVE_ERROR=35020]="CONVER_REMOVE_ERROR",D[D.CONVER_GET_ERROR=35021]="CONVER_GET_ERROR",D[D.SEARCH_PROPS_LIMIT_ERROR=35022]="SEARCH_PROPS_LIMIT_ERROR",D[D.INVALID_PARAMETER_MESSAGE_TYPE=35024]="INVALID_PARAMETER_MESSAGE_TYPE",D[D.INVALID_PARAMETER_ORDER=35025]="INVALID_PARAMETER_ORDER",D[D.INVALID_PARAMETER_DRAFT=35028]="INVALID_PARAMETER_DRAFT",D[D.INVALID_PARAMETER_MESSAGE=35029]="INVALID_PARAMETER_MESSAGE",D[D.INVALID_PARAMETER_PUSH_CONTENT=35030]="INVALID_PARAMETER_PUSH_CONTENT",D[D.INVALID_PARAMETER_SENDOPTIONS=35031]="INVALID_PARAMETER_SENDOPTIONS",D[D.INVALID_PARAMETER_CONTENT_DISPOSITION=35032]="INVALID_PARAMETER_CONTENT_DISPOSITION",D[D.INVALID_PARAMETER_SAVE_NAME=35033]="INVALID_PARAMETER_SAVE_NAME",D[D.INVALID_PARAMETER_SERVER_TYPE=35034]="INVALID_PARAMETER_SERVER_TYPE",D[D.INVALID_PARAMETER_CLEAN_SPACE=35035]="INVALID_PARAMETER_CLEAN_SPACE",D[D.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION=35036]="INVALID_PARAMETER_CAN_INCLUDE_EXPANSION",D[D.INVALID_PARAMETER_DISABLE_NOTIFICATION=35037]="INVALID_PARAMETER_DISABLE_NOTIFICATION",D[D.INVALID_PARAMETER_CHECK_DUPLICATE=35038]="INVALID_PARAMETER_CHECK_DUPLICATE",D[D.INVALID_PARAMETER_IS_AUTO_DELETE=35039]="INVALID_PARAMETER_IS_AUTO_DELETE",D[D.INVALID_PARAMETER_IS_SEND_NOTIFICATION=35040]="INVALID_PARAMETER_IS_SEND_NOTIFICATION",D[D.INVALID_PARAMETER_IS_FORCE=35041]="INVALID_PARAMETER_IS_FORCE",D[D.INVALID_PARAMETER_IS_TOP=35042]="INVALID_PARAMETER_IS_TOP",D[D.INVALID_PARAMETER_IS_UPDATE_TIME=35043]="INVALID_PARAMETER_IS_UPDATE_TIME",D[D.INVALID_PARAMETER_CONTAIN_MUTED=35044]="INVALID_PARAMETER_CONTAIN_MUTED",D[D.INVALID_PARAMETER_IS_STATUS_MESSAGE=35045]="INVALID_PARAMETER_IS_STATUS_MESSAGE",D[D.INVALID_PARAMETER_IS_MENTIONED=35046]="INVALID_PARAMETER_IS_MENTIONED",D[D.INVALID_PARAMETER_IS_VOIP_PUSH=35047]="INVALID_PARAMETER_IS_VOIP_PUSH",D[D.INVALID_PARAMETER_MENTIONED_TYPE=35048]="INVALID_PARAMETER_MENTIONED_TYPE",D[D.INVALID_PARAMETER_PUSH_CONFIG=35049]="INVALID_PARAMETER_PUSH_CONFIG",D[D.INVALID_PARAMETER_PUSH_DATA=35050]="INVALID_PARAMETER_PUSH_DATA",D[D.DNS_PROXY_TIMEOUT=35051]="DNS_PROXY_TIMEOUT",D[D.DNS_PROXY_ERROR=35052]="DNS_PROXY_ERROR",D[D.DNS_PROXY_DATA_ERROR=35053]="DNS_PROXY_DATA_ERROR",D[D.INVALID_DISABLE_UPDATE_LAST_MESSAGE=35054]="INVALID_DISABLE_UPDATE_LAST_MESSAGE",D[D.ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING=35055]="ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING",D[D.SEND_READ_RECEIPT_CONF_ERROR=35056]="SEND_READ_RECEIPT_CONF_ERROR",D[D.SPEECH_TO_TEXT_DISABLE=35057]="SPEECH_TO_TEXT_DISABLE",D[D.SPEECH_TO_TEXT_REQUEST_IN_PROCESS=35058]="SPEECH_TO_TEXT_REQUEST_IN_PROCESS",D[D.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED=35059]="SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED",D[D.TRANSLATION_PARAMS_TYPE_INVALID=35060]="TRANSLATION_PARAMS_TYPE_INVALID",D[D.TRANSLATION_PARAMS_LIST_INVALID=35061]="TRANSLATION_PARAMS_LIST_INVALID",D[D.INVALID_PARAMETER_TRANSLATE_STRATEGY=35062]="INVALID_PARAMETER_TRANSLATE_STRATEGY",D[D.TRANSLATION_LANGUAGE_SAME=35063]="TRANSLATION_LANGUAGE_SAME",D[D.INVALID_PARAMETER_TRANSLATE_MODE=35064]="INVALID_PARAMETER_TRANSLATE_MODE",D[D.TRANSLATION_TEXT_INVALID=35065]="TRANSLATION_TEXT_INVALID",D[D.MSG_BLOCK_SEND=35066]="MSG_BLOCK_SEND",D[D.CHATROOM_ID_ISNULL=36001]="CHATROOM_ID_ISNULL",D[D.CHARTOOM_JOIN_ERROR=36002]="CHARTOOM_JOIN_ERROR",D[D.CHATROOM_HISMESSAGE_ERROR=36003]="CHATROOM_HISMESSAGE_ERROR",D[D.CHATROOM_KV_NOT_FOUND=36004]="CHATROOM_KV_NOT_FOUND",D[D.BLACK_ADD_ERROR=37001]="BLACK_ADD_ERROR",D[D.BLACK_GETSTATUS_ERROR=37002]="BLACK_GETSTATUS_ERROR",D[D.BLACK_REMOVE_ERROR=37003]="BLACK_REMOVE_ERROR",D[D.DRAF_GET_ERROR=38001]="DRAF_GET_ERROR",D[D.STREAM_MESSAGE_DISABLE=39001]="STREAM_MESSAGE_DISABLE",D[D.STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED=39002]="STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED",D[D.STREAM_MESSAGE_EXPANSION_KEY_ERROR=39003]="STREAM_MESSAGE_EXPANSION_KEY_ERROR",D[D.STREAM_MESSAGE_REQUEST_FAIL=39005]="STREAM_MESSAGE_REQUEST_FAIL",D[D.STREAM_MESSAGE_REQUEST_IN_PROCESS=39006]="STREAM_MESSAGE_REQUEST_IN_PROCESS",D[D.STREAM_MESSAGE_SYNCED=39007]="STREAM_MESSAGE_SYNCED",D[D.QNTKN_GET_ERROR=41002]="QNTKN_GET_ERROR",D[D.TIMEOUT=-1]="TIMEOUT",exports.ConversationType=void 0,(x=exports.ConversationType||(exports.ConversationType={}))[x.NONE=0]="NONE",x[x.PRIVATE=1]="PRIVATE",x[x.DISCUSSION=2]="DISCUSSION",x[x.GROUP=3]="GROUP",x[x.CHATROOM=4]="CHATROOM",x[x.CUSTOMER_SERVICE=5]="CUSTOMER_SERVICE",x[x.SYSTEM=6]="SYSTEM",x[x.APP_PUBLIC_SERVICE=7]="APP_PUBLIC_SERVICE",x[x.PUBLIC_SERVICE=8]="PUBLIC_SERVICE",x[x.ULTRA_GROUP=10]="ULTRA_GROUP",x[x.RTC_ROOM=12]="RTC_ROOM";const w=0,G=1,V=2,k=3,F=4,B=5,H=6,j=7,Y=e=>{const t=[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP,exports.ConversationType.SYSTEM,exports.ConversationType.PUBLIC_SERVICE,exports.ConversationType.APP_PUBLIC_SERVICE];switch(e){case w:return t;case G:return[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP];case V:return[...t,exports.ConversationType.ULTRA_GROUP];case k:return[...t,exports.ConversationType.ULTRA_GROUP,exports.ConversationType.CHATROOM];case F:return[...t,exports.ConversationType.ULTRA_GROUP,exports.ConversationType.CHATROOM,exports.ConversationType.RTC_ROOM,exports.ConversationType.CUSTOMER_SERVICE,exports.ConversationType.DISCUSSION];case B:return[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP,exports.ConversationType.ULTRA_GROUP];case H:return[exports.ConversationType.GROUP];case j:return[exports.ConversationType.PRIVATE]}},W=(e,t)=>Y(t).includes(e);var J,q,K;!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"}(J||(J={})),exports.FileType=void 0,(q=exports.FileType||(exports.FileType={}))[q.IMAGE=1]="IMAGE",q[q.AUDIO=2]="AUDIO",q[q.VIDEO=3]="VIDEO",q[q.FILE=4]="FILE",q[q.SIGHT=5]="SIGHT",q[q.COMBINE_HTML=6]="COMBINE_HTML",exports.MentionedType=void 0,(K=exports.MentionedType||(exports.MentionedType={}))[K.ALL=1]="ALL",K[K.SINGAL=2]="SINGAL";const Q={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",COMMAND:"RC:CmdMsg",COMMAND_NOTIFICATION:"RC:CmdNtf",INFORMATION_NOTIFICATION:"RC:InfoNtf",GROUP_NOTIFICATION:"RC:GrpNtf"};var X,z,Z,$,ee,te,re,ie,se,ne,oe,ae,le,ce,de,_e,ue,he,Ee,ge,Ie;exports.UltraGroupChannelType=void 0,(X=exports.UltraGroupChannelType||(exports.UltraGroupChannelType={}))[X.PUBLIC=0]="PUBLIC",X[X.PRIVATE=1]="PRIVATE",exports.UltraGroupChannelChangeType=void 0,(z=exports.UltraGroupChannelChangeType||(exports.UltraGroupChannelChangeType={}))[z.PUBLIC_TO_PRIVATE=2]="PUBLIC_TO_PRIVATE",z[z.PRIVATE_TO_PUBLIC=3]="PRIVATE_TO_PUBLIC",z[z.PUBLIC_TO_PRIVATE_USER_NOT_IN=6]="PUBLIC_TO_PRIVATE_USER_NOT_IN",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"}(Z||(Z={})),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"}($||($={})),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"}(ee||(ee={})),function(e){e[e.NOT_MENTIONED=0]="NOT_MENTIONED",e[e.ALL=1]="ALL",e[e.ME=2]="ME"}(te||(te={})),exports.SentStatus=void 0,(re=exports.SentStatus||(exports.SentStatus={}))[re.SENDING=10]="SENDING",re[re.FAILED=20]="FAILED",re[re.SENT=30]="SENT",re[re.RECEIVED=40]="RECEIVED",re[re.READ=50]="READ",re[re.DESTROYED=60]="DESTROYED",exports.OperateStatus=void 0,(ie=exports.OperateStatus||(exports.OperateStatus={}))[ie.typing=0]="typing",exports.OnlineStatus=void 0,(se=exports.OnlineStatus||(exports.OnlineStatus={}))[se.ONLINE=1]="ONLINE",se[se.OFFLINE=0]="OFFLINE",exports.Platform=void 0,(ne=exports.Platform||(exports.Platform={}))[ne.Other=0]="Other",ne[ne.iOS=1]="iOS",ne[ne.Android=2]="Android",ne[ne.Web=3]="Web",ne[ne.PC=4]="PC",ne[ne.Mini=5]="Mini",ne[ne.HarmonyOS=6]="HarmonyOS",exports.SubscribeType=void 0,(oe=exports.SubscribeType||(exports.SubscribeType={}))[oe.ONLINE_STATUS=1]="ONLINE_STATUS",oe[oe.USER_PROFILE=2]="USER_PROFILE",oe[oe.FRIEND_ONLINE_STATUS=3]="FRIEND_ONLINE_STATUS",oe[oe.FRIEND_USER_PROFILE=4]="FRIEND_USER_PROFILE",exports.SubscribeOperationType=void 0,(ae=exports.SubscribeOperationType||(exports.SubscribeOperationType={}))[ae.SUBSCRIBE=0]="SUBSCRIBE",ae[ae.UNSUBSCRIBE=1]="UNSUBSCRIBE",exports.UserProfileVisibility=void 0,(le=exports.UserProfileVisibility||(exports.UserProfileVisibility={}))[le.NOT_SET=0]="NOT_SET",le[le.INVISIBLE=1]="INVISIBLE",le[le.EVERYONE=2]="EVERYONE",le[le.FriendVisible=3]="FriendVisible",exports.RCConnectionStatus=void 0,(ce=exports.RCConnectionStatus||(exports.RCConnectionStatus={}))[ce.CONNECTED=0]="CONNECTED",ce[ce.CONNECTING=1]="CONNECTING",ce[ce.DISCONNECTED=2]="DISCONNECTED",ce[ce.SUSPENDED=3]="SUSPENDED",exports.MessageBlockType=void 0,(de=exports.MessageBlockType||(exports.MessageBlockType={}))[de.GLOBAL=1]="GLOBAL",de[de.CUSTOM=2]="CUSTOM",de[de.THIRD_PARTY=3]="THIRD_PARTY",exports.MessageBlockSourceType=void 0,(_e=exports.MessageBlockSourceType||(exports.MessageBlockSourceType={}))[_e.MSG_ORIGINAL=0]="MSG_ORIGINAL",_e[_e.MSG_EXPANSION=1]="MSG_EXPANSION",_e[_e.MSG_MODIFY=2]="MSG_MODIFY",exports.MessageDirection=void 0,(ue=exports.MessageDirection||(exports.MessageDirection={}))[ue.SEND=1]="SEND",ue[ue.RECEIVE=2]="RECEIVE",exports.PushImportanceHonor=void 0,(he=exports.PushImportanceHonor||(exports.PushImportanceHonor={})).NORMAL="NORMAL",he.LOW="LOW",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={})),exports.NotificationLevel=void 0,(ge=exports.NotificationLevel||(exports.NotificationLevel={}))[ge.ALL_MESSAGE=-1]="ALL_MESSAGE",ge[ge.NOT_SET=0]="NOT_SET",ge[ge.AT_MESSAGE_NOTIFICATION=1]="AT_MESSAGE_NOTIFICATION",ge[ge.AT_USER_NOTIFICATION=2]="AT_USER_NOTIFICATION",ge[ge.AT_GROUP_ALL_USER_NOTIFICATION=4]="AT_GROUP_ALL_USER_NOTIFICATION",ge[ge.NOT_MESSAGE_NOTIFICATION=5]="NOT_MESSAGE_NOTIFICATION",exports.NotificationStatus=void 0,(Ie=exports.NotificationStatus||(exports.NotificationStatus={}))[Ie.OPEN=1]="OPEN",Ie[Ie.CLOSE=2]="CLOSE";const pe=e=>e<=exports.NotificationLevel.NOT_SET?exports.NotificationStatus.CLOSE:exports.NotificationStatus.OPEN;var Te,Re,fe,Ae,me,Se,ve,Ce,ye;exports.ReceivedStatus=void 0,(Te=exports.ReceivedStatus||(exports.ReceivedStatus={}))[Te.READ=1]="READ",Te[Te.LISTENED=2]="LISTENED",Te[Te.DOWNLOADED=4]="DOWNLOADED",Te[Te.RETRIEVED=8]="RETRIEVED",Te[Te.UNREAD=0]="UNREAD",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"}(fe||(fe={})),function(e){e[e.REQUEST=0]="REQUEST",e[e.LOCAL=1]="LOCAL"}(Ae||(Ae={})),function(e){e[e.CURRENT=2]="CURRENT"}(me||(me={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT"}(Se||(Se={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT",e[e.REDIRECTED=3]="REDIRECTED",e[e.TIMEOUT=4]="TIMEOUT"}(ve||(ve={})),exports.InterruptionLevel=void 0,(Ce=exports.InterruptionLevel||(exports.InterruptionLevel={})).PASSIVE="passive",Ce.ACTIVE="active",Ce.TIME_SENSITIVE="time-sensitive",Ce.CRITICAL="critical",exports.PushNotificationQuietHoursLevel=void 0,(ye=exports.PushNotificationQuietHoursLevel||(exports.PushNotificationQuietHoursLevel={}))[ye.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT=0]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT",ye[ye.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_MENTION_MESSAGE=1]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_MENTION_MESSAGE",ye[ye.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_BLOCKED=5]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_BLOCKED";const Oe={ALL:0,EXCLUDE_ROBOT:1,ROBOT_ONLY:2},Ne={NOT_CONVERTED:0,CONVERTING:1,SUCCESS:2,FAILED:3},Me={UNKNOWN:-1,V1:0,V2:1,V4:3,V5:4},be={DEFAULT:0,DELETED:1,RECALLED:2},Le={ADDED:1,REMOVED:2,CLEARED:3},Ue={ALL:0,UNREAD_ONLY:1,MENTION_ONLY:2,NO_UNREAD:3};var Pe,De;!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"}(Pe||(Pe={})),exports.HttpMethod=void 0,(De=exports.HttpMethod||(exports.HttpMethod={})).GET="GET",De.POST="POST",De.PUT="PUT";const xe=72e5,we=6e4,Ge=131072,Ve="5.44.0".replace(/-.+$/,""),ke="rongcloudsystem",Fe=864e5,Be="RCDeviceId",He=e=>`navi_${e}`,je=(e,t)=>`RC-con-stat-ver-${e}-${t}`,Ye=(e,t)=>`RCV4-CONVER-${e}-${t}`,We=(e,t)=>`RCV4-ultragroupconversation-${e}-${t}`,Je=(e,t)=>`RC-con-type-settings-${e}-${t}`,qe=(e,t)=>`outbox_${e}_${t}`,Ke=(e,t)=>`inbox_${e}_${t}`,Qe=(e,t)=>`broadcastbox_${e}_${t}`,Xe=(e,t)=>`send_msg_${e}_${t}`,ze=(e,t)=>`RC-us-${e}-${t}`,Ze=e=>`rc-static-config-${e}`,$e=e=>`RC-cc-${e}`,et=(e,t)=>`RC-RR-${e}-${t}`,rt=e=>`RC-LI-${e}`,it=Math.pow(2,31)-1,st="undefined"!=typeof window&&window?(window.__RCVersionInfo||(window.__RCVersionInfo={}),window.__RCVersionInfo):{},nt="engine";st[nt]="5.44.0-alpha.1";class ot{static add(e,t){["imlib-next","engine","electron-main","electron-renderer","imlib-v2-adapter","Global_IM_UIKit","IMKit","imkit-store","rtclib","calllib","callplus","plugin-wechat-rtc"].includes(e)&&(st[e]=t)}static validEngine(e){const t=e.match(/\d+\.\d+\.\d+/);if(!t)return!1;const r=t[0].split(".").map((e=>e.padStart(3,"0"))).join("");return st[nt].match(/\d+\.\d+\.\d+/)[0].split(".").map((e=>e.padStart(3,"0"))).join("")>=r}static getInfo(){return st}}const at={gen:()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=Math.floor(36*Math.random());return("x"===e?t:3&t|8).toString(36)})),genWithLen(e=22){const t=Date.now(),r=t.toString(36),i=Math.floor(Math.random()*t).toString(36),s=e-r.length-i.length;var n;return[i,r,s>0?(n=s,Array.from({length:n}).map((()=>Math.floor(36*Math.random()).toString(36))).join("")):""].join("").slice(0,e)}},lt=at.genWithLen(22),ct=Date.now(),dt=e=>"string"==typeof e,_t=e=>"number"==typeof e&&!Number.isNaN(e),ut=e=>t=>Number.isInteger(t)&&(void 0===e.min||t>=e.min)&&(void 0===e.max||t<=e.max),ht=e=>-1!==Object.prototype.toString.call(e).indexOf("Array"),Et=e=>t=>dt(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)),gt=e=>dt(e)&&e.length>0,It=e=>"[object Object]"===Object.prototype.toString.call(e),pt=e=>"function"==typeof e,Tt=e=>void 0===e||"[object Undefined]"===Object.prototype.toString.call(e),Rt=e=>dt(e)&&/https?:\/\//.test(e),ft=e=>{for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1},At=e=>_t(e)&&Object.prototype.hasOwnProperty.call(exports.NotificationLevel,e),mt=e=>{let t=!1;return dt(e)&&!/_/g.test(e)&&e.length<=20&&(t=!0),t},St=e=>Et({minLength:1,maxLength:64})(e),vt=e=>Et({minLength:1,maxLength:64})(e)&&/^[a-zA-Z0-9+=\-_|:]*$/.test(e),Ct=()=>void 0!==(null===window||void 0===window?void 0:window.__RCCppContextBridge__),yt=e=>({isRead:(e&exports.ReceivedStatus.READ)===exports.ReceivedStatus.READ,isListened:(e&exports.ReceivedStatus.LISTENED)===exports.ReceivedStatus.LISTENED,isDownload:(e&exports.ReceivedStatus.DOWNLOADED)===exports.ReceivedStatus.DOWNLOADED,isRetrieved:(e&exports.ReceivedStatus.RETRIEVED)===exports.ReceivedStatus.RETRIEVED}),Ot=e=>[exports.Platform.iOS,exports.Platform.Android,exports.Platform.Web,exports.Platform.PC,exports.Platform.Mini,exports.Platform.HarmonyOS].map((t=>{const r=e.findIndex((e=>e.platform===t));return-1===r?{platform:t,changeTime:0,eventValue:0}:e[r]})),Nt=(e,t,r)=>{const i=t.reduce(((e,t)=>(["gender","role","level"].includes(t.key)?e[t.key]=Number(t.value):e[t.key]=t.value,e)),{});return i.userId=e,r.forEach((e=>{i.extraProfile=i.extraProfile||{},i.extraProfile[e.key]=e.value})),i},Mt=(e,t,r)=>t?1===r?J.TLS:J.RMTP:"http"===e?J.WS:J.WSS,bt=(e,t)=>{const{server:r,backupServer:i,bs:s,serverAddr:n,protocol:o,openTLS:a}=e;if(n){return[...n.filter((e=>e.addr))]}const l=[],c=[];return r&&c.push(r),(i||s||"").split(",").forEach((e=>{c.indexOf(e)<0&&c.push(e)})),c.forEach(((e,i)=>{e&&l.push({addr:e,protocol:Mt(o,t,a),weight:r.length-i,race:!1})})),[...l]},Lt=(e=[])=>e.map((e=>{const t=Dt(e.settingProfile),r=e.extProfile||[],{targetId:i,baseInfo:s,userInfo:n}=e;return JSON.parse(JSON.stringify(Object.assign(Object.assign({groupId:i},Pt(t)),{extProfile:r.length>0?Dt(r):void 0,creatorId:null==s?void 0:s.creatorId,ownerId:null==s?void 0:s.ownerId,createTime:null==s?void 0:s.createTime,membersCount:null==s?void 0:s.memberCount,remark:null==n?void 0:n.remarkName})))})),Ut=e=>{if(void 0===e)return;const t=Number(e);return Number.isNaN(t)?void 0:t},Pt=e=>JSON.parse(JSON.stringify({groupName:e.name,portraitUri:e.portraitUrl,introduction:e.introduction,notice:e.announcement,joinPermission:Ut(e.joinPerm),removeMemberPermission:Ut(e.removePerm),invitePermission:Ut(e.memInvitePerm),inviteHandlePermission:Ut(e.invitePerm),groupInfoEditPermission:Ut(e.profilePerm),memberInfoEditPermission:Ut(e.memProfilePerm)})),Dt=e=>{let t={};return e&&0!==e.length?(e.forEach((e=>{t[e.key]=e.value})),t):t},xt=e=>{const{userId:t,name:r,portraitUrl:i,ext:s}=e,{role:n,joinTime:o,channelNickName:a,additional:l,isBot:c}=s||{};return{userId:t,name:r||"",portraitUri:i||"",nickname:a||"",extra:l||"",role:n||exports.GroupMemberRole.UNDEF,joinedTime:o||0,isRobot:!!c}},wt=e=>{const{joinUserInfo:t,inviterInfo:r,processInfo:i}=e;return{groupId:e.targetId,joinMemberInfo:xt(t),inviterInfo:r&&r.userId?xt(r):void 0,operatorInfo:i&&i.userId?xt(i):void 0,status:e.status,direction:e.directionType,type:e.joinType,operationTime:e.applyTime||0,reason:e.detail||""}},Gt=e=>e.reduce(((e,t)=>(e[t.key]=t.value,e)),{}),Vt=(e,t)=>{if(e=e.replace(/\?$/,""),!t)return e;const r=Object.keys(t).map((e=>`${e}=${t[e]}`)).filter((e=>!!e));return r.length?[e,r.join("&")].join("?"):e};const kt=(e,t)=>{const r=Math.floor(1e3*Math.random()%1e4),i=at.gen(),s=(e=>{e=e||"-";const t=new Date;return`${t.getFullYear()}${e}${t.getMonth()+1}${e}${t.getDate()}`})(),n=(new Date).getTime();let o="";if(t){const e=t.split(".");o=`.${e[e.length-1]}`}return`${e}__RC-${s}_${r}_${n}${i}${o}`},Ft=(e={},t={},r={})=>{const{channelIdMi:i,channelIdHW:s,channelIdOPPO:n,typeVivo:o,importanceHW:a,categoryHW:l,imageUrlHW:c,categoryVivo:d,importanceHonor:_,imageUrlHonor:u}=t,{APNS:h,FCM:E}=((e={},t={})=>{const{threadId:r,apnsCollapseId:i,category:s,richMediaUri:n,interruptionLevel:o}=e,{googleConfig:a}=t,l={};l["thread-id"]=r||"",l["apns-collapse-id"]=i||"",l.category=s||"",l.richMediaUri=n||"",l["interruption-level"]=o||"active";const c={};c.collapse_key=null==a?void 0:a.collapseKey,c.imageUrl=null==a?void 0:a.imageUrl;let d=null==a?void 0:a.priority;return d&&!["high","normal"].includes(d)&&(d="normal"),c.priority=d,{APNS:l,FCM:c}})(e,t),g=[{HW:{channelId:s||"",importance:a||"NORMAL",image:c||"",category:l||""}},{MI:{channelId:i||""}},{OPPO:{channelId:n||""}},{VIVO:{classification:o||"",category:d||""}},{APNS:h},{FCM:E},{HONOR:{importance:_||exports.PushImportanceHonor.NORMAL,image:u||""}},{OHOS:{category:r.category||null,image:r.image||""}}];return JSON.stringify(g)},Bt=(e,t)=>{const r={},i={notificationId:t||""},s={};if(!e)return{iOSConfig:r,androidConfig:i,harmonyOSConfig:s};try{const t=JSON.parse(e);null==t||t.forEach((e=>{var t,n,o,a,l,c,d,_,u,h,E,g;const I=Object.keys(e);if(0===I.length)return;const p=I[0];switch(p){case"HW":return i.channelIdHW=null===(t=e[p])||void 0===t?void 0:t.channelId,i.importanceHW=null===(n=e[p])||void 0===n?void 0:n.importance,i.imageUrlHW=null===(o=e[p])||void 0===o?void 0:o.image,void(i.categoryHW=null===(a=e[p])||void 0===a?void 0:a.category);case"MI":return void(i.channelIdMi=null===(l=e[p])||void 0===l?void 0:l.channelId);case"OPPO":return void(i.channelIdOPPO=null===(c=e[p])||void 0===c?void 0:c.channelId);case"VIVO":return i.typeVivo=null===(d=e[p])||void 0===d?void 0:d.classification,void(i.categoryVivo=null===(_=e[p])||void 0===_?void 0:_.category);case"APNS":return r.threadId=e[p]["thread-id"],r.apnsCollapseId=e[p]["apns-collapse-id"],r.category=e[p].category,r.richMediaUri=e[p].richMediaUri,void(r.interruptionLevel=e[p]["interruption-level"]);case"FCM":return void(i.googleConfig={collapseKey:e[p].collapse_key||"",imageUrl:e[p].imageUrl||"",priority:e[p].priority||""});case"HONOR":return i.importanceHonor=null===(u=e[p])||void 0===u?void 0:u.importance,void(i.imageUrlHonor=null===(h=e[p])||void 0===h?void 0:h.image);case"OHOS":s.category=null===(E=e[p])||void 0===E?void 0:E.category,s.image=null===(g=e[p])||void 0===g?void 0:g.image}}))}catch(e){}return{iOSConfig:r,androidConfig:i,harmonyOSConfig:s}},Ht=e=>{const t=/^[A-Za-z0-9_=+-]+$/.test(e),r=e.length;return t&&(r<=128&&r>=1)},jt=e=>{const{length:t}=e;return t<=4096&&t>=1},Yt=(()=>{let e=0;return()=>{const t=((4294967295&Date.now())>>>0).toString(2),r=Math.floor(Math.random()*(Math.pow(2,8)-1)),i=t+e.toString(2).padStart(11,"0")+r.toString(2).padStart(8,"0");return e=2047&++e,parseInt(i,2)}})(),Wt=()=>{const e=ot.getInfo();let t="electron";for(let r in e)"engine"!==r&&(t=["imlib-v2-adapter","imlib-next"].includes(r)?r:"electron");return t},Jt=(e,r,i)=>t(void 0,void 0,void 0,(function*(){const t=yield window.crypto.subtle.importKey("raw",(new TextEncoder).encode(r),"AES-CBC",!0,["decrypt"]),s=yield window.crypto.subtle.decrypt({name:"AES-CBC",iv:(new TextEncoder).encode(i)},t,function(e){const t=null===window||void 0===window?void 0:window.atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r.buffer}(e));return(new TextDecoder).decode(s)}));function qt(e,t){var r;if(!e)return"";const i="undefined"!=typeof window&&"https:"===(null===(r=null===window||void 0===window?void 0:window.location)||void 0===r?void 0:r.protocol);return/^https?:\/\//.test(e)?i?e.replace(/^https?:\/\//i,"https://"):e:t!==J.HTTP||i?`https://${e}`:`http://${e}`}const Kt=(e,t)=>{if(!e)return"";const{ossConfig:r=""}=e;let i="";try{const e=JSON.parse(r);if(e.length>0){const t=e.find((e=>e.minio));t&&(i=t.minio)}}catch(e){t.warn(n.L_PARSE_JSON_E,JSON.stringify({ossConfig:r,error:e}))}return i};const Qt=(e,t)=>t&&0!==t.length?[exports.ConversationType.GROUP,exports.ConversationType.ULTRA_GROUP,exports.ConversationType.APP_PUBLIC_SERVICE,exports.ConversationType.PUBLIC_SERVICE].includes(e)?t:[]:t||[];class Xt extends Error{constructor(e){super(e),this.name="RCError"}static InvalidParameters(e){return(null==e?void 0:e.length)?new Xt(`Invalid parameter -> ${e}`):new Xt("Invalid parameters.")}static ParameterTypeError(){return new Xt("Wrong parameter type")}}var zt;class Zt{constructor(){zt.set(this,!1)}stopPropagation(){i(this,zt,!0,"f")}get isStopPropagation(){return r(this,zt,"f")}}zt=new WeakMap;class $t{constructor(){Object.defineProperty(this,"_map",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"_piped",{enumerable:!0,configurable:!0,writable:!0,value:new Map})}_addItem(e,t,r,i,s=0){const n=Symbol(),o=this._map.get(e)||this._map.set(e,[]).get(e),a={symbol:n,priority:Math.min(s,100),listener:t.bind(i),once:r},l=o.findIndex((e=>e.priority>s));return-1===l?o.push(a):o.splice(l,0,a),n}on(e,t,r,i=0){return this._addItem(e,t,!1,r,i)}once(e,t,r,i=0){return this._addItem(e,t,!0,r,i)}off(e){for(let[t,r]of this._map){const t=r.findIndex((t=>t.symbol===e));if(-1!==t)return void r.splice(t,1)}}emit(e,...t){const r=this._map.get(e);if(r&&r.length>0){const e=new Zt;for(let i=0;i<r.length;i+=1){const{once:s,listener:n}=r[i];s&&r.splice(i,1);try{n(e,...t)}catch(e){null===console||void 0===console||console.error(e)}if(e.isStopPropagation)return}}[...this._piped.entries()].forEach((([r,i])=>{(0===i.length||i.includes(e))&&r.emit(e,...t)}))}removeAll(e){this._map.delete(e)}clear(){this._piped.clear(),this._map.clear()}pipe(e,t){this._piped.set(e,t||[])}}class er extends $t{constructor(e){super(),Object.defineProperty(this,"_name",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_versionQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_pullingPromise",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_dataVersion",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(this,"_invervalTimer",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(this,"_started",{enumerable:!0,configurable:!0,writable:!0,value:!1})}get length(){return this._versionQueue.length}get _isPulling(){return null!==this._pullingPromise}setInitVersion(e,t=!1){-1===this._dataVersion&&(this._dataVersion=e,t&&this._execPulling())}push(e){this._versionQueue.push(e),-1!==this._dataVersion&&this._execPulling()}_execPulling(){return t(this,void 0,void 0,(function*(){if(this._pullingPromise)return;this._pullingPromise=this._handleSyncData(this._dataVersion);const{isOk:e,data:t}=yield this._pullingPromise;if(this._pullingPromise=null,!e)return;if(void 0===(null==t?void 0:t.version)||t.version<this._dataVersion)throw new Error(`${this._name}: version error, please check: lastVersion: ${this._dataVersion}, newVersion: ${null==t?void 0:t.version}`);const{version:r,hasNext:i}=t,s=this._versionQueue.filter((e=>e>r));return this._versionQueue=[...s],this._dataVersion=r,i?this._execPulling():this._versionQueue.length>0?(this._versionQueue.length=0,this._execPulling()):void 0}))}startInterval(e,t){this._started||(this._started=!0,t&&this._execPulling(),this._invervalTimer=setInterval((()=>this._execPulling()),e))}stopInterval(){this._started&&(this._started=!1,clearInterval(this._invervalTimer),this._invervalTimer=-1)}reset(){this.stopInterval(),this._versionQueue.length=0,this._dataVersion=-1}}class tr{constructor(e,t){Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_resolve",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_onCancel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._promise=new Promise((t=>{this._resolve=t,e(this._onResolve.bind(this))})),this._onCancel=t}_onResolve(e){this._resolve(e)}result(){return this._promise}abort(){this._onCancel(this._onResolve.bind(this))}}class rr{constructor(e,t,r){Object.defineProperty(this,"isOk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"msg",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.isOk=0===e,this.code=e,this.msg=t,this.data=r}static from(e,t,r){return new rr(e,t||`fail: ${e}`,r)}static ok(e,t){return new rr(0,t||"success",e)}static fail(e,t,r){return new rr(e,t||`fail: ${e}`,r)}next(e){return t(this,void 0,void 0,(function*(){return this.isOk?e(this.data):this.wipe()}))}or(e){return t(this,void 0,void 0,(function*(){return this.isOk?this:e(this.code)}))}orSync(e){return this.isOk?this:e(this.code)}trans(e){return this.isOk?ir(e(this.data)):this.wipe()}tryTrans(e){return this.isOk?e(this.data):this.wipe()}errmsg(){return JSON.stringify({code:this.code,msg:this.msg})}wipe(){return this.isOk?ir(void 0,this.msg):sr(this.code,this.msg)}}const{ok:ir}=rr,{fail:sr}=rr;class nr{constructor(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})}static create(e){return new nr(e)}get isFailed(){return!this._isValid}fail(e,t,r=!1){return this.isFailed&&(0===this._code||r)&&(this._code=e,this._errmsg=t||this._errmsg),this}setFailed(e,t){return this._isValid=!1,this.fail(e,t)}result(){if(this.isFailed&&0===this._code)throw new Error("Validator: result() should not be called without fail()");return this.isFailed?sr(this._code,this._errmsg):ir()}check(e){return this.isFailed||e(this),this}validate(e,t,r,i=!1){if(this.isFailed)return this;const s=i?r(t):null==t||r(t);return this._isValid=s,this.isFailed&&(this._errmsg=`param '${e}' is invalid`),this}assert(e,t,r,i=!1){if(this.isFailed)return this;if(this.validate(e,t,r,i),this.isFailed)throw Xt.InvalidParameters(`'${e}' at '${this._apiName}'`);return this}isString(e,t,r=!1){return this.validate(e,t,(()=>"string"==typeof t),r)}assertString(e,t,r=!1){return this.assert(e,t,(()=>"string"==typeof t),r)}isHttpUrl(e,t,r=!1){return this.isNotEmptyString(e,t,r).validate(e,t,(e=>/^https?:\/\//.test(e)))}isNotEmptyString(e,t,r=!1){return this.isString(e,t,r).validate(e,t,(e=>e.trim().length>0),r)}assertNotEmptyString(e,t,r=!1){return this.assertString(e,t,r),this.assert(e,t,(e=>e.trim().length>0),r)}isLimitedString(e,t,r,i,s=!1){return this.isString(e,t,s).validate(e,t,(e=>e.length>=r&&e.length<=i),s)}assertLimitedString(e,t,r,i,s=!1){return this.assertString(e,t,s),this.assert(e,t,(e=>e.length>=r&&e.length<=i),s)}isBoolean(e,t,r=!1){return this.validate(e,t,(e=>"boolean"==typeof e),r)}assertBoolean(e,t,r=!1){return this.assert(e,t,(e=>"boolean"==typeof e),r)}isNumber(e,t,r=!1){return this.validate(e,t,(e=>"number"==typeof e&&!Number.isNaN(e)),r)}assertNumber(e,t,r=!1){return this.assert(e,t,(e=>"number"==typeof e&&!Number.isNaN(e)),r)}isLimitedNumber(e,t,r,i,s=!1){return this.isNumber(e,t,s).validate(e,t,(e=>e>=r&&e<=i),s)}assertLimitedNumber(e,t,r,i,s=!1){return this.assertNumber(e,t,s),this.assert(e,t,(e=>e>=r&&e<=i),s)}isInteger(e,t,r=!1){return this.validate(e,t,(e=>Number.isInteger(e)),r)}assertInteger(e,t,r=!1){return this.assert(e,t,(e=>Number.isInteger(e)),r)}isLimitedInteger(e,t,r,i,s=!1){return this.isInteger(e,t,s).validate(e,t,(e=>e>=r&&e<=i),s)}isTimestamp(e,t,r=!1){return this.isLimitedInteger(e,t,0,Number.MAX_SAFE_INTEGER,r)}assertLimitedInteger(e,t,r,i,s=!1){return this.assertInteger(e,t,s),this.assert(e,t,(e=>e>=r&&e<=i),s)}isArray(e,t,r=!1){return this.validate(e,t,(e=>-1!==Object.prototype.toString.call(e).indexOf("Array")),r)}assertArray(e,t,r=!1){return this.assert(e,t,(e=>-1!==Object.prototype.toString.call(e).indexOf("Array")),r)}isLimitedArray(e,t,r,i=!1,s=1){return this.isArray(e,t,i).validate(e,t,(e=>e.length>=s&&e.length<=r),i)}assertLimitedArray(e,t,r,i=!1,s=1){return this.assertArray(e,t,i),this.assert(e,t,(e=>e.length>=s&&e.length<=r),i)}isTypedArray(e,t,r,i=!1){return this.isArray(e,t,i).validate(e,t,(e=>e.every(r)),i)}assertTypedArray(e,t,r,i=!1){return this.assertArray(e,t,i),this.assert(e,t,(e=>e.every(r)),i)}isLimitedTypedArray(e,t,r,i,s=!1,n=1){return this.isLimitedArray(e,t,r,s,n).validate(e,t,(e=>e.every(i)),s)}assertLimitedTypedArray(e,t,r,i,s=!1,n=1){return this.assertLimitedArray(e,t,r,s,n),this.assert(e,t,(e=>e.every(i)),s)}isObject(e,t,r=!1){return this.validate(e,t,(e=>"[object Object]"===Object.prototype.toString.call(e)),r)}assertObject(e,t,r=!1){return this.assert(e,t,(e=>"[object Object]"===Object.prototype.toString.call(e)),r)}isStringEnum(e,t,r,i=!1){return this.isString(e,t,i).validate(e,t,(e=>Object.values(r).includes(e)),i)}isNumberEnum(e,t,r,i=!1){return this.isNumber(e,t,i).validate(e,t,(e=>Object.values(r).includes(e)),i)}assertValueOf(e,t,r,i=!1){return this.assert(e,t,(()=>Object.values(r).includes(t)),i)}isFunction(e,t,r=!1){return this.validate(e,t,(e=>"function"==typeof e),r)}assertFunction(e,t,r=!1){return this.assert(e,t,(e=>"function"==typeof e),r)}}const or="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function ar(e){let t,r,i,s,n,o,a,l="",c=0;for(e=e.replace(/[^A-Za-z0-9+/=]/g,"");c<e.length;)s=or.indexOf(e.charAt(c++)),n=or.indexOf(e.charAt(c++)),o=or.indexOf(e.charAt(c++)),a=or.indexOf(e.charAt(c++)),t=s<<2|n>>4,r=(15&n)<<4|o>>2,i=(3&o)<<6|a,l+=String.fromCharCode(t),64!==o&&(l+=String.fromCharCode(r)),64!==a&&(l+=String.fromCharCode(i));return l}const lr=()=>{let e,t=new Promise((t=>{e=t}));return{resolve:e,promise:t}},cr=1732584193,dr=4023233417,_r=2562383102,ur=271733878,hr=[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],Er=[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 gr(e,t){return e<<t|e>>>32-t}function Ir(e,t,r){return e&r|t&~r}function pr(e,t,r){return e^t^r}function Tr(e,t,r){return t^(e|~r)}function Rr(e){const t=[];for(let r=0;r<e.length;r+=4)t.push((e[r]||0)|(e[r+1]||0)<<8|(e[r+2]||0)<<16|(e[r+3]||0)<<24);return t}function fr(e){const 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 Ar(e){const t=8*e.length,r=e.length%64<56?56-e.length%64:120-e.length%64,i=new Uint8Array(e.length+r+8);i.set(e),i[e.length]=128;for(let t=1;t<r;t++)i[e.length+t]=0;const s=new Uint8Array(8),n=4294967295&t,o=4294967295&Math.floor(t/4294967296);s.set(fr(n),0),s.set(fr(o),4),i.set(s,e.length+r);let a=cr,l=dr,c=_r,d=ur;for(let e=0;e<i.length;e+=64){const t=Rr(i.slice(e,e+64)),r=a,s=l,n=c,o=d;for(let e=0;e<64;e++){let r,i;e<16?(r=(_=l)&c|~_&d,i=e):e<32?(r=Ir(l,c,d),i=(5*e+1)%16):e<48?(r=pr(l,c,d),i=(3*e+5)%16):(r=Tr(l,c,d),i=7*e%16);const s=d;d=c,c=l,l+=gr(a+r+Er[e]+t[i]&4294967295,hr[e]),a=s}a=a+r&4294967295,l=l+s&4294967295,c=c+n&4294967295,d=d+o&4294967295}var _;const u=new Uint8Array(16);return u.set(fr(a),0),u.set(fr(l),4),u.set(fr(c),8),u.set(fr(d),12),function(e){return Array.from(e).map((e=>e.toString(16).padStart(2,"0"))).join("")}(u)}function mr(e){const t=function(e){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);const t=unescape(encodeURIComponent(e)).split("").map((e=>e.charCodeAt(0)));return new Uint8Array(t)}(e);return Ar(t)}function Sr(e){const t=e.method||exports.HttpMethod.GET,r=e.timeout||we,{headers:i,query:s,body:n,onProgress:o}=e,a=Vt(e.url,s),l=new XMLHttpRequest;if(l.open(t,a),i&&l.setRequestHeader)for(const e in i)l.setRequestHeader(e,i[e]);return function(e,t,r,i){return new tr((s=>{e.onreadystatechange=()=>{4===e.readyState&&s({data:e.responseText,status:e.status,xhr:e})},e.onerror=()=>{s({status:e.status})},i&&(e.upload.onprogress=e=>i(e)),0!==t&&setTimeout((()=>{e.abort(),s({status:e.status})}),t),e.send(r)}),(t=>{e.abort(),t({status:-1})}))}(l,r,n,o)}var vr;!function(e){e[e.add=1]="add",e[e.update=2]="update",e[e.delete=3]="delete"}(vr||(vr={}));const Cr={SUCCESS:0,UPDATING:1,FAILED:2},yr={DEFAULT:0,MODIFIED:1,RECALLED:2,DELETE:3},Or={TranslationLanguage:0,AutoTranslateEnable:1};var Nr;exports.AreaCode=void 0,(Nr=exports.AreaCode||(exports.AreaCode={}))[Nr.BJ=1]="BJ",Nr[Nr.SG=2]="SG",Nr[Nr.NA=3]="NA",Nr[Nr.SG_A=4]="SG_A",Nr[Nr.SG_B=4]="SG_B",Nr[Nr.SA=5]="SA",Nr[Nr.OM=6]="OM";const Mr={[exports.AreaCode.BJ]:{naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5yb25nLWVkZ2UuY29t","bmF2LWIucm9uZy1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ucm9uZy1lZGdlLmNvbQ==",protocol:J.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnJvbmctZWRnZS5jb20=","d3MtYi5yb25nLWVkZ2UuY29t"],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWMtMS5vc3MtY24tYmVpamluZy5hbGl5dW5jcy5jb20="],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5yb25nLWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIucm9uZy1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5yb25nLWVkZ2UuY29t"]},[exports.AreaCode.SG]:{naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zZy1saWdodC1lZGdlLmNvbQ==","bmF2LWIuc2ctbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2ctbGlnaHQtZWRnZS5jb20=",protocol:J.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWxpZ2h0LWVkZ2UuY29t","d3MtYi5zZy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWItMi5zMy5hcC1zb3V0aGVhc3QtMS5hbWF6b25hd3MuY29t"],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIuc2ctbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1saWdodC1lZGdlLmNvbQ=="]},[exports.AreaCode.NA]:{naviUrlBase64:["ZHVhbHN0YWNrLW5hdi51cy1saWdodC1lZGdlLmNvbQ==","bmF2LWIudXMtbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24udXMtbGlnaHQtZWRnZS5jb20=",protocol:J.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnVzLWxpZ2h0LWVkZ2UuY29t","d3MtYi51cy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC51cy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIudXMtbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy51cy1saWdodC1lZGdlLmNvbQ=="]},[exports.AreaCode.SG_B]:{naviUrlBase64:["bmF2LnNnLWItbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zZy1iLWxpZ2h0LWVkZ2UuY29t",protocol:J.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWItbGlnaHQtZWRnZS5jb20=","d3MtYi5zZy1iLWxpZ2h0LWVkZ2UuY29t"],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1iLWxpZ2h0LWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1iLWxpZ2h0LWVkZ2UuY29t"]},[exports.AreaCode.SA]:{naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zYXUtbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2F1LWxpZ2h0LWVkZ2UuY29t",protocol:J.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNhdS1saWdodC1lZGdlLmNvbQ==","d3MtYi5zYXUtbGlnaHQtZWRnZS5jb20="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zYXUtbGlnaHQtZWRnZS5jb20=","Y2xvdWRjb250cm9sLWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zYXUtbGlnaHQtZWRnZS5jb20="]},[exports.AreaCode.OM]:{naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5vbS1saWdodC1lZGdlLmNvbQ==","bmF2LWIub20tbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ub20tbGlnaHQtZWRnZS5jb20=",protocol:J.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLm9tLWxpZ2h0LWVkZ2UuY29t","d3MtYi5vbS1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5vbS1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIub20tbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9kdWFsc3RhY2stc3RhdHMub20tbGlnaHQtZWRnZS5jb20="]}};function br(e){return exports.AreaCode[e]?e:exports.AreaCode.BJ}const Lr=new class{constructor(){Object.defineProperty(this,"initOption",{enumerable:!0,configurable:!0,writable:!0,value:{}})}init(e){this.initOption=e}getNaviUrlList(e,t){const{areaCode:r,navigators:i}=this.initOption||{},s=function(e=exports.AreaCode.BJ){return Mr[br(e)].naviUrlBase64}(r).map((e=>ar(e)));let n=[];const[,o]=e.split("@");t&&(n=o?o.split(";"):[]);const a=i&&i.length>0?[...n,...i]:[...n,...s];return a.filter(((e,t)=>a.indexOf(e)===t)).map((e=>qt(e)))}getLogUrlPolicyList(e,t){const{log:r,logPolicy:i}=e||{},{areaCode:s,logServerUrl:o}=this.initOption||{},a=function(e=exports.AreaCode.BJ){return Mr[br(e)].logUrlBase64}(s).map((e=>Object.assign(Object.assign({},e),{addr:ar(e.addr)}))),l=[],c={level:1,itv:6,times:5};if(r)l.push(...r.addrs),Object.assign(c,r.policy);else if(i)try{const e=JSON.parse(i);l.push({addr:e.url,protocol:J.HTTPS,weight:1}),c.level=e.level,c.itv=e.itv,c.times=e.times}catch(r){t.warn(n.L_REPORT_LOG_POLICY_E,JSON.stringify({policy:e.logPolicy}))}const d=o?[{addr:o,protocol:J.HTTPS,weight:101},...l]:[...l,...a];return{policy:c,addrs:d.filter(((e,t)=>d.findIndex((t=>t.addr===e.addr&&t.protocol===e.protocol))===t)).map((e=>Object.assign(Object.assign({},e),{addr:qt(e.addr,e.protocol)}))).sort(((e,t)=>t.weight-e.weight))}}getMiniCmpUrlList(){var e;const t=function(e=exports.AreaCode.BJ){return Mr[br(e)].miniCmpBase64}(null===(e=this.initOption)||void 0===e?void 0:e.areaCode).map((e=>ar(e))),{miniCMPProxy:r}=this.initOption||{};return r&&r.length>0?r:t}getStaticConfigUrl(){var e;return function(e=exports.AreaCode.BJ){return Mr[br(e)].staticConfigUrlBase64}(null===(e=this.initOption)||void 0===e?void 0:e.areaCode).map((e=>ar(e)))}getCloudControllerUrl(e){var t;return function(e=exports.AreaCode.BJ){return Mr[br(e)].cloudControllerUrlBase64}(null!=e?e:null===(t=this.initOption)||void 0===t?void 0:t.areaCode).map((e=>ar(e)))}getAreaCode(){var e,t;return null!==(t=null===(e=this.initOption)||void 0===e?void 0:e.areaCode)&&void 0!==t?t:exports.AreaCode.BJ}setAreaCode(e){return!(!e||!exports.AreaCode[e]||e===this.initOption.areaCode)&&(this.initOption.areaCode=e,!0)}getStatsUrlList(e){var t;const{active:r,activeServer:i}=e||{};let s=(null==r?void 0:r.addrs)||[];const n=function(e=exports.AreaCode.BJ){return Mr[br(e)].statsUrlBase64}(null===(t=this.initOption)||void 0===t?void 0:t.areaCode).map((e=>ar(e))),o=[];return 0!==s.length?o.push(...s.sort(((e,t)=>t.weight-e.weight)).map((e=>qt(e.addr,e.protocol)))):i&&o.push(qt(i,J.HTTPS)),n.forEach((e=>{o.includes(e)||o.push(e)})),o}};class Ur{constructor(e,t){Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"staticUrls",{enumerable:!0,configurable:!0,writable:!0,value:[]})}getStaticConfig(){var e;return t(this,void 0,void 0,(function*(){const t=this.getCache();if(t){try{const e=JSON.parse(t);if(Date.now()-(null==e?void 0:e.time)<18e5){const t=(yield this.decryptData(e.val)).resources.navi.slice();return t.sort(((e,t)=>t.weight-e.weight)),{navi:t.map((e=>qt(e.addr,e.protocol)))||[]}}}catch(e){this.logger.error(n.L_GET_STATIC_CONF_E,JSON.stringify({error:null==e?void 0:e.stack}))}this.clearCache()}const r=yield this._requestHandle();if(!r)return;const i=yield this.decryptData(r);if((null==i?void 0:i.areaCode)!==Lr.getAreaCode())return;this.setCache(JSON.stringify({time:Date.now(),val:r})),this.staticUrls=(null==i?void 0:i.bootstrap)||[];const s=null===(e=null==i?void 0:i.resources)||void 0===e?void 0:e.navi.slice();return s.sort(((e,t)=>t.weight-e.weight)),{navi:s.map((e=>qt(e.addr,e.protocol)))||[]}}))}_requestHandle(){return t(this,void 0,void 0,(function*(){let e=[...this.staticUrls,...Lr.getStaticConfigUrl()].map((e=>qt(e)));e=e.filter(((t,r)=>e.indexOf(t)===r));for(let t of e){this.logger.info(n.L_GET_STATIC_CONF_T,JSON.stringify({url:t}));const e=Date.now(),{code:r,data:i}=yield this.sendRequest(`${t}/${this.appkey}`);if(200===r)return this.logger.info(n.L_GET_STATIC_CONF_R,JSON.stringify({url:t,code:r,duration:Date.now()-e})),i;this.logger.warn(n.L_GET_STATIC_CONF_R,JSON.stringify({url:t,code:r,duration:Date.now()-e}))}}))}}var Pr;exports.LogL=void 0,(Pr=exports.LogL||(exports.LogL={}))[Pr.STATISTICS=-2]="STATISTICS",Pr[Pr.RECORD=-1]="RECORD",Pr[Pr.FATAL=0]="FATAL",Pr[Pr.ERROR=1]="ERROR",Pr[Pr.WARN=2]="WARN",Pr[Pr.INFO=3]="INFO",Pr[Pr.DEBUG=4]="DEBUG";class Dr{constructor(e,t,r,i){Object.defineProperty(this,"_appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_id",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_type",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"proxy",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"outputLevel",{enumerable:!0,configurable:!0,writable:!0,value:exports.LogL.WARN}),Object.defineProperty(this,"debug",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.DEBUG)}),Object.defineProperty(this,"info",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.INFO)}),Object.defineProperty(this,"warn",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.WARN)}),Object.defineProperty(this,"error",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.ERROR)}),Object.defineProperty(this,"__statistics",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.STATISTICS)}),Object.defineProperty(this,"record",{enumerable:!0,configurable:!0,writable:!0,value:this.__statistics})}_write(e){const{tag:t,level:r,content:i,traceId:s}=e;/^[\w-]+$/.test(t)?r!==exports.LogL.DEBUG&&this.proxy.write(e):console.error(`${(new Date).toISOString()}[${this._id}]['ERROR']: ${t} | ${i} | ${s}`)}createTraceId(){return""+ ++Dr._traceIdCount}getSessionId(){return lt}_stdout(e){const{time:t,tag:r,content:i,traceId:s,level:n,loggerId:o}=e;if(!console)return;if(n<=exports.LogL.FATAL)return;if(n>this.outputLevel)return;const a=["error","warn","info","debug"][n-1],l=`${new Date(t).toISOString()}[${null!=o?o:this._id}][${(a||"stat").toUpperCase()}]: ${r} | ${i} | ${s}`;console[a||"warn"](l)}setOutputLevel(e){(e=>[exports.LogL.DEBUG,exports.LogL.INFO,exports.LogL.WARN,exports.LogL.ERROR].some((t=>t===e)))(e)&&(this.outputLevel=e)}_log(e,t,r,i){const s={time:Date.now(),level:e,tag:t,content:r,traceId:i,loggerId:this._id,sessionId:this.getSessionId(),type:this._type};this._stdout(s),this._write(s)}summary(e,t,r,i={},s,n){if(t.isOk){const n=null==s?void 0:s(t.data);this.info(e,JSON.stringify(Object.assign(Object.assign({isOk:!0},i),n)),r)}else{const s=null==n?void 0:n(t.data);this.warn(e,JSON.stringify(Object.assign(Object.assign({code:t.code,msg:t.msg},i),s)),r)}}}Object.defineProperty(Dr,"_traceIdCount",{enumerable:!0,configurable:!0,writable:!0,value:0});class xr{constructor(e,t,r,i,s=!1){Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"deviceInfo",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"disableLogReport",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"userId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"started",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"reportFailedNumber",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"itvByNavi",{enumerable:!0,configurable:!0,writable:!0,value:6}),Object.defineProperty(this,"timesByNavi",{enumerable:!0,configurable:!0,writable:!0,value:5})}_getLogs(e,r,i,s,n,o){return t(this,void 0,void 0,(function*(){let t=[];try{const n=yield this.logDB.read(e,r,i,s,o);ht(n.logs)&&(t=n.logs.filter((e=>!(!e||"object"!=typeof e))))}catch(e){}return{logs:t}}))}checkStart(e,r){return t(this,void 0,void 0,(function*(){if(this.started)return;if(this.userId=e.userId,!e.logSwitch||this.disableLogReport)return;const{policy:t,addrs:i}=Lr.getLogUrlPolicyList(e,this.logger);this.started=!0,this.itvByNavi=t.itv,this.timesByNavi=t.times,i.length>0&&this.realtimeReport(i[0].addr,t.level,t.itv,r)}))}_sendLogs2Realtime(e,r,i,s){return t(this,void 0,void 0,(function*(){const{success:t,data:o}=yield this.compressLogs(e);if(!t)return{isOk:!1,itv:s};let a=Rt(i)?i:`https://${i}`;a+=`?version=5.44.0-alpha.1&appkey=${this.appkey}&userId=${encodeURIComponent(this.userId)}&deviceId=${this.getDeviceId()}&deviceInfo=${this.deviceInfo}&platform=Web`;const{status:l,data:c}=yield this.send({url:a,body:o,method:"POST"});if(200!==l)return this.reportFailedNumber>this.timesByNavi&&this.itvByNavi<60&&(s+=s),this.reportFailedNumber++,{isOk:!1,itv:s};let d,_;if(this.reportFailedNumber=0,c)try{const e=JSON.parse(c);e.nextTime&&(s=e.nextTime),d=e.level,_=e.logSwitch}catch(e){this.logger.warn(n.L_PARSE_JSON_E,JSON.stringify({error:null==e?void 0:e.stack}),r)}return{isOk:!0,itv:s,level:d,logSwitch:_}}))}realtimeReport(e,r,i,s){return t(this,void 0,void 0,(function*(){const t=Date.now(),n=this.logger.getTimestamp4RealtimeLog()||ct,o=Math.max(t-3e4,n+1),a=this.logger.createTraceId(),{logs:l}=yield this._getLogs(n,o,r,!0,a,s);if(0===l.length);else if(l.length>0){const{itv:t,level:s,logSwitch:n,isOk:o}=yield this._sendLogs2Realtime(l,a,e,i);if(o){const e=Math.max(...l.map((e=>e.time)));this.logger.setTimestamp4RealtimeLog(e+1),0===n&&(this.started=!1),void 0!==s&&(r=s)}i=t}this.started&&(i>=60&&this.itvByNavi<60&&(i=60),this.timer=setTimeout((()=>this.realtimeReport(e,r,i,s)),1e3*i))}))}report(e,r,i,s,o,a,l=!1){return t(this,void 0,void 0,(function*(){if("web"!==i.toLowerCase()||this.disableLogReport)return;const t=this.logger.createTraceId();this.logger.info(n.L_REPORT_FULL_LOG_T,JSON.stringify({startTime:e,endTime:r,logId:o,messageUId:a,isCloudControl:l}),t);const{logs:c}=yield this._getLogs(e,r,exports.LogL.DEBUG,!1,t);this.logger.info(n.L_REPORT_FULL_LOG_O,JSON.stringify({count:c.length}),t);let d,_=Rt(s)?s:`https://${s}`;if(_+=`?version=5.44.0-alpha.1&appkey=${this.appkey}&userId=${encodeURIComponent(this.userId)}&deviceId=${this.getDeviceId()}&deviceInfo=${this.deviceInfo}&platform=Web&logId=${o}`,c.length>0){const{success:e,data:t}=yield this.compressLogs(c);d=e?t:"compress failed"}else d="no data or no database";this.logger.debug(n.L_REPORT_FULL_LOG_O,"compress done",t),l&&(_+="&source=cloud");const{status:u}=yield this.send({url:_,body:d,method:"POST"});this.logger.info(n.L_REPORT_FULL_LOG_R,JSON.stringify({status:u}),t)}))}stop(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.started=!1}}const wr=e=>{const{sessionId:t,level:r,loggerId:i,traceId:s,time:n,tag:o,type:a}=e;let{content:l}=e;dt(l)||(l=JSON.stringify(l));let c=r<0?l||"":JSON.stringify({content:l,traceId:s,from:i});return c=`"${c.replace(/"/g,'""')}"`,`${t},${n},${a},${r},${o},${c}\n`};function Gr(e){try{return!(!e||"object"!=typeof e)&&("number"==typeof e.time&&("string"==typeof e.tag&&("string"==typeof e.sessionId&&("string"==typeof e.type&&"number"==typeof e.level))))}catch(e){return!1}}var Vr,kr,Fr,Br,Hr,jr,Yr,Wr;function Jr(){return t(this,void 0,void 0,(function*(){return{logs:[]}}))}function qr(){}class Kr{constructor(e,t){Vr.set(this,void 0),kr.set(this,void 0),i(this,Vr,e,"f"),i(this,kr,t,"f")}read(e,i,s,n,o){return t(this,void 0,void 0,(function*(){try{const t=yield r(this,Vr,"f").call(this,e,i,s,n,o);if(!t||!Array.isArray(t.logs))return{logs:[]};return{logs:t.logs.filter(Gr)}}catch(e){return console.error("[LogDBProxy] read error",e),{logs:[]}}}))}write(e){try{r(this,kr,"f").call(this,e)}catch(e){console.error("[LogDBProxy] write error",e)}}setLogReader(e){return"function"==typeof e&&i(this,Vr,e,"f"),this}setLogWriter(e){return"function"==typeof e&&i(this,kr,e,"f"),this}}function Qr(){return new Kr(Jr,qr)}Vr=new WeakMap,kr=new WeakMap;class Xr{static start(e){r(this,Fr,"f",Br)||(i(this,Fr,e,"f",Br),e.info(n.L_EVENT_LOOP_BLOCKING_S,"start"),r(this,Fr,"m",Wr).call(this))}static stop(){r(this,Fr,"f",Br)&&(r(this,Fr,"f",Br).info(n.L_EVENT_LOOP_BLOCKING_S,"stop"),i(this,Fr,null,"f",Br),r(this,Fr,"f",Hr)&&(clearTimeout(r(this,Fr,"f",Hr)),i(this,Fr,null,"f",Hr)))}}Fr=Xr,Wr=function e(){const t=Date.now();i(this,Fr,setTimeout((()=>{const i=Date.now()-t;i>=r(this,Fr,"f",Yr)&&r(this,Fr,"f",Br).warn(n.L_EVENT_LOOP_BLOCKING_S,`delta time: ${i}ms`),r(this,Fr,"m",e).call(this)}),r(this,Fr,"f",jr)),"f",Hr)},Br={value:null},Hr={value:null},jr={value:30},Yr={value:1500};const zr=1,Zr=2,$r=3;class ei{constructor(e){Object.defineProperty(this,"reporter",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"uploadTask",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"taskLock",{enumerable:!0,configurable:!0,writable:!0,value:!0})}uploadLogCmdTask(e){this.uploadTask.push(e),this.enqueueTask()}reportLogCmdTask(e){var t,r,i,s;this.taskLock=!1;const n=null!==(t=e.startTime)&&void 0!==t?t:0,o=null!==(r=e.endTime)&&void 0!==r?r:0,a=null!==(i=e.platform)&&void 0!==i?i:"",l=null!==(s=e.uri)&&void 0!==s?s:"";e.logId!==this.logId&&""!==l&&(this.logId=e.logId,this.reporter.report(n,o,a,l,e.logId,"",!0).finally((()=>{this.taskLock=!0,this.uploadTask.length>0&&this.enqueueTask()})))}enqueueTask(){if(!this.taskLock)return;const e=this.uploadTask.shift();e&&this.reportLogCmdTask(e)}}class ti{constructor(e,t,r){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"reporter",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"isEable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"expire",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"interval",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"lastRequestTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"uploadTaskManage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"changeAreaCode",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_cache",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.uploadTaskManage=new ei(r)}init(){try{const e=this.getLocalCloudControllerCache();this._cache=e?JSON.parse(e):{timestamp:0,lastRequestTime:0,cc:{temporary:!1,enable:!0,expire:72e5,interval:6e5},uploadLog:{temporary:!0,tasks:[]},mrtr:{chatroom:0,group:0,private:0,ultraGroup:0,temporary:!1}}}catch(e){this._cache={timestamp:0,lastRequestTime:0,cc:{temporary:!1,enable:!0,expire:72e5,interval:6e5},uploadLog:{temporary:!0,tasks:[]},mrtr:{chatroom:0,group:0,private:0,ultraGroup:0,temporary:!1}}}this._cache&&(this.interval=this._cache.cc.interval,this.expire=this._cache.cc.expire,this.timestamp=this._cache.timestamp||0,this.isEable=this._cache.cc.enable,this.lastRequestTime=this._cache.lastRequestTime,this.logCmdMsgTasks(this._cache),this.setMRTRConfig(this._handleMrtrData(this._cache.mrtr)))}isExire(){return(new Date).getTime()-this.timestamp<this.expire}isOverclock(){return(new Date).getTime()-this.lastRequestTime<this.interval}logCmdMsgTasks(e){if(e.uploadLog){const{tasks:t}=e.uploadLog;t.forEach((e=>{e.objectName===Q.LOG_COMMAND&&this.uploadTaskManage.uploadLogCmdTask(e)}))}}dataHandle(e){const t=this._cache;t.lastRequestTime=this.lastRequestTime,ft(e)&&(t.timestamp=e.timestamp,e.uploadLog&&!e.uploadLog.temporary&&(t.uploadLog=e.uploadLog),e.cc&&!e.cc.temporary&&(t.cc=e.cc),e.mrtr&&!e.mrtr.temporary&&(t.mrtr=this._handleMrtrData(e.mrtr)),e.mrtr&&this.setMRTRConfig(this._handleMrtrData(e.mrtr))),this.setCloudControllerCache(t),this.expire=t.cc.expire,this.interval=t.cc.interval,this.timestamp=t.timestamp,this.logCmdMsgTasks(e)}request(e,r,i){return t(this,void 0,void 0,(function*(){if(!this.isEable&&r===zr&&this.isExire())return this.logger.info(n.L_CLOUD_DISABLED,JSON.stringify({msg:"cloud controller is disabled"})),this.timestamp;if(!this.isEable&&r===Zr&&this.isOverclock())return this.logger.info(n.L_CLOUD_OVERCLOCK,JSON.stringify({msg:"cloud controller is overclock"})),this.timestamp;const t=qt(e);this.lastRequestTime=(new Date).getTime();const s=`${t}/v1/config`,o={"Content-Type":"application/json","RC-App-Key":this.appkey};i&&(o["RC-Token"]=i);const a={platform:"web",version:"5.44.0-alpha.1",timestamp:this.timestamp};this.logger.record(Ee.L_CLOUD_INFO_FETCH_T,JSON.stringify({appKey:this.appkey,timestamp:this.timestamp,token:!!i,uri:s}));const{code:l,data:c}=yield this.httpRequest(s,exports.HttpMethod.POST,o,a);if(this.logger.record(Ee.L_CLOUD_INFO_FETCH_R,JSON.stringify({appkey:this.appkey,info:c})),l===exports.ErrorCode.CLOUD_DATA_CENTER_INVALID&&c&&c.targetRegion){const e=c.targetRegion;if(this.changeAreaCode===e)return this.timestamp;const t=Lr.setAreaCode(e);this.logger.info(n.L_CLOUD_SET_AREA_CODE_O,JSON.stringify({isChangeSuccess:t,originAreaCode:Lr.getAreaCode(),newAreaCode:e})),this.changeAreaCode=e;const r=Lr.getCloudControllerUrl(e);return r[0]?this.request(r[0],$r):(this.logger.info(n.L_CLOUD_APPKEY_REGION_E,JSON.stringify({appkey:this.appkey,uri:s,msg:"appkey region error"})),this.timestamp)}return c&&this.dataHandle(c),this.timestamp||this.lastRequestTime}))}_handleMrtrData(e){return{chatroom:(null==e?void 0:e.chatroom)||0,group:(null==e?void 0:e.group)||0,private:(null==e?void 0:e.private)||0,ultraGroup:(null==e?void 0:e.ultraGroup)||0,temporary:!!(null==e?void 0:e.temporary)}}}var ri,ii,si,ni;const oi=e=>e===exports.ErrorCode.RC_CONN_REDIRECTED;class ai extends $t{constructor(e,t,r){super(),ri.add(this),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"navi",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"_fromSuspend",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"token",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"curCmpUrl",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"retryCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"uuid",{enumerable:!0,configurable:!0,writable:!0,value:""}),ni.set(this,0),Object.defineProperty(this,"_doConnectReason",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_network",{enumerable:!0,configurable:!0,writable:!0,value:{status:!0,type:Pe.UNKONWN}}),Object.defineProperty(this,"_checkAliveTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_crtConnectionStatus",{enumerable:!0,configurable:!0,writable:!0,value:exports.RCConnectionStatus.DISCONNECTED}),Object.defineProperty(this,"_crtUserId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_openCallPlus",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"cmpWeightCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_crtConnectionTask",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"reconnectTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_failedCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"ALLOW_FAILED_TIMES",{enumerable:!0,configurable:!0,writable:!0,value:2})}getToken(){return this.token}get cid(){return`${this.uuid}_${this.retryCount}`}getCurrentUserId(){return this._crtUserId}setConnectionStatus(e,t){if(this._crtConnectionStatus!==e){if(this._crtConnectionStatus===exports.RCConnectionStatus.DISCONNECTED&&e===exports.RCConnectionStatus.CONNECTING&&(this._doConnectReason=ve.CONNECT,r(this,ri,"m",si).call(this)),this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTED&&e===exports.RCConnectionStatus.SUSPENDED&&(t===exports.ErrorCode.RC_PING_EXCEED_LIMIT?this._doConnectReason=ve.TIMEOUT:t===exports.ErrorCode.RC_CONN_REDIRECTED?this._doConnectReason=ve.REDIRECTED:this._doConnectReason=ve.RECONNECT),this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTED){const i={bid:Wt(),cod:t,net:this.getNetwork().type,dur:Date.now()-r(this,ni,"f"),cid:this.cid};this.logger.record(Ee.IM_CONNECTION_DURATION,JSON.stringify(i)),e===exports.RCConnectionStatus.SUSPENDED&&r(this,ri,"m",si).call(this)}switch(this._crtConnectionStatus=e,e){case exports.RCConnectionStatus.CONNECTED:this.logger.info(n.L_CONNECT_S,`status: ${e}`),this.checkAlive(),r(this,ri,"m",ii).call(this).emit("onConnected",this._fromSuspend);break;case exports.RCConnectionStatus.CONNECTING:this.logger.warn(n.L_CONNECT_S,`status: ${e}`),r(this,ri,"m",ii).call(this).emit("onConnecting");break;case exports.RCConnectionStatus.SUSPENDED:this._fromSuspend=!0,this.logger.warn(n.L_CONNECT_S,`status: ${e}, code: ${t}`),oi(t)&&this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),r(this,ri,"m",ii).call(this).emit("onSuspend",t);break;default:this._fromSuspend=!1,this._crtUserId="",this.logger.warn(n.L_CONNECT_S,`status: ${e}, code: ${t}`),this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),r(this,ri,"m",ii).call(this).emit("onDisconnected",t)}}}getConnectionStatus(){return this._crtConnectionStatus}get isConnected(){return this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTED}setNetwork(e,t){if(!t){const t={cid:this.cid,cn:e.type,on:this._network.type};this.logger.record(Ee.IM_NETWORK_CHANGE,JSON.stringify(t))}this._network=e}getNetwork(){return this._network}connect(e,r,i,s){return t(this,void 0,void 0,(function*(){if(this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTED)return ir(this._crtUserId);if(this._crtConnectionTask)return this._crtConnectionTask;this._openCallPlus=i,this.token=e,this.setConnectionStatus(exports.RCConnectionStatus.CONNECTING);const{code:t,data:n}=yield this.try2Connect(e,r,!1,s,!0);return t!==exports.ErrorCode.SUCCESS?(this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,t),sr(t)):(this.setConnectionStatus(exports.RCConnectionStatus.CONNECTED),ir(n))}))}try2Connect(e,r,i,s,n){return t(this,void 0,void 0,(function*(){if(this._crtConnectionTask)return this._crtConnectionTask;this._crtConnectionTask=this.createConnectionTask(e,r,i,s,n);const t=yield this._crtConnectionTask;return this._crtConnectionTask=null,t}))}createConnectionTask(e,r,s,o,a){return t(this,void 0,void 0,(function*(){const t={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(t));const l={retryCount:this.retryCount,uuid:this.uuid,type:this.getNetwork().type,reason:this._doConnectReason},{code:c,data:d}=yield this.navi.request(e,s,!1,o,l);if(c!==exports.ErrorCode.SUCCESS)return sr(c);const _=d;if(1===_.type)return sr(exports.ErrorCode.PACKAGE_ENVIRONMENT_ERROR);this.logger.info(n.L_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:r}),o);const{code:u,data:h}=yield this._connectWithToken(e.replace(/@.+$/,"@"),_,r,o);if(a||u===exports.ErrorCode.SUCCESS||(this.retryCount+=1),oi(u))return this.logger.warn(n.L_CONNECT_R,`redirect code: ${u}`,o),this.clearCmpWeightCache(),this.createConnectionTask(e,r,!0,o,a);if([exports.ErrorCode.RC_TCP_RESET,exports.ErrorCode.RC_CONN_ACK_TIMEOUT,exports.ErrorCode.RC_TCP_DISCONNECTED_NO_RMTP,exports.ErrorCode.CONNECTION_REFUSED].includes(u)&&this.cmpWeightCache&&this.cmpWeightCache.length>1){this.updateCmpWeight(this.curCmpUrl,!1);const t=this.cmpWeightCache.every((e=>e.failed));return a&&t?(this.logger.warn(n.L_CONNECT_R,`cpp code:${u},reture code:${exports.ErrorCode.SERVER_UNAVAILABLE}`,o),sr(exports.ErrorCode.SERVER_UNAVAILABLE)):(this.logger.warn(n.L_CONNECT_R,`cmp ack timeout, code: ${u}`,o),this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,u),this.setConnectionStatus(exports.RCConnectionStatus.CONNECTING),this.createConnectionTask(e,r,!1,o,a))}return u!==exports.ErrorCode.SUCCESS?(this.logger.warn(n.L_CONNECT_R,`code: ${u}`,o),sr(u)):(this.logger.info(n.L_CONNECT_R,`userId: ${h}`,o),i(this,ni,Date.now(),"f"),this._crtUserId=h,ir(h))}))}try2Reconnect(e,r){return t(this,void 0,void 0,(function*(){const i=this.logger.createTraceId();this.logger.debug(n.T,`try2Reconnect -> ignoreNaviCache: ${e}, reason: ${r}`,i),this.stopReconnectTimer();const s=()=>t(this,void 0,void 0,(function*(){if(this._crtConnectionStatus!==exports.RCConnectionStatus.SUSPENDED)return;this.setConnectionStatus(exports.RCConnectionStatus.CONNECTING,r);const{code:t,isOk:n}=yield this.try2Connect(this.token,!0,e,i,!1);this.reconnectTimer=null,n?this.setConnectionStatus(exports.RCConnectionStatus.CONNECTED):[exports.ErrorCode.SERVER_UNAVAILABLE,exports.ErrorCode.TIMEOUT,exports.ErrorCode.RC_SOCKET_DISCONNECTED,exports.ErrorCode.RC_SOCKET_NOT_CREATED,exports.ErrorCode.RC_CONN_ACK_TIMEOUT,exports.ErrorCode.RC_TCP_RESET,exports.ErrorCode.RC_NAVI_REQ_FAILED,exports.ErrorCode.RC_NETWORK_DOWN,exports.ErrorCode.RC_TCP_DISCONNECTED_NO_RMTP].includes(t)?this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTING&&(this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,t),this.reconnectTimer=setTimeout(s,5e3)):this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,t)}));s()}))}onDisconnectByServer(e,t){return oi(e)?(this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,e),void this.try2Reconnect(!0,e)):e===exports.ErrorCode.RC_UDP_DISCONNECTED?(this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,e),void setTimeout((()=>{this.try2Reconnect(!0,e)}),1e3*(t||0))):void this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,e)}onDisconenctUnusual(e){this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,e),this.try2Reconnect(!1,e)}checkAlive(){return t(this,void 0,void 0,(function*(){if(this._crtConnectionStatus!==exports.RCConnectionStatus.CONNECTED)return this._failedCount=0,void this.logger.debug(n.L_CHECK_ALIVE_IM_S,"stop ping because of no connection");const e=this.logger.createTraceId();this.logger.debug(n.L_CHECK_ALIVE_IM_T,null,e);const t=yield this.sendPing(15e3);if(t===exports.ErrorCode.SUCCESS)return this.logger.debug(n.L_CHECK_ALIVE_IM_R,t,e),this._failedCount=0,void(this._checkAliveTimer=setTimeout((()=>this.checkAlive()),15e3));if(this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTED){if(this._failedCount+=1,this.logger.debug(n.L_CHECK_ALIVE_IM_R,`code: ${t}, count: ${this._failedCount}`,e),this._failedCount<this.ALLOW_FAILED_TIMES)return this.checkAlive();this._failedCount=0,this.logger.warn(n.L_CHECK_ALIVE_IM_S,"ping timeout, close connection to reconnect!"),yield this.close(!0),this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,exports.ErrorCode.RC_PING_EXCEED_LIMIT),this.try2Reconnect(!1,exports.ErrorCode.RC_PING_EXCEED_LIMIT)}}))}disconnect(e,r){return t(this,void 0,void 0,(function*(){return this.stopReconnectTimer(),this._crtConnectionTask&&(yield this._crtConnectionTask),this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,exports.ErrorCode.ACTIVE_DISCONNECT),this.close(!1,e,r)}))}stopReconnectTimer(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}getCmpList(e,t){if(this.cmpWeightCache&&this.cmpWeightCache.length>0)return[...this.cmpWeightCache];const r=bt(e,t);return this.cmpWeightCache=[...r],[...r]}updateCmpWeight(e,t,r){if(!this.cmpWeightCache)return;const i=this.cmpWeightCache.find((t=>r?t.addr===e&&t.protocol===J.QUIC:t.addr===e));if(i)if(t){const e=Math.max(...this.cmpWeightCache.map((e=>e.weight)));i.weight!==e&&(i.weight=e+1)}else{const e=Math.min(...this.cmpWeightCache.map((e=>e.weight)));i.weight!==e&&(i.weight=e-1),i.failed=!0}}clearCmpWeightCache(){this.cmpWeightCache=void 0}reconnect(e,t,r,i){this.token=e,this._openCallPlus=r,this.onDisconenctUnusual(i)}}ni=new WeakMap,ri=new WeakSet,ii=function(){return this},si=function(){this.uuid=at.gen(),this.retryCount=0};const li=e=>e.replace(/@.+$/,"@");class ci{constructor(e,t,r,i=!0,s=!0,n=!1){Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"staticConfigManager",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"isRequestProfile",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"isUseDynamicNaviUrl",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"useNaviV2",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"crtRequest",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_environment",{enumerable:!0,configurable:!0,writable:!0,value:"default"})}getCatchKey(e){return e+(this._environment?`-${this._environment}`:"")}request(e,r,i,s,n){return t(this,void 0,void 0,(function*(){if(this.crtRequest)return this.crtRequest;this.crtRequest=this.sendRequest(e,r,i,s,n);const t=yield this.crtRequest;return this.crtRequest=null,t}))}sendRequest(e,r,i,s,o){var a;return t(this,void 0,void 0,(function*(){const t=li(e),l=this.getNaviCache(t);if(!r&&l){const{timestamp:e,naviInfo:t}=l;if(i||Date.now()-e<xe){if(this.logger.info(n.L_REQUEST_T,JSON.stringify({fromCache:!0,naviInfo:t}),s),o){const{uuid:e,retryCount:r,reason:i}=o,n={bid:Wt(),ptc:fe.NAVI,cod:exports.ErrorCode.SUCCESS,net:o.type,dur:0,spr:0,pr:null!==(a=t.type)&&void 0!==a?a:0,hos:"",cache:Ae.LOCAL,v:me.CURRENT,rsn:i,cid:`${e}_${r}`,count:r};this.logger.record(Ee.IM_NAVI,JSON.stringify(n),s)}return ir(t)}}const c=Lr.getNaviUrlList(e,this.isUseDynamicNaviUrl);this.logger.info(n.L_GET_NAVI_T,JSON.stringify({token:e,uris:c}),s);let{code:d,data:_}=yield this.requestHandler(c,e,s,o);if(d===exports.ErrorCode.RC_NAVI_REQ_FAILED&&this.isRequestProfile){const t=yield this.staticConfigManager.getStaticConfig();if((null==t?void 0:t.navi)&&(null==t?void 0:t.navi.length)>0){const{navi:r}=t,i=yield this.requestHandler(r,e,s,o);d=i.code,_=i.data}}if(d!==exports.ErrorCode.SUCCESS)return this.logger.warn(n.L_GET_NAVI_R,d,s),sr(d);const u=_;if(u.code&&200!==u.code)return this.logger.warn(n.L_GET_NAVI_R,u.code,s),sr(this.transHttpCode(u.code));if(!(bt(u).length>0)){const e={server:u.server,backupServer:u.backupServer,serverAddr:u.serverAddr,bs:u.bs};return this.logger.warn(n.L_GET_NAVI_R,`navi server address invalid: ${JSON.stringify(e)}`,s),sr(exports.ErrorCode.SERVER_UNAVAILABLE)}return this.logger.info(n.L_GET_NAVI_R,JSON.stringify({naviInfo:u}),s),this.setNaviCache(t,u),ir(u)}))}requestHandler(e,r,i,s){return t(this,void 0,void 0,(function*(){for(let t=0,n=e.length;t<n;t+=1){const n=t===e.length-1,o=this.useV2Navi()?this.httpRequestV2:this.httpRequest,a=Date.now(),{code:l,data:c}=yield o.call(this,e[t],this.appkey,r,i,n),d={bid:Wt(),ptc:fe.NAVI,cod:l,net:null==s?void 0:s.type,dur:Date.now()-a,spr:0,pr:(null==c?void 0:c.type)||0,hos:e[t],cache:Ae.REQUEST,v:me.CURRENT,rsn:null==s?void 0:s.reason,cid:`${null==s?void 0:s.uuid}_${null==s?void 0:s.retryCount}`,count:null==s?void 0:s.retryCount};if(this.logger.record(Ee.IM_NAVI,JSON.stringify(d),i),[exports.ErrorCode.SUCCESS,exports.ErrorCode.RC_CONN_TOKEN_INCORRECT,exports.ErrorCode.RC_LICENSE_EXPIRED].includes(l))return l===exports.ErrorCode.SUCCESS?ir(c):sr(l)}return sr(exports.ErrorCode.RC_NAVI_REQ_FAILED)}))}transHttpCode(e){switch(e){case 401:case 403:return exports.ErrorCode.RC_CONN_TOKEN_INCORRECT;case 416:return exports.ErrorCode.RC_LICENSE_EXPIRED;default:return exports.ErrorCode.RC_NAVI_REQ_FAILED}}getNaviInfoFromCache(e){const t=this.getNaviCache(li(e));return t?t.naviInfo:null}updateVoipCallInfo(e,t){const r=this.getNaviInfoFromCache(e);r&&this.setNaviCache(li(e),Object.assign(Object.assign({},r),{voipCallInfo:t}))}getNaviV2RequestOption(e){const{uri:t,token:r,platform:i,protocol:s,mac:n}=e;let o="";o=`${t}/v2/navi.json?cloud=0`;let a=`token=${encodeURIComponent(r)}&v=${Ve}&platfrom=${i}`;return n&&(a+=`&m=${n}`),{method:"POST",headers:{"RC-Appkey":this.appkey,"Content-Type":"Application/x-www-form-urlencoded","RC-Negotiate":`conn=${s};rtc=4;log=2;iptype=v4,v6`},body:a,url:o,timeout:1e4}}useV2Navi(){return!0}}const di=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}],[Q.INFORMATION_NOTIFICATION,{isCounted:!1,isPersited:!0}],["RC:ContactNtf",{isCounted:!1,isPersited:!0}],["RC:ProfileNtf",{isCounted:!1,isPersited:!0}],[Q.COMMAND_NOTIFICATION,{isCounted:!1,isPersited:!0}],[Q.GROUP_NOTIFICATION,{isCounted:!1,isPersited:!0}],["RC:RcNtf",{isCounted:!1,isPersited:!0}],[Q.COMMAND,{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 _i(e){return di.get(e)}function ui(e){return di.has(e)}const hi={MECHANICAL:0,INTELLIGENT:1};class Ei{constructor(e,t,r,i){Object.defineProperty(this,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sourceLanguage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"targetLanguage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.identifier=e,this.sourceLanguage=t||"auto",this.targetLanguage=r,this.text=i}isValid(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)}toInnerParam(){return{identifier:this.identifier,sourceLanguage:this.sourceLanguage,targetLanguage:this.targetLanguage,content:this.text}}}class gi extends Ei{constructor(e,t,r,i){super(e,t,r,i)}}class Ii extends Ei{constructor(e,t,r){super(mr(e),t,r,e)}}const pi={NONE:0,TRANSLATING:1,SUCCESS:2,FAILED:3},Ti={DEFAULT:0,AUTO_ON:1,AUTO_OFF:2};class Ri{static enable(){return!0}}const fi=48,Ai=64,mi=80,Si=96,vi=112,Ci="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",yi=e=>{const t={};for(let r=0;r<e.length-1;r++){const i=e.charAt(r)+e.charAt(r+1);t.hasOwnProperty(i)?t[i].push(r):t[i]=[r]}const r=[];let i=[];const s=function(){if(i.length>0){const e=i.join("");if(i=[],e.length>26){const t=Ni(e.length),i=String.fromCharCode(mi|t.length);r.push(i+t)}else{const t=String.fromCharCode(Si|e.length);r.push(t)}r.push(e)}};let n=0;for(;n<e.length;){const o=Oi(t,e,n);if(o.length<2){i.push(e.charAt(n++));continue}if(o.length<4){i.push(e.substr(n,o.length)),n+=o.length;continue}const a=Ni(n-o.offset),l=Ni(o.length);if(a.length+l.length>=o.length){i.push(e.substr(n,o.length)),n+=o.length;continue}s();const c=String.fromCharCode(Ai|a.length<<2|l.length);r.push(c+a+l),n+=o.length}s();const o=Ni(e.length),a=String.fromCharCode(fi|o.length);return r.push(a+o),r.join("")},Oi=(e,t,r)=>{const i={length:0,offset:-1};if(t.length,r>=t.length-1)return i;const s=e[t.charAt(r)+t.charAt(r+1)];if(s[0]===r)return i;const n=t.length-r;for(let e=0,o=s.length;e<o;e++){const o=s[e],a=r-o;if(a>238327)continue;const l=Math.min(n,a);if(l<=i.length)break;if(i.length>2&&t.charAt(o+i.length-1)!==t.charAt(r+i.length-1))continue;let c=2;for(let e=c;e<l&&t.charAt(o+e)===t.charAt(r+e);e++)c++;c>=i.length&&(i.length=c,i.offset=o)}return i},Ni=e=>{const t=[];let r=0;do{r=e%62,t.push(Ci.charAt(r)),e=(e-r)/62}while(e>0);return t.join("")},Mi=e=>{let t=0,r=0;for(let i=e.length-1;i>=0;i--){if(r=Ci.indexOf(e.charAt(i)),-1===r)throw new Error('decode number error, data is "'+e+'"');t=62*t+r}return t},bi=()=>!("undefined"==typeof uni||!(e=>{const t=["request","getSystemInfo"];for(let r=0,i=t.length;r<i;r++)if(!e[t[r]])return!1;return!0})(uni)),Li=e=>(["setItem","getItem","removeItem"].forEach((t=>{const r=e[t];e[t]=(...t)=>{try{return r.apply(e,t)}catch(e){null===console||void 0===console||console.error(e)}}})),e);var Ui,Pi,Di;class xi{constructor(e){Ui.add(this),Pi.set(this,void 0),Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),i(this,Pi,e,"f"),this._logger=e.logger}open(e){return t(this,void 0,void 0,(function*(){return e=e.sort(((e,t)=>t.weight-e.weight)),r(this,Ui,"m",Di).call(this,e,r(this,Pi,"f"))}))}}Pi=new WeakMap,Ui=new WeakSet,Di=function e(i,s){return t(this,void 0,void 0,(function*(){if(0===i.length)return sr(exports.ErrorCode.STREAM_MESSAGE_REQUEST_FAIL,"All addrs failed");const o=i.shift();let a=qt(o.addr,o.protocol);a=`${a}/v3/message/get_stream.json?sdkVersion=5.44.0-alpha.1&platform=Websocket&messageUID=${s.msgUId}`,this._logger.info(n.L_REQ_STREAM_MSG_CONTENT_O,`try open -> ${a}`);const l=yield this._openHandler(a,s);return l.or((n=>t(this,void 0,void 0,(function*(){return-1===n?r(this,Ui,"m",e).call(this,i,s):l}))))}))};class wi extends xi{_openHandler(e,r){return t(this,void 0,void 0,(function*(){const{resolve:t,promise:i}=lr(),s=new XMLHttpRequest;let o=!1,a=null;const l=e=>{o||(o=!0,a&&(clearTimeout(a),a=null),e.isOk||(this._logger.warn(n.L_REQ_STREAM_MSG_CONTENT_E,`req fail -> code: ${e.code}`),s.abort()),t(e))};return a=setTimeout((()=>l(sr(-1,"timeout"))),r.timeout),s.onerror=e=>l(sr(-1,"network error")),s.onreadystatechange=t=>{if(s.readyState!==XMLHttpRequest.HEADERS_RECEIVED)return;const i=s.getResponseHeader("Content-Type"),o=null==i?void 0:i.startsWith("text/event-stream");if(200!==s.status||!o)return void(s.onloadend=()=>{const e=JSON.parse(s.response);l(sr(e.code,e.message))});l(ir());let a=0;s.onprogress=e=>{const t=s.response.slice(a);a=s.response.length,r.onRawContent(t)},s.onerror=t=>{this._logger.warn(n.L_REQ_STREAM_MSG_CONTENT_E,`network error in transit -> ${e}`),s.onprogress=null,s.abort(),r.onNetworkError(exports.ErrorCode.STREAM_MESSAGE_REQUEST_FAIL)}},s.open("GET",e,!0),s.setRequestHeader("Content-Type","application/json;charset=UTF-8"),s.setRequestHeader("App-Key",r.appkey),s.setRequestHeader("Authorization",`Bearer ${r.token}`),s.send(),i}))}}const Gi=bi();let Vi=null;const ki=e=>t(void 0,void 0,void 0,(function*(){const t=yield Fi.getNetworkType();Vi({status:"online"===e.type,type:t})}));const Fi={tag:"browser",httpReq:e=>Sr(e).result(),get localStorage(){return localStorage},get sessionStorage(){return sessionStorage},useNavi:!0,connectPlatform:"",isFromUniapp:Gi,createWebSocket:function(e,t){const r=new WebSocket(e,t);return r.binaryType="arraybuffer",Promise.resolve(ir({id:Date.now(),onClose(e){r.onclose=t=>{const{code:r,reason:i}=t;e(r,i)}},onError(e){r.onerror=e},onMessage(e){r.onmessage=t=>{e(t.data)}},onOpen(e){r.onopen=e},send(e){r.send(e)},close(e,t){r.close()}}))},getNetworkType(){const{type:e,effectiveType:t}=navigator.connection||navigator.mozConnection||navigator.webkitConnection||{effectiveType:Pe.UNKONWN},r=e||t||Pe.UNKONWN;return Promise.resolve(r)},setNetworkStatusListener:function(e){Vi=e,"undefined"!=typeof window&&window&&(window.addEventListener("offline",ki),window.addEventListener("online",ki))},removeNetworkStatusListener:function(){"undefined"!=typeof window&&window&&(window.removeEventListener("offline",ki),window.removeEventListener("online",ki)),Vi=null},createSSEClient:e=>ir(new wi(e)),getApiVer:()=>{const{type:e,version:t}=Fi.runtimeInfo;return`browser|${e}|${t}`},get runtimeInfo(){const{userAgent:e}=navigator;let t,r;const i={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(const s in i){if(!i.hasOwnProperty(s))continue;let n=e.match(i[s]);if(n){r=s,t=n[1]||n[2];break}}return{type:r||"Unknown",version:t||"Unknown"}}};var Bi;!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.qryRLBatch=31]="qryRLBatch",e[e.chatMsgS=32]="chatMsgS",e[e.qrySessionsAtt=33]="qrySessionsAtt",e[e.pullMsg=34]="pullMsg",e[e.qrySessions=35]="qrySessions",e[e.delSessions=36]="delSessions",e[e.delMsg=37]="delMsg",e[e.delUgMsg=38]="delUgMsg",e[e.delUgSe=39]="delUgSe",e[e.updRRTime=40]="updRRTime",e[e.qrySessionsUnread=41]="qrySessionsUnread",e[e.setTypeUnpush=42]="setTypeUnpush",e[e.chrmPull=43]="chrmPull",e[e.joinChrm=44]="joinChrm",e[e.joinChrmR=45]="joinChrmR",e[e.exitChrm=46]="exitChrm",e[e.queryChrmI=47]="queryChrmI",e[e.setKV=48]="setKV",e[e.delKV=49]="delKV",e[e.setKVS=50]="setKVS",e[e.delKVS=51]="delKVS",e[e.pullKV=52]="pullKV",e[e.qryRelation=53]="qryRelation",e[e.qryRelationR=54]="qryRelationR",e[e.qryRelationFilter=55]="qryRelationFilter",e[e.delRelation=56]="delRelation",e[e.delRelationBatch=57]="delRelationBatch",e[e.pullSe=58]="pullSe",e[e.pullSeAtts=59]="pullSeAtts",e[e.setSeAtt=60]="setSeAtt",e[e.qnTkn=61]="qnTkn",e[e.qnUrl=62]="qnUrl",e[e.aliUrl=63]="aliUrl",e[e.s3Url=64]="s3Url",e[e.stcUrl=65]="stcUrl",e[e.minioUrl=66]="minioUrl",e[e.cleanPMsg=67]="cleanPMsg",e[e.cleanGMsg=68]="cleanGMsg",e[e.cleanCMsg=69]="cleanCMsg",e[e.cleanSMsg=70]="cleanSMsg",e[e.cleanMCMsg=71]="cleanMCMsg",e[e.cleanMPMsg=72]="cleanMPMsg",e[e.cleanMsgBatch=73]="cleanMsgBatch",e[e.rtcPing=74]="rtcPing",e[e.rtc_ntf=75]="rtc_ntf",e[e.rtcSetOutData=76]="rtcSetOutData",e[e.rtcQryUserOutData=77]="rtcQryUserOutData",e[e.addSeTag=78]="addSeTag",e[e.delSeTag=79]="delSeTag",e[e.addTag=80]="addTag",e[e.delTag=81]="delTag",e[e.reportsdk=82]="reportsdk",e[e.pullUgSes=83]="pullUgSes",e[e.pullUgMsg=84]="pullUgMsg",e[e.ugMsg=85]="ugMsg",e[e.qryUgMsg=86]="qryUgMsg",e[e.updUgRTime=87]="updUgRTime",e[e.upMsgEx=88]="upMsgEx",e[e.modifyMsg=89]="modifyMsg",e[e.qryMsgChange=90]="qryMsgChange",e[e.qryMsg=91]="qryMsg",e[e.operate=92]="operate",e[e.s_opNtf=93]="s_opNtf",e[e.ugUnpushQuery=94]="ugUnpushQuery",e[e.ugUnpushSet=95]="ugUnpushSet",e[e.setRtcRoomId=96]="setRtcRoomId",e[e.qryUgUal=97]="qryUgUal",e[e.updUserSub=98]="updUserSub",e[e.pullUserSub=99]="pullUserSub",e[e.pullSubData=100]="pullSubData",e[e.qrySubData=101]="qrySubData",e[e.pullUserProfile=102]="pullUserProfile",e[e.pullOwnProfile=103]="pullOwnProfile",e[e.updProfilePermiss=104]="updProfilePermiss",e[e.qProfilePermiss=105]="qProfilePermiss",e[e.searchUserProfile=106]="searchUserProfile",e[e.updUserProfile=107]="updUserProfile",e[e.pullEventChange=108]="pullEventChange",e[e.channelCreate=109]="channelCreate",e[e.upChannelInfo=110]="upChannelInfo",e[e.qChannelInfo=111]="qChannelInfo",e[e.channelMemKick=112]="channelMemKick",e[e.channelMemQuit=113]="channelMemQuit",e[e.channelDismiss=114]="channelDismiss",e[e.channelTransfer=115]="channelTransfer",e[e.upChannelManager=116]="upChannelManager",e[e.qChannelMem=117]="qChannelMem",e[e.qChannelSpeMem=118]="qChannelSpeMem",e[e.upChannelMem=119]="upChannelMem",e[e.channelMemJoin=120]="channelMemJoin",e[e.channelMemInvite=121]="channelMemInvite",e[e.channelApplyResp=122]="channelApplyResp",e[e.qChannelApplyList=123]="qChannelApplyList",e[e.qChannelMemJoin=124]="qChannelMemJoin",e[e.qChannelMemSpeJoin=125]="qChannelMemSpeJoin",e[e.upChannelRemark=126]="upChannelRemark",e[e.qChannelRemark=127]="qChannelRemark",e[e.upChannelFollow=128]="upChannelFollow",e[e.qChannelFollow=129]="qChannelFollow",e[e.qSimpleUserProfile=130]="qSimpleUserProfile",e[e.friendAdd=131]="friendAdd",e[e.friendDel=132]="friendDel",e[e.friendHandle=133]="friendHandle",e[e.friendSetPf=134]="friendSetPf",e[e.friendCheck=135]="friendCheck",e[e.friendsQuery=136]="friendsQuery",e[e.friendApplyDel=137]="friendApplyDel",e[e.friendsInfoQry=138]="friendsInfoQry",e[e.friendAuthSet=139]="friendAuthSet",e[e.friendAuthGet=140]="friendAuthGet",e[e.addUnpush=141]="addUnpush",e[e.qryUnpush=142]="qryUnpush",e[e.delUnpush=143]="delUnpush",e[e.s_pubCall=144]="s_pubCall",e[e.reqCall=145]="reqCall",e[e.pullKvMsg=146]="pullKvMsg",e[e.readReceipt=147]="readReceipt",e[e.qryReceipt=148]="qryReceipt",e[e.qryReceiptBatch=149]="qryReceiptBatch",e[e.upConvertMsg=150]="upConvertMsg",e[e.pullModifyMsg=151]="pullModifyMsg",e[e.qAppBot=152]="qAppBot",e[e.qBot=153]="qBot",e[e.addPReaction=154]="addPReaction",e[e.rmPReaction=155]="rmPReaction",e[e.addGReaction=156]="addGReaction",e[e.rmGReaction=157]="rmGReaction",e[e.addUgReaction=158]="addUgReaction",e[e.rmUgReaction=159]="rmUgReaction",e[e.mReactBQ=160]="mReactBQ",e[e.ugMReactBQ=161]="ugMReactBQ",e[e.mReactQ=162]="mReactQ",e[e.ugMReactQ=163]="ugMReactQ",e[e.mReactUQ=164]="mReactUQ",e[e.ugMReactUQ=165]="ugMReactUQ"}(Bi||(Bi={}));const Hi=e=>{const t=Bi[e];return t},ji=e=>Bi[e],Yi=0,Wi=1,Ji=2,qi=3,Ki=4,Qi=5,Xi=6,zi=7,Zi=12,$i=13,es=14,ts=4,rs=3,is="rtcRJoin_data",ss="rtcRExit",ns="rtcUPut",os="rtcUDel",as="rtcSetData",ls="userSetData",cs="rtcQryData",ds="rtcDelData",_s="rtcToken",us="rtcUserState",hs="rtcUList",Es="viewerJoinR",gs="viewerExitR",Is="rtcIdentityChange",ps="rtcInvite",Ts="rtcCancelInvite",Rs="rtcInviteAnswer",fs="rtcEndInvite",As="rtcQueryJoined",ms=0,Ss=1,vs=2,Cs=3,ys=4,Os=5,Ns=6,Ms=7,bs=8,Ls=9,Us=10,Ps=11,Ds=12,xs=13,ws=14,Gs=15,Vs=16,Fs=17,Bs=18,Hs=19,js=20,Ys=1,Ws=2,Js=4,qs=5,Ks=6,Qs=7,Xs=8,zs=9;class Zs{static writeUTF(e){let{back:t,byteSize:r}=this._getBackAndByteSize(e);for(let e=0,r=t.length;e<r;e++)t[e]>255&&(t[e]&=255);return r<=255?[0,r].concat(t):[r>>8,255&r].concat(t)}static _getBackAndByteSize(e){const t=[];let r=0;if("string"==typeof e)for(let i=0,s=e.length;i<s;i++){const s=e.charCodeAt(i);s>=0&&s<=127?(r+=1,t.push(s)):s>=128&&s<=2047?(r+=2,t.push(192|31&s>>6),t.push(128|63&s)):s>=2048&&s<=65535&&(r+=3,t.push(224|15&s>>12),t.push(128|63&s>>6),t.push(128|63&s))}return{byteSize:r,back:t}}static readUTF(e){const t=[];let r,i,s=-1;const n=e;let o="";for(;++s<n.length;){let e=Number(n[s]);if(e===(127&e)||(240&~e?224&~e?192&~e||(e^=192,e=e<<6|128^n[++s]):(e^=224,e=e<<6|128^n[++s],e=e<<6|128^n[++s]):(e^=240,e=e<<6|128^n[++s],e=e<<6|128^n[++s],e=e<<6|128^n[++s])),!Number.isFinite(e)||e<0||e>1114111||Math.floor(e)!==e)throw RangeError(`Invalid code point: ${e}`);e<=65535?t.push(e):(e-=65536,r=e>>10|55296,i=e%1024|56320,t.push(r,i)),(s+1===n.length||t.length>16384)&&(o+=String.fromCharCode.apply(null,t),t.length=0)}return o}}class $s{constructor(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}check(){return this._position>=this._pool.length}read2Byte(){const e=this;if(e.check())return-1;let t="";for(let r=0;r<2;r++){let r=e._pool[e._position++].toString(16);1===r.length&&(r=`0${r}`),t+=r.toString()}return parseInt(t,16)}readInt32(){return(this.readByte()<<24)+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()}readLong(){const e=this;if(e.check())return-1;let t="";for(let r=0;r<8;r++){let r=e._pool[e._position++].toString(16);1===r.length&&(r=`0${r}`),t+=r}return parseInt(t,16)}readByte(){if(this.check())return-1;let e=this._pool[this._position++];return e>255&&(e&=255),e}readUTF(){if(this.check())return"";const e=this.readByte()<<8|this.readByte(),t=this._position;this._position+=e;const r=this._pool.subarray(t,this._position);return Zs.readUTF(r)}readAll(){return this._pool.subarray(this._position,this._poolLen)}}class en{constructor(){Object.defineProperty(this,"_pool",{enumerable:!0,configurable:!0,writable:!0,value:[]})}writeByte(e){e>=0&&(e>255&&(e&=255),this._pool.push(e))}writeBuffer(e){this._pool=this._pool.concat([...new Int8Array(e)])}writeArr(e){this._pool=this._pool.concat(e)}writeUTF(e){const t=Zs.writeUTF(e);this._pool=this._pool.concat(t)}getBytesArray(){return this._pool}}class tn{constructor(e,t=Wi,r=!1,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:r}),Object.defineProperty(this,"dup",{enumerable:!0,configurable:!0,writable:!0,value:i})}static parse(e){return new tn(e>>4,(6&e)>>1,!(1&~e),(8&e)>0)}encode(){let e=this.command<<4;return e|=this._retain?1:0,e|=this.qos<<1,e|=this.dup?8:0,e}}class rn{constructor(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})}read(e,t,r){this.readMessage(e,t,r)}readMessage(e,t,r){return{stream:e,length:t}}}class sn{constructor(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 tn(e,Yi)}write(e){const t=this.getHeaderFlag();e.writeByte(t),this.writeMessage(e)}setHeaderQos(e){this._header.qos=e}getHeaderFlag(){return this._header.encode()}getArrayBuffer(){const e=new en;this.write(e);const t=e.getBytesArray();return new Int8Array(t).buffer}}class nn extends rn{constructor(){super(...arguments),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"userId",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"messageId",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"sessionId",{enumerable:!0,configurable:!0,writable:!0,value:""})}readMessage(e,t,r){if(e.readByte(),this.status=e.readByte(),t<=nn.MESSAGE_LENGTH)return{stream:e,length:t};if(r===ts){const t=e.readByte();1&t&&(this.userId=e.readUTF()),2&t&&(this.sessionId=e.readUTF()),4&t&&(this.timestamp=e.readLong()),8&t&&(this.messageId=e.read2Byte())}else this.userId=e.readUTF(),this.sessionId=e.readUTF(),this.timestamp=e.readLong();return{stream:e,length:t}}}Object.defineProperty(nn,"MESSAGE_LENGTH",{enumerable:!0,configurable:!0,writable:!0,value:2});class on extends sn{constructor(e){super(es),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:e})}writeMessage(e){e.writeArr([0,this.status])}}class an extends rn{constructor(){super(...arguments),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}readMessage(e,t){return e.readByte(),this.status=e.readByte(),this.data=e.readAll(),{stream:e,length:t}}}Object.defineProperty(an,"MESSAGE_LENGTH",{enumerable:!0,configurable:!0,writable:!0,value:2});class ln extends sn{constructor(){super(Zi)}writeMessage(e){}}class cn extends rn{constructor(e){super(e)}}class dn extends rn{constructor(){super(...arguments),Object.defineProperty(this,"messageId",{enumerable:!0,configurable:!0,writable:!0,value:0})}readMessage(e,t){const r=256*e.readByte()+e.readByte();return this.messageId=parseInt(r.toString(),10),{stream:e,length:t}}}class _n extends sn{writeMessage(e){const t=this.messageId,r=255&t,i=(65280&t)>>8;e.writeByte(i),e.writeByte(r)}}class un extends dn{constructor(e){super(e),Object.defineProperty(this,"topic",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"pbData",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"targetId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"date",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"syncMsg",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this.syncMsg=e.dup}readMessage(e,t){return this.date=e.readInt32(),this.topic=e.readUTF(),this.targetId=e.readUTF(),super.readMessage(e,t),this.pbData=e.readAll(),{stream:e,length:t}}}class hn extends _n{constructor(e,t,r,i){super(e),Object.defineProperty(this,"targetId",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"pbData",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"topic",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.topic="string"==typeof t?t:ji(t)}writeMessage(e){e.writeUTF(this.topic),e.writeUTF(this.targetId),super.writeMessage(e),e.writeBuffer(this.pbData)}}class En extends hn{constructor(e,t,r){super(Qi,e,r,t)}}class gn extends hn{constructor(e,t,r){super(qi,e,r,t)}}class In extends dn{constructor(){super(...arguments),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"date",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"millisecond",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"messageUId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0})}readMessage(e,t){return super.readMessage(e,t),this.date=e.readInt32(),this.status=256*e.readByte()+e.readByte(),this.millisecond=256*e.readByte()+e.readByte(),this.timestamp=1e3*this.date+this.millisecond,this.messageUId=e.readUTF(),{stream:e,length:t}}}class pn extends _n{constructor(e){super(Ki),this.messageId=e}}class Tn extends _n{constructor(e){super(zi),this.messageId=e}}class Rn extends dn{constructor(){super(...arguments),Object.defineProperty(this,"pbData",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"date",{enumerable:!0,configurable:!0,writable:!0,value:0})}readMessage(e,t){return super.readMessage(e,t),this.date=e.readInt32(),this.status=256*e.readByte()+e.readByte(),this.pbData=e.readAll(),{stream:e,length:t}}}const fn=(e,t)=>{const r=new Uint8Array(e),i=new $s(r),s=i.readByte(),n=(e=>{const{command:t}=e;let r;switch(t){case Ji:r=new nn(e);break;case qi:r=new un(e);break;case Ki:r=new In(e);break;case Xi:r=new Rn(e);break;case $i:r=new cn(e);break;case es:r=new an(e);break;default:console.error(`No support for deserializing ${t} messages`)}return r})(tn.parse(s));return n&&n.read(i,r.length-1,t),n};class An extends xi{_openHandler(e,t){const{resolve:r,promise:i}=lr(),s=this._logger,o=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 ${t.token}`},success(e){var t;if(200===e.statusCode&&(null===(t=e.header["Content-Type"])||void 0===t?void 0:t.startsWith("text/event-stream")))r(ir());else{const{code:t,message:i}=JSON.parse(e.data);r(sr(t,i))}},fail(t){const{errMsg:i,errno:o}=t;s.warn(n.L_REQ_STREAM_MSG_CONTENT_E,JSON.stringify({url:e,errMsg:i,errno:o})),r(sr(-1,t.errMsg))},complete(){s.debug(n.L_REQ_STREAM_MSG_CONTENT_O,`req complete -> ${e}`)}});return o.onChunkReceived((e=>{const r=Zs.readUTF(new Uint8Array(e.data));s.debug(n.L_REQ_STREAM_MSG_CONTENT_O,`chunk received -> ${r}`),t.onRawContent(r)})),i}}const mn=bi(),Sn=Li({setItem(e,t){wx.setStorage({key:e,data:t})},getItem:e=>wx.getStorageSync(e),removeItem(e){wx.removeStorage({key:e})}});let vn=null;const Cn=e=>{const{isConnected:t,networkType:r}=e;vn({status:t,type:r})};const yn={tag:"wechat",httpReq(e){const t=e.method||exports.HttpMethod.GET,r=e.timeout||we,{headers:i,query:s,body:n}=e,o=Vt(e.url,s);return new Promise((e=>{wx.request({url:o,method:t,header:i,timeout:r,data:n,success:t=>{e({data:t.data,status:t.statusCode})},fail:()=>{e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:Sn,sessionStorage:Sn,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:mn,createWebSocket(e,t){const r=wx.connectSocket({url:e,protocols:t});return Promise.resolve(ir({id:Date.now(),onClose(e){r.onClose((t=>{e(t.code,t.reason)}))},onError(e){r.onError((t=>{e(t.errMsg),r.close()}))},onMessage(e){r.onMessage((t=>{e(t.data)}))},onOpen(e){r.onOpen(e)},send(e){r.send({data:e})},close(e,t){r.close({code:e,reason:t})}}))},getNetworkType:()=>new Promise((e=>{wx.getNetworkType({success:({networkType:t})=>{e(t)},fail:()=>{e(Pe.UNKONWN)}})})),setNetworkStatusListener:function(e){vn=e,wx.onNetworkStatusChange(Cn)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(Cn),vn=null},createSSEClient:e=>ir(new An(e)),get runtimeInfo(){return{type:yn.tag,version:"Unknown"}}},On=bi(),Nn=Li({setItem(e,t){my.setStorage({key:e,data:t})},getItem(e){const{data:t}=my.getStorageSync({key:e});return t},removeItem(e){my.removeStorage({key:e})}});let Mn=null;const bn=e=>{const{isConnected:t,networkType:r}=e;Mn({status:t,type:r})};const Ln={tag:"alipay",httpReq(e){const t=e.method||exports.HttpMethod.GET,r=e.timeout||we,{headers:i,query:s,body:n}=e,o=Vt(e.url,s),a=e.dataType||"json";return new Promise((e=>{my.request({url:o,method:t,headers:i,timeout:r,data:n,dataType:a,success:t=>{e({data:t.data,status:t.status})},fail:()=>{e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:Nn,sessionStorage:Nn,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:On,createWebSocket(e){const t=my.connectSocket({url:e,multiple:!0});return Promise.resolve(ir({id:Date.now(),onClose(e){t.onClose(e)},onError(e){t.onError((t=>{e(t.errMsg)}))},onMessage(e){t.onMessage((t=>{t.data.isBuffer?e(my.base64ToArrayBuffer(t.data.data)):e(t.data.data)}))},onOpen(e){t.onOpen(e)},send(e){t.send({data:my.arrayBufferToBase64(e),isBuffer:!0})},close(){t.close()}}))},getNetworkType:()=>new Promise((e=>{my.getNetworkType({success:({networkType:t})=>{e(t)},fail:()=>{e(Pe.UNKONWN)}})})),setNetworkStatusListener:function(e){Mn=e,my.onNetworkStatusChange(bn)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(bn),Mn=null},createSSEClient:e=>sr(exports.ErrorCode.NOT_SUPPORT,"Not supported yet"),get runtimeInfo(){return{type:Ln.tag,version:"Unknown"}}},Un=bi(),Pn=Li({setItem(e,t){tt.setStorage({key:e,data:t})},getItem:e=>tt.getStorageSync(e),removeItem(e){tt.removeStorage({key:e})}});let Dn=null;const xn=e=>{const{isConnected:t,networkType:r}=e;Dn({status:t,type:r})};const wn={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Un,localStorage:Pn,sessionStorage:Pn,httpReq:e=>new Promise((t=>{tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success(e){const r=(null==e?void 0:e.data)||{},i={data:JSON.stringify(r),status:e.statusCode};t(i)},fail(e){t({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})})),createWebSocket:(e,t)=>new Promise((r=>{const i=tt.connectSocket({url:e,protocols:t,fail:e=>r(sr(exports.ErrorCode.RC_SOCKET_DISCONNECTED,e.errMsg))});r(ir({id:Date.now(),onOpen(e){i.onOpen(e)},onClose(e){i.onClose((t=>e(t.code,t.reason)))},onError(e){i.onError((t=>{i.close(),e(t.errMsg)}))},onMessage(e){i.onMessage((t=>e(t.data)))},send(e){i.send({data:e})},close(e,t){i.close({code:e,reason:t})}}))})),getNetworkType:()=>new Promise((e=>{tt.getNetworkType({success:({networkType:t})=>{e(t)},fail:()=>{e(Pe.UNKONWN)}})})),setNetworkStatusListener:function(e){Dn=e,tt.onNetworkStatusChange(xn)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(xn),Dn=null},createSSEClient:e=>sr(exports.ErrorCode.NOT_SUPPORT),get runtimeInfo(){return{type:wn.tag,version:"Unknown"}}},Gn=bi(),Vn=Li({setItem(e,t){swan.setStorage({key:e,data:t})},getItem:e=>swan.getStorageSync(e),removeItem(e){swan.removeStorage({key:e})}});let kn=null;const Fn=e=>{const{isConnected:t,networkType:r}=e;kn({status:t,type:r})};const Bn={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Gn,localStorage:Vn,sessionStorage:Vn,httpReq:e=>new Promise((t=>{swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success(e){const r=(null==e?void 0:e.data)||{},i={data:JSON.stringify(r),status:e.statusCode};t(i)},fail(e){t({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})})),createWebSocket(e,t){const r=swan.connectSocket({url:e,protocols:t});return Promise.resolve(ir({id:Date.now(),onOpen(e){r.onOpen(e)},onClose(e){r.onClose((t=>e(t.code,t.reason)))},onError(e){r.onError((t=>e(t.errMsg)))},onMessage(e){r.onMessage((t=>e(t.data)))},send(e){r.send({data:e})},close(e,t){r.close({code:e,reason:t})}}))},getNetworkType(){return t(this,void 0,void 0,(function*(){return new Promise((e=>{swan.getNetworkType({success:({networkType:t})=>{e(t)},fail:()=>{e(Pe.UNKONWN)}})}))}))},setNetworkStatusListener:function(e){kn=e,swan.onNetworkStatusChange(Fn)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(Fn),kn=null},createSSEClient:e=>sr(exports.ErrorCode.NOT_SUPPORT),get runtimeInfo(){return{type:Bn.tag,version:"Unknown"}}},Hn=bi(),jn=Li({setItem(e,t){jd.setStorage({key:e,data:t})},getItem:e=>jd.getStorageSync(e),removeItem(e){jd.removeStorage({key:e})}});let Yn=null;const Wn=e=>{const{isConnected:t,networkType:r}=e;Yn({status:t,type:r})};const Jn={tag:"jingdong",httpReq(e){const t=e.method||exports.HttpMethod.GET,r=e.timeout||we,{headers:i,query:s,body:n}=e,o=Vt(e.url,s);return new Promise((e=>{jd.request({url:o,method:t,header:i,timeout:r,data:n,success:t=>{e({data:t.data,status:t.statusCode})},fail:()=>{e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:jn,sessionStorage:jn,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Hn,createWebSocket:(e,t)=>(jd.connectSocket({url:e,protocols:t}),Promise.resolve(ir({id:Date.now(),onClose(e){jd.onSocketClose((t=>{e(t.code,t.reason)}))},onError(e){jd.onSocketError((t=>{e(t.errMsg)}))},onMessage(e){jd.onSocketMessage((t=>{e(t.data)}))},onOpen(e){jd.onSocketOpen(e)},send(e){jd.sendSocketMessage({data:e})},close(e,t){jd.closeSocket({code:e,reason:t})}}))),getNetworkType:()=>new Promise((e=>{jd.getNetworkType({success:({networkType:t})=>{e(t)},fail:()=>{e(Pe.UNKONWN)}})})),setNetworkStatusListener:function(e){Yn=e,jd.onNetworkStatusChange(Wn)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(Wn),Yn=null},createSSEClient:e=>sr(exports.ErrorCode.NOT_SUPPORT),get runtimeInfo(){return{type:Jn.tag,version:"Unknown"}}},qn=bi(),Kn=Li({setItem(e,t){ks.setStorage({key:e,data:t})},getItem:e=>ks.getStorageSync(e),removeItem(e){ks.removeStorage({key:e})}});let Qn=null;const Xn=e=>{const{isConnected:t,networkType:r}=e;Qn({status:t,type:r})};const zn={tag:"kuaishou",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:qn,localStorage:Kn,sessionStorage:Kn,httpReq:e=>new Promise((t=>{ks.request({url:e.url,data:e.body,header:e.headers,method:e.method,success(e){const r=(null==e?void 0:e.data)||{},i={data:JSON.stringify(r),status:e.statusCode};t(i)},fail(e){t({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})})),createWebSocket(e,t){const r=ks.connectSocket({url:e,protocols:t});return Promise.resolve(ir({id:Date.now(),onOpen(e){r.onOpen(e)},onClose(e){r.onClose((t=>e(t.code,t.reason)))},onError(e){r.onError((t=>e(t.errMsg)))},onMessage(e){r.onMessage((t=>e(t.data)))},send(e){r.send({data:e})},close(e,t){r.close({code:e,reason:t})}}))},getNetworkType:()=>new Promise((e=>{ks.getNetworkType({success:({networkType:t})=>{e(t)},fail:()=>{e(Pe.UNKONWN)}})})),setNetworkStatusListener:function(e){Qn=e,ks.onNetworkStatusChange(Xn)},removeNetworkStatusListener:function(){ks.offNetworkStatusChange(Xn),Qn=null},createSSEClient:e=>sr(exports.ErrorCode.NOT_SUPPORT),get runtimeInfo(){return{type:zn.tag,version:"Unknown"}}},Zn=Li({setItem(e,t){uni.setStorage({key:e,data:t})},getItem:e=>uni.getStorageSync(e),removeItem(e){uni.removeStorage({key:e,success:()=>{}})}});let $n=null;const eo=e=>{const{isConnected:t,networkType:r}=e;$n({status:t,type:r})};const to={tag:"uniapp",httpReq(e){const t=e.method||exports.HttpMethod.GET,r=e.timeout||we,{headers:i,query:s,body:n}=e,o=Vt(e.url,s);return new Promise((e=>{uni.request({url:o,method:t,header:i,timeout:r,data:n,success:t=>{e({data:t.data,status:t.statusCode})},fail:()=>{e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:Zn,sessionStorage:Zn,useNavi:!0,get connectPlatform(){const{uniPlatform:e,osName:t}=uni.getSystemInfoSync();return["app","app-plus"].includes(e)&&t||""},isFromUniapp:!0,createWebSocket(e,t){const r={complete(){},url:e,protocols:t},i=uni.connectSocket(r);return Promise.resolve(ir({id:Date.now(),onClose(e){i.onClose((t=>{e(t.code,t.reason)}))},onError(e){i.onError((t=>{e(t.errMsg)}))},onMessage(e){i.onMessage((t=>{e(t.data)}))},onOpen(e){i.onOpen(e)},send(e){i.send({data:e})},close(e,t){i.close({code:e,reason:t})}}))},getNetworkType:()=>new Promise((e=>{uni.getNetworkType({success:({networkType:t})=>{e(t)},fail:()=>{e(Pe.UNKONWN)}})})),setNetworkStatusListener:function(e){$n=e,uni.onNetworkStatusChange(eo)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(eo),$n=null},createSSEClient:e=>sr(exports.ErrorCode.NOT_SUPPORT),getApiVer:()=>{const e=uni.getSystemInfoSync(),{osAndroidAPILevel:t,deviceModel:r,deviceBrand:i,osVersion:s,osName:n}=e;return`${i||""}|${r||""}|${("android"===n?t:s)||""}|||uniapp`.replace(/-/g,"_")},get runtimeInfo(){return{type:to.tag,version:"Unknown"}}},ro=e=>e&&e.request&&e.getSystemInfo,io="undefined"!=typeof uni&&ro(uni)?(()=>{switch(process.env.VUE_APP_PLATFORM){case"app-plus":case"app":case"app-harmony":return to;case"mp-jd":return Jn;case"mp-baidu":return Bn;case"mp-toutiao":return wn;case"mp-alipay":return Ln;case"mp-weixin":return yn;case"mp-kuaishou":return zn;default:return Fi}})():"undefined"!=typeof jd&&ro(jd)?Jn:"undefined"!=typeof my&&ro(my)?Ln:"undefined"!=typeof tt&&ro(tt)?wn:"undefined"!=typeof ks&&ro(ks)?zn:"undefined"!=typeof swan&&ro(swan)?Bn:"undefined"!=typeof wx&&ro(wx)?yn:Fi,so=function(){var e,t={},r=function(e){var t=function(e,r,s){if(void 0===e&&(e=t.DEFAULT_CAPACITY),void 0===r&&(r=t.DEFAULT_ENDIAN),void 0===s&&(s=t.DEFAULT_NOASSERT),!s){if((e|=0)<0)throw RangeError("Illegal capacity");r=!!r,s=!!s}this.buffer=0===e?i:new ArrayBuffer(e),this.view=0===e?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=e,this.littleEndian=r,this.noAssert=s};t.VERSION="5.0.1",t.LITTLE_ENDIAN=!0,t.BIG_ENDIAN=!1,t.DEFAULT_CAPACITY=16,t.DEFAULT_ENDIAN=t.BIG_ENDIAN,t.DEFAULT_NOASSERT=!1,t.Long=e||null;var r=t.prototype;r.__isByteBuffer__,Object.defineProperty(r,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1});var i=new ArrayBuffer(0),s=String.fromCharCode;function n(e){var t=0;return function(){return t<e.length?e.charCodeAt(t++):null}}function o(){var e=[],t=[];return function(){if(0===arguments.length)return t.join("")+s.apply(String,e);e.length+arguments.length>1024&&(t.push(s.apply(String,e)),e.length=0),Array.prototype.push.apply(e,arguments)}}function a(e,t,r,i,s){var n,o,a=8*s-i-1,l=(1<<a)-1,c=l>>1,d=-7,_=r?s-1:0,u=r?-1:1,h=e[t+_];for(_+=u,n=h&(1<<-d)-1,h>>=-d,d+=a;d>0;n=256*n+e[t+_],_+=u,d-=8);for(o=n&(1<<-d)-1,n>>=-d,d+=i;d>0;o=256*o+e[t+_],_+=u,d-=8);if(0===n)n=1-c;else{if(n===l)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,i),n-=c}return(h?-1:1)*o*Math.pow(2,n-i)}function l(e,t,r,i,s,n){var o,a,l,c=8*n-s-1,d=(1<<c)-1,_=d>>1,u=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,h=i?0:n-1,E=i?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=d):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+_>=1?u/l:u*Math.pow(2,1-_))*l>=2&&(o++,l/=2),o+_>=d?(a=0,o=d):o+_>=1?(a=(t*l-1)*Math.pow(2,s),o+=_):(a=t*Math.pow(2,_-1)*Math.pow(2,s),o=0));s>=8;e[r+h]=255&a,h+=E,a/=256,s-=8);for(o=o<<s|a,c+=s;c>0;e[r+h]=255&o,h+=E,o/=256,c-=8);e[r+h-E]|=128*g}t.accessor=function(){return Uint8Array},t.allocate=function(e,r,i){return new t(e,r,i)},t.concat=function(e,r,i,s){"boolean"!=typeof r&&"string"==typeof r||(s=i,i=r,r=void 0);for(var n,o=0,a=0,l=e.length;a<l;++a)t.isByteBuffer(e[a])||(e[a]=t.wrap(e[a],r)),(n=e[a].limit-e[a].offset)>0&&(o+=n);if(0===o)return new t(0,i,s);var c,d=new t(o,i,s);for(a=0;a<l;)(n=(c=e[a++]).limit-c.offset)<=0||(d.view.set(c.view.subarray(c.offset,c.limit),d.offset),d.offset+=n);return d.limit=d.offset,d.offset=0,d},t.isByteBuffer=function(e){return!0===(e&&e.__isByteBuffer__)},t.type=function(){return ArrayBuffer},t.wrap=function(e,i,s,n){if("string"!=typeof i&&(n=s,s=i,i=void 0),"string"==typeof e)switch(void 0===i&&(i="utf8"),i){case"base64":return t.fromBase64(e,s);case"hex":return t.fromHex(e,s);case"binary":return t.fromBinary(e,s);case"utf8":return t.fromUTF8(e,s);case"debug":return t.fromDebug(e,s);default:throw Error("Unsupported encoding: "+i)}if(null===e||"object"!=typeof e)throw TypeError("Illegal buffer");var o;if(t.isByteBuffer(e))return(o=r.clone.call(e)).markedOffset=-1,o;if(e instanceof Uint8Array)o=new t(0,s,n),e.length>0&&(o.buffer=e.buffer,o.offset=e.byteOffset,o.limit=e.byteOffset+e.byteLength,o.view=new Uint8Array(e.buffer));else if(e instanceof ArrayBuffer)o=new t(0,s,n),e.byteLength>0&&(o.buffer=e,o.offset=0,o.limit=e.byteLength,o.view=e.byteLength>0?new Uint8Array(e):null);else{if("[object Array]"!==Object.prototype.toString.call(e))throw TypeError("Illegal buffer");(o=new t(e.length,s,n)).limit=e.length;for(var a=0;a<e.length;++a)o.view[a]=e[a]}return o},r.writeBitSet=function(e,t){var r=void 0===t;if(r&&(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)}var i,s=t,n=e.length,o=n>>3,a=0;for(t+=this.writeVarint32(n,t);o--;)i=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(i,t++);if(a<n){var l=0;for(i=0;a<n;)i|=(1&!!e[a++])<<l++;this.writeByte(i,t++)}return r?(this.offset=t,this):t-s},r.readBitSet=function(e){var t=void 0===e;t&&(e=this.offset);var r,i=this.readVarint32(e),s=i.value,n=s>>3,o=0,a=[];for(e+=i.length;n--;)r=this.readByte(e++),a[o++]=!!(1&r),a[o++]=!!(2&r),a[o++]=!!(4&r),a[o++]=!!(8&r),a[o++]=!!(16&r),a[o++]=!!(32&r),a[o++]=!!(64&r),a[o++]=!!(128&r);if(o<s){var l=0;for(r=this.readByte(e++);o<s;)a[o++]=!!(r>>l++&1)}return t&&(this.offset=e),a},r.readBytes=function(e,t){var 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)}var i=this.slice(t,t+e);return r&&(this.offset+=e),i},r.writeBytes=r.append,r.writeInt8=function(e,t){var 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)}t+=1;var i=this.buffer.byteLength;return t>i&&this.resize((i*=2)>t?i:t),t-=1,this.view[t]=e,r&&(this.offset+=1),this},r.writeByte=r.writeInt8,r.readInt8=function(e){var t=void 0===e;if(t&&(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)}var r=this.view[e];return 128&~r||(r=-(255-r+1)),t&&(this.offset+=1),r},r.readByte=r.readInt8,r.writeUint8=function(e,t){var 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)}t+=1;var i=this.buffer.byteLength;return t>i&&this.resize((i*=2)>t?i:t),t-=1,this.view[t]=e,r&&(this.offset+=1),this},r.writeUInt8=r.writeUint8,r.readUint8=function(e){var t=void 0===e;if(t&&(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)}var r=this.view[e];return t&&(this.offset+=1),r},r.readUInt8=r.readUint8,r.writeInt16=function(e,t){var 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)}t+=2;var i=this.buffer.byteLength;return t>i&&this.resize((i*=2)>t?i: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},r.writeShort=r.writeInt16,r.readInt16=function(e){var t=void 0===e;if(t&&(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)}var r=0;return this.littleEndian?(r=this.view[e],r|=this.view[e+1]<<8):(r=this.view[e]<<8,r|=this.view[e+1]),32768&~r||(r=-(65535-r+1)),t&&(this.offset+=2),r},r.readShort=r.readInt16,r.writeUint16=function(e,t){var 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)}t+=2;var i=this.buffer.byteLength;return t>i&&this.resize((i*=2)>t?i: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},r.writeUInt16=r.writeUint16,r.readUint16=function(e){var t=void 0===e;if(t&&(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)}var r=0;return this.littleEndian?(r=this.view[e],r|=this.view[e+1]<<8):(r=this.view[e]<<8,r|=this.view[e+1]),t&&(this.offset+=2),r},r.readUInt16=r.readUint16,r.writeInt32=function(e,t){var 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)}t+=4;var i=this.buffer.byteLength;return t>i&&this.resize((i*=2)>t?i:t),t-=4,this.littleEndian?(this.view[t+3]=e>>>24&255,this.view[t+2]=e>>>16&255,this.view[t+1]=e>>>8&255,this.view[t]=255&e):(this.view[t]=e>>>24&255,this.view[t+1]=e>>>16&255,this.view[t+2]=e>>>8&255,this.view[t+3]=255&e),r&&(this.offset+=4),this},r.writeInt=r.writeInt32,r.readInt32=function(e){var t=void 0===e;if(t&&(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)}var r=0;return this.littleEndian?(r=this.view[e+2]<<16,r|=this.view[e+1]<<8,r|=this.view[e],r+=this.view[e+3]<<24>>>0):(r=this.view[e+1]<<16,r|=this.view[e+2]<<8,r|=this.view[e+3],r+=this.view[e]<<24>>>0),r|=0,t&&(this.offset+=4),r},r.readInt=r.readInt32,r.writeUint32=function(e,t){var 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)}t+=4;var i=this.buffer.byteLength;return t>i&&this.resize((i*=2)>t?i:t),t-=4,this.littleEndian?(this.view[t+3]=e>>>24&255,this.view[t+2]=e>>>16&255,this.view[t+1]=e>>>8&255,this.view[t]=255&e):(this.view[t]=e>>>24&255,this.view[t+1]=e>>>16&255,this.view[t+2]=e>>>8&255,this.view[t+3]=255&e),r&&(this.offset+=4),this},r.writeUInt32=r.writeUint32,r.readUint32=function(e){var t=void 0===e;if(t&&(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)}var r=0;return this.littleEndian?(r=this.view[e+2]<<16,r|=this.view[e+1]<<8,r|=this.view[e],r+=this.view[e+3]<<24>>>0):(r=this.view[e+1]<<16,r|=this.view[e+2]<<8,r|=this.view[e+3],r+=this.view[e]<<24>>>0),t&&(this.offset+=4),r},r.readUInt32=r.readUint32,e&&(r.writeInt64=function(t,r){var i=void 0===r;if(i&&(r=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 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)}"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),r+=8;var s=this.buffer.byteLength;r>s&&this.resize((s*=2)>r?s:r),r-=8;var n=t.low,o=t.high;return this.littleEndian?(this.view[r+3]=n>>>24&255,this.view[r+2]=n>>>16&255,this.view[r+1]=n>>>8&255,this.view[r]=255&n,r+=4,this.view[r+3]=o>>>24&255,this.view[r+2]=o>>>16&255,this.view[r+1]=o>>>8&255,this.view[r]=255&o):(this.view[r]=o>>>24&255,this.view[r+1]=o>>>16&255,this.view[r+2]=o>>>8&255,this.view[r+3]=255&o,r+=4,this.view[r]=n>>>24&255,this.view[r+1]=n>>>16&255,this.view[r+2]=n>>>8&255,this.view[r+3]=255&n),i&&(this.offset+=8),this},r.writeLong=r.writeInt64,r.readInt64=function(t){var 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+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var i=0,s=0;this.littleEndian?(i=this.view[t+2]<<16,i|=this.view[t+1]<<8,i|=this.view[t],i+=this.view[t+3]<<24>>>0,t+=4,s=this.view[t+2]<<16,s|=this.view[t+1]<<8,s|=this.view[t],s+=this.view[t+3]<<24>>>0):(s=this.view[t+1]<<16,s|=this.view[t+2]<<8,s|=this.view[t+3],s+=this.view[t]<<24>>>0,t+=4,i=this.view[t+1]<<16,i|=this.view[t+2]<<8,i|=this.view[t+3],i+=this.view[t]<<24>>>0);var n=new e(i,s,!1);return r&&(this.offset+=8),n},r.readLong=r.readInt64,r.writeUint64=function(t,r){var i=void 0===r;if(i&&(r=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 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)}"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),r+=8;var s=this.buffer.byteLength;r>s&&this.resize((s*=2)>r?s:r),r-=8;var n=t.low,o=t.high;return this.littleEndian?(this.view[r+3]=n>>>24&255,this.view[r+2]=n>>>16&255,this.view[r+1]=n>>>8&255,this.view[r]=255&n,r+=4,this.view[r+3]=o>>>24&255,this.view[r+2]=o>>>16&255,this.view[r+1]=o>>>8&255,this.view[r]=255&o):(this.view[r]=o>>>24&255,this.view[r+1]=o>>>16&255,this.view[r+2]=o>>>8&255,this.view[r+3]=255&o,r+=4,this.view[r]=n>>>24&255,this.view[r+1]=n>>>16&255,this.view[r+2]=n>>>8&255,this.view[r+3]=255&n),i&&(this.offset+=8),this},r.writeUInt64=r.writeUint64,r.readUint64=function(t){var 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+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var i=0,s=0;this.littleEndian?(i=this.view[t+2]<<16,i|=this.view[t+1]<<8,i|=this.view[t],i+=this.view[t+3]<<24>>>0,t+=4,s=this.view[t+2]<<16,s|=this.view[t+1]<<8,s|=this.view[t],s+=this.view[t+3]<<24>>>0):(s=this.view[t+1]<<16,s|=this.view[t+2]<<8,s|=this.view[t+3],s+=this.view[t]<<24>>>0,t+=4,i=this.view[t+1]<<16,i|=this.view[t+2]<<8,i|=this.view[t+3],i+=this.view[t]<<24>>>0);var n=new e(i,s,!0);return r&&(this.offset+=8),n},r.readUInt64=r.readUint64),r.writeFloat32=function(e,t){var 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)}t+=4;var i=this.buffer.byteLength;return t>i&&this.resize((i*=2)>t?i:t),t-=4,l(this.view,e,t,this.littleEndian,23,4),r&&(this.offset+=4),this},r.writeFloat=r.writeFloat32,r.readFloat32=function(e){var t=void 0===e;if(t&&(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)}var r=a(this.view,e,this.littleEndian,23,4);return t&&(this.offset+=4),r},r.readFloat=r.readFloat32,r.writeFloat64=function(e,t){var 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)}t+=8;var i=this.buffer.byteLength;return t>i&&this.resize((i*=2)>t?i:t),t-=8,l(this.view,e,t,this.littleEndian,52,8),r&&(this.offset+=8),this},r.writeDouble=r.writeFloat64,r.readFloat64=function(e){var t=void 0===e;if(t&&(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)}var r=a(this.view,e,this.littleEndian,52,8);return t&&(this.offset+=8),r},r.readDouble=r.readFloat64,t.MAX_VARINT32_BYTES=5,t.calculateVarint32=function(e){return(e>>>=0)<128?1:e<16384?2:e<1<<21?3:e<1<<28?4:5},t.zigZagEncode32=function(e){return((e|=0)<<1^e>>31)>>>0},t.zigZagDecode32=function(e){return e>>>1^-(1&e)},r.writeVarint32=function(e,r){var i=void 0===r;if(i&&(r=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+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)}var s,n=t.calculateVarint32(e);r+=n;var o=this.buffer.byteLength;for(r>o&&this.resize((o*=2)>r?o:r),r-=n,e>>>=0;e>=128;)s=127&e|128,this.view[r++]=s,e>>>=7;return this.view[r++]=e,i?(this.offset=r,this):n},r.writeVarint32ZigZag=function(e,r){return this.writeVarint32(t.zigZagEncode32(e),r)},r.readVarint32=function(e){var t=void 0===e;if(t&&(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)}var r,i=0,s=0;do{if(!this.noAssert&&e>this.limit){var n=Error("Truncated");throw n.truncated=!0,n}r=this.view[e++],i<5&&(s|=(127&r)<<7*i),++i}while(128&r);return s|=0,t?(this.offset=e,s):{value:s,length:i}},r.readVarint32ZigZag=function(e){var r=this.readVarint32(e);return"object"==typeof r?r.value=t.zigZagDecode32(r.value):r=t.zigZagDecode32(r),r},e&&(t.MAX_VARINT64_BYTES=10,t.calculateVarint64=function(t){"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t));var r=t.toInt()>>>0,i=t.shiftRightUnsigned(28).toInt()>>>0,s=t.shiftRightUnsigned(56).toInt()>>>0;return 0==s?0==i?r<16384?r<128?1:2:r<1<<21?3:4:i<16384?i<128?5:6:i<1<<21?7:8:s<128?9:10},t.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()},t.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()},r.writeVarint64=function(r,i){var s=void 0===i;if(s&&(i=this.offset),!this.noAssert){if("number"==typeof r)r=e.fromNumber(r);else if("string"==typeof r)r=e.fromString(r);else if(!(r&&r instanceof e))throw TypeError("Illegal value: "+r+" (not an integer or Long)");if("number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}"number"==typeof r?r=e.fromNumber(r,!1):"string"==typeof r?r=e.fromString(r,!1):!1!==r.unsigned&&(r=r.toSigned());var n=t.calculateVarint64(r),o=r.toInt()>>>0,a=r.shiftRightUnsigned(28).toInt()>>>0,l=r.shiftRightUnsigned(56).toInt()>>>0;i+=n;var c=this.buffer.byteLength;switch(i>c&&this.resize((c*=2)>i?c:i),i-=n,n){case 10:this.view[i+9]=l>>>7&1;case 9:this.view[i+8]=9!==n?128|l:127&l;case 8:this.view[i+7]=8!==n?a>>>21|128:a>>>21&127;case 7:this.view[i+6]=7!==n?a>>>14|128:a>>>14&127;case 6:this.view[i+5]=6!==n?a>>>7|128:a>>>7&127;case 5:this.view[i+4]=5!==n?128|a:127&a;case 4:this.view[i+3]=4!==n?o>>>21|128:o>>>21&127;case 3:this.view[i+2]=3!==n?o>>>14|128:o>>>14&127;case 2:this.view[i+1]=2!==n?o>>>7|128:o>>>7&127;case 1:this.view[i]=1!==n?128|o:127&o}return s?(this.offset+=n,this):n},r.writeVarint64ZigZag=function(e,r){return this.writeVarint64(t.zigZagEncode64(e),r)},r.readVarint64=function(t){var 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+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var i=t,s=0,n=0,o=0,a=0;if(s=127&(a=this.view[t++]),128&a&&(s|=(127&(a=this.view[t++]))<<7,(128&a||this.noAssert&&void 0===a)&&(s|=(127&(a=this.view[t++]))<<14,(128&a||this.noAssert&&void 0===a)&&(s|=(127&(a=this.view[t++]))<<21,(128&a||this.noAssert&&void 0===a)&&(n=127&(a=this.view[t++]),(128&a||this.noAssert&&void 0===a)&&(n|=(127&(a=this.view[t++]))<<7,(128&a||this.noAssert&&void 0===a)&&(n|=(127&(a=this.view[t++]))<<14,(128&a||this.noAssert&&void 0===a)&&(n|=(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");var l=e.fromBits(s|n<<28,n>>>4|o<<24,!1);return r?(this.offset=t,l):{value:l,length:t-i}},r.readVarint64ZigZag=function(r){var i=this.readVarint64(r);return i&&i.value instanceof e?i.value=t.zigZagDecode64(i.value):i=t.zigZagDecode64(i),i}),r.writeCString=function(e,t){var r=void 0===t;r&&(t=this.offset);var i,s=e.length;if(!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");for(i=0;i<s;++i)if(0===e.charCodeAt(i))throw RangeError("Illegal str: Contains NULL-characters");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)}s=d.calculateUTF16asUTF8(n(e))[1],t+=s+1;var o=this.buffer.byteLength;return t>o&&this.resize((o*=2)>t?o:t),t-=s+1,d.encodeUTF16toUTF8(n(e),function(e){this.view[t++]=e}.bind(this)),this.view[t++]=0,r?(this.offset=t,this):s},r.readCString=function(e){var t=void 0===e;if(t&&(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)}var r,i=e,s=-1;return d.decodeUTF8toUTF16(function(){if(0===s)return null;if(e>=this.limit)throw RangeError("Illegal range: Truncated data, "+e+" < "+this.limit);return 0===(s=this.view[e++])?null:s}.bind(this),r=o(),!0),t?(this.offset=e,r()):{string:r(),length:e-i}},r.writeIString=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");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)}var i,s=t;i=d.calculateUTF16asUTF8(n(e),this.noAssert)[1],t+=4+i;var o=this.buffer.byteLength;if(t>o&&this.resize((o*=2)>t?o:t),t-=4+i,this.littleEndian?(this.view[t+3]=i>>>24&255,this.view[t+2]=i>>>16&255,this.view[t+1]=i>>>8&255,this.view[t]=255&i):(this.view[t]=i>>>24&255,this.view[t+1]=i>>>16&255,this.view[t+2]=i>>>8&255,this.view[t+3]=255&i),t+=4,d.encodeUTF16toUTF8(n(e),function(e){this.view[t++]=e}.bind(this)),t!==s+4+i)throw RangeError("Illegal range: Truncated data, "+t+" == "+(t+4+i));return r?(this.offset=t,this):t-s},r.readIString=function(e){var r=void 0===e;if(r&&(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)}var i=e,s=this.readUint32(e),n=this.readUTF8String(s,t.METRICS_BYTES,e+=4);return e+=n.length,r?(this.offset=e,n.string):{string:n.string,length:e-i}},t.METRICS_CHARS="c",t.METRICS_BYTES="b",r.writeUTF8String=function(e,t){var r,i=void 0===t;if(i&&(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+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var s=t;r=d.calculateUTF16asUTF8(n(e))[1],t+=r;var o=this.buffer.byteLength;return t>o&&this.resize((o*=2)>t?o:t),t-=r,d.encodeUTF16toUTF8(n(e),function(e){this.view[t++]=e}.bind(this)),i?(this.offset=t,this):t-s},r.writeString=r.writeUTF8String,t.calculateUTF8Chars=function(e){return d.calculateUTF16asUTF8(n(e))[0]},t.calculateUTF8Bytes=function(e){return d.calculateUTF16asUTF8(n(e))[1]},t.calculateString=t.calculateUTF8Bytes,r.readUTF8String=function(e,r,i){"number"==typeof r&&(i=r,r=void 0);var s=void 0===i;if(s&&(i=this.offset),void 0===r&&(r=t.METRICS_CHARS),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");if(e|=0,"number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}var n,a=0,l=i;if(r===t.METRICS_CHARS){if(n=o(),d.decodeUTF8(function(){return a<e&&i<this.limit?this.view[i++]:null}.bind(this),(function(e){++a,d.UTF8toUTF16(e,n)})),a!==e)throw RangeError("Illegal range: Truncated data, "+a+" == "+e);return s?(this.offset=i,n()):{string:n(),length:i-l}}if(r===t.METRICS_BYTES){if(!this.noAssert){if("number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+"+e+") <= "+this.buffer.byteLength)}var c=i+e;if(d.decodeUTF8toUTF16(function(){return i<c?this.view[i++]:null}.bind(this),n=o(),this.noAssert),i!==c)throw RangeError("Illegal range: Truncated data, "+i+" == "+c);return s?(this.offset=i,n()):{string:n(),length:i-l}}throw TypeError("Unsupported metrics: "+r)},r.readString=r.readUTF8String,r.writeVString=function(e,r){var i=void 0===r;if(i&&(r=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("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)}var s,o,a=r;s=d.calculateUTF16asUTF8(n(e),this.noAssert)[1],o=t.calculateVarint32(s),r+=o+s;var l=this.buffer.byteLength;if(r>l&&this.resize((l*=2)>r?l:r),r-=o+s,r+=this.writeVarint32(s,r),d.encodeUTF16toUTF8(n(e),function(e){this.view[r++]=e}.bind(this)),r!==a+s+o)throw RangeError("Illegal range: Truncated data, "+r+" == "+(r+s+o));return i?(this.offset=r,this):r-a},r.readVString=function(e){var r=void 0===e;if(r&&(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)}var i=e,s=this.readVarint32(e),n=this.readUTF8String(s.value,t.METRICS_BYTES,e+=s.length);return e+=n.length,r?(this.offset=e,n.string):{string:n.string,length:e-i}},r.append=function(e,r,i){"number"!=typeof r&&"string"==typeof r||(i=r,r=void 0);var s=void 0===i;if(s&&(i=this.offset),!this.noAssert){if("number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}e instanceof t||(e=t.wrap(e,r));var n=e.limit-e.offset;if(n<=0)return this;i+=n;var o=this.buffer.byteLength;return i>o&&this.resize((o*=2)>i?o:i),i-=n,this.view.set(e.view.subarray(e.offset,e.limit),i),e.offset+=n,s&&(this.offset+=n),this},r.appendTo=function(e,t){return e.append(this,t),this},r.assert=function(e){return this.noAssert=!e,this},r.capacity=function(){return this.buffer.byteLength},r.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},r.clone=function(e){var r=new t(0,this.littleEndian,this.noAssert);return e?(r.buffer=new ArrayBuffer(this.buffer.byteLength),r.view=new Uint8Array(r.buffer)):(r.buffer=this.buffer,r.view=this.view),r.offset=this.offset,r.markedOffset=this.markedOffset,r.limit=this.limit,r},r.compact=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(0===e&&t===this.buffer.byteLength)return this;var r=t-e;if(0===r)return this.buffer=i,this.view=null,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=0,this;var s=new ArrayBuffer(r),n=new Uint8Array(s);return n.set(this.view.subarray(e,t)),this.buffer=s,this.view=n,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=r,this},r.copy=function(e,r){if(void 0===e&&(e=this.offset),void 0===r&&(r=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal end: Not an integer");if(r>>>=0,e<0||e>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+r+" <= "+this.buffer.byteLength)}if(e===r)return new t(0,this.littleEndian,this.noAssert);var i=r-e,s=new t(i,this.littleEndian,this.noAssert);return s.offset=0,s.limit=i,s.markedOffset>=0&&(s.markedOffset-=e),this.copyTo(s,0,e,r),s},r.copyTo=function(e,r,i,s){var n,o;if(!this.noAssert&&!t.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(r=(o=void 0===r)?e.offset:0|r,i=(n=void 0===i)?this.offset:0|i,s=void 0===s?this.limit:0|s,r<0||r>e.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+r+" <= "+e.buffer.byteLength);if(i<0||s>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+i+" <= "+this.buffer.byteLength);var a=s-i;return 0===a?e:(e.ensureCapacity(r+a),e.view.set(this.view.subarray(i,s),r),n&&(this.offset+=a),o&&(e.offset+=a),this)},r.ensureCapacity=function(e){var t=this.buffer.byteLength;return t<e?this.resize((t*=2)>e?t:e):this},r.fill=function(e,t,r){var i=void 0===t;if(i&&(t=this.offset),"string"==typeof e&&e.length>0&&(e=e.charCodeAt(0)),void 0===t&&(t=this.offset),void 0===r&&(r=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 r||r%1!=0)throw TypeError("Illegal end: Not an integer");if(r>>>=0,t<0||t>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+r+" <= "+this.buffer.byteLength)}if(t>=r)return this;for(;t<r;)this.view[t++]=e;return i&&(this.offset=t),this},r.flip=function(){return this.limit=this.offset,this.offset=0,this},r.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},r.order=function(e){if(!this.noAssert&&"boolean"!=typeof e)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!e,this},r.LE=function(e){return this.littleEndian=void 0===e||!!e,this},r.BE=function(e){return this.littleEndian=void 0!==e&&!e,this},r.prepend=function(e,r,i){"number"!=typeof r&&"string"==typeof r||(i=r,r=void 0);var s=void 0===i;if(s&&(i=this.offset),!this.noAssert){if("number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}e instanceof t||(e=t.wrap(e,r));var n=e.limit-e.offset;if(n<=0)return this;var o=n-i;if(o>0){var a=new ArrayBuffer(this.buffer.byteLength+o),l=new Uint8Array(a);l.set(this.view.subarray(i,this.buffer.byteLength),n),this.buffer=a,this.view=l,this.offset+=o,this.markedOffset>=0&&(this.markedOffset+=o),this.limit+=o,i+=o}else new Uint8Array(this.buffer);return this.view.set(e.view.subarray(e.offset,e.limit),i-n),e.offset=e.limit,s&&(this.offset-=n),this},r.prependTo=function(e,t){return e.prepend(this,t),this},r.printDebug=function(e){"function"!=typeof e&&(e=console.log.bind(console)),e(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},r.remaining=function(){return this.limit-this.offset},r.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},r.resize=function(e){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)}if(this.buffer.byteLength<e){var t=new ArrayBuffer(e),r=new Uint8Array(t);r.set(this.view),this.buffer=t,this.view=r}return this},r.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},r.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},r.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 r=this.clone();return r.offset=e,r.limit=t,r},r.toBuffer=function(e){var t=this.offset,r=this.limit;if(!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: Not an integer");if(t>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal limit: Not an integer");if(r>>>=0,t<0||t>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+r+" <= "+this.buffer.byteLength)}if(!e&&0===t&&r===this.buffer.byteLength)return this.buffer;if(t===r)return i;var s=new ArrayBuffer(r-t);return new Uint8Array(s).set(new Uint8Array(this.buffer).subarray(t,r),0),s},r.toArrayBuffer=r.toBuffer,r.toString=function(e,t,r){if(void 0===e)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof e&&(r=t=e="utf8"),e){case"utf8":return this.toUTF8(t,r);case"base64":return this.toBase64(t,r);case"hex":return this.toHex(t,r);case"binary":return this.toBinary(t,r);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+e)}};var c=function(){for(var e={},t=[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],r=[],i=0,s=t.length;i<s;++i)r[t[i]]=i;return e.encode=function(e,r){for(var i,s;null!==(i=e());)r(t[i>>2&63]),s=(3&i)<<4,null!==(i=e())?(r(t[63&((s|=i>>4&15)|i>>4&15)]),s=(15&i)<<2,null!==(i=e())?(r(t[63&(s|i>>6&3)]),r(t[63&i])):(r(t[63&s]),r(61))):(r(t[63&s]),r(61),r(61))},e.decode=function(e,t){var i,s,n;function o(e){throw Error("Illegal character code: "+e)}for(;null!==(i=e());)if(void 0===(s=r[i])&&o(i),null!==(i=e())&&(void 0===(n=r[i])&&o(i),t(s<<2>>>0|(48&n)>>4),null!==(i=e()))){if(void 0===(s=r[i])){if(61===i)break;o(i)}if(t((15&n)<<4>>>0|(60&s)>>2),null!==(i=e())){if(void 0===(n=r[i])){if(61===i)break;o(i)}t((3&s)<<6>>>0|n)}}},e.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)},e}();r.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 c.encode(function(){return e<t?this.view[e++]:null}.bind(this),r=o()),r()},t.fromBase64=function(e,r){if("string"!=typeof e)throw TypeError("str");var i=new t(e.length/4*3,r),s=0;return c.decode(n(e),(function(e){i.view[s++]=e})),i.limit=s,i},t.btoa=function(e){return t.fromBinary(e).toBase64()},t.atob=function(e){return t.fromBase64(e).toBinary()},r.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 r=[],i=[];e<t;)r.push(this.view[e++]),r.length>=1024&&(i.push(String.fromCharCode.apply(String,r)),r=[]);return i.join("")+String.fromCharCode.apply(String,r)},t.fromBinary=function(e,r){if("string"!=typeof e)throw TypeError("str");for(var i,s=0,n=e.length,o=new t(n,r);s<n;){if((i=e.charCodeAt(s))>255)throw RangeError("illegal char code: "+i);o.view[s++]=i}return o.limit=n,o},r.toDebug=function(e){for(var t,r=-1,i=this.buffer.byteLength,s="",n="",o="";r<i;){if(-1!==r&&(s+=(t=this.view[r])<16?"0"+t.toString(16).toUpperCase():t.toString(16).toUpperCase(),e&&(n+=t>32&&t<127?String.fromCharCode(t):".")),++r,e&&r>0&&r%16==0&&r!==i){for(;s.length<51;)s+=" ";o+=s+n+"\n",s=n=""}r===this.offset&&r===this.limit?s+=r===this.markedOffset?"!":"|":r===this.offset?s+=r===this.markedOffset?"[":"<":r===this.limit?s+=r===this.markedOffset?"]":">":s+=r===this.markedOffset?"'":e||0!==r&&r!==i?" ":""}if(e&&" "!==s){for(;s.length<51;)s+=" ";o+=s+n+"\n"}return e?o:s},t.fromDebug=function(e,r,i){for(var s,n,o=e.length,a=new t((o+1)/3|0,r,i),l=0,c=0,d=!1,_=!1,u=!1,h=!1,E=!1;l<o;){switch(s=e.charAt(l++)){case"!":if(!i){if(_||u||h){E=!0;break}_=u=h=!0}a.offset=a.markedOffset=a.limit=c,d=!1;break;case"|":if(!i){if(_||h){E=!0;break}_=h=!0}a.offset=a.limit=c,d=!1;break;case"[":if(!i){if(_||u){E=!0;break}_=u=!0}a.offset=a.markedOffset=c,d=!1;break;case"<":if(!i){if(_){E=!0;break}_=!0}a.offset=c,d=!1;break;case"]":if(!i){if(h||u){E=!0;break}h=u=!0}a.limit=a.markedOffset=c,d=!1;break;case">":if(!i){if(h){E=!0;break}h=!0}a.limit=c,d=!1;break;case"'":if(!i){if(u){E=!0;break}u=!0}a.markedOffset=c,d=!1;break;case" ":d=!1;break;default:if(!i&&d){E=!0;break}if(n=parseInt(s+e.charAt(l++),16),!i&&(isNaN(n)||n<0||n>255))throw TypeError("Illegal str: Not a debug encoded string");a.view[c++]=n,d=!0}if(E)throw TypeError("Illegal str: Invalid symbol at "+l)}if(!i){if(!_||!h)throw TypeError("Illegal str: Missing offset or limit");if(c<a.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+c+" < "+o)}return a},r.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 r,i=new Array(t-e);e<t;)(r=this.view[e++])<16?i.push("0",r.toString(16)):i.push(r.toString(16));return i.join("")},t.fromHex=function(e,r,i){if(!i){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(var s,n=e.length,o=new t(n/2|0,r),a=0,l=0;a<n;a+=2){if(s=parseInt(e.substring(a,a+2),16),!i&&(!isFinite(s)||s<0||s>255))throw TypeError("Illegal str: Contains non-hex characters");o.view[l++]=s}return o.limit=l,o};var d=function(){var e={MAX_CODEPOINT:1114111,encodeUTF8:function(e,t){var r=null;for("number"==typeof e&&(r=e,e=function(){return null});null!==r||null!==(r=e());)r<128?t(127&r):r<2048?(t(r>>6&31|192),t(63&r|128)):r<65536?(t(r>>12&15|224),t(r>>6&63|128),t(63&r|128)):(t(r>>18&7|240),t(r>>12&63|128),t(r>>6&63|128),t(63&r|128)),r=null},decodeUTF8:function(e,t){for(var r,i,s,n,o=function(e){e=e.slice(0,e.indexOf(null));var t=Error(e.toString());throw t.name="TruncatedError",t.bytes=e,t};null!==(r=e());)if(128&r)if(192==(224&r))null===(i=e())&&o([r,i]),t((31&r)<<6|63&i);else if(224==(240&r))(null===(i=e())||null===(s=e()))&&o([r,i,s]),t((15&r)<<12|(63&i)<<6|63&s);else{if(240!=(248&r))throw RangeError("Illegal starting byte: "+r);(null===(i=e())||null===(s=e())||null===(n=e()))&&o([r,i,s,n]),t((7&r)<<18|(63&i)<<12|(63&s)<<6|63&n)}else t(r)},UTF16toUTF8:function(e,t){for(var r,i=null;null!==(r=null!==i?i:e());)r>=55296&&r<=57343&&null!==(i=e())&&i>=56320&&i<=57343?(t(1024*(r-55296)+i-56320+65536),i=null):t(r);null!==i&&t(i)},UTF8toUTF16:function(e,t){var r=null;for("number"==typeof e&&(r=e,e=function(){return null});null!==r||null!==(r=e());)r<=65535?t(r):(t(55296+((r-=65536)>>10)),t(r%1024+56320)),r=null},encodeUTF16toUTF8:function(t,r){e.UTF16toUTF8(t,(function(t){e.encodeUTF8(t,r)}))},decodeUTF8toUTF16:function(t,r){e.decodeUTF8(t,(function(t){e.UTF8toUTF16(t,r)}))},calculateCodePoint:function(e){return e<128?1:e<2048?2:e<65536?3:4},calculateUTF8:function(e){for(var t,r=0;null!==(t=e());)r+=t<128?1:t<2048?2:t<65536?3:4;return r},calculateUTF16asUTF8:function(t){var r=0,i=0;return e.UTF16toUTF8(t,(function(e){++r,i+=e<128?1:e<2048?2:e<65536?3:4})),[r,i]}};return e}();return r.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{d.decodeUTF8toUTF16(function(){return e<t?this.view[e++]:null}.bind(this),r=o())}catch(r){if(e!==t)throw RangeError("Illegal range: Truncated data, "+e+" != "+t)}return r()},t.fromUTF8=function(e,r,i){if(!i&&"string"!=typeof e)throw TypeError("Illegal str: Not a string");var s=new t(d.calculateUTF16asUTF8(n(e),!0)[1],r,i),o=0;return d.encodeUTF16toUTF8(n(e),(function(e){s.view[o++]=e})),s.limit=o,s},t}(function(){function e(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function t(e){return!0===(e&&e.__isLong__)}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t;var r={},i={};function s(e,t){var s,n,a;return t?(a=0<=(e>>>=0)&&e<256)&&(n=i[e])?n:(s=o(e,(0|e)<0?-1:0,!0),a&&(i[e]=s),s):(a=-128<=(e|=0)&&e<128)&&(n=r[e])?n:(s=o(e,e<0?-1:0,!1),a&&(r[e]=s),s)}function n(e,t){if(isNaN(e)||!isFinite(e))return t?g:E;if(t){if(e<0)return g;if(e>=_)return f}else{if(e<=-u)return A;if(e+1>=u)return R}return e<0?n(-e,t).neg():o(e%d|0,e/d|0,t)}function o(t,r,i){return new e(t,r,i)}e.fromInt=s,e.fromNumber=n,e.fromBits=o;var a=Math.pow;function l(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return E;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var i;if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return l(e.substring(1),t,r).neg();for(var s=n(a(r,8)),o=E,c=0;c<e.length;c+=8){var d=Math.min(8,e.length-c),_=parseInt(e.substring(c,c+d),r);if(d<8){var u=n(a(r,d));o=o.mul(u).add(n(_))}else o=(o=o.mul(s)).add(n(_))}return o.unsigned=t,o}function c(t){return t instanceof e?t:"number"==typeof t?n(t):"string"==typeof t?l(t):o(t.low,t.high,t.unsigned)}e.fromString=l,e.fromValue=c;var d=4294967296,_=d*d,u=_/2,h=s(1<<24),E=s(0);e.ZERO=E;var g=s(0,!0);e.UZERO=g;var I=s(1);e.ONE=I;var p=s(1,!0);e.UONE=p;var T=s(-1);e.NEG_ONE=T;var R=o(-1,2147483647,!1);e.MAX_VALUE=R;var f=o(-1,-1,!0);e.MAX_UNSIGNED_VALUE=f;var A=o(0,-2147483648,!1);e.MIN_VALUE=A;var m=e.prototype;return m.toInt=function(){return this.unsigned?this.low>>>0:this.low},m.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},m.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(A)){var t=n(e),r=this.div(t),i=r.mul(t).sub(this);return r.toString(e)+i.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var s=n(a(e,6),this.unsigned),o=this,l="";;){var c=o.div(s),d=(o.sub(c.mul(s)).toInt()>>>0).toString(e);if((o=c).isZero())return d+l;for(;d.length<6;)d="0"+d;l=""+d+l}},m.getHighBits=function(){return this.high},m.getHighBitsUnsigned=function(){return this.high>>>0},m.getLowBits=function(){return this.low},m.getLowBitsUnsigned=function(){return this.low>>>0},m.getNumBitsAbs=function(){if(this.isNegative())return this.eq(A)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<<t);t--);return 0!=this.high?t+33:t+1},m.isZero=function(){return 0===this.high&&0===this.low},m.isNegative=function(){return!this.unsigned&&this.high<0},m.isPositive=function(){return this.unsigned||this.high>=0},m.isOdd=function(){return!(1&~this.low)},m.isEven=function(){return!(1&this.low)},m.equals=function(e){return t(e)||(e=c(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},m.eq=m.equals,m.notEquals=function(e){return!this.eq(e)},m.neq=m.notEquals,m.lessThan=function(e){return this.comp(e)<0},m.lt=m.lessThan,m.lessThanOrEqual=function(e){return this.comp(e)<=0},m.lte=m.lessThanOrEqual,m.greaterThan=function(e){return this.comp(e)>0},m.gt=m.greaterThan,m.greaterThanOrEqual=function(e){return this.comp(e)>=0},m.gte=m.greaterThanOrEqual,m.compare=function(e){if(t(e)||(e=c(e)),this.eq(e))return 0;var r=this.isNegative(),i=e.isNegative();return r&&!i?-1:!r&&i?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},m.comp=m.compare,m.negate=function(){return!this.unsigned&&this.eq(A)?A:this.not().add(I)},m.neg=m.negate,m.add=function(e){t(e)||(e=c(e));var r=this.high>>>16,i=65535&this.high,s=this.low>>>16,n=65535&this.low,a=e.high>>>16,l=65535&e.high,d=e.low>>>16,_=0,u=0,h=0,E=0;return h+=(E+=n+(65535&e.low))>>>16,u+=(h+=s+d)>>>16,_+=(u+=i+l)>>>16,_+=r+a,o((h&=65535)<<16|(E&=65535),(_&=65535)<<16|(u&=65535),this.unsigned)},m.subtract=function(e){return t(e)||(e=c(e)),this.add(e.neg())},m.sub=m.subtract,m.multiply=function(e){if(this.isZero())return E;if(t(e)||(e=c(e)),e.isZero())return E;if(this.eq(A))return e.isOdd()?A:E;if(e.eq(A))return this.isOdd()?A:E;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(h)&&e.lt(h))return n(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,i=65535&this.high,s=this.low>>>16,a=65535&this.low,l=e.high>>>16,d=65535&e.high,_=e.low>>>16,u=65535&e.low,g=0,I=0,p=0,T=0;return p+=(T+=a*u)>>>16,I+=(p+=s*u)>>>16,p&=65535,I+=(p+=a*_)>>>16,g+=(I+=i*u)>>>16,I&=65535,g+=(I+=s*_)>>>16,I&=65535,g+=(I+=a*d)>>>16,g+=r*u+i*_+s*d+a*l,o((p&=65535)<<16|(T&=65535),(g&=65535)<<16|(I&=65535),this.unsigned)},m.mul=m.multiply,m.divide=function(e){if(t(e)||(e=c(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?g:E;var r,i,s;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return p;s=g}else{if(this.eq(A))return e.eq(I)||e.eq(T)?A:e.eq(A)?I:(r=this.shr(1).div(e).shl(1)).eq(E)?e.isNegative()?I:T:(i=this.sub(e.mul(r)),s=r.add(i.div(e)));if(e.eq(A))return this.unsigned?g:E;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();s=E}for(i=this;i.gte(e);){r=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(r)/Math.LN2),l=o<=48?1:a(2,o-48),d=n(r),_=d.mul(e);_.isNegative()||_.gt(i);)_=(d=n(r-=l,this.unsigned)).mul(e);d.isZero()&&(d=I),s=s.add(d),i=i.sub(_)}return s},m.div=m.divide,m.modulo=function(e){return t(e)||(e=c(e)),this.sub(this.div(e).mul(e))},m.mod=m.modulo,m.not=function(){return o(~this.low,~this.high,this.unsigned)},m.and=function(e){return t(e)||(e=c(e)),o(this.low&e.low,this.high&e.high,this.unsigned)},m.or=function(e){return t(e)||(e=c(e)),o(this.low|e.low,this.high|e.high,this.unsigned)},m.xor=function(e){return t(e)||(e=c(e)),o(this.low^e.low,this.high^e.high,this.unsigned)},m.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?o(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):o(0,this.low<<e-32,this.unsigned)},m.shl=m.shiftLeft,m.shiftRight=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?o(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):o(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},m.shr=m.shiftRight,m.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0===(e&=63))return this;var r=this.high;return e<32?o(this.low>>>e|r<<32-e,r>>>e,this.unsigned):o(32===e?r:r>>>e-32,0,this.unsigned)},m.shru=m.shiftRightUnsigned,m.toSigned=function(){return this.unsigned?o(this.low,this.high,!1):this},m.toUnsigned=function(){return this.unsigned?this:o(this.low,this.high,!0)},m.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},m.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},m.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e}());return t.ByteBuffer=r,t.Long=r.Long||null,t.VERSION="5.0.3",t.WIRE_TYPES={},t.WIRE_TYPES.VARINT=0,t.WIRE_TYPES.BITS64=1,t.WIRE_TYPES.LDELIM=2,t.WIRE_TYPES.STARTGROUP=3,t.WIRE_TYPES.ENDGROUP=4,t.WIRE_TYPES.BITS32=5,t.PACKABLE_WIRE_TYPES=[t.WIRE_TYPES.VARINT,t.WIRE_TYPES.BITS64,t.WIRE_TYPES.BITS32],t.TYPES={int32:{name:"int32",wireType:t.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:"uint32",wireType:t.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:"sint32",wireType:t.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:"int64",wireType:t.WIRE_TYPES.VARINT,defaultValue:t.Long?t.Long.ZERO:void 0},uint64:{name:"uint64",wireType:t.WIRE_TYPES.VARINT,defaultValue:t.Long?t.Long.UZERO:void 0},sint64:{name:"sint64",wireType:t.WIRE_TYPES.VARINT,defaultValue:t.Long?t.Long.ZERO:void 0},bool:{name:"bool",wireType:t.WIRE_TYPES.VARINT,defaultValue:!1},double:{name:"double",wireType:t.WIRE_TYPES.BITS64,defaultValue:0},string:{name:"string",wireType:t.WIRE_TYPES.LDELIM,defaultValue:""},bytes:{name:"bytes",wireType:t.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:"fixed32",wireType:t.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:"sfixed32",wireType:t.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:"fixed64",wireType:t.WIRE_TYPES.BITS64,defaultValue:t.Long?t.Long.UZERO:void 0},sfixed64:{name:"sfixed64",wireType:t.WIRE_TYPES.BITS64,defaultValue:t.Long?t.Long.ZERO:void 0},float:{name:"float",wireType:t.WIRE_TYPES.BITS32,defaultValue:0},enum:{name:"enum",wireType:t.WIRE_TYPES.VARINT,defaultValue:0},message:{name:"message",wireType:t.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:"group",wireType:t.WIRE_TYPES.STARTGROUP,defaultValue:null}},t.MAP_KEY_TYPES=[t.TYPES.int32,t.TYPES.sint32,t.TYPES.sfixed32,t.TYPES.uint32,t.TYPES.fixed32,t.TYPES.int64,t.TYPES.sint64,t.TYPES.sfixed64,t.TYPES.uint64,t.TYPES.fixed64,t.TYPES.bool,t.TYPES.string,t.TYPES.bytes],t.ID_MIN=1,t.ID_MAX=536870911,t.convertFieldsToCamelCase=!1,t.populateAccessors=!0,t.populateDefaults=!0,t.Util=((e={}).IS_NODE=!("object"!=typeof process||process+""!="[object process]"||process.browser),e.toCamelCase=function(e){return e.replace(/_([a-zA-Z])/g,(function(e,t){return t.toUpperCase()}))},e),t.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]*)(?:\.[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},t.DotProto=function(e,t){var r={},i=function(e){this.source=e+"",this.index=0,this.line=1,this.stack=[],this._stringOpen=null},s=i.prototype;s._readString=function(){var e='"'===this._stringOpen?t.STRING_DQ:t.STRING_SQ;e.lastIndex=this.index-1;var r=e.exec(this.source);if(!r)throw Error("unterminated string");return this.index=e.lastIndex,this.stack.push(this._stringOpen),this._stringOpen=null,r[1]},s.next=function(){if(this.stack.length>0)return this.stack.shift();if(this.index>=this.source.length)return null;if(null!==this._stringOpen)return this._readString();var e,r,i;do{for(e=!1;t.WHITESPACE.test(i=this.source.charAt(this.index));)if("\n"===i&&++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("*"!==(i=this.source.charAt(this.index)))return"/";do{if("\n"===i&&++this.line,++this.index===this.source.length)return null;r=i,i=this.source.charAt(this.index)}while("*"!==r||"/"!==i);++this.index,e=!0}}while(e);if(this.index===this.source.length)return null;var s=this.index;if(t.DELIM.lastIndex=0,!t.DELIM.test(this.source.charAt(s++)))for(;s<this.source.length&&!t.DELIM.test(this.source.charAt(s));)++s;var n=this.source.substring(this.index,this.index=s);return'"'!==n&&"'"!==n||(this._stringOpen=n),n},s.peek=function(){if(0===this.stack.length){var e=this.next();if(null===e)return null;this.stack.push(e)}return this.stack[0]},s.skip=function(e){var t=this.next();if(t!==e)throw Error("illegal '"+t+"', '"+e+"' expected")},s.omit=function(e){return this.peek()===e&&(this.next(),!0)},s.toString=function(){return"Tokenizer ("+this.index+"/"+this.source.length+" at line "+this.line+")"},r.Tokenizer=i;var n=function(e){this.tn=new i(e),this.proto3=!1},o=n.prototype;function a(e,r){var i=-1,s=1;if("-"==e.charAt(0)&&(s=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))i=parseInt(e);else if(t.NUMBER_HEX.test(e))i=parseInt(e.substring(2),16);else{if(!t.NUMBER_OCT.test(e))throw Error("illegal id value: "+(s<0?"-":"")+e);i=parseInt(e.substring(1),8)}if(i=s*i|0,!r&&i<0)throw Error("illegal id value: "+(s<0?"-":"")+e);return i}function l(e){var r=1;if("-"==e.charAt(0)&&(r=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))return r*parseInt(e,10);if(t.NUMBER_HEX.test(e))return r*parseInt(e.substring(2),16);if(t.NUMBER_OCT.test(e))return r*parseInt(e.substring(1),8);if("inf"===e)return r*(1/0);if("nan"===e)return NaN;if(t.NUMBER_FLT.test(e))return r*parseFloat(e);throw Error("illegal number value: "+(r<0?"-":"")+e)}function c(e,t,r){void 0===e[t]?e[t]=r:(Array.isArray(e[t])||(e[t]=[e[t]]),e[t].push(r))}return o.parse=function(){var e,r,i={name:"[ROOT]",package:null,messages:[],enums:[],imports:[],options:{},services:[]},s=!0;try{for(;e=this.tn.next();)switch(e){case"package":if(!s||null!==i.package)throw Error("unexpected 'package'");if(e=this.tn.next(),!t.TYPEREF.test(e))throw Error("illegal package name: "+e);this.tn.skip(";"),i.package=e;break;case"import":if(!s)throw Error("unexpected 'import'");("public"===(e=this.tn.peek())||(r="weak"===e))&&this.tn.next(),e=this._readString(),this.tn.skip(";"),r||i.imports.push(e);break;case"syntax":if(!s)throw Error("unexpected 'syntax'");this.tn.skip("="),"proto3"===(i.syntax=this._readString())&&(this.proto3=!0),this.tn.skip(";");break;case"message":this._parseMessage(i,null),s=!1;break;case"enum":this._parseEnum(i),s=!1;break;case"option":this._parseOption(i);break;case"service":this._parseService(i);break;case"extend":this._parseExtend(i);break;default:throw Error("unexpected '"+e+"'")}}catch(e){throw e.message="Parse error at line "+this.tn.line+": "+e.message,e}return delete i.name,i},n.parse=function(e){return new n(e).parse()},o._readString=function(){var e,t,r="";do{if("'"!==(t=this.tn.next())&&'"'!==t)throw Error("illegal string delimiter: "+t);r+=this.tn.next(),this.tn.skip(t),e=this.tn.peek()}while('"'===e||'"'===e);return r},o._readValue=function(e){var r=this.tn.peek();if('"'===r||"'"===r)return this._readString();if(this.tn.next(),t.NUMBER.test(r))return l(r);if(t.BOOL.test(r))return"true"===r.toLowerCase();if(e&&t.TYPEREF.test(r))return r;throw Error("illegal value: "+r)},o._parseOption=function(e,r){var i=this.tn.next(),s=!1;if("("===i&&(s=!0,i=this.tn.next()),!t.TYPEREF.test(i))throw Error("illegal option name: "+i);var n=i;s&&(this.tn.skip(")"),n="("+n+")",i=this.tn.peek(),t.FQTYPEREF.test(i)&&(n+=i,this.tn.next())),this.tn.skip("="),this._parseOptionValue(e,n),r||this.tn.skip(";")},o._parseOptionValue=function(e,r){var i=this.tn.peek();if("{"!==i)c(e.options,r,this._readValue(!0));else for(this.tn.skip("{");"}"!==(i=this.tn.next());){if(!t.NAME.test(i))throw Error("illegal option name: "+r+"."+i);this.tn.omit(":")?c(e.options,r+"."+i,this._readValue(!0)):this._parseOptionValue(e,r+"."+i)}},o._parseService=function(e){var r=this.tn.next();if(!t.NAME.test(r))throw Error("illegal service name at line "+this.tn.line+": "+r);var i={name:r,rpc:{},options:{}};for(this.tn.skip("{");"}"!==(r=this.tn.next());)if("option"===r)this._parseOption(i);else{if("rpc"!==r)throw Error("illegal service token: "+r);this._parseServiceRPC(i)}this.tn.omit(";"),e.services.push(i)},o._parseServiceRPC=function(e){var r="rpc",i=this.tn.next();if(!t.NAME.test(i))throw Error("illegal rpc service method name: "+i);var s=i,n={request:null,response:null,request_stream:!1,response_stream:!1,options:{}};if(this.tn.skip("("),"stream"===(i=this.tn.next()).toLowerCase()&&(n.request_stream=!0,i=this.tn.next()),!t.TYPEREF.test(i))throw Error("illegal rpc service request type: "+i);if(n.request=i,this.tn.skip(")"),"returns"!==(i=this.tn.next()).toLowerCase())throw Error("illegal rpc service request type delimiter: "+i);if(this.tn.skip("("),"stream"===(i=this.tn.next()).toLowerCase()&&(n.response_stream=!0,i=this.tn.next()),n.response=i,this.tn.skip(")"),"{"===(i=this.tn.peek())){for(this.tn.next();"}"!==(i=this.tn.next());){if("option"!==i)throw Error("illegal rpc service token: "+i);this._parseOption(n)}this.tn.omit(";")}else this.tn.skip(";");void 0===e[r]&&(e[r]={}),e[r][s]=n},o._parseMessage=function(e,r){var i=!!r,s=this.tn.next(),n={name:"",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!t.NAME.test(s))throw Error("illegal "+(i?"group":"message")+" name: "+s);for(n.name=s,i&&(this.tn.skip("="),r.id=a(this.tn.next()),n.isGroup=!0),"["===(s=this.tn.peek())&&r&&this._parseFieldOptions(r),this.tn.skip("{");"}"!==(s=this.tn.next());)if(t.RULE.test(s))this._parseMessageField(n,s);else if("oneof"===s)this._parseMessageOneOf(n);else if("enum"===s)this._parseEnum(n);else if("message"===s)this._parseMessage(n);else if("option"===s)this._parseOption(n);else if("service"===s)this._parseService(n);else if("extensions"===s)n.hasOwnProperty("extensions")?n.extensions=n.extensions.concat(this._parseExtensionRanges()):n.extensions=this._parseExtensionRanges();else if("reserved"===s)this._parseIgnored();else if("extend"===s)this._parseExtend(n);else{if(!t.TYPEREF.test(s))throw Error("illegal message token: "+s);if(!this.proto3)throw Error("illegal field rule: "+s);this._parseMessageField(n,"optional",s)}return this.tn.omit(";"),e.messages.push(n),n},o._parseIgnored=function(){for(;";"!==this.tn.peek();)this.tn.next();this.tn.skip(";")},o._parseMessageField=function(e,r,i){if(!t.RULE.test(r))throw Error("illegal message field rule: "+r);var s,n={rule:r,type:"",name:"",options:{},id:0};if("map"===r){if(i)throw Error("illegal type: "+i);if(this.tn.skip("<"),s=this.tn.next(),!t.TYPE.test(s)&&!t.TYPEREF.test(s))throw Error("illegal message field type: "+s);if(n.keytype=s,this.tn.skip(","),s=this.tn.next(),!t.TYPE.test(s)&&!t.TYPEREF.test(s))throw Error("illegal message field: "+s);if(n.type=s,this.tn.skip(">"),s=this.tn.next(),!t.NAME.test(s))throw Error("illegal message field name: "+s);n.name=s,this.tn.skip("="),n.id=a(this.tn.next()),"["===(s=this.tn.peek())&&this._parseFieldOptions(n),this.tn.skip(";")}else if("group"===(i=void 0!==i?i:this.tn.next())){var o=this._parseMessage(e,n);if(!/^[A-Z]/.test(o.name))throw Error("illegal group name: "+o.name);n.type=o.name,n.name=o.name.toLowerCase(),this.tn.omit(";")}else{if(!t.TYPE.test(i)&&!t.TYPEREF.test(i))throw Error("illegal message field type: "+i);if(n.type=i,s=this.tn.next(),!t.NAME.test(s))throw Error("illegal message field name: "+s);n.name=s,this.tn.skip("="),n.id=a(this.tn.next()),"["===(s=this.tn.peek())&&this._parseFieldOptions(n),this.tn.skip(";")}return e.fields.push(n),n},o._parseMessageOneOf=function(e){var r=this.tn.next();if(!t.NAME.test(r))throw Error("illegal oneof name: "+r);var i,s=r,n=[];for(this.tn.skip("{");"}"!==(r=this.tn.next());)(i=this._parseMessageField(e,"optional",r)).oneof=s,n.push(i.id);this.tn.omit(";"),e.oneofs[s]=n},o._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()},o._parseEnum=function(e){var r={name:"",values:[],options:{}},i=this.tn.next();if(!t.NAME.test(i))throw Error("illegal name: "+i);for(r.name=i,this.tn.skip("{");"}"!==(i=this.tn.next());)if("option"===i)this._parseOption(r);else{if(!t.NAME.test(i))throw Error("illegal name: "+i);this.tn.skip("=");var s={name:i,id:a(this.tn.next(),!0)};"["===(i=this.tn.peek())&&this._parseFieldOptions({options:{}}),this.tn.skip(";"),r.values.push(s)}this.tn.omit(";"),e.enums.push(r)},o._parseExtensionRanges=function(){var t,r,i,s=[];do{for(r=[];;){switch(t=this.tn.next()){case"min":i=e.ID_MIN;break;case"max":i=e.ID_MAX;break;default:i=l(t)}if(r.push(i),2===r.length)break;if("to"!==this.tn.peek()){r.push(i);break}this.tn.next()}s.push(r)}while(this.tn.omit(","));return this.tn.skip(";"),s},o._parseExtend=function(e){var r=this.tn.next();if(!t.TYPEREF.test(r))throw Error("illegal extend reference: "+r);var i={ref:r,fields:[]};for(this.tn.skip("{");"}"!==(r=this.tn.next());)if(t.RULE.test(r))this._parseMessageField(i,r);else{if(!t.TYPEREF.test(r))throw Error("illegal extend token: "+r);if(!this.proto3)throw Error("illegal field rule: "+r);this._parseMessageField(i,"optional",r)}return this.tn.omit(";"),e.messages.push(i),i},o.toString=function(){return"Parser at line "+this.tn.line},r.Parser=n,r}(t,t.Lang),t.Reflect=function(e){var t={},i=function(e,t,r){this.builder=e,this.parent=t,this.name=r,this.className},s=i.prototype;s.fqn=function(){for(var e=this.name,t=this;;){if(null==(t=t.parent))break;e=t.name+"."+e}return e},s.toString=function(e){return(e?this.className+" ":"")+this.fqn()},s.build=function(){throw Error(this.toString(!0)+" cannot be built directly")},t.T=i;var n=function(e,t,r,s,n){i.call(this,e,t,r),this.className="Namespace",this.children=[],this.options=s||{},this.syntax=n||"proto2"},o=n.prototype=Object.create(i.prototype);o.getChildren=function(e){if(null==(e=e||null))return this.children.slice();for(var t=[],r=0,i=this.children.length;r<i;++r)this.children[r]instanceof e&&t.push(this.children[r]);return t},o.addChild=function(e){var t;if(t=this.getChild(e.name))if(t instanceof d.Field&&t.name!==t.originalName&&null===this.getChild(t.originalName))t.name=t.originalName;else{if(!(e instanceof d.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)},o.getChild=function(e){for(var t="number"==typeof e?"id":"name",r=0,i=this.children.length;r<i;++r)if(this.children[r][t]===e)return this.children[r];return null},o.resolve=function(e,r){var i,s="string"==typeof e?e.split("."):e,n=this,o=0;if(""===s[o]){for(;null!==n.parent;)n=n.parent;o++}do{do{if(!(n instanceof t.Namespace)){n=null;break}if(!(i=n.getChild(s[o]))||!(i instanceof t.T)||r&&!(i instanceof t.Namespace)){n=null;break}n=i,o++}while(o<s.length);if(null!=n)break;if(null!==this.parent)return this.parent.resolve(e,r)}while(null!=n);return n},o.qn=function(e){var r=[],i=e;do{r.unshift(i.name),i=i.parent}while(null!==i);for(var s=1;s<=r.length;s++){var n=r.slice(r.length-s);if(e===this.resolve(n,e instanceof t.Namespace))return n.join(".")}return e.fqn()},o.build=function(){for(var e,t={},r=this.children,i=0,s=r.length;i<s;++i)(e=r[i])instanceof n&&(t[e.name]=e.build());return Object.defineProperty&&Object.defineProperty(t,"$options",{value:this.buildOpt()}),t},o.buildOpt=function(){for(var e={},t=Object.keys(this.options),r=0,i=t.length;r<i;++r){var s=t[r],n=this.options[t[r]];e[s]=n}return e},o.getOption=function(e){return void 0===e?this.options:void 0!==this.options[e]?this.options[e]:null},t.Namespace=n;var a=function(t,r,i,s,n){if(this.type=t,this.resolvedType=r,this.isMapKey=i,this.syntax=s,this.name=n,i&&e.MAP_KEY_TYPES.indexOf(t)<0)throw Error("Invalid map key type: "+t.name)},l=a.prototype;function c(t,r){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===r?t.unsigned:r);if("string"==typeof t)return e.Long.fromString(t,r||!1,10);if("number"==typeof t)return e.Long.fromNumber(t,r||!1);throw Error("not convertible to Long")}a.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},l.toString=function(){return(this.name||"")+(this.isMapKey?"map":"value")+" element"},l.verifyValue=function(t){var i=this;function s(e,t){throw Error("Illegal value for "+i.toString(!0)+" of type "+i.type.name+": "+e+" ("+t+")")}switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:return("number"!=typeof t||t==t&&t%1!=0)&&s(typeof t,"not an integer"),t>4294967295?0|t:t;case e.TYPES.uint32:case e.TYPES.fixed32:return("number"!=typeof t||t==t&&t%1!=0)&&s(typeof t,"not an integer"),t<0?t>>>0:t;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:if(e.Long)try{return c(t,!1)}catch(e){s(typeof t,e.message)}else s(typeof t,"requires Long.js");case e.TYPES.uint64:case e.TYPES.fixed64:if(e.Long)try{return c(t,!0)}catch(e){s(typeof t,e.message)}else s(typeof t,"requires Long.js");case e.TYPES.bool:return"boolean"!=typeof t&&s(typeof t,"not a boolean"),t;case e.TYPES.float:case e.TYPES.double:return"number"!=typeof t&&s(typeof t,"not a number"),t;case e.TYPES.string:return"string"==typeof t||t&&t instanceof String||s(typeof t,"not a string"),""+t;case e.TYPES.bytes:return r.isByteBuffer(t)?t:r.wrap(t,"base64");case e.TYPES.enum:var n=this.resolvedType.getChildren(e.Reflect.Enum.Value);for(a=0;a<n.length;a++){if(n[a].name==t)return n[a].id;if(n[a].id==t)return n[a].id}if("proto3"===this.syntax)return("number"!=typeof t||t==t&&t%1!=0)&&s(typeof t,"not an integer"),(t>4294967295||t<0)&&s(typeof t,"not in range for uint32"),t;s(t,"not a valid enum value");case e.TYPES.group:case e.TYPES.message:if(t&&"object"==typeof t||s(typeof t,"object expected"),t instanceof this.resolvedType.clazz)return t;if(t instanceof e.Builder.Message){var o={};for(var a in t)t.hasOwnProperty(a)&&(o[a]=t[a]);t=o}return new this.resolvedType.clazz(t)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+t+" (undefined type "+this.type+")")},l.calculateLength=function(t,i){if(null===i)return 0;var s;switch(this.type){case e.TYPES.int32:return i<0?r.calculateVarint64(i):r.calculateVarint32(i);case e.TYPES.uint32:return r.calculateVarint32(i);case e.TYPES.sint32:return r.calculateVarint32(r.zigZagEncode32(i));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(i);case e.TYPES.sint64:return r.calculateVarint64(r.zigZagEncode64(i));case e.TYPES.fixed64:case e.TYPES.sfixed64:return 8;case e.TYPES.bool:return 1;case e.TYPES.enum:return r.calculateVarint32(i);case e.TYPES.double:return 8;case e.TYPES.string:return s=r.calculateUTF8Bytes(i),r.calculateVarint32(s)+s;case e.TYPES.bytes:if(i.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+i.remaining()+" bytes remaining");return r.calculateVarint32(i.remaining())+i.remaining();case e.TYPES.message:return s=this.resolvedType.calculate(i),r.calculateVarint32(s)+s;case e.TYPES.group:return(s=this.resolvedType.calculate(i))+r.calculateVarint32(t<<3|e.WIRE_TYPES.ENDGROUP)}throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+i+" (unknown type)")},l.encodeValue=function(t,i,s){if(null===i)return s;switch(this.type){case e.TYPES.int32:i<0?s.writeVarint64(i):s.writeVarint32(i);break;case e.TYPES.uint32:s.writeVarint32(i);break;case e.TYPES.sint32:s.writeVarint32ZigZag(i);break;case e.TYPES.fixed32:s.writeUint32(i);break;case e.TYPES.sfixed32:s.writeInt32(i);break;case e.TYPES.int64:case e.TYPES.uint64:s.writeVarint64(i);break;case e.TYPES.sint64:s.writeVarint64ZigZag(i);break;case e.TYPES.fixed64:s.writeUint64(i);break;case e.TYPES.sfixed64:s.writeInt64(i);break;case e.TYPES.bool:"string"==typeof i?s.writeVarint32("false"===i.toLowerCase()?0:!!i):s.writeVarint32(i?1:0);break;case e.TYPES.enum:s.writeVarint32(i);break;case e.TYPES.float:s.writeFloat32(i);break;case e.TYPES.double:s.writeFloat64(i);break;case e.TYPES.string:s.writeVString(i);break;case e.TYPES.bytes:if(i.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+i.remaining()+" bytes remaining");var n=i.offset;s.writeVarint32(i.remaining()),s.append(i),i.offset=n;break;case e.TYPES.message:var o=(new r).LE();this.resolvedType.encode(i,o),s.writeVarint32(o.offset),s.append(o.flip());break;case e.TYPES.group:this.resolvedType.encode(i,s),s.writeVarint32(t<<3|e.WIRE_TYPES.ENDGROUP);break;default:throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+i+" (unknown type)")}return s},l.decode=function(t,r,i){if(r!=this.type.wireType)throw Error("Unexpected wire type for element");var s,n;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(n=t.readVarint32(),t.remaining()<n)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+n+" required but got only "+t.remaining());return(s=t.clone()).limit=s.offset+n,t.offset+=n,s;case e.TYPES.message:return n=t.readVarint32(),this.resolvedType.decode(t,n);case e.TYPES.group:return this.resolvedType.decode(t,-1,i)}throw Error("[INTERNAL] Illegal decode type")},l.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)}},l.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()},t.Element=a;var d=function(e,t,r,i,s,o){n.call(this,e,t,r,i,o),this.className="Message",this.extensions=void 0,this.clazz=null,this.isGroup=!!s,this._fields=null,this._fieldsById=null,this._fieldsByName=null},_=d.prototype=Object.create(n.prototype);function u(t,r){var i=r.readVarint32(),s=7&i,n=i>>>3;switch(s){case e.WIRE_TYPES.VARINT:do{i=r.readUint8()}while(!(128&~i));break;case e.WIRE_TYPES.BITS64:r.offset+=8;break;case e.WIRE_TYPES.LDELIM:i=r.readVarint32(),r.offset+=i;break;case e.WIRE_TYPES.STARTGROUP:u(n,r);break;case e.WIRE_TYPES.ENDGROUP:if(n===t)return!1;throw Error("Illegal GROUPEND after unknown group: "+n+" ("+t+" expected)");case e.WIRE_TYPES.BITS32:r.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+t+": "+s)}return!0}_.build=function(t){if(this.clazz&&!t)return this.clazz;var i=function(e,t){var i=t.getChildren(e.Reflect.Message.Field),s=t.getChildren(e.Reflect.Message.OneOf),n=function(o,a){e.Builder.Message.call(this);for(var l=0,c=s.length;l<c;++l)this[s[l].name]=null;for(l=0,c=i.length;l<c;++l){var d=i[l];this[d.name]=d.repeated?[]:d.map?new e.Map(d):null,!d.required&&"proto3"!==t.syntax||null===d.defaultValue||(this[d.name]=d.defaultValue)}var _;if(arguments.length>0)if(1!==arguments.length||null===o||"object"!=typeof o||!("function"!=typeof o.encode||o instanceof n)||Array.isArray(o)||o instanceof e.Map||r.isByteBuffer(o)||o instanceof ArrayBuffer||e.Long&&o instanceof e.Long)for(l=0,c=arguments.length;l<c;++l)void 0!==(_=arguments[l])&&this.$set(i[l].name,_);else this.$set(o)},o=n.prototype=Object.create(e.Builder.Message.prototype);o.add=function(r,i,s){var n=t._fieldsByName[r];if(!s){if(!n)throw Error(this+"#"+r+" is undefined");if(!(n instanceof e.Reflect.Message.Field))throw Error(this+"#"+r+" is not a field: "+n.toString(!0));if(!n.repeated)throw Error(this+"#"+r+" is not a repeated field");i=n.verifyValue(i,!0)}return null===this[r]&&(this[r]=[]),this[r].push(i),this},o.$add=o.add,o.set=function(r,i,s){if(r&&"object"==typeof r){for(var n in s=i,r)r.hasOwnProperty(n)&&void 0!==(i=r[n])&&void 0===t._oneofsByName[n]&&this.$set(n,i,s);return this}var o=t._fieldsByName[r];if(s)this[r]=i;else{if(!o)throw Error(this+"#"+r+" is not a field: undefined");if(!(o instanceof e.Reflect.Message.Field))throw Error(this+"#"+r+" is not a field: "+o.toString(!0));this[o.name]=i=o.verifyValue(i)}if(o&&o.oneof){var a=this[o.oneof.name];null!==i?(null!==a&&a!==o.name&&(this[a]=null),this[o.oneof.name]=o.name):a===r&&(this[o.oneof.name]=null)}return this},o.$set=o.set,o.get=function(r,i){if(i)return this[r];var s=t._fieldsByName[r];if(!(s&&s instanceof e.Reflect.Message.Field))throw Error(this+"#"+r+" is not a field: undefined");if(!(s instanceof e.Reflect.Message.Field))throw Error(this+"#"+r+" is not a field: "+s.toString(!0));return this[s.name]},o.$get=o.get;for(var a=0;a<i.length;a++){var l=i[a];l instanceof e.Reflect.Message.ExtensionField||t.builder.options.populateAccessors&&function(e){var r=e.originalName.replace(/(_[a-zA-Z])/g,(function(e){return e.toUpperCase().replace("_","")}));r=r.substring(0,1).toUpperCase()+r.substring(1);var i=e.originalName.replace(/([A-Z])/g,(function(e){return"_"+e})),s=function(t,r){return this[e.name]=r?t:e.verifyValue(t),this},n=function(){return this[e.name]};null===t.getChild("set"+r)&&(o["set"+r]=s),null===t.getChild("set_"+i)&&(o["set_"+i]=s),null===t.getChild("get"+r)&&(o["get"+r]=n),null===t.getChild("get_"+i)&&(o["get_"+i]=n)}(l)}function c(t,i,s,n){if(null===t||"object"!=typeof t){if(n&&n instanceof e.Reflect.Enum){var o=e.Reflect.Enum.getName(n.object,t);if(null!==o)return o}return t}if(r.isByteBuffer(t))return i?t.toBase64():t.toBuffer();if(e.Long.isLong(t))return s?t.toString():e.Long.fromValue(t);var a;if(Array.isArray(t))return a=[],t.forEach((function(e,t){a[t]=c(e,i,s,n)})),a;if(a={},t instanceof e.Map){for(var l=t.entries(),d=l.next();!d.done;d=l.next())a[t.keyElem.valueToString(d.value[0])]=c(d.value[1],i,s,t.valueElem.resolvedType);return a}var _=t.$type,u=void 0;for(var h in t)t.hasOwnProperty(h)&&(_&&(u=_.getChild(h))?a[h]=c(t[h],i,s,u.resolvedType):a[h]=c(t[h],i,s));return a}return o.encode=function(e,i){"boolean"==typeof e&&(i=e,e=void 0);var s=!1;e||(e=new r,s=!0);var n=e.littleEndian;try{return t.encode(this,e.LE(),i),(s?e.flip():e).LE(n)}catch(t){throw e.LE(n),t}},n.encode=function(e,t,r){return new n(e).encode(t,r)},o.calculate=function(){return t.calculate(this)},o.encodeDelimited=function(e,i){var s=!1;e||(e=new r,s=!0);var n=(new r).LE();return t.encode(this,n,i).flip(),e.writeVarint32(n.remaining()),e.append(n),s?e.flip():e},o.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toArrayBuffer()),e}},o.toArrayBuffer=o.encodeAB,o.encodeNB=function(){try{return this.encode().toBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBuffer()),e}},o.toBuffer=o.encodeNB,o.encode64=function(){try{return this.encode().toBase64()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBase64()),e}},o.toBase64=o.encode64,o.encodeHex=function(){try{return this.encode().toHex()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toHex()),e}},o.toHex=o.encodeHex,o.toRaw=function(e,t){return c(this,!!e,!!t,this.$type)},o.encodeJSON=function(){return JSON.stringify(c(this,!0,!0,this.$type))},n.decode=function(e,i,s){"string"==typeof i&&(s=i,i=-1),"string"==typeof e?e=r.wrap(e,s||"base64"):r.isByteBuffer(e)||(e=r.wrap(e));var n=e.littleEndian;try{var o=t.decode(e.LE(),i);return e.LE(n),o}catch(t){throw e.LE(n),t}},n.decodeDelimited=function(e,i){if("string"==typeof e?e=r.wrap(e,i||"base64"):r.isByteBuffer(e)||(e=r.wrap(e)),e.remaining()<1)return null;var s=e.offset,n=e.readVarint32();if(e.remaining()<n)return e.offset=s,null;try{var o=t.decode(e.slice(e.offset,e.offset+n).LE());return e.offset+=n,o}catch(t){throw e.offset+=n,t}},n.decode64=function(e){return n.decode(e,"base64")},n.decodeHex=function(e){return n.decode(e,"hex")},n.decodeJSON=function(e){return new n(JSON.parse(e))},o.toString=function(){return t.toString()},Object.defineProperty&&(Object.defineProperty(n,"$options",{value:t.buildOpt()}),Object.defineProperty(o,"$options",{value:n.$options}),Object.defineProperty(n,"$type",{value:t}),Object.defineProperty(o,"$type",{value:t})),n}(e,this);this._fields=[],this._fieldsById={},this._fieldsByName={},this._oneofsByName={};for(var s,n=0,o=this.children.length;n<o;n++)if((s=this.children[n])instanceof I||s instanceof d||s instanceof R){if(i.hasOwnProperty(s.name))throw Error("Illegal reflect child of "+this.toString(!0)+": "+s.toString(!0)+" cannot override static property '"+s.name+"'");i[s.name]=s.build()}else if(s instanceof d.Field)s.build(),this._fields.push(s),this._fieldsById[s.id]=s,this._fieldsByName[s.name]=s;else if(s instanceof d.OneOf)this._oneofsByName[s.name]=s;else if(!(s instanceof d.OneOf||s instanceof T))throw Error("Illegal reflect child of "+this.toString(!0)+": "+this.children[n].toString(!0));return this.clazz=i},_.encode=function(e,t,r){for(var i,s,n=null,o=0,a=this._fields.length;o<a;++o)s=e[(i=this._fields[o]).name],i.required&&null===s?null===n&&(n=i):i.encode(r?s:i.verifyValue(s),t,e);if(null!==n){var l=Error("Missing at least one required field for "+this.toString(!0)+": "+n);throw l.encoded=t,l}return t},_.calculate=function(e){for(var t,r,i=0,s=0,n=this._fields.length;s<n;++s){if(r=e[(t=this._fields[s]).name],t.required&&null===r)throw Error("Missing at least one required field for "+this.toString(!0)+": "+t);i+=t.calculate(r,e)}return i},_.decode=function(t,r,i){"number"!=typeof r&&(r=-1);for(var s,n,o,a,l=t.offset,c=new this.clazz;t.offset<l+r||-1===r&&t.remaining()>0;){if(o=(s=t.readVarint32())>>>3,(n=7&s)===e.WIRE_TYPES.ENDGROUP){if(o!==i)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+o+" ("+(i?i+" expected":"not a group")+")");break}if(a=this._fieldsById[o]){if(a.repeated&&!a.options.packed)c[a.name].push(a.decode(n,t));else if(a.map){var d=a.decode(n,t);c[a.name].set(d[0],d[1])}else if(c[a.name]=a.decode(n,t),a.oneof){var _=c[a.oneof.name];null!==_&&_!==a.name&&(c[_]=null),c[a.oneof.name]=a.name}}else switch(n){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:var h=t.readVarint32();t.offset+=h;break;case e.WIRE_TYPES.STARTGROUP:for(;u(o,t););break;default:throw Error("Illegal wire type for unknown field "+o+" in "+this.toString(!0)+"#decode: "+n)}}for(var E=0,g=this._fields.length;E<g;++E)if(null===c[(a=this._fields[E]).name])if("proto3"===this.syntax)c[a.name]=a.defaultValue;else{if(a.required){var I=Error("Missing at least one required field for "+this.toString(!0)+": "+a.name);throw I.decoded=c,I}e.populateDefaults&&null!==a.defaultValue&&(c[a.name]=a.defaultValue)}return c},t.Message=d;var h=function(t,r,s,n,o,a,l,c,_,u){i.call(this,t,r,a),this.className="Message.Field",this.required="required"===s,this.repeated="repeated"===s,this.map="map"===s,this.keyType=n||null,this.type=o,this.resolvedType=null,this.id=l,this.options=c||{},this.defaultValue=null,this.oneof=_||null,this.syntax=u||"proto2",this.originalName=this.name,this.element=null,this.keyElement=null,!this.builder.options.convertFieldsToCamelCase||this instanceof d.ExtensionField||(this.name=e.Util.toCamelCase(this.name))},E=h.prototype=Object.create(i.prototype);E.build=function(){this.element=new a(this.type,this.resolvedType,!1,this.syntax,this.name),this.map&&(this.keyElement=new a(this.keyType,void 0,!0,this.syntax,this.name)),"proto3"!==this.syntax||this.repeated||this.map?void 0!==this.options.default&&(this.defaultValue=this.verifyValue(this.options.default)):this.defaultValue=a.defaultFieldValue(this.type)},E.verifyValue=function(t,r){r=r||!1;var i,s=this;function n(e,t){throw Error("Illegal value for "+s.toString(!0)+" of type "+s.type.name+": "+e+" ("+t+")")}if(null===t)return this.required&&n(typeof t,"required"),"proto3"===this.syntax&&this.type!==e.TYPES.message&&n(typeof t,"proto3 field without field presence cannot be null"),null;if(this.repeated&&!r){Array.isArray(t)||(t=[t]);var o=[];for(i=0;i<t.length;i++)o.push(this.element.verifyValue(t[i]));return o}return this.map&&!r?t instanceof e.Map?t:(t instanceof Object||n(typeof t,"expected ProtoBuf.Map or raw object for map field"),new e.Map(this,t)):(!this.repeated&&Array.isArray(t)&&n(typeof t,"no array expected"),this.element.verifyValue(t))},E.hasWirePresence=function(t,r){if("proto3"!==this.syntax)return null!==t;if(this.oneof&&r[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}},E.encode=function(t,i,s){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 i;try{var n;if(this.repeated)if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){i.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),i.ensureCapacity(i.offset+=1);var o=i.offset;for(n=0;n<t.length;n++)this.element.encodeValue(this.id,t[n],i);var a=i.offset-o,l=r.calculateVarint32(a);if(l>1){var c=i.slice(o,i.offset);o+=l-1,i.offset=o,i.append(c)}i.writeVarint32(a,o-l)}else for(n=0;n<t.length;n++)i.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,t[n],i);else this.map?t.forEach((function(t,s,n){var o=r.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,s)+r.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,t);i.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),i.writeVarint32(o),i.writeVarint32(8|this.keyType.wireType),this.keyElement.encodeValue(1,s,i),i.writeVarint32(16|this.type.wireType),this.element.encodeValue(2,t,i)}),this):this.hasWirePresence(t,s)&&(i.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,t,i))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+t+" ("+e+")")}return i},E.calculate=function(t,i){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;var s=0;try{var n,o;if(this.repeated)if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(s+=r.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),o=0,n=0;n<t.length;n++)o+=this.element.calculateLength(this.id,t[n]);s+=r.calculateVarint32(o),s+=o}else for(n=0;n<t.length;n++)s+=r.calculateVarint32(this.id<<3|this.type.wireType),s+=this.element.calculateLength(this.id,t[n]);else this.map?t.forEach((function(t,i,n){var o=r.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,i)+r.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,t);s+=r.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),s+=r.calculateVarint32(o),s+=o}),this):this.hasWirePresence(t,i)&&(s+=r.calculateVarint32(this.id<<3|this.type.wireType),s+=this.element.calculateLength(this.id,t))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+t+" ("+e+")")}return s},E.decode=function(t,r,i){var s,n;if(!(!this.map&&t==this.type.wireType||!i&&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&&!i){n=r.readVarint32(),n=r.offset+n;for(var o=[];r.offset<n;)o.push(this.decode(this.type.wireType,r,!0));return o}if(this.map){var l=a.defaultFieldValue(this.keyType);if(s=a.defaultFieldValue(this.type),n=r.readVarint32(),r.remaining()<n)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+n+" required but got only "+r.remaining());var c=r.clone();for(c.limit=c.offset+n,r.offset+=n;c.remaining()>0;){var d=c.readVarint32();t=7&d;var _=d>>>3;if(1===_)l=this.keyElement.decode(c,t,_);else{if(2!==_)throw Error("Unexpected tag in map field key/value submessage");s=this.element.decode(c,t,_)}}return[l,s]}return this.element.decode(r,t,this.id)},t.Message.Field=h;var g=function(e,t,r,i,s,n,o){h.call(this,e,t,r,null,i,s,n,o),this.extension};g.prototype=Object.create(h.prototype),t.Message.ExtensionField=g;t.Message.OneOf=function(e,t,r){i.call(this,e,t,r),this.fields=[]};var I=function(e,t,r,i,s){n.call(this,e,t,r,i,s),this.className="Enum",this.object=null};I.getName=function(e,t){for(var r,i=Object.keys(e),s=0;s<i.length;++s)if(e[r=i[s]]===t)return r;return null},(I.prototype=Object.create(n.prototype)).build=function(t){if(this.object&&!t)return this.object;for(var r=new e.Builder.Enum,i=this.getChildren(I.Value),s=0,n=i.length;s<n;++s)r[i[s].name]=i[s].id;return Object.defineProperty&&Object.defineProperty(r,"$options",{value:this.buildOpt(),enumerable:!1}),this.object=r},t.Enum=I;var p=function(e,t,r,s){i.call(this,e,t,r),this.className="Enum.Value",this.id=s};p.prototype=Object.create(i.prototype),t.Enum.Value=p;var T=function(e,t,r,s){i.call(this,e,t,r),this.field=s};T.prototype=Object.create(i.prototype),t.Extension=T;var R=function(e,t,r,i){n.call(this,e,t,r,i),this.className="Service",this.clazz=null};(R.prototype=Object.create(n.prototype)).build=function(t){return this.clazz&&!t?this.clazz:this.clazz=function(e,t){for(var i=function(t){e.Builder.Service.call(this),this.rpcImpl=t||function(e,t,r){setTimeout(r.bind(this,Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")),0)}},s=i.prototype=Object.create(e.Builder.Service.prototype),n=t.getChildren(e.Reflect.Service.RPCMethod),o=0;o<n.length;o++)!function(e){s[e.name]=function(i,s){try{try{i=e.resolvedRequestType.clazz.decode(r.wrap(i))}catch(e){if(!(e instanceof TypeError))throw e}if(null===i||"object"!=typeof i)throw Error("Illegal arguments");i instanceof e.resolvedRequestType.clazz||(i=new e.resolvedRequestType.clazz(i)),this.rpcImpl(e.fqn(),i,(function(r,i){if(r)s(r);else{null===i&&(i="");try{i=e.resolvedResponseType.clazz.decode(i)}catch(e){}i&&i instanceof e.resolvedResponseType.clazz?s(null,i):s(Error("Illegal response type received in service method "+t.name+"#"+e.name))}}))}catch(e){setTimeout(s.bind(this,e),0)}},i[e.name]=function(t,r,s){new i(t)[e.name](r,s)},Object.defineProperty&&(Object.defineProperty(i[e.name],"$options",{value:e.buildOpt()}),Object.defineProperty(s[e.name],"$options",{value:i[e.name].$options}))}(n[o]);return Object.defineProperty&&(Object.defineProperty(i,"$options",{value:t.buildOpt()}),Object.defineProperty(s,"$options",{value:i.$options}),Object.defineProperty(i,"$type",{value:t}),Object.defineProperty(s,"$type",{value:t})),i}(e,this)},t.Service=R;var f=function(e,t,r,s){i.call(this,e,t,r),this.className="Service.Method",this.options=s||{}};(f.prototype=Object.create(i.prototype)).buildOpt=o.buildOpt,t.Service.Method=f;var A=function(e,t,r,i,s,n,o,a){f.call(this,e,t,r,a),this.className="Service.RPCMethod",this.requestName=i,this.responseName=s,this.requestStream=n,this.responseStream=o,this.resolvedRequestType=null,this.resolvedResponseType=null};return A.prototype=Object.create(f.prototype),t.Service.RPCMethod=A,t}(t),t.Builder=function(e,t,r){var i=function(e){this.ns=new r.Namespace(this,null,""),this.ptr=this.ns,this.resolved=!1,this.result=null,this.files={},this.importRoot=null,this.options=e||{}},s=i.prototype;function n(e){e.messages&&e.messages.forEach((function(t){t.syntax=e.syntax,n(t)})),e.enums&&e.enums.forEach((function(t){t.syntax=e.syntax}))}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},s.reset=function(){return this.ptr=this.ns,this},s.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 r.Namespace(this,this.ptr,e)),this.ptr=t}),this),this},s.create=function(t){if(!t)return this;if(Array.isArray(t)){if(0===t.length)return this;t=t.slice()}else t=[t];for(var s=[t];s.length>0;){if(t=s.pop(),!Array.isArray(t))throw Error("not a valid namespace: "+JSON.stringify(t));for(;t.length>0;){var n=t.shift();if(i.isMessage(n)){var o=new r.Message(this,this.ptr,n.name,n.options,n.isGroup,n.syntax),a={};n.oneofs&&Object.keys(n.oneofs).forEach((function(e){o.addChild(a[e]=new r.Message.OneOf(this,o,e))}),this),n.fields&&n.fields.forEach((function(e){if(null!==o.getChild(0|e.id))throw Error("duplicate or invalid field id in "+o.name+": "+e.id);if(e.options&&"object"!=typeof e.options)throw Error("illegal field options in "+o.name+"#"+e.name);var t=null;if("string"==typeof e.oneof&&!(t=a[e.oneof]))throw Error("illegal oneof in "+o.name+"#"+e.name+": "+e.oneof);e=new r.Message.Field(this,o,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,n.syntax),t&&t.fields.push(e),o.addChild(e)}),this);var l=[];if(n.enums&&n.enums.forEach((function(e){l.push(e)})),n.messages&&n.messages.forEach((function(e){l.push(e)})),n.services&&n.services.forEach((function(e){l.push(e)})),n.extensions&&("number"==typeof n.extensions[0]?o.extensions=[n.extensions]:o.extensions=n.extensions),this.ptr.addChild(o),l.length>0){s.push(t),t=l,l=null,this.ptr=o,o=null;continue}l=null}else if(i.isEnum(n))o=new r.Enum(this,this.ptr,n.name,n.options,n.syntax),n.values.forEach((function(e){o.addChild(new r.Enum.Value(this,o,e.name,e.id))}),this),this.ptr.addChild(o);else if(i.isService(n))o=new r.Service(this,this.ptr,n.name,n.options),Object.keys(n.rpc).forEach((function(e){var t=n.rpc[e];o.addChild(new r.Service.RPCMethod(this,o,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))}),this),this.ptr.addChild(o);else{if(!i.isExtend(n))throw Error("not a valid definition: "+JSON.stringify(n));if(o=this.ptr.resolve(n.ref,!0))n.fields.forEach((function(t){if(null!==o.getChild(0|t.id))throw Error("duplicate extended field id in "+o.name+": "+t.id);if(o.extensions){var i=!1;if(o.extensions.forEach((function(e){t.id>=e[0]&&t.id<=e[1]&&(i=!0)})),!i)throw Error("illegal extended field id in "+o.name+": "+t.id+" (not within valid ranges)")}var s=t.name;this.options.convertFieldsToCamelCase&&(s=e.Util.toCamelCase(s));var n=new r.Message.ExtensionField(this,o,t.rule,t.type,this.ptr.fqn()+"."+s,t.id,t.options),a=new r.Extension(this,this.ptr,t.name,n);n.extension=a,this.ptr.addChild(a),o.addChild(n)}),this);else if(!/\.?google\.protobuf\./.test(n.ref))throw Error("extended message "+n.ref+" is not defined")}n=null,o=null}t=null,this.ptr=this.ptr.parent}return this.resolved=!1,this.result=null,this},s.import=function(t,r){var i="/";if("string"==typeof r){if(e.Util.IS_NODE&&(r=require("path").resolve(r)),!0===this.files[r])return this.reset();this.files[r]=!0}else if("object"==typeof r){var s,o=r.root;if(e.Util.IS_NODE&&(o=require("path").resolve(o)),(o.indexOf("\\")>=0||r.file.indexOf("\\")>=0)&&(i="\\"),s=e.Util.IS_NODE?require("path").join(o,r.file):o+i+r.file,!0===this.files[s])return this.reset();this.files[s]=!0}if(t.imports&&t.imports.length>0){var a,l=!1;"object"==typeof r?(this.importRoot=r.root,l=!0,a=this.importRoot,r=r.file,(a.indexOf("\\")>=0||r.indexOf("\\")>=0)&&(i="\\")):"string"==typeof r?this.importRoot?a=this.importRoot:r.indexOf("/")>=0?""===(a=r.replace(/\/[^\/]*$/,""))&&(a="/"):r.indexOf("\\")>=0?(a=r.replace(/\\[^\\]*$/,""),i="\\"):a=".":a=null;for(var c=0;c<t.imports.length;c++)if("string"==typeof t.imports[c]){if(!a)throw Error("cannot determine import root");var d=t.imports[c];if("google/protobuf/descriptor.proto"===d)continue;if(d=e.Util.IS_NODE?require("path").join(a,d):a+i+d,!0===this.files[d])continue;/\.proto$/i.test(d)&&!e.DotProto&&(d=d.replace(/\.proto$/,".json"));var _=e.Util.fetch(d);if(null===_)throw Error("failed to import '"+d+"' in '"+r+"': file not found");/\.json$/i.test(d)?this.import(JSON.parse(_+""),d):this.import(e.DotProto.Parser.parse(_),d)}else r?/\.(\w+)$/.test(r)?this.import(t.imports[c],r.replace(/^(.+)\.(\w+)$/,(function(e,t,r){return t+"_import"+c+"."+r}))):this.import(t.imports[c],r+"_import"+c):this.import(t.imports[c]);l&&(this.importRoot=null)}t.package&&this.define(t.package),t.syntax&&n(t);var u=this.ptr;return t.options&&Object.keys(t.options).forEach((function(e){u.options[e]=t.options[e]})),t.messages&&(this.create(t.messages),this.ptr=u),t.enums&&(this.create(t.enums),this.ptr=u),t.services&&(this.create(t.services),this.ptr=u),t.extends&&this.create(t.extends),this.reset()},s.resolveAll=function(){var i;if(null==this.ptr||"object"==typeof this.ptr.type)return this;if(this.ptr instanceof r.Namespace)this.ptr.children.forEach((function(e){this.ptr=e,this.resolveAll()}),this);else if(this.ptr instanceof r.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(!(i=(this.ptr instanceof r.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=i,i instanceof r.Enum){if(this.ptr.type=e.TYPES.enum,"proto3"===this.ptr.syntax&&"proto3"!==i.syntax)throw Error("proto3 message cannot reference proto2 enum")}else{if(!(i instanceof r.Message))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);this.ptr.type=i.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]}"proto3"===this.ptr.syntax&&this.ptr.repeated&&void 0===this.ptr.options.packed&&-1!==e.PACKABLE_WIRE_TYPES.indexOf(this.ptr.type.wireType)&&(this.ptr.options.packed=!0)}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(!((i=this.ptr.parent.resolve(this.ptr.requestName,!0))&&i instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.requestName);if(this.ptr.resolvedRequestType=i,!((i=this.ptr.parent.resolve(this.ptr.responseName,!0))&&i instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.responseName);this.ptr.resolvedResponseType=i}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()},s.build=function(e){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(var t="string"==typeof e?e.split("."):e,r=this.result,i=0;i<t.length;i++){if(!r[t[i]]){r=null;break}r=r[t[i]]}return r},s.lookup=function(e,t){return e?this.ns.resolve(e,t):this.ns},s.toString=function(){return"Builder"},i.Message=function(){},i.Enum=function(){},i.Service=function(){},i}(t,t.Lang,t.Reflect),t.Map=function(e,t){var r=function(e,r){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}}),r)for(var i=Object.keys(r),s=0;s<i.length;s++){var n=this.keyElem.valueFromString(i[s]),o=this.valueElem.verifyValue(r[i[s]]);this.map[this.keyElem.valueToString(n)]={key:n,value:o}}},i=r.prototype;function s(e){var t=0;return{next:function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}}return i.clear=function(){this.map={}},i.delete=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e)),r=t in this.map;return delete this.map[t],r},i.entries=function(){for(var e,t=[],r=Object.keys(this.map),i=0;i<r.length;i++)t.push([(e=this.map[r[i]]).key,e.value]);return s(t)},i.keys=function(){for(var e=[],t=Object.keys(this.map),r=0;r<t.length;r++)e.push(this.map[t[r]].key);return s(e)},i.values=function(){for(var e=[],t=Object.keys(this.map),r=0;r<t.length;r++)e.push(this.map[t[r]].value);return s(e)},i.forEach=function(e,t){for(var r,i=Object.keys(this.map),s=0;s<i.length;s++)e.call(t,(r=this.map[i[s]]).value,r.key,this)},i.set=function(e,t){var r=this.keyElem.verifyValue(e),i=this.valueElem.verifyValue(t);return this.map[this.keyElem.valueToString(r)]={key:r,value:i},this},i.get=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e));if(t in this.map)return this.map[t].value},i.has=function(e){return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map},r}(0,t.Reflect),t.loadProto=function(e,r,i){return("string"==typeof r||r&&"string"==typeof r.file&&"string"==typeof r.root)&&(i=r,r=void 0),t.loadJson(t.DotProto.Parser.parse(e),r,i)},t.newBuilder=function(e){return void 0===(e=e||{}).convertFieldsToCamelCase&&(e.convertFieldsToCamelCase=t.convertFieldsToCamelCase),void 0===e.populateAccessors&&(e.populateAccessors=t.populateAccessors),new t.Builder(e)},t.loadJson=function(e,r,i){return("string"==typeof r||r&&"string"==typeof r.file&&"string"==typeof r.root)&&(i=r,r=null),r&&"object"==typeof r||(r=t.newBuilder()),"string"==typeof e&&(e=JSON.parse(e)),r.import(e,i),r.resolveAll(),r},t}(),no="NotifyMsg",oo="SyncRequestMsg",ao="UpStreamMessage",lo="DownStreamMessages",co="ChrmDownStreamMessages",_o="DownStreamMessage",uo="ExtMsgData",ho="GetQNupTokenInput",Eo="GetDownloadUrlInput",go="GetQNupTokenOutput",Io="GetDownloadUrlOutput",po="ChrmInput",To="ChrmOutput",Ro="ChrmPullMsg",fo="RelationQryInput",Ao="RelationQryFilter",mo="RelationsOutput",So="QryRemindListReq",vo="QryRemindListResp",Co="CleanHisMsgInput",yo="CleanMsgBatchReq",Oo="QueryChatRoomInfoInput",No="QueryChatRoomInfoOutput",Mo="HistoryMsgInput",bo="HistoryMsgOuput",Lo="SessionsAttQryInput",Uo="SessionsAttOutput",Po="SessionMsgReadInput",Do="DeleteSessionsInput",xo="QuerySessionsInput",wo="QuerySessionsOutPut",Go="RelationDelBatchReq",Vo="DeleteMsgInput",ko="SetChrmKV",Fo="SetChrmKVS",Bo="ChrmKVOutput",Ho="ChrmKVSOutput",jo="QueryChrmKV",Yo="SetUserSettingInput",Wo="SetUserSettingOutput",Jo="PullUserSettingInput",qo="PullUserSettingOutput",Ko="SessionReq",Qo="SessionStates",Xo="SessionStateModifyReq",zo="GroupUnpushQuery",Zo="GroupUnpushSet",$o="GroupUnpushResult",ea="SessionStateModifyResp",ta="TypeUnpushInput",ra="TypeUnpushOutput",ia="GrpReadReceiptMsg",sa="ReadReceipt",na="QueryReceiptReq",oa="QueryReceiptBatchReq",aa="ReceiptResp",la="QueryReceiptBatchResp",ca="GrpReadReceiptQryResp",da="SessionTagAddInput",_a="SessionTagDelInput",ua="UserSettingNotification",ha="ReportSDKInput",Ea="UltraGrpPullSes",ga="UltraGrpPullMsg",Ia="MsgChangeReq",pa="ModifyMsgResp",Ta="QueryMsgChange",Ra="EventChangeList",fa="MsgChangeList",Aa="MsgQuery",ma="MsgQueryAck",Sa="OperateStatus",va="OperateStatusNotify",Ca="SetRtcRoomIdInput",ya="CallInfoUpStream",Oa="CallInfoDownStream",Na="KvInput",Ma="KvOutput",ba="ReadReceiptMsg",La="ReceiptQryReq",Ua="QueryReceiptResp",Pa="ReceiptCntQryReq",Da="ReceiptCntQryResp",xa="UpdateUserSubReq",wa="UpdateUserSubResp",Ga="PullUserSubReq",Va="PUllUserSubResp",ka="PullSubDataReq",Fa="PullSubDataResp",Ba="SubDataDetail",Ha="QrySubDataReq",ja="UserProfile",Ya="SetUserProfileResp",Wa="PullUserProfileReq",Ja="UserProfiles",qa="UserProfileInput",Ka="UserProfilePermission",Qa="SearchUserProfile",Xa="ChannelsInput",za="ChannelsOutput",Za="MultiChannels",$a="ModifyChannelsInput",el="ChannelsQueryInput",tl="ChannelsListResult",rl="ChannelsInviteStatusInfos",il="ChannelsUserInfos",sl="ChannelsJoinedInfos",nl="ChannelsMemberUpdateInput",ol="ChannelsMemberResponseInput",al="ChannelsMembersInput",ll="FriendInput",cl="FriendsInput",dl="FriendsCheckOutput",_l="FriendProfileInput",ul="FriendProfileOutput",hl="FriendQueryInput",El="FriendsListInput",gl="FriendLevelSet",Il="FriendUserInfos",pl="FriendInviteInfos",Tl="ChannelApplyInfo",Rl="AddUnpushPeriodInput",fl="DeleteUnpushPeriodInput",Al="QueryUnpushPeriodInput",ml="QueryUnpushPeriodOutput",Sl="MsgReadEvent",vl="ConvertMsgInput",Cl="SpeechToTextInfo",yl="ConvertMsgOutput",Ol="SpeechToTextResult",Nl="TransReq",Ml="TransResp",bl="PullModifyMsgReq",Ll="PullModifyMsgResp",Ul="SessionQryInput",Pl="SessionsOutput",Dl="SetUserStatusInput",xl="MCFollowInput",wl="RtcQueryListInput",Gl="RtcKeyDeleteInput",Vl="RtcValueInfo",kl="RtcUserListOutput",Fl="RtcInput",Bl="RtcQryOutput",Hl="RtcDataInput",jl="RtcSetDataInput",Yl="RtcUserSetDataInput",Wl="RtcOutput",Jl="RtcTokenOutput",ql="RtcQueryUserJoinedInput",Kl="RtcQueryUserJoinedOutput",Ql="RtcViewerJoinedOutput",Xl="RtcInviteInput",zl="RtcCancelInviteInput",Zl="RtcInviteAnswerInput",$l="RtcEndInviteInput",ec="BotInput",tc="BotOutput",rc="ReactionInput",ic="ReactionAck",sc="ReactionBatchQry",nc="ReactionsOutput",oc="ReactionQry",ac="ReactionOutput",lc="ReactionUserOutput",cc="ReactionEvent",dc=(e=>{let t=0,r="";e:do{const i=e.charCodeAt(t++),s=i&vi,n=15&i;let o;switch(s){case Ai:const i=n>>2,a=3&n;if(0===i||0===a)throw new Error("Data parsing error,at "+t);let l=Mi(e.substr(t,i));const c=Mi(e.substr(t+=i,a));if(l=r.length-l,l+c>r.length)throw new Error("Data parsing error,at "+t);t+=a,r+=r.substr(l,c);break;case fi:if(o=Mi(e.substr(t,n)),o!==r.length)throw console.log(r.length),console.log(o),new Error("Data parsing error,at "+t);t+=n;break e;case mi:o=Mi(e.substr(t,n)),r+=e.substr(t+=n,o),t+=o;break;case Si:r+=e.substr(t,n),t+=n;break;case vi:if(n>10)throw new Error("Data parsing error,at "+t);r+=e.substr(t,16+n),t+=16+n;break;default:throw new Error("Data parsing error,at "+t+" header:"+s)}}while(t<e.length);return r})("upackage Modules;\nmessEH4kprobuf {\n EJ8sSetUserStatusOutputEW5QV optional int32 nothing=1;\n }I41BaGI41CbInJ3111I72Mistring stEZ4I416EUJbubIA14dId=2Ib1GaSER6Ie2IhrepeatedI618guserid If2II41DIm4rkVoipDynamicI62Egquired I116n engineType = Im37Ea9Ig27jchannelNamEb4Iq35IN4IEb7iExtra = 3IK2RIM3DIl1GadEa6cKeyIQ3IjNotifyMsg IJ3LatIC3DIn4Ce64 tiI43UermId=Iw25Ik5HgdestroyIj44b=4Is6HjyncRequestIT2Mh64 syncTI426Ij5Gkbool ispollIC24Ib2IEX7cwebIY2HER7iPullSend=IW25EWIdKeepIp84a5IW4LgsendBoxID34Id24b=6EcLibroadcastEe9a7EeLcendIl37a8IH2KucompressioEnabled = 9IS5GiUpStreamMEG7Iw7LbseI814cnIdIDBRglassnamI78BEZHfontentI6B8Ie8IkpushText = Ie5GEY7fappDatIBC4Ig57I4GGbtoI9H6ds = Id5MfdelMsgI257IY5GIlC8Ea5Ir35Ia5GIP46iconfigFlaIN94IU55Ig1HlclientUniqueI356a0Il1MfextraCIa49a1IiDGdPushI9G6Ie44cExtEb4IqDNdbusCIxG6Eb4In5NhsystemIdEZ4Ii4GEZ8lenderPortraiIp14a2I8GMEF6cBitIw54a2IP2GfExtMsgIz65cextEB8c= 2IT2NemetadEZ7IH8GiReferenceI615crefIE18IP85IeBCEgEIXQMamIi77IYQNdfromIQ96IhJRI9CBIiMHI27AI42MetitleIeLMIQP4otemplateIdNoUseI82PIX84Ie25IhDRfConfigIi64IkDNIl1AInD8IG3CdDownI4HDbs IQUFEYHe listICHJIDNHIgMLffinishIJJ5IJPJI8LKIX3JIj18I1C4EZ7IzMMmcredibleStartEg7IQHMEg8bEnIXM8IVHGIXMPICNHeytes Eg8bedIXB7IANHdChrmIC6YIG16I06zIv2KIuSHIv2MIXVHIV8II1ZMI0EDIx2GIhJ7Iqb5IjY7IRCNegroupISCCIFRSIt87IFRQIAQ9I95DIuI4Ii8EIg5GIEg5IZ8JIcV7Ird7IO8GInIFIwPJIQb4direcEI4IrPKEZ6lplantform =1IqHMgisRemovId75IkPOfsourceIgPKI9SOIpHNI9SGIMEGI3JEEc8IIEJIbUGa1If5GILTLIm5NILTEIoVMcextIdn6I4A4Is57IcYSIGTKc32 IeA5bUnIO24IHTKIrTKIlNNgconvertIW36IETHISUPIy5NISUCIv5GISUPI065I1GCIu1BIHsIIyi5aqIOULISjAIlICIS14eenum IJGCIQ16fPERSONIC1AEG6aSIiGAeGROUPIQGAdTEMPEJ8Ip47oCUSTOMERSERVICEI2GAfNOTIFYIlFAbMCI2l8cMP=IK97eULTRAIJ18INE6ICNDkreateDiscusIuj5MR01KI667IaI7IItHI61GITuTIqy4I51JI256gInvitatIC2FIzzKI4A4I81HeLeaveID19IwyPIxz7IC2RcEviIKJ5I71LIA2BI51KbReIm44IA2SIP5WEx8bfoIB3zI314IN6MIFRJMA31UINgCMj31UIsRNeadminIZT9IuR9Ic7EhfirstTenI1JAI2SJg32 openIAK9IJC5I64NMN91FI71Depage IKiOdnumbIi75MuA1HIW1CId5FIJ37IA6IIg47I9B9ME61Ieotal Im1JbMeIC24ID14IPARIBzSEW4MLA1EEYKIFsBIE7NeextenIwF4ItbKaGISP4Il26Jy5L1IW1CIy5MIk4BbmeEe5Iq5oM7K17IHEwI31BIeKTJ07O1IE2FbSeMr717II3vI419IJ3MMW91NI2T9dFileIzSBdIMAGIkR4Iw37eAUDIOId3AdVIDEEF4IGA7cFILEi4I7H7eSIGHTIhGAlCOMBINE_HTMLIUGKlGetQNupTokenI54LIU29MVK1NIl57ckeyIFmQjhttpMethodIkyQhqueryStrIj56IvgNburIXA4InaNMQD16IuuMcsizIjuKI4k7bpTIY36I5X5Ic4HkdownloadUrlIg4iIRAGIg4Te fileI5PCIA2FIEt4J82Y1I72GIi5OMr11NIi56Ml11JIi5CIKATILDPMZJ15eadlinIY3RetokenIa3QcbosId15Ia3QfbosDatMV51KIaq8batIxm4c5;\nEVLfosskeyIxF5M1I1NhossPolicIH64MjM1NfossSigIg24IwqNiossBucketIt67c9;\nIBvMi3CredentiIlN5MmM1Oms3Algorithm =MlM1IEc9IY47IxwPa3IV39MfM1Pa3IV34eatureIxwRbs3Ia3DIxw4MHk1NicAuthorizIQj5M3O1SbtcIex7fSha256IAxKEhAIl38IB6NcstcIb2EIC6OeminioId2GILx8EjLIf2GIUxHEjCIh27ITxHEaCIj2DIZx4MpW1MIzH7Im24IMX5IgxJIGAAM1M16MpQ1LINLGMUl1UEeAIEUNIRKBIC1ymAdd2BlackListI8qWIOVEIAqAhmoveFromJB111aQISS4I61UImYXI61EIneMID2DIivLI319Mnw1KIL3eiBlockPushI11SgblockeeI41MkModifyPermiMC11HIjqSI29IMrK15M001KEQ7cfo MRL16IuB6I31MICeSIHfSIR19M531WIFzPIcmMcHasIc5TIsjWIu35I714dCodeIe1TI24MEV9IyV5eresulMdU19IJi9EbEI416ME915n_SUCCESS = 0x0IYK7EQ6fFAILURIEi4c0x0MG21JcrmIIrCfMpM1NI5yMbrmIo7hM2o1KIXmAM5K1MdjoinM6G17M1Q1NMHC15MEe1Qc32 I5u6cCouMOV1CMHP1GjhatroomBanIkC4MEe1Nh32 whiteIAG8IUj9IU4GdPullMU52qMYR18Il26IR4JI2z4IU16IKf7Ma52LMLd1KMp01HIi2BcNewIG7MIE28MWf1nMnA2JIpOEilationQryMMK1LMsC1QMNW1HIp4PMRc16Mhl19MvC2MeorderIC9JMLA27hEraseMsgMZY1AMWn1MM2R1AI89GIS6PIesMcqryIfsCMgB1IEU5MaB17Eg7M1f1MdbotTI457McQ1HIB6BgFilter MRD1MIC6zIe5BMeB19MCb1FbagM5x1KI867fTagTopIOyQdpageIfp8I26TI3FKIA48MbB1NEV8IwQ5binISSAIh2IbFiMTx19IPAMIEF4IOANIBFRa MXs1bIZ4eI34KIUUKMCR1gIcT9Ix3GMdu1Iemsg =IiNMdreadMZH27M501ObunEb4IiN5Is3PMnl1DMw61McverIVQ4Mm12NII28cminIj16MJJ2PIj1AIQENbUnIR37MrK16E87MXt1PIs16bMeIu18IdwHIv97bBoMHJ2AMdQ2DIn1DIWaMMzE2FIqNFcmsgIC66IYFMIb26M6Y25Mi31OMM025I4s7IRQHiQryRemindIlT4cReqIe2NMz12AIlXOIp7DI7EMIH37IUOPMZ917Ie2WbspImGGIZ7PItDSdReadIJ25I1EoIsCJM0R1NgtargetIMkK19IYWDgleanHisIy25IEKAI71TIE27M572SIE27MX12KI2E4I845I29DIQ7VIWZIIy24hMsgBatchI59AIMRCIW3GbinE64IT6JgHistoryImI7IWnSID4IIB4PIO6GIm9BIK6AI92PcsOuIdQJNgO231II2FbhaIc44IKkSMQN2HIjMMMQN2IIoMGIzRPb6;IzRcITVHMM215hChatRoomMZf1VI9Z5IcZOI8Z5IZq9Ia1SMZy2SIbS4iTotalNumsIV6CIvb9brmMSj16IIT6dnfosITsOEe7IynLMSv27IlUNIoz5M8q1IgPFollowInBSMp32CExJIqusaMMa216Ieb6Ih5IbMCJV1U1Ma41SdmpidM7838Ma41SIZGJI2tDIf6JMXy2HIzc8Mkn17cUrlMby2HM411EITd7MlD3DdarchIO34Im4PIS24IO3Ocid=Ie4IIM18I96ZIQ1AMxu18I76CIKDJIew5Io2PIn48Io2NIe65IM1OMIr1TMiF3DIn2UIbMIIvSEMLm2HIgOHMIA3cIjrCIOxnI4TKI5MhItfKggnoreCmMS03AIvQLbsgIqQhIM7HIoQEI4TNImQ6IMnNJkQf1IjQsMo127dsAttMa61FMgN1gI61BMbp1SeinboxMSC1QMVW27EaAIr5JIlA4IDR4Irh6Ido8IQfHIL27cMsgIfh4IR3LIghfI1lAMqM2UM813SIGfUIo2EMuT3rgDeleteSIK67M4W1LMh928IRH4MlM17M8X1LEeCNrR2E1IWzQI25uIQa5Jw371IC1DeOutPuID1vIM6EIR7rI1t8cDelIpnFM1B1HaOIDR7breEG6M8B1ObclI7p6IbPKIE1GIeYMIMrCMp13XI5sGMO52RIm7CIcFHIN56I5SOMMJ1ZI33OIfF9IyO8Ih18IFG4Ic74IbArI81AMUL3kIDI9IJN4MOU1NMH33CIrzLlhrmKVEntity IH7MMJF26IGFNevalueIw1PMh639IQSMInX4estampMUM2RInl5M5U1MM5F17MUJ1KcSetIW36ImIIIs3BeentryIKCOabMbl36IY3JMAe3GgnotificIaD8Io3GI4AJIwNJIq27bS MQU1HJr2P2IAB6Ju2o2IR26Men2OIt2FbieIvyBIv2FiFullUpdatIICNMz51EN9W1O1IV3IbSVIeC6IhFDIDDPMKc2YIljDIb17I75SET7IE58grrorKeyMB41OIq2HdkeysEI7MN41OIc1GIPLMIMJDIrIFIQ25MI22OMr717IPHKIMJIIgTMIa7JM594IMgA47fettingIKwRIv67INwOIdM5Izo8ICrKIO5AI4jJI82CISlSI92OIg15greserveI92MbupIwC4I92RI7z4II4rIg1EI92OMDf2FI32WInBMIa2Chtem itemMdy2NIi2BM8d1II91FMAQ1UMbd3iIiVMMyc3GIiH6IhV8Mvc3MI338Msc3JMU51AMdj17IuiGcTagIU35dtagsMmq2JEc7MYe1JMoJ1IEuJMD925MTl3AIqAUIT2EMAA26I334MXb18IY1OJUqU1Ic37MLz1GI32CI955Ii25EA5MK81hIN3OIx9KEWCIW35Iwp7EHAIweeII8SI3fTIOVCMlN25IO2HMC637esSileMeD2CbIsMc326I627cTagIi1BgAutoTraICt5Md01OIb15MqW26IVAPIY9nIeMnMdR25Mxh36IcQ5IzRNMJk3EI71RcSetI41eIqFHbunI414dLeveM6I3MIe1AgResult M1u1WM0u1hIF2TMiA1OIH7DMgt1BIXPgIDRGIx3HIOA4Iw36NMC101IucAIt3fIU9WIlBHIm2AI4WZIyZOIQ4XmGrpReadReceipM6b4DM6J2EIXy5MXk4OIGLHIa1QMX125M771HJd131Ia1BMTW1rMEh4AMpj4UMrJ1LM9M47dreadIKM6b4 MLO2MIc35ds= 5EW7MHP4KMtB3AIOiHId37IA5AIg3hIBFJIXcMMMj1GI83KMpg2PMnV2AMlg2MMFb17MPR2bMQE2JIg58MqI2NMRO25MkI28b EZObSiMIC25MHF3OMZP2CMcI28Mbv3PIFpMIr67MDJ1OEaCIChGIS4PIi1TJW871MxB1NIX8iIlEEI4B7MbH2IIaBEbspIYY5cresIhtXMSQ4KM711DM5117MzZ4OIf7BMoT1MI87EI03UEb9IYo9J53F1Ml62IIw1LJA8q1IC7LMXa25IV5UIt2VMtO1XMpO1TMQj15aCM2c1LMpP2AEW6Mn34GIZ27Iuu4Ec5E95Mxv4PMmd16dListMic2PMLe17Il15I3tGIl1CEe6In17Mtj3IIoTIIVbLI548MdD26cNumMcA1JcGrpMak17Im15MuL27IfVKEdCIrYLIoM5MuE2TMfj2EIveJfTagAddMg81iIAyRMn81uIC1DMq21OILZRdnameIzTKMOA39Ik45M2C5OcTopMTE5JIP29cDelJd482fDisTagI0eQIf4BMU81NMuS15MFS18NTE111IHQEgportSDKMxl1SgsdkInfoMlo1KI017Mlp1rhUltraGrpMKJ56M6718MrF3ZMY93aMrD1IIm1BMbH3hMdN1pIC24ehangeM2q2QMAt4TIlQII9sGIEtJM5K4NfmsgUIDMAG1JI0PGM203qMEu4HMJC2HIyx6IqK5IWM9I7RGEZ5I16NMx33NILeNI569Ih7nI0B7eeedCoIdYPMvn47fnlineTM4e1MI97II3JHeEventIh26IrS5IoGFEVBNt4501ehasNeML845a3IIsNIg2GInDIIL4BIPt6IF3NMlA1QeinessILZLMaM3QM6L1aMhY3IcngeI217MAw3OjriginalId MVw1PEa8MfQ3NMhc39hcondaryIMbQ3KI657eAdminM0b5OdaddiEG6dMarkIMt6Iv2MgperatorMRV5MMlU17bubIJ66M7N18IqBMIw29Ed8Mig5NM0736bMeMm84BIcRGcextMXu37ItyMMoB3AMb55KIBm6eeventI8m7MV846IkLLIyCKI8GAIwCzIxCHI52LMS33oMJd1ZMlW1MMvx2EIfBJIEONMvd1PIFOAIWBNIFODIVBqeisDelMSN3JJLBK1MJP3HIMBxIsk4MA046JSBZ1MvV1CJM991Mzn49Id15IZ15MkT25Mbd45IY95c //MSt4HEjFISTLI29AMPt2OI5A9MXQ2rIO48cAckM5F3oIH7EhnotExistMjr58IKXHbOpIFA4heStatus MW31XIMRTMzN1NM6C48Mdw3NM9S2bIh2DM2G27IZj8M5V2ZIuRHMSG25IJO8M6Q39I859In17MRz2CIXX8EcIjSummary suE86c= 4IILHIJ1CNH91N1M901GME03NIH68Mev2MEF4I1jAI634Eb4IJ6JIm37NXC1T1MT33WIF3DMHA3FdtRtcM4M35Mt31MM9q48brtEc7Md02LI71AMkL4tcCalMNC55MhQ28MMb2QIgHPddataISu7ICyIIY18IpGAJa161ILKIaaM2035MJ94IbKvMu41RIfoGEvEMwk1SIo17IvJJIp14M9E3REV7M8h2RMB22UMvi1SM601JIJRyI1PYMKY6LbrtIrN8MEm5OcndMEY7MP96JMln1KMQu3TMjx1jMpn3ZMGR1GML81NMvL1LMpN1CMsL1CMBi1LMBR1BIB4JMLM1BMdR1HEX5IuzNM364WMaW3EMQb1OMPJ5AI4xLimentionedIH7QcCntIK7DMzx2qM4I2RIeARMWh1LMVh1RIk28Mbe1IMiS17Ir64MJd46Mpf3LEbAM8a1nIrP4M1L4RbtmMnM1LMXl26MtL15bubIi5JIfl9M1K2GMSW2ChubDetailM7n68Mn81NIUbSMlg27cxpiIKY6MVO1LIg19Mdp6NM9p68ImMKIl3FMv54JIG3OMzv5NcubTMyv5FMVb2HIS5OMfo2aMho1CIa1IbUlIa1AIH3PMV015IAkEIA2PM1D1WMMr1dMXR4JcullICNKIe2CIM6xInADMxw2NIs69I9AaI9BQI93HMQV15fubDataIs7WMoT1SgneedAllMx668Iq5YMal2LID29IV8IER7IQ57IX8aMcL1dJb8J1Ik2EMj57ScStrMLv4RIfGBMtc2HIb16IQf5MYN4QIb99IClJI317IJLLhplatformMPN4CEbHMKK3RIF6HINYIcrySI8ASISNxIxEGgProfileIdJtIuXGI929IP17Ih45Myq55If17InUIEgGcExtEjAILPHEkCMW73iMwl2KMg33JIX17Mxd1QMiC3iIUYIpcensorFailedFielMPE15Mk13PIH29MYs1OMMK5QI11BMWh6HI68CII8CI91UMcu3sI31BMZL5AImDNEWAIB1UInytMGB46IBCRMdA29M7c6AMrC6NMKQ7MMi41YMwJ1ZIsBCbseMqz15ILDccextIHDFIx1IdBaseEj5abE98MrE2QIMH7MuH4IIE1GIE4MM4725MlS18MLT1NbwnIPpNMXI5JInNMMXI5EIrNIIy68MU22PMoC15MHC15M4s1TafMoi66MOi5OMOb4OIiB4hrocessCoMuP35Ia6NgsJoinedIP55Iiq8Ig6MEn8McE68MOX4DMha1GkFriendInvitIt66bfrEHFMxa1IEq6IX19Eo6EF9MJD5II1KSMc077IbrCdultiIA38IQvgI74HISE6MbM2EMp12HJBFR1EZ9dQuitIe18M1F27IJF8It47MDd1RMQn2QIcA8IehDMt51DIv1IIb3FIHd7Eg4MtD5QM0445IwnPEW5eWhiteMp13PEY4cAttMU316ITETM5d17JL6Q1If18jPageParam MAV67IC6NbidIA6QbroMsE67Mbt2OMiO5AI7LPID2BIDeMMXs27IAwdMa72hM8X6EMt038MyX4NMT728I73JMu657MaF3AI51FIOE4IMhEMwn1FMVl59Iu6kIgU4IjULIQJ4Mov58INK4MGU5MEfHIqrDIV1NI7K8IN1PIeK9IF1ZIvNAIH1PIUOBIJ1EIW2RIpZOMnP2FIm5HI214cExtIbX8MtJ2QbpTMpJ2TMxI7EMEq4RIOJLII2KIf9LIPE4ImyPMNq5BMkD3UdNickMJT6UMNE2AIR3QfremarkIA17Mof4LcisBIgL5M8s7NbanM0V7VMjQ58MMq27Iv4JMjp26MnF16JfLS1M8p1WIe5PMcr7OIe5CMMF3NISSDMUz6OI5DCI14eIdkcIMlSIdkDMID4NIdkKIkeOIECCI0e8MgA4MIgJNI48uIWHAILD4IMeBI2NOEZ9binI724El8ME91NMYR48I4UMMGX79I9UTIoF5IL8BMSz7KMI715Mhg5OdapplMDg28M3J2GIT3HIil7IT37MMU7MEa7Ion8MtL7IItEDgResponsJvET1IAD8IhU8Mo02OIjV8IoEPIK89MZX4KIZb8I887Mkj6RIS6EIY4QNX01T1MfT6HMH91HIbr8MhA5uMEe3XMHD28Ix1MMpz5NET6ES7IGYGI41EMvU8TIsWPICzKMnw6OIDz6I73OMPV7SI55jIU1JeCheckIg4SEXCIibPEhIIt7tIkJ9Iq2NMTG1JMqG2oIHYDInQkIM2PMWg6TMI21LI1ANIEuQMZl37EW4IGnNIlmPIkJMMN516Mfq5BII2IIDjuMh328Ma156MSW3TIA2AIxLPIuC7IkfqIFkEInLNIFkEMLW3GIY8PIRS7INKNMhB19I55lMGe5LIs2UI05MMko4CI5EQMr13NITJDI15NIaM7M2v3MIb7DM9b3HIYI7Mwu6IJ6KF1MpA45cSetMp01NMJB47IrJOMy41GM051VMC12lIwDEIOyHIREFIcMVI2AAIB1NIZABMq01REi6aAIMe4MYD35I25MIse6MgX6SIC8DIpVZJTz71M6A2GIrK5MmR18MBO1MMWS1QIbmXIWoBMlq1IMAC29I02SID1AEl5MDS1CI22XcoptIcoGIFfJIN75MmZ2DMnA1WIsG6MNK6OMi289MW138IW3WIh2EIS3OIH6PIPVGMnY1TIGwNIW1JdFullIQwCIoEIIGB4ME836IVCLMvb39IqD5I3JQIVCIIXGJID85If1SINS6M678CIIRaIn1HcAddMeU46ePerioMNq2TMrs6CM8d4MispanMinutM0E55IOWMIBM8MKZ3OgimezoneM2J5QIp2XMJK7cJ9191I91CMav1SbisMrR89MzC2OIf5BMoU5NIf5DIUWMIf58M3q8OIf5AMje2JMyg59J7wU1MHp2TMqh5GIK8HMWd27IoCSNgD4U1M1n2DIFcMMTC4CM4s1GMEE4GMeD46MvH1IMhZ86M3j5OMOQ39M9i35Mda1TMki39I5PNmSpeechToTextIEa4MX39sfobjectMIQ9VM7F9PIqB7fampleRMMs7MMhY3AdnelNMyE88IsmNfformatIthQMsN78Mg81II469Me44SI56jM6C19I76TMRi1MIQO9MQT7CMRh8KIJ16Mfv4KdransMvI2JEO5I085ctraEA6MWe2QcmodM5H3LMZ596dorceMi658IYwHI427MDb2IEP8IV34Ic36I42dIW1HIusREe7MQ546IDoNI514IehUbteMfc2SI315dFileIBh6Mqx7OMyv85aLMKd15IBBNI8M6EZ6MkU7MM9r65aSMAx86IKBKIU5CIP4pIN3CICBEIM3UMT54TEZ6IiFNM5E26MiB8NIp3BM7d1JMrG45M2B4Acq {MWr4IMNI77MUO4AMvh4dIvA9IJA9MhZ3AM3X2LMFD4KMk53AET8MWI27ICRMdnextMr65FMfJ9hIF3GM8n2HMMp5dIm2AIXKLII4DMQG4jMJ09DbacEB4I2W6creaMRA98MAV4OMbb7OMre2WMMV7UIx4DMpZ4HMg21GMvZ4PMyT1NEU7ET7MAV57MO92xIg7BMiL9uIN2EN8g3N1MUS4QI37MMrs6HMBa66Iqu6EB5Mc22LEcBIxALMMI36I0QNMfK26Iid6IJfMEZ7cMeCM3t4RIvh4brTM1w6KEW7eutOffEX5I8KGMjL7EMUx85EJ9IJKCMGc55IVy4M8c5BhKICK = 0IL16eREFUSMZi8BgCOEXISTMTC9HbTaIb74I91BgROOM =1MMI27MgC99MCz5PMvAAWM8u6CIoHDM3477ICxVM7P86IrpHbtcIGt5MnK1GMlB7LI01KcKeyIcw6MnL1Sdkey=EzKeValueMZi3UM236ZIN1FMGC1FMqw4MM8r4HII2DEa4I3G4IY1PMWJ8QI52CMUa25MKv4OM0f85Mjs4HMp68GIVL8Ii2MdroomMs52EEeCMoI6JMb7ANMgq3AIVbMkofflineKickMTF2CIX4FM4K7UI6l8MUx35MGj3KIV3GM1L3NMEL7AMam6FIF6LMO175M4e3IbtcMM61RI124Mhh15MVM4NMjq98Ea5IsUHID3CIkr5eInnerMWL5NMtO39bSyIZO4MfC85IVYJbIdIPL4btyM4P4BbidEJHIj7II1K9Me92II46MbinIm27McX5BEgMeouterEg8Mhc1HIvH4bryIwCPI91DM315NMXi85caInIp6JMUP26fnterioIwI7EUBIrMBIdU6Mm34AIwIIIQZNMf11AMmM7OMd117IjQ6Iz2FcSetJ23K1I4LIMNz4NI4L6MHn4OIV3AIFsNIV38MC38IInD6IZ3LIf7KIC25MtU1EIl2GMS71KIF1MMY71FI0AIIt5RcsInJx8B1ItAGbelIL4PIwRRIS2GIp7GIS2II12KMrD5fIjfPINSKMJ79RInN8Eb7IJFLfSetOutINCPIW3IIuOTIM99IZTOIcBBMst9QIcB5IrOKcQryIfB4Ir2LMIU3eIlC7I617INXcIA1NMBiAZMsX7SMF51PImU6IM9LdPullM5i6hIR8HIEW8IS9KI6Z9NR47Z2Ix2HIJ7PNIv6R1MMB28Iko5IkWJIF26mAnchorToVieweMmr3BEG6bToEW6IQ6NMPg16cserMtp18MF59rbtcMep2HMeY4HdevicMsb3BI89WMep8XIF3UIv6PIj2BMKY8CIfpGI655ID1LIUKSIe8XMN37cIhhHMo826MQ18REY5Mi226MLk5IMEdA8fimeoutMFk7LIA1EMhj47IEYNEb6IhM5Mv95NEY6MJk99IhDMeCanceMm7A6IY3oIz2UIa3TIz25IX3TIz2AI7oMEa4hAnswerInIy2WIx2NIV67janswerCodeIu2UIT6aIw2FMJXAPIoeOIOZ4M9i1NIGg6IFvKcEndIG7eIA37IF7TIA3AIN4TMKq48MnV3OIo19dKeysIJ7IcBotILWSMoW36MwK9IbotIgG6EsFIG15ffo botEuOEW4IozMMnG87MCW5MMiY2yMZD8EMB41GcMetMkTA5Mi4A7MxTA9MpoAPMrY2QMAA67IES5MA41OIn1CMQA4UIH4MMRA4PMDW18NRp201N9Q121MYj4KMps1KIm27MU53KM6fAKMij2OMcDBAM4j9NMcDBAM3j9NM4x5DMHuAHIV58MXM5AMqJ6IMCF36MT35NI318MUP65cQryJb6o1M9q4TMZa1RMtV3LcallMFL67IS6OM9c1BMf79JIJ46MT54NI62GME32MMfc1HMQW5HMjE25IYC7M4s86EG8MMZ6tIK1FMdt4qIs88Mqa1DMYE2BIq2BMal1SEf8JQ9r1J1GE1IU9VMUq2DIrFNIz6CMPXBTIpFSJSAM1Msl4XI88ZM355JES6M4117Jv2s1Mew1HIv2fMfC2RIs8DMiA3OICMDMdW1RM6o1LMCA76cserII25M9h6KIa5AM0618MFZ2JEbBMuD3tIC3IIa1KMBY2SJvFf2MF05FMAY1HIv5GMh57QIY7AMvX17b}\n3Q4C");var _c,uc;class hc{constructor(e){_c.add(this),Object.defineProperty(this,"pbModules",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const t=so.loadProto(e);this.pbModules=t.build("Modules").probuf}encode(e,t){return this.pbModules[e].encode(t).toArrayBuffer()}decode(e,t){try{const i=this.pbModules[e].decode(t);return r(this,_c,"m",uc).call(this,i)}catch(t){const r=`name: ${e}, stack: ${t.stack}`;throw null===console||void 0===console||console.error("pb decode error!",r),t}}}var Ec,gc,Ic,pc,Tc,Rc,fc;_c=new WeakSet,uc=function e(t,i){if(t instanceof Array)return t.map((t=>r(this,_c,"m",e).call(this,t)));if(s=t,"[object Object]"!==Object.prototype.toString.call(s))return t;var s;if(t instanceof so.ByteBuffer)return t.toArrayBuffer();if(t instanceof so.Long)return i?t.toString():t.toNumber();const n={};return Object.keys(t).forEach((i=>{const s=t[i],o=t.$type.name===uo&&"seqId"===i;n[i]=r(this,_c,"m",e).call(this,s,o)})),n},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"}(Ec||(Ec={})),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"}(gc||(gc={})),function(e){e[e.GROUP_SUCCESS=0]="GROUP_SUCCESS",e[e.GROUP_FAILURE=1]="GROUP_FAILURE"}(Ic||(Ic={})),function(e){e[e.IsSilent=1]="IsSilent",e[e.IsTop=2]="IsTop",e[e.Tags=3]="Tags",e[e.AutoTrans=4]="AutoTrans"}(pc||(pc={})),function(e){e[e.KICK=0]="KICK",e[e.REFUSE=1]="REFUSE",e[e.COEXIST=2]="COEXIST"}(Tc||(Tc={})),function(e){e[e.ROOM=1]="ROOM",e[e.PERSON=2]="PERSON"}(Rc||(Rc={})),function(e){e[e.AnchorToViewer=1]="AnchorToViewer",e[e.ViewerToAnchor=2]="ViewerToAnchor"}(fc||(fc={}));const Ac=new hc(dc);var mc,Sc,vc,Cc,yc,Oc,Nc,Mc,bc;exports.LogLevel=void 0,(mc=exports.LogLevel||(exports.LogLevel={}))[mc.LOG=0]="LOG",mc[mc.DEBUG=0]="DEBUG",mc[mc.INFO=1]="INFO",mc[mc.WARN=2]="WARN",mc[mc.ERROR=3]="ERROR",mc[mc.FATAL=4]="FATAL",mc[mc.STATISTICS=6]="STATISTICS",mc[mc.NONE=1e3]="NONE",exports.LogSource=void 0,(Sc=exports.LogSource||(exports.LogSource={})).IM="IM",Sc.RTC="RTC",exports.ConnectionStatus=void 0,(vc=exports.ConnectionStatus||(exports.ConnectionStatus={}))[vc.CONNECTED=0]="CONNECTED",vc[vc.CONNECTING=1]="CONNECTING",vc[vc.DISCONNECTED=2]="DISCONNECTED",vc[vc.NETWORK_UNAVAILABLE=3]="NETWORK_UNAVAILABLE",vc[vc.CONNECTION_CLOSED=4]="CONNECTION_CLOSED",vc[vc.KICKED_OFFLINE_BY_OTHER_CLIENT=6]="KICKED_OFFLINE_BY_OTHER_CLIENT",vc[vc.WEBSOCKET_UNAVAILABLE=7]="WEBSOCKET_UNAVAILABLE",vc[vc.WEBSOCKET_ERROR=8]="WEBSOCKET_ERROR",vc[vc.BLOCKED=9]="BLOCKED",vc[vc.DOMAIN_INCORRECT=12]="DOMAIN_INCORRECT",vc[vc.DISCONNECT_BY_SERVER=13]="DISCONNECT_BY_SERVER",vc[vc.REDIRECT=14]="REDIRECT",vc[vc.USER_LOGOUT=19]="USER_LOGOUT",vc[vc.APPKEY_IS_FAKE=20]="APPKEY_IS_FAKE",vc[vc.FORBID_RECONNECT_BY_OTHER_SAME_CLIENT=31023]="FORBID_RECONNECT_BY_OTHER_SAME_CLIENT",vc[vc.ULTRALIMIT=1101]="ULTRALIMIT",vc[vc.REQUEST_NAVI=201]="REQUEST_NAVI",vc[vc.RESPONSE_NAVI=202]="RESPONSE_NAVI",vc[vc.RESPONSE_NAVI_ERROR=203]="RESPONSE_NAVI_ERROR",vc[vc.RESPONSE_NAVI_TIMEOUT=204]="RESPONSE_NAVI_TIMEOUT",vc[vc.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",vc[vc.RC_CONN_USER_OR_PASSWD_ERROR=31004]="RC_CONN_USER_OR_PASSWD_ERROR",exports.RTCMode=void 0,(Cc=exports.RTCMode||(exports.RTCMode={}))[Cc.RTC=0]="RTC",Cc[Cc.LIVE=2]="LIVE",Cc[Cc.SIP=4]="SIP",Cc[Cc.CALL=5]="CALL",Cc[Cc.MEETING=6]="MEETING",Cc[Cc.CROSS_MUTI=7]="CROSS_MUTI",Cc[Cc.CROSS_LIVE=8]="CROSS_LIVE",function(e){e[e.AUDIO_AND_VIDEO=0]="AUDIO_AND_VIDEO",e[e.AUDIO=1]="AUDIO"}(yc||(yc={})),function(e){e[e.ANCHOR=1]="ANCHOR",e[e.AUDIENCE=2]="AUDIENCE"}(Oc||(Oc={})),exports.RTCApiType=void 0,(Nc=exports.RTCApiType||(exports.RTCApiType={}))[Nc.ROOM=1]="ROOM",Nc[Nc.PERSON=2]="PERSON",function(e){e[e.AnchorToViewer=1]="AnchorToViewer",e[e.ViewerToAnchor=2]="ViewerToAnchor"}(Mc||(Mc={})),exports.RTCJoinType=void 0,(bc=exports.RTCJoinType||(exports.RTCJoinType={}))[bc.KICK=0]="KICK",bc[bc.REFUSE=1]="REFUSE",bc[bc.COEXIST=2]="COEXIST";const Lc=(e,t,r)=>{const i=null==r?void 0:r.isReverse;It(e)&&(()=>{for(const r in e)t(e[r],r,e)})(),(ht(e)||dt(e))&&(()=>{if(i)for(let r=e.length-1;r>=0;r--)t(e[r],r);else for(let r=0,i=e.length;r<i;r++)t(e[r],r)})()};class Uc{constructor(e){Object.defineProperty(this,"pbCodec",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.pbCodec=new hc(e)}encode(e,t,r){return r?t:this.pbCodec.encode(e,t)}decode(e,t){return this.pbCodec.decode(e,t)}}const Pc=(e,t,r,i,s)=>{const n=i?Object.keys(i).map((e=>({key:e,value:i[e]}))):void 0,o=s?Object.keys(s).map((e=>({key:e,value:s[e]}))):void 0;return Ac.encode(Fl,{roomType:e,broadcastType:t,joinType:r,innerDatas:n,outerDatas:o})},Dc=e=>{const t=Ac.decode(kl,e),{users:r,token:i,sessionId:s,roomInfo:n,entries:o,offlineKickTime:a}=t,l={};return Lc(r,(e=>{const{userId:t,userData:r}=e,i={};Lc(r,(e=>{const{key:t,value:r}=e;i[t]=r})),l[t]=i})),{users:l,token:i,sessionId:s,roomInfo:n,kvEntries:o,offlineKickTime:a}};var xc,wc,Gc,Vc,kc,Fc,Bc,Hc,jc,Yc,Wc,Jc;exports.StreamMessageResponseEventType=void 0,(xc=exports.StreamMessageResponseEventType||(exports.StreamMessageResponseEventType={})).INIT="INIT",xc.DATA="DATA",xc.END="END";class qc extends $t{constructor(e,t){super(),wc.add(this),Gc.set(this,void 0),Vc.set(this,new Map),kc.set(this,void 0),i(this,Gc,e,"f"),i(this,kc,t,"f")}requestStreamMessageContent(e){return t(this,void 0,void 0,(function*(){const t=r(this,wc,"a",Fc).createTraceId();r(this,wc,"a",Fc).info(n.L_REQ_STREAM_MSG_CONTENT_T,`messageUId: ${e}`,t);const i=yield nr.create("requestStreamMessageContent").isLimitedString("messageUId",e,1,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID,"messageUId is invalid.").result().tryTrans(r(this,Gc,"f").validateConnected).tryTrans((e=>{var t,r;return(null===(r=null===(t=null==e?void 0:e.streamServer)||void 0===t?void 0:t.addrs)||void 0===r?void 0:r.length)?ir(e.streamServer.addrs):sr(exports.ErrorCode.STREAM_MESSAGE_DISABLE)})).next((t=>r(this,wc,"m",Wc).call(this,e,t)));return r(this,wc,"a",Fc).summary(n.L_REQ_STREAM_MSG_CONTENT_R,i,t,{messageUId:e}),i.wipe()}))}}Gc=new WeakMap,Vc=new WeakMap,kc=new WeakMap,wc=new WeakSet,Fc=function(){return r(this,Gc,"f").logger},Bc=function(e,t,i){const s=r(this,Vc,"f").get(e);s&&(r(this,Vc,"f").delete(e),r(this,wc,"m",Hc).call(this,e,exports.StreamMessageResponseEventType.END,t,s.msg))},Hc=function(e,t,r,i,s){this.emit("message",{code:r,messageUId:e,type:t,chunk:s,message:i})},jc=function(e,t){e.content=Object.assign(Object.assign({},e.content),t),r(this,Gc,"f")._innerSetMessageContent(e.messageId,JSON.stringify(e.content),e.messageType)},Yc=function(e,t,i){const s=r(this,Vc,"f").get(t);let n,o;switch(e){case"init":s.msg&&r(this,wc,"m",jc).call(this,s.msg,{content:"",stopReason:0,completeReason:0,isSynced:!1}),r(this,wc,"m",Hc).call(this,t,exports.StreamMessageResponseEventType.INIT,exports.ErrorCode.SUCCESS,s.msg);break;case"complete":n=i.length?JSON.parse(i):{},o=n.complete||!1,s.msg&&r(this,wc,"m",jc).call(this,s.msg,{stopReason:n.stopReason||0,completeReason:n.completeReason||0,complete:o,isSynced:o}),r(this,wc,"m",Bc).call(this,t,n.stopReason||0,o);break;default:n=JSON.parse(i),s.cached+=n.content,s.msg&&r(this,wc,"m",jc).call(this,s.msg,{content:s.cached}),r(this,wc,"m",Hc).call(this,t,exports.StreamMessageResponseEventType.DATA,exports.ErrorCode.SUCCESS,s.msg,{content:n.content,fullContent:s.cached})}},Wc=function(e,i){return t(this,void 0,void 0,(function*(){if(r(this,Vc,"f").has(e))return sr(exports.ErrorCode.STREAM_MESSAGE_REQUEST_IN_PROCESS,`Request in process, msgUId: ${e}`);if(r(this,Vc,"f").size>=3)return sr(exports.ErrorCode.STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED,"The request queue is full");const t=io.createSSEClient({logger:r(this,wc,"a",Fc),msgUId:e,appkey:r(this,Gc,"f").appkey,token:r(this,Gc,"f").token,timeout:3e4,onRawContent:t=>{t.split("\n\n").forEach((t=>{if(0===t.length)return;t.startsWith("data:")&&(t=`event:delta\n${t}`);const i=t.indexOf("\n"),s=t.slice(0,i).replace("event:",""),n=t.slice(i+1+5);r(this,wc,"m",Yc).call(this,s,e,n.trim())}))},onNetworkError:t=>{r(this,wc,"m",Bc).call(this,e,t,!1)}});if(!t.isOk)return t.wipe();const s=t.data,n={client:s,cached:"",msg:void 0};if(r(this,Vc,"f").set(e,n),r(this,kc,"f")){const{code:t,data:i}=yield r(this,Gc,"f").getLocalMessage(e);if(!i)return r(this,Vc,"f").delete(e),sr(t,`message not found, msgUId: ${e}`);if(i.content.isSynced)return r(this,Vc,"f").delete(e),sr(exports.ErrorCode.STREAM_MESSAGE_SYNCED,"synced");n.msg=i}const o=yield s.open(i.slice());return o.isOk||r(this,Vc,"f").delete(e),o.wipe()}))};class Kc{constructor(e){Object.defineProperty(this,"_context",{enumerable:!0,configurable:!0,writable:!0,value:e})}__getContext(){return this._context}createCodec(e,t){return new Uc(t)}createPBCodec(e,t){return new hc(e)}refetchNaviInfo(){return t(this,void 0,void 0,(function*(){return this._context.refetchNaviInfo()}))}getNaviInfo(){return this._context.getNaviInfoFromCache()}getCoreVersion(){return"5.44.0-alpha.1"}getAPIVersion(){return"5.44.0-alpha.1"}getAppkey(){return this._context.appkey}getCurrentId(){return this._context.getCurrentUserId()}getUserToken(){return this._context.token}getConnectionStatus(){return this._context.getConnectionStatus()}getDeviceId(){return this._context.getDeviceId()}setPushConfig(e){this._context.setPushConfig(e)}sendMessage(e,t,r){return console.warn('[PluginContext] sendMessage is deprecated, please use "sendMessageTo" instead'),this.sendMessageTo({conversationType:e,targetId:t,channelId:r.channelId},r)}sendMessageTo(e,t){return this._context.sendMessageByPlugin(e,t)}registerMessageType(e,t,r,i=[]){this._context.registerMessageType(e,t,r,i)}getServerTime(){return this._context.getServerTime()}getOSInfo(){return this._context.getOSInfo()}getProcessInfo(){return this._context.getProcessInfo()}getMainProcessInfo(){return this._context.getMainProcessInfo()}setCallInfo(e,t,r){return this._context.setCallInfo(e,t,r)}createLogger(e,t){return this._context.createLogger(e,t)}getStatsUrlList(){return this._context.getStatsUrlList()}registerCustomSignalHandler(e,t){this._context.registerCustomSignalHandler(e,t)}}class Qc extends Kc{joinRTCRoom(e,r,i,s,n,o){return t(this,void 0,void 0,(function*(){const t=Pc(r,i,s,n,o),{code:a,buffer:l}=yield this.rtcSignaling(e,is,!0,t);let c;return a===exports.ErrorCode.SUCCESS&&l&&(c=Dc(l)),{code:a,data:c}}))}quitRTCRoom(e){return t(this,void 0,void 0,(function*(){const t=Ac.encode(Dl,{status:0}),{code:r}=yield this.rtcSignaling(e,ss,!0,t);return r}))}rtcPing(e,r,i){return t(this,void 0,void 0,(function*(){const{code:t}=yield this._context.rtcPing(e,r,i);return t}))}rtcPingResVersion(e,t,r){return this._context.rtcPing(e,t,r)}getRTCUserInfo(e){throw new Error("Method not implemented.")}setRTCUserInfo(e,r,i){return t(this,void 0,void 0,(function*(){const t=Ac.encode(Vl,{key:r,value:i}),{code:s}=yield this.rtcSignaling(e,ns,!0,t);return s}))}removeRTCUserInfo(e,r){return t(this,void 0,void 0,(function*(){const t=Ac.encode(Gl,{key:r}),{code:i}=yield this.rtcSignaling(e,os,!1,t);return i}))}setRTCData(e,r,i,s,n,o){return t(this,void 0,void 0,(function*(){const t=Ac.encode(jl,{interior:s,target:n,key:r,value:i,objectName:null==o?void 0:o.name,content:null==o?void 0:o.content}),{code:a}=yield this.rtcSignaling(e,as,!1,t);return a}))}setRTCTotalRes(e,r,i,s,n=""){return t(this,void 0,void 0,(function*(){const t={objectName:s,content:[{key:r.name,value:r.content}],valueInfo:[{key:"uris",value:i},{key:"mcu_uris",value:n}]},o=Ac.encode(Yl,t),{code:a}=yield this.rtcSignaling(e,ls,!0,o);return a}))}setRTCCDNUris(e,r,i){return t(this,void 0,void 0,(function*(){const t=Ac.encode(Yl,{objectName:r,valueInfo:[{key:"cdn_uris",value:i}]}),{code:s}=yield this.rtcSignaling(e,ls,!0,t);return s}))}getRTCData(e,r,i,s){return t(this,void 0,void 0,(function*(){const t=Ac.encode(Hl,{interior:i,target:s,key:r}),{code:n,buffer:o}=yield this.rtcSignaling(e,cs,!0,t);if(n!==exports.ErrorCode.SUCCESS||!o)return{code:n};const{outInfo:a}=Ac.decode(Bl,o),l={};return a.forEach((e=>{l[e.key]=e.value})),{code:n,data:l}}))}removeRTCData(e,r,i,s,n){return t(this,void 0,void 0,(function*(){const t=Ac.encode(Hl,{interior:i,target:s,key:r,objectName:null==n?void 0:n.name,content:null==n?void 0:n.content}),{code:o}=yield this.rtcSignaling(e,ds,!1,t);return o}))}setRTCOutData(e,r,i,s){return t(this,void 0,void 0,(function*(){throw new Error("JSEngine's method not implemented.")}))}getRTCOutData(e,r){return t(this,void 0,void 0,(function*(){throw new Error("JSEngine's method not implemented.")}))}getRTCToken(e,r,i){return t(this,void 0,void 0,(function*(){const t=Pc(r,i),{code:s,buffer:n}=yield this.rtcSignaling(e,_s,!0,t);if(s!==exports.ErrorCode.SUCCESS||!n)return{code:s};const{rtcToken:o}=Ac.decode(Jl,n);return{code:s,data:{rtcToken:o}}}))}setRTCState(e,r){return t(this,void 0,void 0,(function*(){const t=Ac.encode(xl,{state:r}),{code:i}=yield this.rtcSignaling(e,us,!0,t);return i}))}getRTCUserList(e){return t(this,void 0,void 0,(function*(){const t=Ac.encode(wl,{order:2}),{code:r,buffer:i}=yield this.rtcSignaling(e,hs,!0,t);if(r!==exports.ErrorCode.SUCCESS||!i)return{code:r};return{code:r,data:Dc(i)}}))}joinLivingRoomAsAudience(e,r,i){return t(this,void 0,void 0,(function*(){const t=Pc(r,i),{code:s,buffer:n}=yield this.rtcSignaling(e,Es,!0,t);if(s!==exports.ErrorCode.SUCCESS||!n)return{code:s};const{rtcToken:o,entries:a}=Ac.decode(Ql,n);return{code:s,data:{token:o,kvEntries:a}}}))}quitLivingRoomAsAudience(e){return t(this,void 0,void 0,(function*(){const t=Ac.encode(Dl,{status:0}),{code:r}=yield this.rtcSignaling(e,gs,!0,t);return r}))}rtcIdentityChange(e,r,i){return t(this,void 0,void 0,(function*(){const t=Ac.encode(Fl,{roomType:exports.RTCMode.LIVE,broadcastType:i,identityChangeType:r,needSysChatroom:!1}),{code:s,buffer:n}=yield this.rtcSignaling(e,Is,!0,t);if(s!==exports.ErrorCode.SUCCESS||!n)return{code:s};return{code:s,data:Dc(n)}}))}requestRoomPK(e){return t(this,void 0,void 0,(function*(){const{invitedRoomId:t,invitedUserId:r,inviteSessionId:i,inviteTimeout:s,inviteInfo:n,roomId:o}=e,a=Ac.encode(Xl,{invitedRoomId:t,invitedUserId:r,inviteSessionId:i,timeoutTime:s,inviteInfo:n}),{code:l}=yield this.rtcSignaling(o,ps,!0,a);return l}))}cancelRoomPK(e){return t(this,void 0,void 0,(function*(){const{invitedRoomId:t,invitedUserId:r,inviteSessionId:i,inviteInfo:s,roomId:n}=e,o=Ac.encode(zl,{invitedRoomId:t,invitedUserId:r,inviteSessionId:i,inviteInfo:s}),{code:a}=yield this.rtcSignaling(n,Ts,!0,o);return a}))}responseRoomPK(e){return t(this,void 0,void 0,(function*(){const{inviteUserId:t,inviteRoomId:r,inviteSessionId:i,content:s,key:n,value:o,agree:a,roomId:l}=e,c=Ac.encode(Zl,{inviteUserId:t,inviteRoomId:r,inviteSessionId:i,content:s,key:n,value:o,answerCode:a?1:0}),{code:d}=yield this.rtcSignaling(l,Rs,!0,c);return d}))}endRoomPK(e){return t(this,void 0,void 0,(function*(){const{endRoomId:t,sessionId:r,content:i,keys:s,roomId:n}=e,o=Ac.encode($l,{inviteRoomId:t,inviteSessionId:r,inviteContent:i,inviteRoomKeys:s}),{code:a}=yield this.rtcSignaling(n,fs,!0,o);return a}))}registerRTCSignalListener(e){this._context.registerRTCSignalingListener(e)}rtcSignaling(e,r,i,s){return t(this,void 0,void 0,(function*(){const t=yield this._context.rtcSignaling(e,r,i,s);return{code:t.code,buffer:t.data}}))}getRTCJoinedUserInfo(e){return t(this,void 0,void 0,(function*(){const t=Ac.encode(ql,{userId:e}),{code:r,buffer:i}=yield this.rtcSignaling("",As,!0,t);if(r!==exports.ErrorCode.SUCCESS||!i)return{code:r};return{code:r,data:Ac.decode(Kl,i).info.map((e=>({deviceId:e.deviceId,roomId:e.roomId,joinTime:e.joinTime})))}}))}}exports.AssertRules=void 0,(Jc=exports.AssertRules||(exports.AssertRules={}))[Jc.STRING=0]="STRING",Jc[Jc.ONLY_STRING=1]="ONLY_STRING",Jc[Jc.NUMBER=2]="NUMBER",Jc[Jc.BOOLEAN=3]="BOOLEAN",Jc[Jc.OBJECT=4]="OBJECT",Jc[Jc.ARRAY=5]="ARRAY",Jc[Jc.CALLBACK=6]="CALLBACK",Jc[Jc.CHANNEL_ID=7]="CHANNEL_ID";const Xc={[exports.AssertRules.STRING]:gt,[exports.AssertRules.ONLY_STRING]:dt,[exports.AssertRules.NUMBER]:_t,[exports.AssertRules.BOOLEAN]:e=>"boolean"==typeof e,[exports.AssertRules.OBJECT]:It,[exports.AssertRules.ARRAY]:ht,[exports.AssertRules.CALLBACK]:e=>{let t=!0;return It(e)||(t=!1),(e=e||{}).onSuccess&&!pt(e.onSuccess)&&(t=!1),e.onError&&!pt(e.onError)&&(t=!1),t},[exports.AssertRules.CHANNEL_ID]:mt};class zc extends Error{constructor(e){super(e),this.name="RCAssertError"}}const Zc=(e,t,r,i=!1)=>{r=Xc[r]||r;const s=i?r(t):Tt(t)||null==t||r(t);return s||null===console||void 0===console||console.error(`'${e}' is invalid: ${JSON.stringify(t)}`),s},$c=(e,t)=>{if(!gt(e))return sr(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE);if(!ui(e))return sr(exports.ErrorCode.MESSAGE_NOT_REGISTERED);const{searchProps:r}=_i(e);if(!r||0===r.length)return ir();return r.every((e=>void 0!==t[e]))?ir():sr(exports.ErrorCode.SEARCH_PROPS_LIMIT_ERROR)},ed=(e,t,r)=>td(nr.create(e),t,r),td=(e,t,r)=>(e.isFailed||e.isObject("conversation",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION).validate("conversationType",null==t?void 0:t.conversationType,(()=>W(null==t?void 0:t.conversationType,r)),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE).validate("targetId",null==t?void 0:t.targetId,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("channelId",null==t?void 0:t.channelId,mt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID),e),rd=(e,t,r)=>(e.check((e=>td(e,t,B))).check((e=>{const i=null==t?void 0:t.messageType;gt(i)?i===Q.STREAM_MESSAGE&&r.includes("RC_Ext_StreamMsgSummary")&&e.setFailed(exports.ErrorCode.STREAM_MESSAGE_EXPANSION_KEY_ERROR):e.setFailed(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE)})).check((e=>{(null==t?void 0:t.canIncludeExpansion)||e.setFailed(exports.ErrorCode.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION)})).isNotEmptyString("messageUId",null==t?void 0:t.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isTimestamp("sentTime",null==t?void 0:t.sentTime,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP),e),id=(e,t,r)=>(e.check((e=>{r||e.setFailed(exports.ErrorCode.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION)})).isObject("expansion",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_EXPANSION).check((e=>{const r=Object.keys(t);if(r.length>20||0===r.length)return void e.setFailed(exports.ErrorCode.EXPANSION_LIMIT_EXCEET);if(r.some((e=>!/^[A-Za-z0-9_=+-]+$/.test(e)||"string"!=typeof t[e])))return void e.setFailed(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_EXPANSION);r.some((e=>e.length>32||t[e].length>4096))&&e.setFailed(exports.ErrorCode.EXPANSION_LIMIT_EXCEET)})),e),sd=(e,t)=>t?(e.isObject("proxy",t,!0).isString("socketHost",t.socksHost,!0).isNumber("socketPort",t.socksPort,!0).isString("socketUsername",t.socksUsername).isString("socketPassword",t.socksPassword).fail(exports.ErrorCode.INVALID_PARAMETER_PROXY),e):e;const nd=e=>function(e){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);const t=unescape(encodeURIComponent(e)).split("").map((e=>e.charCodeAt(0)));return new Uint8Array(t)}(e).byteLength,od=e=>({isPersited:!!(16&e),isCounted:!!(32&e),disableNotification:!!(512&e),receivedStatus:!!(2&e)?exports.ReceivedStatus.RETRIEVED:exports.ReceivedStatus.UNREAD,canIncludeExpansion:!!(1024&e)}),ad=(e,t,r,i,s)=>{let n=0;return e&&(n|=16),t&&(n|=32),r&&(n|=64),i&&(n|=512),s&&(n|=1024),n},ld=e=>{const t={};try{const r=JSON.parse(e);Object.entries(r).forEach((([e,r])=>{t[e]=r.v}))}catch(t){console.error(`parseMessageExpansion error: ${e}`,t)}return t},cd=(e,t,r,i)=>{const s=Ac.decode(ao,e.pbData),n=Hi(e.topic);let o,a;if(n===Bi.recallMsg){const e=JSON.parse(s.content);o=e.conversationType,a=e.targetId}else l=n,o={[Bi.ppMsgP]:exports.ConversationType.PRIVATE,[Bi.pgMsgP]:exports.ConversationType.GROUP,[Bi.chatMsg]:exports.ConversationType.CHATROOM,[Bi.ugMsg]:exports.ConversationType.ULTRA_GROUP,[Bi.pcMsgP]:exports.ConversationType.CUSTOMER_SERVICE,[Bi.pbMsgP]:exports.ConversationType.SYSTEM}[l]||exports.ConversationType.PRIVATE,a=e.targetId;var l;const c=![exports.ConversationType.GROUP,exports.ConversationType.CHATROOM,exports.ConversationType.RTC_ROOM,exports.ConversationType.ULTRA_GROUP].includes(o),d=c?a:t,_=c?"":a,{isPersited:u,isCounted:h,isMentioned:E,disableNotification:g,canIncludeExpansion:I}=hd(s.sessionId);return{fromUserId:d,type:o,groupId:_,classname:s.classname,content:s.content,dataTime:r,status:ad(u,h,E,g,I),msgId:i,direction:exports.MessageDirection.SEND,clientUniqueId:s.clientUniqueId,extraContent:s.extraContent,pushContent:s.pushText,configFlag:s.configFlag,pushExt:s.pushExt,busChannel:s.busChannel,toUserIds:s.toUserIds,optionBits:s.optionBits,refData:s.refData}},dd=(e,t,r=!1,i)=>{const{type:s,classname:n}=e,o=![exports.ConversationType.GROUP,exports.ConversationType.CHATROOM,exports.ConversationType.RTC_ROOM,exports.ConversationType.ULTRA_GROUP].includes(s)?i||e.fromUserId:e.groupId||i,{disableNotification:a,receivedStatus:l,canIncludeExpansion:c}=od(e.status),d=e.direction===exports.MessageDirection.SEND?exports.MessageDirection.SEND:exports.MessageDirection.RECEIVE,_=((e=0,t,r)=>{const{isVoipPush:i,isFilerWhiteBlacklist:s,disablePushTitle:n,forceShowDetailContent:o}=(e=>({isVoipPush:!!(1&e),isFilerWhiteBlacklist:!!(2&e),disablePushTitle:!!(4&e),forceShowDetailContent:!!(8&e)}))(e),a=Bt(null==r?void 0:r.pushConfigs,null==r?void 0:r.pushId);return Object.assign({pushTitle:(null==r?void 0:r.title)||"",pushContent:t||"",pushData:"",disablePushTitle:n,forceShowDetailContent:o,templateId:null==r?void 0:r.templateId},a)})(e.configFlag||0,e.pushContent,e.pushExt),{isInterrupt:u,isModifyMessage:h,isPrivateChannel:E,isStatusMessage:g}=(e=>{const t=e||0;return{isInterrupt:!!(2&t),isModifyMessage:!!(4&t),isPrivateChannel:!!(8&t),isStatusMessage:!!(64&t)}})(e.extStatus);let I,p,T;if(ui(e.classname)){const t=_i(e.classname);I=t.isCounted,p=t.isPersited,T=!!t.isStatusMessage}else{const t=od(e.status);I=t.isCounted,p=t.isPersited,T=g||!1}const R=(e=>{let t;try{t=JSON.parse(e)}catch(r){t=e}if(null==t?void 0:t.user){const{portrait:e,portraitUri:r}=t.user,i=e||r;i&&(t.user.portrait=t.user.portraitUri=i)}return t})(e.content),f=e.optionBits||0,A={conversationType:s,targetId:o,senderUserId:d===exports.MessageDirection.SEND?t:e.fromUserId,messageType:n,messageUId:e.msgId,isPersited:p,isCounted:I,isMentioned:!!R.mentionedInfo,sentTime:e.dataTime,messageDirection:d,receivedTime:Date.now(),disableNotification:a,receivedStatus:l,receivedStatusInfo:yt(l),canIncludeExpansion:c,content:R,expansion:e.extraContent?ld(e.extraContent):null,pushConfig:_,channelId:e.busChannel||"",isInterrupt:u,isModifyMessage:h,messageId:e.clientUniqueId||0,sentStatus:exports.SentStatus.SENT,isOffLineMessage:r,channelType:E?exports.UltraGroupChannelType.PRIVATE:exports.UltraGroupChannelType.PUBLIC,isStatusMessage:T,readReceiptInfo:void 0,directedUserIds:e.toUserIds,disableUpdateLastMessage:(1&f)>0,needReceipt:(2&f)>0,sendReceipt:!!(4&f)||void 0,modifyInfo:Ed(e.convertExt),extraData:e.extMsgData?{seqId:e.extMsgData.seqId,sentTime:e.extMsgData.sendTime}:void 0,hasReactions:(64&f)>0};return e.refData&&(A.quoteInfo={messageUId:e.refData.msgId,senderId:e.refData.fromUserId,objectName:e.refData.classname,quoteMessageStatus:be.DEFAULT}),A},_d=(e,t,r,i=!1,s)=>{const n=dd(t,r,i,s);return n.messageType===Q.RECALL&&e.serverSaveUnread?(n.__innerData__={keepUnreadCount:!(16&t.optionBits)},n):n},ud=(e,t,r,i,s)=>{let n=0;const{isPersited:o,isCounted:a,isStatusMessage:l}=_i(e),c=s||l;return o&&!c&&(n|=1),a&&!c&&(n|=2),t&&(n|=4),r&&(n|=32),i&&(n|=64),n},hd=e=>({isPersited:!!(1&e),isCounted:!!(2&e),disableNotification:!!(32&e),canIncludeExpansion:!!(64&e),isMentioned:!!(4&e)}),Ed=e=>{if(e)try{const{modify:t}=JSON.parse(e);if(t.time)return{timestamp:t.time,content:{},status:Cr.SUCCESS}}catch(t){console.error(`parse message modify info error: ${e}`,t)}},gd=(e,t)=>{const{sentTime:r,messageUId:i,isDelete:s,isAdmin:n,directionalUserIdList:o,extra:a}=e.content,l={recallTime:r,recallActionTime:e.sentTime,admin:!!n,delete:!!s,isDelete:!!s,operatorId:e.senderUserId,extra:a},c=Object.assign(Object.assign({},e),{content:l,messageType:Q.RECALL_NOTIFICATION_MESSAGE});return t&&(c.messageUId=i,c.sentTime=r,c.directedUserIds=o),c};function Id(e){return 1&~((null==e?void 0:e.sessionMode)||0)?sr(exports.ErrorCode.RC_REAL_TIME_CONVERSATION_UNAVAILABLE):ir()}function pd(e){return Math.min(e,999)}class Td{constructor(e){Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"subscribeData",{enumerable:!0,configurable:!0,writable:!0,value:{[exports.SubscribeType.ONLINE_STATUS]:{},[exports.SubscribeType.USER_PROFILE]:{}}}),Object.defineProperty(this,"_ownProfile",{enumerable:!0,configurable:!0,writable:!0,value:null})}clearSubscribeRelation(){this.subscribeData={[exports.SubscribeType.ONLINE_STATUS]:{},[exports.SubscribeType.USER_PROFILE]:{}}}clearSubscribeStatusData(e){e===exports.SubscribeType.ONLINE_STATUS?Object.keys(this.subscribeData[e]).forEach((t=>{this.subscribeData[e][t].statusMap={}})):e===exports.SubscribeType.USER_PROFILE&&Object.keys(this.subscribeData[e]).forEach((t=>{this.subscribeData[e][t].profile=void 0}))}getSubscribeUserData(e,t){const r=this.subscribeData[e][t];return r?Object.assign({},r):void 0}removeSubscribeUserData(e,t){delete this.subscribeData[e][t]}updateSubscribeUserData(e,t,r){this.subscribeData[e][t]=r}clearExpiredData(e){for(const t in this.subscribeData[e]){const r=this.subscribeData[e][t];r.expiry<(Date.now()+this._delayTime-r.subscribeTime)/1e3&&delete this.subscribeData[e][t]}}getSubscribeUserList(e,t,r){return[...Object.values(this.subscribeData[e])].sort(((e,t)=>e.subscribeTime-t.subscribeTime)).slice(r,r+t)}updateOwnProfile(e){var t;const r=Object.assign(Object.assign({},null===(t=this._ownProfile)||void 0===t?void 0:t.extraProfile),e.extraProfile);this._ownProfile=Object.assign(Object.assign(Object.assign({},this._ownProfile),e),{extraProfile:r})}getOwnProfile(){return this._ownProfile?Object.assign(Object.assign({},this._ownProfile),{extraProfile:Object.assign({},this._ownProfile.extraProfile)}):null}}class Rd{constructor(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 Td(e)}updateRelationshipStatusVersion(e){e>this._relationshipStatusVersion&&(this._relationshipStatusVersion=e)}getRelationshipStatusVersion(){return this._relationshipStatusVersion}updateSubscribeUserStatusVersion(e){e>this._subUserStatusVersion&&(this._subUserStatusVersion=e)}getSubscribeUserStatusVersion(){return this._subUserStatusVersion}_filterSubscribeRelationData(e){return e.reduce(((e,t)=>(t.subUsers.forEach((r=>{let i=e.find((e=>e.subscribeType===t.subType&&e.userId===r.subUserId));i?i.subscribeTime<t.subTime&&(i.expiry=t.expiry,i.operationType=t.opType,i.subscribeTime=t.subTime):e.push({userId:r.subUserId,subscribeTime:t.subTime,subscribeType:t.subType,expiry:t.expiry,operationType:t.opType})})),e)),[])}updateSubscribeRelation(e,t=!1){const r=[],i=[],s=[];t&&this._subStore.clearSubscribeRelation();return this._filterSubscribeRelationData(e).forEach((e=>{var t,n;const{userId:o,subscribeTime:a,subscribeType:l,expiry:c,operationType:d}=e;if(d===exports.SubscribeOperationType.UNSUBSCRIBE)return this._subStore.removeSubscribeUserData(l,o),void s.push(e);const _=this._subStore.getSubscribeUserData(l,o);if(!(_&&_.subscribeTime>=a)){if(l===exports.SubscribeType.ONLINE_STATUS){r.push(o);const e=(null===(t=_)||void 0===t?void 0:t.statusMap)||{};this._subStore.updateSubscribeUserData(l,o,{subscribeTime:a,expiry:c,userId:o,subscribeType:l,statusMap:e})}else{i.push(o);const e=null===(n=_)||void 0===n?void 0:n.profile;this._subStore.updateSubscribeUserData(l,o,{subscribeTime:a,expiry:c,userId:o,subscribeType:l,profile:e,isSubscribed:!0})}s.push(e)}})),{newSubscribeOnlineStatusList:r,newSubscribeUserProfileList:i,subscribeUserChangeList:s}}clearSubscribeStatus(){this._subStore.clearSubscribeStatusData(exports.SubscribeType.ONLINE_STATUS),this._subStore.clearSubscribeStatusData(exports.SubscribeType.USER_PROFILE)}updateSubscribeUserOnlineStatus(e){const t=[];return e.forEach((e=>{const r=e.subUserId,i=e.data,s=this._subStore.getSubscribeUserData(exports.SubscribeType.ONLINE_STATUS,r);if(!s)return;const n=[],o=Object.assign({},s.statusMap);i.forEach((e=>{const t=e.platformInfo,r=e.versionTime,i=o[t];if(i&&i.changeTime>r)return;const s={eventValue:e.value,changeTime:r};o[t]=s,n.push(Object.assign(Object.assign({},s),{platform:t}))})),this._subStore.updateSubscribeUserData(exports.SubscribeType.ONLINE_STATUS,r,{subscribeTime:s.subscribeTime,expiry:s.expiry,userId:r,subscribeType:exports.SubscribeType.ONLINE_STATUS,statusMap:o}),t.push({userId:r,subscribeType:exports.SubscribeType.ONLINE_STATUS,subscribeTime:s.subscribeTime,expiry:s.expiry,details:n})})),t}updateSubscribeUserProfile(e){const t=[];return e.forEach((e=>{const{userId:r,version:i,userProfile:s,userExtProfile:n}=e,o=this._subStore.getSubscribeUserData(exports.SubscribeType.USER_PROFILE,r),a=Nt(r,s,n);o?o.profile&&o.profile.version>=i||(this._subStore.updateSubscribeUserData(exports.SubscribeType.USER_PROFILE,r,{subscribeTime:o.subscribeTime,expiry:o.expiry,userId:r,subscribeType:exports.SubscribeType.USER_PROFILE,profile:{info:a,version:i},isSubscribed:o.isSubscribed}),o.isSubscribed&&t.push({userId:r,subscribeType:exports.SubscribeType.USER_PROFILE,subscribeTime:o.subscribeTime,expiry:o.expiry,userProfile:Object.assign({},a)})):this._subStore.updateSubscribeUserData(exports.SubscribeType.USER_PROFILE,r,{subscribeTime:0,expiry:0,userId:r,subscribeType:exports.SubscribeType.USER_PROFILE,profile:{info:a,version:i},isSubscribed:!1})})),t}getSubscribeUserStatus(e,t){const r=[];return t.forEach((t=>{const i=this._subStore.getSubscribeUserData(e,t);if(!i||i.expiry<(Date.now()+this._delayTime-i.subscribeTime)/1e3)this._subStore.removeSubscribeUserData(e,t);else{const t={subscribeTime:i.subscribeTime,expiry:i.expiry,userId:i.userId,subscribeType:i.subscribeType};if(e===exports.SubscribeType.ONLINE_STATUS){const{statusMap:e}=i,r=Object.keys(e).map((t=>Object.assign({platform:~~t},e[~~t])));t.details=Ot(r)}else if(e===exports.SubscribeType.USER_PROFILE&&!i.isSubscribed)return;r.push(t)}})),r}getUserProfiles(e){const t=[],r=[];return e.forEach((e=>{const i=this._subStore.getSubscribeUserData(exports.SubscribeType.USER_PROFILE,e);if(!i||!i.profile)return void r.push(e);const{version:s,info:n}=i.profile;if(i.isSubscribed)return this._delayTime+Date.now()-s>6048e5?void r.push(e):void t.push(Object.assign(Object.assign({},n),{extraProfile:Object.assign({},n.extraProfile)}));this._delayTime+Date.now()-s>6e5?r.push(e):t.push(Object.assign(Object.assign({},n),{extraProfile:Object.assign({},n.extraProfile)}))})),{list:t,needQueryUserIds:r}}getSubscribeUserList(e,t,r){this._subStore.clearExpiredData(e);return this._subStore.getSubscribeUserList(e,t,r).map((t=>{const r={subscribeTime:t.subscribeTime,expiry:t.expiry,userId:t.userId,subscribeType:t.subscribeType};if(e===exports.SubscribeType.ONLINE_STATUS){const e=Object.keys(t.statusMap).map((e=>Object.assign({platform:~~e},t.statusMap[~~e])));r.details=Ot(e)}return r}))}updateOwnProfile(e,t){this._ownProfileVersion>t||this._subStore.updateOwnProfile(e)}getOwnProfile(){return this._subStore.getOwnProfile()}}class fd{constructor(e,t,r,i,s,n,o){Object.defineProperty(this,"_ctx",{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:r}),Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"_isOpenUserProfile",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"_subDriven",{enumerable:!0,configurable:!0,writable:!0,value:o}),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 Rd(i)}syncData(){return t(this,void 0,void 0,(function*(){this._subDriven&&(yield this._syncSubscribeRelationship(!1),yield this._syncSubscribeUserStatus(!0)),this._isOpenUserProfile&&(yield this.syncOwnProfile()),1&this._subDriven&&this._event.syncSubscribeUserStatusFinished(exports.SubscribeType.ONLINE_STATUS),2&this._subDriven&&this._event.syncSubscribeUserStatusFinished(exports.SubscribeType.USER_PROFILE),3&this._subDriven&&this._event.syncSubscribeUserStatusFinished(exports.SubscribeType.FRIEND_ONLINE_STATUS),4&this._subDriven&&this._event.syncSubscribeUserStatusFinished(exports.SubscribeType.FRIEND_USER_PROFILE)}))}startSyncSubscribeRelationship(e){return t(this,void 0,void 0,(function*(){this._pullRelationshipQueue.push(e),this._syncSubscribeRelationship()}))}_syncSubscribeRelationship(e=!0){return t(this,void 0,void 0,(function*(){this._isPullingRelationship||(this._isPullingRelationship=!0,yield this._pullSubscribeRelationship(e),this._isPullingRelationship=!1,this._pullRelationshipQueue.length>0&&(this._pullRelationshipQueue.length=0,yield this._syncSubscribeRelationship(e)))}))}_pullSubscribeRelationship(e,r=""){return t(this,void 0,void 0,(function*(){const t=this._subscribeService.getRelationshipStatusVersion(),i=this._logger.createTraceId();this._logger.info(n.L_PULL_SUBSCRIBED_USER_RELATION_T,JSON.stringify({version:t,_pageToken:r}),i);const s=Ac.encode(Ga,{version:t,pageToken:r}),o=yield this._ctx.query(Bi.pullUserSub,this._currentUserId,s,Va);if(this._logger.summary(n.L_PULL_SUBSCRIBED_USER_RELATION_R,o,i),!o.isOk)return this._pullRelationshipFailTime++,this._pullRelationshipFailTime>5?void(this._pullRelationshipFailTime=0):this._pullSubscribeRelationship(e,r);this._pullRelationshipFailTime=0;const{list:a,version:l,hasNext:c,pageToken:d}=o.data;if(e){const{newSubscribeOnlineStatusList:e,newSubscribeUserProfileList:t,subscribeUserChangeList:r}=this._subscribeService.updateSubscribeRelation(a);r.length>0&&this._event.subscribeRelationChanged(r),e.length>0&&this._queryAndUpdateUserOnlineStatus(e),t.length>0&&this._queryAndUpdateUserProfile(t)}else this._subscribeService.updateSubscribeRelation(a,!r);this._subscribeService.updateRelationshipStatusVersion(l),this._pullRelationshipQueue=this._pullRelationshipQueue.filter((e=>e>l)),c&&(yield this._pullSubscribeRelationship(e,d))}))}startsyncSubscribeUserStatus(e){return t(this,void 0,void 0,(function*(){this._pullSubUserStatusQueue.push(e),this._syncSubscribeUserStatus()}))}_syncSubscribeUserStatus(e=!1){return t(this,void 0,void 0,(function*(){this._isPullingSubUserStatus||(this._isPullingSubUserStatus=!0,yield this._pullSubscribeUserStatus(e),this._isPullingSubUserStatus=!1,this._pullSubUserStatusQueue.length>0&&(this._pullSubUserStatusQueue.length=0,yield this._syncSubscribeUserStatus(e)))}))}_pullSubscribeUserStatus(e=!1,r=""){return t(this,void 0,void 0,(function*(){const t=this._subscribeService.getSubscribeUserStatusVersion(),i=this._logger.createTraceId();this._logger.info(n.L_PULL_SUBSCRIBED_USER_STATUS_T,JSON.stringify({version:t,_pageToken:r,needAllData:e}),i);const s=Ac.encode(ka,{versionTime:t,needAllData:e,pageToken:r}),o=yield this._ctx.query(Bi.pullSubData,this._currentUserId,s,Fa);if(!o.isOk)return this._logger.warn(n.L_PULL_SUBSCRIBED_USER_STATUS_R,JSON.stringify({code:o.code,failTime:this._pullSubUserStatusFailTime}),i),this._pullSubUserStatusFailTime++,this._pullSubUserStatusFailTime>5?void(this._pullSubUserStatusFailTime=0):this._pullSubscribeUserStatus(e,r);this._pullSubUserStatusFailTime=0;let{list:a,versionTime:l,hasNext:c,pageToken:d,isFull:_}=o.data;this._logger.info(n.L_PULL_SUBSCRIBED_USER_STATUS_R,JSON.stringify({code:o.code}),i),this._pullSubUserStatusQueue=this._pullSubUserStatusQueue.filter((e=>e>l)),this._subscribeService.updateSubscribeUserStatusVersion(l);const u=[],h=[];a.forEach((e=>{switch(e.subType){case exports.SubscribeType.ONLINE_STATUS:u.push(e);break;case exports.SubscribeType.USER_PROFILE:h.push(e.subUserId);case exports.SubscribeType.FRIEND_ONLINE_STATUS:case exports.SubscribeType.FRIEND_USER_PROFILE:}})),_&&""===r&&this._subscribeService.clearSubscribeStatus(),u.length>0&&this._updateUserOnlineStatus(u,!_),h.length>0&&(yield this._queryAndUpdateUserProfile(h,!_)),c&&(yield this._pullSubscribeUserStatus(e,d))}))}_queryAndUpdateUserOnlineStatus(e){return t(this,void 0,void 0,(function*(){const t=this._logger.createTraceId();this._logger.info(n.L_QUERY_SUBSCRIBE_DATA_T,JSON.stringify(e),t);const r=Ac.encode(Ha,{subType:exports.SubscribeType.ONLINE_STATUS,subUsers:e.map((e=>({subUserId:e})))}),i=yield this._ctx.query(Bi.qrySubData,this._currentUserId,r,Fa);this._logger.summary(n.L_QUERY_SUBSCRIBE_DATA_R,i,t),i.isOk&&this._updateUserOnlineStatus(i.data.list)}))}_updateUserOnlineStatus(e,t=!0){let r=this._subscribeService.updateSubscribeUserOnlineStatus(e);r=r.filter((e=>e.details&&e.details.length>0)),t&&r.length>0&&this._event.subscribeUserStatusChanged(r)}_queryAndUpdateUserProfile(e,r=!0){return t(this,void 0,void 0,(function*(){const t=this._logger.createTraceId();this._logger.info(n.L_PULL_USER_PROFILE_T,JSON.stringify(e),t);const i=Ac.encode(Wa,{userId:e}),s=new En(Bi.pullUserProfile,i,this._currentUserId),{code:o,data:a}=yield this._ctx.send(s,Ja);if(this._logger.info(n.L_PULL_USER_PROFILE_R,JSON.stringify({code:o,data:a}),t),o!==exports.ErrorCode.SUCCESS)return sr(o);const l=this._subscribeService.updateSubscribeUserProfile(a.UserProfile);return r&&l.length>0&&this._event.subscribeUserStatusChanged(l),ir(a.UserProfile)}))}updateUserStatus(e){return t(this,void 0,void 0,(function*(){const t=Ac.decode(Ba,e.pbData);if(t.subType===exports.SubscribeType.ONLINE_STATUS)this._updateUserOnlineStatus([t]);else if(t.subType===exports.SubscribeType.USER_PROFILE)this._queryAndUpdateUserProfile([t.subUserId]);else if(t.subType===exports.SubscribeType.FRIEND_ONLINE_STATUS){const e=t.data.map((e=>({changeTime:e.versionTime,eventValue:e.value,platform:e.platformInfo})));this._event.subscribeUserStatusChanged([{userId:t.subUserId,subscribeType:t.subType,subscribeTime:0,expiry:0,details:e}])}else if(t.subType===exports.SubscribeType.FRIEND_USER_PROFILE){const e=yield this._queryAndUpdateUserProfile([t.subUserId]),{data:r}=e;r&&this._event.subscribeUserStatusChanged([{userId:t.subUserId,subscribeType:t.subType,subscribeTime:0,expiry:0,userProfile:Nt(t.subUserId,r[0].userProfile,r[0].userExtProfile)}])}}))}getSubscribeUserStatus(e,t){return this._subscribeService.getSubscribeUserStatus(e,t)}getSubscribeUserList(e,t,r){return this._subscribeService.getSubscribeUserList(e,t,r)}updateSubscribeRelation(e,r,i,s=0){return t(this,void 0,void 0,(function*(){const t=Ac.encode(xa,{subType:r,opType:i,expiry:s,subUsers:e.map((e=>({subUserId:e})))}),n=yield this._ctx.query(Bi.updUserSub,this._currentUserId,t,wa),{code:o,data:a,isOk:l}=n;if(o===exports.ErrorCode.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT)return sr(o,"",a.subUsers.map((e=>e.subUserId)));if(!l)return n.wipe();const{subTime:c}=a;return this._subscribeService.updateSubscribeRelation([{subType:r,subTime:c,expiry:s,opType:i,subUsers:e.map((e=>({subUserId:e})))}]),i===exports.SubscribeOperationType.SUBSCRIBE&&(r===exports.SubscribeType.ONLINE_STATUS?this._queryAndUpdateUserOnlineStatus(e):r===exports.SubscribeType.USER_PROFILE&&this._queryAndUpdateUserProfile(e,!1)),n.wipe()}))}getUserProfiles(e){return t(this,void 0,void 0,(function*(){const{needQueryUserIds:t,list:r}=this._subscribeService.getUserProfiles(e);if(0===t.length)return ir(r);const i=yield this._queryAndUpdateUserProfile(t,!1);if(!i.isOk)return i.wipe();const s=i.data.map((e=>Nt(e.userId,e.userProfile,e.userExtProfile)));return ir([...r,...s])}))}syncOwnProfile(e=!1){return t(this,void 0,void 0,(function*(){if(!this._isOpenUserProfile)return sr(exports.ErrorCode.RC_USER_PROFILE_SERVICE_UNAVAILABLE);const t=this._logger.createTraceId();this._logger.info(n.L_PULL_OWN_PROFILE_T,"",t);const r=Ac.encode(qa,{nothing:1}),i=yield this._ctx.query(Bi.pullOwnProfile,this._currentUserId,r,ja);if(this._logger.summary(n.L_PULL_OWN_PROFILE_R,i,t),!i.isOk)return i.wipe();const{userExtProfile:s,userProfile:o,version:a,userId:l}=i.data,c=Nt(l,o,s);return this._subscribeService.updateOwnProfile(c,a),e&&this._event.ownUserProfileChanged(c),ir(c)}))}getOwnProfile(){return t(this,void 0,void 0,(function*(){const e=this._subscribeService.getOwnProfile();return e?ir(e):this.syncOwnProfile()}))}updateOwnProfile(e,r){return t(this,void 0,void 0,(function*(){this._subscribeService.updateOwnProfile(e,r)}))}}var Ad;class md extends Dr{constructor(e,t,r,i){super(e,t,r,i),Ad.set(this,ct)}setTimestamp4RealtimeLog(e){i(this,Ad,e,"f")}getTimestamp4RealtimeLog(){return r(this,Ad,"f")}}Ad=new WeakMap;let Sd=null;const vd="RC_LOGS",Cd="RC_STATISTICS",yd={[vd]:["level","time"],[Cd]:["level","time"]},Od=(e,t,r)=>new Promise((i=>{const s=e.transaction(t,"readwrite").objectStore(t).index("time"),n=IDBKeyRange.upperBound(Date.now()-r),o=s.openCursor(n);o.onsuccess=e=>{const t=e.target.result;t?(t.delete(),t.continue()):i()},o.onerror=()=>{i()}}));let Nd=null;const Md=e=>t(void 0,void 0,void 0,(function*(){const t=yield Sd;if(!t)return;const{db:r}=t;yield Od(r,vd,e),yield Od(r,Cd,e),Nd=setTimeout((()=>Md(e)),6e5)})),bd=(e,t,r=168)=>{Sd||("undefined"!=typeof window&&window&&window.indexedDB&&"IE"!==io.runtimeInfo.type?Sd=new Promise((i=>{const s=window.indexedDB;(e=>{const t=window.indexedDB;t.databases&&t.databases().then((r=>{r.forEach((r=>{r.name&&e.includes(r.name)&&t.deleteDatabase(r.name)}))}))})(["RC_ENGINE_DB",`RC_STATISTIC_${e}`]);const o=`RC_LOGS_${e}`,a=s.open(o,2);a.onerror=e=>{t.error(n.L_LOGDB_OPEN_FAILED_E,e.target.error),i(null)},a.onsuccess=s=>{const o=s.target.result;o?(o.onclose=e=>{Sd=null,t.warn(n.L_LOGDB_CLOSED_S)},o.onerror=e=>{Sd=null,t.error(n.L_LOGDB_ERROR_E,e.target.error)},o.onabort=e=>{t.info(n.L_LOGDB_ABORT_S,e.target.error)},Md(3600*Math.max(24,Math.min(168,r))*1e3),i({appkey:e,db:o})):i(null)},a.onupgradeneeded=e=>{const t=e.target.result;Object.keys(yd).forEach((e=>{t.objectStoreNames.contains(e)&&t.deleteObjectStore(e);const r=t.createObjectStore(e,{autoIncrement:!0});yd[e].forEach((e=>r.createIndex(e,e,{unique:!1})))}))}})):t.warn(n.L_UNSUPPORT_INDEXDB_O))},Ld=[],Ud=(e,t,r)=>new Promise((i=>{const s=e.transaction(t,"readwrite");s.oncomplete=i,s.onabort=i;const n=s.objectStore(t);r.forEach((e=>{try{n.add(e)}catch(t){null===console||void 0===console||console.error("write failed ->",e,t)}}))})),Pd=[];let Dd=!1;const xd=e=>t(void 0,void 0,void 0,(function*(){if(Dd||0===Pd.length)return;Dd=!0;const t=Pd.filter((e=>e.level<exports.LogL.FATAL)),r=Pd.filter((e=>e.level>=exports.LogL.FATAL));Pd.length=0,yield Ud(e,vd,r),yield Ud(e,Cd,t),Dd=!1,0===Pd.length&&Ld.length>0&&(Ld.forEach((e=>e.close())),Ld.length=0),setTimeout((()=>xd(e)))})),wd=()=>{const e=Qr();return e.setLogReader(((e,r,i,s,n=vd)=>t(void 0,void 0,void 0,(function*(){const t=yield Sd;return t?new Promise((o=>{const{db:a}=t,l=a.transaction(n,"readonly").objectStore(n),c=[],d=IDBKeyRange.bound(e,r),_=l.index("time").openCursor(d);_.onsuccess=e=>{const t=e.target.result;if(t){const e=t.value;e.level<=i&&(s?e.sessionId===lt:e.level>=0)&&c.push(e),t.continue()}else o({logs:c})},_.onerror=()=>{o({logs:[]})}})):{logs:[]}})))),e.setLogWriter((e=>{(e=>{t(void 0,void 0,void 0,(function*(){const t=yield Sd;if(t){if(e.content&&dt(e.content))try{e.content=JSON.parse(e.content)}catch(e){}Pd.push(e),xd(t.db)}}))})(e)})),e},Gd=144e5;if("undefined"!=typeof window){const e=(e,t)=>{const r=t.map((({sessionId:e,time:t,type:r,level:i,tag:s,traceId:n,loggerId:o,content:a})=>`${e},${t},${r},${i},${s},${n},${o},"${a}"\n`)),i=new Blob(r,{type:"text/csv"}),s=URL.createObjectURL(i),n=document.createElement("a");n.href=s,n.download=`${e}.csv`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(s)};window.__rongcloud_devtools__={logger:{get(r,i=Date.now()-Gd,s=Date.now()){return t(this,void 0,void 0,(function*(){i=i<0?Date.now()+i:i,(s=s<=0?Date.now():s)-i>Gd&&(i=s-Gd);const t=Qr(),o=new md(r,"RC-IM","IM",t);o.debug(n.T,`get logs: startTime ${i} endTime ${s}`),bd(r,o);const{logs:a}=yield t.read(i,s,exports.LogL.DEBUG,!1);o.debug(n.T,`get logs ${a.length}`),e(`${r}-${i}-${s}`,a)}))}}}}class Vd extends xr{constructor(e,t,r,i,s){const{type:n,version:o}=io.runtimeInfo;super(e,`${n}|${o}|${t.getSessionId()}|${io.connectPlatform}`,i,t),Object.defineProperty(this,"tableName",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"appStorage",{enumerable:!0,configurable:!0,writable:!0,value:s})}getDeviceId(){return this.appStorage.deviceId}send(e){return io.httpReq(e)}checkStart(e){const r=Object.create(null,{checkStart:{get:()=>super.checkStart}});return t(this,void 0,void 0,(function*(){return yield((e,r)=>t(void 0,void 0,void 0,(function*(){const t=r.get("logReporter");t[`REPORT_SESSION_${e}`]={sessionId:lt},r.set("logReporter",t)})))(e.userId,this.appStorage),r.checkStart.call(this,e,this.tableName)}))}compressLogs(e){return t(this,void 0,void 0,(function*(){return{success:!0,data:yi(e.map(wr).join(""))}}))}realtimeReport(e,r,i){const s=Object.create(null,{realtimeReport:{get:()=>super.realtimeReport}});return t(this,void 0,void 0,(function*(){return s.realtimeReport.call(this,e,r,i,this.tableName)}))}}class kd extends Vd{constructor(e,t,r){super(e,t,vd,t.proxy,r)}isReporter(){return t(this,void 0,void 0,(function*(){const e=yield((e,r)=>t(void 0,void 0,void 0,(function*(){const t=r.get("logReporter")[`REPORT_SESSION_${e}`];return(null==t?void 0:t.sessionId)===lt})))(this.userId,this.appStorage);return e}))}report(e,r,i,s,n,o,a=!1){const l=Object.create(null,{report:{get:()=>super.report}});return t(this,void 0,void 0,(function*(){const t=yield this.isReporter();if(!this.userId||t)return l.report.call(this,e,r,i,s,n,o,a)}))}}class Fd extends Vd{constructor(e,t,r){super(e,t,Cd,t.proxy,r)}}var Bd,Hd,Yd,Wd,Jd;class qd extends er{constructor(e,t,i){super("WebConversationSettings"),Bd.add(this),Object.defineProperty(this,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:i}),Hd.set(this,!1),this._ctx.on("sCmd",r(this,Bd,"m",Wd),this),this._ctx.on("onConnected",r(this,Bd,"m",Yd),this)}_handleSyncData(e){return t(this,void 0,void 0,(function*(){return(yield r(this,Bd,"m",Jd).call(this,e)).trans((()=>({version:this._storage.get("conversationStatusVersion")})))}))}syncDataFromServer(){return t(this,void 0,void 0,(function*(){const e=this._storage.get("conversationStatusVersion");return yield r(this,Bd,"m",Jd).call(this,e),this._storage.get("conversationStatusVersion")}))}}Hd=new WeakMap,Bd=new WeakSet,Yd=function(){i(this,Hd,!0,"f")},Wd=function(e,t){const{type:r,time:i}=t;if(3===r)this.push(i),e.stopPropagation()},Jd=function(e){return t(this,void 0,void 0,(function*(){const{logger:t}=this._ctx,s=t.createTraceId();t.info(n.L_PULL_CONVERSATION_SETTINGS_T,JSON.stringify({version:e}),s);const o=Ac.encode(Ko,{time:e}),a=yield this._ctx.query(Bi.pullSeAtts,this._ctx.currentUserId,o,Qo);if(a.isOk){const e=this._storage.updateBySessionStates(a.data.state);e.length&&this._emitter.emit("conversationStatusChanged",e)}const l=this._storage.get("conversationStatusVersion");return t.summary(n.L_PULL_CONVERSATION_SETTINGS_R,a,s,{version:e,nextVersion:l},(e=>({respVer:e.version}))),r(this,Hd,"f")&&(i(this,Hd,!1,"f"),this._emitter.emit("conversationStatusSynced",a.code)),a.wipe()}))};class Kd{constructor(){Object.defineProperty(this,"_memData",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}syncDataFromLocalStorage(e){this._memData=this._syncDataHandler(e)}get(e){return this._memData[e].value}set(e,t){const r=this._memData[e],{key:i,stringify:s}=r;r.value=t;const n=s?JSON.stringify(t):t;io.localStorage.setItem(i,n)}delete(e){const t=this._memData[e];delete this._memData[e];const{key:r}=t;io.localStorage.removeItem(r)}}const Qd=e=>{var t;return`${null!==(t=e.channelId)&&void 0!==t?t:""}_${e.conversationType}_${e.targetId}`},Xd=e=>{const[t,r,...i]=e.split("_");return{channelId:t,conversationType:parseInt(r,10),targetId:i.join("_")}};var zd,Zd,$d,e_,t_;function r_(e){if(!e)return;if(Array.isArray(e))return e;return Object.entries(e).map((([e,{isTop:t}])=>({tagId:e,isTop:t})))}const i_=()=>({latestMessage:null,lastReadTime:0,firstUnreadMessageType:"",firstUnreadMessageUId:"",firstUnreadTime:0,unreadCount:0,unreadMentionedCount:0,unreadMentionedMeCount:0,hasMentioned:!1,mentionedInfo:void 0,isTop:!1,notificationLevel:exports.NotificationLevel.NOT_SET,translateStrategy:Ti.DEFAULT,tags:[],channelType:exports.UltraGroupChannelType.PUBLIC,operationTime:0,draft:"",hidden:!1,includeRobot:!1,version:0});class s_{constructor(e){zd.set(this,void 0),Zd.set(this,void 0),$d.set(this,void 0),e_.set(this,i_()),t_.set(this,[]),i(this,zd,e.conversationType,"f"),i(this,Zd,e.targetId,"f"),i(this,$d,e.channelId||"","f")}get conversationType(){return r(this,zd,"f")}get targetId(){return r(this,Zd,"f")}get channelId(){return r(this,$d,"f")}get version(){return r(this,e_,"f").version||0}get channelType(){return r(this,e_,"f").channelType}get hidden(){return!!r(this,e_,"f").hidden}get isTop(){return!!r(this,e_,"f").isTop}get notificationLevel(){return r(this,e_,"f").notificationLevel||exports.NotificationLevel.NOT_SET}get translateStrategy(){return r(this,e_,"f").translateStrategy||Ti.DEFAULT}get tags(){return(r(this,e_,"f").tags||[]).map((e=>({tagId:e.tagId,isTop:e.isTop})))}get unreadCount(){return r(this,e_,"f").unreadCount||0}get unreadMentionedCount(){return r(this,e_,"f").unreadMentionedCount||0}get unreadMentionedMeCount(){return r(this,e_,"f").unreadMentionedMeCount||0}get hasMentioned(){return!!r(this,e_,"f").hasMentioned}get mentionedInfo(){return r(this,e_,"f").mentionedInfo}get lastReadTime(){return r(this,e_,"f").lastReadTime||0}get firstUnreadTime(){return r(this,e_,"f").firstUnreadTime||0}get firstUnreadMessageUId(){return r(this,e_,"f").firstUnreadMessageUId||""}get firstUnreadMessageType(){return r(this,e_,"f").firstUnreadMessageType||""}get latestMessage(){return r(this,e_,"f").latestMessage||null}get operationTime(){return r(this,e_,"f").operationTime||0}get draft(){return r(this,e_,"f").draft||""}get firstUnreadMessage(){return this.firstUnreadTime?{sentTime:this.firstUnreadTime,messageType:this.firstUnreadMessageType,messageUId:this.firstUnreadMessageUId}:null}get identifier(){return{conversationType:r(this,zd,"f"),targetId:r(this,Zd,"f"),channelId:r(this,$d,"f")}}get key(){return Qd(this.identifier)}get includeRobot(){return!!r(this,e_,"f").includeRobot}toIReceivedConversation(){return Object.assign(Object.assign({},this.identifier),{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:pe(this.notificationLevel),isTop:this.isTop,operationTime:this.operationTime,firstUnreadMessage:this.firstUnreadMessage,versionTime:0,draft:this.draft,includeRobot:this.includeRobot})}toStoragItem(e){const t={};return this.hidden&&(t.h=1),e||(this.isTop&&(t.to=1),this.notificationLevel!==exports.NotificationLevel.NOT_SET&&(t.nl=this.notificationLevel),this.tags.length>0&&(t.tg=this.tags),this.translateStrategy!==Ti.DEFAULT&&(t.ts=this.translateStrategy)),t}remove(){this.updateAttrs(Object.assign(Object.assign({},i_()),{tags:this.tags,isTop:this.isTop,notificationLevel:this.notificationLevel,translateStrategy:this.translateStrategy,hidden:!0}))}clearUnreadCount(e){const t={unreadCount:0,unreadMentionedCount:0,unreadMentionedMeCount:0,hasMentioned:!1,mentionedInfo:void 0,lastReadTime:e,firstUnreadTime:0,firstUnreadMessageType:void 0,firstUnreadMessageUId:void 0};return t.version=Math.max(this.version,e),this.updateAttrs(t,e)}updateAttrs(e,t=0){const i={},s={latestMessage:"latestMessage",unreadCount:"unreadMessageCount",hasMentioned:"hasMentioned",mentionedInfo:"mentionedInfo",notificationLevel:"notificationLevel",tags:"tags",isTop:"isTop",translateStrategy:"translateStrategy",unreadMentionedCount:"unreadMentionedCount",unreadMentionedMeCount:"unreadMentionedMeCount",lastReadTime:void 0,firstUnreadMessageType:void 0,firstUnreadMessageUId:void 0,firstUnreadTime:void 0,channelType:void 0,operationTime:void 0,draft:void 0,includeRobot:void 0,hidden:void 0,version:void 0};return Object.entries(s).forEach((([s,n])=>{const o=s;if(!Object.prototype.hasOwnProperty.call(e,o))return;const a=e[o];r(this,e_,"f")[o]!==a&&(r(this,e_,"f")[o]=a,n&&(i[n]={time:t,val:a}))})),Object.keys(i).length>0?i:null}addRecvMessageRecord(e,t,i){r(this,t_,"f").push([e,t,i]),this.removeRecvMessageRecords(e-12e4)}removeRecvMessageRecords(e){i(this,t_,r(this,t_,"f").filter((([t])=>t<=e)),"f")}calibrateUnreadCount(e,t){const{mentionCnt:i,mentionMeCnt:s,clearTime:n,firstUnreadMsg:o,cnt:a}=e,l=e.cutOffTime,c=i>0,d=s>0,_=c?{type:d?exports.MentionedType.SINGAL:exports.MentionedType.ALL,userIdList:d?[t]:void 0}:void 0,u={unreadCount:a,unreadMentionedCount:i,unreadMentionedMeCount:s,lastReadTime:n,firstUnreadTime:null==o?void 0:o.msgTime,firstUnreadMessageType:null==o?void 0:o.className,firstUnreadMessageUId:null==o?void 0:o.msgId,hasMentioned:c,mentionedInfo:_,version:l};r(this,t_,"f").forEach((([e,t,r])=>{e<=l||(u.version=Math.max(u.version,e),u.unreadCount+=t,r===exports.MentionedType.SINGAL?u.unreadMentionedMeCount+=t:r===exports.MentionedType.ALL&&(u.unreadMentionedCount+=t))}));const h=this.updateAttrs(u,n);return this.removeRecvMessageRecords(l),h}}zd=new WeakMap,Zd=new WeakMap,$d=new WeakMap,e_=new WeakMap,t_=new WeakMap;class n_ extends s_{toStoragItem(e){const t=super.toStoragItem(e);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=1),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),this.version&&(t.v=this.version),t}}class o_ extends s_{toIReceivedConversation(){const e=super.toIReceivedConversation();return e.channelType=this.channelType,e}isDefaultChannel(){return!this.channelId||"RCDefault"===this.channelId}}var a_,l_,c_;const d_=e=>`${e.targetId}_${e.channelId||""}`;class __ extends Kd{constructor(e){super(),a_.add(this),Object.defineProperty(this,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_conversationCachePolicy",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"models",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"ugSentRecord",{enumerable:!0,configurable:!0,writable:!0,value:new Map});const t=this._ctx.initOptions.conversationCachePolicy;this._conversationCachePolicy=t?{limit:"number"==typeof t.limit?t.limit:1e3,ultraGroupLimit:"number"==typeof t.ultraGroupLimit?t.ultraGroupLimit:5e3,customEviction:"function"==typeof t.customEviction?t.customEviction:void 0}:void 0}get enableReadReceiptStorage(){return this._ctx.initOptions.enableReadReceiptStorage}_syncDataHandler(e){const{localStorage:t}=io,{appkey:i,currentUserId:s,isDisableEmptyUGChannelId:n,isMemSesAttrs:o}=e,a=Ke(i,s),l=qe(i,s),c=Qe(i,s),d=Ye(i,s),_=je(i,s),u=We(i,s),h=Je(i,s),E=Xe(i,s),g=et(i,s);t.removeItem(`RC-con-s-ver-${i}-${s}`),o&&t.removeItem(_),this.ugSentRecord.clear();const I=t.getItem(a)||"0",p=t.getItem(l)||"0",T=t.getItem(c)||"1",R=t.getItem(_)||"0",f=JSON.parse(t.getItem(h)||"{}"),A=JSON.parse(t.getItem(d)||"{}"),m=JSON.parse(t.getItem(u)||"{}"),S=JSON.parse(t.getItem(E)||"{}"),v=JSON.parse(t.getItem(g)||"{}");r(this,a_,"m",l_).call(this,A,m,f,n);const C=Object.entries(v);C.length>0&&C.forEach((([e,t])=>{Object.entries(t).forEach((([e,r])=>{delete r.d,r.t<this._ctx.serverTime-Fe&&delete t[e]})),0===Object.keys(t).length&&delete v[e]}));return{inboxTime:{value:parseInt(I,10)||0,key:a},outboxTime:{value:parseInt(p,10)||0,key:l},broadcastTime:{value:parseInt(T,10)||0,key:c},conversationStatus:{value:A,key:d,stringify:!0},ultraGroupStatus:{value:m,key:u,stringify:!0},conversationStatusVersion:{value:parseInt(R,10)||0,key:_},conversationTypeGlobalSettings:{value:f,key:h,stringify:!0},sentRecord:{value:S,key:E,stringify:!0},readReceiptRecord:{value:v,key:g,stringify:!0}}}addUGSentRecord(e,t){this.ugSentRecord.set(e,t)}removeUGSentRecordByTimestamp(e){Array.from(this.ugSentRecord.entries()).forEach((([t,r])=>{r<=e&&this.ugSentRecord.delete(t)}))}isLocalSentUGMessage(e){return this.ugSentRecord.has(e)}addSentRecord(e,t){const r=this.get("sentRecord");r[e]=t,this.set("sentRecord",r)}removeSentRecord(e){const t=this.get("sentRecord");delete t[e],this.set("sentRecord",t)}removeSentRecordByTimestamp(e){const t=this.get("sentRecord");Object.keys(t).forEach((r=>{t[r]<=e&&delete t[r]})),this.set("sentRecord",t)}hasSentRecord(e){return!!this.get("sentRecord")[e]}addReadReceiptRequest(e,t){const{conversationType:r,content:i,senderUserId:s,sentTime:n}=e,{messageUId:o}=i;if(r!==exports.ConversationType.GROUP||!o)return!1;if(!this.enableReadReceiptStorage)return!0;if(n<this._ctx.serverTime-Fe)return!1;const a=this.get("readReceiptRecord"),l=d_(e),c=a[l]=a[l]||{};c[o]={t:e.sentTime,sId:s===t?void 0:s};const d=Object.entries(c);if(d.length>30){const[e,t]=d.sort(((e,t)=>e[1].t-t[1].t)).pop();delete c[e]}return this.set("readReceiptRecord",a),!0}handleReadReceiptResponse(e,t){const{conversationType:r,content:i,senderUserId:s,sentTime:n}=e;if(r!==exports.ConversationType.GROUP||!i.receiptMessageDic)return!1;if(!this.enableReadReceiptStorage)return!0;const o=s===t,{receiptMessageDic:a}=i,l=d_(e),c=this.get("readReceiptRecord"),d=c[l]=c[l]||{};if(o)Object.entries(a).forEach((([e,t])=>{t.forEach((e=>{delete d[e]}))})),0===Object.keys(d).length&&delete c[l];else{(a[t]||[]).forEach((e=>{const t=d[e];t&&(t.us=(t.us||[]).concat(s))}))}return this.set("readReceiptRecord",c),!0}getReadReceiptResponseUsers(e,t){var r;return(null===(r=(this.get("readReceiptRecord")[d_(e)]||{})[t])||void 0===r?void 0:r.us)||[]}createReadReceiptResponseContent(e){const t=this.get("readReceiptRecord")[d_(e)]||{},r={receiptMessageDic:{}};return Object.entries(t).forEach((([e,t])=>{t.sId&&(r.receiptMessageDic[t.sId]=r.receiptMessageDic[t.sId]||[],r.receiptMessageDic[t.sId].push(e))})),r}syncDataFromLocalStorage(e){super.syncDataFromLocalStorage(e),this.models.clear(),r(this,a_,"m",c_).call(this)}setConversationTypeNotificationLevel(e,t){const r=this.get("conversationTypeGlobalSettings");t===exports.NotificationLevel.NOT_SET?delete r[e]:r[e]={nl:t},this.set("conversationTypeGlobalSettings",r)}getConversationTypeNotificationLevel(e){var t;return(null===(t=this.get("conversationTypeGlobalSettings")[e])||void 0===t?void 0:t.nl)||exports.NotificationLevel.NOT_SET}getOrCreateModel(e,t){const{conversationType:r,targetId:i,channelId:s}=e;let n=this.getModel(e);if(!n){n=e.conversationType===exports.ConversationType.ULTRA_GROUP?new o_(e):new n_(e);const s=(r===exports.ConversationType.PRIVATE||r===exports.ConversationType.SYSTEM)&&this._ctx.robots.some((e=>e.robotId===i));n.updateAttrs({includeRobot:s}),t&&this.models.set(n.key,n)}return n}updateConversationStorage(e){const t=this.get("ultraGroupStatus"),r=this.get("conversationStatus");let i=!1,s=!1;const{isMemSesAttrs:n}=this._ctx;e.forEach((e=>{const{conversationType:o,key:a}=e,l=e.toStoragItem(n),c=Object.keys(l),d=0===c.length||1===c.length&&"h"===c[0],_=o===exports.ConversationType.ULTRA_GROUP;_?s=!0:i=!0;const u=_?t:r;d?delete u[a]:u[a]=l})),i&&this._updateConversationStorage("conversationStatus",r),s&&this._updateConversationStorage("ultraGroupStatus",t)}_updateConversationStorage(e,t){if(!this._conversationCachePolicy)return void this.set(e,t);const{limit:r,ultraGroupLimit:i,customEviction:s}=this._conversationCachePolicy;if("ultraGroupStatus"===e&&this._ctx.isMemSesAttrs)return;const o="conversationStatus"===e?r:i;let a=Object.entries(t);if(a.length<=o)return void this.set(e,t);let l=a.map((([e,t])=>this.getModel(Xd(e)))).filter((e=>!!e));if(s){const e=l.map((e=>e.toIReceivedConversation()));try{a=s(e).map((e=>{const r=Qd(e);return[r,t[r]]})).filter((e=>!!e[1]))}catch(e){this._ctx.logger.error(n.L_EXEC_CUSTOM_CONVERSATION_STORAGE_EVICTION_E,(null==e?void 0:e.message)||"unknown error")}}else l=this._defaultEviction(l,o),a=l.map((e=>{const{key:r}=e;return[r,t[r]]})).filter((e=>!!e[1]));this.set(e,Object.fromEntries(a))}_defaultEviction(e,t){return e.sort(((e,t)=>{const r=e.version,i=t.version,s=e.isTop?1:0;return(t.isTop?1:0)-s||i-r})).slice(0,t)}updateBySessionStates(e){if(!(null==e?void 0:e.length))return[];let t=this.get("conversationStatusVersion");const r=new Map,i=new Set;e.forEach((e=>{const{channelId:s,busChannel:n,type:o,stateItem:a}=e,l=e.time;t=Math.max(t,l);const c={};if(null==a||a.forEach((e=>{const{tags:t,sessionStateType:r,value:i}=e;switch(r){case pc.IsSilent:c.notificationLevel=parseInt(i,10);break;case pc.IsTop:c.isTop="1"===i;break;case pc.Tags:c.tags=t;break;case pc.AutoTrans:c.translateStrategy=parseInt(i,10)}})),!s)return void(void 0!==c.notificationLevel&&this.setConversationTypeNotificationLevel(o,c.notificationLevel));const d={conversationType:o,targetId:s,channelId:n},_=this.getOrCreateModel(d,!0);i.add(_);const u=_.updateAttrs(c,l);if(u)if(r.has(_)){const e=r.get(_);Object.assign(e,u)}else r.set(_,u)})),this.set("conversationStatusVersion",t),this.updateConversationStorage(Array.from(i));return Array.from(r.entries()).map((([e,t])=>({conversation:e.toIReceivedConversation(),updatedItems:t})))}addRelations(e,t){e.forEach((e=>{const{userId:r,type:i,busChannel:s}=e,n={conversationType:i,targetId:r,channelId:s},o=this.getOrCreateModel(n,!0),a=((e,t)=>{var r,i,s;const{msg:n,isBot:o}=e;return{latestMessage:n?dd(n,t,!1,e.userId):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===(s=e.msgInfo)||void 0===s?void 0:s.msgTime,includeRobot:!!o}})(e,t);i===exports.ConversationType.ULTRA_GROUP?o.updateAttrs(a):o.updateAttrs({latestMessage:a.latestMessage,operationTime:a.operationTime,includeRobot:a.includeRobot,hidden:!1})}))}getDrafts(e){const t=this.getModel(e);return(null==t?void 0:t.draft)||""}setDrafts(e,t){this.getOrCreateModel(e,!0).updateAttrs({draft:t})}deleteDrafts(e){const t=this.getModel(e);t&&t.updateAttrs({draft:""})}getCachedUGConversation(e,t){const r={conversationType:exports.ConversationType.ULTRA_GROUP,targetId:e,channelId:t},i=this.getModel(r);return(null==i?void 0:i.toIReceivedConversation())||null}getAllUGModels(){const e=this.models.values();return Array.from(e).filter((e=>e.conversationType===exports.ConversationType.ULTRA_GROUP)).map((e=>e))}getAllSGModels(){const e=this.models.values();return Array.from(e).filter((e=>e.conversationType!==exports.ConversationType.ULTRA_GROUP)).map((e=>e))}getAllModels(){return Array.from(this.models.values())}getModel(e){const{conversationType:t,targetId:r}=e,i=Qd(e),s=this.models.get(i);if(!s)return null;const n=(t===exports.ConversationType.PRIVATE||t===exports.ConversationType.SYSTEM)&&this._ctx.robots.some((e=>e.robotId===r));return s.updateAttrs({includeRobot:n}),s}removeConversation(e){const t=this.getModel(e);t&&(t.remove(),this.updateConversationStorage([t]))}getAllUnreadCount(e,t){let r=0;return this.getAllSGModels().forEach((i=>{var s;const{conversationType:n}=i;e.includes(n)&&(i.notificationLevel>exports.NotificationLevel.NOT_SET&&!t||(r+=null!==(s=i.unreadCount)&&void 0!==s?s:0))})),r}getTagConversationCountMap(){const e=new Map;return this.getAllModels().forEach((t=>{const{tags:r}=t;r.length>0&&r.forEach((r=>{e.set(r.tagId,(e.get(r.tagId)||[]).concat(t.identifier))}))})),e}clearConversationUnreadCount(e,t){const r=this.getModel(e);if(!r)return null;const i=r.clearUnreadCount(t);return this.updateConversationStorage([r]),i?{conversation:r.toIReceivedConversation(),updatedItems:i}:null}}a_=new WeakSet,l_=function(e,t,r,i){Object.keys(e).forEach((t=>{const i=Xd(t);W(i.conversationType,w)?i.targetId||(r[i.conversationType]={nl:e[t].nl||exports.NotificationLevel.NOT_SET},delete e[t]):delete e[t]})),Object.keys(t).forEach((e=>{const s=Xd(e);if(s.conversationType===exports.ConversationType.ULTRA_GROUP)return s.targetId?void(i&&!s.channelId&&delete t[e]):(r[s.conversationType]={nl:t[e].nl||exports.NotificationLevel.NOT_SET},void delete t[e]);delete t[e]}))},c_=function(){[...Object.entries(this.get("conversationStatus")),...Object.entries(this.get("ultraGroupStatus"))].forEach((([e,t])=>{const r=Xd(e);if(!W(r.conversationType,V))return;this.getOrCreateModel(r,!0).updateAttrs((e=>{const{c:t,mc:r,mmc:i,hm:s,m:n,fut:o,fuid:a,fumt:l,nl:c,to:d,tg:_,rt:u,h:h,ts:E,v:g}=e;return{isTop:!!d,notificationLevel:c,tags:r_(_),unreadCount:t,unreadMentionedCount:r,unreadMentionedMeCount:i,hasMentioned:!!s,mentionedInfo:n,firstUnreadTime:o,firstUnreadMessageUId:a,firstUnreadMessageType:l,lastReadTime:u,hidden:!!h,translateStrategy:E,version:g||u}})(t),0)}))};function u_(e){let t=e.length;for(;--t>=0;)e[t]=0}const h_=256,E_=286,g_=30,I_=15,p_=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]),T_=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]),R_=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),f_=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),A_=new Array(576);u_(A_);const m_=new Array(60);u_(m_);const S_=new Array(512);u_(S_);const v_=new Array(256);u_(v_);const C_=new Array(29);u_(C_);const y_=new Array(g_);function O_(e,t,r,i,s){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=i,this.max_length=s,this.has_stree=e&&e.length}let N_,M_,b_;function L_(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}u_(y_);const U_=e=>e<256?S_[e]:S_[256+(e>>>7)],P_=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},D_=(e,t,r)=>{e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,P_(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)},x_=(e,t,r)=>{D_(e,r[2*t],r[2*t+1])},w_=(e,t)=>{let r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1},G_=(e,t,r)=>{const i=new Array(16);let s,n,o=0;for(s=1;s<=I_;s++)o=o+r[s-1]<<1,i[s]=o;for(n=0;n<=t;n++){let t=e[2*n+1];0!==t&&(e[2*n]=w_(i[t]++,t))}},V_=e=>{let t;for(t=0;t<E_;t++)e.dyn_ltree[2*t]=0;for(t=0;t<g_;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},k_=e=>{e.bi_valid>8?P_(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},F_=(e,t,r,i)=>{const s=2*t,n=2*r;return e[s]<e[n]||e[s]===e[n]&&i[t]<=i[r]},B_=(e,t,r)=>{const i=e.heap[r];let s=r<<1;for(;s<=e.heap_len&&(s<e.heap_len&&F_(t,e.heap[s+1],e.heap[s],e.depth)&&s++,!F_(t,i,e.heap[s],e.depth));)e.heap[r]=e.heap[s],r=s,s<<=1;e.heap[r]=i},H_=(e,t,r)=>{let i,s,n,o,a=0;if(0!==e.sym_next)do{i=255&e.pending_buf[e.sym_buf+a++],i+=(255&e.pending_buf[e.sym_buf+a++])<<8,s=e.pending_buf[e.sym_buf+a++],0===i?x_(e,s,t):(n=v_[s],x_(e,n+h_+1,t),o=p_[n],0!==o&&(s-=C_[n],D_(e,s,o)),i--,n=U_(i),x_(e,n,r),o=T_[n],0!==o&&(i-=y_[n],D_(e,i,o)))}while(a<e.sym_next);x_(e,256,t)},j_=(e,t)=>{const r=t.dyn_tree,i=t.stat_desc.static_tree,s=t.stat_desc.has_stree,n=t.stat_desc.elems;let o,a,l,c=-1;for(e.heap_len=0,e.heap_max=573,o=0;o<n;o++)0!==r[2*o]?(e.heap[++e.heap_len]=c=o,e.depth[o]=0):r[2*o+1]=0;for(;e.heap_len<2;)l=e.heap[++e.heap_len]=c<2?++c:0,r[2*l]=1,e.depth[l]=0,e.opt_len--,s&&(e.static_len-=i[2*l+1]);for(t.max_code=c,o=e.heap_len>>1;o>=1;o--)B_(e,r,o);l=n;do{o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],B_(e,r,1),a=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=a,r[2*l]=r[2*o]+r[2*a],e.depth[l]=(e.depth[o]>=e.depth[a]?e.depth[o]:e.depth[a])+1,r[2*o+1]=r[2*a+1]=l,e.heap[1]=l++,B_(e,r,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const r=t.dyn_tree,i=t.max_code,s=t.stat_desc.static_tree,n=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,a=t.stat_desc.extra_base,l=t.stat_desc.max_length;let c,d,_,u,h,E,g=0;for(u=0;u<=I_;u++)e.bl_count[u]=0;for(r[2*e.heap[e.heap_max]+1]=0,c=e.heap_max+1;c<573;c++)d=e.heap[c],u=r[2*r[2*d+1]+1]+1,u>l&&(u=l,g++),r[2*d+1]=u,d>i||(e.bl_count[u]++,h=0,d>=a&&(h=o[d-a]),E=r[2*d],e.opt_len+=E*(u+h),n&&(e.static_len+=E*(s[2*d+1]+h)));if(0!==g){do{for(u=l-1;0===e.bl_count[u];)u--;e.bl_count[u]--,e.bl_count[u+1]+=2,e.bl_count[l]--,g-=2}while(g>0);for(u=l;0!==u;u--)for(d=e.bl_count[u];0!==d;)_=e.heap[--c],_>i||(r[2*_+1]!==u&&(e.opt_len+=(u-r[2*_+1])*r[2*_],r[2*_+1]=u),d--)}})(e,t),G_(r,c,e.bl_count)},Y_=(e,t,r)=>{let i,s,n=-1,o=t[1],a=0,l=7,c=4;for(0===o&&(l=138,c=3),t[2*(r+1)+1]=65535,i=0;i<=r;i++)s=o,o=t[2*(i+1)+1],++a<l&&s===o||(a<c?e.bl_tree[2*s]+=a:0!==s?(s!==n&&e.bl_tree[2*s]++,e.bl_tree[32]++):a<=10?e.bl_tree[34]++:e.bl_tree[36]++,a=0,n=s,0===o?(l=138,c=3):s===o?(l=6,c=3):(l=7,c=4))},W_=(e,t,r)=>{let i,s,n=-1,o=t[1],a=0,l=7,c=4;for(0===o&&(l=138,c=3),i=0;i<=r;i++)if(s=o,o=t[2*(i+1)+1],!(++a<l&&s===o)){if(a<c)do{x_(e,s,e.bl_tree)}while(0!=--a);else 0!==s?(s!==n&&(x_(e,s,e.bl_tree),a--),x_(e,16,e.bl_tree),D_(e,a-3,2)):a<=10?(x_(e,17,e.bl_tree),D_(e,a-3,3)):(x_(e,18,e.bl_tree),D_(e,a-11,7));a=0,n=s,0===o?(l=138,c=3):s===o?(l=6,c=3):(l=7,c=4)}};let J_=!1;const q_=(e,t,r,i)=>{D_(e,0+(i?1:0),3),k_(e),P_(e,r),P_(e,~r),r&&e.pending_buf.set(e.window.subarray(t,t+r),e.pending),e.pending+=r};var K_=(e,t,r,i)=>{let s,n,o=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&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<h_;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),j_(e,e.l_desc),j_(e,e.d_desc),o=(e=>{let t;for(Y_(e,e.dyn_ltree,e.l_desc.max_code),Y_(e,e.dyn_dtree,e.d_desc.max_code),j_(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*f_[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),s=e.opt_len+3+7>>>3,n=e.static_len+3+7>>>3,n<=s&&(s=n)):s=n=r+5,r+4<=s&&-1!==t?q_(e,t,r,i):4===e.strategy||n===s?(D_(e,2+(i?1:0),3),H_(e,A_,m_)):(D_(e,4+(i?1:0),3),((e,t,r,i)=>{let s;for(D_(e,t-257,5),D_(e,r-1,5),D_(e,i-4,4),s=0;s<i;s++)D_(e,e.bl_tree[2*f_[s]+1],3);W_(e,e.dyn_ltree,t-1),W_(e,e.dyn_dtree,r-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),H_(e,e.dyn_ltree,e.dyn_dtree)),V_(e),i&&k_(e)},Q_={_tr_init:e=>{J_||((()=>{let e,t,r,i,s;const n=new Array(16);for(r=0,i=0;i<28;i++)for(C_[i]=r,e=0;e<1<<p_[i];e++)v_[r++]=i;for(v_[r-1]=i,s=0,i=0;i<16;i++)for(y_[i]=s,e=0;e<1<<T_[i];e++)S_[s++]=i;for(s>>=7;i<g_;i++)for(y_[i]=s<<7,e=0;e<1<<T_[i]-7;e++)S_[256+s++]=i;for(t=0;t<=I_;t++)n[t]=0;for(e=0;e<=143;)A_[2*e+1]=8,e++,n[8]++;for(;e<=255;)A_[2*e+1]=9,e++,n[9]++;for(;e<=279;)A_[2*e+1]=7,e++,n[7]++;for(;e<=287;)A_[2*e+1]=8,e++,n[8]++;for(G_(A_,287,n),e=0;e<g_;e++)m_[2*e+1]=5,m_[2*e]=w_(e,5);N_=new O_(A_,p_,257,E_,I_),M_=new O_(m_,T_,0,g_,I_),b_=new O_(new Array(0),R_,0,19,7)})(),J_=!0),e.l_desc=new L_(e.dyn_ltree,N_),e.d_desc=new L_(e.dyn_dtree,M_),e.bl_desc=new L_(e.bl_tree,b_),e.bi_buf=0,e.bi_valid=0,V_(e)},_tr_stored_block:q_,_tr_flush_block:K_,_tr_tally:(e,t,r)=>(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++]=r,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(v_[r]+h_+1)]++,e.dyn_dtree[2*U_(t)]++),e.sym_next===e.sym_end),_tr_align:e=>{D_(e,2,3),x_(e,256,A_),(e=>{16===e.bi_valid?(P_(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 X_=(e,t,r,i)=>{let s=65535&e,n=e>>>16&65535,o=0;for(;0!==r;){o=r>2e3?2e3:r,r-=o;do{s=s+t[i++]|0,n=n+s|0}while(--o);s%=65521,n%=65521}return s|n<<16};const z_=new Uint32Array((()=>{let e,t=[];for(var r=0;r<256;r++){e=r;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t})());var Z_=(e,t,r,i)=>{const s=z_,n=i+r;e^=-1;for(let r=i;r<n;r++)e=e>>>8^s[255&(e^t[r])];return~e},$_={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"},eu={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:tu,_tr_stored_block:ru,_tr_flush_block:iu,_tr_tally:su,_tr_align:nu}=Q_,{Z_NO_FLUSH:ou,Z_PARTIAL_FLUSH:au,Z_FULL_FLUSH:lu,Z_FINISH:cu,Z_BLOCK:du,Z_OK:_u,Z_STREAM_END:uu,Z_STREAM_ERROR:hu,Z_DATA_ERROR:Eu,Z_BUF_ERROR:gu,Z_DEFAULT_COMPRESSION:Iu,Z_FILTERED:pu,Z_HUFFMAN_ONLY:Tu,Z_RLE:Ru,Z_FIXED:fu,Z_DEFAULT_STRATEGY:Au,Z_UNKNOWN:mu,Z_DEFLATED:Su}=eu,vu=258,Cu=262,yu=42,Ou=113,Nu=666,Mu=(e,t)=>(e.msg=$_[t],t),bu=e=>2*e-(e>4?9:0),Lu=e=>{let t=e.length;for(;--t>=0;)e[t]=0},Uu=e=>{let t,r,i,s=e.w_size;t=e.hash_size,i=t;do{r=e.head[--i],e.head[i]=r>=s?r-s:0}while(--t);t=s,i=t;do{r=e.prev[--i],e.prev[i]=r>=s?r-s:0}while(--t)};let Pu=(e,t,r)=>(t<<e.hash_shift^r)&e.hash_mask;const Du=e=>{const t=e.state;let r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+r),e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))},xu=(e,t)=>{iu(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Du(e.strm)},wu=(e,t)=>{e.pending_buf[e.pending++]=t},Gu=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},Vu=(e,t,r,i)=>{let s=e.avail_in;return s>i&&(s=i),0===s?0:(e.avail_in-=s,t.set(e.input.subarray(e.next_in,e.next_in+s),r),1===e.state.wrap?e.adler=X_(e.adler,t,s,r):2===e.state.wrap&&(e.adler=Z_(e.adler,t,s,r)),e.next_in+=s,e.total_in+=s,s)},ku=(e,t)=>{let r,i,s=e.max_chain_length,n=e.strstart,o=e.prev_length,a=e.nice_match;const l=e.strstart>e.w_size-Cu?e.strstart-(e.w_size-Cu):0,c=e.window,d=e.w_mask,_=e.prev,u=e.strstart+vu;let h=c[n+o-1],E=c[n+o];e.prev_length>=e.good_match&&(s>>=2),a>e.lookahead&&(a=e.lookahead);do{if(r=t,c[r+o]===E&&c[r+o-1]===h&&c[r]===c[n]&&c[++r]===c[n+1]){n+=2,r++;do{}while(c[++n]===c[++r]&&c[++n]===c[++r]&&c[++n]===c[++r]&&c[++n]===c[++r]&&c[++n]===c[++r]&&c[++n]===c[++r]&&c[++n]===c[++r]&&c[++n]===c[++r]&&n<u);if(i=vu-(u-n),n=u-vu,i>o){if(e.match_start=t,o=i,i>=a)break;h=c[n+o-1],E=c[n+o]}}}while((t=_[t&d])>l&&0!=--s);return o<=e.lookahead?o:e.lookahead},Fu=e=>{const t=e.w_size;let r,i,s;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Cu)&&(e.window.set(e.window.subarray(t,t+t-i),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),Uu(e),i+=t),0===e.strm.avail_in)break;if(r=Vu(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=r,e.lookahead+e.insert>=3)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=Pu(e,e.ins_h,e.window[s+1]);e.insert&&(e.ins_h=Pu(e,e.ins_h,e.window[s+3-1]),e.prev[s&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=s,s++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<Cu&&0!==e.strm.avail_in)},Bu=(e,t)=>{let r,i,s,n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,o=0,a=e.strm.avail_in;do{if(r=65535,s=e.bi_valid+42>>3,e.strm.avail_out<s)break;if(s=e.strm.avail_out-s,i=e.strstart-e.block_start,r>i+e.strm.avail_in&&(r=i+e.strm.avail_in),r>s&&(r=s),r<n&&(0===r&&t!==cu||t===ou||r!==i+e.strm.avail_in))break;o=t===cu&&r===i+e.strm.avail_in?1:0,ru(e,0,0,o),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,Du(e.strm),i&&(i>r&&(i=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,r-=i),r&&(Vu(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(0===o);return a-=e.strm.avail_in,a&&(a>=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<=a&&(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-a,e.strm.next_in),e.strstart),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),o?4:t!==ou&&t!==cu&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(s=e.window_size-e.strstart,e.strm.avail_in>s&&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++,s+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),s>e.strm.avail_in&&(s=e.strm.avail_in),s&&(Vu(e.strm,e.window,e.strstart,s),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.high_water<e.strstart&&(e.high_water=e.strstart),s=e.bi_valid+42>>3,s=e.pending_buf_size-s>65535?65535:e.pending_buf_size-s,n=s>e.w_size?e.w_size:s,i=e.strstart-e.block_start,(i>=n||(i||t===cu)&&t!==ou&&0===e.strm.avail_in&&i<=s)&&(r=i>s?s:i,o=t===cu&&0===e.strm.avail_in&&r===i?1:0,ru(e,e.block_start,r,o),e.block_start+=r,Du(e.strm)),o?3:1)},Hu=(e,t)=>{let r,i;for(;;){if(e.lookahead<Cu){if(Fu(e),e.lookahead<Cu&&t===ou)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=Pu(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-Cu&&(e.match_length=ku(e,r)),e.match_length>=3)if(i=su(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=Pu(e,e.ins_h,e.window[e.strstart+3-1]),r=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=Pu(e,e.ins_h,e.window[e.strstart+1]);else i=su(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(xu(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===cu?(xu(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(xu(e,!1),0===e.strm.avail_out)?1:2},ju=(e,t)=>{let r,i,s;for(;;){if(e.lookahead<Cu){if(Fu(e),e.lookahead<Cu&&t===ou)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=Pu(e,e.ins_h,e.window[e.strstart+3-1]),r=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!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-Cu&&(e.match_length=ku(e,r),e.match_length<=5&&(e.strategy===pu||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){s=e.strstart+e.lookahead-3,i=su(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=s&&(e.ins_h=Pu(e,e.ins_h,e.window[e.strstart+3-1]),r=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++,i&&(xu(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(i=su(e,0,e.window[e.strstart-1]),i&&xu(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&&(i=su(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===cu?(xu(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(xu(e,!1),0===e.strm.avail_out)?1:2};function Yu(e,t,r,i,s){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=i,this.func=s}const Wu=[new Yu(0,0,0,0,Bu),new Yu(4,4,8,4,Hu),new Yu(4,5,16,8,Hu),new Yu(4,6,32,32,Hu),new Yu(4,4,16,16,ju),new Yu(8,16,32,32,ju),new Yu(8,16,128,128,ju),new Yu(8,32,128,256,ju),new Yu(32,128,258,1024,ju),new Yu(32,258,258,4096,ju)];function Ju(){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=Su,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),Lu(this.dyn_ltree),Lu(this.dyn_dtree),Lu(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),Lu(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Lu(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 qu=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==yu&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==Ou&&t.status!==Nu?1:0},Ku=e=>{if(qu(e))return Mu(e,hu);e.total_in=e.total_out=0,e.data_type=mu;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?yu:Ou,e.adler=2===t.wrap?0:1,t.last_flush=-2,tu(t),_u},Qu=e=>{const t=Ku(e);var r;return t===_u&&((r=e.state).window_size=2*r.w_size,Lu(r.head),r.max_lazy_match=Wu[r.level].max_lazy,r.good_match=Wu[r.level].good_length,r.nice_match=Wu[r.level].nice_length,r.max_chain_length=Wu[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=2,r.match_available=0,r.ins_h=0),t},Xu=(e,t,r,i,s,n)=>{if(!e)return hu;let o=1;if(t===Iu&&(t=6),i<0?(o=0,i=-i):i>15&&(o=2,i-=16),s<1||s>9||r!==Su||i<8||i>15||t<0||t>9||n<0||n>fu||8===i&&1!==o)return Mu(e,hu);8===i&&(i=9);const a=new Ju;return e.state=a,a.strm=e,a.status=yu,a.wrap=o,a.gzhead=null,a.w_bits=i,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=s+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+3-1)/3),a.window=new Uint8Array(2*a.w_size),a.head=new Uint16Array(a.hash_size),a.prev=new Uint16Array(a.w_size),a.lit_bufsize=1<<s+6,a.pending_buf_size=4*a.lit_bufsize,a.pending_buf=new Uint8Array(a.pending_buf_size),a.sym_buf=a.lit_bufsize,a.sym_end=3*(a.lit_bufsize-1),a.level=t,a.strategy=n,a.method=r,Qu(e)};var zu={deflateInit:(e,t)=>Xu(e,t,Su,15,8,Au),deflateInit2:Xu,deflateReset:Qu,deflateResetKeep:Ku,deflateSetHeader:(e,t)=>qu(e)||2!==e.state.wrap?hu:(e.state.gzhead=t,_u),deflate:(e,t)=>{if(qu(e)||t>du||t<0)return e?Mu(e,hu):hu;const r=e.state;if(!e.output||0!==e.avail_in&&!e.input||r.status===Nu&&t!==cu)return Mu(e,0===e.avail_out?gu:hu);const i=r.last_flush;if(r.last_flush=t,0!==r.pending){if(Du(e),0===e.avail_out)return r.last_flush=-1,_u}else if(0===e.avail_in&&bu(t)<=bu(i)&&t!==cu)return Mu(e,gu);if(r.status===Nu&&0!==e.avail_in)return Mu(e,gu);if(r.status===yu&&0===r.wrap&&(r.status=Ou),r.status===yu){let t=Su+(r.w_bits-8<<4)<<8,i=-1;if(i=r.strategy>=Tu||r.level<2?0:r.level<6?1:6===r.level?2:3,t|=i<<6,0!==r.strstart&&(t|=32),t+=31-t%31,Gu(r,t),0!==r.strstart&&(Gu(r,e.adler>>>16),Gu(r,65535&e.adler)),e.adler=1,r.status=Ou,Du(e),0!==r.pending)return r.last_flush=-1,_u}if(57===r.status)if(e.adler=0,wu(r,31),wu(r,139),wu(r,8),r.gzhead)wu(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),wu(r,255&r.gzhead.time),wu(r,r.gzhead.time>>8&255),wu(r,r.gzhead.time>>16&255),wu(r,r.gzhead.time>>24&255),wu(r,9===r.level?2:r.strategy>=Tu||r.level<2?4:0),wu(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(wu(r,255&r.gzhead.extra.length),wu(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=Z_(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69;else if(wu(r,0),wu(r,0),wu(r,0),wu(r,0),wu(r,0),wu(r,9===r.level?2:r.strategy>=Tu||r.level<2?4:0),wu(r,3),r.status=Ou,Du(e),0!==r.pending)return r.last_flush=-1,_u;if(69===r.status){if(r.gzhead.extra){let t=r.pending,i=(65535&r.gzhead.extra.length)-r.gzindex;for(;r.pending+i>r.pending_buf_size;){let s=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+s),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>t&&(e.adler=Z_(e.adler,r.pending_buf,r.pending-t,t)),r.gzindex+=s,Du(e),0!==r.pending)return r.last_flush=-1,_u;t=0,i-=s}let s=new Uint8Array(r.gzhead.extra);r.pending_buf.set(s.subarray(r.gzindex,r.gzindex+i),r.pending),r.pending+=i,r.gzhead.hcrc&&r.pending>t&&(e.adler=Z_(e.adler,r.pending_buf,r.pending-t,t)),r.gzindex=0}r.status=73}if(73===r.status){if(r.gzhead.name){let t,i=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(e.adler=Z_(e.adler,r.pending_buf,r.pending-i,i)),Du(e),0!==r.pending)return r.last_flush=-1,_u;i=0}t=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,wu(r,t)}while(0!==t);r.gzhead.hcrc&&r.pending>i&&(e.adler=Z_(e.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=91}if(91===r.status){if(r.gzhead.comment){let t,i=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(e.adler=Z_(e.adler,r.pending_buf,r.pending-i,i)),Du(e),0!==r.pending)return r.last_flush=-1,_u;i=0}t=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,wu(r,t)}while(0!==t);r.gzhead.hcrc&&r.pending>i&&(e.adler=Z_(e.adler,r.pending_buf,r.pending-i,i))}r.status=103}if(103===r.status){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(Du(e),0!==r.pending))return r.last_flush=-1,_u;wu(r,255&e.adler),wu(r,e.adler>>8&255),e.adler=0}if(r.status=Ou,Du(e),0!==r.pending)return r.last_flush=-1,_u}if(0!==e.avail_in||0!==r.lookahead||t!==ou&&r.status!==Nu){let i=0===r.level?Bu(r,t):r.strategy===Tu?((e,t)=>{let r;for(;;){if(0===e.lookahead&&(Fu(e),0===e.lookahead)){if(t===ou)return 1;break}if(e.match_length=0,r=su(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(xu(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===cu?(xu(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(xu(e,!1),0===e.strm.avail_out)?1:2})(r,t):r.strategy===Ru?((e,t)=>{let r,i,s,n;const o=e.window;for(;;){if(e.lookahead<=vu){if(Fu(e),e.lookahead<=vu&&t===ou)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(s=e.strstart-1,i=o[s],i===o[++s]&&i===o[++s]&&i===o[++s])){n=e.strstart+vu;do{}while(i===o[++s]&&i===o[++s]&&i===o[++s]&&i===o[++s]&&i===o[++s]&&i===o[++s]&&i===o[++s]&&i===o[++s]&&s<n);e.match_length=vu-(n-s),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=su(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=su(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(xu(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===cu?(xu(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(xu(e,!1),0===e.strm.avail_out)?1:2})(r,t):Wu[r.level].func(r,t);if(3!==i&&4!==i||(r.status=Nu),1===i||3===i)return 0===e.avail_out&&(r.last_flush=-1),_u;if(2===i&&(t===au?nu(r):t!==du&&(ru(r,0,0,!1),t===lu&&(Lu(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),Du(e),0===e.avail_out))return r.last_flush=-1,_u}return t!==cu?_u:r.wrap<=0?uu:(2===r.wrap?(wu(r,255&e.adler),wu(r,e.adler>>8&255),wu(r,e.adler>>16&255),wu(r,e.adler>>24&255),wu(r,255&e.total_in),wu(r,e.total_in>>8&255),wu(r,e.total_in>>16&255),wu(r,e.total_in>>24&255)):(Gu(r,e.adler>>>16),Gu(r,65535&e.adler)),Du(e),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?_u:uu)},deflateEnd:e=>{if(qu(e))return hu;const t=e.state.status;return e.state=null,t===Ou?Mu(e,Eu):_u},deflateSetDictionary:(e,t)=>{let r=t.length;if(qu(e))return hu;const i=e.state,s=i.wrap;if(2===s||1===s&&i.status!==yu||i.lookahead)return hu;if(1===s&&(e.adler=X_(e.adler,t,r,0)),i.wrap=0,r>=i.w_size){0===s&&(Lu(i.head),i.strstart=0,i.block_start=0,i.insert=0);let e=new Uint8Array(i.w_size);e.set(t.subarray(r-i.w_size,r),0),t=e,r=i.w_size}const n=e.avail_in,o=e.next_in,a=e.input;for(e.avail_in=r,e.next_in=0,e.input=t,Fu(i);i.lookahead>=3;){let e=i.strstart,t=i.lookahead-2;do{i.ins_h=Pu(i,i.ins_h,i.window[e+3-1]),i.prev[e&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=e,e++}while(--t);i.strstart=e,i.lookahead=2,Fu(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,e.next_in=o,e.input=a,e.avail_in=n,i.wrap=s,_u},deflateInfo:"pako deflate (from Nodeca project)"};const Zu=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var $u={assign:function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(const t in r)Zu(r,t)&&(e[t]=r[t])}}return e},flattenChunks:e=>{let t=0;for(let r=0,i=e.length;r<i;r++)t+=e[r].length;const r=new Uint8Array(t);for(let t=0,i=0,s=e.length;t<s;t++){let s=e[t];r.set(s,i),i+=s.length}return r}};let eh=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){eh=!1}const th=new Uint8Array(256);for(let e=0;e<256;e++)th[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;th[254]=th[254]=1;var rh={string2buf:e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,r,i,s,n,o=e.length,a=0;for(s=0;s<o;s++)r=e.charCodeAt(s),55296==(64512&r)&&s+1<o&&(i=e.charCodeAt(s+1),56320==(64512&i)&&(r=65536+(r-55296<<10)+(i-56320),s++)),a+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(a),n=0,s=0;n<a;s++)r=e.charCodeAt(s),55296==(64512&r)&&s+1<o&&(i=e.charCodeAt(s+1),56320==(64512&i)&&(r=65536+(r-55296<<10)+(i-56320),s++)),r<128?t[n++]=r:r<2048?(t[n++]=192|r>>>6,t[n++]=128|63&r):r<65536?(t[n++]=224|r>>>12,t[n++]=128|r>>>6&63,t[n++]=128|63&r):(t[n++]=240|r>>>18,t[n++]=128|r>>>12&63,t[n++]=128|r>>>6&63,t[n++]=128|63&r);return t},buf2string:(e,t)=>{const r=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let i,s;const n=new Array(2*r);for(s=0,i=0;i<r;){let t=e[i++];if(t<128){n[s++]=t;continue}let o=th[t];if(o>4)n[s++]=65533,i+=o-1;else{for(t&=2===o?31:3===o?15:7;o>1&&i<r;)t=t<<6|63&e[i++],o--;o>1?n[s++]=65533:t<65536?n[s++]=t:(t-=65536,n[s++]=55296|t>>10&1023,n[s++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&eh)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let r="";for(let i=0;i<t;i++)r+=String.fromCharCode(e[i]);return r})(n,s)},utf8border:(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let r=t-1;for(;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+th[e[r]]>t?r:t}};var ih=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 sh=Object.prototype.toString,{Z_NO_FLUSH:nh,Z_SYNC_FLUSH:oh,Z_FULL_FLUSH:ah,Z_FINISH:lh,Z_OK:ch,Z_STREAM_END:dh,Z_DEFAULT_COMPRESSION:_h,Z_DEFAULT_STRATEGY:uh,Z_DEFLATED:hh}=eu;function Eh(e){this.options=$u.assign({level:_h,method:hh,chunkSize:16384,windowBits:15,memLevel:8,strategy:uh},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 ih,this.strm.avail_out=0;let r=zu.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==ch)throw new Error($_[r]);if(t.header&&zu.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?rh.string2buf(t.dictionary):"[object ArrayBuffer]"===sh.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,r=zu.deflateSetDictionary(this.strm,e),r!==ch)throw new Error($_[r]);this._dict_set=!0}}Eh.prototype.push=function(e,t){const r=this.strm,i=this.options.chunkSize;let s,n;if(this.ended)return!1;for(n=t===~~t?t:!0===t?lh:nh,"string"==typeof e?r.input=rh.string2buf(e):"[object ArrayBuffer]"===sh.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(n===oh||n===ah)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(s=zu.deflate(r,n),s===dh)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),s=zu.deflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===ch;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},Eh.prototype.onData=function(e){this.chunks.push(e)},Eh.prototype.onEnd=function(e){e===ch&&(this.result=$u.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const gh=16209;var Ih=function(e,t){let r,i,s,n,o,a,l,c,d,_,u,h,E,g,I,p,T,R,f,A,m,S,v,C;const y=e.state;r=e.next_in,v=e.input,i=r+(e.avail_in-5),s=e.next_out,C=e.output,n=s-(t-e.avail_out),o=s+(e.avail_out-257),a=y.dmax,l=y.wsize,c=y.whave,d=y.wnext,_=y.window,u=y.hold,h=y.bits,E=y.lencode,g=y.distcode,I=(1<<y.lenbits)-1,p=(1<<y.distbits)-1;e:do{h<15&&(u+=v[r++]<<h,h+=8,u+=v[r++]<<h,h+=8),T=E[u&I];t:for(;;){if(R=T>>>24,u>>>=R,h-=R,R=T>>>16&255,0===R)C[s++]=65535&T;else{if(!(16&R)){if(64&R){if(32&R){y.mode=16191;break e}e.msg="invalid literal/length code",y.mode=gh;break e}T=E[(65535&T)+(u&(1<<R)-1)];continue t}for(f=65535&T,R&=15,R&&(h<R&&(u+=v[r++]<<h,h+=8),f+=u&(1<<R)-1,u>>>=R,h-=R),h<15&&(u+=v[r++]<<h,h+=8,u+=v[r++]<<h,h+=8),T=g[u&p];;){if(R=T>>>24,u>>>=R,h-=R,R=T>>>16&255,16&R){if(A=65535&T,R&=15,h<R&&(u+=v[r++]<<h,h+=8,h<R&&(u+=v[r++]<<h,h+=8)),A+=u&(1<<R)-1,A>a){e.msg="invalid distance too far back",y.mode=gh;break e}if(u>>>=R,h-=R,R=s-n,A>R){if(R=A-R,R>c&&y.sane){e.msg="invalid distance too far back",y.mode=gh;break e}if(m=0,S=_,0===d){if(m+=l-R,R<f){f-=R;do{C[s++]=_[m++]}while(--R);m=s-A,S=C}}else if(d<R){if(m+=l+d-R,R-=d,R<f){f-=R;do{C[s++]=_[m++]}while(--R);if(m=0,d<f){R=d,f-=R;do{C[s++]=_[m++]}while(--R);m=s-A,S=C}}}else if(m+=d-R,R<f){f-=R;do{C[s++]=_[m++]}while(--R);m=s-A,S=C}for(;f>2;)C[s++]=S[m++],C[s++]=S[m++],C[s++]=S[m++],f-=3;f&&(C[s++]=S[m++],f>1&&(C[s++]=S[m++]))}else{m=s-A;do{C[s++]=C[m++],C[s++]=C[m++],C[s++]=C[m++],f-=3}while(f>2);f&&(C[s++]=C[m++],f>1&&(C[s++]=C[m++]))}break}if(64&R){e.msg="invalid distance code",y.mode=gh;break e}T=g[(65535&T)+(u&(1<<R)-1)]}}break}}while(r<i&&s<o);f=h>>3,r-=f,h-=f<<3,u&=(1<<h)-1,e.next_in=r,e.next_out=s,e.avail_in=r<i?i-r+5:5-(r-i),e.avail_out=s<o?o-s+257:257-(s-o),y.hold=u,y.bits=h};const ph=15,Th=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]),Rh=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]),fh=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]),Ah=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 mh=(e,t,r,i,s,n,o,a)=>{const l=a.bits;let c,d,_,u,h,E,g=0,I=0,p=0,T=0,R=0,f=0,A=0,m=0,S=0,v=0,C=null;const y=new Uint16Array(16),O=new Uint16Array(16);let N,M,b,L=null;for(g=0;g<=ph;g++)y[g]=0;for(I=0;I<i;I++)y[t[r+I]]++;for(R=l,T=ph;T>=1&&0===y[T];T--);if(R>T&&(R=T),0===T)return s[n++]=20971520,s[n++]=20971520,a.bits=1,0;for(p=1;p<T&&0===y[p];p++);for(R<p&&(R=p),m=1,g=1;g<=ph;g++)if(m<<=1,m-=y[g],m<0)return-1;if(m>0&&(0===e||1!==T))return-1;for(O[1]=0,g=1;g<ph;g++)O[g+1]=O[g]+y[g];for(I=0;I<i;I++)0!==t[r+I]&&(o[O[t[r+I]]++]=I);if(0===e?(C=L=o,E=20):1===e?(C=Th,L=Rh,E=257):(C=fh,L=Ah,E=0),v=0,I=0,g=p,h=n,f=R,A=0,_=-1,S=1<<R,u=S-1,1===e&&S>852||2===e&&S>592)return 1;for(;;){N=g-A,o[I]+1<E?(M=0,b=o[I]):o[I]>=E?(M=L[o[I]-E],b=C[o[I]-E]):(M=96,b=0),c=1<<g-A,d=1<<f,p=d;do{d-=c,s[h+(v>>A)+d]=N<<24|M<<16|b}while(0!==d);for(c=1<<g-1;v&c;)c>>=1;if(0!==c?(v&=c-1,v+=c):v=0,I++,0==--y[g]){if(g===T)break;g=t[r+o[I]]}if(g>R&&(v&u)!==_){for(0===A&&(A=R),h+=p,f=g-A,m=1<<f;f+A<T&&(m-=y[f+A],!(m<=0));)f++,m<<=1;if(S+=1<<f,1===e&&S>852||2===e&&S>592)return 1;_=v&u,s[_]=R<<24|f<<16|h-n}}return 0!==v&&(s[h+v]=g-A<<24|64<<16),a.bits=R,0};const{Z_FINISH:Sh,Z_BLOCK:vh,Z_TREES:Ch,Z_OK:yh,Z_STREAM_END:Oh,Z_NEED_DICT:Nh,Z_STREAM_ERROR:Mh,Z_DATA_ERROR:bh,Z_MEM_ERROR:Lh,Z_BUF_ERROR:Uh,Z_DEFLATED:Ph}=eu,Dh=16180,xh=16190,wh=16191,Gh=16192,Vh=16194,kh=16199,Fh=16200,Bh=16206,Hh=16209,jh=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function Yh(){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 Wh=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<Dh||t.mode>16211?1:0},Jh=e=>{if(Wh(e))return Mh;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=Dh,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,yh},qh=e=>{if(Wh(e))return Mh;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Jh(e)},Kh=(e,t)=>{let r;if(Wh(e))return Mh;const i=e.state;return t<0?(r=0,t=-t):(r=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Mh:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=r,i.wbits=t,qh(e))},Qh=(e,t)=>{if(!e)return Mh;const r=new Yh;e.state=r,r.strm=e,r.window=null,r.mode=Dh;const i=Kh(e,t);return i!==yh&&(e.state=null),i};let Xh,zh,Zh=!0;const $h=e=>{if(Zh){Xh=new Int32Array(512),zh=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(mh(1,e.lens,0,288,Xh,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;mh(2,e.lens,0,32,zh,0,e.work,{bits:5}),Zh=!1}e.lencode=Xh,e.lenbits=9,e.distcode=zh,e.distbits=5},eE=(e,t,r,i)=>{let s;const n=e.state;return null===n.window&&(n.wsize=1<<n.wbits,n.wnext=0,n.whave=0,n.window=new Uint8Array(n.wsize)),i>=n.wsize?(n.window.set(t.subarray(r-n.wsize,r),0),n.wnext=0,n.whave=n.wsize):(s=n.wsize-n.wnext,s>i&&(s=i),n.window.set(t.subarray(r-i,r-i+s),n.wnext),(i-=s)?(n.window.set(t.subarray(r-i,r),0),n.wnext=i,n.whave=n.wsize):(n.wnext+=s,n.wnext===n.wsize&&(n.wnext=0),n.whave<n.wsize&&(n.whave+=s))),0};var tE={inflateReset:qh,inflateReset2:Kh,inflateResetKeep:Jh,inflateInit:e=>Qh(e,15),inflateInit2:Qh,inflate:(e,t)=>{let r,i,s,n,o,a,l,c,d,_,u,h,E,g,I,p,T,R,f,A,m,S,v=0;const C=new Uint8Array(4);let y,O;const N=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Wh(e)||!e.output||!e.input&&0!==e.avail_in)return Mh;r=e.state,r.mode===wh&&(r.mode=Gh),o=e.next_out,s=e.output,l=e.avail_out,n=e.next_in,i=e.input,a=e.avail_in,c=r.hold,d=r.bits,_=a,u=l,S=yh;e:for(;;)switch(r.mode){case Dh:if(0===r.wrap){r.mode=Gh;break}for(;d<16;){if(0===a)break e;a--,c+=i[n++]<<d,d+=8}if(2&r.wrap&&35615===c){0===r.wbits&&(r.wbits=15),r.check=0,C[0]=255&c,C[1]=c>>>8&255,r.check=Z_(r.check,C,2,0),c=0,d=0,r.mode=16181;break}if(r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&c)<<8)+(c>>8))%31){e.msg="incorrect header check",r.mode=Hh;break}if((15&c)!==Ph){e.msg="unknown compression method",r.mode=Hh;break}if(c>>>=4,d-=4,m=8+(15&c),0===r.wbits&&(r.wbits=m),m>15||m>r.wbits){e.msg="invalid window size",r.mode=Hh;break}r.dmax=1<<r.wbits,r.flags=0,e.adler=r.check=1,r.mode=512&c?16189:wh,c=0,d=0;break;case 16181:for(;d<16;){if(0===a)break e;a--,c+=i[n++]<<d,d+=8}if(r.flags=c,(255&r.flags)!==Ph){e.msg="unknown compression method",r.mode=Hh;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=Hh;break}r.head&&(r.head.text=c>>8&1),512&r.flags&&4&r.wrap&&(C[0]=255&c,C[1]=c>>>8&255,r.check=Z_(r.check,C,2,0)),c=0,d=0,r.mode=16182;case 16182:for(;d<32;){if(0===a)break e;a--,c+=i[n++]<<d,d+=8}r.head&&(r.head.time=c),512&r.flags&&4&r.wrap&&(C[0]=255&c,C[1]=c>>>8&255,C[2]=c>>>16&255,C[3]=c>>>24&255,r.check=Z_(r.check,C,4,0)),c=0,d=0,r.mode=16183;case 16183:for(;d<16;){if(0===a)break e;a--,c+=i[n++]<<d,d+=8}r.head&&(r.head.xflags=255&c,r.head.os=c>>8),512&r.flags&&4&r.wrap&&(C[0]=255&c,C[1]=c>>>8&255,r.check=Z_(r.check,C,2,0)),c=0,d=0,r.mode=16184;case 16184:if(1024&r.flags){for(;d<16;){if(0===a)break e;a--,c+=i[n++]<<d,d+=8}r.length=c,r.head&&(r.head.extra_len=c),512&r.flags&&4&r.wrap&&(C[0]=255&c,C[1]=c>>>8&255,r.check=Z_(r.check,C,2,0)),c=0,d=0}else r.head&&(r.head.extra=null);r.mode=16185;case 16185:if(1024&r.flags&&(h=r.length,h>a&&(h=a),h&&(r.head&&(m=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(i.subarray(n,n+h),m)),512&r.flags&&4&r.wrap&&(r.check=Z_(r.check,i,h,n)),a-=h,n+=h,r.length-=h),r.length))break e;r.length=0,r.mode=16186;case 16186:if(2048&r.flags){if(0===a)break e;h=0;do{m=i[n+h++],r.head&&m&&r.length<65536&&(r.head.name+=String.fromCharCode(m))}while(m&&h<a);if(512&r.flags&&4&r.wrap&&(r.check=Z_(r.check,i,h,n)),a-=h,n+=h,m)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=16187;case 16187:if(4096&r.flags){if(0===a)break e;h=0;do{m=i[n+h++],r.head&&m&&r.length<65536&&(r.head.comment+=String.fromCharCode(m))}while(m&&h<a);if(512&r.flags&&4&r.wrap&&(r.check=Z_(r.check,i,h,n)),a-=h,n+=h,m)break e}else r.head&&(r.head.comment=null);r.mode=16188;case 16188:if(512&r.flags){for(;d<16;){if(0===a)break e;a--,c+=i[n++]<<d,d+=8}if(4&r.wrap&&c!==(65535&r.check)){e.msg="header crc mismatch",r.mode=Hh;break}c=0,d=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=wh;break;case 16189:for(;d<32;){if(0===a)break e;a--,c+=i[n++]<<d,d+=8}e.adler=r.check=jh(c),c=0,d=0,r.mode=xh;case xh:if(0===r.havedict)return e.next_out=o,e.avail_out=l,e.next_in=n,e.avail_in=a,r.hold=c,r.bits=d,Nh;e.adler=r.check=1,r.mode=wh;case wh:if(t===vh||t===Ch)break e;case Gh:if(r.last){c>>>=7&d,d-=7&d,r.mode=Bh;break}for(;d<3;){if(0===a)break e;a--,c+=i[n++]<<d,d+=8}switch(r.last=1&c,c>>>=1,d-=1,3&c){case 0:r.mode=16193;break;case 1:if($h(r),r.mode=kh,t===Ch){c>>>=2,d-=2;break e}break;case 2:r.mode=16196;break;case 3:e.msg="invalid block type",r.mode=Hh}c>>>=2,d-=2;break;case 16193:for(c>>>=7&d,d-=7&d;d<32;){if(0===a)break e;a--,c+=i[n++]<<d,d+=8}if((65535&c)!=(c>>>16^65535)){e.msg="invalid stored block lengths",r.mode=Hh;break}if(r.length=65535&c,c=0,d=0,r.mode=Vh,t===Ch)break e;case Vh:r.mode=16195;case 16195:if(h=r.length,h){if(h>a&&(h=a),h>l&&(h=l),0===h)break e;s.set(i.subarray(n,n+h),o),a-=h,n+=h,l-=h,o+=h,r.length-=h;break}r.mode=wh;break;case 16196:for(;d<14;){if(0===a)break e;a--,c+=i[n++]<<d,d+=8}if(r.nlen=257+(31&c),c>>>=5,d-=5,r.ndist=1+(31&c),c>>>=5,d-=5,r.ncode=4+(15&c),c>>>=4,d-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=Hh;break}r.have=0,r.mode=16197;case 16197:for(;r.have<r.ncode;){for(;d<3;){if(0===a)break e;a--,c+=i[n++]<<d,d+=8}r.lens[N[r.have++]]=7&c,c>>>=3,d-=3}for(;r.have<19;)r.lens[N[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,y={bits:r.lenbits},S=mh(0,r.lens,0,19,r.lencode,0,r.work,y),r.lenbits=y.bits,S){e.msg="invalid code lengths set",r.mode=Hh;break}r.have=0,r.mode=16198;case 16198:for(;r.have<r.nlen+r.ndist;){for(;v=r.lencode[c&(1<<r.lenbits)-1],I=v>>>24,p=v>>>16&255,T=65535&v,!(I<=d);){if(0===a)break e;a--,c+=i[n++]<<d,d+=8}if(T<16)c>>>=I,d-=I,r.lens[r.have++]=T;else{if(16===T){for(O=I+2;d<O;){if(0===a)break e;a--,c+=i[n++]<<d,d+=8}if(c>>>=I,d-=I,0===r.have){e.msg="invalid bit length repeat",r.mode=Hh;break}m=r.lens[r.have-1],h=3+(3&c),c>>>=2,d-=2}else if(17===T){for(O=I+3;d<O;){if(0===a)break e;a--,c+=i[n++]<<d,d+=8}c>>>=I,d-=I,m=0,h=3+(7&c),c>>>=3,d-=3}else{for(O=I+7;d<O;){if(0===a)break e;a--,c+=i[n++]<<d,d+=8}c>>>=I,d-=I,m=0,h=11+(127&c),c>>>=7,d-=7}if(r.have+h>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=Hh;break}for(;h--;)r.lens[r.have++]=m}}if(r.mode===Hh)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=Hh;break}if(r.lenbits=9,y={bits:r.lenbits},S=mh(1,r.lens,0,r.nlen,r.lencode,0,r.work,y),r.lenbits=y.bits,S){e.msg="invalid literal/lengths set",r.mode=Hh;break}if(r.distbits=6,r.distcode=r.distdyn,y={bits:r.distbits},S=mh(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,y),r.distbits=y.bits,S){e.msg="invalid distances set",r.mode=Hh;break}if(r.mode=kh,t===Ch)break e;case kh:r.mode=Fh;case Fh:if(a>=6&&l>=258){e.next_out=o,e.avail_out=l,e.next_in=n,e.avail_in=a,r.hold=c,r.bits=d,Ih(e,u),o=e.next_out,s=e.output,l=e.avail_out,n=e.next_in,i=e.input,a=e.avail_in,c=r.hold,d=r.bits,r.mode===wh&&(r.back=-1);break}for(r.back=0;v=r.lencode[c&(1<<r.lenbits)-1],I=v>>>24,p=v>>>16&255,T=65535&v,!(I<=d);){if(0===a)break e;a--,c+=i[n++]<<d,d+=8}if(p&&!(240&p)){for(R=I,f=p,A=T;v=r.lencode[A+((c&(1<<R+f)-1)>>R)],I=v>>>24,p=v>>>16&255,T=65535&v,!(R+I<=d);){if(0===a)break e;a--,c+=i[n++]<<d,d+=8}c>>>=R,d-=R,r.back+=R}if(c>>>=I,d-=I,r.back+=I,r.length=T,0===p){r.mode=16205;break}if(32&p){r.back=-1,r.mode=wh;break}if(64&p){e.msg="invalid literal/length code",r.mode=Hh;break}r.extra=15&p,r.mode=16201;case 16201:if(r.extra){for(O=r.extra;d<O;){if(0===a)break e;a--,c+=i[n++]<<d,d+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,d-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=16202;case 16202:for(;v=r.distcode[c&(1<<r.distbits)-1],I=v>>>24,p=v>>>16&255,T=65535&v,!(I<=d);){if(0===a)break e;a--,c+=i[n++]<<d,d+=8}if(!(240&p)){for(R=I,f=p,A=T;v=r.distcode[A+((c&(1<<R+f)-1)>>R)],I=v>>>24,p=v>>>16&255,T=65535&v,!(R+I<=d);){if(0===a)break e;a--,c+=i[n++]<<d,d+=8}c>>>=R,d-=R,r.back+=R}if(c>>>=I,d-=I,r.back+=I,64&p){e.msg="invalid distance code",r.mode=Hh;break}r.offset=T,r.extra=15&p,r.mode=16203;case 16203:if(r.extra){for(O=r.extra;d<O;){if(0===a)break e;a--,c+=i[n++]<<d,d+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,d-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=Hh;break}r.mode=16204;case 16204:if(0===l)break e;if(h=u-l,r.offset>h){if(h=r.offset-h,h>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=Hh;break}h>r.wnext?(h-=r.wnext,E=r.wsize-h):E=r.wnext-h,h>r.length&&(h=r.length),g=r.window}else g=s,E=o-r.offset,h=r.length;h>l&&(h=l),l-=h,r.length-=h;do{s[o++]=g[E++]}while(--h);0===r.length&&(r.mode=Fh);break;case 16205:if(0===l)break e;s[o++]=r.length,l--,r.mode=Fh;break;case Bh:if(r.wrap){for(;d<32;){if(0===a)break e;a--,c|=i[n++]<<d,d+=8}if(u-=l,e.total_out+=u,r.total+=u,4&r.wrap&&u&&(e.adler=r.check=r.flags?Z_(r.check,s,u,o-u):X_(r.check,s,u,o-u)),u=l,4&r.wrap&&(r.flags?c:jh(c))!==r.check){e.msg="incorrect data check",r.mode=Hh;break}c=0,d=0}r.mode=16207;case 16207:if(r.wrap&&r.flags){for(;d<32;){if(0===a)break e;a--,c+=i[n++]<<d,d+=8}if(4&r.wrap&&c!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=Hh;break}c=0,d=0}r.mode=16208;case 16208:S=Oh;break e;case Hh:S=bh;break e;case 16210:return Lh;default:return Mh}return e.next_out=o,e.avail_out=l,e.next_in=n,e.avail_in=a,r.hold=c,r.bits=d,(r.wsize||u!==e.avail_out&&r.mode<Hh&&(r.mode<Bh||t!==Sh))&&eE(e,e.output,e.next_out,u-e.avail_out),_-=e.avail_in,u-=e.avail_out,e.total_in+=_,e.total_out+=u,r.total+=u,4&r.wrap&&u&&(e.adler=r.check=r.flags?Z_(r.check,s,u,e.next_out-u):X_(r.check,s,u,e.next_out-u)),e.data_type=r.bits+(r.last?64:0)+(r.mode===wh?128:0)+(r.mode===kh||r.mode===Vh?256:0),(0===_&&0===u||t===Sh)&&S===yh&&(S=Uh),S},inflateEnd:e=>{if(Wh(e))return Mh;let t=e.state;return t.window&&(t.window=null),e.state=null,yh},inflateGetHeader:(e,t)=>{if(Wh(e))return Mh;const r=e.state;return 2&r.wrap?(r.head=t,t.done=!1,yh):Mh},inflateSetDictionary:(e,t)=>{const r=t.length;let i,s,n;return Wh(e)?Mh:(i=e.state,0!==i.wrap&&i.mode!==xh?Mh:i.mode===xh&&(s=1,s=X_(s,t,r,0),s!==i.check)?bh:(n=eE(e,t,r,r),n?(i.mode=16210,Lh):(i.havedict=1,yh)))},inflateInfo:"pako inflate (from Nodeca project)"};var rE=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 iE=Object.prototype.toString,{Z_NO_FLUSH:sE,Z_FINISH:nE,Z_OK:oE,Z_STREAM_END:aE,Z_NEED_DICT:lE,Z_STREAM_ERROR:cE,Z_DATA_ERROR:dE,Z_MEM_ERROR:_E}=eu;function uE(e){this.options=$u.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 ih,this.strm.avail_out=0;let r=tE.inflateInit2(this.strm,t.windowBits);if(r!==oE)throw new Error($_[r]);if(this.header=new rE,tE.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=rh.string2buf(t.dictionary):"[object ArrayBuffer]"===iE.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=tE.inflateSetDictionary(this.strm,t.dictionary),r!==oE)))throw new Error($_[r])}function hE(e,t){const r=new uE(t);if(r.push(e),r.err)throw r.msg||$_[r.err];return r.result}uE.prototype.push=function(e,t){const r=this.strm,i=this.options.chunkSize,s=this.options.dictionary;let n,o,a;if(this.ended)return!1;for(o=t===~~t?t:!0===t?nE:sE,"[object ArrayBuffer]"===iE.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),n=tE.inflate(r,o),n===lE&&s&&(n=tE.inflateSetDictionary(r,s),n===oE?n=tE.inflate(r,o):n===dE&&(n=lE));r.avail_in>0&&n===aE&&r.state.wrap>0&&0!==e[r.next_in];)tE.inflateReset(r),n=tE.inflate(r,o);switch(n){case cE:case dE:case lE:case _E:return this.onEnd(n),this.ended=!0,!1}if(a=r.avail_out,r.next_out&&(0===r.avail_out||n===aE))if("string"===this.options.to){let e=rh.utf8border(r.output,r.next_out),t=r.next_out-e,s=rh.buf2string(r.output,e);r.next_out=t,r.avail_out=i-t,t&&r.output.set(r.output.subarray(e,e+t),0),this.onData(s)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(n!==oE||0!==a){if(n===aE)return n=tE.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},uE.prototype.onData=function(e){this.chunks.push(e)},uE.prototype.onEnd=function(e){e===oE&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=$u.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var EE={Inflate:uE,inflate:hE,inflateRaw:function(e,t){return(t=t||{}).raw=!0,hE(e,t)},ungzip:hE,constants:eu};const{Inflate:gE,inflate:IE,inflateRaw:pE,ungzip:TE}=EE;var RE=TE;function fE(e){return Object.keys(e).map((t=>{let r=e[t];return"string"!=typeof r&&(r=`${r}`),{key:t,value:r}}))}function AE(e,t,r,i){return Ac.encode(Xa,{targetId:e,type:exports.ConversationType.GROUP,users:i,extProfile:r?fE(r):void 0,settingProfile:fE(t)})}const mE=(e,t)=>Ac.encode(Po,{type:e.conversationType,msgTime:t,channelId:e.targetId,busChannel:e.channelId||""}),SE=e=>{const{compressioEnabled:t,compressedData:r,info:i,pullTime:s,isFinished:n,pageToken:o}=Ac.decode(mo,e);if(t){const e=RE(r);return SE(e)}return{info:i,pullTime:s,isFinished:n,pageToken:o}},vE=e=>{const t=Ac.decode(lo,e);if(t.compressioEnabled){const e=RE(t.compressedData);return vE(e)}return t},CE=e=>{const t=Ac.decode(co,e);if(t.compressioEnabled){const e=RE(t.compressedData);return CE(e)}const{syncTime:r,list:i}=t;return{syncTime:r,list:i.map((e=>Ac.decode(_o,new Uint8Array(e))))}},yE=e=>Ac.encode(na,Object.assign(Object.assign({},e),{compress:Ri.enable()})),OE=e=>{const t=Ac.decode(aa,e);if(t.compress){const e=RE(t.compressData);return OE(e)}return t},NE=e=>{const t=Ac.decode(la,e);if(t.compress){const e=RE(t.compressData);return NE(e)}return t},ME=e=>{const{listType:t,result:r,page:i}=e,s=new Uint8Array(r);let n=[];switch(t){case 1:n=Ac.decode(il,s).list;break;case 2:n=Ac.decode(rl,s).list;break;case 3:n=Ac.decode(sl,s).list;break;case 11:n=Ac.decode(Il,s).list;break;case 12:n=Ac.decode(pl,s).list}return Object.assign(Object.assign({},i),{list:n})},bE=e=>Ac.encode(Mo,Object.assign(Object.assign({},e),{compressioEnabled:Ri.enable(),ignoreCmd:!0})),LE=e=>{const t=Ac.decode(bo,e);if(t.compressioEnabled){const e=RE(t.compressedData);return LE(e)}return t},UE=(e,t)=>Ac.encode(Xo,{ignoreVersion:!0,version:e,state:t}),PE=e=>{const t=Ac.decode(Ll,e);if(t.compress){const e=RE(t.compressedData);return PE(e)}return t},DE=e=>Ac.encode(jo,{timestamp:e,compressioEnabled:Ri.enable()}),xE=e=>{const t=Ac.decode(Bo,e);if(t.compressioEnabled){const e=RE(t.compressedData);return xE(e)}return t},wE=e=>{if(!e)return;const{pushTitle:t,iOSConfig:r,androidConfig:i,templateId:s,harmonyOSConfig:n}=e;return{title:t,pushConfigs:Ft(r,i,n),pushId:null==i?void 0:i.notificationId,templateId:s}},GE=(e,t)=>{const{targetId:r,conversationType:i,channelId:s}=e,{messageType:n,isMentioned:o,disableNotification:a,canIncludeExpansion:l,pushConfig:c,directionalUserIdList:d,isVoipPush:_,isFilerWhiteBlacklist:u,content:h,pushContent:E,pushData:g,expansion:I,messageId:p,needReceipt:T,disableUpdateLastMessage:R,isStatusMessage:f,quoteInfo:A}=t,m=ud(n,o,a,l,f),S=((e,t,r,i)=>{let s=0;return e&&(s|=1),t&&(s|=2),r&&(s|=4),i&&(s|=8),s})(!!_,!u,!!(null==c?void 0:c.disablePushTitle),!!(null==c?void 0:c.forceShowDetailContent));let v;if(h.user&&h.user.portraitUri&&(h.user.portrait=h.user.portraitUri),l&&I){v={};for(const[e,t]of Object.entries(I))v[e]={v:t}}const C=wE(c),y=i===exports.ConversationType.SYSTEM?r:void 0,{isPersited:O}=_i(n);let N=0;O&&R&&(N|=1),T&&(N|=2);const M=A?{msgId:A.messageUId,fromUserId:A.senderId,classname:A.objectName}:void 0;return Ac.encode(ao,{sessionId:m,pushText:(null==c?void 0:c.pushContent)||E,appData:(null==c?void 0:c.pushData)||g,toUserIds:d,configFlag:S,classname:n,content:JSON.stringify(h),extraContent:v?JSON.stringify(v):void 0,pushExt:C,clientUniqueId:p,busChannel:s,systemId:y,optionBits:N,refData:M})},VE=e=>Ac.encode(el,Object.assign(Object.assign({},e),{type:exports.ConversationType.GROUP})),kE=e=>Ac.encode(nl,Object.assign(Object.assign({},e),{type:exports.ConversationType.GROUP})),FE=e=>Ac.encode($a,Object.assign(Object.assign({},e),{type:exports.ConversationType.GROUP})),BE=e=>{const t=Ac.decode(Pl,e);if(t.compress){const e=RE(t.compressedData);return BE(e)}return t},HE=e=>{const t=Ac.decode(nc,e);if(t.compress){const e=RE(t.compressedData);return HE(e)}return t},jE=e=>{const t=Ac.decode(ac,e);if(t.compress){const e=RE(t.compressedData);return jE(e)}return t},YE=e=>{const t=Ac.decode(lc,e);if(t.compress){const e=RE(t.compressedData);return YE(e)}return t},WE=(e,t)=>{const r=[];return e.forEach((e=>{const{reactionId:i,reactionTime:s,userReact:n,user:o,userCnt:a}=e,l={messageUId:t,reactionId:i,reactionTime:s,hasCurrentUserReacted:n,totalCount:a,users:o.map((e=>({userId:e.userId,reactionTime:e.reactionTime})))};r.push(l)})),r},JE=e=>{const{targetId:t,type:r,busChannel:i,opType:s,msgId:n,reactionId:o,userCnt:a,users:l}=e;return{conversationIdentifier:{targetId:t,conversationType:r,channelId:i||""},messageUId:n,reactionId:o,operationType:s,totalCount:a,users:l.map((({userId:e,reactionTime:t})=>({reactionTime:t,userId:e})))}},qE={[Ys]:exports.ErrorCode.RC_DISCONN_KICK,[Ws]:exports.ErrorCode.RC_DISCONN_EXCEPTION,[qs]:exports.ErrorCode.RC_DISCONN_EXCEPTION,[Ks]:exports.ErrorCode.RC_CONN_REDIRECTED,[Qs]:exports.ErrorCode.RC_CONN_TOKEN_EXPIRED,[Xs]:exports.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,[zs]:exports.ErrorCode.RC_ACCOUNT_CANCELLATION},KE={[ms]:exports.ErrorCode.SUCCESS,[Ss]:exports.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,[vs]:exports.ErrorCode.RC_CONN_IDENTIFIER_REJECTED,[Cs]:exports.ErrorCode.RC_CONN_SERVER_UNAVAILABLE,[ys]:exports.ErrorCode.RC_CONN_TOKEN_INCORRECT,[Os]:exports.ErrorCode.RC_CONN_NOT_AUTHRORIZED,[Ns]:exports.ErrorCode.RC_CONN_REDIRECTED,[Ms]:exports.ErrorCode.RC_CONN_PACKAGE_NAME_INVALID,[bs]:exports.ErrorCode.RC_CONN_APP_BLOCKED_OR_DELETED,[Ls]:exports.ErrorCode.RC_CONN_USER_BLOCKED,[Us]:exports.ErrorCode.RC_CONN_TOKEN_EXPIRED,[Ps]:exports.ErrorCode.RC_CONN_DEVICE_ERROR,[Ds]:exports.ErrorCode.RC_CONN_HOSTNAME_ERROR,[xs]:exports.ErrorCode.RC_DISCONN_SAME_CLIENT_ON_LINE,[ws]:exports.ErrorCode.RC_LISCENSE_COUNT_OUT_OF_LIMIT,[Gs]:exports.ErrorCode.RC_CONN_WRONG_CLUSTER,[Vs]:exports.ErrorCode.RC_APP_AUTH_NOT_PASS,[Fs]:exports.ErrorCode.RC_OTP_USED,[Bs]:exports.ErrorCode.RC_PLATFORM_ERROR,[Hs]:exports.ErrorCode.RC_ACCOUNT_CANCELLATION,[js]:exports.ErrorCode.RC_LICENSE_EXPIRED},QE=e=>[Bi.ppMsgS,Bi.pgMsgS,Bi.chatMsgS,Bi.prMsgS].includes(e);var XE,zE,ZE,$E,eg,tg,rg,ig,sg,ng,og,ag,lg,cg,dg,_g;class ug extends er{constructor(e,t,i){super("WebSGMsgReceiver"),XE.add(this),Object.defineProperty(this,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_recvRecord",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),this._ctx.on("sMsg",r(this,XE,"m",$E),this),this._ctx.on("syncMsg",r(this,XE,"m",ZE),this)}_handleSyncData(e){var i;return t(this,void 0,void 0,(function*(){const{logger:t,currentUserId:s,connectedTime:o}=this._ctx,a=this._ctx.getNaviInfoFromCache(),l=this._storage.get("inboxTime"),c=this._storage.get("outboxTime"),d=this._storage.get("broadcastTime"),_=t.createTraceId();t.info(n.L_PULL_MSG_T,JSON.stringify({inboxTime:l,outboxTime:c,broadcastTime:d}),_);const u=Ac.encode(oo,{ispolling:!1,isPullSend:!0,syncTime:l,sendBoxSyncTime:c,broadcastSyncTime:d,compressioEnabled:Ri.enable()}),h=yield this._ctx.query(Bi.pullMsg,s,u);if(!h.isOk)return t.warn(n.L_PULL_MSG_R,JSON.stringify({code:h.code}),_),h.wipe();const E=vE(h.data.pbData),{list:g,finished:I,syncTime:p,broadcastSyncTime:T}=E;let R=c;const f=g.map((e=>{const t=_d(a,e,s,e.dataTime<o);return t.messageDirection===exports.MessageDirection.SEND&&(R=Math.max(R,t.sentTime)),t}));this._storage.removeSentRecordByTimestamp(R-ug.MESSAGE_RECORD_TTL);const A=r(this,XE,"a",zE);let m=f.filter((e=>{if(e.senderUserId===s){const t=r(this,XE,"m",rg).call(this,e);if(!t){const t=r(this,XE,"m",tg).call(this,e);this._storage.addSentRecord(t,e.sentTime)}return!t}if(A)return!0;const t=!this._recvRecord.has(e.messageUId);return t&&this._recvRecord.set(e.messageUId,e.sentTime),t}));this._storage.set("inboxTime",p),this._storage.set("broadcastTime",T||1),this._storage.set("outboxTime",R),t.info(n.L_PULL_MSG_R,JSON.stringify({code:0,inboxTime:p,broadcastTime:T,outboxTime:R,msgCount:f.length,afterFilteredCount:m.length,hasNext:!I}),_);const S=Math.max(p,T||1,R);return 0===e&&this._emitter.emit("__firstOfflineMessageTime__",(null===(i=f[0])||void 0===i?void 0:i.sentTime)||0),r(this,XE,"m",eg).call(this,"pullMsg",m,!!I),r(this,XE,"m",sg).call(this,p),ir({version:S,hasNext:!I})}))}}XE=new WeakSet,zE=function(){var e;return 0!==(null===(e=this._ctx.getNaviInfoFromCache())||void 0===e?void 0:e.openHistoryMsg)},ZE=function(e,t,i){const{conversationType:s}=t;s!==exports.ConversationType.ULTRA_GROUP&&s!==exports.ConversationType.CHATROOM&&(e.stopPropagation(),s===exports.ConversationType.RTC_ROOM||QE(i)?r(this,XE,"m",eg).call(this,"syncMsg",[t],!0):r(this,XE,"m",ig).call(this,"syncMsg",t))},$E=function(e,t){const{conversationType:i,sentTime:s,isStatusMessage:n,messageUId:o}=t;if(i===exports.ConversationType.CHATROOM||i===exports.ConversationType.ULTRA_GROUP)return;if(e.stopPropagation(),n||i===exports.ConversationType.RTC_ROOM)return void r(this,XE,"m",eg).call(this,"smsg",[t],!0);if(t.senderUserId===this._ctx.currentUserId)return void r(this,XE,"m",ig).call(this,"smsg",t);if(r(this,XE,"a",zE))return void this.push(s);this._recvRecord.has(o)||(this._recvRecord.set(o,s),r(this,XE,"m",eg).call(this,"smsg",[t],!0)),r(this,XE,"m",sg).call(this,s)},eg=function(e,t,r){this._emitter.emit("messages",e,t,r)},tg=function(e){return e.messageType===Q.RECALL?`Cmd:${e.content.messageUId}`:e.messageUId},rg=function(e){const t=r(this,XE,"m",tg).call(this,e);return this._storage.hasSentRecord(t)},ig=function(e,t){if(r(this,XE,"m",rg).call(this,t))return;const i=r(this,XE,"m",tg).call(this,t);this._storage.addSentRecord(i,t.sentTime),r(this,XE,"m",eg).call(this,e,[t],!0)},sg=function(e){if(r(this,XE,"a",zE))return;const t=e-ug.MESSAGE_RECORD_TTL;Array.from(this._recvRecord.entries()).forEach((([e,r])=>{r<=t&&this._recvRecord.delete(e)}))},Object.defineProperty(ug,"MESSAGE_RECORD_TTL",{enumerable:!0,configurable:!0,writable:!0,value:18e4});class hg extends er{constructor(e,t){super("WebUGMsgReceiver"),ng.add(this),Object.defineProperty(this,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:t}),this._ctx.on("syncMsg",r(this,ng,"m",ag),this),this._ctx.on("sCmd",r(this,ng,"m",og),this)}markOnline(){return t(this,void 0,void 0,(function*(){const e=yield r(this,ng,"m",cg).call(this,0);if(!e.isOk)return this._ctx.logger.warn(n.L_NOTIFY_ULTRA_ONLINE_S,`fail to pull ug msg, code: ${e.code}`),e.wipe();this._ctx.logger.info(n.L_NOTIFY_ULTRA_ONLINE_S,"success");const{syncTime:t}=e.data,i=yield r(this,ng,"m",lg).call(this,0,[]);if(!i.isOk)return i.wipe();const s=i.data,o=s.length>0?s[s.length-1].versionTime:0,a=Math.max(t,o);return ir({relations:s,msgVersion:a})}))}_handleSyncData(e){return t(this,void 0,void 0,(function*(){const t=yield r(this,ng,"m",cg).call(this,e);if(!t.isOk)return t.wipe();const{syncTime:i,finished:s,list:n}=t.data;if(null==n?void 0:n.length){const{currentUserId:e}=this._ctx,t=n.filter((e=>!this._storage.isLocalSentUGMessage(e.msgId))).map((t=>dd(t,e,!1)));t.length>0&&this._ctx.emit("messagesFromUG",t,i)}return this._storage.removeUGSentRecordByTimestamp(i),ir({version:i,hasNext:!s})}))}}ng=new WeakSet,og=function(e,t){if(6===t.type)this.push(t.time),e.stopPropagation()},ag=function(e,t){t.conversationType===exports.ConversationType.ULTRA_GROUP&&(this.push(t.sentTime),e.stopPropagation())},lg=function e(i,s){return t(this,void 0,void 0,(function*(){const{currentUserId:t,logger:o}=this._ctx,a=o.createTraceId();o.info(n.L_PULL_UG_RELATIONS_T,JSON.stringify({ver:i}),a);const l=Ac.encode(Ea,{syncTime:i,isEraseMsgContent:!1}),c=yield this._ctx.query(Bi.pullUgSes,t,l,void 0);if(o.summary(n.L_PULL_UG_RELATIONS_R,c,a,{ver:i}),!c.isOk)return c.wipe();const{info:d,isFinished:_}=SE(c.data.pbData);if(s.push(...d),!_){const t=d[d.length-1].versionTime;return r(this,ng,"m",e).call(this,t,s)}return ir(s)}))},cg=function(e){return t(this,void 0,void 0,(function*(){const{currentUserId:t,logger:r}=this._ctx,i=r.createTraceId();r.info(n.L_PULL_ULTRA_MSG_T,JSON.stringify({version:e}),i);const s=(o=e,Ac.encode(ga,{syncTime:o,compressioEnabled:Ri.enable()}));var o;const a=yield this._ctx.query(Bi.pullUgMsg,t,s);if(r.summary(n.L_PULL_ULTRA_MSG_R,a,i,{version:e}),!a.isOk)return a.wipe();const l=a.data;return ir(vE(l.pbData))}))};const Eg=13,gg=36,Ig=41;class pg extends er{constructor(e,t){super("WebServerEventHandler"),dg.add(this),Object.defineProperty(this,"_con",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:t})}_handleSyncData(e){return t(this,void 0,void 0,(function*(){const t=this._logger.createTraceId();this._logger.info(n.L_PULL_EVENT_CHANGE_T,JSON.stringify({version:e}),t);const i=yield r(this,dg,"m",_g).call(this,e);if(this._logger.summary(n.L_PULL_EVENT_CHANGE_R,i,t,{version:e}),!i.isOk)return i.wipe();const{list:s,syncTime:o,hasNext:a}=i.data;if(s.length){const e=new Map;s.forEach((t=>{const r=t.changeType;e.has(r)?e.get(r).push(t):e.set(r,[t])})),Array.from(e.entries()).forEach((([e,t])=>{this.emit("serverEvent",e,t)}))}return ir({version:o,hasNext:a})}))}noticeOnline(){return t(this,void 0,void 0,(function*(){const e=this._logger.createTraceId();this._logger.info(n.L_SERVER_EVENT_NOTIFY_ONLINE_T,JSON.stringify({version:0}),e);const t=yield r(this,dg,"m",_g).call(this,0);return this._logger.summary(n.L_SERVER_EVENT_NOTIFY_ONLINE_R,t,e,{version:0}),t}))}}var Tg,Rg,fg;dg=new WeakSet,_g=function(e){const t=Ac.encode(Ta,{syncTime:e});return this._con.query(Bi.pullEventChange,this._con.getCurrentUserId(),t,Ra)};class Ag extends er{constructor(e){super("WebUGServerEventHandler"),Tg.add(this),Object.defineProperty(this,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:e})}_handleSyncData(e){return t(this,void 0,void 0,(function*(){const t=Ac.encode(Ta,{syncTime:e}),i=yield this._ctx.query(Bi.qryMsgChange,this._ctx.currentUserId,t,fa);if(!i.isOk)return i.wipe();const{list:s,syncTime:n,hasNext:o}=i.data;return s&&s.length&&r(this,Tg,"m",Rg).call(this,s),ir({version:n,hasNext:o})}))}_handleReactions(e){const t=Object.values(Le),r=e.map((e=>{const t=Ac.decode(cc,new Uint8Array(e));return JE(t)})).filter((({operationType:e})=>t.includes(e)));r.length&&this._ctx.emit("messageReaction",{reactions:r})}}Tg=new WeakSet,Rg=function(e){const t=[],i=[],s=[],n=[],o=[],a=[];e.forEach((e=>{const{changeType:r}=e;switch(r){case 1:i.push(e);break;case 2:t.push(e);break;case 3:s.push(e);break;case 4:n.push(e);break;case 5:o.push(e);break;case 6:break;case 7:a.push(e.eventData)}})),i.length&&r(this,Tg,"m",fg).call(this,i,1),t.length&&r(this,Tg,"m",fg).call(this,t,2),s.length&&this.emit("ugMsgRecalled",s),n.length&&this._ctx.emit("ugChannelChanged",n),o.length&&this._ctx.emit("ugUserGroupChanged",o),this._handleReactions(a)},fg=function(e,t){const r=new Map;e.forEach((e=>{const{targetId:t,busChannel:i,msgUID:s}=e,n=`${t}-${i}`,o=r.get(n);o?o.messageUIds.push(s):r.set(n,{conversationIdentifier:{conversationType:exports.ConversationType.ULTRA_GROUP,targetId:t,channelId:i},messageUIds:[s]})})),Array.from(r.entries()).forEach((([e,r])=>{1===t?this.emit("ugMsgExpansion",r.conversationIdentifier,r.messageUIds):this.emit("ugMsgModify",r.conversationIdentifier,r.messageUIds)}))};const mg=()=>t(void 0,void 0,void 0,(function*(){return sr(exports.ErrorCode.NOT_SUPPORT,"Not support")}));var Sg,vg,Cg,yg,Og,Ng,Mg,bg,Lg,Ug,Pg,Dg,xg,wg,Gg,Vg,kg,Fg,Bg,Hg,jg,Yg,Wg,Jg,qg,Kg,Qg,Xg,zg,Zg,$g,eI,tI,rI,iI,sI,nI,oI,aI,lI,cI,dI,_I,uI,hI,EI,gI;class II extends er{constructor(e,t){super("WebSGMsgModifyReceiver"),Sg.add(this),Object.defineProperty(this,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storage",{enumerable:!0,configurable:!0,writable:!0,value:t}),vg.set(this,!0),this._ctx.on("onConnected",r(this,Sg,"m",Cg),this)}_handleModifyNotifies(e){if(0===e.length)return;const{currentUserId:t}=this._ctx,r=[];e.forEach((({modifyType:e,msg:i})=>{const s=dd(i,t,!1);r.push(s);const{conversationType:n,targetId:o,channelId:a}=s,l=this.storage.getModel({conversationType:n,targetId:o,channelId:a});if(!l||!l.latestMessage)return;const{messageUId:c,messageType:d,content:_}=l.latestMessage;if(c!==s.messageUId){if(d===Q.REFERENCE){const{referMsgUid:e}=_;if(e!==s.messageUId)return;_.referMsg=s.content}}else l.updateAttrs({latestMessage:s})})),this._ctx.emit("messageModified",r)}_handleReactionNotifies(e){if(0===e.length)return;const t=Object.values(Le),r=e.filter((({reaction:e})=>t.includes(e.opType))).map((({reaction:e})=>JE(e)));r.length&&this._ctx.emit("messageReaction",{reactions:r})}_handleSyncData(e){return t(this,void 0,void 0,(function*(){const t=this._ctx.logger.createTraceId();this._ctx.logger.info(n.L_PULL_MODIFY_MSG_T,JSON.stringify({time:e}),t);const s=Ac.encode(bl,{pullVersion:e,modifyType:[1,3],compress:Ri.enable()}),o=yield this._ctx.query(Bi.pullModifyMsg,this._ctx.currentUserId,s,void 0);if(this._ctx.logger.summary(n.L_PULL_MODIFY_MSG_R,o,t),!o.isOk)return o.wipe();const{msg:a,nextVersion:l,finished:c}=PE(o.data.pbData);return a&&a.length&&r(this,Sg,"m",yg).call(this,a),r(this,vg,"f")&&(this._ctx.emit("messageModifiedSyncCompleted",!c),i(this,vg,!1,"f")),ir({version:l,hasNext:!c})}))}}vg=new WeakMap,Sg=new WeakSet,Cg=function(e,t){i(this,vg,!0,"f"),t||this.reset()},yg=function(e){const t=[],r=[];e.forEach((e=>{const{modifyType:i}=e;1===i?t.push(e):3===i&&r.push(e)})),this._handleModifyNotifies(t),this._handleReactionNotifies(r)};const pI=18e4;class TI extends $t{constructor(e,t,s){super(),Og.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}),Ng.set(this,void 0),Mg.set(this,void 0),bg.set(this,void 0),Lg.set(this,void 0),Ug.set(this,void 0),Pg.set(this,!1),Dg.set(this,void 0),xg.set(this,!1),Qg.set(this,1),Object.defineProperty(this,"getUntaggedConversationListByPage",{enumerable:!0,configurable:!0,writable:!0,value:mg}),dI.set(this,new Set),Object.defineProperty(this,"searchConversationByContent",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"setMessageSpeechToTextVisible",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"syncRemoteConversations",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"getHistoryMessagesByObjectNames",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"getContinuousMessages",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"getMessagesAroundTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"deleteLocalUGMessagesForAllChannel",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"getUnreadMentionedMessages",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"getFirstUnreadMessage",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"getConversations",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"clearConversations",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"saveEditedMessageDraft",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"getEditedMessageDraft",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"clearEditedMessageDraft",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"clearUnreadCountByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:mg}),i(this,Dg,new $t,"f"),i(this,Ug,s,"f"),this.storage=new __(e),this.settings=new qd(this._ctx,this.storage,this),i(this,Ng,new hg(this._ctx,this.storage),"f"),i(this,Mg,new ug(this._ctx,this.storage,r(this,Dg,"f")),"f"),i(this,bg,new Ag(this._ctx),"f"),i(this,Lg,new II(this._ctx,this.storage),"f"),r(this,Dg,"f").on("messages",r(this,Og,"m",jg),this),r(this,Dg,"f").on("__firstOfflineMessageTime__",((e,t)=>{r(this,Lg,"f").setInitVersion(t||this._ctx.connectedTime)}),this),r(this,bg,"f").on("ugMsgModify",r(this,Og,"m",Zg),this),r(this,bg,"f").on("ugMsgExpansion",r(this,Og,"m",$g),this),r(this,bg,"f").on("ugMsgRecalled",r(this,Og,"m",eI),this),this._ctx.on("onConnected",r(this,Og,"m",Kg),this),this._ctx.on("onDisconnected",r(this,Og,"m",iI),this),this._ctx.on("onSuspend",r(this,Og,"m",iI),this),this._ctx.on("sCmd",r(this,Og,"m",sI),this),this._ctx.on("sNtf",r(this,Og,"m",nI),this),this._ctx.on("signal",r(this,Og,"m",oI),this),this._ctx.on("serverEvent",r(this,Og,"m",Yg),this),this._ctx.on("robotsSynced",r(this,Og,"m",wg),this)}get ugSynced(){return r(this,Pg,"f")}getConversationListByTimestamp(e,i){return t(this,void 0,void 0,(function*(){const{count:t,startTime:s,order:n,conversationTypes:o}=e;if(!i)return r(this,Og,"m",aI).call(this,s,t,n||0,o);const a=0!==s||n?s:Number.MAX_SAFE_INTEGER;let l=this.storage.getAllModels();o&&o.length>0&&(l=l.filter((e=>o.includes(e.conversationType)))),l=l.filter((e=>!e.hidden&&(e.conversationType!==exports.ConversationType.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId)&&(n?e.operationTime>a:e.operationTime<a))).sort(((e,t)=>e.operationTime-t.operationTime));const c=Math.min(l.length,t),d=n?l.slice(0,c):l.slice(l.length-c);return n||d.reverse(),ir(d.map((e=>e.toIReceivedConversation())))}))}getTopConversationList(e,i,s){return t(this,void 0,void 0,(function*(){const t=((null==i?void 0:i.length)||0)>0?i:Y(e?V:w),n="string"==typeof s&&""!==s,o=this.storage.getAllModels().filter((r=>r.isTop&&!r.hidden&&t.includes(r.conversationType)&&(r.conversationType!==exports.ConversationType.ULTRA_GROUP&&(!n||r.channelId===s)||e&&(!r.channelId||"RCDefault"===r.channelId)))).sort(((e,t)=>e.operationTime-t.operationTime)).map((e=>e.toIReceivedConversation()));return r(this,Og,"m",lI).call(this,o)}))}getBlockedConversationList(){return t(this,void 0,void 0,(function*(){const{includeUg:e}=this._ctx,t=this.storage.getAllModels().filter((t=>!t.hidden&&t.notificationLevel>exports.NotificationLevel.NOT_SET&&(t.conversationType!==exports.ConversationType.ULTRA_GROUP||e&&(!t.channelId||"RCDefault"===t.channelId)))).sort(((e,t)=>e.operationTime-t.operationTime)).map((e=>e.toIReceivedConversation()));return r(this,Og,"m",lI).call(this,t)}))}getUnreadConversationList(e,i){return t(this,void 0,void 0,(function*(){const t=((null==i?void 0:i.length)||0)>0?i:Y(e?V:w),s=this.storage.getAllModels().filter((r=>r.unreadCount>0&&t.includes(r.conversationType)&&(r.conversationType!==exports.ConversationType.ULTRA_GROUP||e&&(!r.channelId||"RCDefault"===r.channelId)))).sort(((e,t)=>e.operationTime-t.operationTime)).map((e=>e.toIReceivedConversation()));return r(this,Og,"m",lI).call(this,s)}))}getAllConversationList(e,i){return t(this,void 0,void 0,(function*(){const t="string"==typeof i;if(e){const e=this.storage.getAllModels().filter((e=>!(e.hidden||(e.conversationType===exports.ConversationType.ULTRA_GROUP||t&&e.channelId!==i)&&e.channelId&&"RCDefault"!==e.channelId))).sort(((e,t)=>e.operationTime-t.operationTime)).map((e=>e.toIReceivedConversation()));return ir(e)}return(yield r(this,Og,"m",aI).call(this,0,1e3,0)).trans((e=>e.filter((e=>!t||e.channelId===i))))}))}getTotalUnreadCount(e,r,i){return t(this,void 0,void 0,(function*(){let t=0;return this.storage.getAllModels().forEach((s=>{s.unreadCount>0&&e.includes(s.conversationType)&&(s.conversationType!==exports.ConversationType.ULTRA_GROUP&&(!i&&!s.channelId||s.channelId===i)||s.conversationType===exports.ConversationType.ULTRA_GROUP&&(""===s.channelId||"RCDefault"===s.channelId))&&(r||s.notificationLevel<=exports.NotificationLevel.NOT_SET)&&(t+=s.unreadCount)})),ir(t)}))}getConversation(e){return t(this,void 0,void 0,(function*(){const t=this.storage.getOrCreateModel(e,!1).toIReceivedConversation(),i=yield r(this,Og,"m",lI).call(this,[t]);return i.isOk?i.trans((e=>e[0])):ir(t)}))}batchSetConversationToTop(e,i,s,n){return t(this,void 0,void 0,(function*(){const t=this.storage.get("conversationStatusVersion"),s=yield r(this,Og,"m",cI).call(this,e,t,i);if(!s.isOk)return s.wipe();const{version:o,updateVersion:a}=s.data,l=e.map((e=>{const t=this.storage.getOrCreateModel(e,!0);return t.updateAttrs({isTop:i,hidden:!n&&t.hidden,operationTime:t.hidden&&n?Date.now():t.operationTime}),t}));return this.storage.updateConversationStorage(l),a&&this.storage.set("conversationStatusVersion",o),ir()}))}batchSetConversationNotificationLevel(e,i){return t(this,void 0,void 0,(function*(){const t=this.storage.get("conversationStatusVersion"),s=yield r(this,Og,"m",cI).call(this,e,t,void 0,i);if(!s.isOk)return s.wipe();const{version:n,updateVersion:o}=s.data,a=e.map((e=>{const t=this.storage.getOrCreateModel(e,!0);return t.updateAttrs({notificationLevel:i}),t}));return this.storage.updateConversationStorage(a),o&&this.storage.set("conversationStatusVersion",n),ir()}))}batchSetConversationTranslateStrategy(e,i){return t(this,void 0,void 0,(function*(){const t=this.storage.get("conversationStatusVersion"),s=yield r(this,Og,"m",cI).call(this,e,t,void 0,void 0,i);if(!s.isOk)return s.wipe();const{version:n,updateVersion:o}=s.data,a=e.map((e=>{const t=this.storage.getOrCreateModel(e,!0);return t.updateAttrs({translateStrategy:i}),t}));return this.storage.updateConversationStorage(a),o&&this.storage.set("conversationStatusVersion",n),ir()}))}getConversationNotificationLevel(e){return t(this,void 0,void 0,(function*(){const t=this.storage.getOrCreateModel(e,!1);return ir(t.notificationLevel)}))}getConversationTypeNotificationLevel(e){return t(this,void 0,void 0,(function*(){const t=this.storage.getConversationTypeNotificationLevel(e);return ir(t)}))}setConversationTypeNotificationLevel(e,r){return t(this,void 0,void 0,(function*(){const t=this.storage.get("conversationStatusVersion"),{currentUserId:i}=this._ctx,s=Ac.encode(ta,{type:e,unpushLevel:r,version:t,ignoreVersion:!0}),n=yield this._ctx.query(Bi.setTypeUnpush,i,s,ra);if(!n.isOk)return n.wipe();const{version:o,updateVersion:a}=n.data;return this.storage.setConversationTypeNotificationLevel(e,r),a&&this.storage.set("conversationStatusVersion",o),ir()}))}clearAllSGUnreadCount(){return t(this,void 0,void 0,(function*(){const e=this.storage.getAllSGModels(),t=this._ctx.serverTime;return e.forEach((e=>e.clearUnreadCount(t))),this.storage.updateConversationStorage(e),ir()}))}deleteRemoteMessage(e,r){return t(this,void 0,void 0,(function*(){const t=r.map((e=>({msgDataTime:e.sentTime,msgId:e.messageUId,direct:e.messageDirection}))),i=Ac.encode(Vo,{type:e.conversationType,busChannel:e.channelId,conversationId:e.targetId,msgs:t}),s=e.conversationType===exports.ConversationType.ULTRA_GROUP?Bi.delUgMsg:Bi.delMsg,n=yield this._ctx.query(s,this._ctx.currentUserId,i);if(!n.isOk)return n.wipe();if(!this._ctx.includeUg)return ir();const o=this.storage.getModel(e);if(o){const{latestMessage:e}=o;e&&r.some((t=>t.messageUId===e.messageUId))&&o.updateAttrs({latestMessage:null})}return ir()}))}deleteRemoteMessageByTimestamp(e,r){return t(this,void 0,void 0,(function*(){const t=Ac.encode(Co,{conversationType:e.conversationType,targetId:e.targetId,busChannel:e.channelId,dataTime:r}),i=RI[e.conversationType],s=yield this._ctx.query(i,this._ctx.currentUserId,t);if(!s.isOk)return s.wipe();if(!this._ctx.includeUg)return ir();const n=this.storage.getModel(e);if(n){const{latestMessage:e}=n;e&&(0===r||e.sentTime<=r)&&n.updateAttrs({latestMessage:null})}return ir()}))}batchClearRemoteHistoryMessages(e,r){return t(this,void 0,void 0,(function*(){const t=Ac.encode(yo,{input:e.map((e=>({conversationType:e.conversationType,targetId:e.targetId,busChannel:e.channelId,dataTime:e.timestamp||0})))}),r=yield this._ctx.query(Bi.cleanMsgBatch,this._ctx.currentUserId,t);return r.isOk?(e.forEach((e=>{const t=this.storage.getModel(e);if(t){const{latestMessage:r}=t;r&&(!e.timestamp||r.sentTime<=e.timestamp)&&t.updateAttrs({latestMessage:null})}})),ir()):r.wipe()}))}sendReadReceiptResponseV5(e,r){return t(this,void 0,void 0,(function*(){const t=Ac.encode(sa,{targetId:e.targetId,type:e.conversationType,channelId:e.channelId,readType:0,msgIds:r}),i=r[0];return(yield this._ctx.query(Bi.readReceipt,i,t)).wipe()}))}getMessageReadReceiptInfoV5ByIdentifiers(e){return t(this,void 0,void 0,(function*(){const t=new Map;e.forEach((e=>{const r=Qd(e.identifier),i=t.get(r)||new Set;i.add(e.messageUId),t.set(r,i)}));const r=(e=>Ac.encode(oa,{items:e,compress:Ri.enable()}))(Array.from(t.entries()).map((([e,t])=>{const r=Xd(e);return{targetId:r.targetId,type:r.conversationType,busChannel:r.channelId,msgIds:Array.from(t)}}))),i=yield this._ctx.query(Bi.qryReceiptBatch,e[0].messageUId,r);if(!i.isOk)return i.wipe();const s=i.data,{item:n}=NE(s.pbData),o=[];return n.forEach((e=>{var t;const r={conversationType:e.type,targetId:e.targetId,channelId:e.busChannel};null===(t=e.msg)||void 0===t||t.forEach((({msgId:e,unreadCnt:t,readCnt:i,totalCnt:s})=>{o.push({identifier:r,messageUId:e,unreadCount:t,readCount:i,totalCount:s})}))})),ir(o)}))}getMessagesReadReceiptUsersByPageV5(e,r,i){return t(this,void 0,void 0,(function*(){const t=0===i.readStatus?1:2,s=yE({targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgIds:[r],qryType:1,pageType:1,pageToken:i.pageToken,pageSize:i.pageCount,readType:t,order:i.order?0:1}),n=yield this._ctx.query(Bi.qryReceipt,r,s);if(!n.isOk)return n.wipe();const o=n.data,{resp:a,pageToken:l}=OE(o.pbData),c=a[0];return ir({pageToken:l||"",totalCount:1===t?c.readCnt:c.unreadCnt,users:(1===t?c.readUser:c.unreadUser).map((e=>{const{userId:t,mentioned:r,receiptTime:i}=e;return{userId:t,timestamp:i||0,isMentioned:!!r}}))})}))}getMessagesReadReceiptByUsersV5(e,r,i){return t(this,void 0,void 0,(function*(){const t=yE({targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgIds:[r],qryType:2,users:i}),s=yield this._ctx.query(Bi.qryReceipt,r,t);if(!s.isOk)return s.wipe();const n=s.data,{resp:o}=OE(n.pbData),a=o[0];return ir({pageToken:"",totalCount:0,users:[...a.readUser,...a.unreadUser].map((e=>{const{userId:t,mentioned:r,receiptTime:i}=e;return{userId:t,timestamp:i||0,isMentioned:!!r}}))})}))}requestSpeechToTextForMessage(e,i){return t(this,void 0,void 0,(function*(){const t=nr.create("requestSpeechToTextForMessage").isObject("option",i,!0).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,"option type error").validate("messageType",null==i?void 0:i.messageType,(e=>e===Q.HQ_VOICE||e===Q.VOICE),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).check((e=>{if(i.messageType===Q.HQ_VOICE)e.validate("numberOfChannels",i.numberOfChannels,(e=>1===e),!0).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"numberOfChannels invalid").validate("sampleRate",i.sampleRate,(e=>16e3===e||8e3===e),!0).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"sampleRate invalid").isString("format",i.format).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"format invalid").isHttpUrl("remoteUrl",i.remoteUrl,!0).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"remoteUrl invalid");else{const{content:t}=i;e.isNotEmptyString("content",t,!0).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"content invalid")}})).isLimitedInteger("duration",i.duration,1,60,!0).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"duration invalid").result();return t.isOk?r(this,dI,"f").has(e)?sr(exports.ErrorCode.SPEECH_TO_TEXT_REQUEST_IN_PROCESS,"speech to text request in process"):(r(this,Og,"m",_I).call(this,e,i),ir()):t.wipe()}))}modifyMessageWithParams(e){return t(this,void 0,void 0,(function*(){const{messageUId:t,messageContent:r,conversation:i}=e,s=Ac.encode(Ia,{targetId:i.targetId,type:i.conversationType,busChannel:i.channelId,msgUID:t,msgTime:0,content:JSON.stringify(r),fromUserId:""}),n=yield this._ctx.query(Bi.modifyMsg,this._ctx.currentUserId,s,pa);if(!n.isOk)return n.wipe();const o=this.storage.getModel(i);if(o){const{latestMessage:e,conversationType:i}=o;e&&e.messageUId===t&&(e.content=r,e.isModifyMessage=!0,e.modifyInfo=i===exports.ConversationType.ULTRA_GROUP?void 0:{timestamp:n.data.modifyTime,status:Cr.SUCCESS,content:{}},o.updateAttrs({latestMessage:e}))}return ir()}))}refreshReferenceMessageWithParams(e,i,s,n,o){return t(this,void 0,void 0,(function*(){const t=nr.create("refreshReferenceMessageWithParams").validate("messageInfoMap",o,(t=>t&&e.every((e=>t[e]&&gt(t[e])))),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_INFO_MAP).result();return t.isOk?(setTimeout((()=>{n([]),r(this,Og,"m",hI).call(this,e,i,s,o)}),0),ir()):t.wipe()}))}addTagForConversations(e,r){return t(this,void 0,void 0,(function*(){if(!this._userSettins.hasTag(e))return sr(exports.ErrorCode.TAG_NOT_EXIST);const t=this.storage.get("conversationStatusVersion"),i=Date.now(),{currentUserId:s}=this._ctx,n=r.map((t=>({type:t.conversationType,channelId:t.targetId,busChannel:t.channelId,time:i,stateItem:[{sessionStateType:pc.Tags,value:"",tags:[{tagId:e}]}]}))),o=UE(t,n),a=yield this._ctx.query(Bi.addTag,s,o,ea);if(!a.isOk)return a.wipe();const{version:l,updateVersion:c}=a.data,d=new Map;r.forEach((t=>{const r=this.storage.getOrCreateModel(t,!0),i={},{tags:s}=r;s.some((t=>t.tagId===e))||(i.tags=s.concat({tagId:e}),d.set(r,i))}));const _=[],u=[];return Array.from(d.entries()).forEach((([e,t])=>{u.push(e);const r=e.updateAttrs(t,l);r&&_.push({conversation:e.toIReceivedConversation(),updatedItems:r})})),this.storage.updateConversationStorage(u),c&&this.storage.set("conversationStatusVersion",l),_.length>0&&this.emit("conversationStatusChanged",_),ir()}))}getTagsForConversation(e){return t(this,void 0,void 0,(function*(){const t=this.storage.getOrCreateModel(e,!1),r=this._userSettins.getTags(),i=t.tags.map((e=>{var t;return{tagId:e.tagId,tagName:null===(t=r[e.tagId])||void 0===t?void 0:t.tagName}}));return ir(i)}))}setConversationStatusInTag(e,r,i){return t(this,void 0,void 0,(function*(){const t=this.storage.get("conversationStatusVersion"),{isTop:s}=i,n=this.storage.getOrCreateModel(r,!1),{tags:o}=n,a=o.find((t=>t.tagId===e));if(!a)return sr(exports.ErrorCode.NO_TAG_IN_CONVER);const l=UE(t,[{type:r.conversationType,channelId:r.targetId,busChannel:r.channelId,time:Date.now(),stateItem:[{sessionStateType:pc.Tags,value:"",tags:[{tagId:e,isTop:s}]}]}]),{currentUserId:c}=this._ctx,d=yield this._ctx.query(Bi.addTag,c,l,ea);if(!d.isOk)return d.wipe();const{version:_,updateVersion:u}=d.data;return a.isTop=s,n.updateAttrs({tags:o},_),this.storage.updateConversationStorage([n]),u&&this.storage.set("conversationStatusVersion",_),ir()}))}removeTagForConversations(e,r){return t(this,void 0,void 0,(function*(){const t=this.storage.get("conversationStatusVersion"),i=UE(t,r.map((t=>({type:t.conversationType,channelId:t.targetId,busChannel:t.channelId,time:Date.now(),stateItem:[{sessionStateType:pc.Tags,value:"",tags:[{tagId:e}]}]})))),{currentUserId:s}=this._ctx,n=yield this._ctx.query(Bi.delTag,s,i,ea);if(!n.isOk)return n.wipe();const{version:o,updateVersion:a}=n.data,l=r.map((t=>{const r=this.storage.getOrCreateModel(t,!0),{tags:i}=r,s={tags:i.filter((t=>t.tagId!==e))};return r.updateAttrs(s,o),r}));return this.storage.updateConversationStorage(l),a&&this.storage.set("conversationStatusVersion",o),ir()}))}removeTagsForConversation(e,r){return t(this,void 0,void 0,(function*(){const{currentUserId:t}=this._ctx,i=this.storage.get("conversationStatusVersion"),s=UE(i,[{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId,time:Date.now(),stateItem:[{sessionStateType:pc.Tags,value:"",tags:r.map((e=>({tagId:e})))}]}]),n=yield this._ctx.query(Bi.delTag,t,s,ea);if(!n.isOk)return n.wipe();const{version:o,updateVersion:a}=n.data,l=this.storage.getOrCreateModel(e,!0),{tags:c}=l,d={tags:c.filter((e=>!r.includes(e.tagId)))};return l.updateAttrs(d,o),this.storage.updateConversationStorage([l]),a&&this.storage.set("conversationStatusVersion",o),ir()}))}getConversationListByTag(e,i,s){return t(this,void 0,void 0,(function*(){if(!this._userSettins.hasTag(e))return ir([]);const t=i||Number.MAX_SAFE_INTEGER,n=this.storage.getAllSGModels().filter((r=>r.operationTime<t&&r.tags.some((t=>t.tagId===e)))).sort(((e,t)=>t.operationTime-e.operationTime)).slice(0,s);if(0===n.length)return ir([]);const o=n.map((t=>Object.assign(Object.assign({},t.toIReceivedConversation()),{isTopInTag:t.tags.some((t=>t.tagId===e&&t.isTop))})));return r(this,Og,"m",lI).call(this,o)}))}getUnreadCountByTag(e,r){return t(this,void 0,void 0,(function*(){let t=0;return this.storage.getAllSGModels().forEach((i=>{var s;if(i.tags.some((t=>t.tagId===e))){if(i.notificationLevel>exports.NotificationLevel.NOT_SET&&!r)return;t+=null!==(s=i.unreadCount)&&void 0!==s?s:0}})),ir(t)}))}batchDeleteConversations(e){return t(this,void 0,void 0,(function*(){const{identifiers:t,deleteMessages:r}=e,i=Ac.encode(Go,{relation:t.map((({conversationType:e,targetId:t,channelId:r})=>({conversationType:e,conversationId:t,busChannel:r}))),cleanMsg:r}),s=yield this._ctx.query(Bi.delRelationBatch,this._ctx.currentUserId,i,void 0);return s.isOk&&t.forEach((e=>{const t=this.storage.getModel(e);t&&this.storage.removeConversation(t)})),s.wipe()}))}sendReadReceiptV2(e,r,i){return t(this,void 0,void 0,(function*(){const t=Ac.encode(ia,{msgId:r,channelId:i});return(yield this._ctx.query(Bi.rrMsg,e,t)).wipe()}))}sendUltraGroupTypingStatus(e){return t(this,void 0,void 0,(function*(){const{conversationType:t,channelId:r,targetId:i}=e,s=Ac.encode(Sa,{targetId:i,type:t,busChannel:r||"",opType:0}),n=new gn(Bi.operate,s,i);n.setHeaderQos(Wi);return(yield this._ctx.send(n)).wipe()}))}getUltraGroupList(e){return t(this,void 0,void 0,(function*(){const{targetId:t,channelType:r}=e||{},i=this.storage.getAllUGModels().filter((e=>!(void 0!==t&&t!==e.targetId||void 0!==r&&r!==e.channelType))).sort(((e,t)=>{var r,i;const s=(null===(r=e.latestMessage)||void 0===r?void 0:r.sentTime)||0;return((null===(i=t.latestMessage)||void 0===i?void 0:i.sentTime)||0)-s})).map((e=>{const t=e.toIReceivedConversation();return t.unreadMentionedCount=pd(t.unreadMentionedCount||0),t.unreadMessageCount=pd(t.unreadMessageCount||0),t.unreadMentionedMeCount=pd(t.unreadMentionedMeCount||0),t}));return ir(i)}))}getRemoteMessagesByUIds(e,i){return t(this,void 0,void 0,(function*(){const{currentUserId:t}=this._ctx,s=yield r(this,Og,"m",uI).call(this,e,i);if(!s.isOk)return s.wipe();const{list:n,notExistMsgId:o}=s.data,a=n.map((r=>dd(r,t,!1,e.targetId)));return ir(a)}))}getUGUnreadMentionedDigest(e){return t(this,void 0,void 0,(function*(){const{targetId:t,channelId:r,sentTime:i,count:s}=e,n=Ac.encode(So,{groupId:t,busChannel:r,msgTime:i,size:s}),o=yield this._ctx.query(Bi.qryUgUal,this._ctx.currentUserId,n,vo);if(!o.isOk)return o.wipe();const{msgInfo:a}=o.data;return ir(a.map((e=>({messageUId:e.msgId,sentTime:e.msgTime,messageType:e.className,mentionedType:e.remindType}))))}))}updateUGMessageExpansion(e,r,i){var s;return t(this,void 0,void 0,(function*(){const{currentUserId:t}=this._ctx,{mid:n,put:o,del:a,clear:l}=r,c=Ac.encode(Ia,{fromUserId:t,targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgUID:n,msgTime:i,content:JSON.stringify(r)}),d=yield this._ctx.query(Bi.upMsgEx,e.targetId,c);if(d.isOk){const t=null===(s=this.storage.getModel(e))||void 0===s?void 0:s.latestMessage;(null==t?void 0:t.messageUId)===n&&(l?t.expansion={}:o?t.expansion=Object.assign(Object.assign({},t.expansion),o):a&&t.expansion&&a.forEach((e=>{delete t.expansion[e]})))}return d.wipe()}))}setUGDefaultNotificationLevel(e,r,i){return t(this,void 0,void 0,(function*(){const t=Ac.encode(Zo,{unpushLevel:r,busChannel:i});return(yield this._ctx.query(Bi.ugUnpushSet,e,t)).wipe()}))}getUGDefaultNotificationLevel(e,r){return t(this,void 0,void 0,(function*(){const t=Ac.encode(zo,{busChannel:r}),i=yield this._ctx.query(Bi.ugUnpushQuery,e,t,$o);if(!i.isOk)return i.wipe();const{unpushLevel:s}=i.data;return ir(s)}))}getUnreadMentionedCount(e){var r;return t(this,void 0,void 0,(function*(){const t=this.storage.getModel(e);return ir(null!==(r=null==t?void 0:t.unreadMentionedCount)&&void 0!==r?r:0)}))}getAllUnreadMentionedCount(){return t(this,void 0,void 0,(function*(){const e=this.storage.getAllSGModels().reduce(((e,t)=>e+t.unreadMentionedCount),0);return ir(e)}))}getTotalUnreadCountByLevels(e,r,i){return t(this,void 0,void 0,(function*(){let t=0;return this.storage.getAllModels().forEach((s=>{if(!e.includes(s.conversationType))return;const{notificationLevel:n,unreadCount:o,unreadMentionedCount:a}=s;(0===r.length||r.includes(n))&&(t+=i?a:o)})),ir(t)}))}getConversationUnreadCount(e){return t(this,void 0,void 0,(function*(){const t=this.storage.getModel(e);return ir(t?t.unreadCount:0)}))}getFirstUnreadMessageDigest(e){return t(this,void 0,void 0,(function*(){const t=this.storage.getModel(e);if(!t)return ir(null);const r=t.firstUnreadMessage;return ir(r?{messageUId:r.messageUId||"",sentTime:r.sentTime}:null)}))}getUGUnreadCountForAllChannels(e,r,i){return t(this,void 0,void 0,(function*(){const t=this.storage.getAllUGModels().reduce(((t,s)=>{const n=i?s.unreadMentionedCount:s.unreadCount;if(!n||s.targetId!==e)return t;const o=s.notificationLevel||exports.NotificationLevel.NOT_SET;return!r.length||r.includes(o)?t+n:t}),0);return ir(pd(t))}))}getUGUnreadInfoList(e){return t(this,void 0,void 0,(function*(){const t=this.storage.getAllUGModels().filter((t=>e.includes(t.targetId))).map((e=>({conversationType:e.conversationType,type:e.conversationType,targetId:e.targetId,channelId:e.channelId,unreadMessageCount:pd(e.unreadCount||0),mentionedCount:pd(e.unreadMentionedCount||0),mentionedMeCount:pd(e.unreadMentionedMeCount||0),notificationLevel:e.notificationLevel||exports.NotificationLevel.NOT_SET})));return ir(t)}))}getUGFirstUnreadMessageDigest(e){return t(this,void 0,void 0,(function*(){const t=this.storage.getModel(e),r=null==t?void 0:t.firstUnreadMessage;return r?ir(r):sr(exports.ErrorCode.RC_DB_DATA_NOT_FOUND)}))}getBlockedUGList(){return t(this,void 0,void 0,(function*(){const e=this.storage.getAllUGModels().filter((e=>e.notificationLevel>exports.NotificationLevel.NOT_SET)).map((e=>e.toIReceivedConversation()));return ir(e)}))}clearConversationUnreadCount(e){return t(this,void 0,void 0,(function*(){const t=this._ctx.serverTime;if(e.conversationType===exports.ConversationType.ULTRA_GROUP){const r=mE(e,t),i=new gn(Bi.updUgRTime,r,this._ctx.currentUserId);i.setHeaderQos(Wi);const s=yield this._ctx.send(i);if(!s.isOk)return s.wipe()}return this.storage.clearConversationUnreadCount(e,t),ir()}))}getRealtimeConversations(e,i,s){return t(this,void 0,void 0,(function*(){const t=yield r(this,Og,"m",gI).call(this,i,s,e,[],Oe.ALL,Bi.qrySessions);if(!t.isOk)return t.wipe();const{currentUserId:n}=this._ctx,o=t.data.info.map((e=>{const{unreadCount:t,busChannel:r,type:i,userId:s,versionTime:o,msg:a}=e,l=this.storage.getOrCreateModel({conversationType:i,targetId:s,channelId:r||""},!1);return Object.assign(Object.assign({},l.toIReceivedConversation()),{unreadMessageCount:t,operationTime:o,latestMessage:a?dd(a,n,!1,s):null})})).sort(((e,t)=>{var r,i;const n=(null===(r=e.latestMessage)||void 0===r?void 0:r.sentTime)||0,o=(null===(i=t.latestMessage)||void 0===i?void 0:i.sentTime)||0;return 0===s?o-n:n-o}));return ir(o)}))}getRealtimeConTotalUnreadCount(){return t(this,void 0,void 0,(function*(){const e=Ac.encode(Lo,{nothing:1});return(yield this._ctx.query(Bi.qrySessionsAtt,this._ctx.currentUserId,e,Uo)).trans((e=>e.totalUnreadCount))}))}clearRealtimeConUnreadCount(e){return t(this,void 0,void 0,(function*(){const t=this._ctx.serverTime;this.storage.clearConversationUnreadCount(e,this._ctx.serverTime);const r=mE(e,t),i=new gn(Bi.updRRTime,r,this._ctx.currentUserId);return(yield this._ctx.send(i)).wipe()}))}removeRealtimeConversations(e){return t(this,void 0,void 0,(function*(){const t=Ac.encode(Do,{sessions:e.map((e=>({type:e.conversationType,channelId:e.targetId,busChannel:e.channelId})))});return(yield this._ctx.query(Bi.delSessions,this._ctx.currentUserId,t)).wipe()}))}batchGetRealtimeConUnreadCount(e){return t(this,void 0,void 0,(function*(){const t=Ac.encode(xo,{sessions:e.map((e=>({type:e.conversationType,channelId:e.targetId,busChannel:e.channelId})))});return(yield this._ctx.query(Bi.qrySessionsUnread,this._ctx.currentUserId,t,wo)).trans((e=>e.sessions.map((e=>({conversationType:e.type,targetId:e.channelId,channelId:e.busChannel||"",unreadCount:e.unreadCount||0})))))}))}getUnreadMentionMeConversationList(e,i){return t(this,void 0,void 0,(function*(){const{count:t,conversationTypes:s}=e,n=e.timestamp||Number.MAX_SAFE_INTEGER;if(i){const e=this.storage.getAllModels().filter((e=>e.operationTime<n&&e.unreadMentionedCount>0&&s.includes(e.conversationType)&&(e.conversationType!==exports.ConversationType.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId))).sort(((e,t)=>t.operationTime-e.operationTime)).slice(0,t);return ir(e.map((e=>e.toIReceivedConversation())))}const o=this.storage.getAllSGModels().filter((e=>e.operationTime<n&&e.unreadMentionedCount>0&&s.includes(e.conversationType))).sort(((e,t)=>t.operationTime-e.operationTime)).slice(0,t).map((e=>e.toIReceivedConversation()));return r(this,Og,"m",lI).call(this,o)}))}loadConversationList(e,r,i){return t(this,void 0,void 0,(function*(){const t=((e,t,r)=>{const{conversationTypes:i,tagFilter:s={},order:n,channelId:o}=r,{tagIds:a,topPriority:l}=s;return Ac.encode(Ao,{type:i,count:t,order:n,tags:a,isTagTop:!!l,pageToken:e,compress:Ri.enable()})})(e,r,i),s=yield this._ctx.query(Bi.qryRelationFilter,this._ctx.currentUserId,t,void 0);if(!s.isOk)return s.wipe();const{pageToken:n,isFinished:o,info:a}=SE(s.data.pbData),l=a.map((e=>{const{busChannel:t,type:r,userId:i}=e,s={conversationType:r,targetId:i,channelId:t||""},n=this.storage.getOrCreateModel(s,!1);return Object.assign(Object.assign({},n.toIReceivedConversation()),{operationTime:e.versionTime,latestMessage:e.msg?dd(e.msg,this._ctx.currentUserId,!1,i):null})}));return ir({pageToken:n||"",finished:!!o,list:l})}))}updateConversationReadTime(e,r){return t(this,void 0,void 0,(function*(){const t=mE(e,r),i=new gn(Bi.updRTime,t,this._ctx.currentUserId);return(yield this._ctx.send(i)).wipe()}))}getMessageReader(e,r,i){return t(this,void 0,void 0,(function*(){const t=Ac.encode(ia,{msgId:[r],channelId:i});return(yield this._ctx.query(Bi.rrList,e,t,ca)).trans((e=>({totalMemberCount:e.totalMemberNum,list:e.list})))}))}sendReadReceiptMessageV4(e,r,i){return t(this,void 0,void 0,(function*(){const{conversationType:t,targetId:s,channelId:n}=e,o=Ac.encode(ba,{targetId:s,type:t,busChannel:n,startMsgId:r,endMsgId:i}),a=new gn(Bi.sendMsgRead,o,s);return(yield this._ctx.send(a)).wipe()}))}getMessageReadReceiptV4(e,r){return t(this,void 0,void 0,(function*(){const{targetId:t,channelId:i=""}=e,s=Ac.encode(La,{targetId:t,busChannel:i,msgId:r});return(yield this._ctx.query(Bi.qryMsgRead,t,s,Ua)).trans((({list:e,num:t,readCnt:r})=>({list:e.map((e=>({userId:e.userId,readTime:e.receiptTime}))),totalCount:t,readCount:r})))}))}batchGetMessageReadReceiptInfoV4(e,r){return t(this,void 0,void 0,(function*(){const{targetId:t,conversationType:i,channelId:s}=e,n=Ac.encode(Pa,{type:i,busChannel:s,msgId:r});return(yield this._ctx.query(Bi.qryMsgReadCntBatch,t,n,Da)).trans((({result:t})=>t.map((t=>Object.assign({messageUId:t.msgId,readedCount:t.cnt,totalCount:t.tmn},e)))))}))}getConversationsIncludingRobots(e){return t(this,void 0,void 0,(function*(){const{count:t,conversationTypes:i}=e;if(!this._ctx.includeUg)return r(this,Og,"m",aI).call(this,e.timestamp,t,0,i,Oe.ROBOT_ONLY);let s=e.timestamp||Number.MAX_SAFE_INTEGER;const n=this.storage.getAllSGModels().filter((e=>e.includeRobot&&e.operationTime<s&&i.includes(e.conversationType))).sort(((e,t)=>t.operationTime-e.operationTime)).slice(0,t);return ir(n.map((e=>e.toIReceivedConversation())))}))}markRemoteConversationAsRead(e,i,s){return t(this,void 0,void 0,(function*(){const t=yield r(this,Ug,"f").sendMessage(e,i,s);if(!t.isOk)return t.wipe();const{sentTime:n}=t.data,o=this.storage.getModel(e);return o&&(o.clearUnreadCount(n),this.storage.updateConversationStorage([o])),t.wipe()}))}_updateMessageReaction(e,r){return t(this,void 0,void 0,(function*(){const{conversationIdentifier:t,pushConfig:i,reactionId:s,messageUId:n}=r,{targetId:o,conversationType:a,channelId:l}=t,c=wE(i),d=Ac.encode(rc,{targetId:o,type:a,busChannel:l,msgId:n,reactionId:s,pushExt:c,appData:null==i?void 0:i.pushData,pushText:null==i?void 0:i.pushContent});return(yield this._ctx.query(e,o,d,ic)).wipe()}))}addMessageReaction(e){return t(this,void 0,void 0,(function*(){const t={[exports.ConversationType.PRIVATE]:Bi.addPReaction,[exports.ConversationType.GROUP]:Bi.addGReaction,[exports.ConversationType.ULTRA_GROUP]:Bi.addUgReaction}[e.conversationIdentifier.conversationType];return this._updateMessageReaction(t,e)}))}removeMessageReaction(e){const t={[exports.ConversationType.PRIVATE]:Bi.rmPReaction,[exports.ConversationType.GROUP]:Bi.rmGReaction,[exports.ConversationType.ULTRA_GROUP]:Bi.rmUgReaction}[e.conversationIdentifier.conversationType];return this._updateMessageReaction(t,e)}batchGetMessageReactionSummaries(e){var r;return t(this,void 0,void 0,(function*(){const{conversationIdentifier:t,messageUIds:i}=e,{targetId:s,conversationType:n,channelId:o}=t,a=n===exports.ConversationType.ULTRA_GROUP?Bi.ugMReactBQ:Bi.mReactBQ,l=Ac.encode(sc,{targetId:s,type:n,busChannel:o,msgId:i,compress:Ri.enable(),allUser:!1}),c=yield this._ctx.query(a,i[0],l,void 0);if(!c.isOk)return c.wipe();const{msgReaction:d}=HE(c.data.pbData),_={};return i.forEach((e=>{_[e]=[]})),null===(r=d)||void 0===r||r.forEach((e=>{_[e.msgId]=WE(e.reaction,e.msgId)})),ir(_)}))}getMessageReactions(e){return t(this,void 0,void 0,(function*(){const{conversationIdentifier:t,pageToken:r,count:i,messageUId:s}=e,{targetId:n,conversationType:o,channelId:a}=t,l=o===exports.ConversationType.ULTRA_GROUP?Bi.ugMReactQ:Bi.mReactQ,c=Ac.encode(oc,{targetId:n,type:o,busChannel:a,msgId:s,size:i,pageToken:r,compress:Ri.enable(),allUser:!1}),d=yield this._ctx.query(l,s,c,void 0);if(!d.isOk)return d.wipe();const{pageToken:_,reaction:u}=jE(d.data.pbData),h={pageToken:_||"",reactions:WE(u,s)};return ir(h)}))}getMessageReactionUsers(e){return t(this,void 0,void 0,(function*(){const{conversationIdentifier:t,pageToken:r,count:i,messageUId:s,reactionId:n}=e,{targetId:o,conversationType:a,channelId:l}=t,c=a===exports.ConversationType.ULTRA_GROUP?Bi.ugMReactUQ:Bi.mReactUQ,d=Ac.encode(oc,{targetId:o,type:a,busChannel:l,msgId:s,reactionId:n,size:i,pageToken:r,compress:Ri.enable()}),_=yield this._ctx.query(c,s,d,void 0);if(!_.isOk)return _.wipe();const{pageToken:u,reaction:h}=YE(_.data.pbData),E=h.user,g={pageToken:u||"",totalCount:h.userCnt,users:E.map((({userId:e,reactionTime:t})=>({userId:e,reactionTime:t})))};return ir(g)}))}}Ng=new WeakMap,Mg=new WeakMap,bg=new WeakMap,Lg=new WeakMap,Ug=new WeakMap,Pg=new WeakMap,Dg=new WeakMap,xg=new WeakMap,Qg=new WeakMap,dI=new WeakMap,Og=new WeakSet,wg=function(e,t,r){if(t!==exports.ErrorCode.SUCCESS||!this._ctx.includeUg||0===r.length)return;const i=[exports.ConversationType.PRIVATE,exports.ConversationType.SYSTEM];this.storage.getAllSGModels().filter((e=>i.includes(e.conversationType)&&r.some((t=>t.robotId===e.targetId)))).forEach((e=>e.updateAttrs({includeRobot:!0})))},Gg=function(e,t){const{conversationType:r,targetId:i,channelId:s,senderUserId:n}=e;if(r!==exports.ConversationType.PRIVATE)return!1;if(n===this._ctx.currentUserId){const n={conversationType:r,targetId:i,channelId:s},o=this.storage.getOrCreateModel(n,!0);if(o.version<e.sentTime){const r=o.clearUnreadCount(e.sentTime);r&&t.set(o,Object.assign(Object.assign({},t.get(o)),r))}}return!0},Vg=function(e,t,r,i){const{conversationType:s,targetId:n,channelId:o,senderUserId:a,content:l}=t;if(a!==this._ctx.currentUserId)return!1;const c={conversationType:s,targetId:n,channelId:o},d=this.storage.getOrCreateModel(c,!0);if(d.version>=t.sentTime)return!1;const _=d.clearUnreadCount(t.sentTime);return _&&r.set(d,Object.assign(Object.assign({},r.get(d)),_)),d.removeRecvMessageRecords(t.sentTime),1!==e.sesDriven||(t.isOffLineMessage&&i.push(Object.assign(Object.assign({},c),{timestamp:l.lastMessageSendTime})),!1)},kg=function(e,t){const{conversationType:r,targetId:i,channelId:s,content:n}=e,o={conversationType:r,targetId:i,channelId:s},a=r===exports.ConversationType.PRIVATE?{privateReadReceipt:Object.assign(Object.assign({},o),{endMsgTime:n.endMsgTime})}:{groupReadReceipt:Object.assign(Object.assign({},o),{totalCount:n.tmn,readedCount:n.rrn,messageUId:n.msgId})};t.push(a)},Fg=function(e,t,r,i){var s;const{content:n,conversationType:o,targetId:a,channelId:l,isPersited:c,isStatusMessage:d,isCounted:_,messageType:u,isMentioned:h,senderUserId:E,disableUpdateLastMessage:g}=e;if(!W(o,V))return;if(d||!c)return;if(Id(r).isOk)return;const I={conversationType:o,targetId:a,channelId:l},p=this.storage.getOrCreateModel(I,!0),T=E===i,R=u===Q.RECALL,f=e.sentTime>p.version,A=p.hidden&&!f,m={};f&&(m.hidden=!1);const S=()=>{const r=p.updateAttrs(m,e.sentTime);r&&t.set(p,Object.assign(Object.assign({},t.get(p)),r))};if(!A&&(!R||p.hidden)&&e.sentTime>=p.operationTime&&(m.operationTime=e.sentTime),A||g||p.latestMessage&&!(e.sentTime>=p.latestMessage.sentTime)||(m.latestMessage=r.supportRecallRefactor&&R?gd(e,!0):e),!f)return void S();if(m.version=e.sentTime,R){let{sentTime:t,originalFromUserId:r}=n;return r||(r=E),t&&t>p.lastReadTime&&!(null===(s=e.__innerData__)||void 0===s?void 0:s.keepUnreadCount)&&r!==i&&(m.unreadCount=Math.max(p.unreadCount-1,0),0===m.unreadCount&&(m.firstUnreadMessageUId="",m.firstUnreadTime=0,m.firstUnreadMessageType="",m.unreadMentionedCount=0,m.unreadMentionedMeCount=0,m.hasMentioned=!1,m.mentionedInfo=void 0),p.addRecvMessageRecord(t,-1)),void S()}if(T||!_)return void S();let v;if(m.unreadCount=p.unreadCount+1,0===p.unreadCount&&(m.firstUnreadMessageUId=e.messageUId,m.firstUnreadTime=e.sentTime,m.firstUnreadMessageType=e.messageType),n.mentionedInfo){const{type:e,userIdList:t}=n.mentionedInfo,r=e===exports.MentionedType.ALL||e===exports.MentionedType.SINGAL&&(null==t?void 0:t.includes(i));r&&(v=e,m.hasMentioned=r,m.mentionedInfo={type:e,userIdList:t},m.unreadMentionedCount=p.unreadMentionedCount+1,e===exports.MentionedType.SINGAL&&(m.unreadMentionedMeCount=p.unreadMentionedMeCount+1))}p.addRecvMessageRecord(e.sentTime,1,v),S()},Bg=function(e,t){const{conversationType:r,targetId:i,channelId:s,content:n}=e,o={conversationType:r,targetId:i,channelId:s||""},{put:a,del:l,mid:c,clear:d}=n;if(a?t.push({updatedExpansion:Object.assign(Object.assign({},o),{messageUId:c,expansion:a})}):l&&t.push({deletedExpansion:Object.assign(Object.assign({},o),{messageUId:c,deletedKeys:l})}),!this._ctx.includeUg)return;const _=this.storage.getModel(o);_&&_.latestMessage&&_.latestMessage.messageUId===c&&(d?_.latestMessage.expansion={}:a?_.latestMessage.expansion=Object.assign(Object.assign({},_.latestMessage.expansion),a):l&&_.latestMessage.expansion&&l.forEach((e=>{delete _.latestMessage.expansion[e]})))},Hg=function(e){const{currentUserId:t}=this._ctx,i=this._ctx.getNaviInfoFromCache(),s={v4ReadReceipts:[],v4SyncNotify:[],expansions:[],logCmdMessages:[],cloudControllerMessages:[],messages:[],updateModels:new Map};return s.messages=e.filter((e=>{switch(e.messageType){case Q.DELIVERED:case Q.DELIVERED_MSG:return!1;case Q.LOG_COMMAND:return s.logCmdMessages.push(e),!1;case Q.CLOUD_CONTROL:return s.cloudControllerMessages.push(e),!1;case Q.READ_RECEIPT:return r(this,Og,"m",Gg).call(this,e,s.updateModels);case Q.SYNC_READ_STATUS:return r(this,Og,"m",Vg).call(this,i,e,s.updateModels,s.v4SyncNotify);case Q.READ_STATE:return r(this,Og,"m",kg).call(this,e,s.v4ReadReceipts),!1;case Q.READ_RECEIPT_REQUEST:return this.storage.addReadReceiptRequest(e,t);case Q.READ_RECEIPT_RESPONSE:return this.storage.handleReadReceiptResponse(e,t);case Q.EXPANSION_NOTIFY:return r(this,Og,"m",Bg).call(this,e,s.expansions),!1;default:return r(this,Og,"m",Fg).call(this,e,s.updateModels,i,t),!0}})),s},jg=function(e,t,s,n){e.stopPropagation(),this._ctx.recordReceivedMessagesForStatistics(s);const{messages:o,v4ReadReceipts:a,v4SyncNotify:l,expansions:c,logCmdMessages:d,cloudControllerMessages:_,updateModels:u}=r(this,Og,"m",Hg).call(this,s);if(l.length&&this.emit("syncReadStatusV4",l),o.length&&this.emit("messages",t,o,n),!r(this,xg,"f")&&"pullMsg"===t&&n&&(i(this,xg,!0,"f"),this.emit("offlineFinished"),r(this,Lg,"f").startInterval(pI,!0)),c.length&&this.emit("expansions",c),a.length&&this.emit("readReceiptV4",a),u.size){const e=[],t=[];Array.from(u.entries()).forEach((([r,i])=>{t.push(r),e.push({conversation:r.toIReceivedConversation(),updatedItems:i})})),this.storage.updateConversationStorage(t),this.emit("conversationStatusChanged",e)}this._ctx.handleLogCmdMessages(d),this._ctx.handleCloudControllerMessage(_)},Yg=function(e,t,r){if(t!==gg)return;e.stopPropagation();const i=[];r.forEach((e=>{const{subChangeType:t}=e;if(0!==t)return;const r=Ac.decode(Sl,new Uint8Array(e.eventData)),{msgId:s,unreadCnt:n,readCnt:o,readList:a,totalCnt:l}=r;i.push({identifier:{conversationType:e.channelType,targetId:e.businessId,channelId:e.secondaryId},messageUId:s,users:a.map((e=>({userId:e.userId,timestamp:e.receiptTime,isMentioned:!!e.mentioned}))),readCount:o,unreadCount:n,totalCount:l})})),this._ctx.emit("readReceiptResponseV5",i)},Wg=function(e){return t(this,void 0,void 0,(function*(){i(this,xg,!1,"f"),e||(r(this,Mg,"f").setInitVersion(0),this._ctx.includeUg&&r(this,Og,"m",Xg).call(this)),this._ctx.svrUnread&&(e||this.storage.getAllSGModels().forEach((e=>e.clearUnreadCount(0))),yield r(this,Og,"m",Jg).call(this,0),this.emit("syncServerSaveUnreadCompleted")),r(this,Mg,"f").startInterval(pI,!0)}))},Jg=function e(i,s=new Map,o){return t(this,void 0,void 0,(function*(){const{logger:t,currentUserId:a}=this._ctx,l=t.createTraceId();t.info(n.L_PULL_SG_UNREAD_COUNT_T,JSON.stringify({version:i,pageToken:o}),l);const c=((e,t)=>Ac.encode(Ul,{version:e,compress:Ri.enable(),pageToken:t}))(i,o),d=yield this._ctx.query(Bi.pullSe,a,c,void 0);if(!d.isOk)return void t.warn(n.L_PULL_SG_UNREAD_COUNT_R,d.errmsg(),l);const{session:_,pageToken:u}=BE(d.data.pbData);if(t.summary(n.L_PULL_SG_UNREAD_COUNT_R,d,l,{nextPageToken:u}),_.forEach((e=>{const{targetId:t,type:r,busChannel:i,unread:n}=e,o={conversationType:r,targetId:t,channelId:i},l=this.storage.getOrCreateModel(o,!0),c=l.calibrateUnreadCount(n,a);c&&s.set(l,Object.assign(Object.assign({},s.get(l)),c))})),u)return r(this,Og,"m",e).call(this,i,s,u);this.storage.updateConversationStorage(Array.from(s.keys()))}))},qg=function(e){return t(this,void 0,void 0,(function*(){if(!e){this.settings.reset();const e=yield this.settings.syncDataFromServer();this.settings.setInitVersion(e)}this._ctx.isConnected&&this.settings.startInterval(pI,!0)}))},Kg=function(e,t){i(this,Pg,!1,"f"),t||this.storage.syncDataFromLocalStorage(this._ctx),r(this,Og,"m",qg).call(this,t),r(this,Og,"m",Wg).call(this,t),this._ctx.ugEnabel&&r(this,Og,"m",rI).call(this,t)},Xg=function e(){return t(this,void 0,void 0,(function*(){if(!this._ctx.isConnected)return;const{logger:t}=this._ctx,s=t.createTraceId(),o=r(this,Qg,"f");t.info(n.L_PULL_SG_RELATIONS_T,JSON.stringify({startTime:o}),s);const a=yield r(this,Og,"m",gI).call(this,o,1,1e3);if(!a.isOk)return t.warn(n.L_PULL_SG_RELATIONS_R,a.errmsg(),s),void setTimeout((()=>r(this,Og,"m",e).call(this)),1e3);const{info:l,isFinished:c,pullTime:d}=a.data;if(i(this,Qg,d,"f"),t.info(n.L_PULL_SG_RELATIONS_R,JSON.stringify({startTime:o,isFinished:c,pullTime:d}),s),this.storage.addRelations(l,this._ctx.currentUserId),!c)return r(this,Og,"m",e).call(this);this.emit("sgRelationsSynced",exports.ErrorCode.SUCCESS)}))},zg=function(e,i,s){return t(this,void 0,void 0,(function*(){const t=yield r(this,Og,"m",uI).call(this,e,i);if(!t.isOk)return;const n=t.data.list.map((t=>dd(t,this._ctx.currentUserId,!1,e.targetId))),o=this.storage.getModel(e);if(o&&o.latestMessage){const e=n.find((e=>e.messageUId===o.latestMessage.messageUId));e&&o.updateAttrs({latestMessage:e})}2===s?this._ctx.emit("messageModified",n):1===s&&this._ctx.emit("ugMsgExpansionUpdated",n)}))},Zg=function(e,t,i){r(this,Og,"m",zg).call(this,t,i,2)},$g=function(e,t,i){r(this,Og,"m",zg).call(this,t,i,1)},eI=function(e,t){const i=t.map((e=>{const{targetId:t,busChannel:i,msgUID:s,msgTime:n,operatorId:o,remindType:a}=e,l={conversationType:exports.ConversationType.ULTRA_GROUP,targetId:t,channelId:i||""},c=Object.assign(Object.assign({},l),{messageUId:s,sentTime:n}),d=Object.assign(Object.assign({},l),{sentTime:n,messageUId:s,senderUserId:o,content:c,messageDirection:1,messageType:Q.RECALL,isOffLineMessage:!1,receivedTime:Date.now(),isPersited:!1,isCounted:!1,isMentioned:!1,disableNotification:!1,isStatusMessage:!1,canIncludeExpansion:!1,expansion:null,receivedStatus:exports.ReceivedStatus.UNREAD,receivedStatusInfo:yt(exports.ReceivedStatus.UNREAD)}),_=this.storage.getModel(l);return _&&r(this,Og,"m",tI).call(this,_,d,a),d}));this._ctx.emit("ugMsgRecalled",i)},tI=function(e,t,r){const i={},{messageUId:s,sentTime:n}=t.content,{latestMessage:o}=e;o&&o.messageUId===s&&(i.latestMessage=gd(t,!0)),n&&e.lastReadTime<n&&e.unreadCount&&(i.unreadCount=e.unreadCount-1,r!==exports.MentionedType.ALL&&r!==exports.MentionedType.SINGAL||!e.unreadMentionedCount||(i.unreadMentionedCount=e.unreadMentionedCount-1),r===exports.MentionedType.SINGAL&&e.unreadMentionedCount&&(i.unreadMentionedMeCount=e.unreadMentionedMeCount-1));const a=e.updateAttrs(i,n);this.storage.updateConversationStorage([e]),a&&this.emit("conversationStatusChanged",[{conversation:e.toIReceivedConversation(),updatedItems:a}])},rI=function(e){return t(this,void 0,void 0,(function*(){const e=yield r(this,Ng,"f").markOnline();if(!e.isOk)return;const{relations:t,msgVersion:s}=e.data;this.storage.addRelations(t,this._ctx.currentUserId),i(this,Pg,!0,"f"),this.emit("ultraGroupEnable"),r(this,Ng,"f").setInitVersion(s),r(this,Ng,"f").startInterval(pI,!0),r(this,bg,"f").setInitVersion(s),r(this,bg,"f").startInterval(pI,!0)}))},iI=function(){i(this,Pg,!1,"f"),this.settings.stopInterval(),r(this,Ng,"f").reset(),r(this,Mg,"f").reset(),r(this,bg,"f").reset()},sI=function(e,i){return t(this,void 0,void 0,(function*(){if(3===i.type)return e.stopPropagation(),void this.settings.push(i.time);if(7===i.type)return e.stopPropagation(),void r(this,bg,"f").push(i.time);if(12===i.type)return e.stopPropagation(),void r(this,Lg,"f").push(i.time);if(13===i.type){e.stopPropagation();const t=new Map;if(yield r(this,Og,"m",Jg).call(this,i.time,t),t.size>0){const e=Array.from(t.entries()).map((([e,t])=>({conversation:e.toIReceivedConversation(),updatedItems:t})));this.emit("conversationStatusChanged",e)}}}))},nI=function(e,t){1===t.type&&(e.stopPropagation(),r(this,Mg,"f").push(t.time))},oI=function(e,t,r){const{syncMsg:i}=t,s=Hi(t.topic);if(i&&s===Bi.updUgRTime){e.stopPropagation();const{channelId:r,busChannel:i,msgTime:s}=Ac.decode(Po,t.pbData),n=this.storage.clearConversationUnreadCount({conversationType:exports.ConversationType.ULTRA_GROUP,targetId:r,channelId:i||""},s);n&&this.emit("conversationStatusChanged",[n])}},aI=function(e,i,s,n,o){return t(this,void 0,void 0,(function*(){const{currentUserId:t}=this._ctx,a=yield r(this,Og,"m",gI).call(this,e,s||0,i,n,o);if(!a.isOk)return a.wipe();const{info:l,isFinished:c,pullTime:d}=a.data,_=l.map((e=>{const{userId:r,type:i,busChannel:s}=e,n=this.storage.getOrCreateModel({conversationType:i,targetId:r,channelId:s},!1);return Object.assign(Object.assign({},n.toIReceivedConversation()),{operationTime:e.versionTime,latestMessage:e.msg?dd(e.msg,t,!1,r):null})}));return ir(_)}))},lI=function(e){return t(this,void 0,void 0,(function*(){if(this._ctx.includeUg)return ir(e);const{currentUserId:t}=this._ctx,i=e.filter((({conversationType:e})=>e!==exports.ConversationType.ULTRA_GROUP)).map((({conversationType:e,targetId:t,channelId:r})=>({conversationType:e,conversationId:t,busChannel:r})));if(0===i.length)return ir(e);const s=Ac.encode(Go,{relation:i.slice(0,100)}),n=yield this._ctx.query(Bi.qryRLBatch,this._ctx.currentUserId,s,void 0);if(!n.isOk)return n.wipe();const{info:o}=r(this,Og,"m",EI).call(this,n.data.pbData);return o.forEach((r=>{if(!r.msg)return;const i=e.find((e=>(e.channelId||"")===(r.busChannel||"")&&e.targetId===r.userId&&e.conversationType===r.type));i.latestMessage=dd(r.msg,t,!1,r.userId),i.includeRobot=!!r.isBot})),ir(e)}))},cI=function(e,r,i,s,n){return t(this,void 0,void 0,(function*(){const t=[];void 0!==i&&t.push({sessionStateType:pc.IsTop,value:i?"1":"0"}),void 0!==s&&t.push({sessionStateType:pc.IsSilent,value:s.toString()}),void 0!==n&&t.push({sessionStateType:pc.AutoTrans,value:n.toString()});const o=UE(r,e.map((e=>({type:e.conversationType,channelId:e.targetId,busChannel:e.channelId,stateItem:t}))));return this._ctx.query(Bi.setSeAtt,this._ctx.currentUserId,o,ea)}))},_I=function(e,i){return t(this,void 0,void 0,(function*(){r(this,dI,"f").add(e);const t=i.messageType===Q.HQ_VOICE?{msgId:e,objectName:i.messageType,content:i.remoteUrl,sampleRate:i.sampleRate,channelNumber:i.numberOfChannels,format:i.format}:{msgId:e,objectName:i.messageType,content:i.content},s=Ac.encode(vl,{businessType:1,businessInfo:Ac.encode(Cl,t)}),n=yield this._ctx.query(Bi.upConvertMsg,e,s,yl);r(this,dI,"f").delete(e);const{code:o}=n;let a;if(n.isOk){const e=Ac.decode(Ol,new Uint8Array(n.data.businessResult));a={status:Ne.SUCCESS,text:e.result}}else a={status:Ne.FAILED,text:""};this._ctx.emit("speechToTextResponse",{code:o,messageUId:e,sttInfo:a})}))},uI=function(e,t){const{targetId:r,conversationType:i,channelId:s}=e,n=Ac.encode(Aa,{targetId:r,type:i,query:t.map((e=>({msgTime:0,msgUID:e,busChannel:s})))});return this._ctx.query(Bi.qryMsg,this._ctx.currentUserId,n,ma)},hI=function(e,i,s,n){return t(this,void 0,void 0,(function*(){const t=Object.values(n),o=[...new Set([...e,...t])],{isOk:a,code:l,data:c}=yield r(this,Og,"m",uI).call(this,i,o);if(!a)return void s(e.map((e=>({messageUId:e,code:l}))));const{list:d,notExistMsgId:_}=c,u=new Map(d.map((e=>{const t=dd(e,this._ctx.currentUserId,!1,i.targetId);return[t.messageUId,t]}))),h=e.map((e=>{const t=u.get(e);if(!t)return _.includes(e)?{messageUId:e,code:exports.ErrorCode.RC_DB_DATA_NOT_FOUND}:{messageUId:e,code:exports.ErrorCode.SERVER_DATA_ERROR};if(t.messageType!==Q.REFERENCE)return{messageUId:e,code:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE};const r=n[e],i=u.get(r),s=t.content;return i?(s.referMsg=i.content,s.referMsgStatus=i.isModifyMessage?yr.MODIFIED:yr.DEFAULT,{messageUId:e,message:t,code:exports.ErrorCode.SUCCESS}):_.includes(r)?(s.referMsgStatus=yr.DELETE,{messageUId:e,code:exports.ErrorCode.RC_DB_DATA_NOT_FOUND,message:t}):(s.referMsgStatus=yr.DEFAULT,{messageUId:e,code:exports.ErrorCode.SERVER_DATA_ERROR,message:t})}));s(h)}))},EI=function(e){const t=SE(e);return this._ctx.getNaviInfoFromCache().supportRecallRefactor&&t.info.forEach((e=>{const{msg:t}=e;if(t&&t.classname===Q.RECALL){const e=JSON.parse(t.content),{messageUId:r,sentTime:i,extra:s}=e,n={recallTime:i,recallActionTime:t.dataTime,admin:!!e.isAdmin,delete:!!e.isDelete,isDelete:!!e.isDelete,operatorId:t.fromUserId,extra:s};t.classname=Q.RECALL_NOTIFICATION_MESSAGE,t.content=JSON.stringify(n),t.msgId=r,t.dataTime=i||t.dataTime}})),t},gI=function(e,i,s,n,o,a=Bi.qryRelationR){return t(this,void 0,void 0,(function*(){const{currentUserId:t}=this._ctx,l=((e,t,r,i,s)=>Ac.encode(fo,{startTime:e,order:t,count:r,compressioEnabled:Ri.enable(),channelType:i,botType:s}))(e,i,s,n,o);return(yield this._ctx.query(a,t,l)).trans((e=>r(this,Og,"m",EI).call(this,e.pbData)))}))};const RI={[exports.ConversationType.PRIVATE]:Bi.cleanPMsg,[exports.ConversationType.GROUP]:Bi.cleanGMsg,[exports.ConversationType.CUSTOMER_SERVICE]:Bi.cleanCMsg,[exports.ConversationType.SYSTEM]:Bi.cleanSMsg,[exports.ConversationType.APP_PUBLIC_SERVICE]:Bi.cleanMCMsg,[exports.ConversationType.PUBLIC_SERVICE]:Bi.cleanMPMsg,[exports.ConversationType.ULTRA_GROUP]:Bi.cleanGMsg},fI=(e,t,r,i,s,n,o,a,l,c)=>{var d;const _=l?`&protocolVer=${l}`:"";return`${r}://${i}/websocket?appId=${s}&token=${encodeURIComponent(n)}&sdkVer=${Ve}&pid=${a}&deviceId=${encodeURIComponent(e)}${1===c?`&baggage=${encodeURIComponent(`cid=${o}`)}`:""}&apiVer=${encodeURIComponent((null===(d=io.getApiVer)||void 0===d?void 0:d.call(io))||`${io.tag}||`)}${io.connectPlatform?`&platform=${io.connectPlatform}`:""}${_}${io.isFromUniapp?`&appIdentifier=${encodeURIComponent(t)}`:""}`};class AI extends ai{constructor(e,t,r,i){super(e,t,r),Object.defineProperty(this,"appStorage",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_socket",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_connectedTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_socketIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_serverSessionId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_localConnectedTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_idCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_generateMessageId",{enumerable:!0,configurable:!0,writable:!0,value:()=>(this._idCount>=65535&&(this._idCount=0),++this._idCount)}),Object.defineProperty(this,"_pingResolve",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_messageIds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_syncMessageIds",{enumerable:!0,configurable:!0,writable:!0,value:{}})}getConnectedTime(){return this._connectedTime}getLocalConnectedTime(){return this._localConnectedTime}getCrtServerTime(){return Date.now()-this._localConnectedTime+this._connectedTime}getDelayTime(){return this._localConnectedTime-this._connectedTime}_connectWithToken(e,r,i,s){return t(this,void 0,void 0,(function*(){const{openAnti:t,type:i,baggageEnabled:o}=r,a=this.getCmpList(r);this.logger.debug(n.L_NAVI_CMP_R,JSON.stringify(a),s);const l=a.filter(((e,t)=>a.findIndex((t=>t.addr===e.addr))===t)).sort(((e,t)=>e.weight>t.weight?-1:1));if(0===l.length)return this.logger.error(n.L_NAVI_CONF_E,"no service available",s),sr(exports.ErrorCode.SERVER_UNAVAILABLE);const c=1===t?ts:rs;for(let t=0;t<l.length;t+=1){const{protocol:r,addr:n,weight:a}=l[t],d=fI(this.appStorage.deviceId,this.appStorage.packageName,r===J.WS?"ws":"wss",n,this.appkey,e,this.cid,"",c,o),_=Date.now(),{code:u,data:h}=yield this.connectWebSocket(d,c,s),E=this.cmpWeightCache.findIndex((e=>e.addr===n)),g={bid:Wt(),ptc:fe.WS,cod:u,net:this.getNetwork().type,dur:Date.now()-_,spr:0,pr:i||0,hos:n,idx:E,rct:this.retryCount?Se.RECONNECT:Se.CONNECT,cid:this.cid,v:me.CURRENT,rsn:this._doConnectReason,count:this.retryCount,weight:a,ssid:this._serverSessionId};if(this.logger.record(Ee.IM_WEBSOCKET,JSON.stringify(g),s),u!==exports.ErrorCode.RC_SOCKET_DISCONNECTED&&u!==exports.ErrorCode.TIMEOUT)return u!==exports.ErrorCode.SUCCESS?sr(u):(this._localConnectedTime=Math.floor((Date.now()+_)/2),this._socket=h.socket,this.updateCmpWeight(l[t].addr,!0),this.curCmpUrl=l[t].addr,ir(h.userId))}return sr(exports.ErrorCode.SERVER_UNAVAILABLE)}))}connectWebSocket(e,r,i){return t(this,void 0,void 0,(function*(){this.logger.info(n.L_CONNECT_O,`connect start: ${e}`,i);const{resolve:t,promise:s}=lr(),{data:o,code:a,msg:l}=yield io.createWebSocket(e);if(a!==exports.ErrorCode.SUCCESS||!o)return sr(a,l);this._socketIndex=o.id;let c=exports.ErrorCode.SUCCESS;const d=setTimeout((()=>{this.logger.warn(n.L_CONNECT_S,"timeout",i),c=exports.ErrorCode.TIMEOUT,"wechat"===io.tag?o.close():(t(sr(exports.ErrorCode.TIMEOUT)),this.onSocketEnd(o,exports.ErrorCode.TIMEOUT,i))}),5e3);return o.onOpen((()=>{this.logger.info(n.L_CONNECT_S,"socket opened",i),clearTimeout(d)})),o.onError((e=>{this.logger.warn(n.L_CONNECT_S,"socket error",i),console.error(e),clearTimeout(d);const r=exports.ErrorCode.RC_SOCKET_DISCONNECTED;t(sr(r)),this.onSocketEnd(o,r,i)})),o.onClose((()=>{this.logger.info(n.L_CONNECT_S,"socket close",i);const e=c===exports.ErrorCode.SUCCESS?exports.ErrorCode.RC_SOCKET_DISCONNECTED:c;t(sr(e)),this.onSocketEnd(o,e,i)})),o.onMessage((e=>{if(this._socketIndex!==o.id)return void this.logger.warn(n.L_WS_DISACCORD_E,JSON.stringify({socketIndex:this._socketIndex,curSocketId:o.id}));if("[object ArrayBuffer]"!==Object.prototype.toString.call(e))return;const s=fn(e,r);if(s){if(s instanceof nn){const e=s.status;if(e!==ms)return this.logger.warn(n.L_CONNECT_O,`connect failed: ${e}`,i),c=(e=>KE[e])(e),o.close(),void t(sr(c));this.logger.info(n.L_CONNECT_O,"connect success",i);const{timestamp:r,userId:a,messageId:l,sessionId:d}=s;return this._serverSessionId=d,this._connectedTime=r,this._idCount=l,void t(ir({userId:a,socket:o}))}if(s instanceof an){const e=s.status;return this.logger.info(n.T,`recv disconnect signal -> status: ${e}`),void this.onRecvDisconnect(e,o)}this._onReceiveSignal(s)}})),s}))}_qosNeedAck(e){if(e.header.qos!==Yi)return e instanceof un&&!e.syncMsg?(this.logger.debug(n.O,`send pubAck -> ${e.messageId} ${e.topic}`),void this.sendOnly(new pn(e.messageId))):void(e instanceof Rn&&this._messageIds[e.messageId]&&(this.logger.debug(n.O,`send queryCon -> ${e.messageId}`),this.sendOnly(new Tn(e.messageId))))}_publishReader(e){return t(this,void 0,void 0,(function*(){const{syncMsg:t,topic:r,messageId:i}=e;if(this.logger.debug(n.O,`recv PublishReader -> messageId: ${i} ${r}`),r===ls)return;if(!t||QE(Hi(r)))return void this.emit("signal",e);const s=yield new Promise((e=>{this._syncMessageIds[i]=e}));delete this._syncMessageIds[i],this.emit("signal",e,s)}))}_onReceiveSignal(e){return t(this,void 0,void 0,(function*(){if(e instanceof cn&&this._pingResolve)return this._pingResolve(exports.ErrorCode.SUCCESS),void(this._pingResolve=void 0);if(this._qosNeedAck(e),e instanceof In||e instanceof Rn){const{messageId:t}=e;this.logger.debug(n.O,`recv ack -> messageId: ${t}`);const r=this._messageIds[t];r&&(r(e),delete this._messageIds[t]);const i=this._syncMessageIds[t];i&&(delete this._syncMessageIds[t],i(e))}e instanceof un&&(yield this._publishReader(e))}))}onRecvDisconnect(e,t){this._socket&&this._socket===t&&(this._socket=null,this.clearResolves(),this.onDisconnectByServer((e=>qE[e])(e)))}onSocketEnd(e,t,r){this._socket&&this._socket===e&&(this._socket=null,this.clearResolves(),this.onDisconenctUnusual(t),this._pingResolve&&(this._pingResolve(t),this._pingResolve=void 0))}clearResolves(){for(const e in this._messageIds){const t=this._messageIds[e];delete this._messageIds[e],t(exports.ErrorCode.RC_SOCKET_DISCONNECTED)}}sendPing(e){return new Promise((t=>{this._pingResolve=t,setTimeout((()=>t(exports.ErrorCode.TIMEOUT)),e),this.sendOnly(new ln)}))}sendOnly(e){this._socket&&((e instanceof gn||e instanceof En)&&(e.messageId=this._generateMessageId()),this._socket.send(e.getArrayBuffer()))}_sendHandler(e){return t(this,void 0,void 0,(function*(){if(!this._socket)return sr(exports.ErrorCode.RC_NET_CHANNEL_INVALID);const t=this._generateMessageId();e.messageId=t,this._socket.send(e.getArrayBuffer());const r=yield new Promise((e=>{this._messageIds[t]=e,setTimeout((()=>{this._messageIds[t]&&delete this._messageIds[t],e(exports.ErrorCode.TIMEOUT)}),3e4)})),i="number"==typeof r?r:r.status;return exports.ErrorCode.SUCCESS,"number"==typeof r?sr(r):i===exports.ErrorCode.SUCCESS?ir(r):sr(i,"",r)}))}query(e,r,i,s,n){return t(this,void 0,void 0,(function*(){this.logger.createTraceId(),ji(e);const t=new En(e,i,r);n&&t.setHeaderQos(n);const o=yield this._sendHandler(t),{data:a,isOk:l}=o;return l&&void 0!==s?ir(Ac.decode(s,a.pbData)):o}))}send(e,r){return t(this,void 0,void 0,(function*(){const t=yield this._sendHandler(e);if(!t.data)return t.wipe();if(t.data instanceof In)return t;const i=t.data,s=r&&i.pbData&&[exports.ErrorCode.SUCCESS,exports.ErrorCode.CHATROOM_KV_STORE_NOT_ALL_SUCCESS,exports.ErrorCode.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT,exports.ErrorCode.RC_USER_PROFILE_KEY_NOT_EXIST,exports.ErrorCode.RC_USER_PROFILE_EXT_KEY_NOT_EXIST,exports.ErrorCode.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS,exports.ErrorCode.RC_USER_PROFILE_VALUE_EXCEED_RANGE,exports.ErrorCode.RC_GROUP_PARAMETER_FORMAT_ERROR].indexOf(i.status)>=0?Ac.decode(r,i.pbData):i;return 0!==i.status?sr(i.status,void 0,r&&i.pbData?s:null):ir(s)}))}close(e,r,i){return t(this,void 0,void 0,(function*(){i&&(yield this.sendOnly(new on(Js))),this._socket&&(this._socket.close(),this._socket=null),this.clearResolves()}))}}const mI={};function SI(){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:Lr.getMiniCmpUrlList().join(",")}}class vI extends ci{constructor(e,t,r,i,s="default",n){super(e,t,r,io.useNavi&&"https:"===(null===window||void 0===window?void 0:window.location.protocol),io.useNavi,n),Object.defineProperty(this,"_appStorage",{enumerable:!0,configurable:!0,writable:!0,value:i}),this._environment=s}httpRequest(e,r,i,s,o){return t(this,void 0,void 0,(function*(){const t=`${e}/navi.js?appId=${r}&token=${encodeURIComponent(i)}&callBack=x&v=${Ve}&r=${Date.now()}&env=${this._environment}&p=${io.tag}`;this.logger.debug(n.L_REQUEST_T,`req navi => ${t}`,s);const a=yield io.httpReq({url:t,timeout:1e4,dataType:"text"});if(200!==a.status)return this.logger.debug(n.L_REQUEST_R,`request navi failed: ${a.status}`,s),!io.useNavi&&o?ir(SI()):sr(this.transHttpCode(a.status));try{let e=a.data.match(/{[\d\D]+}/)[0];0===e.indexOf('{\\"code\\":')&&(e=JSON.parse(`"${e}"`));const r=JSON.parse(e);return r.protocol=/^https/.test(t)?"https":"http",r.code&&200!==r.code?sr(this.transHttpCode(r.code)):(io.useNavi||(r.server="",r.backupServer=Lr.getMiniCmpUrlList().join(","),r.logSwitch=0),ir(r))}catch(e){this.logger.error(n.L_PARSE_NAVI_E,a.data,s)}return sr(exports.ErrorCode.RC_NAVI_REQ_FAILED)}))}httpRequestV2(e,r,i,s,o){return t(this,void 0,void 0,(function*(){const t=this.getNaviV2RequestOption({appkey:r,token:i,uri:e,platform:io.tag,protocol:(/^https/.test(e)?J.WSS:J.WS).toString()});this.logger.debug(n.L_REQUEST_T,`req navi => ${t.url}`,s);const a=yield io.httpReq(t);if(200!==a.status)return this.logger.debug(n.L_REQUEST_R,`request navi failed: ${a.status}`,s),!io.useNavi&&o?ir(SI()):sr(this.transHttpCode(a.status));try{let e=a.data;const r="object"!=typeof e?JSON.parse(e):e;if(r.protocol=/^https/.test(t.url)?"https":"http",!io.useNavi){r.logSwitch=0;const e=Lr.getMiniCmpUrlList();r.serverAddr=e.map(((r,i)=>({addr:r,protocol:/^https/.test(t.url)?J.WSS:J.WS,weight:e.length-i})))}return ir(r)}catch(e){this.logger.error(n.L_PARSE_NAVI_E,a.data,s)}return sr(exports.ErrorCode.RC_NAVI_REQ_FAILED)}))}getNaviCache(e){const t=this.getCatchKey(e);if(mI[t])return mI[t];const r=this._appStorage.get("naviInfo");if(!r)return null;let i;try{i=JSON.parse(r)}catch(e){i=[]}if(0===i.length)return null;const s=i.find((t=>t.token===e&&t.environment===this._environment))||null;return mI[t]=s,s}setNaviCache(e,t){let r=[];const i=Date.now(),s=this._appStorage.get("naviInfo");if(s){try{r=JSON.parse(s)}catch(e){r=[]}r.length>0&&(r=r.filter((t=>i-t.timestamp<xe&&(e!==t.token||this._environment!==t.environment))))}const n={timestamp:i,naviInfo:t,token:e,environment:this._environment};r.push(n),this._appStorage.set("naviInfo",JSON.stringify(r)),mI[this.getCatchKey(e)]=n}}class CI{constructor(){Object.defineProperty(this,"recallMsgMap",{enumerable:!0,configurable:!0,writable:!0,value:new Set})}}function yI(e){const t=!(1&~(e.ugMsg||0)),r=!(1&~(e.sessionCfg||0));return t&&r}class OI extends ti{constructor(e,t,r,i){super(t,e,r),Object.defineProperty(this,"_appStorage",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"model",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_mrtr",{enumerable:!0,configurable:!0,writable:!0,value:{chatroom:0,group:0,private:0,ultraGroup:0,temporary:!1}});const{type:s,version:n}=io.runtimeInfo;this.model=`Web|${s}|${n}`,this.init()}httpRequest(e,r,i,s){return t(this,void 0,void 0,(function*(){const t=s;t.deviceId=this._appStorage.deviceId,t.model=this.model;const o={url:e,method:r,headers:i,body:JSON.stringify(t)},a=this.logger.createTraceId();this.logger.info(n.L_REQUEST_T,JSON.stringify(o),a);const{status:l,data:c=""}=yield io.httpReq(o);this.logger.info(n.L_REQUEST_R,JSON.stringify({status:l,data:c}),a);try{const e=JSON.parse(c),t=e.data;return{code:parseInt(e.code,10),data:t}}catch(e){return this.logger.warn(n.L_CLOUD_CONFIG_DATA_E,JSON.stringify({status:l,data:c,error:e})),{code:l,msg:e}}}))}setCloudControllerCache(e){this._appStorage.set("cloudControllerData",JSON.stringify(e))}getLocalCloudControllerCache(){return this._appStorage.get("cloudControllerData")}setMRTRConfig(e){this.logger.info(n.L_CLOUD_SET_MRTR_O,JSON.stringify(e)),this._mrtr=e}getMRTRConfig(){return this._mrtr}}class NI extends Ur{constructor(e,t,r){super(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,"_appStorage",{enumerable:!0,configurable:!0,writable:!0,value:r})}getCache(){return this._appStorage.get("staticConf")}setCache(e){this._appStorage.set("staticConf",e)}clearCache(){this._appStorage.delete("staticConf")}sendRequest(e){return t(this,void 0,void 0,(function*(){const{status:t,data:r}=yield io.httpReq({url:e});return{code:t,data:r}}))}decryptData(e){return t(this,void 0,void 0,(function*(){try{const t=yield Jt(e,"cd4936151214ce45dc1d12673a59d94c","51ad078e5eb17a91");return JSON.parse(t)}catch(e){this.logger.error(n.L_GET_STATIC_CONF_E,JSON.stringify({error:null==e?void 0:e.stack}))}}))}}class MI extends Kd{constructor(){super(),Object.defineProperty(this,"_deviceId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_customDeviceId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_packageName",{enumerable:!0,configurable:!0,writable:!0,value:""});let e="";const{localStorage:t,tag:r}=io;"browser"!==r?(e=t.getItem(Be)||"",e||(e=at.genWithLen(22),t.setItem(Be,e))):e=lt,this._deviceId=e}setPackageName(e){this._packageName=e}get deviceId(){return this._customDeviceId||this._deviceId}get packageName(){return this._packageName}setCustomDeviceId(e){this._customDeviceId=e}_syncDataHandler(e){const{appkey:t}=e,{localStorage:r}=io,i=$e(t),s=r.getItem(i),n=Ze(t),o=r.getItem(n),a=He(t),l=r.getItem(a),c=rt(t),d=r.getItem(c);return{cloudControllerData:{value:s,key:i},staticConf:{value:o,key:n},naviInfo:{value:l,key:a},logReporter:{value:d?JSON.parse(d):{},key:c,stringify:!0}}}}var bI,LI,UI,PI,DI,xI,wI,GI,VI,kI;const FI=[Bi.chatMsg,Bi.ugMsg,Bi.recallMsg,Bi.ppMsgS,Bi.pgMsgS,Bi.ppMsgP,Bi.pgMsgP,Bi.pcMsgP,Bi.prMsgS,Bi.pbMsgP,Bi.chatMsgS];class BI extends $t{constructor(e){var t;super(),bI.add(this),Object.defineProperty(this,"_initOptions",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"navi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_connection",{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,"send",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"query",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sendOnly",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"connect",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"disconnect",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"appStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"userStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),LI.set(this,void 0),UI.set(this,void 0),PI.set(this,void 0),DI.set(this,void 0),xI.set(this,void 0),Object.defineProperty(this,"_robots",{enumerable:!0,configurable:!0,writable:!0,value:{robots:[],isSynced:!1}}),this.appStorage=new MI,this.appStorage.syncDataFromLocalStorage(this);const{appkey:s,loggerProxy:n,environment:o,useNaviV2:a,logOutputLevel:l,logExpireTime:c,areaCode:d,navigators:_,logServerUrl:u,miniCMPProxy:h}=e,E=n||wd(),g=this.logger=new md(e.appkey,"IMLib","IM",E);g.setOutputLevel(l),n||bd(s,this.logger,c),Lr.init({areaCode:d,navigators:_,logServerUrl:u,miniCMPProxy:h}),this.navi=new vI(s,this.logger,new NI(s,this.logger,this.appStorage),this.appStorage,o||"default",!!a);const I=this._connection=new AI(s,this.navi,this.logger,this.appStorage);this.send=this._connection.send.bind(this._connection),this.query=this._connection.query.bind(this._connection),this.sendOnly=this._connection.sendOnly.bind(this._connection),this.connect=this._connection.connect.bind(this._connection),this.disconnect=this._connection.disconnect.bind(this._connection),I.on("onConnected",r(this,bI,"m",wI),this),I.on("onDisconnected",r(this,bI,"m",VI),this),I.on("onSuspend",r(this,bI,"m",GI),this),I.on("signal",r(this,bI,"m",kI),this),I.pipe(this),i(this,UI,new kd(s,g,this.appStorage),"f"),i(this,PI,new Fd(s,g,this.appStorage),"f"),i(this,DI,new OI(s,g,r(this,UI,"f"),this.appStorage),"f"),t=this,[{set value(e){i(t,xI,e,"f")}}.value]=Lr.getCloudControllerUrl(),this.userStorage=new CI,i(this,LI,new pg(I,g),"f"),r(this,LI,"f").pipe(this),"browser"===io.tag&&r(this,DI,"f").request(r(this,xI,"f"),zr)}get isConnected(){return this._connection.isConnected}get connectionStatus(){return this._connection.getConnectionStatus()}get currentUserId(){return this._connection.getCurrentUserId()}get currentToken(){return this._connection.getToken()}get serverTime(){return this._connection.getCrtServerTime()}get delayTime(){return this._connection.getDelayTime()}get connectedTime(){return this._connection.getConnectedTime()}get ugEnabel(){return!(1&~(this.getNaviInfoFromCache().ugMsg||0))}get isDisableEmptyUGChannelId(){return!(2&~(this.getNaviInfoFromCache().ugDriven||0))}get includeUg(){return yI(this.getNaviInfoFromCache())}get isMemSesAttrs(){var e;return(8&((null===(e=this.getNaviInfoFromCache())||void 0===e?void 0:e.sessionCfg)||0))>0}get svrUnread(){return 1===this.getNaviInfoFromCache().serverSaveUnread}get logReporter(){return r(this,UI,"f")}get statisticReporter(){return r(this,PI,"f")}get appkey(){return this.initOptions.appkey}get initOptions(){return this._initOptions}getNaviInfoFromCache(){return this.navi.getNaviInfoFromCache(this.currentToken)}get robots(){return this._robots.robots.slice()}getAllRobots(e){return t(this,void 0,void 0,(function*(){let t=this._robots.robots.slice();if(!e&&this._robots.isSynced)return ir(t);const r=Ac.encode(ec,{ids:[]}),i=yield this._connection.query(Bi.qAppBot,this.currentUserId,r,tc);if(!i.isOk)return e&&this.emit("robotsSynced",i.code,[],[],[]),sr(i.code,i.msg,t);let s=Math.max(...t.map((e=>e.updateTime)));const n=[],o=i.data.bots.map((e=>{const t={robotId:e.id,name:e.name,portraitUri:e.portraitUrl,robotType:e.type||"",metadata:Object.fromEntries(e.metadata.map((e=>[e.key,e.value]))),createTime:e.createTime,updateTime:e.updateTime};return t.updateTime>s&&n.push(t),t})),a=t.filter((e=>!o.some((t=>t.robotId===e.robotId))));return this._robots.isSynced=!0,this._robots.robots=o,e&&this.emit("robotsSynced",i.code,o.slice(),n,a),ir(o.slice())}))}handleCloudControllerMessage(e){return t(this,void 0,void 0,(function*(){if(0===e.length)return;if(e.shift().senderUserId!==ke)return this.handleCloudControllerMessage(e);const t=this._connection.getToken(),i=(yield r(this,DI,"f").request(r(this,xI,"f"),$r,t))||0,s=e.filter((e=>e.sentTime>i));return this.handleCloudControllerMessage(s)}))}handleLogCmdMessages(e){e.forEach((e=>{if(e.senderUserId!==ke)return;const{startTime:t,endTime:i,platform:s,logId:n,uri:o}=e.content;r(this,UI,"f").report(parseInt(t,10),parseInt(i,10),s,o,n,e.messageUId)}))}handleNetworkChange(e,t){if(this._connection.setNetwork(e,t),e.status&&r(this,xI,"f")){const e=this._connection.getToken();r(this,DI,"f").request(r(this,xI,"f"),Zr,e)}}checkIfNeedRecordMessageUId(e,t){const i=r(this,DI,"f").getMRTRConfig();if(!i)return!1;const s=function(e){if(!e)return Math.floor(4294967296*Math.random());let t=0;if(0===e.length)return t;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return Math.abs(t)}(t);let n=0;switch(e){case exports.ConversationType.PRIVATE:n=i.private;break;case exports.ConversationType.GROUP:n=i.group;break;case exports.ConversationType.CHATROOM:n=i.chatroom;break;case exports.ConversationType.ULTRA_GROUP:n=i.ultraGroup}return!!n&&s%(1/n)==0}recordReceivedMessagesForStatistics(e){if(0===e.length)return;const{connectedTime:t}=this,r=e.filter((e=>e.sentTime>=t&&this.checkIfNeedRecordMessageUId(e.conversationType,e.messageUId))).map((e=>e.messageUId));if(0===r.length)return;const i=Date.now();this.logger.record(Ee.IM_MSG_RECEIVE,JSON.stringify({client_ts:i,server_deltatime:i-this.serverTime,msg_ids:r.join(",")}))}}var HI,jI,YI;LI=new WeakMap,UI=new WeakMap,PI=new WeakMap,DI=new WeakMap,xI=new WeakMap,bI=new WeakSet,wI=function(e,i){return t(this,void 0,void 0,(function*(){i||this.getAllRobots(!0);const e=yield r(this,LI,"f").noticeOnline();if(!e.isOk)return;if(i)r(this,LI,"f").startInterval(18e4,!0);else{const{syncTime:t,hasNext:i}=e.data;r(this,LI,"f").setInitVersion(t),r(this,LI,"f").startInterval(18e4,!!i)}const t=this.getNaviInfoFromCache();r(this,UI,"f").checkStart(t),r(this,PI,"f").checkStart(t)}))},GI=function(e,t){r(this,LI,"f").stopInterval()},VI=function(e){this._robots.isSynced=!1,this._robots.robots=[],r(this,LI,"f").reset(),r(this,UI,"f").stop(),r(this,PI,"f").stop()},kI=function(e,t,i){const{topic:s,syncMsg:o,targetId:a,date:l,pbData:c}=t,d=Hi(s),_=this.getNaviInfoFromCache();if(d)if(this.logger.debug(n.L_RECV_RMTP_O,s),o&&FI.includes(d)){e.stopPropagation();const{timestamp:r=this.serverTime,messageUId:s=""}=i||{},n=cd(t,this.currentUserId,r,s),o=_d(_,n,this.currentUserId,!1,t.targetId);this.emit("syncMsg",o,d)}else{if(d===Bi.s_ntf){e.stopPropagation();const r=Ac.decode(no,t.pbData),{type:i,chrmId:s,time:o}=r;return this.logger.info(n.L_RECV_S_NTF_O,`type: ${i}, chrmId: ${s}, time: ${o}`),void this.emit("sNtf",r)}if(d===Bi.s_cmd){e.stopPropagation();const i=Ac.decode(no,t.pbData),{type:s,chrmId:o,time:a}=i;if(this.logger.info(n.L_RECV_S_CMD_O,`type: ${s}, chrmId: ${o}, time: ${a}`),11===s)return void r(this,LI,"f").push(a);this.emit("sCmd",i)}if(d===Bi.s_msg){e.stopPropagation();const r=Ac.decode(_o,t.pbData),i=_d(_,r,this.currentUserId,!1);this.emit("sMsg",i)}}else{this.logger.warn(n.L_RECV_RMTP_E,`unknown topic: ${s}`),e.stopPropagation();const t={name:s,targetId:a,data:c,timestamp:l};this.emit("unknownSignal",t)}};const WI=(e,t,r)=>{let i=0;return e&&(i|=1),t&&(i|=2),r&&(i|=4),i},JI=(e,t,r)=>({chatroomId:e,key:t.key,value:t.value,timestamp:t.version,type:r?exports.ChatroomEntryType.DELETE:exports.ChatroomEntryType.UPDATE});class qI extends er{constructor(e,t,r){super("WebChatroomKVStore"),HI.add(this),Object.defineProperty(this,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_chatroomId",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:r}),jI.set(this,new Map),Object.defineProperty(this,"_emittedEntriesSynced",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_handleSyncData(e){return t(this,void 0,void 0,(function*(){const{logger:t}=this._ctx,i=t.createTraceId(),s=this._chatroomId,o={chatroomId:s,timestamp:e};t.info(n.L_PULL_CHATROOM_KV_T,JSON.stringify(o),i);const a=yield this._ctx.query(Bi.pullKV,s,DE(e),void 0);if(!a.isOk)return t.warn(n.L_PULL_CHATROOM_KV_R,JSON.stringify(Object.assign(Object.assign({},o),{code:a.code})),i),a.wipe();const{bFullUpdate:l,entries:c,syncTime:d}=xE(a.data.pbData);t.info(n.L_PULL_CHATROOM_KV_R,JSON.stringify(Object.assign(Object.assign({},o),{newVersion:d})),i);const _=new Map;return l&&(Array.from(r(this,jI,"f").values()).forEach((e=>{_.set(e.key,JI(s,e,!0))})),r(this,jI,"f").clear()),Array.from(c.values()).forEach((e=>{const{isDelete:t}={isAutoDelete:!!(1&(i=e.status)),isOverwrite:!!(2&i),isDelete:!!(4&i)};var i;const n=(e=>{const{key:t,value:r,timestamp:i,uid:s,version:n}=e;return{key:t,value:r,userId:s,version:n}})(e);t?r(this,jI,"f").delete(n.key):r(this,jI,"f").set(n.key,n),_.set(n.key,JI(s,n,t))})),this._emittedEntriesSynced||(this._emittedEntriesSynced=!0,this._emitter.emit("chatroom",{entriesSynced:s})),_.size>0&&this._emitter.emit("chatroom",{updatedEntries:Array.from(_.values())}),ir({version:d})}))}setEntry(e,i){return t(this,void 0,void 0,(function*(){const t=yield r(this,HI,"m",YI).call(this,e,i,!1);return t.isOk&&r(this,jI,"f").set(e.key,{key:e.key,value:e.value,userId:this._ctx.currentUserId,version:this._ctx.serverTime}),t}))}removeEntry(e,i){return t(this,void 0,void 0,(function*(){const t=yield r(this,HI,"m",YI).call(this,{key:e.key,value:"",isAutoDelete:!1,isSendNotification:e.isSendNotification,notificationExtra:e.notificationExtra},i,!0);return t.isOk&&r(this,jI,"f").delete(e.key),t}))}setEntries(e){return t(this,void 0,void 0,(function*(){const{serverTime:t}=this._ctx,i=e.entries.map((i=>{var s;const n=r(this,jI,"f").get(i.key);return{key:i.key,value:i.value,uid:this._ctx.currentUserId,version:null!==(s=null==n?void 0:n.version)&&void 0!==s?s:t,status:WI(!!e.isAutoDelete,e.isForce||!1,!1)}})),s=Ac.encode(Fo,{entry:i}),n=yield this._ctx.query(Bi.setKVS,this._chatroomId,s,Ho);if(!n.isOk&&n.code!==exports.ErrorCode.CHATROOM_KV_STORE_NOT_ALL_SUCCESS)return n.wipe();const{errorKeys:o,keysVersion:a}=n.data,l=new Map;return null==a||a.forEach((e=>{l.set(e.key,e.version)})),e.entries.forEach((e=>{const{key:t}=e,i=l.get(t);i&&r(this,jI,"f").set(t,{key:t,value:e.value,userId:this._ctx.currentUserId,version:i})})),n.wipe()}))}removeEntries(e){return t(this,void 0,void 0,(function*(){const t=WI(!1,!1,!0),{serverTime:i}=this._ctx,s=Ac.encode(Fo,{entry:e.keys.map((e=>{var s;const n=r(this,jI,"f").get(e);return{key:e,status:t,value:"",uid:this._ctx.currentUserId,version:null!==(s=null==n?void 0:n.version)&&void 0!==s?s:i}}))}),n=yield this._ctx.query(Bi.delKVS,this._chatroomId,s,Ho);if(!n.isOk&&n.code!==exports.ErrorCode.CHATROOM_KV_STORE_NOT_ALL_SUCCESS)return n.wipe();const{errorKeys:o}=n.data,a=new Set;return null==o||o.forEach((e=>a.add(e.key))),e.keys.forEach((e=>{a.has(e)||r(this,jI,"f").delete(e)})),n.wipe()}))}getEntry(e){if(!r(this,jI,"f").has(e))return null;return r(this,jI,"f").get(e).value}getAllEntries(){const e=Array.from(r(this,jI,"f").entries()).map((([e,t])=>[e,t.value]));return Object.fromEntries(e)}}var KI,QI,XI,zI,ZI,$I,ep,tp,rp,ip,sp,np,op,ap,lp,cp,dp,_p,up,hp,Ep,gp;jI=new WeakMap,HI=new WeakSet,YI=function(e,i,s){var n;return t(this,void 0,void 0,(function*(){const{serverTime:t}=this._ctx,o=r(this,jI,"f").get(e.key),a=WI(!!e.isAutoDelete,i,s),l={entry:{key:e.key,value:e.value,uid:this._ctx.currentUserId,version:null!==(n=null==o?void 0:o.version)&&void 0!==n?n:t,status:a}};e.isSendNotification&&(l.type=exports.ConversationType.CHATROOM,l.bNotify=!0,l.notification={sessionId:ud(Q.CHRM_KV_NOTIFY,!1,!1,!1),classname:Q.CHRM_KV_NOTIFY,content:JSON.stringify({key:e.key,value:e.value,extra:e.notificationExtra,type:s?exports.ChatroomEntryType.DELETE:exports.ChatroomEntryType.UPDATE})});const c=Ac.encode(ko,l);return(yield this._ctx.query(s?Bi.delKV:Bi.setKV,this._chatroomId,c)).wipe()}))};class Ip extends er{constructor(e,t,r,s){super("WebChatroomMessageReceiver"),Object.defineProperty(this,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_chatroomId",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:s}),KI.set(this,0),i(this,KI,r,"f")}_handleSyncData(e){return t(this,void 0,void 0,(function*(){const{logger:t}=this._ctx,i=t.createTraceId(),s={chatroomId:this._chatroomId,version:e};t.info(n.L_PULL_CHATROOM_MSG_T,JSON.stringify(s),i);const o=((e,t)=>Ac.encode(Ro,{syncTime:e,count:t,compressioEnabled:Ri.enable()}))(e,r(this,KI,"f")),a=yield this._ctx.query(Bi.chrmPull,this._chatroomId,o,void 0);if(t.summary(n.L_PULL_CHATROOM_MSG_R,a,i,s),!a.isOk)return a.wipe();const{currentUserId:l}=this._ctx,{list:c,syncTime:d}=CE(a.data.pbData);if(c.length>0){const e=c.map((e=>dd(e,l,!1,this._chatroomId)));this._emitter.emit("message",e,this._chatroomId)}return ir({version:d})}))}}KI=new WeakMap;class pp{constructor(e,t,r,s,n){QI.add(this),Object.defineProperty(this,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"roomId",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"initCount",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"extra",{enumerable:!0,configurable:!0,writable:!0,value:n}),XI.set(this,void 0),zI.set(this,void 0),i(this,XI,new Ip(this._ctx,this.roomId,r,s),"f"),i(this,zI,new qI(this._ctx,this.roomId,s),"f")}startInterval(){const e=18e4;r(this,XI,"f").setInitVersion(0),r(this,XI,"f").startInterval(e,!0),r(this,QI,"a",ZI)&&(r(this,zI,"f").setInitVersion(0),r(this,zI,"f").startInterval(e,!0))}restartInterval(){const e=18e4;this.stopInterval(),r(this,zI,"f").startInterval(e,!0),r(this,XI,"f").startInterval(e,!0)}stopInterval(){r(this,XI,"f").stopInterval(),r(this,zI,"f").stopInterval()}handleMessageNotify(e){r(this,XI,"f").push(e)}handleKVNotify(e){r(this,zI,"f").push(e)}setEntry(e,i){return t(this,void 0,void 0,(function*(){return r(this,zI,"f").setEntry(e,i)}))}setEntries(e){return t(this,void 0,void 0,(function*(){return r(this,zI,"f").setEntries(e)}))}removeEntry(e,i){return t(this,void 0,void 0,(function*(){return r(this,zI,"f").removeEntry(e,i)}))}removeEntries(e){return t(this,void 0,void 0,(function*(){return r(this,zI,"f").removeEntries(e)}))}getEntry(e){return r(this,zI,"f").getEntry(e)}getAllEntries(){return r(this,zI,"f").getAllEntries()}}XI=new WeakMap,zI=new WeakMap,QI=new WeakSet,ZI=function(){var e;return!!(null===(e=this._ctx.getNaviInfoFromCache())||void 0===e?void 0:e.kvStorage)};const Tp=e=>{const{joinTime:t,createTime:r,memberCount:i,chatroomBanState:s,whiteListState:n}=e;return{createTime:r,joinTime:t,memberCount:i,isAllChatroomBanned:!(1&~(s||0)),isCurrentUserBanned:!(2&~(s||0)),isCurrentChatroomBanned:!(4&~(s||0)),isCurrentChatroomInWhitelist:!(1&~(n||0))}};class Rp extends $t{constructor(e){super(),$I.add(this),Object.defineProperty(this,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:e}),ep.set(this,new Map),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),tp.set(this,void 0),Object.defineProperty(this,"setCheckChatRoomDuplicateMessage",{enumerable:!0,configurable:!0,writable:!0,value:mg}),this.logger=e.logger,i(this,tp,new $t,"f"),r(this,tp,"f").on("message",r(this,$I,"m",ip),this),r(this,tp,"f").on("chatroom",r(this,$I,"m",rp),this),this._ctx.on("onConnected",r(this,$I,"m",op),this),this._ctx.on("onDisconnected",r(this,$I,"m",sp),this),this._ctx.on("onSuspend",r(this,$I,"m",np),this),this._ctx.on("sNtf",r(this,$I,"m",lp),this),this._ctx.on("sCmd",r(this,$I,"m",cp),this),this._ctx.on("syncMsg",r(this,$I,"m",ap),this),this._ctx.on("sMsg",r(this,$I,"m",ap),this)}joinChatroom(e,i,s,n){return t(this,void 0,void 0,(function*(){const t=yield r(this,$I,"m",up).call(this,e,s,n);if(!t.isOk)return t.wipe();let o=r(this,ep,"f").get(e);return o||(o=new pp(this._ctx,e,i,r(this,tp,"f"),n),r(this,ep,"f").set(e,o),o.startInterval()),t.trans(Tp)}))}quitChatroom(e,i){return t(this,void 0,void 0,(function*(){if(!r(this,ep,"f").get(e))return ir();r(this,$I,"m",hp).call(this,e);const t=Ac.encode(po,{nothing:1,extra:i});return(yield this._ctx.query(Bi.exitChrm,e,t)).wipe()}))}getChatroomInfo(e,r,i){return t(this,void 0,void 0,(function*(){const t=Ac.encode(Oo,{count:r,order:i});return(yield this._ctx.query(Bi.queryChrmI,e,t,No)).trans((e=>{const{userTotalNums:t,userInfos:r}=e;return{userCount:t,userInfos:r.map((({id:e,time:t})=>({id:e,time:t})))}}))}))}setChatroomEntry(e,i,s){return t(this,void 0,void 0,(function*(){return r(this,$I,"m",Ep).call(this,e).next((e=>e.setEntry(i,s)))}))}setChatroomEntries(e,i){return t(this,void 0,void 0,(function*(){return r(this,$I,"m",Ep).call(this,e).next((e=>e.setEntries(i)))}))}removeChatroomEntry(e,i,s){return t(this,void 0,void 0,(function*(){return r(this,$I,"m",Ep).call(this,e).next((e=>e.removeEntry(i,s)))}))}removeChatroomEntries(e,i){return t(this,void 0,void 0,(function*(){return r(this,$I,"m",Ep).call(this,e).next((e=>e.removeEntries(i)))}))}getChatroomEntry(e,i){return t(this,void 0,void 0,(function*(){const t=r(this,ep,"f").get(e);if(t){const e=t.getEntry(i);return null===e?sr(exports.ErrorCode.CHATROOM_KEY_NOT_EXIST):ir(e)}return(yield r(this,$I,"m",gp).call(this,e)).tryTrans((e=>{const t=e[i];return void 0===t?sr(exports.ErrorCode.CHATROOM_KEY_NOT_EXIST):ir(t)}))}))}getAllChatroomEntries(e){return t(this,void 0,void 0,(function*(){const t=r(this,ep,"f").get(e);return t?ir(t.getAllEntries()):r(this,$I,"m",gp).call(this,e)}))}getChatroomHistoryMessages(e,r,i,s){return t(this,void 0,void 0,(function*(){const t=bE({targetId:e,time:r,count:i,order:s}),{currentUserId:n}=this._ctx,o=yield this._ctx.query(Bi.qryCHMsg,e,t);if(!o.isOk)return o.wipe();const a=LE(o.data.pbData);return ir({hasMore:!!a.hasMsg,list:a.list.map((t=>dd(t,n,!1,e)))})}))}bindRTCRoomForChatroom(e){return t(this,void 0,void 0,(function*(){const t=Ac.encode(Ca,{rtcRoomId:e.rtcRoomId});return(yield this._ctx.query(Bi.setRtcRoomId,e.chatRoomId,t)).wipe()}))}}var fp,Ap,mp,Sp;ep=new WeakMap,tp=new WeakMap,$I=new WeakSet,rp=function(e,t){e.stopPropagation(),this.emit("chatroom",t)},ip=function(e,t,i){e.stopPropagation(),this._ctx.recordReceivedMessagesForStatistics(t),r(this,$I,"m",dp).call(this,t,i,!1)},sp=function(){for(const e of r(this,ep,"f").values())e.stopInterval();r(this,ep,"f").clear()},np=function(){for(const e of r(this,ep,"f").values())e.stopInterval()},op=function(e,t){if(t)for(const e of r(this,ep,"f").values())r(this,$I,"m",_p).call(this,e)},ap=function(e,t){t.conversationType===exports.ConversationType.CHATROOM&&(e.stopPropagation(),r(this,$I,"m",dp).call(this,[t],t.targetId,!0))},lp=function(e,t){const{type:i,chrmId:s,time:n}=t;if(2!==i)return;e.stopPropagation();const o=r(this,ep,"f").get(s);o&&o.handleMessageNotify(n)},cp=function(e,t){const{type:i,chrmId:s,time:n,destroyType:o}=t;if(2!==i&&4!==i)return;e.stopPropagation();const a=r(this,ep,"f").get(s);return a?4===i?(r(this,ep,"f").delete(s),void this.emit("chatroom",{chatroomDestroyed:s,chatroomDestroyedType:o})):void a.handleKVNotify(n):void 0},dp=function(e,t,i){if(!(r(this,ep,"f").get(t)||i&&e[0].messageType===Q.CHATROOM_MERGE_BLOCK))return;const s=e.filter((e=>{var i;const{messageType:s}=e;if(s===Q.CHATROOM_MERGE_CHANGE){const t=function(e){const t={},r=[],i=e.content.memberCount||0;return Array.isArray(e.content.userList)&&e.content.userList.forEach((e=>{t[e.userId]=e.status,r.push({userId:e.userId,action:e.status,extra:e.extra})})),{users:t,chatroomId:e.targetId,memberCount:i,userList:r}}(e);return this.emit("chatroom",{userChange:t}),!1}if(s===Q.CHATROOM_MERGE_BAN){const t=function(e){const{chatroomId:t,operateType:r,durationTime:i,operateTime:s,userList:n,extra:o}=e.content;return{chatroomId:t,banType:r,durationTime:i,operateTime:s,userIdList:n,extra:o||""}}(e);return this.emit("chatroom",{chatroomNotifyBan:t}),!1}if(s===Q.CHATROOM_SYNC_MSG){const t=function(e){const{chatroomId:t,status:r,reason:i,time:s,extra:n}=e.content;return{chatroomId:t,status:r,reason:i,time:s,extra:n||""}}(e);return this.emit("chatroom",{chatroomNotifyMultiLoginSync:t}),!1}if(s===Q.CHATROOM_MERGE_BLOCK){const s=function(e){const{chatroomId:t,operateType:r,durationTime:i,operateTime:s,userList:n,extra:o}=e.content;return{chatroomId:t,operateType:r,durationTime:i,operateTime:s,userIdList:n,extra:o||""}}(e);return s.operateType===exports.ChrmMemOperateType.Blocked&&(null===(i=null==s?void 0:s.userIdList)||void 0===i?void 0:i.includes(this._ctx.currentUserId))&&r(this,$I,"m",hp).call(this,t),this.emit("chatroom",{chatroomNotifyBlock:s}),!1}return!0}));s.length>0&&this.emit("message",s,t)},_p=function(e){return t(this,void 0,void 0,(function*(){const{roomId:t,extra:i}=e,s=this.logger.createTraceId();this.logger.info(n.L_REJOIN_CHATROOM_T,JSON.stringify({chatroomId:t}),s);const o=yield r(this,$I,"m",up).call(this,t,!1,i);this.logger.summary(n.L_REJOIN_CHATROOM_R,o,s,{chatroomId:t});const{code:a,isOk:l,data:c}=o;if(!l)return a!==exports.ErrorCode.RC_CHATROOM_USER_KICKED&&a!==exports.ErrorCode.RC_CHATROOM_NOT_EXIST||r(this,ep,"f").delete(t),void this.emit("chatroom",{rejoinedRoom:{chatroomId:t,errorCode:a}});e.restartInterval();const d=Tp(c);this.emit("chatroom",{rejoinedRoom:Object.assign(Object.assign({chatroomId:t},d),{count:e.initCount})})}))},up=function(e,t,r){const i=Ac.encode(po,{extra:r,nothing:1}),s=t?Bi.joinChrm:Bi.joinChrmR;return this._ctx.query(s,e,i,To)},hp=function(e){const t=r(this,ep,"f").get(e);t&&(t.stopInterval(),r(this,ep,"f").delete(e))},Ep=function(e){const t=r(this,ep,"f").get(e);return t?ir(t):sr(exports.ErrorCode.NOT_IN_CHATROOM)},gp=function(e){return t(this,void 0,void 0,(function*(){const t=yield this._ctx.query(Bi.pullKV,e,DE(0),void 0);if(!t.isOk)return t.wipe();const{entries:r}=xE(t.data.pbData);return ir(r.reduce(((e,t)=>(e[t.key]=t.value,e)),{}))}))};class vp extends Kd{_syncDataHandler(e){const{localStorage:t}=io,{appkey:r,currentUserId:i}=e,s=ze(r,i),n=t.getItem(s)||"{}",{version:o,tags:a,transLan:l,autoTrans:c}=JSON.parse(n);return{value:{value:{version:o||0,tags:a||{},transLan:l||"zh",autoTrans:c||!1},key:s,stringify:!0}}}get version(){return this.get("value").version||0}get tags(){return this.get("value").tags||{}}forceUpdate(e){this.set("value",e)}addTag(e,t){const{tags:r,autoTrans:i,transLan:s}=this.get("value");r[e.tagId]={tagName:e.tagName,createdTime:t},this.set("value",{version:t,tags:r,autoTrans:i,transLan:s})}deleteTag(e,t){const{tags:r,autoTrans:i,transLan:s}=this.get("value");delete r[e],this.set("value",{version:t,tags:r,autoTrans:i,transLan:s})}}class Cp extends er{constructor(e){super("UserSettings"),fp.add(this),Object.defineProperty(this,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"storage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Ap.set(this,!1),this.storage=new vp,this._ctx.on("onConnected",this._handleConnected,this),this._ctx.on("onDisconnected",this._handleDisconnected,this),this._ctx.on("onSuspend",this._handleDisconnected,this),this._ctx.on("signal",this._handleSignal,this)}_handleConnected(){this.storage.syncDataFromLocalStorage(this._ctx),i(this,Ap,!0,"f");const{version:e}=this.storage;this.setInitVersion(e),this.push(e)}_handleDisconnected(){this.reset()}_handleSignal(e,t){if(Hi(t.topic)===Bi.s_us){const{version:r}=Ac.decode(ua,t.pbData);this.push(r),e.stopPropagation()}}_handleSyncData(e){return t(this,void 0,void 0,(function*(){const{currentUserId:t,logger:i}=this._ctx,s=this._ctx.getNaviInfoFromCache(),o=i.createTraceId();i.info(n.L_SYNC_USER_SETTINGS_T,`version: ${e}`,o);const a=Ac.encode(Jo,{version:e,ipType:s.ipType||0}),l=yield this._ctx.query(Bi.pullUS,t,a,qo);if(i.summary(n.L_SYNC_USER_SETTINGS_R,l,o),!l.isOk)return r(this,fp,"m",mp).call(this,l.code),l.wipe();const{version:c,items:d}=l.data;let _=!1,u=!1,h=!1,E="";const{transLan:g,autoTrans:I,tags:p}=this.storage.get("value"),T={version:c,transLan:g,autoTrans:I,tags:p};return null==d||d.forEach((e=>{const{key:t,value:r}=e;switch(t){case"Tag":T.tags={},e.tags.forEach((e=>{T.tags[e.tagId]={tagName:e.name,createdTime:e.createdTime}})),_=!0;break;case"transLan":h=!0,T.transLan=Zs.readUTF(new Uint8Array(r));break;case"autoTrans":u=!0,T.autoTrans="1"===Zs.readUTF(new Uint8Array(r));break;case"VoipInfo":E=Zs.readUTF(new Uint8Array(r))}})),this.storage.set("value",T),_&&this.emit("tagsChanged"),h&&this.emit("userSettingsChanged",{key:Or.TranslationLanguage,value:T.transLan}),u&&this.emit("userSettingsChanged",{key:Or.AutoTranslateEnable,value:T.autoTrans}),E&&this.emit("voipInfoChanged",E),r(this,fp,"m",mp).call(this,l.code),ir({version:c})}))}hasTag(e){return!!this.storage.tags[e]}getTags(){return this.storage.tags}createTag(e){return t(this,void 0,void 0,(function*(){const{version:t}=this.storage,{currentUserId:r}=this._ctx,i=Ac.encode(da,{version:t,tags:[{tagId:e.tagId,name:e.tagName}],ignoreVersion:!0}),s=yield this._ctx.query(Bi.addSeTag,r,i,Wo);if(s.isOk){const{version:r,updateVersion:i}=s.data;this.storage.addTag(e,i?r:t)}return s.wipe()}))}removeTag(e){return t(this,void 0,void 0,(function*(){const{version:t}=this.storage,{currentUserId:r}=this._ctx,i=Ac.encode(_a,{version:t,tags:[{tagId:e}],ignoreVersion:!0}),s=yield this._ctx.query(Bi.delSeTag,r,i,Wo);if(s.isOk){const{version:r,updateVersion:i}=s.data;this.storage.deleteTag(e,i?r:t)}return s.wipe()}))}setTranslationLanguage(e){return t(this,void 0,void 0,(function*(){return r(this,fp,"m",Sp).call(this,Bi.transLan,e)}))}getTranslationLanguage(){return t(this,void 0,void 0,(function*(){return ir(this.storage.get("value").transLan||"zh")}))}setAutoTranslateEnabled(e){return t(this,void 0,void 0,(function*(){return r(this,fp,"m",Sp).call(this,Bi.autoTrans,e?"1":"0")}))}getAutoTranslateEnabled(){return t(this,void 0,void 0,(function*(){return ir(this.storage.get("value").autoTrans)}))}}Ap=new WeakMap,fp=new WeakSet,mp=function(e){r(this,Ap,"f")&&(i(this,Ap,!1,"f"),this.emit("userSettingsSynced",e))},Sp=function(e,r){return t(this,void 0,void 0,(function*(){const{version:t}=this.storage,{currentUserId:i}=this._ctx,s=Ac.encode(Yo,{version:t,value:r,ignoreVersion:!0}),n=yield this._ctx.query(e,i,s,Wo);if(n.isOk){const{version:t,updateVersion:i}=n.data,{transLan:s,autoTrans:o,tags:a,version:l}=this.storage.get("value"),c={version:i?t:l,transLan:s,autoTrans:o,tags:a};switch(e){case Bi.transLan:c.transLan=r;break;case Bi.autoTrans:c.autoTrans="1"===r}this.storage.set("value",c)}return n.wipe()}))};const yp=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:Object.fromEntries(e.extProfile.map((e=>[e.key,e.value]))),addTime:e.relationTime,inBlackList:!!e.flag}},Op=e=>{var t,r;const{targetId:i,settingProfile:s,extProfile:n,baseInfo:o,userInfo:a}=e,l=Gt(s||[]),c=Gt(n||[]);return{groupId:i,groupName:l.name||"",portraitUri:l.portraitUrl||"",introduction:l.introduction||"",notice:l.announcement||"",extProfile:c,joinPermission:~~l.joinPerm,removeMemberPermission:~~l.removePerm,invitePermission:~~l.memInvitePerm,inviteHandlePermission:~~l.invitePerm,groupInfoEditPermission:~~l.profilePerm,memberInfoEditPermission:~~l.memProfilePerm,creatorId:(null==o?void 0:o.creatorId)||"",ownerId:(null==o?void 0:o.ownerId)||"",createTime:(null==o?void 0:o.createTime)||0,membersCount:(null==o?void 0:o.memberCount)||0,remark:null!==(t=null==a?void 0:a.remarkName)&&void 0!==t?t:"",joinedTime:(null==a?void 0:a.joinTime)||0,role:null!==(r=null==a?void 0:a.role)&&void 0!==r?r:exports.GroupMemberRole.UNDEF}};class Np{constructor(e){Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"searchFriendsInfo",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"searchGroupMembers",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"searchJoinedGroups",{enumerable:!0,configurable:!0,writable:!0,value:mg})}updateMyUserProfileVisibility(e){return t(this,void 0,void 0,(function*(){const t=Ac.encode(Ka,{permission:e});return(yield this.ctx.query(Bi.updProfilePermiss,this.ctx.currentUserId,t)).wipe()}))}getMyUserProfileVisibility(){return t(this,void 0,void 0,(function*(){const e=Ac.encode(qa,{nothing:1});return(yield this.ctx.query(Bi.qProfilePermiss,this.ctx.currentUserId,e,Ka)).trans((e=>e.permission))}))}searchUserProfileByUniqueId(e){return t(this,void 0,void 0,(function*(){const t=Ac.encode(Qa,{uniqueId:e}),r=yield this.ctx.query(Bi.searchUserProfile,this.ctx.currentUserId,t,ja);if(!r.isOk)return r.wipe();const{userId:i,userProfile:s,userExtProfile:n}=r.data,o=Nt(i,s,n);return ir(o)}))}createGroup(e,r,i,s){return t(this,void 0,void 0,(function*(){const t=AE(e,r,i,s),n=yield this.ctx.query(Bi.channelCreate,e,t,void 0);if(n.isOk||!n.data)return n.wipe();const o=Ac.decode(za,n.data.pbData),a={errorKeys:o.censorFailedFields,processCode:o.processCode||0};return sr(n.code,n.msg,a)}))}updateGroupInfo(e,r,i){return t(this,void 0,void 0,(function*(){const t=AE(e,r,i),s=yield this.ctx.query(Bi.upChannelInfo,e,t,void 0);if(s.isOk||!s.data)return s.wipe();const n=Ac.decode(za,s.data.pbData);return sr(s.code,s.msg,{errorKeys:n.censorFailedFields})}))}getGroupsInfo(e){return t(this,void 0,void 0,(function*(){const t=Ac.encode(Za,{type:exports.ConversationType.GROUP,list:e.map((e=>({targetId:e})))}),r=yield this.ctx.query(Bi.qChannelInfo,e[0],t,tl);if(!r.isOk)return r.wipe();const{list:i}=ME(r.data);return ir(i.map(Op))}))}kickGroupMembers(e,r,i){return t(this,void 0,void 0,(function*(){const t=FE({targetId:e,users:r,settingInfo:{isQuit:!0,isDelBan:i.removeMuteStatus,isDelAttention:i.removeFollow,isDelWhite:i.removeWhiteList}});return(yield this.ctx.query(Bi.channelMemKick,e,t)).wipe()}))}quitGroup(e,r){return t(this,void 0,void 0,(function*(){const t=FE({targetId:e,settingInfo:{isQuit:!0,isDelBan:r.removeMuteStatus,isDelAttention:r.removeFollow,isDelWhite:r.removeWhiteList}});return(yield this.ctx.query(Bi.channelMemQuit,e,t)).wipe()}))}dismissGroup(e){return t(this,void 0,void 0,(function*(){const t=FE({targetId:e});return(yield this.ctx.query(Bi.channelDismiss,e,t)).wipe()}))}transferGroupOwner(e,r,i,s){return t(this,void 0,void 0,(function*(){const t=FE({targetId:e,settingInfo:{isQuit:i,isDelBan:s.removeMuteStatus,isDelAttention:s.removeFollow,isDelWhite:s.removeWhiteList},users:[r]});return(yield this.ctx.query(Bi.channelTransfer,e,t)).wipe()}))}setGroupManagers(e,r,i){return t(this,void 0,void 0,(function*(){const t=Ac.encode($a,{targetId:r,type:exports.ConversationType.GROUP,users:i,operateType:e});return(yield this.ctx.query(Bi.upChannelManager,r,t)).wipe()}))}setGroupFollows(e,r,i){return t(this,void 0,void 0,(function*(){const t=Ac.encode($a,{targetId:r,type:exports.ConversationType.GROUP,users:i,operateType:e});return(yield this.ctx.query(Bi.upChannelFollow,r,t)).wipe()}))}getGroupFollows(e){return t(this,void 0,void 0,(function*(){const t=VE({targetId:e}),r=yield this.ctx.query(Bi.qChannelFollow,this.ctx.currentUserId,t,tl);if(!r.isOk)return r.wipe();const{list:i}=ME(r.data),s=i.map((e=>({userId:e.userId,time:e.opTime})));return ir(s)}))}setGroupRemark(e,r){return t(this,void 0,void 0,(function*(){const t=kE({targetId:e,operateType:r?exports.GroupOperationType.ADD:exports.GroupOperationType.REMOVE,channelNickName:r});return(yield this.ctx.query(Bi.upChannelRemark,e,t)).wipe()}))}addFriend(e,r,i){return t(this,void 0,void 0,(function*(){const t=Ac.encode(ll,{targetId:e,type:r,info:i});return(yield this.ctx.query(Bi.friendAdd,this.ctx.currentUserId,t,za)).trans((e=>({processCode:e.processCode||0})))}))}deleteFriends(e,r){return t(this,void 0,void 0,(function*(){const t=Ac.encode(cl,{targetId:e,type:r});return(yield this.ctx.query(Bi.friendDel,this.ctx.currentUserId,t)).wipe()}))}acceptFriendRequest(e){return t(this,void 0,void 0,(function*(){const t=Ac.encode(ll,{targetId:e,type:1});return(yield this.ctx.query(Bi.friendHandle,this.ctx.currentUserId,t)).wipe()}))}refuseFriendRequest(e,r){return t(this,void 0,void 0,(function*(){const t=Ac.encode(ll,{targetId:e,type:2,info:r});return(yield this.ctx.query(Bi.friendHandle,this.ctx.currentUserId,t)).wipe()}))}setFriendInfo(e,r,i){return t(this,void 0,void 0,(function*(){const t=Ac.encode(_l,{targetId:e,remarkName:r,extProfile:Object.entries(i).map((([e,t])=>({key:e,value:t})))}),s=yield this.ctx.query(Bi.friendSetPf,this.ctx.currentUserId,t,void 0);if(s.isOk||!s.data)return s.wipe();const n=Ac.decode(ul,s.data.pbData);return sr(s.code,"",{errorKeys:n.censorFailedFields})}))}checkFriends(e,r){return t(this,void 0,void 0,(function*(){const t=Ac.encode(cl,{targetId:e,type:r});return(yield this.ctx.query(Bi.friendCheck,this.ctx.currentUserId,t,dl)).trans((({list:e})=>e.map((e=>({userId:e.targetId,relationType:e.status})))))}))}getFriends(e,r){return t(this,void 0,void 0,(function*(){const t=Ac.encode(hl,{queryType:11,friendType:e,page:{size:r.count,order:r.order?0:1,pageToken:r.pageToken}}),i=yield this.ctx.query(Bi.friendsQuery,this.ctx.currentUserId,t,tl);if(!i.isOk)return i.wipe();const{pageToken:s,hasNext:n}=i.data.page,{list:o}=ME(i.data),a={pageToken:n&&s?s:"",data:o.map(yp)};return ir(a)}))}getFriendApplications(e,r,i){return t(this,void 0,void 0,(function*(){const t=Ac.encode(hl,{queryType:12,page:{size:e.count,pageToken:e.pageToken,order:e.order?0:1}}),r=yield this.ctx.query(Bi.friendsQuery,this.ctx.currentUserId,t,tl);if(!r.isOk)return r.wipe();const{pageToken:i,hasNext:s}=r.data.page,{list:n}=ME(r.data),o={pageToken:s&&i?i:"",data:n.map((e=>({userId:e.userId,name:e.name,portraitUri:e.portraitUrl,applicationType:e.type,applicationStatus:e.status,operationTime:e.operateTime,extra:e.info||""})))};return ir(o)}))}getFriendsInfo(e){return t(this,void 0,void 0,(function*(){const t=Ac.encode(El,{targetId:e});return(yield this.ctx.query(Bi.friendsInfoQry,this.ctx.currentUserId,t,Il)).trans((e=>e.list.map(yp)))}))}setFriendAddPermission(e){return t(this,void 0,void 0,(function*(){const t=Ac.encode(gl,{level:e});return(yield this.ctx.query(Bi.friendAuthSet,this.ctx.currentUserId,t)).wipe()}))}getFriendAddPermission(){return t(this,void 0,void 0,(function*(){const{currentUserId:e}=this.ctx,t=Ac.encode(ll,{targetId:e});return(yield this.ctx.query(Bi.friendAuthGet,e,t,gl)).trans((e=>e.level))}))}getGroupMembers(e,r){return t(this,void 0,void 0,(function*(){const t=VE({targetId:e,ids:r}),i=yield this.ctx.query(Bi.qChannelSpeMem,e,t,tl);if(!i.isOk)return i.wipe();const{list:s}=ME(i.data),n=s.map(xt);return ir(n)}))}setGroupMemberInfo(e,r,i,s){return t(this,void 0,void 0,(function*(){const t=kE({targetId:e,userId:r,channelNickName:i,additional:s}),n=yield this.ctx.query(Bi.upChannelMem,e,t,void 0);if(n.isOk||!n.data)return n.wipe();const o=Ac.decode(za,n.data.pbData);return sr(n.code,n.msg,{errorKeys:o.censorFailedFields})}))}getGroupMembersByRole(e,r,i){return t(this,void 0,void 0,(function*(){const t=VE({targetId:e,roleType:r,botType:i.filterRobotType,page:{size:i.count,order:i.order?0:1,pageToken:i.pageToken}}),s=yield this.ctx.query(Bi.qChannelMem,e,t,tl);if(!s.isOk)return s.wipe();const{pageToken:n,hasNext:o}=s.data.page,{list:a}=ME(s.data),l={pageToken:o&&n?n:"",data:a.map(xt)};return ir(l)}))}joinGroup(e){return t(this,void 0,void 0,(function*(){const t=Ac.encode(al,{targetId:e,type:exports.ConversationType.GROUP});return(yield this.ctx.query(Bi.channelMemJoin,e,t,za)).trans((e=>({processCode:e.processCode||0})))}))}inviteUsersToGroup(e,r){return t(this,void 0,void 0,(function*(){const t=Ac.encode(al,{targetId:e,type:exports.ConversationType.GROUP,userIds:r});return(yield this.ctx.query(Bi.channelMemInvite,e,t,za)).trans((e=>({processCode:e.processCode||0})))}))}memberInviteResponse(e){return t(this,void 0,void 0,(function*(){const{groupId:t,inviterId:r,optType:i,optResult:s,joinUserId:n,reason:o}=e,a=Ac.encode(ol,{targetId:t,type:exports.ConversationType.GROUP,optType:i,optResult:s,inviterId:r,joinUserId:n,detail:o});return(yield this.ctx.query(Bi.channelApplyResp,t,a,za)).trans((e=>({processCode:e.processCode||0})))}))}getGroupApplications(e,r,i){return t(this,void 0,void 0,(function*(){const t=VE({page:{size:e.count,pageToken:e.pageToken,order:e.order?0:1}}),r=yield this.ctx.query(Bi.qChannelApplyList,this.ctx.currentUserId,t,tl);if(!r.isOk)return r.wipe();const{pageToken:i,hasNext:s,list:n}=ME(r.data),o=n.map(wt);return ir({data:o,pageToken:s&&i?i:""})}))}getJoinedGroupsByRole(e,r){return t(this,void 0,void 0,(function*(){const t=VE({roleType:e,page:{size:r.count,pageToken:r.pageToken,order:r.order?1:0}}),i=yield this.ctx.query(Bi.qChannelMemJoin,this.ctx.currentUserId,t,tl);if(!i.isOk)return i.wipe();const{pageToken:s,hasNext:n}=i.data.page,{list:o}=ME(i.data),a=o.map(Op);return ir({data:a,pageToken:n&&s?s:""})}))}getJoinedGroups(e){return t(this,void 0,void 0,(function*(){const t=Ac.encode(el,{type:exports.ConversationType.GROUP,ids:e}),r=yield this.ctx.query(Bi.qChannelMemSpeJoin,this.ctx.currentUserId,t,tl);if(!r.isOk)return r.wipe();const{list:i}=ME(r.data),s=i.map(Op);return ir(s)}))}}const Mp={[C.GROUP_OPERATION]:e=>"ChannelEventData",[C.GROUP_PROFILE_CHANGE]:e=>"ChannelEventData",[u.FRIEND_APPLICATION]:e=>({0:"FriendApplyEvent",1:"FriendApplyEvent",2:"FriendUserInfo",3:"FriendsInput",5:"FriendTypeChangeEvent",6:"FriendUpdateEvent"}[e])};class bp{constructor(e){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:e})}decodeByPBName(e,t,r){let i=e;const s={}[t];try{i=e.length>0&&Ac.decode(t,e),pt(s)&&(i=s.call(this,i,r))}catch(e){this.logger.error(n.L_PB_DECODE_E,t)}return i}formatEventChangeList(e){return e.map((e=>{const{businessId:t,time:r,changeType:i,originalId:s,originalTime:n,secondaryId:o,isAdmin:a,additionalMark:l,operatorId:c,subChangeType:d,secondaryType:_,remindType:u,isRemindMe:h,extIds:E,eventData:g}=e;let I;return g&&(I=this._formatEventData(g,i,d)),{businessId:t,changeType:i,originalId:s,time:r,originalTime:n,secondaryId:o||"",isAdmin:a,additionalMark:l,operatorId:c,subChangeType:d,userGroupIds:E,secondaryType:_,remindType:u,isRemindMe:h,eventData:I}}))}_formatEventData(e,t,r){let i={};return e&&Mp[t]&&Mp[t](r)&&(i=Ac.decode(Mp[t](r),e)||{}),i}}var Lp,Up,Pp,Dp,xp,wp,Gp,Vp,kp,Fp,Bp;const Hp={[exports.ConversationType.PRIVATE]:Bi.qryPMsg,[exports.ConversationType.GROUP]:Bi.qryGMsg,[exports.ConversationType.CHATROOM]:Bi.qryCHMsg,[exports.ConversationType.CUSTOMER_SERVICE]:Bi.qryCMsg,[exports.ConversationType.SYSTEM]:Bi.qrySMsg,[exports.ConversationType.APP_PUBLIC_SERVICE]:Bi.qryMCMsg,[exports.ConversationType.PUBLIC_SERVICE]:Bi.qryMPMsg,[exports.ConversationType.ULTRA_GROUP]:Bi.qryUgMsg},jp=(e,t,r,i,s,n)=>{const{isCounted:o,isPersited:a,isStatusMessage:l}=_i(t.messageType),{conversationType:c,targetId:d,channelId:_}=e;return{conversationType:c,targetId:d,channelId:_||"",senderUserId:s,messageDirection:exports.MessageDirection.SEND,isCounted:o,isMentioned:!!t.isMentioned,content:t.content,messageType:t.messageType,isOffLineMessage:!1,isPersited:a,messageUId:r,sentTime:i,receivedTime:0,disableNotification:!!t.disableNotification,isStatusMessage:!!l,canIncludeExpansion:!!t.canIncludeExpansion,expansion:t.canIncludeExpansion?t.expansion:null,receivedStatus:exports.ReceivedStatus.UNREAD,receivedStatusInfo:yt(exports.ReceivedStatus.UNREAD),pushConfig:t.pushConfig,isInterrupt:t.isInterrupt,messageId:n||0,sentStatus:exports.SentStatus.SENT,directedUserIds:t.directionalUserIdList,disableUpdateLastMessage:t.disableUpdateLastMessage,needReceipt:t.needReceipt}},Yp=[C.GROUP_OPERATION,C.GROUP_PROFILE_CHANGE,C.GROUP_APPLICATION_INVITATION,C.GROUP_FOLLOW_USER_CHANGE],Wp=[u.FRIEND_APPLICATION];class Jp{constructor(e,t){Lp.add(this),Object.defineProperty(this,"_watcher",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_initOptions",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userSettings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subscribeManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_openCallPlus",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_chat",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_chatroom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dataHosting",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_codec",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_signalHandlerMap",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"_latestPullKVMsgTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_handleInnerMsgOptions",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>{const{messageType:r}=t;return r===Q.SYNC_READ_STATUS&&(t.directionalUserIdList=Qt(e.conversationType,[this.currentUserId])),r===Q.READ_RECEIPT_RESPONSE&&(t.content.receiptMessageDic&&0!==Object.keys(t.content.receiptMessageDic).length||(t.content=this._chat.storage.createReadReceiptResponseContent(e)),t.directionalUserIdList=Object.keys(t.content.receiptMessageDic)),t}}),Object.defineProperty(this,"getOSInfo",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"getProcessInfo",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"getMainProcessInfo",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"setProxy",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"getProxy",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"testProxy",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"setUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"getUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"addToBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"removeFromBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"getBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"getBlacklistStatus",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"insertMessage",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"batchInsertMessage",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"getLocalMessageCount",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"deleteLocalMessages",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"deleteLocalMessagesByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"batchClearLocalMessagesByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"clearLocalMessages",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"getMessage",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"setMessageContent",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"setMessageSearchField",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"searchConversationByContentWithAllChannel",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"searchMessagesWithParams",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"setMessageSentStatus",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"updateMessageReceiptStatus",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"setMessageReceivedStatus",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"clearLocalData",{enumerable:!0,configurable:!0,writable:!0,value:mg}),Object.defineProperty(this,"setCheckDuplicateMessage",{enumerable:!0,configurable:!0,writable:!0,value:mg});const i=this._ctx=new BI(t),{logger:s}=i;this._codec=new bp(s),this._userSettings=new Cp(i),this._chat=new TI(i,this._userSettings,this),this._chatroom=new Rp(i),this._dataHosting=new Np(i),this._chat.on("messages",this._handleChatMessages,this),this._chat.on("offlineFinished",(()=>this._watcher.pullFinished()),this),this._chat.on("syncReadStatusV4",this._handleSyncReadStatusV4,this),this._chat.on("expansions",this._handleExpansions,this),this._chat.on("readReceiptV4",this._handleReadReceiptV4,this),this._chat.on("conversationStatusChanged",this._conversationStatusChanged,this),this._chat.on("conversationStatusSynced",((e,t)=>this._watcher.conversationStatusSynced(t)),this),this._chat.on("sgRelationsSynced",((e,t)=>this._watcher.sgRelationsSynced(t)),this),this._chat.on("ultraGroupEnable",(()=>this._watcher.ultraGroupEnable()),this),this._chat.on("syncServerSaveUnreadCompleted",(()=>this._watcher.syncServerSaveUnreadCompleted()),this),this._chatroom.on("message",this._handleChatroomMessages,this),this._chatroom.on("chatroom",this._handlerChatroomEvent,this),i.on("sCmd",this._handleSCmdNotify,this),i.on("signal",this._handleSignal,this),i.on("onConnected",this.onConnected,this),i.on("onDisconnected",this.onDisconnected,this),i.on("onConnecting",this.onConnecting,this),i.on("onSuspend",this.onSuspend,this),i.on("messagesFromUG",this._handleMessagesFromUltraGroup,this),i.on("serverEvent",r(this,Lp,"m",kp),this),i.on("readReceiptResponseV5",r(this,Lp,"m",Pp),this),i.on("speechToTextResponse",r(this,Lp,"m",Dp),this),i.on("ugUserGroupChanged",this._handleUserGroupStatus,this),i.on("ugChannelChanged",this._handleUltraChannelChange,this),i.on("messageModified",r(this,Lp,"m",xp),this),i.on("messageModifiedSyncCompleted",r(this,Lp,"m",wp),this),i.on("ugMsgExpansionUpdated",r(this,Lp,"m",Gp),this),i.on("ugMsgRecalled",r(this,Lp,"m",Vp),this),i.on("robotsSynced",r(this,Lp,"m",Up),this),i.on("messageReaction",((e,t)=>this._watcher.messageReaction(t))),i.on("unknownSignal",((e,t)=>this._handleUnknownSignal(t)),this),this._userSettings.on("voipInfoChanged",this._naviChangeHandler,this),this._userSettings.on("tagsChanged",(()=>this._watcher.tag()),this),this._userSettings.on("userSettingsSynced",((e,t)=>this._watcher.userSettingsSynced(t)),this),this._userSettings.on("userSettingsChanged",((e,t)=>this._watcher.userSettingsChanged(t)),this)}get appkey(){return this._initOptions.appkey}get chat(){return this._chat}get chatroom(){return this._chatroom}get userSettings(){return this._userSettings}get dataHosting(){return this._dataHosting}get usingCppEngine(){return!1}get logger(){return this._ctx.logger}registerCustomSignalHandler(e,t){"function"==typeof t&&e.forEach((e=>{const r=this._signalHandlerMap.get(e)||new Set;r.add(t),this._signalHandlerMap.set(e,r)}))}_handleUnknownSignal(e){const{name:t}=e,r=this._signalHandlerMap.get(t);r&&Array.from(r).forEach((r=>{try{r(e)}catch(e){console.error(`execute custom signal('${t}') handler err.`,e)}}))}onConnected(e,t){const r=this._ctx.getNaviInfoFromCache();this._initSubscribeManager(r),this._openCallPlus&&this._syncCallPullKVMsg(),this._watcher.onConnected(t)}onDisconnected(e,t){this._resetMemoryState(),this._watcher.onDisconnected(t)}onSuspend(e,t){this._watcher.onSuspend(t)}onConnecting(e){this._watcher.onConnecting()}_handleSyncReadStatusV4(e,t){t.forEach((e=>this._watcher.syncReadStatus(e)))}_handleReadReceiptV4(e,t){t.forEach((e=>this._watcher.messageReadReceipt(e)))}_handleExpansions(e,t){t.forEach((e=>this._watcher.expansion(e)))}_conversationStatusChanged(e,t){const r=t.some((e=>{var t;return void 0!==(null===(t=e.updatedItems)||void 0===t?void 0:t.tags)}));this._watcher.conversation(t),r&&this._watcher.conversationTag()}_initSubscribeManager(e){(e.subDriven||e.userProfile)&&(this._subscribeManager||(this._subscribeManager=new fd(this._ctx,{syncSubscribeUserStatusFinished:e=>{var t,r;null===(r=(t=this._watcher).syncSubscribedUserStatusFinished)||void 0===r||r.call(t,e)},subscribeUserStatusChanged:e=>{var t,r;null===(r=(t=this._watcher).subscribedUserStatusChange)||void 0===r||r.call(t,e)},subscribeRelationChanged:e=>{var t,r;null===(r=(t=this._watcher).subscribedRelationChange)||void 0===r||r.call(t,e)},ownUserProfileChanged:e=>{var t,r;null===(r=(t=this._watcher).ownUserProfileChanged)||void 0===r||r.call(t,e)}},this.currentUserId,this._ctx.delayTime,this.logger,!!e.userProfile,e.subDriven||0)),this._subscribeManager.syncData())}createLogger(e,t){return new md(this.appkey,e,t,this.logger.proxy)}refetchNaviInfo(){return this._ctx.navi.request(this._ctx.currentToken,!0,!0,this.logger.createTraceId())}get naviInfo(){return this._ctx.getNaviInfoFromCache()}get connectedTime(){return this._ctx.connectedTime}get connectionStatus(){return this._ctx.connectionStatus}connect(e,r,i,s){return t(this,void 0,void 0,(function*(){return this._openCallPlus=i,this._ctx.connect(e,r,i,s)}))}_handleMessagesFromUltraGroup(e,t,r){const i=new Map,s=[];t.forEach((e=>{var t,r,n;const{targetId:o,content:a,messageUId:l,channelId:c,isMentioned:d,isCounted:_,senderUserId:u,messageType:h,sentTime:E,channelType:g,isPersited:I}=e,p={conversationType:exports.ConversationType.ULTRA_GROUP,targetId:o,channelId:c||""},T=this._chat.storage.getOrCreateModel(p,!0),R=i.get(T)||{params:{channelType:g},time:E};i.set(T,R),R.time=E;const{params:f}=R;if(I&&(f.hidden=!1,f.latestMessage=e,f.operationTime=E),_&&u!==this.currentUserId&&h!==Q.RECALL_NOTIFICATION_MESSAGE){f.unreadCount=(f.unreadCount||T.unreadCount)+1;const e=(null===(t=null==a?void 0:a.mentionedInfo)||void 0===t?void 0:t.type)===exports.MentionedType.ALL;d&&(e||(null===(n=null===(r=null==a?void 0:a.mentionedInfo)||void 0===r?void 0:r.userIdList)||void 0===n?void 0:n.includes(this.currentUserId)))&&(f.unreadMentionedCount=(f.unreadMentionedCount||T.unreadMentionedCount)+1,e||(f.unreadMentionedMeCount=(f.unreadMentionedMeCount||T.unreadMentionedMeCount)+1),f.hasMentioned=!0,f.mentionedInfo=null==a?void 0:a.mentionedInfo),T.firstUnreadMessage||f.firstUnreadMessageUId||(f.firstUnreadMessageType=h,f.firstUnreadMessageUId=l,f.firstUnreadTime=E)}s.push(e)}));const n=[],o=[];Array.from(i.entries()).forEach((([e,{params:t,time:r}])=>{n.push(e);const i=e.updateAttrs(t,r);i&&o.push({conversation:e.toIReceivedConversation(),updatedItems:i})})),this._chat.storage.updateConversationStorage(n),o.length>0&&this._watcher.conversation(o),this._batchMessage(s)}_handleChatroomMessages(e,t,r){this._watcher.batchMessage(t)}_handlerChatroomEvent(e,t){this._watcher.chatroom(t)}_handleChatMessages(e,t,r,i){this._watcher.batchMessage(r)}_handleSignal(e,t,r){var i;const{syncMsg:s,topic:n}=t;if(s)return void this._receiveSyncMsg(t,r);switch(Hi(n)){case Bi.rtc_ntf:this._watcher.onRTCDataChange(t.pbData);break;case Bi.s_opNtf:this._pullOperateStatusNotify(t);break;case Bi.s_pubCall:this._pubCallInfo(t);break;case Bi.s_stat:null===(i=this._subscribeManager)||void 0===i||i.updateUserStatus(t)}}_handleSCmdNotify(e,t){var r,i,s;const{time:n,type:o}=t;switch(o){case 8:null===(r=this._subscribeManager)||void 0===r||r.startsyncSubscribeUserStatus(n);break;case 9:null===(i=this._subscribeManager)||void 0===i||i.startSyncSubscribeRelationship(n);break;case 10:null===(s=this._subscribeManager)||void 0===s||s.syncOwnProfile(!0)}}_receiveMessageExpansion(e){const{content:t,channelId:r="",conversationType:i,targetId:s}=e,{put:n,del:o,mid:a}=t;n&&this._watcher.expansion({updatedExpansion:{messageUId:a,expansion:n,channelId:r,conversationType:i,targetId:s}}),o&&this._watcher.expansion({deletedExpansion:{messageUId:a,deletedKeys:o,channelId:r,conversationType:i,targetId:s}})}_clearConversationUnreadCount(e,t,r,i,s){const n=this._chat.storage.clearConversationUnreadCount({conversationType:e,targetId:t,channelId:r},s);i&&n&&this._watcher.conversation([n])}_updateSGModelCacheAfterSent(e){const{conversationType:t,isPersited:r,targetId:i,channelId:s,sentTime:n,disableUpdateLastMessage:o,messageType:a,messageUId:l,content:c}=e;if(!W(t,w))return;const d=this.naviInfo,_={conversationType:t,targetId:i,channelId:s},u=this._chat.storage.getOrCreateModel(_,!0),h={},E=a===Q.RECALL;if(r){E&&!u.hidden||(h.operationTime=n),h.hidden=!1;const t=E?c.sentTime:n;o||u.latestMessage&&!(u.latestMessage.sentTime<=t)||(h.latestMessage=d.supportRecallRefactor&&E?gd(e,!0):e)}if(this._ctx.includeUg&&a===Q.EXPANSION_NOTIFY&&u.latestMessage&&u.latestMessage.messageUId===l){const{put:e,del:t,clear:r}=c;r?u.latestMessage.expansion={}:e?u.latestMessage.expansion=Object.assign(Object.assign({},u.latestMessage.expansion),e):t&&u.latestMessage.expansion&&t.forEach((e=>{delete u.latestMessage.expansion[e]}))}const g=u.updateAttrs(h,e.sentTime);this._chat.storage.updateConversationStorage([u]),g&&this._watcher.conversation([{conversation:u.toIReceivedConversation(),updatedItems:g}])}_receiveSyncMsg(e,t){var r;switch(Hi(e.topic)){case Bi.updRTime:this._receivesyncReadStatus(e);break;case Bi.updUserSub:null===(r=this._subscribeManager)||void 0===r||r.startSyncSubscribeRelationship(t.timestamp)}}_batchMessage(e){this._watcher.batchMessage(e)}_pubCallInfo(e){const{key:t,dataContent:r,maxTime:i}=Ac.decode(Oa,e.pbData);this._latestPullKVMsgTimestamp=i,this._watcher.callInfo(JSON.stringify({list:[{key:t,value:r}]}))}_receivesyncReadStatus(e){const t=Ac.decode(Po,e.pbData),{type:r,channelId:i,msgTime:s,busChannel:n}=t;this._clearConversationUnreadCount(r,i,n||"",!0,s),this._watcher.syncReadStatus({conversationType:r,targetId:i,channelId:n,timestamp:s})}_syncCallPullKVMsg(){return t(this,void 0,void 0,(function*(){if(!this._ctx.isConnected)return;const e=Ac.encode(Na,{syncTime:this._latestPullKVMsgTimestamp}),{isOk:t,data:r}=yield this._ctx.query(Bi.pullKvMsg,this.currentUserId,e,Ma);t&&r&&(this._latestPullKVMsgTimestamp=r.maxTime,this._watcher.callInfo(JSON.stringify({list:r.info})))}))}getHistoryMessage(e,r,i){return t(this,void 0,void 0,(function*(){const{conversationType:t,targetId:i,channelId:s}=e,{timestamp:n,count:o,order:a}=r,l=Hp[t],{currentUserId:c}=this,d=bE({targetId:i,busChannel:s,time:n||(1===a?1:this._ctx.serverTime+6e4),count:o,order:a}),_=t===exports.ConversationType.CHATROOM?i:c,u=yield this._ctx.query(l,_,d,void 0);if(!u.isOk)return u.wipe();const h=LE(u.data.pbData),E=h.list.map((e=>{const t=dd(e,c,!1,i);if(t.messageDirection===exports.MessageDirection.SEND){const e=this._chat.storage.getReadReceiptResponseUsers(t,t.messageUId);t.readReceiptInfo={isReceiptRequestMessage:!0,readerList:e}}return t}));return ir({hasMore:!!h.hasMsg,list:0===a?E.reverse():E})}))}reportSDKInfo(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId(),r=JSON.stringify(e);this.logger.info(n.L_VER_REPORT_T,r,t);const i=Ac.encode(ha,{sdkInfo:r}),s=yield this._ctx.query(Bi.reportsdk,this._ctx.currentUserId,i);this.logger.summary(n.L_VER_REPORT_R,s,t)}))}saveTextMessageDraft(e,r){return t(this,void 0,void 0,(function*(){return this._chat.storage.setDrafts(e,r),ir()}))}getTextMessageDraft(e){return t(this,void 0,void 0,(function*(){const t=this._chat.storage.getDrafts(e);return ir(t)}))}clearTextMessageDraft(e){return t(this,void 0,void 0,(function*(){return this._chat.storage.deleteDrafts(e),ir()}))}sendMessage(e,r,i,s){return t(this,void 0,void 0,(function*(){const{conversationType:t,targetId:i}=e;r=this._handleInnerMsgOptions(e,r);let n=!1;[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP].includes(t)&&(r.isStatusMessage||_i(r.messageType).isStatusMessage)&&(n=!0);const o=n?(a=t,{[exports.ConversationType.PRIVATE]:Bi.ppMsgS,[exports.ConversationType.GROUP]:Bi.pgMsgS}[a]):(e=>({[exports.ConversationType.PRIVATE]:Bi.ppMsgP,[exports.ConversationType.GROUP]:Bi.pgMsgP,[exports.ConversationType.CHATROOM]:Bi.chatMsg,[exports.ConversationType.CUSTOMER_SERVICE]:Bi.pcMsgP,[exports.ConversationType.RTC_ROOM]:Bi.prMsgS,[exports.ConversationType.SYSTEM]:Bi.pbMsgP}[e]))(t)||Bi.ppMsgP;var a;r.messageId||(r.messageId=Yt());const{messageId:l}=r,c=GE(e,r),d=new gn(Bi[o],c,t===exports.ConversationType.SYSTEM?this.currentUserId:i);if(d.setHeaderQos(Wi),n)return this._ctx.sendOnly(d),ir(jp(e,Object.assign(Object.assign({},r),{isStatusMessage:n}),"",0,this.currentUserId,l));const _=this._ctx.serverTime,u=jp(e,Object.assign(Object.assign({},r),{isStatusMessage:n}),"",_,this.currentUserId,l);null==s||s(l);const h=Date.now(),{code:E,isOk:g,msg:I,data:p}=yield this._ctx.send(d);if(!g)return this._ctx.checkIfNeedRecordMessageUId(t)&&this.logger.record(Ee.IM_MSG_SEND,JSON.stringify({channel:t,start_ts:h,client_ts:Date.now(),server_deltatime:Date.now()-this._ctx.serverTime,cod:E})),u.sentStatus=exports.SentStatus.FAILED,sr(E,I,u);const{timestamp:T,messageUId:R}=p;return u.sentTime=T,u.messageUId=R,this._sendMessageSuccessHandle(u),this._ctx.checkIfNeedRecordMessageUId(t,R)&&this.logger.record(Ee.IM_MSG_SEND,JSON.stringify({msg_id:R,channel:t,start_ts:h,client_ts:Date.now(),server_deltatime:Date.now()-this._ctx.serverTime,cod:E})),ir(u)}))}_sendMessageSuccessHandle(e){e.conversationType!==exports.ConversationType.CHATROOM&&this._chat.storage.addSentRecord(e.messageUId,e.sentTime),this._updateSGModelCacheAfterSent(e);const{messageType:t}=e;t===Q.READ_RECEIPT_REQUEST&&this._chat.storage.addReadReceiptRequest(e,this.currentUserId),t===Q.READ_RECEIPT_RESPONSE&&this._chat.storage.handleReadReceiptResponse(e,this.currentUserId)}recallMsg(e,r){return t(this,void 0,void 0,(function*(){const{targetId:t,conversationType:i}=e,s=e.channelId||"",{user:n,extra:o,isDelete:a,directionalUserIdList:l,disableUpdateLastMessage:c,messageUId:d,sentTime:_,disableNotification:u,pushConfig:h,pushContent:E,isAdmin:g}=r,I={conversationType:i,targetId:t,messageUId:d,sentTime:_,channelId:s,isDelete:!!a,isAdmin:!!g};n&&(I.user=n),o&&(I.extra=o);const p={content:I,messageType:Q.RECALL,disableNotification:u,pushConfig:h,pushContent:(null==h?void 0:h.pushContent)||E,disableUpdateLastMessage:c,directionalUserIdList:Qt(i,l)},T=GE(e,p),R=new gn(Bi.recallMsg,T,this.currentUserId);R.setHeaderQos(Wi);const f=yield this._ctx.send(R);if(!f.isOk)return f.wipe();const A=f.data;i!==exports.ConversationType.ULTRA_GROUP&&(A.messageUId=`Cmd:${d}`);const m=jp(e,p,A.messageUId,A.timestamp,this.currentUserId);return i===exports.ConversationType.ULTRA_GROUP?(this._chat.storage.addUGSentRecord(A.messageUId,A.timestamp),this._updateUltraGroupWhenRecallMsg(m)):(this._chat.storage.addSentRecord(A.messageUId,A.timestamp),this._updateSGModelCacheAfterSent(m)),ir(m)}))}_naviChangeHandler(e,t){this._ctx.navi.updateVoipCallInfo(this._ctx.currentToken,t);const r=this._ctx.getNaviInfoFromCache();this._watcher.onNaviDataChange(Object.assign({},r))}getFileToken(e,r,i,s,n,o){return t(this,void 0,void 0,(function*(){let t;t=s&&"uploads"!==s?r||"":kt(e,r);const a=this.naviInfo,l=Kt(a,this.logger);let c="";l||(c=JSON.stringify({uploadDomain:l}));const d=Ac.encode(ho,{type:e,key:t,httpMethod:i||"",queryString:s||"",url:n||"",ext:c,size:o?Math.ceil(o):0,ipType:a.ipType||0});return(yield this._ctx.query(Bi.qnTkn,this.currentUserId,d,go)).trans((e=>Object.assign(Object.assign({},e),{fileName:t,downloadAuthInfo:e.downloadAuthInfo?JSON.parse(e.downloadAuthInfo):null})))}))}getFileUrl(e,r,i,s){return t(this,void 0,void 0,(function*(){const t=this.naviInfo;let n,o="",a="";r===exports.UploadMethod.QINIU?n=Bi.qnUrl:r===exports.UploadMethod.AWS?n=Bi.s3Url:r===exports.UploadMethod.STC?n=Bi.stcUrl:r===exports.UploadMethod.MINIO?(n=Bi.minioUrl,o=Kt(t,this.logger),a=JSON.stringify({url:o})):n=Bi.aliUrl;const l=Ac.encode(Eo,{type:e,key:i,fileName:s,ext:a,size:-1,ipType:t.ipType||0});return(yield this._ctx.query(n,this.currentUserId,l,Io)).trans((({downloadUrl:e})=>({downloadUrl:e})))}))}disconnect(e,r){return t(this,void 0,void 0,(function*(){return yield this._ctx.disconnect(e,r),this._resetMemoryState(),ir()}))}_resetMemoryState(){this._subscribeManager&&delete this._subscribeManager}registerMessageType(e,t){}get serverTime(){return this._ctx.serverTime}get userId(){return this._ctx.currentUserId}get currentUserId(){return this._ctx.currentUserId}createTag(e){return t(this,void 0,void 0,(function*(){return this._userSettings.hasTag(e.tagId)?sr(exports.ErrorCode.TAG_EXISTS):this._userSettings.createTag(e)}))}removeTag(e){return t(this,void 0,void 0,(function*(){return this._userSettings.hasTag(e)?this._userSettings.removeTag(e):sr(exports.ErrorCode.TAG_NOT_EXIST)}))}updateTag(e){return t(this,void 0,void 0,(function*(){return this._userSettings.hasTag(e.tagId)?this._userSettings.createTag(e):sr(exports.ErrorCode.TAG_NOT_EXIST)}))}getTagList(){var e;return t(this,void 0,void 0,(function*(){const t=this._userSettings.getTags(),r=this._chat.storage.getTagConversationCountMap(),i=[];for(const s in t)i.push({tagId:s,tagName:t[s].tagName,createdTime:t[s].createdTime,conversationCount:(null===(e=r.get(s))||void 0===e?void 0:e.length)||0});return ir(i)}))}sendUltraMessage(e,r,i,s){return t(this,void 0,void 0,(function*(){const{targetId:t}=e;r.messageId||(r.messageId=Yt());const{messageId:i}=r,n=GE(e,r),o=new gn(Bi.ugMsg,n,t);o.setHeaderQos(Wi);const a=this._ctx.serverTime,l=jp(e,Object.assign({},r),"",a,this.currentUserId,i);s&&s(i);const c=Date.now(),{code:d,data:_}=yield this._ctx.send(o);if(d!==exports.ErrorCode.SUCCESS)return this._ctx.checkIfNeedRecordMessageUId(exports.ConversationType.ULTRA_GROUP)&&this.logger.record(Ee.IM_MSG_SEND,JSON.stringify({channel:exports.ConversationType.ULTRA_GROUP,start_ts:c,client_ts:Date.now(),server_deltatime:Date.now()-this._ctx.serverTime,cod:d})),l.sentStatus=exports.SentStatus.FAILED,sr(d,void 0,l);const{timestamp:u,messageUId:h}=_;l.sentTime=u,l.messageUId=h,this._ctx.checkIfNeedRecordMessageUId(exports.ConversationType.ULTRA_GROUP,h)&&this.logger.record(Ee.IM_MSG_SEND,JSON.stringify({msg_id:h,channel:exports.ConversationType.ULTRA_GROUP,start_ts:c,client_ts:Date.now(),server_deltatime:Date.now()-this._ctx.serverTime,cod:d})),this._chat.storage.addUGSentRecord(h,u);const E=this._chat.storage.getOrCreateModel(e,!0),g=E.updateAttrs({operationTime:u,latestMessage:Object.assign({},l)},u);return g&&this._watcher.conversation([{conversation:E.toIReceivedConversation(),updatedItems:g}]),ir(l)}))}_pullOperateStatusNotify(e){if(!this._ctx.isConnected)return;const t=(e=>{const{type:t,notifyType:r,info:i,summary:s}=e,n=[],o=[],a=!(2&~r),l=!(1&~r);return l&&Array.isArray(i)&&i.forEach((e=>{const{targetId:t,busChannel:r,userId:i,opType:s,optime:o}=e;n.push({targetId:t,channelId:r,userId:i,operationType:s,operationTime:o})})),a&&Array.isArray(s)&&s.forEach((e=>{const{targetId:t,busChannel:r,count:i,opType:s}=e;o.push({targetId:t,channelId:r,count:i,operationType:s})})),{conversationType:t,info:n,summary:o,hasInfo:l,hasSummary:a}})(Ac.decode(va,e.pbData));this._watcher.operateStatus(t)}_handleConvertEvent(e){var t,r;const i=[];e.filter((e=>0===e.subChangeType)).forEach((e=>{const{results:t}=Ac.decode(Ml,new Uint8Array(e.eventData));i.push(...t.map((e=>({identifier:e.messageUID,from:e.inputSource,code:e.code,translateInfo:{targetLanguage:e.targetLan,translatedText:e.transResult||"",status:e.code===exports.ErrorCode.SUCCESS?pi.SUCCESS:pi.FAILED}}))))})),i.length&&(null===(r=(t=this._watcher).translateResponse)||void 0===r||r.call(t,i))}_handleEventChangeList(e){const t={Group:{map:{},types:Yp},Friend:{map:{},types:Wp}},r=(e,t,r)=>{e[t]||(e[t]=[]),e[t].push(r)};e.forEach((e=>{const{changeType:i}=e;for(const s in t)if(t[s].types.includes(i)){r(t[s].map,i,e);break}}));const i={Group:this._processChangeMapGroup.bind(this),Friend:this._processChangeMapFriend.bind(this)};for(const e in t)Object.keys(t[e].map).length>0&&i[e](t[e].map)}_processChangeMapGroup(e){const{GROUP_OPERATION:t,GROUP_PROFILE_CHANGE:r,GROUP_FOLLOW_USER_CHANGE:i}=C;e[t]&&this._handleGroupOperation(e[t]),e[r]&&this._handleGroupProfileChange(e[r]),e[i]&&this._handleFollowUserChange(e[i])}_processChangeMapFriend(e){(e[u.FRIEND_APPLICATION]||[]).forEach((e=>{var t,r,i,s,n,o,a,l,c,d;const{subChangeType:_,businessId:u,time:E,eventData:g}=e,{FRIEND_APPLY:I,FRIEND_REFUSE:p,FRIEND_USER_INFO:T,FRIENDS_INPUT:R,FRIEND_CLEAR:f,FRIEND_INFO_CHANGE:A,FRIEND_INFO_CHANGE_SYNC:m}=h;switch(_){case I:case p:{const e=_===I?exports.FriendApplicationStatus.UNHANDLED:exports.FriendApplicationStatus.REFUSED;null===(r=(t=this._watcher).friendApplicationStatusChanged)||void 0===r||r.call(t,{userId:u,applicationType:g.applyType,applicationStatus:e,directionType:g.friendType,operationTime:E,extra:g.info||""});break}case T:null===(s=(i=this._watcher).friendAdd)||void 0===s||s.call(i,{userId:u,name:g.name,portraitUri:g.portraitUrl,directionType:g.friendType,operationTime:E});break;case R:null===(o=(n=this._watcher).friendDelete)||void 0===o||o.call(n,{userIds:g.targetId,directionType:g.type,operationTime:E});break;case f:null===(l=(a=this._watcher).friendCleared)||void 0===l||l.call(a,E);break;case A:break;case m:null===(d=(c=this._watcher).friendInfoChangedSync)||void 0===d||d.call(c,{userId:u,remark:g.remarkname,extProfile:g.extProfile,operationTime:E})}}))}_handleGroupOperation(e){e.forEach((e=>{var t,r;const{subChangeType:i,businessId:s,time:n,eventData:o}=e,{optUserInfo:a,channelInfo:l,userInfos:c}=o;let d={groupId:s,operation:i,operationTime:n};a&&(d.operatorInfo=xt(a)),i===exports.GroupOperation.CREATE&&([d.groupInfo]=((e=[])=>e.map((e=>{var t,r,i,s,n,o,a,l,c;const d=Dt(e.settingProfile)||{},_=e.extProfile||[],{targetId:u,baseInfo:h,userInfo:E}=e;return{groupId:u,groupName:null!==(t=d.name)&&void 0!==t?t:"",portraitUri:null!==(r=d.portraitUrl)&&void 0!==r?r:"",introduction:null!==(i=d.introduction)&&void 0!==i?i:"",notice:null!==(s=d.announcement)&&void 0!==s?s:"",extProfile:Dt(_),joinPermission:~~d.joinPerm,removeMemberPermission:~~d.removePerm,invitePermission:~~d.memInvitePerm,inviteHandlePermission:~~d.invitePerm,groupInfoEditPermission:~~d.profilePerm,memberInfoEditPermission:~~d.memProfilePerm,creatorId:null!==(n=null==h?void 0:h.creatorId)&&void 0!==n?n:"",ownerId:null!==(o=null==h?void 0:h.ownerId)&&void 0!==o?o:"",createTime:(null==h?void 0:h.createTime)||0,membersCount:null!==(a=null==h?void 0:h.memberCount)&&void 0!==a?a:0,remark:null!==(l=null==E?void 0:E.remarkName)&&void 0!==l?l:"",joinedTime:(null==E?void 0:E.joinTime)||0,role:null!==(c=null==E?void 0:E.role)&&void 0!==c?c:exports.GroupMemberRole.UNDEF}})))([l])),[exports.GroupOperation.CREATE,exports.GroupOperation.DISMISS].includes(i)||(d.memberInfos=c.map(xt)),null===(r=(t=this._watcher).groupOperation)||void 0===r||r.call(t,d)}))}_handleGroupProfileChange(e){e.forEach((e=>{var t,r,i,s,n,o;const{businessId:a,time:l,eventData:c,subChangeType:d,secondaryId:_}=e;switch(d){case f.GROUP_INFO_CHANGE:{const e=c.optUserInfo?xt(c.optUserInfo):void 0,[i]=Lt([c.channelInfo]),[s]=c.channelFullInfo?Lt([c.channelFullInfo]):[void 0],n={operatorInfo:e,groupInfo:i,changedGroupInfo:i,operationTime:l,fullGroupInfo:s};null===(r=(t=this._watcher).groupInfoChanged)||void 0===r||r.call(t,n);break}case f.MEMBER_PROFILE_CHANGE:{const e={groupId:a,operatorInfo:c.optUserInfo?xt(c.optUserInfo):void 0,memberInfo:xt(c.userInfos[0]),operationTime:l};null===(s=(i=this._watcher).groupMemberInfoChanged)||void 0===s||s.call(i,e);break}case f.GROUP_REMARK_DELETE:case f.GROUP_REMARK_SET:{const e=d===f.GROUP_REMARK_SET?exports.GroupOperationType.ADD:exports.GroupOperationType.REMOVE;null===(o=(n=this._watcher).groupRemarkChangedSync)||void 0===o||o.call(n,{groupId:a,operationType:e,operationTime:l,groupRemark:_});break}}}))}_handleFollowUserChange(e){e.forEach((e=>{var t,r;const{subChangeType:i,businessId:s,time:n,userGroupIds:o}=e,a=1===i?exports.GroupOperationType.ADD:exports.GroupOperationType.REMOVE;null===(r=(t=this._watcher).groupFollowsChangedSync)||void 0===r||r.call(t,{groupId:s,operationType:a,operationTime:n,userIds:o})}))}_handleUltraChannelChange(e,t){const r=[],i=[],s=[];t.forEach((e=>{const{subChangeType:t,targetId:n,msgTime:o,operatorId:a,busChannelType:l,time:c}=e,d=e.busChannel||"",_={conversationType:exports.ConversationType.ULTRA_GROUP,targetId:n,channelId:d},u=this._chat.storage.getModel(_);switch(t){case $.PRIVATE_TO_PUBLIC:null==u||u.updateAttrs({channelType:exports.UltraGroupChannelType.PUBLIC}),r.push({targetId:n,channelId:d,changeType:exports.UltraGroupChannelChangeType.PRIVATE_TO_PUBLIC,channelType:exports.UltraGroupChannelType.PUBLIC});break;case $.PUBLIC_TO_PRIVATE:null==u||u.updateAttrs({channelType:exports.UltraGroupChannelType.PRIVATE}),r.push({targetId:n,channelId:d,changeType:exports.UltraGroupChannelChangeType.PUBLIC_TO_PRIVATE,channelType:exports.UltraGroupChannelType.PRIVATE});break;case $.PUBLIC_TO_PRIVATE_USER_NOT_IN:u&&this._chat.storage.removeConversation(u),r.push({targetId:n,channelId:d,changeType:exports.UltraGroupChannelChangeType.PUBLIC_TO_PRIVATE_USER_NOT_IN,channelType:l});break;case $.CHANNEL_DELETE:u&&this._chat.storage.removeConversation(u),i.push({targetId:n,channelId:d,channelType:l,deleteTime:c});break;case $.CHANNEL_USER_KICKED:s.push({targetId:n,channelId:d,userId:a,channelType:exports.UltraGroupChannelType.PRIVATE}),a===this.currentUserId&&u&&this._chat.storage.removeConversation(u);case $.PRIVATE_CHANNEL_USER_JOIN_PUBLIC:}})),r.length>0&&this._watcher.ultraGroupChannelChangeType(r),i.length>0&&this._watcher.ultraGroupChannelDelete(i),s.length>0&&this._watcher.ultraGroupChannelUserKicked(s)}_handleUserGroupStatus(e,r){return t(this,void 0,void 0,(function*(){const e=[],t=[],i=[],s=[],n=[];r.forEach((r=>{const{type:o,targetId:a,busChannelType:l,busChannel:c}=r,d=r.userGroupIds;switch(r.subChangeType){case ee.REMOVE_USER_GROUP:e.push({conversation:{conversationType:o,targetId:a},userGroupIds:d});break;case ee.JOIN_USER_GROUP:t.push({conversation:{conversationType:o,targetId:a},userGroupIds:d});break;case ee.EXIT_USER_GROUP:i.push({conversation:{conversationType:o,targetId:a},userGroupIds:d});break;case ee.CHANNEL_BIND_USER_GROUP:s.push({conversation:{conversationType:o,targetId:a,channelId:c},channelType:l,userGroupIds:d});break;case ee.CHANNEL_UNBIND_USER_GROUP:n.push({conversation:{conversationType:o,targetId:a,channelId:c},channelType:l,userGroupIds:d})}}));const o={};e.length>0&&(o.userGroupDisband=e),t.length>0&&(o.userAdded=t),i.length>0&&(o.userRemoved=i),s.length>0&&(o.userGroupBindChannel=s),n.length>0&&(o.userGroupUnBindChannel=n),this._watcher.userGroupStatus(o)}))}_updateUltraGroupWhenRecallMsg(e,t){const r=this._chat.storage.getModel(e);if(!r)return;const i={},{messageUId:s,sentTime:n}=e.content,{latestMessage:o}=r;o&&o.messageUId===s&&(i.latestMessage=gd(e,!0)),n&&r.lastReadTime<n&&r.unreadCount&&(i.unreadCount=r.unreadCount-1,t!==te.ALL&&t!==te.ME||!r.unreadMentionedCount||(i.unreadMentionedCount=r.unreadMentionedCount-1),t===te.ME&&r.unreadMentionedCount&&(i.unreadMentionedMeCount=r.unreadMentionedMeCount-1));const a=r.updateAttrs(i,e.sentTime);this._chat.storage.updateConversationStorage([r]),a&&this._watcher.conversation([{conversation:r.toIReceivedConversation(),updatedItems:a}])}subscribeUser(e,r,i){return t(this,void 0,void 0,(function*(){return this._subscribeManager.updateSubscribeRelation(e,r,exports.SubscribeOperationType.SUBSCRIBE,i)}))}unSubscribeUser(e,r){return t(this,void 0,void 0,(function*(){return yield this._subscribeManager.updateSubscribeRelation(e,r,exports.SubscribeOperationType.UNSUBSCRIBE)}))}getSubscribeUserList(e,r,i){var s;return t(this,void 0,void 0,(function*(){const t=null===(s=this._subscribeManager)||void 0===s?void 0:s.getSubscribeUserList(e,r,i);return ir(t)}))}getSubscribeUserStatus(e,r){var i;return t(this,void 0,void 0,(function*(){const t=null===(i=this._subscribeManager)||void 0===i?void 0:i.getSubscribeUserStatus(e,r);return ir(t||[])}))}updateMyUserProfile(e){var i;return t(this,void 0,void 0,(function*(){const t=Ac.encode(ja,r(this,Lp,"m",Fp).call(this,e)),s=yield this._ctx.query(Bi.updUserProfile,this.currentUserId,t,void 0);if(!s.data)return s.wipe();const n=Ac.decode(Ya,s.data.pbData);if(s.isOk){const{version:t}=n;return null===(i=this._subscribeManager)||void 0===i||i.updateOwnProfile(e,t),s.wipe()}const o=n.censorFailedFields;return sr(s.code,"",o&&0!==o.length?{errorKeys:o,errorKey:o[0]}:void 0)}))}getMyUserProfile(){return this._subscribeManager.getOwnProfile()}getUserProfiles(e){return t(this,void 0,void 0,(function*(){return this._subscribeManager.getUserProfiles(e)}))}rtcSignaling(e,r,i,s){return t(this,void 0,void 0,(function*(){if(!i){return(yield this._ctx.send(new gn(r,s,e))).wipe()}return(yield this._ctx.query(r,e,s,void 0)).trans((e=>e.pbData))}))}rtcPing(e,r,i){return t(this,void 0,void 0,(function*(){const t=Pc(r,i),s=yield this.rtcSignaling(e,Bi[Bi.rtcPing],!0,t);if(!s.isOk)return s.wipe();const n=Ac.decode(Wl,s.data);return ir(n)}))}get deviceId(){return this._ctx.appStorage.deviceId}setPushConfig(e){this._ctx.appStorage.setCustomDeviceId(e.deviceId),this._ctx.appStorage.setPackageName(e.packageName)}destroy(){t(void 0,void 0,void 0,(function*(){if(!Sd)return;Nd&&(clearTimeout(Nd),Nd=null);const e=yield Sd;if(e){const{db:t}=e;Ld.push(t)}Sd=null}))}setNetwork(e,t){this._ctx.handleNetworkChange(e,t)}setCallInfo(e,r,i){return t(this,void 0,void 0,(function*(){const t=Ac.encode(ya,{key:r,dataContent:i}),s=yield this._ctx.query(Bi.reqCall,e,t,ya);return s.isOk?s.trans((e=>({key:e.key,value:e.dataContent}))):s.wipe()}))}setNotificationQuietHoursWithSetting(e){return t(this,void 0,void 0,(function*(){const t=Ac.encode(Rl,e);return(yield this._ctx.query(Bi.addUnpush,this.currentUserId,t)).wipe()}))}removeNotificationQuietHoursSetting(){return t(this,void 0,void 0,(function*(){const e=Ac.encode(fl,{nothing:0});return(yield this._ctx.query(Bi.delUnpush,this.currentUserId,e)).wipe()}))}getNotificationQuietHoursSetting(){return t(this,void 0,void 0,(function*(){const e=Ac.encode(Al,{nothing:0});return(yield this._ctx.query(Bi.qryUnpush,this.currentUserId,e,ml)).trans((({isUnpush:e,spanMinutes:t,startTime:r,level:i,timezone:s})=>e?{spanMinutes:t,startTime:r,level:i,timezone:s}:{spanMinutes:0,startTime:"",level:exports.PushNotificationQuietHoursLevel.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT}))}))}getStatsUrlList(){return t(this,void 0,void 0,(function*(){return ir(Lr.getStatsUrlList(this.naviInfo))}))}translateWithParams(e,r,i,s){return t(this,void 0,void 0,(function*(){const t=0===s?e[0].identifier:this.currentUserId,n=this.userSettings.storage.get("value").transLan,o=[],a=[];let l;if(e.forEach((e=>{const{sourceLanguage:t,content:r}=e,i=e.targetLanguage||n;t!==i?r?o.push({messageUID:e.identifier,sourceLan:e.sourceLanguage,targetLan:e.targetLanguage||n,text:e.content,inputSource:s,transType:1}):a.push({identifier:e.identifier,from:s,code:exports.ErrorCode.TRANSLATION_TEXT_INVALID,translateInfo:{targetLanguage:i,translatedText:"",status:pi.NONE}}):a.push({identifier:e.identifier,from:s,code:exports.ErrorCode.TRANSLATION_LANGUAGE_SAME,translateInfo:{targetLanguage:i,translatedText:"",status:pi.NONE}})})),0===o.length)l=ir();else{const e=Ac.encode(vl,{businessType:3,businessInfo:Ac.encode(Nl,{forceTrans:i,transInfos:o,model:r})});l=(yield this._ctx.query(Bi.upConvertMsg,t,e,yl)).wipe()}return a.length>0&&setTimeout((()=>this._watcher.translateResponse(a)),0),l}))}getSubscribeUsersOnlineStatus(e){return t(this,void 0,void 0,(function*(){if(!this._subscribeManager)return ir([]);const t=[],i=new Set;this._subscribeManager.getSubscribeUserStatus(exports.SubscribeType.ONLINE_STATUS,e).forEach((e=>{const{userId:r,details:s=[]}=e,n=s.map((e=>({platform:e.platform,isOnline:!!e.eventValue,updateTime:e.changeTime}))),o=n.some((e=>e.isOnline)),a={userId:r,isOnline:o,details:n};t.push(a),i.add(r)}));const s=e.filter((e=>!i.has(e)));if(0===s.length)return ir(t);const n=yield r(this,Lp,"m",Bp).call(this,exports.SubscribeType.FRIEND_ONLINE_STATUS,s);return n.isOk?(n.data.list.forEach((e=>{const{subUserId:r,data:i}=e,s=i.map((e=>({platform:e.platformInfo,isOnline:!!e.value,updateTime:e.versionTime}))),n=s.some((e=>e.isOnline));var o;t.push((o={userId:r,isOnline:n,details:s},[exports.Platform.iOS,exports.Platform.Android,exports.Platform.Web,exports.Platform.PC,exports.Platform.Mini,exports.Platform.HarmonyOS].forEach((e=>{o.details.some((t=>t.platform===e))||o.details.push({platform:e,isOnline:!1,updateTime:0})})),o))})),ir(t)):n.wipe()}))}getAllRobots(){return t(this,void 0,void 0,(function*(){return this._ctx.getAllRobots(!1)}))}getMessagesByUIds(e,r){return t(this,void 0,void 0,(function*(){const{targetId:t,conversationType:i,channelId:s}=e,n=Ac.encode(Aa,{targetId:t,type:i,query:r.map((e=>({msgTime:0,msgUID:e,busChannel:s})))}),o=yield this._ctx.query(Bi.qryMsg,this._ctx.currentUserId,n,ma);if(!o.isOk)return o.wipe();const{list:a,notExistMsgId:l}=o.data,c=this.currentUserId,d=r.map((e=>{const r=a.findIndex((t=>t.msgId===e));if(-1!==r){const e=a.splice(r,1)[0];return{message:dd(e,c,!1,t),messageUId:e.msgId,code:exports.ErrorCode.SUCCESS}}return l.includes(e)?{messageUId:e,code:exports.ErrorCode.RC_DB_DATA_NOT_FOUND}:{messageUId:e,code:exports.ErrorCode.SERVER_DATA_ERROR}}));return ir(d)}))}}var qp;Lp=new WeakSet,Up=function(e,t,r,i,s){this._watcher.robotsSynced(t,i)},Pp=function(e,t){this._watcher.readReceiptResponseV5(t)},Dp=function(e,t){this._watcher.speechToTextResponse(t)},xp=function(e,t){this._watcher.messagesModified(t)},wp=function(e){this._watcher.messageModifiedSyncCompleted()},Gp=function(e,t){this._watcher.ultraGroupMessageExpansionUpdated(t)},Vp=function(e,t){this._watcher.ultraGroupMessageRecalled(t)},kp=function(e,t,r){t!==Eg?t!==Ig?this._handleEventChangeList(this._codec.formatEventChangeList(r)):this._handleConvertEvent(r):r.forEach((e=>{Ac.decode(Tl,new Uint8Array(e.eventData)).statusInfo.forEach((e=>{var t,r;const i=wt(e);null===(r=(t=this._watcher).groupApplicationEvent)||void 0===r||r.call(t,i)}))}))},Fp=function(e){const t={},{extraProfile:r}=e;return r&&(delete e.extraProfile,t.userExtProfile=fE(r)),t.userProfile=fE(e),t},Bp=function(e,r){return t(this,void 0,void 0,(function*(){const t=Ac.encode(Ha,{subType:e,subUsers:r.map((e=>({subUserId:e})))});return yield this._ctx.query(Bi.qrySubData,this.currentUserId,t,Fa)}))};class Kp{constructor(e){qp.set(this,void 0),i(this,qp,e,"f")}get isSpeechToTextEnabled(){return!!(1&(r(this,qp,"f").AIBusinessSub||0))}get isConversationListIncludeUltraGroup(){return yI(r(this,qp,"f"))}get messageModifiableMinutes(){return r(this,qp,"f").msgModifyMinute||0}get readReceiptVersion(){return e=(e=r(this,qp,"f").grpRRVer)||0,Object.values(Me).includes(e)?e:Me.UNKNOWN;var e}get isServerSaveUnreadEnabled(){return 1===r(this,qp,"f").serverSaveUnread}get messageSizeLimit(){return r(this,qp,"f").msgMaxLengthV2||0}}qp=new WeakMap;class Qp{constructor(e){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.ctx=e,this.logger=e.logger}get validateConnected(){return()=>this.checkAuthed(!1)}get validateLogin(){return()=>this.checkAuthed(!0)}checkAuthed(e){return this.ctx.connectionStatus===exports.RCConnectionStatus.CONNECTED||this.ctx.userId&&e?ir(this.ctx.naviInfo):sr(exports.ErrorCode.RC_NET_UNAVAILABLE)}}class Xp extends Qp{constructor(e,t){super(e),Object.defineProperty(this,"svr",{enumerable:!0,configurable:!0,writable:!0,value:t})}joinChatroom(e,r,i,s){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:r,extra:s,createIfNotExist:i}),t);const o=yield nr.create("joinChatroom").validate("chatroomId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isNumber("count",r,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isString("extra",s).fail(exports.ErrorCode.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).next((()=>{const t=Math.max(Math.min(r,50),-1)||10;return this.svr.joinChatroom(e,t,i,s)}));return this.logger.summary(n.A_JOIN_CHATROOM_R,o,t),o}))}quitChatroom(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_QUIT_CHATROOM_T,JSON.stringify({roomId:e}),t);const i=yield nr.create("quitChatroom").validate("roomId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isString("extra",r).fail(exports.ErrorCode.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).next((()=>this.svr.quitChatroom(e,r)));return this.logger.summary(n.A_QUIT_CHATROOM_R,i,t),i}))}getChatroomInfo(e,r,i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_CHATROOM_INFO_T,JSON.stringify({roomId:e,count:r,order:i}),t);const s=yield nr.create("getChatroomInfo").validate("roomId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isLimitedInteger("count",r,0,20).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("order",i,0,2).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).result().tryTrans(this.validateConnected).next((()=>this.svr.getChatroomInfo(e,r||0,i||1)));return this.logger.summary(n.A_GET_CHATROOM_INFO_R,s,t),s}))}setChatroomEntry(e,r,i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_SET_CHATROOM_ENTRY_T,JSON.stringify({roomId:e,entry:r,isForce:i}),t);const s=yield nr.create("setChatroomEntry").validate("roomId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("key",null==r?void 0:r.key,Ht,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEY).validate("value",null==r?void 0:r.value,jt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_VALUE).isLimitedString("notificationExtra",null==r?void 0:r.notificationExtra,0,2048).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_EXTRA).isBoolean("isAutoDelete",null==r?void 0:r.isAutoDelete).fail(exports.ErrorCode.INVALID_PARAMETER_IS_AUTO_DELETE).isBoolean("isSendNotification",null==r?void 0:r.isSendNotification).fail(exports.ErrorCode.INVALID_PARAMETER_IS_SEND_NOTIFICATION).result().tryTrans(this.validateConnected).next((()=>this.svr.setChatroomEntry(e,r,i)));return this.logger.summary(n.A_SET_CHATROOM_ENTRY_R,s,t),s}))}setChatroomEntries(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_SET_CHATROOM_ENTRIES_T,JSON.stringify({roomId:e,entryOptions:r}),t);const i=yield nr.create("setChatroomEntries").validate("roomId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isTypedArray("entries",null==r?void 0:r.entries,(e=>Ht(null==e?void 0:e.key)&&jt(null==e?void 0:e.value)),!0).fail(exports.ErrorCode.INVALID_PARAMETER_ENTRIES).isLimitedArray("entryOptions.entries",null==r?void 0:r.entries,10,!0).fail(exports.ErrorCode.CHATROOM_KV_STORE_OUT_LIMIT).isBoolean("entryOptions.isForce",null==r?void 0:r.isForce).fail(exports.ErrorCode.INVALID_PARAMETER_IS_FORCE).isBoolean("entryOptions.isAutoDelete",null==r?void 0:r.isAutoDelete).fail(exports.ErrorCode.INVALID_PARAMETER_IS_AUTO_DELETE).result().tryTrans(this.validateConnected).next((()=>this.svr.setChatroomEntries(e,r)));return this.logger.summary(n.A_SET_CHATROOM_ENTRIES_R,i,t),i}))}removeChatroomEntry(e,r,i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_REMOVE_CHATROOM_ENTRY_T,JSON.stringify({roomId:e,entry:r,isForce:i}),t);const s=yield nr.create("removeChatroomEntry").validate("roomId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("entry.key",null==r?void 0:r.key,Ht,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEY).isBoolean("entry.isSendNotification",null==r?void 0:r.isSendNotification).fail(exports.ErrorCode.INVALID_PARAMETER_IS_SEND_NOTIFICATION).isLimitedString("entry.notificationExtra",null==r?void 0:r.notificationExtra,0,2048).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_EXTRA).result().tryTrans(this.validateConnected).next((()=>this.svr.removeChatroomEntry(e,r,i)));return this.logger.summary(n.A_REMOVE_CHATROOM_ENTRY_R,s,t),s}))}removeChatroomEntries(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_REMOVE_CHATROOM_ENTRIES_T,JSON.stringify({roomId:e,entryOptions:r}),t);const i=yield nr.create("removeChatroomEntries").validate("roomId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isLimitedTypedArray("keys",null==r?void 0:r.keys,10,Ht,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEYS).isLimitedString("notificationExtra",null==r?void 0:r.notificationExtra,0,2048).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_EXTRA).result().tryTrans(this.validateConnected).next((()=>this.svr.removeChatroomEntries(e,r)));return this.logger.summary(n.A_REMOVE_CHATROOM_ENTRIES_R,i,t),i}))}getChatroomEntry(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_CHATROOM_ENTRY_T,JSON.stringify({roomId:e,key:r}),t);const i=yield nr.create("getChatroomEntry").validate("roomId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("key",r,Ht,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEY).result().tryTrans(this.validateConnected).next((()=>this.svr.getChatroomEntry(e,r)));return this.logger.summary(n.A_GET_CHATROOM_ENTRY_R,i,t),i}))}getAllChatroomEntries(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_CHATROOM_ENTRIES_T,JSON.stringify({roomId:e}),t);const r=yield nr.create("getAllChatroomEntries").validate("roomId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateConnected).next((()=>this.svr.getAllChatroomEntries(e)));return this.logger.summary(n.A_GET_CHATROOM_ENTRIES_R,r,t),r}))}getChatroomHistoryMessages(e,r,i,s){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_CHATROOM_HISTORY_MESSAGES_T,JSON.stringify({roomId:e,count:r,order:i,timestamp:s}),t);const o=yield nr.create("getChatroomHistoryMessages").validate("roomId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isLimitedInteger("count",r,1,100).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("order",i,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isTimestamp("timestamp",s).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((()=>this.svr.getChatroomHistoryMessages(e,s||0,r||20,i||0)));return this.logger.summary(n.A_GET_CHATROOM_HISTORY_MESSAGES_R,o,t,void 0,(({list:e})=>({size:e.length}))),o}))}setCheckChatRoomDuplicateMessage(e){return this.svr.setCheckChatRoomDuplicateMessage(e)}bindRTCRoomForChatroom(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_BIND_RTC_FOR_CHATROOM_T,JSON.stringify({option:e}),t);const r=yield nr.create("bindRTCRoomForChatroom").validate("chatRoomId",null==e?void 0:e.chatRoomId,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("rtcRoomId",null==e?void 0:e.rtcRoomId,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateConnected).next((()=>this.svr.bindRTCRoomForChatroom(e)));return this.logger.summary(n.A_BIND_RTC_FOR_CHATROOM_R,r,t),r}))}}const zp=e=>{const{groupId:t,groupName:r,portraitUri:i,introduction:s,notice:n,extProfile:o,joinPermission:a,removeMemberPermission:l,invitePermission:c,inviteHandlePermission:d,groupInfoEditPermission:_,memberInfoEditPermission:u}=e;return JSON.parse(JSON.stringify({name:r,portraitUrl:i,introduction:s,announcement:n,joinPerm:a,removePerm:l,memInvitePerm:c,invitePerm:d,profilePerm:_,memProfilePerm:u}))},Zp=e=>{var t,r,i;return{removeMuteStatus:!(null!==(t=null==e?void 0:e.removeMuteStatus)&&void 0!==t&&!t),removeWhiteList:!(null!==(r=null==e?void 0:e.removeWhiteList)&&void 0!==r&&!r),removeFollow:!(null!==(i=null==e?void 0:e.removeFollow)&&void 0!==i&&!i)}},$p=(e,t,r)=>e.validate("groupId",null==t?void 0:t.groupId,vt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedString("groupName",null==t?void 0:t.groupName,1,64,r).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_NAME).isString("portraitUri",null==t?void 0:t.portraitUri).isString("introduction",null==t?void 0:t.introduction).isString("notice",null==t?void 0:t.notice).validate("extProfile",null==t?void 0:t.extProfile,(e=>{if(!It(e))return!1;const t=Object.entries(e);return t.length<=10&&t.every((([e,t])=>dt(t)))})).isNumberEnum("joinPermission",null==t?void 0:t.joinPermission,exports.GroupJoinPermission).isNumberEnum("removeMemberPermission",null==t?void 0:t.removeMemberPermission,exports.GroupOperationPermission).isNumberEnum("invitePermission",null==t?void 0:t.invitePermission,exports.GroupOperationPermission).isNumberEnum("inviteHandlePermission",null==t?void 0:t.inviteHandlePermission,exports.GroupInviteHandlePermission).isNumberEnum("groupInfoEditPermission",null==t?void 0:t.groupInfoEditPermission,exports.GroupOperationPermission).isNumberEnum("memberInfoEditPermission",null==t?void 0:t.memberInfoEditPermission,exports.GroupMemberInfoEditPermission).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_INFO),eT=(e,t,r,i,s)=>e.isObject("option",i,s).fail(exports.ErrorCode.INVALID_PARAMETER_PAGING_QUERY_OPTION).isLimitedInteger("count",null==i?void 0:i.count,1,t,r).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isString("pageToken",null==i?void 0:i.pageToken).fail(exports.ErrorCode.INVALID_PARAMETER_PAGING_QUERY_OPTION).isBoolean("order",null==i?void 0:i.order).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER);class tT extends Qp{constructor(e,t){super(e),Object.defineProperty(this,"svr",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_userProfileEnabled",{enumerable:!0,configurable:!0,writable:!0,value:()=>{var e;return 1===(null===(e=this.ctx.naviInfo)||void 0===e?void 0:e.userProfile)?ir():sr(exports.ErrorCode.RC_USER_PROFILE_SERVICE_UNAVAILABLE)}})}updateMyUserProfileVisibility(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_UPDATE_MY_USER_PROFILE_VISIBILITY_T,e,t);const r=yield nr.create("updateMyUserProfileVisibility").isNumberEnum("visibility",e,exports.UserProfileVisibility,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_PROFILE_VISIBILITY).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>this.svr.updateMyUserProfileVisibility(e)));return this.logger.summary(n.A_UPDATE_MY_USER_PROFILE_VISIBILITY_R,r,t),r}))}getMyUserProfileVisibility(){return t(this,void 0,void 0,(function*(){const e=this.logger.createTraceId();this.logger.info(n.A_GET_MY_USER_PROFILE_VISIBILITY_T,"",e);const t=yield this.validateConnected().tryTrans(this._userProfileEnabled).next((()=>this.svr.getMyUserProfileVisibility()));return this.logger.summary(n.A_GET_MY_USER_PROFILE_VISIBILITY_R,t,e),t}))}searchUserProfileByUniqueId(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_SEARCH_USER_PROFILE_BY_UNIQUE_ID_T,e,t);const r=yield nr.create("searchUserProfileByUniqueId").isNotEmptyString("uniqueId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_UNIQUE_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>this.svr.searchUserProfileByUniqueId(e)));return this.logger.summary(n.A_SEARCH_USER_PROFILE_BY_UNIQUE_ID_R,r,t),r}))}addFriend(e,r,i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_ADD_FRIEND_T,JSON.stringify({userId:e,directionType:r,extra:i}),t);const s=yield nr.create("addFriend").validate("userId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isNumberEnum("directionType",r,exports.DirectionType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_DIRECTION_TYPE).isLimitedString("extra",i,0,128).fail(exports.ErrorCode.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>this.svr.addFriend(e,r,i||"")));return this.svr.addFriend(e,r,i||""),this.logger.summary(n.A_ADD_FRIEND_R,s,t),s}))}deleteFriends(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_DELETE_FRIENDS_T,JSON.stringify({userIds:e,directionType:r}),t);const i=yield nr.create("deleteFriends").isLimitedTypedArray("userIds",e,100,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).isNumberEnum("directionType",r,exports.DirectionType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_DIRECTION_TYPE).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>this.svr.deleteFriends(e,r)));return this.logger.summary(n.A_DELETE_FRIENDS_R,i,t),i}))}acceptFriendRequest(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_ACCEPT_FRIEND_REQUEST_T,e,t);const r=yield nr.create("acceptFriendRequest").validate("userId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>this.svr.acceptFriendRequest(e)));return this.logger.summary(n.A_ACCEPT_FRIEND_REQUEST_R,r,t),r}))}refuseFriendRequest(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_REFUSE_FRIEND_REQUEST_T,JSON.stringify({userId:e,reason:r}),t);const i=yield nr.create("refuseFriendApplication").validate("userId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isString("reason",r).fail(exports.ErrorCode.INVALID_PARAMETER_REASON).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>this.svr.refuseFriendRequest(e,r)));return this.logger.summary(n.A_REFUSE_FRIEND_REQUEST_R,i,t),i}))}setFriendInfo(e,r,i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_SET_FRIEND_INFO_T,JSON.stringify({userId:e,remark:r,extProfile:i}),t);const s=yield nr.create("setFriendInfo").validate("userId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isLimitedString("remark",r,0,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_REMARK).validate("extProfile",i,(e=>{if("object"!=typeof i)return!1;const t=Object.entries(i);return!(t.length>10||t.some((([e,t])=>!dt(t))))})).fail(exports.ErrorCode.INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>this.svr.setFriendInfo(e,r,i||{})));return this.logger.summary(n.A_SET_FRIEND_INFO_R,s,t),s}))}checkFriends(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_CHECK_FRIENDS_T,JSON.stringify({userIds:e,directionType:r}),t);const i=yield nr.create("checkFriends").isLimitedTypedArray("userIds",e,20,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).isNumberEnum("directionType",r,exports.DirectionType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_DIRECTION_TYPE).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>this.svr.checkFriends(e,r)));return this.logger.summary(n.A_CHECK_FRIENDS_R,i,t,void 0,(e=>({size:e.length}))),i}))}getFriends(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_FRIENDS_T,JSON.stringify({directionType:e,option:r}),t);const i=yield nr.create("getFriends").isNumberEnum("directionType",e,exports.QueryFriendsDirectionType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE).check((e=>eT(e,100,!1,r))).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>{const t={count:(null==r?void 0:r.count)||50,pageToken:(null==r?void 0:r.pageToken)||"",order:!!(null==r?void 0:r.order)};return this.svr.getFriends(e,t)}));return this.logger.summary(n.A_GET_FRIENDS_R,i,t,void 0,(({data:e})=>({size:e.length}))),i}))}getFriendApplications(e,r,i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_FRIEND_APPLICATIONS_T,JSON.stringify({option:e,types:r,status:i}),t);const s=yield nr.create("getFriendApplications").check((t=>eT(t,100,!1,e))).check((e=>{e.isTypedArray("types",r,(t=>!e.isNumberEnum("type",t,exports.FriendApplicationType,!0).isFailed)).fail(exports.ErrorCode.INVALID_PARAMETER_FRIEND_APPLICATION_TYPE).isTypedArray("status",i,(t=>!e.isNumberEnum("status",t,exports.FriendApplicationStatus,!0).isFailed)).fail(exports.ErrorCode.INVALID_PARAMETER_FRIEND_APPLICATION_STATUS)})).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>{const t={count:(null==e?void 0:e.count)||50,pageToken:(null==e?void 0:e.pageToken)||"",order:!!(null==e?void 0:e.order)},s=r&&0!==r.length?r:[1,2],n=i&&0!==i.length?i:[0,1,2,3];return this.svr.getFriendApplications(t,s,n)}));return this.logger.summary(n.A_GET_FRIEND_APPLICATIONS_R,s,t,void 0,(({data:e})=>({size:e.length}))),s}))}getFriendsInfo(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_FRIENDS_INFO_T,JSON.stringify({userIds:e}),t);const r=yield nr.create("getFriendsInfo").isLimitedTypedArray("userIds",e,100,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>this.svr.getFriendsInfo(e)));return this.logger.summary(n.A_GET_FRIENDS_INFO_R,r,t,void 0,(e=>({size:e.length}))),r}))}searchFriendsInfo(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_SEARCH_FRIENDS_INFO_T,JSON.stringify({nickname:e}),t);const r=yield nr.create("searchFriendsInfo").isLimitedString("nickname",e,1,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NICK_NAME).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>this.svr.searchFriendsInfo(e)));return this.logger.summary(n.A_SEARCH_FRIENDS_INFO_R,r,t,void 0,(e=>({size:e.length}))),r}))}setFriendAddPermission(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_SET_FRIEND_ADD_PERMISSION_T,JSON.stringify({permission:e}),t);const r=yield nr.create("setFriendAddPermission").isNumberEnum("permission",e,exports.FriendAddPermission,!0).fail(exports.ErrorCode.INVALID_PARAMETER_FRIEND_ADD_PERMISSION).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>this.svr.setFriendAddPermission(e)));return this.logger.summary(n.A_SET_FRIEND_ADD_PERMISSION_R,r,t),r}))}getFriendAddPermission(){return t(this,void 0,void 0,(function*(){const e=this.logger.createTraceId();this.logger.info(n.A_GET_FRIEND_ADD_PERMISSION_T,JSON.stringify({}),e);const t=yield nr.create("getFriendAddPermission").result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>this.svr.getFriendAddPermission()));return this.logger.summary(n.A_GET_FRIEND_ADD_PERMISSION_R,t,e),t}))}createGroup(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_CREATE_GROUP_T,JSON.stringify({groupInfo:e,inviteeUserIds:r}),t);const i=yield nr.create("createGroup").check((t=>$p(t,e,!0))).isLimitedTypedArray("inviteeUserIds",r,30,St,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>{const t=zp(e);return this.svr.createGroup(e.groupId,t,e.extProfile||{},r||[])}));return this.logger.summary(n.A_CREATE_GROUP_R,i,t),i}))}updateGroupInfo(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_UPDATE_GROUP_INFO_T,JSON.stringify({groupInfo:e}),t);const r=yield nr.create("updateGroupInfo").check((t=>$p(t,e,!1))).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>{const t=zp(e);return this.svr.updateGroupInfo(e.groupId,t,e.extProfile)}));return this.logger.summary(n.A_UPDATE_GROUP_INFO_R,r,t),r}))}getGroupsInfo(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_GROUPS_INFO_T,JSON.stringify({groupIds:e}),t);const r=yield nr.create("getGroupsInfo").isLimitedTypedArray("groupIds",e,20,vt,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_IDS).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>this.svr.getGroupsInfo(e)));return this.logger.summary(n.A_GET_GROUPS_INFO_R,r,t,void 0,(e=>({size:e.length}))),r}))}kickGroupMembers(e,r,i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_KICK_GROUP_MEMBERS_T,JSON.stringify({groupId:e,userIds:r,config:i}),t);const s=yield nr.create("kickGroupMembers").validate("groupId",e,vt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",r,100,St,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>this.svr.kickGroupMembers(e,r,Zp(i))));return this.logger.summary(n.A_KICK_GROUP_MEMBERS_R,s,t),s}))}quitGroup(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_QUIT_GROUP_T,JSON.stringify({groupId:e,config:r}),t);const i=yield nr.create("quitGroup").validate("groupId",e,vt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>this.svr.quitGroup(e,Zp(r))));return this.logger.summary(n.A_QUIT_GROUP_R,i,t),i}))}dismissGroup(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_DISMISS_GROUP_T,JSON.stringify({groupId:e}),t);const r=yield nr.create("dismissGroup").validate("groupId",e,vt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>this.svr.dismissGroup(e)));return this.logger.summary(n.A_DISMISS_GROUP_R,r,t),r}))}transferGroupOwner(e,r,i,s){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_TRANSFER_GROUP_OWNER_T,JSON.stringify({groupId:e,newOwnerId:r,quit:i,config:s}),t);const o=yield nr.create("transferGroupOwner").validate("groupId",e,vt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).validate("newOwnerId",r,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>this.svr.transferGroupOwner(e,r,!!i,Zp(s))));return this.logger.summary(n.A_TRANSFER_GROUP_OWNER_R,o,t),o}))}addGroupManagers(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_ADD_GROUP_MANAGERS_T,JSON.stringify({groupId:e,userIds:r}),t);const i=yield nr.create("addGroupManagers").validate("groupId",e,vt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",r,10,St,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>this.svr.setGroupManagers(exports.GroupOperationType.ADD,e,r)));return this.logger.summary(n.A_ADD_GROUP_MANAGERS_R,i,t),i}))}removeGroupManagers(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_REMOVE_GROUP_MANAGERS_T,JSON.stringify({groupId:e,userIds:r}),t);const i=yield nr.create("removeGroupManagers").validate("groupId",e,vt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",r,10,St,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>this.svr.setGroupManagers(exports.GroupOperationType.REMOVE,e,r)));return this.logger.summary(n.A_REMOVE_GROUP_MANAGERS_R,i,t),i}))}getGroupMembers(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_GROUP_MEMBERS_T,JSON.stringify({groupId:e,userIds:r}),t);const i=yield nr.create("getGroupMembers").validate("groupId",e,vt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",r,100,St,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>this.svr.getGroupMembers(e,r)));return this.logger.summary(n.A_GET_GROUP_MEMBERS_R,i,t,void 0,(e=>({size:e.length}))),i}))}setGroupMemberInfo(e,r,i,s){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_SET_GROUP_MEMBER_INFO_T,JSON.stringify({groupId:e,userId:r,nickname:i,extra:s}),t);const o=yield nr.create("setGroupMemberInfo").validate("groupId",e,vt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).validate("userId",r,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isLimitedString("nickname",i,0,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NICK_NAME).isLimitedString("extra",s,0,128).fail(exports.ErrorCode.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>this.svr.setGroupMemberInfo(e,r,i,s)));return this.logger.summary(n.A_SET_GROUP_MEMBER_INFO_R,o,t),o}))}searchGroupMembers(e,r,i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_SEARCH_GROUP_MEMBERS_T,JSON.stringify({groupId:e,nickName:r,option:i}),t);const s=yield nr.create("searchGroupMembers").validate("groupId",e,vt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedString("nickName",r,1,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NICK_NAME).check((e=>eT(e,200,!0,i,!0))).result().tryTrans(this.validateLogin).tryTrans(this._userProfileEnabled).next((()=>{const t={count:i.count,pageToken:i.pageToken||"",order:!!i.order};return this.svr.searchGroupMembers(e,r,t)}));return this.logger.summary(n.A_SEARCH_GROUP_MEMBERS_R,s,t,void 0,(({data:e})=>({size:e.length}))),s}))}getGroupMembersByRole(e,r,i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_GROUP_MEMBERS_BY_ROLE_T,JSON.stringify({groupId:e,role:r,option:i}),t);const s=yield nr.create("getGroupMembersByRole").validate("groupId",e,vt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isNumberEnum("role",r,exports.GroupMemberRole,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_MEMBER_ROLE).isLimitedInteger("count",i.count,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isString("pageToken",i.pageToken).fail(exports.ErrorCode.INVALID_PARAMETER_PAGING_QUERY_OPTION).isNumberEnum("filterRobotType",i.filterRobotType,Oe).fail(exports.ErrorCode.INVALID_PARAMETER_PAGING_QUERY_OPTION).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>{const t={count:i.count,pageToken:i.pageToken||"",order:!!i.order,filterRobotType:i.filterRobotType||Oe.ALL};return this.svr.getGroupMembersByRole(e,r,t)}));return this.logger.summary(n.A_GET_GROUP_MEMBERS_BY_ROLE_R,s,t,void 0,(({data:e})=>({size:e.length}))),s}))}addGroupFollows(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_ADD_GROUP_FOLLOWS_T,JSON.stringify({groupId:e,userIds:r}),t);const i=yield nr.create("addGroupFollows").validate("groupId",e,vt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",r,100,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>this.svr.setGroupFollows(exports.GroupOperationType.ADD,e,r)));return this.logger.summary(n.A_ADD_GROUP_FOLLOWS_R,i,t),i}))}removeGroupFollows(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_REMOVE_GROUP_FOLLOWS_T,JSON.stringify({groupId:e,userIds:r}),t);const i=yield nr.create("removeGroupFollows").validate("groupId",e,vt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",r,100,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>this.svr.setGroupFollows(exports.GroupOperationType.REMOVE,e,r)));return this.logger.summary(n.A_REMOVE_GROUP_FOLLOWS_R,i,t),i}))}getGroupFollows(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_GROUP_FOLLOWS_T,JSON.stringify({groupId:e}),t);const r=yield nr.create("getGroupFollows").validate("groupId",e,vt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>this.svr.getGroupFollows(e)));return this.logger.summary(n.A_GET_GROUP_FOLLOWS_R,r,t,void 0,(e=>({size:e.length}))),r}))}setGroupRemark(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_SET_GROUP_REMARK_T,JSON.stringify({groupId:e,remark:r}),t);const i=yield nr.create("setGroupRemark").validate("groupId",e,vt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedString("remark",r,0,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_REMARK).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>this.svr.setGroupRemark(e,r)));return this.logger.summary(n.A_SET_GROUP_REMARK_R,i,t),i}))}joinGroup(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_JOIN_GROUP_T,JSON.stringify({groupId:e}),t);const r=yield nr.create("joinGroup").validate("groupId",e,vt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>this.svr.joinGroup(e)));return this.logger.summary(n.A_JOIN_GROUP_R,r,t),r}))}inviteUsersToGroup(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_INVITE_USERS_TO_GROUP_T,JSON.stringify({groupId:e,userIds:r}),t);const i=yield nr.create("inviteUsersToGroup").validate("groupId",e,vt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",r,30,St,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>this.svr.inviteUsersToGroup(e,r)));return this.logger.summary(n.A_INVITE_USERS_TO_GROUP_R,i,t),i}))}acceptGroupInvite(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_ACCEPT_GROUP_INVITE_T,JSON.stringify({groupId:e,inviterId:r}),t);const i=yield nr.create("acceptGroupInvite").validate("groupId",e,vt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).validate("inviterId",r,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>this.svr.memberInviteResponse({groupId:e,inviterId:r,optType:exports.GroupOperationRole.APPLICANT,optResult:exports.GroupOperationStatus.ACCEPT})));return this.logger.summary(n.A_ACCEPT_GROUP_INVITE_R,i,t),i.wipe()}))}refuseGroupInvite(e,r,i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_REFUSE_GROUP_INVITE_T,JSON.stringify({groupId:e,inviterId:r,reason:i}),t);const s=yield nr.create("refuseGroupInvite").validate("groupId",e,vt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).validate("inviterId",r,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isLimitedString("reason",i,0,128).fail(exports.ErrorCode.INVALID_PARAMETER_REASON).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>this.svr.memberInviteResponse({groupId:e,inviterId:r,optType:exports.GroupOperationRole.APPLICANT,optResult:exports.GroupOperationStatus.REFUSE,reason:i})));return this.logger.summary(n.A_REFUSE_GROUP_INVITE_R,s,t),s.wipe()}))}acceptGroupApplication(e,r,i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_ACCEPT_GROUP_APPLICATION_T,JSON.stringify({groupId:e,joinUserId:r,inviterId:i}),t);const s=yield nr.create("acceptGroupApplication").validate("groupId",e,vt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).validate("joinUserId",r,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).validate("inviterId",i,St).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>this.svr.memberInviteResponse({groupId:e,joinUserId:r,inviterId:i||"",optType:exports.GroupOperationRole.MANAGER,optResult:exports.GroupOperationStatus.ACCEPT})));return this.logger.summary(n.A_ACCEPT_GROUP_APPLICATION_R,s,t),s.wipe()}))}refuseGroupApplication(e,r,i,s){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_REFUSE_GROUP_APPLICATION_T,JSON.stringify({groupId:e,joinUserId:r,inviterId:i,reason:s}),t);const o=yield nr.create("refuseGroupApplication").validate("groupId",e,vt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).validate("joinUserId",r,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).validate("inviterId",i,St).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isLimitedString("reason",s,0,128).fail(exports.ErrorCode.INVALID_PARAMETER_REASON).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>this.svr.memberInviteResponse({groupId:e,joinUserId:r,inviterId:i||"",optType:exports.GroupOperationRole.MANAGER,optResult:exports.GroupOperationStatus.REFUSE,reason:s})));return this.logger.summary(n.A_REFUSE_GROUP_APPLICATION_R,o,t),o.wipe()}))}getGroupApplications(e,r,i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_GROUP_APPLICATIONS_T,JSON.stringify({option:e,directions:r,status:i}),t);const{usingCppEngine:s}=this.ctx,o=yield nr.create("getGroupApplications").check((t=>eT(t,200,!0,e,!0))).check((e=>{s&&e.isLimitedTypedArray("directions",r,Object.keys(exports.GroupApplicationDirection).length,(t=>!e.isNumberEnum("directions",t,exports.GroupApplicationDirection,!0).isFailed),!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION).isLimitedTypedArray("status",i,Object.keys(exports.GroupApplicationStatus).length,(t=>!e.isNumberEnum("status",t,exports.GroupApplicationStatus,!0).isFailed),!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_APPLICATION_STATUS)})).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>{const t={count:e.count,pageToken:e.pageToken||"",order:!!e.order};return this.svr.getGroupApplications(t,r||[],i||[])}));return this.logger.summary(n.A_GET_GROUP_APPLICATIONS_R,o,t,void 0,(({data:e})=>({size:e.length}))),o}))}getJoinedGroupsByRole(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_JOINED_GROUPS_BY_ROLES_T,JSON.stringify({role:e,option:r}),t);const i=yield nr.create("getJoinedGroupsByRole").isNumberEnum("role",e,exports.GroupMemberRole,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_MEMBER_ROLE).check((e=>eT(e,100,!0,r,!0))).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>{const t={count:r.count,pageToken:r.pageToken||"",order:!!r.order};return this.svr.getJoinedGroupsByRole(e,t)}));return this.logger.summary(n.A_GET_JOINED_GROUPS_BY_ROLES_R,i,t,void 0,(({data:e})=>({size:e.length}))),i}))}searchJoinedGroups(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_SEARCH_JOINED_GROUPS_T,JSON.stringify({groupName:e,option:r}),t);const i=yield nr.create("searchJoinedGroups").isLimitedString("groupName",e,1,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_NAME).check((e=>eT(e,200,!0,r,!0))).result().tryTrans(this.validateLogin).tryTrans(this._userProfileEnabled).next((()=>{const t={count:r.count,pageToken:r.pageToken||"",order:!!r.order};return this.svr.searchJoinedGroups(e,t)}));return this.logger.summary(n.A_SEARCH_JOINED_GROUPS_R,i,t,void 0,(({data:e})=>({size:e.length}))),i}))}getJoinedGroups(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_JOINED_GROUPS_T,JSON.stringify({groupIds:e}),t);const r=yield nr.create("getJoinedGroups").isLimitedTypedArray("groupIds",e,20,vt,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_IDS).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((()=>this.svr.getJoinedGroups(e)));return this.logger.summary(n.A_GET_JOINED_GROUPS_R,r,t,void 0,(e=>({size:e.length}))),r}))}}var rT,iT,sT,nT;let oT=0;class aT extends Qp{constructor(e,t,r){super(r),Object.defineProperty(this,"_svr",{enumerable:!0,configurable:!0,writable:!0,value:t}),rT.set(this,void 0),iT.set(this,!1),sT.set(this,!0),nT.set(this,""),Object.defineProperty(this,"_id",{enumerable:!0,configurable:!0,writable:!0,value:++oT}),i(this,rT,Object.assign(Object.assign({},e),{tagFilter:Object.assign({},e.tagFilter)}),"f")}get hasMore(){return r(this,sT,"f")}get isLoading(){return r(this,iT,"f")}load(e){return t(this,void 0,void 0,(function*(){if(r(this,iT,"f"))return sr(exports.ErrorCode.METHOD_BUSY);i(this,iT,!0,"f");const t=this.logger.createTraceId();this.logger.info(n.A_LOAD_CONVERSATION_LIST_T,JSON.stringify({count:e,loaderId:this._id,pageToken:r(this,nT,"f")}),t);const s=yield nr.create("ConversationListLoader.load").isLimitedInteger("count",e,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).next((()=>this._svr.loadConversationList(r(this,nT,"f"),e,r(this,rT,"f"))));if(this.logger.summary(n.A_LOAD_CONVERSATION_LIST_R,s,t,{loaderId:this._id},(({pageToken:e,finished:t,list:r})=>({pageToken:e,finished:t,size:r.length}))),i(this,iT,!1,"f"),!s.isOk)return s.wipe();const{pageToken:o,finished:a,list:l}=s.data;return i(this,nT,o,"f"),i(this,sT,!a,"f"),ir(l)}))}}var lT,cT,dT,_T,uT,hT,ET,gT;rT=new WeakMap,iT=new WeakMap,sT=new WeakMap,nT=new WeakMap;class IT extends Qp{constructor(e,t){super(e),lT.add(this),Object.defineProperty(this,"svr",{enumerable:!0,configurable:!0,writable:!0,value:t})}saveEditedMessageDraft(e,i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_SAVE_EDITED_MSG_DRAFT_T,JSON.stringify({draft:e,identifier:i}),t);const s=yield nr.create("saveEditedMessageDraft").check((e=>td(e,i,B))).isString("draft",null==e?void 0:e.content,!0).fail(exports.ErrorCode.INVALID_PARAMETER_DRAFT).isNotEmptyString("messageUId",null==e?void 0:e.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateLogin).next((()=>this.svr.saveEditedMessageDraft(e,r(this,lT,"m",dT).call(this,i))));return this.logger.summary(n.A_SAVE_EDITED_MSG_DRAFT_R,s,t),s}))}getEditedMessageDraft(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_EDITED_MSG_DRAFT_T,JSON.stringify({identifier:e}),t);const i=yield nr.create("getEditedMessageDraft").check((t=>td(t,e,B))).result().next((()=>this.svr.getEditedMessageDraft(r(this,lT,"m",dT).call(this,e))));return this.logger.summary(n.A_GET_EDITED_MSG_DRAFT_R,i,t),i}))}clearEditedMessageDraft(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_CLEAR_EDITED_MSG_DRAFT_T,JSON.stringify({identifier:e}),t);const i=yield nr.create("clearEditedMessageDraft").check((t=>td(t,e,B))).result().next((()=>this.svr.clearEditedMessageDraft(r(this,lT,"m",dT).call(this,e))));return this.logger.summary(n.A_CLEAR_EDITED_MSG_DRAFT_R,i,t),i}))}createConversationListLoader(e){return t(this,void 0,void 0,(function*(){const{conversationTypes:t,order:r,channelId:i,tagFilter:s}=e||{};return yield nr.create("createConversationListLoader").isTypedArray("conversationTypes",t,(e=>W(e,w))).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isLimitedInteger("order",r,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).validate("channelId",i,mt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).check((e=>{if(!s)return;const{tagIds:t}=s;e.isLimitedTypedArray("tagIds",t,20,gt,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID)})).result().tryTrans(this.validateConnected).trans((()=>new aT(Object.assign(Object.assign({},e),{tagFilter:Object.assign({},s)}),this.svr,this.ctx)))}))}sendUltraGroupTypingStatus(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId(),i=null==e?void 0:e.conversationType;this.logger.info(n.A_SEND_UG_TYPING_T,JSON.stringify(e),t);const s=yield nr.create("sendUltraGroupTypingStatus").check((t=>td(t,e,F))).validate("conversationType",i,(()=>i===exports.ConversationType.ULTRA_GROUP),!0).fail(exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT).result().tryTrans(this.validateConnected).next((()=>this.svr.sendUltraGroupTypingStatus(r(this,lT,"m",dT).call(this,e))));return this.logger.summary(n.A_SEND_UG_TYPING_R,s,t),s}))}sendTypingStatus(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_SEND_TYPING_STATUS_T,JSON.stringify({identifier:e,typingContentType:r}),t);const i=yield nr.create("sendTypingStatus").check((t=>td(t,e,w))).isString("typingContentType",r,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).result().tryTrans(this.validateConnected).next((()=>{const i={messageType:"RC:TypSts",content:{typingContentType:r}};return this.ctx.sendMessage(e,i,t)}));return this.logger.summary(n.A_SEND_TYPING_STATUS_R,i,t),i}))}sendSyncReadStatusMessage(e,r){return t(this,void 0,void 0,(function*(){const i=this.logger.createTraceId();this.logger.info(n.A_SYNC_READ_STATUS_T,JSON.stringify({identifier:e,timestamp:r}),i);const s=yield nr.create("sendSyncReadStatusMessage").check((t=>td(t,e,w))).isNumber("timestamp",r,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((s=>t(this,void 0,void 0,(function*(){if(s.serverSaveUnread)return sr(exports.ErrorCode.SERVER_RECORD_UNREAD_COUNT_ENABLED_FORBIDDEN);if(1===s.sesDriven)return this.svr.updateConversationReadTime(e,r);const t={messageType:Q.SYNC_READ_STATUS,content:{lastMessageSendTime:r},directionalUserIdList:Qt(e.conversationType,[this.ctx.userId])};return(yield this.ctx.sendMessage(e,t,i)).wipe()}))));return this.logger.summary(n.A_SYNC_READ_STATUS_R,s,i),s}))}clearUnreadCount(e){return t(this,void 0,void 0,(function*(){const i=this.logger.createTraceId();this.logger.info(n.A_CLEAR_UNREAD_COUNT_T,JSON.stringify(e),i);const s=yield nr.create("clearUnreadCount").check((t=>td(t,e,F))).result().tryTrans((()=>this.checkAuthed(e.conversationType!==exports.ConversationType.ULTRA_GROUP))).tryTrans((e=>e.serverSaveUnread?sr(exports.ErrorCode.SERVER_RECORD_UNREAD_COUNT_ENABLED_FORBIDDEN):ir())).next((()=>t(this,void 0,void 0,(function*(){return e.conversationType!==exports.ConversationType.ULTRA_GROUP||this.svr.ugSynced?this.svr.clearConversationUnreadCount(r(this,lT,"m",dT).call(this,e)):sr(exports.ErrorCode.METHOD_NOT_AVAILABLE)}))));return this.logger.summary(n.A_CLEAR_UNREAD_COUNT_R,s,i),s}))}clearAllUnreadCount(){return t(this,void 0,void 0,(function*(){const e=this.logger.createTraceId();this.logger.info(n.A_CLEAR_ALL_UNREAD_COUNT_T,null,e);const r=yield nr.create("clearAllUnreadCount").result().tryTrans(this.validateLogin).tryTrans((e=>e.serverSaveUnread?sr(exports.ErrorCode.SERVER_RECORD_UNREAD_COUNT_ENABLED_FORBIDDEN):ir())).next((()=>t(this,void 0,void 0,(function*(){return this.svr.clearAllSGUnreadCount()}))));return this.logger.summary(n.A_CLEAR_ALL_UNREAD_COUNT_R,r,e),r}))}clearUnreadCountByTimestamp(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_CLEAR_UNREAD_COUNT_BY_TIME_T,JSON.stringify({identifier:e,timestamp:r}),t);const i=yield nr.create("clearUnreadCountByTimestamp").check((t=>td(t,e,w))).isTimestamp("timestamp",r).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin).tryTrans((e=>e.serverSaveUnread?sr(exports.ErrorCode.SERVER_RECORD_UNREAD_COUNT_ENABLED_FORBIDDEN):ir())).next((()=>this.svr.clearUnreadCountByTimestamp(e,r)));return this.logger.summary(n.A_CLEAR_UNREAD_COUNT_BY_TIME_R,i,t),i}))}sendReadReceiptRequest(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_SEND_READ_RECEIPT_REQ_T,JSON.stringify({identifier:e,messageUId:r}),t);const i=yield nr.create("sendReadReceiptRequest").check((t=>td(t,e,H))).isNotEmptyString("messageUId",r,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).next((()=>{const i={messageType:Q.READ_RECEIPT_REQUEST,content:{messageUId:r}};return this.ctx.sendMessage(e,i,t)}));return this.logger.summary(n.A_SEND_READ_RECEIPT_REQ_R,i,t),i.wipe()}))}sendReadReceiptMessage(e,r,i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_SEND_READ_RECEIPT_T,JSON.stringify({identifier:e,messageUId:r,timestamp:i}),t);const s=yield nr.create("sendReadReceiptMessage").check((t=>td(t,e,j))).isNotEmptyString("messageUId",r,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("timestamp",i,1,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((()=>{const s={messageType:Q.READ_RECEIPT,content:{messageUId:r,lastMessageSendTime:i,type:1}};return this.ctx.sendMessage(e,s,t)}));return this.logger.summary(n.A_SEND_READ_RECEIPT_R,s,t),s.wipe()}))}sendReadReceipt(e,r){return t(this,void 0,void 0,(function*(){const i=this.logger.createTraceId();this.logger.info(n.A_SEND_READ_RECEIPT_T,JSON.stringify({identifier:e,messageList:r}),i);const s=yield nr.create("sendReadReceipt").check((t=>td(t,e,H))).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).check((e=>{It(r)&&!Object.keys(r).some((t=>{const i=r[t];return e.isLimitedTypedArray("messageList",i,Number.MAX_SAFE_INTEGER,gt,!0).isFailed}))||e.setFailed(exports.ErrorCode.MSG_LIMIT_ERROR)})).result().tryTrans(this.validateConnected).next((s=>t(this,void 0,void 0,(function*(){const t=s.grpRRVer||0;if(0!==t&&1!==t)return sr(exports.ErrorCode.READ_RECEIPT_ERROR);if(1===t){const t=[];return Object.keys(r).forEach((e=>{t.push(...r[e])})),this.svr.sendReadReceiptV2(e.targetId,t,e.channelId)}const n={receiptMessageDic:r};return(yield this.ctx.sendMessage(e,{messageType:Q.READ_RECEIPT_RESPONSE,content:n},i)).wipe()}))));return this.logger.summary(n.A_SEND_READ_RECEIPT_R,s,i),s}))}getMessageReader(e,r,i){return t(this,void 0,void 0,(function*(){const s=this.logger.createTraceId();this.logger.info(n.A_GET_MSG_READER_T,JSON.stringify({targetId:e,messageUId:r,channelId:i}),s);const o=yield nr.create("getMessageReader").validate("targetId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isNotEmptyString("messageUId",r,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).validate("channelId",i,mt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((s=>t(this,void 0,void 0,(function*(){return 1!==s.grpRRVer?sr(exports.ErrorCode.READ_RECEIPT_ERROR):this.svr.getMessageReader(e,r,i||"")}))));return this.logger.summary(n.A_GET_MSG_READER_R,o,s,void 0,(({list:e})=>({size:e.length}))),o}))}sendReadReceiptMessageV4(e,r,i){return t(this,void 0,void 0,(function*(){const s=this.logger.createTraceId();this.logger.info(n.A_SEND_READ_RECEIPT_V4_T,JSON.stringify({conversation:e,endMsgUid:r,startMsgUid:i}),s);const o=yield nr.create("sendReadReceiptMessageV4").check((t=>td(t,e,w))).isNotEmptyString("endMsgUid",r,!0).fail(exports.ErrorCode.INVALID_PARAMETER_END_MESSAGE_UID).isNotEmptyString("startMsgUid",i).fail(exports.ErrorCode.INVALID_PARAMETER_START_MESSAGE_UID).result().tryTrans(this.validateConnected).next((s=>t(this,void 0,void 0,(function*(){return 3!==s.grpRRVer?sr(exports.ErrorCode.READ_RECEIPT_V4_NOT_SUPPORT):this.svr.sendReadReceiptMessageV4(e,i||"",r)}))));return this.logger.summary(n.A_SEND_READ_RECEIPT_V4_R,o,s),o}))}getMessageReadReceiptV4(e,r){return t(this,void 0,void 0,(function*(){const i=this.logger.createTraceId();this.logger.info(n.A_GET_READ_RECEIPT_V4_T,JSON.stringify({conversation:e,messageUId:r}),i);const s=yield nr.create("getMessageReadReceiptV4").check((t=>td(t,e,H))).isNotEmptyString("messageUId",r,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).next((i=>t(this,void 0,void 0,(function*(){return 3!==i.grpRRVer?sr(exports.ErrorCode.READ_RECEIPT_V4_NOT_SUPPORT):this.svr.getMessageReadReceiptV4(e,r)}))));return this.logger.summary(n.A_GET_READ_RECEIPT_V4_R,s,i,void 0,(({list:e})=>({size:e.length}))),s}))}batchGetMessageReadReceiptInfoV4(e,r){return t(this,void 0,void 0,(function*(){const i=this.logger.createTraceId();this.logger.info(n.A_BATCH_GET_READ_RECEIPT_INFO_V4_T,JSON.stringify({conversation:e,messageUIds:r}),i);const s=yield nr.create("batchGetMessageReadReceiptInfoV4").check((t=>td(t,e,H))).isTypedArray("messageUIds",r,gt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).next((i=>t(this,void 0,void 0,(function*(){return 3!==i.grpRRVer?sr(exports.ErrorCode.READ_RECEIPT_V4_NOT_SUPPORT):this.svr.batchGetMessageReadReceiptInfoV4(e,r)}))));return this.logger.summary(n.A_BATCH_GET_READ_RECEIPT_INFO_V4_R,s,i,void 0,(e=>({size:e.length}))),s}))}getConversationsIncludingRobots(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_CONVERSATIONS_INCLUDING_ROBOTS_T,JSON.stringify({options:e}),t);const r=yield nr.create("getConversationsIncludingRobots").isLimitedTypedArray("conversationTypes",null==e?void 0:e.conversationTypes,2,(e=>[exports.ConversationType.PRIVATE,exports.ConversationType.SYSTEM].includes(e)),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isLimitedInteger("count",null==e?void 0:e.count,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isTimestamp("timestamp",null==e?void 0:e.timestamp,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((()=>{const t=Object.assign(Object.assign({},e),{topPriority:!!e.topPriority});return this.svr.getConversationsIncludingRobots(t)}));return this.logger.summary(n.A_GET_CONVERSATIONS_INCLUDING_ROBOTS_R,r,t,void 0,(e=>({size:e.length}))),r}))}markRemoteConversationAsRead(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_MARK_REMOTE_CONVERSATION_AS_READ_T,JSON.stringify(e),t);const i=yield nr.create("markRemoteConversationAsRead").check((t=>td(t,e,V))).result().tryTrans(this.validateConnected).tryTrans((e=>e.serverSaveUnread?ir():sr(exports.ErrorCode.SERVER_RECORD_UNREAD_COUNT_DISABLED))).next((()=>{if(e.conversationType===exports.ConversationType.ULTRA_GROUP)return this.svr.clearConversationUnreadCount(r(this,lT,"m",dT).call(this,e));const i={lastMessageSendTime:this.ctx.serverTime},s={messageType:Q.SYNC_READ_STATUS,content:i,directionalUserIdList:Qt(e.conversationType,[this.ctx.userId])};return this.svr.markRemoteConversationAsRead(e,s,t)}));return this.logger.summary(n.A_MARK_REMOTE_CONVERSATION_AS_READ_R,i,t),i.wipe()}))}addMessageReaction(i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_ADD_MSG_REACTION_T,JSON.stringify(i),t);const s=yield nr.create("addMessageReaction").check((e=>td(e,null==i?void 0:i.conversationIdentifier,B))).isNotEmptyString("messageUId",null==i?void 0:i.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isLimitedString("reactionId",null==i?void 0:i.reactionId,1,16,!0).fail(exports.ErrorCode.REACTION_ID_INVALID).isObject("pushConfig",null==i?void 0:i.pushConfig).fail(exports.ErrorCode.INVALID_PARAMETER_PUSH_CONFIG).result().tryTrans(this.validateConnected).next((()=>{const{conversationIdentifier:t}=i,s=e(i,["conversationIdentifier"]);return this.svr.addMessageReaction(Object.assign(Object.assign({},s),{conversationIdentifier:r(this,lT,"m",dT).call(this,t)}))}));return this.logger.summary(n.A_ADD_MSG_REACTION_R,s,t),s}))}removeMessageReaction(i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_REMOVE_MSG_REACTION_T,JSON.stringify(i),t);const s=yield nr.create("removeMessageReaction").check((e=>td(e,null==i?void 0:i.conversationIdentifier,B))).isNotEmptyString("messageUId",null==i?void 0:i.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isLimitedString("reactionId",null==i?void 0:i.reactionId,1,16,!0).fail(exports.ErrorCode.REACTION_ID_INVALID).isObject("pushConfig",null==i?void 0:i.pushConfig).fail(exports.ErrorCode.INVALID_PARAMETER_PUSH_CONFIG).result().tryTrans(this.validateConnected).next((()=>{const{conversationIdentifier:t}=i,s=e(i,["conversationIdentifier"]);return this.svr.removeMessageReaction(Object.assign(Object.assign({},s),{conversationIdentifier:r(this,lT,"m",dT).call(this,t)}))}));return this.logger.summary(n.A_REMOVE_MSG_REACTION_R,s,t),s}))}batchGetMessageReactionSummaries(i){var s;return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_BATCH_GET_MSG_REACTION_SUMMARIES_T,JSON.stringify(i),t);const o=yield nr.create("batchGetMessageReactionSummaries").check((e=>td(e,null==i?void 0:i.conversationIdentifier,B))).isTypedArray("messageUIds",null==i?void 0:i.messageUIds,(e=>gt(e)),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("messageUIds",null===(s=null==i?void 0:i.messageUIds)||void 0===s?void 0:s.length,1,100,!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).next((()=>{const{conversationIdentifier:t}=i,s=e(i,["conversationIdentifier"]);return this.svr.batchGetMessageReactionSummaries(Object.assign({conversationIdentifier:r(this,lT,"m",dT).call(this,t)},s))}));return this.logger.summary(n.A_BATCH_GET_MSG_REACTION_SUMMARIES_R,o,t),o}))}getMessageReactions(i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_MSG_REACTIONS_T,JSON.stringify(i),t);const s=yield nr.create("getMessageReactions").check((e=>td(e,null==i?void 0:i.conversationIdentifier,B))).isNotEmptyString("messageUId",null==i?void 0:i.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("count",null==i?void 0:i.count,1,50,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isString("pageToken",null==i?void 0:i.pageToken).fail(exports.ErrorCode.INVALID_PARAMETER_PAGE_TOKEN).result().tryTrans(this.validateConnected).next((()=>{const{conversationIdentifier:t}=i,s=e(i,["conversationIdentifier"]);return this.svr.getMessageReactions(Object.assign({conversationIdentifier:r(this,lT,"m",dT).call(this,t)},s))}));return this.logger.summary(n.A_GET_MSG_REACTIONS_R,s,t,void 0,(({reactions:e})=>({size:e.length}))),s}))}getMessageReactionUsers(i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_MSG_REACTION_USERS_T,JSON.stringify(i),t);const s=yield nr.create("getMessageReactionUsers").check((e=>td(e,null==i?void 0:i.conversationIdentifier,B))).isNotEmptyString("messageUId",null==i?void 0:i.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isLimitedString("reactionId",null==i?void 0:i.reactionId,1,16,!0).fail(exports.ErrorCode.REACTION_ID_INVALID).isLimitedInteger("count",null==i?void 0:i.count,1,50,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isString("pageToken",null==i?void 0:i.pageToken).fail(exports.ErrorCode.INVALID_PARAMETER_PAGE_TOKEN).result().tryTrans(this.validateConnected).next((()=>{const{conversationIdentifier:t}=i,s=e(i,["conversationIdentifier"]);return this.svr.getMessageReactionUsers(Object.assign({conversationIdentifier:r(this,lT,"m",dT).call(this,t)},s))}));return this.logger.summary(n.A_GET_MSG_REACTION_USERS_R,s,t,void 0,(({users:e})=>({size:e.length}))),s}))}}lT=new WeakSet,cT=function(e){var t;return!!(2&((null===(t=this.ctx.naviInfo)||void 0===t?void 0:t.ugDriven)||0))&&!e?"RCDefault":e},dT=function(e){return e.conversationType!==exports.ConversationType.ULTRA_GROUP?e:Object.assign(Object.assign({},e),{channelId:r(this,lT,"m",cT).call(this,e.channelId)})};class pT extends Dr{constructor(e,r,i,s){const n=Qr();n.setLogReader(((e,r,i,s)=>t(this,void 0,void 0,(function*(){return{logs:[]}})))),n.setLogWriter((e=>{s(e)})),super(e,r,i,n)}getTimestamp4RealtimeLog(){return 0}setTimestamp4RealtimeLog(e){}}let TT=0,RT=Date.now();const fT=e=>{const t=Date.now();return RT!==t&&(RT=t,TT=0),[e,window.__RCCppContextBridge__.process.pid,t,TT++].join("__")},AT=()=>t(void 0,void 0,void 0,(function*(){return sr(exports.ErrorCode.NOT_SUPPORT,"Not support")}));class mT{constructor(e,t){var r;_T.add(this),Object.defineProperty(this,"_initOptions",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_cache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),uT.set(this,void 0),hT.set(this,void 0),ET.set(this,!1),Object.defineProperty(this,"_resolveMaps",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"loadConversationList",{enumerable:!0,configurable:!0,writable:!0,value:AT}),Object.defineProperty(this,"batchGetMessageReadReceiptInfoV4",{enumerable:!0,configurable:!0,writable:!0,value:AT}),Object.defineProperty(this,"getRealtimeConversations",{enumerable:!0,configurable:!0,writable:!0,value:AT}),Object.defineProperty(this,"getRealtimeConTotalUnreadCount",{enumerable:!0,configurable:!0,writable:!0,value:AT}),Object.defineProperty(this,"clearRealtimeConUnreadCount",{enumerable:!0,configurable:!0,writable:!0,value:AT}),Object.defineProperty(this,"removeRealtimeConversations",{enumerable:!0,configurable:!0,writable:!0,value:AT}),Object.defineProperty(this,"batchGetRealtimeConUnreadCount",{enumerable:!0,configurable:!0,writable:!0,value:AT});const s=t,o=e=>this._send2Main("onReceiveRendererLog",e),a=i(this,hT,new pT(s.appkey,"IMLib","IM",o),"f");i(this,uT,o,"f"),a.setOutputLevel(s.logOutputLevel);const{ipcRenderer:l}=window.__RCCppContextBridge__;l.on("__RC_CHANNEL_NOTIFICATION_FROM_MAIN__",((t,r,...s)=>{const o=e[r];if(o){switch(r){case"ultraGroupEnable":i(this,ET,!0,"f");break;case"onNaviDataChange":this._cache.naviInfo=s[0];break;case"onRTCDataChange":s[0]=new Uint8Array(s[0]);break;case"onConnected":i(this,ET,!1,"f"),this._cache=s[1];break;case"onSuspend":i(this,ET,!1,"f"),this._setConnectionStatus(exports.RCConnectionStatus.SUSPENDED);break;case"onDisconnected":i(this,ET,!1,"f"),this._setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED);break;case"onConnecting":this._setConnectionStatus(exports.RCConnectionStatus.CONNECTING)}o(...s)}else this.logger.error(n.L_UNSUPPORT_NTF_FROM_MAIN_E,r)})),l.on("__RC_CHANNEL_RESULT_FROM_MAIN__",((e,t,...r)=>{const i=this._resolveMaps[t];i&&(delete this._resolveMaps[t],i(...r))})),s.httpInMainProcess&&(io.httpReq=this.sendHTTPRequest.bind(this));const c={navigators:s.navigators,areaCode:s.areaCode,logServerUrl:s.logServerUrl,environment:s.environment,enableReadReceiptStorage:s.enableReadReceiptStorage,useNaviV2:null!==(r=s.useNaviV2)&&void 0!==r&&r,commitId:"07c327459d99ef27cc3fa8e218a316fa67bab020"};if(l.send("__RC_INNER_COMMAND_INIT__",c),this._cache=this._callMainSync("getMainProcessCache"),"07c327459d99ef27cc3fa8e218a316fa67bab020"!==this._cache.commitId)throw new Error("SDK version mismatch.")}get chat(){return this}get chatroom(){return this}get userSettings(){return this}get dataHosting(){return this}get logger(){return r(this,hT,"f")}get ugSynced(){return r(this,ET,"f")}_setConnectionStatus(e){this._cache.connectionStatus=e,e===exports.RCConnectionStatus.DISCONNECTED&&(this._cache.crtUserId="")}sendHTTPRequest(e){return this._callMain("sendHTTPRequest",e)}_callMain(e,...t){const{ipcRenderer:r}=window.__RCCppContextBridge__;return new Promise((i=>{const s=fT(e);this._resolveMaps[s]=i,r.send("__RC_CHANNEL_CALL_MAIN__",s,e,...t)}))}_send2Main(e,...t){window.__RCCppContextBridge__.ipcRenderer.send("__RC_CHANNEL_SEND_2_MAIN__",e,...t)}_callMainSync(e,...t){return window.__RCCppContextBridge__.ipcRenderer.sendSync("__RC_CHANNEL_CALL_MAIN_SYNC__",e,...t)}refetchNaviInfo(){return r(this,_T,"m",gT).call(this,"refetchNaviInfo")}get naviInfo(){return this._cache.naviInfo}createLogger(e,t){return new pT(this.appkey,e,t,r(this,uT,"f"))}get connectionStatus(){return this._cache.connectionStatus}get usingCppEngine(){return!0}connect(e,i,s,n){return t(this,void 0,void 0,(function*(){return r(this,_T,"m",gT).call(this,"connect",e,i,s,n)}))}reportSDKInfo(e){this._send2Main("reportSDKInfo",e)}get connectedTime(){return this._cache.connectedTime}getHistoryMessage(e,t,i){return r(this,_T,"m",gT).call(this,"getHistoryMessage",e,t,i)}getContinuousMessages(e,t){return r(this,_T,"m",gT).call(this,"getContinuousMessages",e,t)}getHistoryMessagesByObjectNames(e,t){return r(this,_T,"m",gT).call(this,"getHistoryMessagesByObjectNames",e,t)}deleteRemoteMessage(e,t){return r(this,_T,"m",gT).call(this,"deleteRemoteMessage",e,t)}recallMsg(e,t){return r(this,_T,"m",gT).call(this,"recallMsg",e,t)}deleteRemoteMessageByTimestamp(e,t){return r(this,_T,"m",gT).call(this,"deleteRemoteMessageByTimestamp",e,t)}getTopConversationList(e,t,i){return r(this,_T,"m",gT).call(this,"getTopConversationList",e,t,i)}getUnreadConversationList(e,t){return r(this,_T,"m",gT).call(this,"getUnreadConversationList",e,t)}getAllConversationList(e,t){return r(this,_T,"m",gT).call(this,"getAllConversationList",e,t)}getConversationListByTimestamp(e,t){return r(this,_T,"m",gT).call(this,"getConversationListByTimestamp",e,t)}getUntaggedConversationListByPage(e,t,i){return r(this,_T,"m",gT).call(this,"getUntaggedConversationListByPage",e,t,i)}getConversation(e){return r(this,_T,"m",gT).call(this,"getConversation",e)}batchDeleteConversations(e){return r(this,_T,"m",gT).call(this,"batchDeleteConversations",e)}getTotalUnreadCount(e,t,i){return r(this,_T,"m",gT).call(this,"getTotalUnreadCount",e,t,i)}getConversationUnreadCount(e){return r(this,_T,"m",gT).call(this,"getConversationUnreadCount",e)}getTotalUnreadCountByLevels(e,t,i){return r(this,_T,"m",gT).call(this,"getTotalUnreadCountByLevels",e,t,i)}clearConversationUnreadCount(e){return r(this,_T,"m",gT).call(this,"clearConversationUnreadCount",e)}markRemoteConversationAsRead(e,t,i){return r(this,_T,"m",gT).call(this,"markRemoteConversationAsRead",e,t,i)}getFirstUnreadMessage(e){return r(this,_T,"m",gT).call(this,"getFirstUnreadMessage",e)}getFirstUnreadMessageDigest(e){return r(this,_T,"m",gT).call(this,"getFirstUnreadMessageDigest",e)}saveTextMessageDraft(e,t){return r(this,_T,"m",gT).call(this,"saveTextMessageDraft",e,t)}getTextMessageDraft(e){return r(this,_T,"m",gT).call(this,"getTextMessageDraft",e)}clearTextMessageDraft(e){return r(this,_T,"m",gT).call(this,"clearTextMessageDraft",e)}batchSetConversationToTop(e,t,i,s){return r(this,_T,"m",gT).call(this,"batchSetConversationToTop",e,t,i,s)}batchSetConversationNotificationLevel(e,t){return r(this,_T,"m",gT).call(this,"batchSetConversationNotificationLevel",e,t)}batchSetConversationTranslateStrategy(e,t){return r(this,_T,"m",gT).call(this,"batchSetConversationTranslateStrategy",e,t)}sendMessage(e,t,i,s){const o=["sendMessageBefore",Date.now(),Math.floor(Math.random()*Date.now())].join("_");return s&&(this._resolveMaps[o]=e=>{try{s(e)}catch(e){this.logger.error(n.L_CALLBACK_E,JSON.stringify({error:null==e?void 0:e.stack,pos:"sendMsgBefore"}))}}),r(this,_T,"m",gT).call(this,"sendMessage",e,t,i,o)}sendReadReceiptV2(e,t,i){return r(this,_T,"m",gT).call(this,"sendReadReceiptV2",e,t,i)}getMessageReader(e,t,i){return r(this,_T,"m",gT).call(this,"getMessageReader",e,t,i)}sendReadReceiptMessageV4(e,t,i){return r(this,_T,"m",gT).call(this,"sendReadReceiptMessageV4",e,t,i)}getMessageReadReceiptV4(e,t){return r(this,_T,"m",gT).call(this,"getMessageReadReceiptV4",e,t)}updateConversationReadTime(e,t){return r(this,_T,"m",gT).call(this,"updateConversationReadTime",e,t)}disconnect(e,i){return t(this,void 0,void 0,(function*(){return r(this,_T,"m",gT).call(this,"disconnect",e,i)}))}registerMessageType(e,t){this._send2Main("registerMessageType",e,t)}joinChatroom(e,t,i,s){return r(this,_T,"m",gT).call(this,"joinChatroom",e,t,i,s)}quitChatroom(e,t){return r(this,_T,"m",gT).call(this,"quitChatroom",e,t)}getChatroomInfo(e,t,i){return r(this,_T,"m",gT).call(this,"getChatroomInfo",e,t,i)}getChatroomHistoryMessages(e,t,i,s){return r(this,_T,"m",gT).call(this,"getChatroomHistoryMessages",e,t,i,s)}setChatroomEntry(e,t,i){return r(this,_T,"m",gT).call(this,"setChatroomEntry",e,t,i)}setChatroomEntries(e,t){return r(this,_T,"m",gT).call(this,"setChatroomEntries",e,t)}removeChatroomEntry(e,t,i){return r(this,_T,"m",gT).call(this,"removeChatroomEntry",e,t,i)}removeChatroomEntries(e,t){return r(this,_T,"m",gT).call(this,"removeChatroomEntries",e,t)}getChatroomEntry(e,t){return r(this,_T,"m",gT).call(this,"getChatroomEntry",e,t)}getAllChatroomEntries(e){return r(this,_T,"m",gT).call(this,"getAllChatroomEntries",e)}getFileToken(e,t,i,s,n,o){return r(this,_T,"m",gT).call(this,"getFileToken",e,t,i,s,n,o)}getFileUrl(e,t,i,s){return r(this,_T,"m",gT).call(this,"getFileUrl",e,t,i,s)}setUserStatus(e){return r(this,_T,"m",gT).call(this,"setUserStatus",e)}getUserStatus(e){return r(this,_T,"m",gT).call(this,"getUserStatus",e)}clearConversations(e,t){return r(this,_T,"m",gT).call(this,"clearConversations",e,t)}addToBlacklist(e){return r(this,_T,"m",gT).call(this,"addToBlacklist",e)}removeFromBlacklist(e){return r(this,_T,"m",gT).call(this,"removeFromBlacklist",e)}getBlacklist(){return r(this,_T,"m",gT).call(this,"getBlacklist")}getBlacklistStatus(e){return r(this,_T,"m",gT).call(this,"getBlacklistStatus",e)}insertMessage(e,t){return r(this,_T,"m",gT).call(this,"insertMessage",e,t)}batchInsertMessage(e,t){return r(this,_T,"m",gT).call(this,"batchInsertMessage",e,t)}getLocalMessageCount(e){return r(this,_T,"m",gT).call(this,"getLocalMessageCount",e)}deleteLocalMessages(e){return r(this,_T,"m",gT).call(this,"deleteLocalMessages",e)}deleteLocalMessagesByTimestamp(e,t,i){return r(this,_T,"m",gT).call(this,"deleteLocalMessagesByTimestamp",e,t,i)}batchClearLocalMessagesByTimestamp(e){return r(this,_T,"m",gT).call(this,"batchClearLocalMessagesByTimestamp",e)}batchClearRemoteHistoryMessages(e,t){return r(this,_T,"m",gT).call(this,"batchClearRemoteHistoryMessages",e,t)}clearLocalMessages(e){return r(this,_T,"m",gT).call(this,"clearLocalMessages",e)}getMessage(e){return r(this,_T,"m",gT).call(this,"getMessage",e)}setMessageContent(e,t,i){return r(this,_T,"m",gT).call(this,"setMessageContent",e,t,i)}setMessageSearchField(e,t,i){return r(this,_T,"m",gT).call(this,"setMessageSearchField",e,t,i)}searchConversationByContent(e,t,i,s){return r(this,_T,"m",gT).call(this,"searchConversationByContent",e,t,i,s)}searchConversationByContentWithAllChannel(e,t,i){return r(this,_T,"m",gT).call(this,"searchConversationByContentWithAllChannel",e,t,i)}searchMessagesWithParams(e){return r(this,_T,"m",gT).call(this,"searchMessagesWithParams",e)}getUnreadMentionedMessages(e){return r(this,_T,"m",gT).call(this,"getUnreadMentionedMessages",e)}getUnreadMentionedCount(e){return r(this,_T,"m",gT).call(this,"getUnreadMentionedCount",e)}getMessagesAroundTimestamp(e,t,i,s){return r(this,_T,"m",gT).call(this,"getMessagesAroundTimestamp",e,t,i,s)}setMessageSentStatus(e,t){return r(this,_T,"m",gT).call(this,"setMessageSentStatus",e,t)}setMessageReceivedStatus(e,t){return r(this,_T,"m",gT).call(this,"setMessageReceivedStatus",e,t)}updateMessageReceiptStatus(e,t,i,s){return r(this,_T,"m",gT).call(this,"updateMessageReceiptStatus",e,t,i,s)}clearUnreadCountByTimestamp(e,t){return r(this,_T,"m",gT).call(this,"clearUnreadCountByTimestamp",e,t)}clearAllSGUnreadCount(){return t(this,void 0,void 0,(function*(){return r(this,_T,"m",gT).call(this,"clearAllSGUnreadCount")}))}get serverTime(){return Date.now()-this._cache.deltaTime}get deviceId(){return this._cache.deviceId}setPushConfig(e){}get userId(){return this._cache.crtUserId}bindRTCRoomForChatroom(e){return r(this,_T,"m",gT).call(this,"bindRTCRoomForChatroom",e)}rtcSignaling(e,i,s,n){return t(this,void 0,void 0,(function*(){const t=Array.prototype.slice.call(new Uint8Array(n));return(yield r(this,_T,"m",gT).call(this,"rtcSignaling",e,i,s,t)).trans((e=>new Uint8Array(e)))}))}rtcPing(e,t,i){return r(this,_T,"m",gT).call(this,"rtcPing",e,t,i)}createTag(e){return r(this,_T,"m",gT).call(this,"createTag",e)}removeTag(e){return r(this,_T,"m",gT).call(this,"removeTag",e)}updateTag(e){return r(this,_T,"m",gT).call(this,"updateTag",e)}getTagList(){return r(this,_T,"m",gT).call(this,"getTagList")}addTagForConversations(e,t){return r(this,_T,"m",gT).call(this,"addTagForConversations",e,t)}removeTagForConversations(e,t){return r(this,_T,"m",gT).call(this,"removeTagForConversations",e,t)}removeTagsForConversation(e,t){return r(this,_T,"m",gT).call(this,"removeTagsForConversation",e,t)}getConversationListByTag(e,t,i){return r(this,_T,"m",gT).call(this,"getConversationListByTag",e,t,i)}getUnreadCountByTag(e,t){return r(this,_T,"m",gT).call(this,"getUnreadCountByTag",e,t)}setConversationStatusInTag(e,t,i){return r(this,_T,"m",gT).call(this,"setConversationStatusInTag",e,t,i)}getTagsForConversation(e){return r(this,_T,"m",gT).call(this,"getTagsForConversation",e)}clearLocalData(){return r(this,_T,"m",gT).call(this,"clearLocalData")}setCallInfo(e,t,i){return r(this,_T,"m",gT).call(this,"setCallInfo",e,t,i)}getAllUnreadMentionedCount(){return r(this,_T,"m",gT).call(this,"getAllUnreadMentionedCount")}getUltraGroupList(e){return r(this,_T,"m",gT).call(this,"getUltraGroupList",e)}getBlockedUGList(){return r(this,_T,"m",gT).call(this,"getBlockedUGList")}getBlockedConversationList(e){return r(this,_T,"m",gT).call(this,"getBlockedConversationList",e)}sendUltraMessage(e,t,r,i){return this.sendMessage(e,t,r,i)}getConversationNotificationLevel(e){return r(this,_T,"m",gT).call(this,"getConversationNotificationLevel",e)}setConversationTypeNotificationLevel(e,t){return r(this,_T,"m",gT).call(this,"setConversationTypeNotificationLevel",e,t)}getConversationTypeNotificationLevel(e){return r(this,_T,"m",gT).call(this,"getConversationTypeNotificationLevel",e)}getUGUnreadCountForAllChannels(e,t,i){return r(this,_T,"m",gT).call(this,"getUGUnreadCountForAllChannels",e,t,i)}setUGDefaultNotificationLevel(e,t,i){return r(this,_T,"m",gT).call(this,"setUGDefaultNotificationLevel",e,t,i)}getUGDefaultNotificationLevel(e,t){return r(this,_T,"m",gT).call(this,"getUGDefaultNotificationLevel",e,t)}getUGUnreadInfoList(e){return r(this,_T,"m",gT).call(this,"getUGUnreadInfoList",e)}getOSInfo(){return t(this,void 0,void 0,(function*(){return r(this,_T,"m",gT).call(this,"getOSInfo")}))}getProcessInfo(){return t(this,void 0,void 0,(function*(){const{process:e}=window.__RCCppContextBridge__,t={title:e.title,pid:e.pid,ppid:e.ppid,platform:e.platform,arch:e.arch,uptime:e.uptime(),cpuUsage:e.cpuUsage(),memoryUsage:e.memoryUsage(),resourceUsage:e.resourceUsage()};return ir(t)}))}getMainProcessInfo(){return t(this,void 0,void 0,(function*(){return r(this,_T,"m",gT).call(this,"getMainProcessInfo")}))}setProxy(e){return r(this,_T,"m",gT).call(this,"setProxy",e)}getProxy(){return r(this,_T,"m",gT).call(this,"getProxy")}testProxy(e,t){return r(this,_T,"m",gT).call(this,"testProxy",e,t)}setCheckDuplicateMessage(e){return r(this,_T,"m",gT).call(this,"setCheckDuplicateMessage",e)}setCheckChatRoomDuplicateMessage(e){return r(this,_T,"m",gT).call(this,"setCheckChatRoomDuplicateMessage",e)}setNetwork(e,t){this._send2Main("setNetwork",e,t)}subscribeUser(e,t,i){return r(this,_T,"m",gT).call(this,"subscribeUser",e,t,i)}unSubscribeUser(e,t){return r(this,_T,"m",gT).call(this,"unSubscribeUser",e,t)}getSubscribeUserList(e,t,i){return r(this,_T,"m",gT).call(this,"getSubscribeUserList",e,t,i)}getSubscribeUserStatus(e,t){return r(this,_T,"m",gT).call(this,"getSubscribeUserStatus",e,t)}getConversations(e){return r(this,_T,"m",gT).call(this,"getConversations",e)}updateMyUserProfile(e){return r(this,_T,"m",gT).call(this,"updateMyUserProfile",e)}getUserProfiles(e){return r(this,_T,"m",gT).call(this,"getUserProfiles",e)}getMyUserProfile(){return r(this,_T,"m",gT).call(this,"getMyUserProfile")}updateMyUserProfileVisibility(e){return r(this,_T,"m",gT).call(this,"updateMyUserProfileVisibility",e)}getMyUserProfileVisibility(){return r(this,_T,"m",gT).call(this,"getMyUserProfileVisibility")}searchUserProfileByUniqueId(e){return r(this,_T,"m",gT).call(this,"searchUserProfileByUniqueId",e)}createGroup(e,i,s,n){return t(this,void 0,void 0,(function*(){return r(this,_T,"m",gT).call(this,"createGroup",e,i,s,n)}))}updateGroupInfo(e,t,i){return r(this,_T,"m",gT).call(this,"updateGroupInfo",e,t,i)}getGroupsInfo(e){return r(this,_T,"m",gT).call(this,"getGroupsInfo",e)}kickGroupMembers(e,t,i){return r(this,_T,"m",gT).call(this,"kickGroupMembers",e,t,i)}quitGroup(e,t){return r(this,_T,"m",gT).call(this,"quitGroup",e,t)}dismissGroup(e){return r(this,_T,"m",gT).call(this,"dismissGroup",e)}transferGroupOwner(e,t,i,s){return r(this,_T,"m",gT).call(this,"transferGroupOwner",e,t,i,s)}setGroupManagers(e,t,i){return r(this,_T,"m",gT).call(this,"setGroupManagers",e,t,i)}getGroupMembersByRole(e,t,i){return r(this,_T,"m",gT).call(this,"getGroupMembersByRole",e,t,i)}getGroupMembers(e,t){return r(this,_T,"m",gT).call(this,"getGroupMembers",e,t)}setGroupMemberInfo(e,t,i,s){return r(this,_T,"m",gT).call(this,"setGroupMemberInfo",e,t,i,s)}searchGroupMembers(e,t,i){return r(this,_T,"m",gT).call(this,"searchGroupMembers",e,t,i)}joinGroup(e){return r(this,_T,"m",gT).call(this,"joinGroup",e)}inviteUsersToGroup(e,t){return r(this,_T,"m",gT).call(this,"inviteUsersToGroup",e,t)}memberInviteResponse(e){return r(this,_T,"m",gT).call(this,"memberInviteResponse",e)}getGroupApplications(e,t,i){return r(this,_T,"m",gT).call(this,"getGroupApplications",e,t,i)}getJoinedGroupsByRole(e,t){return r(this,_T,"m",gT).call(this,"getJoinedGroupsByRole",e,t)}searchJoinedGroups(e,t){return r(this,_T,"m",gT).call(this,"searchJoinedGroups",e,t)}getJoinedGroups(e){return r(this,_T,"m",gT).call(this,"getJoinedGroups",e)}setGroupRemark(e,t){return r(this,_T,"m",gT).call(this,"setGroupRemark",e,t)}setGroupFollows(e,t,i){return r(this,_T,"m",gT).call(this,"setGroupFollows",e,t,i)}getGroupFollows(e){return r(this,_T,"m",gT).call(this,"getGroupFollows",e)}addFriend(e,t,i){return r(this,_T,"m",gT).call(this,"addFriend",e,t,i)}deleteFriends(e,t){return r(this,_T,"m",gT).call(this,"deleteFriends",e,t)}acceptFriendRequest(e){return r(this,_T,"m",gT).call(this,"acceptFriendRequest",e)}refuseFriendRequest(e,t){return r(this,_T,"m",gT).call(this,"refuseFriendRequest",e,t)}setFriendInfo(e,t,i){return r(this,_T,"m",gT).call(this,"setFriendInfo",e,t,i)}checkFriends(e,t){return r(this,_T,"m",gT).call(this,"checkFriends",e,t)}getFriends(e,t){return r(this,_T,"m",gT).call(this,"getFriends",e,t)}getFriendApplications(e,t,i){return r(this,_T,"m",gT).call(this,"getFriendApplications",e,t,i)}getFriendsInfo(e){return r(this,_T,"m",gT).call(this,"getFriendsInfo",e)}searchFriendsInfo(e){return r(this,_T,"m",gT).call(this,"searchFriendsInfo",e)}setFriendAddPermission(e){return r(this,_T,"m",gT).call(this,"setFriendAddPermission",e)}getFriendAddPermission(){return r(this,_T,"m",gT).call(this,"getFriendAddPermission")}setNotificationQuietHoursWithSetting(e){return t(this,void 0,void 0,(function*(){return r(this,_T,"m",gT).call(this,"setNotificationQuietHoursWithSetting",e)}))}removeNotificationQuietHoursSetting(){return t(this,void 0,void 0,(function*(){return r(this,_T,"m",gT).call(this,"removeNotificationQuietHoursSetting")}))}getNotificationQuietHoursSetting(){return t(this,void 0,void 0,(function*(){return r(this,_T,"m",gT).call(this,"getNotificationQuietHoursSetting")}))}getStatsUrlList(){return r(this,_T,"m",gT).call(this,"getStatsUrlList")}sendReadReceiptResponseV5(e,t){return r(this,_T,"m",gT).call(this,"sendReadReceiptResponseV5",e,t)}getMessageReadReceiptInfoV5ByIdentifiers(e){return r(this,_T,"m",gT).call(this,"getMessageReadReceiptInfoV5ByIdentifiers",e)}getMessagesReadReceiptUsersByPageV5(e,t,i){return r(this,_T,"m",gT).call(this,"getMessagesReadReceiptUsersByPageV5",e,t,i)}getMessagesReadReceiptByUsersV5(e,t,i){return r(this,_T,"m",gT).call(this,"getMessagesReadReceiptByUsersV5",e,t,i)}requestSpeechToTextForMessage(e,t){return r(this,_T,"m",gT).call(this,"requestSpeechToTextForMessage",e)}setMessageSpeechToTextVisible(e,t){return r(this,_T,"m",gT).call(this,"setMessageSpeechToTextVisible",e,t)}translateWithParams(e,t,i,s){return r(this,_T,"m",gT).call(this,"translateWithParams",e,t,i,s)}setTranslationLanguage(e){return r(this,_T,"m",gT).call(this,"setTranslationLanguage",e)}getTranslationLanguage(){return r(this,_T,"m",gT).call(this,"getTranslationLanguage")}setAutoTranslateEnabled(e){return r(this,_T,"m",gT).call(this,"setAutoTranslateEnabled",e)}getAutoTranslateEnabled(){return r(this,_T,"m",gT).call(this,"getAutoTranslateEnabled")}modifyMessageWithParams(e){return r(this,_T,"m",gT).call(this,"modifyMessageWithParams",e)}refreshReferenceMessageWithParams(e,i,s,o){return t(this,void 0,void 0,(function*(){const t=(e,t)=>{const r=[e,Date.now(),Math.floor(Math.random()*Date.now())].join("_");return this._resolveMaps[r]=r=>{try{t(r)}catch(t){this.logger.error(n.L_CALLBACK_E,JSON.stringify({error:null==t?void 0:t.stack,pos:e}))}},r},a=t("localMessageBlock",o),l=t("remoteMessageBlock",s);return r(this,_T,"m",gT).call(this,"refreshReferenceMessageWithParams",e,i,l,a)}))}syncRemoteConversations(){return r(this,_T,"m",gT).call(this,"syncRemoteConversations")}sendUltraGroupTypingStatus(e){return r(this,_T,"m",gT).call(this,"sendUltraGroupTypingStatus",e)}getRemoteMessagesByUIds(e,t){return r(this,_T,"m",gT).call(this,"getRemoteMessagesByUIds",e,t)}getUGUnreadMentionedDigest(e){return r(this,_T,"m",gT).call(this,"getUGUnreadMentionedDigest",e)}deleteLocalUGMessagesForAllChannel(e,t){return r(this,_T,"m",gT).call(this,"deleteLocalUGMessagesForAllChannel",e,t)}updateUGMessageExpansion(e,t,i){return r(this,_T,"m",gT).call(this,"updateUGMessageExpansion",e,t,i)}getUGFirstUnreadMessageDigest(e){return r(this,_T,"m",gT).call(this,"getUGFirstUnreadMessageDigest",e)}getSubscribeUsersOnlineStatus(e){return r(this,_T,"m",gT).call(this,"getSubscribeUsersOnlineStatus",e)}saveEditedMessageDraft(e,t){return r(this,_T,"m",gT).call(this,"saveEditedMessageDraft",e,t)}getEditedMessageDraft(e){return r(this,_T,"m",gT).call(this,"getEditedMessageDraft",e)}clearEditedMessageDraft(e){return r(this,_T,"m",gT).call(this,"clearEditedMessageDraft",e)}getUnreadMentionMeConversationList(e,t){return r(this,_T,"m",gT).call(this,"getUnreadMentionMeConversationList",e,t)}getAllRobots(){return r(this,_T,"m",gT).call(this,"getAllRobots")}getConversationsIncludingRobots(e){return r(this,_T,"m",gT).call(this,"getConversationsIncludingRobots",e)}getMessagesByUIds(e,t){return r(this,_T,"m",gT).call(this,"getMessagesByUIds",e,t)}get appkey(){return this._initOptions.appkey}destroy(){}addMessageReaction(e){return r(this,_T,"m",gT).call(this,"addMessageReaction",e)}removeMessageReaction(e){return r(this,_T,"m",gT).call(this,"removeMessageReaction",e)}batchGetMessageReactionSummaries(e){return r(this,_T,"m",gT).call(this,"batchGetMessageReactionSummaries",e)}getMessageReactions(e){return r(this,_T,"m",gT).call(this,"getMessageReactions",e)}getMessageReactionUsers(e){return r(this,_T,"m",gT).call(this,"getMessageReactionUsers",e)}}var ST,vT,CT,yT,OT,NT,MT,bT,LT;function UT(e){return Object.assign({},e)}uT=new WeakMap,hT=new WeakMap,ET=new WeakMap,_T=new WeakSet,gT=function(e,...t){const{promise:r,resolve:i}=lr(),s=fT(e);return this._resolveMaps[s]=({code:e,msg:t,data:r})=>{i(rr.from(e,t,r))},window.__RCCppContextBridge__.ipcRenderer.send("__RC_CHANNEL_CALL_MAIN__",s,e,...t),r};class PT{constructor(e){ST.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,"chatroom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"chat",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dataHosting",{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,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_compatibleMessageProccessor",{enumerable:!0,configurable:!0,writable:!0,value:{[Q.TYPING_STATUS]:this._processTypingStatusMessage.bind(this),[Q.INTERCEPT]:this._processInterceptMessage.bind(this)}}),Object.defineProperty(this,"_messageProccessor",{enumerable:!0,configurable:!0,writable:!0,value:{[Q.READ_RECEIPT]:this._processReadReceiptMessage.bind(this),[Q.READ_RECEIPT_REQUEST]:this._processReadReceiptRequestMessage.bind(this),[Q.READ_RECEIPT_RESPONSE]:this._processReadReceiptResponseMessage.bind(this)}}),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,robotsSynced: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,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,databaseOpened: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,syncServerSaveUnreadCompleted:void 0,messageReaction: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:[]}),Object.defineProperty(this,"_rtcListener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._options=Object.assign({},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((e=>e.replace(/\/$/g,"")));const t={onRTCDataChange:this._rtcDataChange.bind(this),onConnected:()=>this._onConnectionStatusChange(exports.RCConnectionStatus.CONNECTED),onConnecting:this._onConnectionStatusChange.bind(this,exports.RCConnectionStatus.CONNECTING),onSuspend:this._onConnectionStatusChange.bind(this,exports.RCConnectionStatus.SUSPENDED),onDisconnected:this._onConnectionStatusChange.bind(this,exports.RCConnectionStatus.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),robotsSynced:this._onRobotsSynced.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),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),databaseOpened:this._databaseOpened.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),syncServerSaveUnreadCompleted:this._syncServerSaveUnreadCompleted.bind(this),messageReaction:this._onMessageReaction.bind(this)},r=Ct();this._engine=r?new mT(t,this._options):new Jp(t,this._options),this.logger=this._engine.logger,this._options.eventLoopBlockingCheck&&Xr.start(this.logger),this.sse=new qc(this,r),this.chatroom=new Xp(this._engine,this._engine.chatroom),this.dataHosting=new tT(this._engine,this._engine.dataHosting),this.chat=new IT(this._engine,this._engine.chat)}static init(e){if(this._context)return this._context.logger.warn(n.A_INIT_REPEAT_O),this._context;this._context=new PT(e),this._context.logger.info(n.L_INIT_O,JSON.stringify({appkey:e.appkey,navigators:e.navigators,typingExpireTime:e.typingExpireTime,runtime:io.tag})),this._context.logger.warn(n.L_IMSDK_VER_O,JSON.stringify({commitId:"07c327459d99ef27cc3fa8e218a316fa67bab020",version:"5.44.0-alpha.1"}));const t=this._context._engine;return io.setNetworkStatusListener(t.setNetwork.bind(t)),this._context}static getContext(){return this._context}getOptions(){return this._options}static destroy(){return t(this,void 0,void 0,(function*(){this._context&&(this._context.logger.info(n.A_DESTROY_O),yield this._context._destroy(),this._context=void 0)}))}install(e,t){const r=this.logger.createTraceId();if(this.logger.info(n.L_INSTALL_PLUGIN_T,JSON.stringify({tag:e.tag}),r),this._pluginInstanseMap[e.tag])return this.logger.warn(n.L_INSTALL_PLUGIN_R,"repeat install",r),this._pluginInstanseMap[e.tag];const i="RCRTC"===e.tag?new Qc(this):new Kc(this);let s=null;try{if(!e.verify(io))return null;s=e.setup(i,io,t)}catch(e){this.logger.error(n.L_INSTALL_PLUGIN_R,null==e?void 0:e.stack,r)}return["RCRTC","RCCall"].includes(e.tag)&&e.version&&e.name&&(this._versionInfo[e.name]=e.version),s&&(this._pluginContextQueue.push(i),this._pluginInstanseMap[e.tag]=s),s}registerCustomSignalHandler(e,t){var r,i;null===(i=(r=this._engine).registerCustomSignalHandler)||void 0===i||i.call(r,e,t)}getAppSettings(){return this.validateLogin().trans((e=>new Kp(e)))}_onConnectionStatusChange(e,t){var r,i;this.logger.warn(n.A_CONNECT_S,`status: ${e}, code: ${t}`),null===(i=(r=this._watcher).connection)||void 0===i||i.call(r,e,t),this._pluginContextQueue.forEach((r=>{var i;null===(i=r.onconnectionstatechange)||void 0===i||i.call(r,e,t)}))}_processTypingStatusMessage(e){return this._addTypingInfo(UT(e)),!!this._watcher.typingState}_processInterceptMessage(e){const 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===exports.ConversationType.ULTRA_GROUP){const{sourceType:r}=e.content;if(t.sourceType=r,(r===exports.MessageBlockSourceType.MSG_EXPANSION||r===exports.MessageBlockSourceType.MSG_MODIFY)&&e.content.sourceContent)try{t.sourceContent=JSON.parse(e.content.sourceContent)}catch(e){this.logger.warn(n.L_CALLBACK_E,JSON.stringify({source:"message.content.sourceContent",msg:e.message}))}}return this._MessageBlockedListener(t),!0}_processReadReceiptMessage(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)}_processReadReceiptRequestMessage(e){"function"==typeof this._watcher.messageReceiptRequest&&this._watcher.messageReceiptRequest({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.content.messageUId,e.senderUserId)}_processReadReceiptResponseMessage(e){var t;const r=null===(t=e.content)||void 0===t?void 0:t.receiptMessageDic,{userId:i}=this._engine;r&&Array.isArray(r[i])&&"function"==typeof this._watcher.messageReceiptResponse&&this._watcher.messageReceiptResponse({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.senderUserId,r[i])}_messageReceiver(e,t,r){var i,s,o,a;if(!(null===(s=(i=this._compatibleMessageProccessor)[e.messageType])||void 0===s?void 0:s.call(i,e))&&!this._pluginContextQueue.some((t=>{if(!t.onmessage)return!1;try{return t.onmessage(UT(e))}catch(e){return this.logger.error(n.A_MSG_LISTENER_E,null==e?void 0:e.stack),!1}})))return null===(a=(o=this._watcher).message)||void 0===a||a.call(o,UT(e),t,r),e}_batchMessageReceiver(e,t,r){const i=[],s=[],o=[Q.READ_RECEIPT,Q.READ_RECEIPT_REQUEST,Q.READ_RECEIPT_RESPONSE];e.forEach((e=>{const n=this._messageReceiver(e,t,r);n&&o.includes(n.messageType)?s.push(n):n&&i.push(n)})),i.length&&this._watcher.batchMessage&&(this.logger.debug(n.L_BATCH_MESSAGE_O,i.map((e=>e.messageUId)).join(",")),this._watcher.batchMessage(i)),s.length&&s.forEach((e=>{this._messageProccessor[e.messageType]&&this._messageProccessor[e.messageType](e)}))}_chatroomInfoListener(e){var t,r;null===(r=(t=this._watcher).chatroomState)||void 0===r||r.call(t,e)}_conversationInfoListener(e){var t,r;null===(r=(t=this._watcher).conversationState)||void 0===r||r.call(t,e)}_expansionInfoListener(e){var t,r;null===(r=(t=this._watcher).expansion)||void 0===r||r.call(t,e)}_tagListener(){var e,t;null===(t=(e=this._watcher).tag)||void 0===t||t.call(e)}_onUserSettingsSynced(e){var t,r;null===(r=(t=this._watcher).userSettingsSynced)||void 0===r||r.call(t,e)}_onUserSettingsChanged(e){var t,r;null===(r=(t=this._watcher).userSettingsChanged)||void 0===r||r.call(t,e)}_onConversationStatusSynced(e){var t,r;null===(r=(t=this._watcher).conversationStatusSynced)||void 0===r||r.call(t,e)}_onRobotsSynced(e,t){var r,i;null===(i=(r=this._watcher).robotsSynced)||void 0===i||i.call(r,e,t)}_conversationTagListener(){var e,t;null===(t=(e=this._watcher).conversationTagChanged)||void 0===t||t.call(e)}_typingStatusListener(e){var t,r;null===(r=(t=this._watcher).typingState)||void 0===r||r.call(t,e)}_pullFinishedListener(){var e,t;null===(t=(e=this._watcher).pullFinished)||void 0===t||t.call(e)}_MessageBlockedListener(e){var t,r;null===(r=(t=this._watcher).messageBlocked)||void 0===r||r.call(t,e)}_callInfoListener(e){this._pluginContextQueue.forEach((t=>{try{t.onCallInfo&&t.onCallInfo(e)}catch(e){this.logger.warn(n.L_CALLBACK_E,null==e?void 0:e.stack)}}))}_ultraGroupEnableListener(){var e,t;null===(t=(e=this._watcher).ultraGroupEnable)||void 0===t||t.call(e)}_sgRelationsSyncedListener(e){var t,r;null===(r=(t=this._watcher).sgRelationsSynced)||void 0===r||r.call(t,e)}_operateStatusListener(e){var t,r;null===(r=(t=this._watcher).operateStatus)||void 0===r||r.call(t,e)}_ultraGroupMessageExpansionUpdatedListener(e){var t,r;null===(r=(t=this._watcher).ultraGroupMessageExpansionUpdated)||void 0===r||r.call(t,e)}_ultraGroupMessageRecalledListener(e){var t,r;null===(r=(t=this._watcher).ultraGroupMessageRecalled)||void 0===r||r.call(t,e)}_ultraGroupChannelChangeTypeListener(e){var t,r;null===(r=(t=this._watcher).ultraGroupChannelChangeType)||void 0===r||r.call(t,e)}_ultraGroupChannelUserKickedListener(e){var t,r;null===(r=(t=this._watcher).ultraGroupChannelUserKicked)||void 0===r||r.call(t,e)}_ultraGroupChannelDeleteListener(e){var t,r;null===(r=(t=this._watcher).ultraGroupChannelDelete)||void 0===r||r.call(t,e)}_userGroupStatusListener(e){var t,r;null===(r=(t=this._watcher).userGroupStatus)||void 0===r||r.call(t,e)}_messageReadReceipt(e){var t,r;null===(r=(t=this._watcher).messageReadReceipt)||void 0===r||r.call(t,e)}_syncReadStatus(e){var t,r;null===(r=(t=this._watcher).syncReadStatus)||void 0===r||r.call(t,e)}_subscribedUserStatusChange(e){var t,r;null===(r=(t=this._watcher).subscribedUserStatusChange)||void 0===r||r.call(t,e)}_subscribedRelationChange(e){var t,r;null===(r=(t=this._watcher).subscribedRelationChange)||void 0===r||r.call(t,e)}_syncSubscribedUserStatusFinished(e){var t,r;this.logger.info(n.L_SYNC_SUBSCRIBED_USER_STATUS_FINISHED_S),null===(r=(t=this._watcher).syncSubscribedUserStatusFinished)||void 0===r||r.call(t,e)}_ownUserProfileChanged(e){var t,r;this.logger.info(n.L_OWN_USER_PROFILE_CHANGED_S),null===(r=(t=this._watcher).ownUserProfileChanged)||void 0===r||r.call(t,e)}_groupOperation(e){var t,r;null===(r=(t=this._watcher).groupOperation)||void 0===r||r.call(t,e)}_groupInfoChanged(e){var t,r;null===(r=(t=this._watcher).groupInfoChanged)||void 0===r||r.call(t,e)}_groupMemberInfoChanged(e){var t,r;null===(r=(t=this._watcher).groupMemberInfoChanged)||void 0===r||r.call(t,e)}_groupApplicationEvent(e){var t,r;null===(r=(t=this._watcher).groupApplicationEvent)||void 0===r||r.call(t,e)}_groupRemarkChangedSync(e){var t,r;null===(r=(t=this._watcher).groupRemarkChangedSync)||void 0===r||r.call(t,e)}_groupFollowsChangedSync(e){var t,r;null===(r=(t=this._watcher).groupFollowsChangedSync)||void 0===r||r.call(t,e)}_friendAdd(e){var t,r;null===(r=(t=this._watcher).friendAdd)||void 0===r||r.call(t,e)}_friendDelete(e){var t,r;null===(r=(t=this._watcher).friendDelete)||void 0===r||r.call(t,e)}_friendApplicationStatusChanged(e){var t,r;null===(r=(t=this._watcher).friendApplicationStatusChanged)||void 0===r||r.call(t,e)}_friendCleared(e){var t,r;null===(r=(t=this._watcher).friendCleared)||void 0===r||r.call(t,e)}_friendInfoChangedSync(e){var t,r;null===(r=(t=this._watcher).friendInfoChangedSync)||void 0===r||r.call(t,e)}_naviDataChange(e){this._pluginContextQueue.forEach((t=>{var r;null===(r=t.onnavidatachange)||void 0===r||r.call(t,e)}))}_databaseOpened(e,t){var r,i;null===(i=(r=this._watcher).databaseOpened)||void 0===i||i.call(r,e,t)}_databaseUpgradeWillStart(){var e,t;this.logger.info(n.L_DB_UPGRATE_START_S),null===(t=(e=this._watcher).databaseUpgradeWillStart)||void 0===t||t.call(e)}_databaseUpgrading(e){var t,r;this.logger.info(n.L_DB_UPGRATING_S,e),null===(r=(t=this._watcher).databaseUpgrading)||void 0===r||r.call(t,e)}_databaseUpgradeDidComplete(e){var t,r;this.logger.info(n.L_DB_UPGRATE_COMPLETE_S),null===(r=(t=this._watcher).databaseUpgradeDidComplete)||void 0===r||r.call(t,e)}_readReceiptResponseV5(e){var t,r;null===(r=(t=this._watcher).readReceiptResponseV5)||void 0===r||r.call(t,e)}_speechToTextResponse(e){var t,r;null===(r=(t=this._watcher).speechToTextResponse)||void 0===r||r.call(t,e)}_translateResponse(e){var t,r;null===(r=(t=this._watcher).translateResponse)||void 0===r||r.call(t,e)}_messagesModified(e){var t,r;null===(r=(t=this._watcher).messagesModified)||void 0===r||r.call(t,e)}_messageModifiedSyncCompleted(){var e,t;null===(t=(e=this._watcher).messageModifiedSyncCompleted)||void 0===t||t.call(e)}_syncServerSaveUnreadCompleted(){var e,t;null===(t=(e=this._watcher).syncServerSaveUnreadCompleted)||void 0===t||t.call(e)}_onMessageReaction(e){var t,r;null===(r=(t=this._watcher).messageReaction)||void 0===r||r.call(t,e)}assignWatcher(e){Object.keys(this._watcher).forEach((t=>{if(Object.prototype.hasOwnProperty.call(e,t)){const r=e[t];this._watcher[t]=pt(r)||It(r)?r:void 0}}))}_resetWatcher(){Object.keys(this._watcher).forEach((e=>{this._watcher[e]=void 0}))}_addTypingInfo(e){const{senderUserId:t,conversationType:r,targetId:i,content:s,channelId:n}=e,{typingContentType:o}=s,a=`${r}#${i}#${n||""}`;this._typingInfo[a]||(this._typingInfo[a]=[]);const l=this._typingInfo[a].findIndex((e=>e.userId===t));l>=0&&this._typingInfo[a][l].messageType===o?this._typingInfo[a][l].timestamp=Date.now():(l>=0&&this._typingInfo[a].splice(l,1),this._typingInfo[a].push({userId:t,messageType:o,timestamp:Date.now()}),this._typingChangedList.includes(a)||this._typingChangedList.push(a),this._startCheckTypingInfo())}_startCheckTypingInfo(){-1===this._typingInternalTimer&&0!==Object.keys(this._typingInfo).length&&(this._typingInternalTimer=setInterval((()=>{for(const e in this._typingInfo){const t=this._typingInfo[e].length;this._typingInfo[e]=this._typingInfo[e].filter((e=>Date.now()-e.timestamp<this._typingExpireTime)),this._typingInfo[e].length===t||this._typingChangedList.includes(e)||this._typingChangedList.push(e),0===this._typingInfo[e].length&&delete this._typingInfo[e]}this._notifyTypingChanged()}),500))}_notifyTypingChanged(){if(this._typingChangedList.length>0){const e=this._typingChangedList.map((e=>({conversationType:Number(e.split("#")[0]),targetId:e.split("#")[1],channelId:e.split("#")[2],list:this._typingInfo[e]||[]})));this._typingStatusListener(e),this._typingChangedList=[]}0===Object.keys(this._typingInfo).length&&(clearInterval(this._typingInternalTimer),this._typingInternalTimer=-1)}getConnectedTime(){return this._engine.connectedTime}getServerTime(){return this._engine.serverTime}getDeviceId(){return this._engine.deviceId}setPushConfig(e){return this._engine.setPushConfig(e)}getCurrentUserId(){return this._engine.userId}getConnectionStatus(){return this._engine.connectionStatus}isConnected(){return this._engine.connectionStatus===exports.RCConnectionStatus.CONNECTED}_validateUserProfile(e){return 1!==e.userProfile?sr(exports.ErrorCode.RC_USER_PROFILE_SERVICE_UNAVAILABLE):ir(e)}get validateConnected(){return()=>this.checkAuthed(!1)}get validateLogin(){return()=>this.checkAuthed(!0)}checkAuthed(e){return this._engine.connectionStatus===exports.RCConnectionStatus.CONNECTED||this._engine.userId&&e?ir(this._engine.naviInfo):sr(exports.ErrorCode.RC_NET_UNAVAILABLE)}get token(){return this._token}refetchNaviInfo(){return t(this,void 0,void 0,(function*(){return this._engine.refetchNaviInfo()}))}connect(e,i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:i}),t);const s=yield nr.create("connect").isNotEmptyString("token",e).fail(exports.ErrorCode.RC_CONN_TOKEN_INCORRECT).result().next((()=>r(this,ST,"m",vT).call(this,e,!!i,t)));return this.logger.summary(n.A_CONNECT_R,s,t,void 0,(e=>({userId:e}))),s}))}disconnect(e,i){return t(this,void 0,void 0,(function*(){return this.logger.info(n.A_DISCONNECT_O,JSON.stringify({closeDB:e,disablePush:i})),r(this,ST,"m",CT).call(this,e,i)}))}reconnect(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_RECONNECT_T,JSON.stringify({reconnectKickEnable:e}),t);const i=yield r(this,ST,"m",vT).call(this,this.token,!!e,t);return this.logger.summary(n.A_RECONNECT_R,i,t,void 0,(e=>({userId:e}))),i}))}_channelIdConvert(e,t){if(e!==exports.ConversationType.ULTRA_GROUP)return t;const r=this.getNaviInfoFromCache();return!!(2&((null==r?void 0:r.ugDriven)||0))&&!t?"RCDefault":t}getNaviInfoFromCache(){return this._engine.naviInfo}registerMessageType(e,t,r,i=[],s=!1){const n={isPersited:t,isCounted:r,searchProps:i,isStatusMessage:s};!function(e,t){const r=di.get(e);r&&!r.isCustom&&console.warn(`Builtin message type '${e}' cannot be registered`),t.isStatusMessage&&(t.isCounted=t.isPersited=!1),di.set(e,Object.assign(Object.assign({},t),{isCustom:!0}))}(e,n),this._engine.registerMessageType(e,n)}_rtcDataChange(e){var t;null===(t=this._rtcListener)||void 0===t||t.call(this,e)}registerRTCSignalingListener(e){this._rtcListener=e}sendMessageByPlugin(e,i,s){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.L_SEND_MSG_T,JSON.stringify({identifier:e,messageType:i.messageType}),t);const o=yield r(this,ST,"m",OT).call(this,e,i,t,s);return this.logger.summary(n.L_SEND_MSG_R,o,t,void 0,(({messageId:t,messageUId:r,messageType:i})=>({messageId:t,messageUId:r,messageType:i,identifier:e}))),o}))}sendMessage(e,i,s){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_SEND_MSG_T,JSON.stringify({identifier:e,messageType:i.messageType}),t);const o=yield r(this,ST,"m",OT).call(this,e,i,t,s);return this.logger.summary(n.A_SEND_MSG_R,o,t,void 0,(({messageId:t,messageUId:r,messageType:i})=>({messageId:t,messageUId:r,messageType:i,identifier:e}))),o}))}updateMessageExpansion(e,i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_UPDATE_MSG_EXPANSION_T,JSON.stringify({expansion:e,attrs:i}),t);const s=yield nr.create("updateMessageExpansion").check((t=>rd(t,i,Object.keys(e||{})))).check((t=>id(t,e,i.canIncludeExpansion))).result().tryTrans(this.validateConnected).next((()=>{const s={put:e,mid:i.messageUId},n=Object.assign(Object.assign({},i),{channelId:this._channelIdConvert(i.conversationType,i.channelId)});return i.conversationType===exports.ConversationType.ULTRA_GROUP?this._engine.chat.updateUGMessageExpansion(n,s,i.sentTime):r(this,ST,"m",MT).call(this,n,s,t)}));return this.logger.summary(n.A_UPDATE_MSG_EXPANSION_R,s,t),s}))}removeMessageExpansion(e,i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_REMOVE_MSG_EXPANSION_T,JSON.stringify({keys:e,attrs:i}),t);const s=yield nr.create("removeMessageExpansion").isLimitedTypedArray("keys",e,20,(e=>"string"==typeof e&&/^[A-Za-z0-9_=+-]+$/.test(e)),!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEYS).check((t=>rd(t,i,e))).result().tryTrans(this.validateConnected).next((()=>{const s={del:e,mid:i.messageUId},n=Object.assign(Object.assign({},i),{channelId:this._channelIdConvert(i.conversationType,i.channelId)});return i.conversationType===exports.ConversationType.ULTRA_GROUP?this._engine.chat.updateUGMessageExpansion(n,s,i.sentTime):r(this,ST,"m",MT).call(this,n,s,t)}));return this.logger.summary(n.A_REMOVE_MSG_EXPANSION_R,s,t),s}))}removeAllMessageExpansion(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_REMOVE_ALL_MSG_EXPANSION_T,JSON.stringify({attrs:e}),t);const i=yield nr.create("removeAllMessageExpansion").check((t=>rd(t,e,[]))).check((t=>{e.conversationType!==exports.ConversationType.ULTRA_GROUP&&t.setFailed(exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT)})).result().tryTrans(this.validateConnected).next((()=>{const i={clear:1,mid:e.messageUId},s=Object.assign(Object.assign({},e),{channelId:this._channelIdConvert(e.conversationType,e.channelId)});return e.conversationType===exports.ConversationType.ULTRA_GROUP?this._engine.chat.updateUGMessageExpansion(s,i,e.sentTime):r(this,ST,"m",MT).call(this,s,i,t)}));return this.logger.summary(n.A_REMOVE_ALL_MSG_EXPANSION_R,i,t),i}))}sendReadReceiptV2(e,r,i,s){return t(this,void 0,void 0,(function*(){s=s||this.logger.createTraceId(),this.logger.info(n.A_SEND_READ_RECEIPT_V2_T,JSON.stringify({targetId:e,messageUIds:r,channelId:i}),s);const o=yield nr.create("sendReadReceiptV2").validate("targetId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isLimitedTypedArray("messageUIds",r,Number.MAX_SAFE_INTEGER,gt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).validate("channelId",i,mt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((s=>t(this,void 0,void 0,(function*(){return 1!==s.grpRRVer?sr(exports.ErrorCode.READ_RECEIPT_ERROR,"The read receipt switch is not on, please call the sendMessage method."):this._engine.chat.sendReadReceiptV2(e,r,i)}))));return this.logger.summary(n.A_SEND_READ_RECEIPT_V2_R,o,s),o}))}_destroy(){return t(this,void 0,void 0,(function*(){Xr.stop(),this._resetWatcher(),this._engine.destroy(),io.removeNetworkStatusListener(),yield r(this,ST,"m",CT).call(this),this._pluginContextQueue.forEach((e=>{if(e.ondestroy)try{e.ondestroy()}catch(e){this.logger.error(n.L_CALLBACK_E,null==e?void 0:e.stack)}})),this._pluginContextQueue.length=0,this._pluginInstanseMap={}}))}getHistoryMessage(e,i){return t(this,void 0,void 0,(function*(){const t=null==i?void 0:i.timestamp,s=null==i?void 0:i.count,o=null==i?void 0:i.order,a=null==i?void 0:i.messageType,l=this.logger.createTraceId();this.logger.info(n.A_GET_HISTORY_MSG_T,JSON.stringify({conversation:e,options:i}),l);const c=yield nr.create("getHistoryMessage").check((t=>td(t,e,k))).isLimitedInteger("timestamp",t,0,Number.MAX_SAFE_INTEGER).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("order",o,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isLimitedInteger("count",s,1,100).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isNotEmptyString("messageType",a).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).result().tryTrans(this.validateConnected).next((()=>{const i={timestamp:t||0,count:s||20,order:o||0,messageType:a||""},n=r(this,ST,"m",yT).call(this,e);return this._engine.getHistoryMessage(n,i,!0)}));return this.logger.summary(n.A_GET_HISTORY_MSG_R,c,l,void 0,(({list:e})=>({size:e.length}))),c}))}getContinuousMessages(e,i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_CONTINUOUS_MSGS_T,JSON.stringify({conversation:e,options:i}),t);const s=yield nr.create("getContinuousMessages").check((t=>td(t,e,G))).isLimitedInteger("timestamp",null==i?void 0:i.timestamp,0,Number.MAX_SAFE_INTEGER).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("count",null==i?void 0:i.count,1,100).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("order",null==i?void 0:i.order,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).result().tryTrans(this.validateLogin).next((()=>{const t=r(this,ST,"m",yT).call(this,e),s={timestamp:i.timestamp||0,count:i.count||20,order:i.order||0,messageType:""};return this._engine.chat.getContinuousMessages(t,s)}));return this.logger.summary(n.A_GET_CONTINUOUS_MSGS_R,s,t,void 0,(({list:e})=>({size:e.length}))),s}))}getHistoryMessagesByObjectNames(e,i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_HIS_MSGS_BY_OBJ_NAMES_T,JSON.stringify({conversation:e,option:i}),t);const s=yield nr.create("getHistoryMessagesByObjectNames").check((t=>td(t,e,F))).isLimitedInteger("timestamp",null==i?void 0:i.timestamp,0,Number.MAX_SAFE_INTEGER).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("count",null==i?void 0:i.count,1,100).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("order",null==i?void 0:i.order,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isTypedArray("messageTypes",null==i?void 0:i.messageTypes,gt).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).result().tryTrans(this.validateLogin).next((()=>{const t=r(this,ST,"m",yT).call(this,e),s={timestamp:i.timestamp||0,count:i.count||20,order:i.order||0,messageTypes:i.messageTypes||[]};return this._engine.chat.getHistoryMessagesByObjectNames(t,s)}));return this.logger.summary(n.A_GET_HIS_MSGS_BY_OBJ_NAMES_R,s,t,void 0,(({list:e})=>({size:e.length}))),s}))}getTopConversationList(e,r){return t(this,void 0,void 0,(function*(){const i=this.logger.createTraceId();this.logger.info(n.A_GET_TOP_CONVERSATION_LIST_T,JSON.stringify({conversationTypes:e,channelId:r}),i);const s=yield nr.create("getTopConversationList").isTypedArray("conversationTypes",e,(e=>W(e,V))).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).validate("channelId",r,mt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((i=>t(this,void 0,void 0,(function*(){const t=yI(i);return t&&!this._engine.chat.ugSynced?sr(exports.ErrorCode.METHOD_NOT_AVAILABLE):this._engine.chat.getTopConversationList(t,e,r)}))));return this.logger.summary(n.A_GET_TOP_CONVERSATION_LIST_R,s,i,void 0,(e=>({size:e.length}))),s}))}getUnreadConversationList(e){return t(this,void 0,void 0,(function*(){const r=this.logger.createTraceId();this.logger.info(n.A_GET_UNREAD_CONVERSATION_LIST_T,JSON.stringify({conversationTypes:e}),r);const i=yield nr.create("getUnreadConversationList").isTypedArray("conversationTypes",e,(e=>W(e,V))).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateConnected).next((r=>t(this,void 0,void 0,(function*(){const t=yI(r);return t&&!this._engine.chat.ugSynced?sr(exports.ErrorCode.METHOD_NOT_AVAILABLE):this._engine.chat.getUnreadConversationList(t,e)}))));return this.logger.summary(n.A_GET_UNREAD_CONVERSATION_LIST_R,i,r,void 0,(e=>({size:e.length}))),i}))}getBlockedConversationList(){return t(this,void 0,void 0,(function*(){const e=this.logger.createTraceId();this.logger.info(n.A_GET_BLOCKED_CONVERSATION_LIST_T,"",e);const r=yield nr.create("getBlockedConversationList").result().tryTrans(this.validateConnected).next((e=>t(this,void 0,void 0,(function*(){const t=yI(e);return t&&!this._engine.chat.ugSynced?sr(exports.ErrorCode.METHOD_NOT_AVAILABLE):this._engine.chat.getBlockedConversationList(t)}))));return this.logger.summary(n.A_GET_BLOCKED_CONVERSATION_LIST_R,r,e,void 0,(e=>({size:e.length}))),r}))}getAllConversationList(e){return t(this,void 0,void 0,(function*(){const r=this.logger.createTraceId();this.logger.info(n.A_GET_ALL_CONVERSATION_LIST_T,JSON.stringify({channelId:e}),r);const i=yield nr.create("getAllConversationList").validate("channelId",e,mt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateLogin).next((r=>t(this,void 0,void 0,(function*(){const t=yI(r);return t&&!this._engine.chat.ugSynced?sr(exports.ErrorCode.METHOD_NOT_AVAILABLE):this._engine.chat.getAllConversationList(t,e)}))));return this.logger.summary(n.A_GET_ALL_CONVERSATION_LIST_R,i,r,void 0,(e=>({size:e.length}))),i}))}getConversationList(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_CONVERSATION_LIST_OLD_T,JSON.stringify(e),t);const r=Ct()&&"string"!=typeof(null==e?void 0:e.channelId)?this.getAllConversationList(null==e?void 0:e.channelId):this.getConversationListByTimestamp(e),i=yield r;return this.logger.summary(n.A_GET_CONVERSATION_LIST_OLD_R,i,t,void 0,(e=>({size:e.length}))),i}))}getConversationListByTimestamp(e){return t(this,void 0,void 0,(function*(){const r=this.logger.createTraceId();this.logger.info(n.A_GET_CONVERSATION_LIST_BY_TIME_T,JSON.stringify(e),r);const i=yield nr.create("getConversationListByTimestamp").isObject("params",e,!0).fail(exports.ErrorCode.CONVER_GET_ERROR,"params must be an object").isTimestamp("startTime",null==e?void 0:e.startTime,!0).fail(exports.ErrorCode.INVALID_PARAMETER_START_TIME).isLimitedInteger("count",null==e?void 0:e.count,1,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("order",null==e?void 0:e.order,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).validate("channelId",null==e?void 0:e.channelId,mt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",null==e?void 0:e.conversationTypes,(e=>W(e,V))).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isNumberEnum("unreadCountFilter",null==e?void 0:e.unreadCountFilter,Ue).fail(exports.ErrorCode.INVALID_PARAMETER_UNREAD_COUNT_FILTER).result().tryTrans((()=>this.checkAuthed(Ct()))).next((r=>t(this,void 0,void 0,(function*(){const t=yI(r);return t&&!this._engine.chat.ugSynced?sr(exports.ErrorCode.METHOD_NOT_AVAILABLE):this._engine.chat.getConversationListByTimestamp(e,t)}))));return this.logger.summary(n.A_GET_CONVERSATION_LIST_BY_TIME_R,i,r,void 0,(e=>({size:e.length}))),i}))}getConversation(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_CONVERSATION_T,JSON.stringify(e),t);const i=yield nr.create("getConversation").check((t=>td(t,e,k))).result().tryTrans(this.validateConnected).next((()=>{const t=r(this,ST,"m",yT).call(this,e);return this._engine.chat.getConversation(t)}));return this.logger.summary(n.A_GET_CONVERSATION_R,i,t,e),i}))}removeConversation(e,i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_REMOVE_CONVERSATION_T,JSON.stringify(e),t);const s=yield nr.create("removeConversation").check((t=>td(t,e,V))).result().tryTrans(this.validateConnected).next((()=>{const t=r(this,ST,"m",yT).call(this,e);return this._engine.chat.batchDeleteConversations({identifiers:[t],deleteRemotely:!!i,deleteMessages:!1})}));return this.logger.summary(n.A_REMOVE_CONVERSATION_R,s,t),s}))}batchDeleteConversations(e){return t(this,void 0,void 0,(function*(){const i=null==e?void 0:e.identifiers,s=!!(null==e?void 0:e.deleteRemotely),o=!!(null==e?void 0:e.deleteMessages),a=this.logger.createTraceId();this.logger.info(n.A_BATCH_DEL_CONVERS_T,JSON.stringify({identifiers:i,deleteRemotely:s,deleteMessages:o}),a);const l=yield nr.create("batchDeleteConversations").isLimitedArray("identifiers",i,100,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST).result().tryTrans(this.validateConnected).next((()=>t(this,void 0,void 0,(function*(){const e=i.filter((e=>ed("",e,V).result().isOk)).map((e=>r(this,ST,"m",yT).call(this,e)));return 0===e.length?ir():this._engine.chat.batchDeleteConversations({identifiers:e,deleteRemotely:s,deleteMessages:o})}))));return this.logger.summary(n.A_BATCH_DEL_CONVERS_R,l,a),l.wipe()}))}getUltraGroupList(e){return t(this,void 0,void 0,(function*(){const r=null==e?void 0:e.targetId,i=null==e?void 0:e.channelType,s=this.logger.createTraceId();this.logger.info(n.A_GET_UG_LIST_T,JSON.stringify({targetId:r,channelType:i}),s);const o=yield nr.create("getUltraGroupList").validate("targetId",r,St).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isNumberEnum("channelType",i,exports.UltraGroupChannelType).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_TYPE).result().tryTrans(this.validateLogin).next((()=>t(this,void 0,void 0,(function*(){return this._engine.chat.ugSynced?this._engine.chat.getUltraGroupList(e):sr(exports.ErrorCode.METHOD_NOT_AVAILABLE)}))));return this.logger.summary(n.A_GET_UG_LIST_R,o,s,void 0,(e=>({size:e.length}))),o}))}getBlockedUGList(){return t(this,void 0,void 0,(function*(){const e=this.logger.createTraceId();this.logger.info(n.A_GET_BLOCKED_UG_LIST_T,"",e);const r=yield nr.create("getBlockedUGList").result().tryTrans(this.validateConnected).next((()=>t(this,void 0,void 0,(function*(){return this._engine.chat.ugSynced?this._engine.chat.getBlockedUGList():sr(exports.ErrorCode.METHOD_NOT_AVAILABLE)}))));return this.logger.summary(n.A_GET_BLOCKED_UG_LIST_R,r,e,void 0,(e=>({size:e.length}))),r}))}getUnreadCount(e){return t(this,void 0,void 0,(function*(){const i=this.logger.createTraceId();this.logger.info(n.A_GET_UNREAD_COUNT_T,JSON.stringify(e),i);const s=yield nr.create("getUnreadCount").check((t=>td(t,e,F))).result().tryTrans(this.validateLogin).next((()=>t(this,void 0,void 0,(function*(){if(e.conversationType===exports.ConversationType.ULTRA_GROUP&&!this._engine.chat.ugSynced)return sr(exports.ErrorCode.METHOD_NOT_AVAILABLE);const t=r(this,ST,"m",yT).call(this,e);return this._engine.chat.getConversationUnreadCount(t)}))));return this.logger.summary(n.A_GET_UNREAD_COUNT_R,s,i,void 0,(e=>({unreadCount:e}))),s}))}getTotalUnreadCount(e,r,i){return t(this,void 0,void 0,(function*(){const s=this.logger.createTraceId();this.logger.info(n.A_GET_TOTAL_UNREAD_COUNT_T,JSON.stringify({conversationTypes:e,includeMuted:r,channelId:i}),s);const o=yield nr.create("getTotalUnreadCount").validate("channelId",i,mt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",e,(e=>W(e,F))).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateLogin).next((s=>t(this,void 0,void 0,(function*(){const t=yI(s);if(!t&&e&&e.includes(exports.ConversationType.ULTRA_GROUP))return sr(exports.ErrorCode.METHOD_NOT_SUPPORT);const n=e&&e.length>0?e:Y(t?V:w);return n.includes(exports.ConversationType.ULTRA_GROUP)&&!this._engine.chat.ugSynced?sr(exports.ErrorCode.METHOD_NOT_AVAILABLE):this._engine.chat.getTotalUnreadCount(n,!!r,i)}))));return this.logger.summary(n.A_GET_TOTAL_UNREAD_COUNT_R,o,s,void 0,(e=>({unreadCount:e}))),o}))}getTotalUnreadCountByLevels(e,r,i){return t(this,void 0,void 0,(function*(){const s=this.logger.createTraceId();this.logger.info(n.A_GET_TOTAL_UNREAD_COUNT_BY_LEVELS_T,JSON.stringify({conversationTypes:e,levels:r,isMentioned:i}),s);const o=yield nr.create("getTotalUnreadCountByLevels").isLimitedTypedArray("conversationTypes",e,20,(e=>W(e,V)),!0).fail(exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT).isTypedArray("levels",r,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateLogin).next((()=>t(this,void 0,void 0,(function*(){return e.includes(exports.ConversationType.ULTRA_GROUP)&&!this._engine.chat.ugSynced?sr(exports.ErrorCode.METHOD_NOT_AVAILABLE):this._engine.chat.getTotalUnreadCountByLevels(e,r,i)}))));return this.logger.summary(n.A_GET_TOTAL_UNREAD_COUNT_BY_LEVELS_R,o,s,void 0,(e=>({unreadCount:e}))),o}))}getFirstUnreadMessage(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_FIRST_UNREAD_MEG_T,JSON.stringify(e),t);const i=yield nr.create("getFirstUnreadMessage").check((t=>td(t,e,F))).result().tryTrans(this.validateLogin).next((()=>{const t=r(this,ST,"m",yT).call(this,e);return this._engine.chat.getFirstUnreadMessage(t)}));return this.logger.summary(n.A_GET_FIRST_UNREAD_MSG_R,i,t,e),i}))}getFirstUnreadMessageDigest(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_FIRST_UNREAD_MSG_DIGEST_T,JSON.stringify(e),t);const i=yield nr.create("getFirstUnreadMessageDigest").check((t=>td(t,e,F))).result().tryTrans(this.validateLogin).next((()=>{const t=r(this,ST,"m",yT).call(this,e);return this._engine.chat.getFirstUnreadMessageDigest(t)}));return this.logger.summary(n.A_GET_FIRST_UNREAD_MSG_DIGEST_R,i,t,e),i}))}batchSetConversationNotificationLevel(e,i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_T,JSON.stringify({conversations:e,notificationLevel:i}),t);const s=nr.create("batchSetConversationNotificationLevel"),o=yield s.isLimitedTypedArray("conversations",e,20,(e=>!ed("batchSetConversationNotificationLevel",e,V).isFailed),!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST).isNumberEnum("notificationLevel",i,exports.NotificationLevel,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected).next((()=>{const t=e.map((e=>r(this,ST,"m",yT).call(this,e)));return this._engine.chat.batchSetConversationNotificationLevel(t,i)}));return this.logger.summary(n.A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_R,o,t),o}))}batchSetConversationToTop(e,i,s,o){return t(this,void 0,void 0,(function*(){const t=nr.create("batchSetConversationToTop").isLimitedTypedArray("conversations",e,20,(e=>ed("batchSetConversationToTop",e,V).result().isOk),!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST).result().tryTrans((()=>e.every((e=>e.conversationType!==exports.ConversationType.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId))?ir():sr(exports.ErrorCode.ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING))).tryTrans(this.validateConnected);if(!t.isOk)return t.wipe();const a=this.logger.createTraceId(),l=e.map((e=>r(this,ST,"m",yT).call(this,e)));this.logger.info(n.A_BATCH_SET_CONVERSATION_TO_TOP_T,JSON.stringify({conversations:l,isTop:i,isUpdateTime:s,isCreateConversation:o}),a);const c=yield this._engine.chat.batchSetConversationToTop(l,i,s,o);return this.logger.summary(n.A_BATCH_SET_CONVERSATION_TO_TOP_R,c,a),c}))}batchSetConversationTranslateStrategy(e,i){return t(this,void 0,void 0,(function*(){const t=nr.create("batchSetConversationTranslateStrategy").isLimitedTypedArray("conversations",e,20,(e=>ed("",e,V).result().isOk),!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST).isNumberEnum("strategy",i,Ti,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TRANSLATE_STRATEGY).result().tryTrans(this.validateConnected);if(!t.isOk)return t.wipe();const s=this.logger.createTraceId();this.logger.info(n.A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_T,JSON.stringify({conversations:e,strategy:i}),s);const o=e.map((e=>r(this,ST,"m",yT).call(this,e))),a=yield this._engine.chat.batchSetConversationTranslateStrategy(o,i);return this.logger.summary(n.A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_R,a,s),a}))}saveTextMessageDraft(e,i){return t(this,void 0,void 0,(function*(){return yield ed("saveTextMessageDraft",e,F).isString("draft",i,!0).fail(exports.ErrorCode.INVALID_PARAMETER_DRAFT).result().tryTrans(this.validateLogin).next((()=>{const t=r(this,ST,"m",yT).call(this,e);return this._engine.saveTextMessageDraft(t,i)}))}))}getTextMessageDraft(e){return t(this,void 0,void 0,(function*(){return yield ed("getTextMessageDraft",e,F).result().tryTrans(this.validateLogin).next((()=>{const t=r(this,ST,"m",yT).call(this,e);return this._engine.getTextMessageDraft(t)}))}))}clearTextMessageDraft(e){return t(this,void 0,void 0,(function*(){return yield ed("clearTextMessageDraft",e,F).result().tryTrans(this.validateLogin).next((()=>{const t=r(this,ST,"m",yT).call(this,e);return this._engine.clearTextMessageDraft(t)}))}))}recallMessage(e,i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId(),s={conversation:e,messageUId:null==i?void 0:i.messageUId};this.logger.info(n.A_RECALL_MESSAGE_T,JSON.stringify(s),t);const o=yield nr.create("recallMessage").check((t=>td(t,e,k))).isNotEmptyString("messageUId",i.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isInteger("sentTime",i.sentTime,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isBoolean("disableNotification",i.disableNotification).fail(exports.ErrorCode.INVALID_PARAMETER_DISABLE_NOTIFICATION).isObject("pushConfig",i.pushConfig).fail(exports.ErrorCode.INVALID_PARAMETER_PUSH_CONFIG).isBoolean("disableUpdateLastMessage",i.disableUpdateLastMessage).fail(exports.ErrorCode.INVALID_DISABLE_UPDATE_LAST_MESSAGE).isLimitedTypedArray("directionalUserIdList",i.directionalUserIdList,300,St,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).next((()=>{const t=r(this,ST,"m",yT).call(this,e);return this._engine.recallMsg(t,i)}));return this.logger.summary(n.A_RECALL_MESSAGE_R,o,t,s),o}))}deleteRemoteMessage(e,i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_DEL_REMOTE_MSGS_T,JSON.stringify({conversation:e,messages:i}),t);const s=yield nr.create("deleteRemoteMessage").check((t=>td(t,e,V))).isLimitedTypedArray("messages",i,100,(e=>{if(!e||"object"!=typeof e)return!1;const{messageUId:t,sentTime:r,messageDirection:i}=e;return gt(t)&&(i===exports.MessageDirection.SEND||i===exports.MessageDirection.RECEIVE)&&ut({min:0})(r)}),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).next((()=>{const t=r(this,ST,"m",yT).call(this,e);return this._engine.chat.deleteRemoteMessage(t,i)}));return this.logger.summary(n.A_DEL_REMOTE_MSGS_R,s,t),s}))}deleteRemoteMessageByTimestamp(e,i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_DEL_REMOTE_MSGS_T,JSON.stringify({identifier:e,timestamp:i}),t);const s=yield nr.create("deleteRemoteMessageByTimestamp").check((t=>td(t,e,k))).isInteger("timestamp",i,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((()=>{const t=r(this,ST,"m",yT).call(this,e);return this._engine.chat.deleteRemoteMessageByTimestamp(t,i)}));return this.logger.summary(n.A_DEL_REMOTE_MSGS_R,s,t),s}))}getFileToken(e,r,i,s,n,o){return t(this,void 0,void 0,(function*(){return nr.create("getFileToken").isNumberEnum("fileType",e,exports.FileType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MEDIA_TYPE).isString("fileName",r).fail(exports.ErrorCode.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME).validate("httpMethod",i,(e=>"POST"===e||"PUT"===e)).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,"`httpMethod` is invalid").isString("queryString",s).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,"`queryString` is invalid").isString("url",n).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,"`url` is invalid").isInteger("size",o).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,"`size` is invalid").result().tryTrans(this.validateConnected).next((a=>t(this,void 0,void 0,(function*(){const t=a.uploadServer||"",l=a.ossConfig||"";return(yield this._engine.getFileToken(e,r,i,s,n,o)).trans((e=>Object.assign(e,{qiniu:t,ossConfig:e.ossConfig||l})))}))))}))}getFileUrl(e,r,i,s){return t(this,void 0,void 0,(function*(){return yield nr.create("getFileUrl").isNumberEnum("fileType",e,exports.FileType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MEDIA_TYPE).isString("fileName",r).fail(exports.ErrorCode.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME).isString("saveName",s).fail(exports.ErrorCode.INVALID_PARAMETER_SAVE_NAME).isNumberEnum("serverType",i,exports.UploadMethod,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SERVER_TYPE).result().tryTrans(this.validateConnected).next((()=>this._engine.getFileUrl(e,i,r,s||"")))}))}createTag(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_ADD_TAG_T,JSON.stringify({tagId:null==e?void 0:e.tagId,tagName:null==e?void 0:e.tagName}),t);const r=yield nr.create("createTag").isLimitedString("tagId",null==e?void 0:e.tagId,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isLimitedString("tagName",null==e?void 0:e.tagName,1,15,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_NAME).result().tryTrans(this.validateConnected).next((()=>this._engine.createTag(e)));return this.logger.summary(n.A_ADD_TAG_R,r,t),r}))}removeTag(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_REMOVE_TAG_T,JSON.stringify({tagId:e}),t);const r=yield nr.create("removeTag").isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).result().tryTrans(this.validateConnected).next((()=>this._engine.removeTag(e)));return this.logger.summary(n.A_REMOVE_TAG_R,r,t),r}))}updateTag(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_UPDATE_TAG_T,JSON.stringify({tagId:null==e?void 0:e.tagId,tagName:null==e?void 0:e.tagName}),t);const r=yield nr.create("updateTag").isLimitedString("tagId",null==e?void 0:e.tagId,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isLimitedString("tagName",null==e?void 0:e.tagName,1,15,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_NAME).result().tryTrans(this.validateConnected).next((()=>this._engine.updateTag(e)));return this.logger.summary(n.A_UPDATE_TAG_R,r,t),r}))}getTagList(){return t(this,void 0,void 0,(function*(){const e=this.logger.createTraceId();this.logger.info(n.A_GET_TAGS_T,"",e);const t=yield this.validateLogin().next((()=>this._engine.getTagList()));return this.logger.summary(n.A_GET_TAGS_R,t,e,void 0,(e=>({size:e.length}))),t}))}addTagForConversations(e,i){return t(this,void 0,void 0,(function*(){const t=nr.create("addTagForConversations").isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isTypedArray("conversations",i,(e=>ed("",e,w).result().isOk),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATIONS).isLimitedInteger("conversations",null==i?void 0:i.length,1,1e3,!0).fail(exports.ErrorCode.CONVER_OUT_LIMIT_ERROR).result().tryTrans(this.validateConnected);if(!t.isOk)return t.wipe();const s=i.map((e=>r(this,ST,"m",yT).call(this,e))),o=this.logger.createTraceId();this.logger.info(n.A_ADD_TAG_FOR_CONVERSATIONS_T,JSON.stringify({tagId:e,conversations:s}),o);const a=yield this._engine.chat.addTagForConversations(e,s);return this.logger.summary(n.A_ADD_TAG_FOR_CONVERSATIONS_R,a,o),a}))}removeTagForConversations(e,i){return t(this,void 0,void 0,(function*(){const t=nr.create("removeTagForConversations").isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isLimitedTypedArray("conversations",i,1e3,(e=>ed("",e,w).result().isOk),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATIONS).result().tryTrans(this.validateConnected);if(!t.isOk)return t.wipe();const s=i.map((e=>r(this,ST,"m",yT).call(this,e))),o=this.logger.createTraceId();this.logger.info(n.A_REMOVE_TAG_FOR_CONVERS_T,JSON.stringify({tagId:e,conversations:s}),o);const a=yield this._engine.chat.removeTagForConversations(e,s);return this.logger.summary(n.A_REMOVE_TAG_FOR_CONVERS_R,a,o),a}))}removeTagsForConversation(e,i){return t(this,void 0,void 0,(function*(){const t=ed("removeTagsForConversation",e,w).isTypedArray("tagIds",i,(e=>dt(e)),!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).result().tryTrans(this.validateConnected);if(!t.isOk)return t.wipe();const s=this.logger.createTraceId(),o=r(this,ST,"m",yT).call(this,e);this.logger.info(n.A_REMOVE_TAGS_FOR_CONVER_T,JSON.stringify({tagIds:i,conversation:o}),s);const a=yield this._engine.chat.removeTagsForConversation(o,i);return this.logger.summary(n.A_REMOVE_TAGS_FOR_CONVER_R,a,s),a}))}getConversationListByTag(e,r,i){return t(this,void 0,void 0,(function*(){const t=nr.create("getConversationListByTag").isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isInteger("count",i,!0).fail(exports.ErrorCode.CONVER_OUT_LIMIT_ERROR).isLimitedInteger("startTime",r,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_START_TIME).result().tryTrans((()=>this.checkAuthed(Ct())));if(!t.isOk)return t.wipe();const s=i<=0?20:Math.min(i,1e3);return this._engine.chat.getConversationListByTag(e,r,s)}))}getUnreadCountByTag(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_UNREAD_COUNT_BY_TAG_T,JSON.stringify({tagId:e,containMuted:r}),t);const i=yield nr.create("getUnreadCountByTag").isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isBoolean("containMuted",r,!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONTAIN_MUTED).result().tryTrans(this.validateLogin).next((()=>this._engine.chat.getUnreadCountByTag(e,r)));return this.logger.summary(n.A_GET_UNREAD_COUNT_BY_TAG_R,i,t),i}))}setConversationStatusInTag(e,i,s){return t(this,void 0,void 0,(function*(){const t=ed("setConversationStatusInTag",i,w).isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isBoolean("isTop",null==s?void 0:s.isTop,!0).fail(exports.ErrorCode.INVALID_PARAMETER_IS_TOP).result().tryTrans(this.validateConnected);if(!t.isOk)return t.wipe();const o=this.logger.createTraceId(),a=r(this,ST,"m",yT).call(this,i);this.logger.info(n.A_SET_CONVER_TO_TOP_IN_TAG_T,JSON.stringify({tagId:e,conversation:a,isTop:s.isTop}),o);const l=yield this._engine.chat.setConversationStatusInTag(e,a,s);return this.logger.summary(n.A_SET_CONVER_TO_TOP_IN_TAG_R,l,o),l}))}getTagsForConversation(e){return t(this,void 0,void 0,(function*(){const t=ed("getTagsForConversation",e,w).result().tryTrans(this.validateLogin);if(!t.isOk)return t.wipe();const i=this.logger.createTraceId(),s=r(this,ST,"m",yT).call(this,e);this.logger.info(n.A_GET_TAGS_OF_CONVERSATION_T,JSON.stringify(s),i);const o=yield this._engine.chat.getTagsForConversation(s);return this.logger.summary(n.A_GET_TAGS_OF_CONVERSATION_R,o,i,void 0,(e=>({size:e.length}))),o}))}getUnreadMentionedCount(e){return t(this,void 0,void 0,(function*(){const i=this.logger.createTraceId();this.logger.info(n.A_GET_UNREAD_MENTIONED_COUNT_T,JSON.stringify(e),i);const s=yield nr.create("getUnreadMentionedCount").check((t=>td(t,e,B))).result().tryTrans(this.validateLogin).next((()=>t(this,void 0,void 0,(function*(){if(e.conversationType===exports.ConversationType.ULTRA_GROUP&&!this._engine.chat.ugSynced)return sr(exports.ErrorCode.METHOD_NOT_AVAILABLE);const t=r(this,ST,"m",yT).call(this,e);return this._engine.chat.getUnreadMentionedCount(t)}))));return this.logger.summary(n.A_GET_UNREAD_MENTIONED_COUNT_R,s,i),s.trans(pd)}))}getAllUnreadMentionedCount(){return t(this,void 0,void 0,(function*(){const e=this.logger.createTraceId();this.logger.info(n.A_GET_ALL_UNREAD_MENTIONED_COUNT_T,"",e);const t=yield this.validateLogin().next((()=>this._engine.chat.getAllUnreadMentionedCount()));return this.logger.summary(n.A_GET_ALL_UNREAD_MENTIONED_COUNT_R,t,e),t}))}getUltraGroupMessageListByMessageUId(e,i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId(),s=i instanceof Array?i.map((e=>null==e?void 0:e.messageUId)):[],o=null==e?void 0:e.conversationType,a=null==e?void 0:e.targetId,l=null==e?void 0:e.channelId;this.logger.info(n.A_GET_UG_MSGS_BY_UID_T,JSON.stringify({conversationType:o,targetId:a,channelId:l,messageUIds:s}),t);const c=yield nr.create("getUltraGroupMessageListByMessageUId").check((t=>td(t,e,V))).isTypedArray("messages",i,(e=>gt(null==e?void 0:e.messageUId)),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("messages",null==i?void 0:i.length,1,20,!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).next((()=>{const t=r(this,ST,"m",yT).call(this,e);return this._engine.chat.getRemoteMessagesByUIds(t,i.map((e=>e.messageUId)))}));return this.logger.summary(n.A_GET_UG_MSGS_BY_UID_R,c,t,c.isOk?{list:c.data.map((e=>e.messageUId))}:void 0),c.trans((e=>{const t={};return e.forEach((e=>{t[e.messageUId]=e})),t}))}))}getUGUnreadCountForAllChannels(e,r,i){return t(this,void 0,void 0,(function*(){const s=this.logger.createTraceId();this.logger.info(n.A_GET_UG_UNREAD_COUNT_FOR_ALL_CHANNELS_T,JSON.stringify({targetId:e,levels:i,isGetMentioned:r}),s);const o=yield nr.create("getUGUnreadCountForAllChannels").validate("targetId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).check((e=>{e.isTypedArray("levels",i,(t=>!e.isNumberEnum("",t,exports.NotificationLevel,!0).isFailed))})).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateLogin).next((()=>t(this,void 0,void 0,(function*(){return this._engine.chat.ugSynced?this._engine.chat.getUGUnreadCountForAllChannels(e,i||[],r):sr(exports.ErrorCode.METHOD_NOT_AVAILABLE)}))));return this.logger.summary(n.A_GET_UG_UNREAD_COUNT_FOR_ALL_CHANNELS_R,o,s),o}))}getUGUnreadMentionedDigest(e){return t(this,void 0,void 0,(function*(){const t=null==e?void 0:e.targetId,r=null==e?void 0:e.channelId,i=null==e?void 0:e.sentTime,s=null==e?void 0:e.count,o=this.logger.createTraceId();this.logger.info(n.A_GET_UG_UNREAD_MENTIONED_DIGEST_T,JSON.stringify({targetId:t,channelId:r,sentTime:i,count:s}),o);const a=yield nr.create("getUGUnreadMentionedDigest").validate("targetId",t,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("channelId",r,mt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isLimitedInteger("count",s,1,50,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("sentTime",i,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((()=>(e.channelId=this._channelIdConvert(exports.ConversationType.ULTRA_GROUP,r),this._engine.chat.getUGUnreadMentionedDigest(e))));return this.logger.summary(n.A_GET_UG_UNREAD_MENTIONED_DIGEST_R,a,o,void 0,(e=>({size:e.length}))),a}))}getUGFirstUnreadMessageDigest(e){return t(this,void 0,void 0,(function*(){const i=this.logger.createTraceId();this.logger.info(n.A_GET_UG_FIRST_UNREAD_MSG_DIGEST_T,JSON.stringify(e),i);const s=yield nr.create("getUGFirstUnreadMessageDigest").validate("targetId",null==e?void 0:e.targetId,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("channelId",null==e?void 0:e.channelId,mt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((()=>t(this,void 0,void 0,(function*(){if(!this._engine.chat.ugSynced)return sr(exports.ErrorCode.METHOD_NOT_AVAILABLE);const t=r(this,ST,"m",yT).call(this,Object.assign(Object.assign({},e),{conversationType:exports.ConversationType.ULTRA_GROUP}));return this._engine.chat.getUGFirstUnreadMessageDigest(t)}))));return this.logger.summary(n.A_GET_UG_FIRST_UNREAD_MSG_DIGEST_R,s,i),s}))}getUGUnreadInfoList(e){return t(this,void 0,void 0,(function*(){const r=this.logger.createTraceId();this.logger.info(n.A_GET_UG_UNREAD_INFO_LIST_T,JSON.stringify({targetIds:e}),r);const i=yield nr.create("getUGUnreadInfoList").isLimitedTypedArray("targetIds",e,20,(e=>St(e)),!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateLogin).next((()=>t(this,void 0,void 0,(function*(){if(!this._engine.chat.ugSynced)return sr(exports.ErrorCode.METHOD_NOT_AVAILABLE);const t=new Set(e);return this._engine.chat.getUGUnreadInfoList(Array.from(t))}))));return this.logger.summary(n.A_GET_UG_UNREAD_INFO_LIST_R,i,r,void 0,(e=>({size:e.length}))),i}))}getOSInfo(){return this._engine.getOSInfo()}getProcessInfo(){return this._engine.getProcessInfo()}getMainProcessInfo(){return this._engine.getMainProcessInfo()}setCallInfo(e,t,r){return this.validateConnected().next((()=>this._engine.setCallInfo(e,t,r)))}_validateSubDriven(e,t){const{subDriven:r=0}=e;switch(t){case exports.SubscribeType.ONLINE_STATUS:return 1&r?ir(e):sr(exports.ErrorCode.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE);case exports.SubscribeType.USER_PROFILE:return 2&r?ir(e):sr(exports.ErrorCode.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE);default:return sr(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_TYPE)}}subscribeUser(e,r,i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_SUBSCRIBE_USER_STATUS_T,JSON.stringify({userIds:e,subscribeType:r,expiry:i}),t);const s=yield nr.create("subscribeUser").isLimitedTypedArray("userIds",e,200,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS).isNumberEnum("subscribeType",r,exports.SubscribeType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_TYPE).isLimitedInteger("expiry",i,60,2592e3,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_EXPIRY).result().tryTrans(this.validateConnected).tryTrans((e=>this._validateSubDriven(e,r))).next((()=>this._engine.subscribeUser(e,r,i)));return this.logger.summary(n.A_SUBSCRIBE_USER_STATUS_R,s,t),s}))}unSubscribeUser(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_UNSUBSCRIBE_USER_STATUS_T,JSON.stringify({userIds:e,subscribeType:r}),t);const i=yield nr.create("unSubscribeUser").isLimitedTypedArray("userIds",e,200,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS).isNumberEnum("subscribeType",r,exports.SubscribeType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_TYPE).result().tryTrans(this.validateConnected).tryTrans((e=>this._validateSubDriven(e,r))).next((()=>this._engine.unSubscribeUser(e,r)));return this.logger.summary(n.A_UNSUBSCRIBE_USER_STATUS_R,i,t),i}))}getSubscribeUserList(e,r,i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_SUBSCRIBE_USER_STATUS_LIST_T,JSON.stringify({subscribeType:e,count:r,offset:i}),t);const s=yield nr.create("getSubscribeUserList").isNumberEnum("subscribeType",e,exports.SubscribeType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_TYPE).isLimitedInteger("count",r,1,200,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE).isLimitedInteger("offset",i,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_OFFSET).result().tryTrans(this.validateConnected).tryTrans((t=>this._validateSubDriven(t,e))).next((()=>this._engine.getSubscribeUserList(e,r,i)));return this.logger.summary(n.A_GET_SUBSCRIBE_USER_STATUS_LIST_R,s,t,void 0,(e=>({size:e.length}))),s}))}getSubscribeUserStatus(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_SUB_USERS_STATUS_T,JSON.stringify({subscribeType:e,userIds:r}),t);const i=yield nr.create("getSubscribeUserStatus").isNumberEnum("subscribeType",e,exports.SubscribeType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_TYPE).isLimitedTypedArray("userIds",r,200,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS).result().tryTrans(this.validateConnected).tryTrans((t=>this._validateSubDriven(t,e))).next((()=>this._engine.getSubscribeUserStatus(e,r)));return this.logger.summary(n.A_GET_SUB_USERS_STATUS_R,i,t,void 0,(e=>({size:e.length}))),i}))}getSubscribeUsersOnlineStatus(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_SUB_USERS_ONLINE_STATUS_T,JSON.stringify({userIds:e}),t);const r=yield nr.create("getSubscribeUsersOnlineStatus").isLimitedTypedArray("userIds",e,200,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).next((()=>this._engine.getSubscribeUsersOnlineStatus(e)));return this.logger.summary(n.A_GET_SUB_USERS_ONLINE_STATUS_R,r,t,void 0,(e=>({size:e.length}))),r}))}updateMyUserProfile(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_UPDATE_MY_USER_PROFILE_T,JSON.stringify({profile:e}),t);const r=yield nr.create("updateMyUserProfile").isObject("profile",e,!0).check((t=>{const{name:r,portraitUri:i,email:s,birthday:n,gender:o,location:a,role:l,level:c,extraProfile:d}=e;t.isString("name",r).isString("portraitUri",i).isString("email",s).isString("birthday",n).isNumber("gender",o).isString("location",a).isNumber("role",l).isNumber("level",c).isObject("extraProfile",d),!t.isFailed&&d&&Object.entries(d).forEach((([e,r])=>{t.isString("extraProfile",r,!0)}))})).fail(exports.ErrorCode.INVALID_PARAMETER_USER_PROFILE).result().tryTrans(this.validateConnected).tryTrans((e=>this._validateUserProfile(e))).next((()=>{const t={};return["name","portraitUri","email","birthday","gender","location","role","level"].forEach((r=>{const i=e[r];void 0!==i&&(t[r]=i)})),e.extraProfile&&(t.extraProfile=Object.assign({},e.extraProfile)),this._engine.updateMyUserProfile(t)}));return this.logger.summary(n.A_UPDATE_MY_USER_PROFILE_R,r,t),r}))}getUserProfiles(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_USER_PROFILES_T,JSON.stringify({userIds:e}),t);const r=yield nr.create("getUserProfiles").isLimitedTypedArray("userIds",e,100,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateLogin).tryTrans((e=>this._validateUserProfile(e))).next((()=>this._engine.getUserProfiles(e)));return this.logger.summary(n.A_GET_USER_PROFILES_R,r,t,void 0,(e=>({size:e.length}))),r}))}getMyUserProfile(){return t(this,void 0,void 0,(function*(){const e=this.logger.createTraceId();this.logger.info(n.A_GET_MY_USER_PROFILE_T,void 0,e);const t=yield nr.create("getMyUserProfile").result().tryTrans(this.validateConnected).tryTrans((e=>this._validateUserProfile(e))).next((()=>this._engine.getMyUserProfile()));return this.logger.summary(n.A_GET_MY_USER_PROFILE_R,t,e),t}))}clearConversations(e,r){return t(this,void 0,void 0,(function*(){return this._engine.chat.clearConversations(e,r)}))}addToBlacklist(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_ADD_TO_BLACKLIST_T,JSON.stringify({userId:e}),t);const r=yield nr.create("addToBlacklist").validate("userId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).next((()=>this._engine.addToBlacklist(e)));return this.logger.summary(n.A_ADD_TO_BLACKLIST_R,r,t),r}))}removeFromBlacklist(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_REMOVE_FROM_BLACKLIST_T,JSON.stringify({userId:e}),t);const r=yield nr.create("removeFromBlacklist").validate("userId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).next((()=>this._engine.removeFromBlacklist(e)));return this.logger.summary(n.A_REMOVE_FROM_BLACKLIST_R,r,t),r}))}getBlacklist(){return t(this,void 0,void 0,(function*(){const e=this.logger.createTraceId();this.logger.info(n.A_GET_BLACKLIST_T,void 0,e);const t=yield nr.create("getBlacklist").result().tryTrans(this.validateConnected).next((()=>this._engine.getBlacklist()));return this.logger.summary(n.A_GET_BLACKLIST_R,t,e,void 0,(e=>({size:e.length}))),t}))}getBlacklistStatus(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_BLACKLIST_STATUS_T,JSON.stringify({userId:e}),t);const r=yield nr.create("getBlacklistStatus").validate("userId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).next((()=>this._engine.getBlacklistStatus(e)));return this.logger.summary(n.A_GET_BLACKLIST_STATUS_R,r,t),r}))}insertMessage(e,i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_INSERT_MSG_T,JSON.stringify({conversation:e,params:i}),t);const s=yield nr.create("insertMessage").check((t=>td(t,e,F))).validate("senderUserId",i.senderUserId,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isObject("content",i.content,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_CONTENT).check((e=>{const t=$c(i.messageType,i.content);t.isOk||e.setFailed(t.code)})).isNotEmptyString("messageType",i.messageType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).isNumberEnum("messageDirection",i.messageDirection,exports.MessageDirection,!0).fail(exports.ErrorCode.INVALID_MESSAGE_DIRECTION).check((e=>{i.canIncludeExpansion&&i.expansion&&id(e,i.expansion,!0)})).isTimestamp("sentTime",i.sentTime).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isNumberEnum("sentStatus",i.sentStatus,exports.SentStatus).fail(exports.ErrorCode.INVALID_PARAMETER_SENT_STATUS).isTypedArray("directedUserIds",i.directedUserIds,St).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).isString("searchContent",i.searchContent).fail(exports.ErrorCode.SEARCH_PROPS_LIMIT_ERROR).check((e=>{const{quoteInfo:t}=i;t&&e.isObject("quoteInfo",t,!0).isNotEmptyString("quoteInfo.messageUId",t.messageUId,!0).isNotEmptyString("quoteInfo.senderId",t.senderId,!0).isNotEmptyString("quoteInfo.objectName",t.objectName,!0).isNumberEnum("quoteInfo.quoteMessageStatus",t.quoteMessageStatus,be).fail(exports.ErrorCode.INVALID_PARAMETER_QUOTE_INFO)})).result().tryTrans(this.validateLogin).next((()=>{const t=r(this,ST,"m",yT).call(this,e);return this._engine.insertMessage(t,i)}));return this.logger.summary(n.A_INSERT_MSG_R,s,t),s}))}batchInsertMessage(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_BATCH_INSERT_MSGS_T,JSON.stringify({count:null==e?void 0:e.length,checkDuplicate:r}),t);const i=nr.create(""),s=yield nr.create("batchInsertMessage").isLimitedTypedArray("messages",e,500,(e=>"object"==typeof e&&(td(i,e,F),i.validate("senderUserId",e.senderUserId,St,!0).isNotEmptyString("messageType",e.messageType,!0).isObject("content",e.content,!0).isNumberEnum("messageDirection",e.messageDirection,exports.MessageDirection,!0).check((t=>{e.canIncludeExpansion&&e.expansion&&id(t,e.expansion,!0)})).isTimestamp("sentTime",e.sentTime).isNumberEnum("sentStatus",e.sentStatus,exports.SentStatus).isString("searchContent",e.searchContent).isNumber("receivedStatus",e.receivedStatus).isObject("receivedStatusInfo",e.receivedStatusInfo).isTypedArray("directedUserIds",e.directedUserIds,St).check((t=>{const{quoteInfo:r}=e;r&&t.isObject("quoteInfo",r,!0).isNotEmptyString("quoteInfo.messageUId",r.messageUId,!0).isNotEmptyString("quoteInfo.senderId",r.senderId,!0).isNotEmptyString("quoteInfo.objectName",r.objectName,!0).isNumberEnum("quoteInfo.quoteMessageStatus",r.quoteMessageStatus,be).fail(exports.ErrorCode.INVALID_PARAMETER_QUOTE_INFO)})),!i.isFailed)),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).result().tryTrans(this.validateLogin).next((()=>{const t=e.map((e=>Object.assign(Object.assign({},e),{channelId:this._channelIdConvert(e.conversationType,e.channelId)})));return this._engine.batchInsertMessage(t,r)}));return this.logger.summary(n.A_BATCH_INSERT_MSGS_R,s,t),s}))}getLocalMessageCount(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_LOCAL_MSG_COUNT_T,JSON.stringify({conversation:e}),t);const i=yield nr.create("getMessageCount").check((t=>td(t,e,F))).result().tryTrans(this.validateLogin).next((()=>{const t=r(this,ST,"m",yT).call(this,e);return this._engine.getLocalMessageCount(t)}));return this.logger.summary(n.A_GET_LOCAL_MSG_COUNT_R,i,t),i}))}deleteLocalMessages(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_DELETE_LOCAL_MSGS_T,JSON.stringify({messageIds:e}),t);const r=yield nr.create("deleteLocalMessages").isTypedArray("messageIds",e,(e=>Number.isInteger(e)),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ARRAY).result().tryTrans(this.validateLogin).next((()=>this._engine.deleteLocalMessages(e)));return this.logger.summary(n.A_DELETE_LOCAL_MSGS_R,r,t),r}))}deleteLocalMessagesByTimestamp(e,i,s){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_DEL_LOCAL_MSGS_BY_TIME_T,JSON.stringify({conversation:e,timestamp:i,cleanSpace:s}),t);const o=yield nr.create("deleteLocalMessagesByTimestamp").check((t=>td(t,e,F))).isTimestamp("timestamp",i,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin).next((()=>{const t=r(this,ST,"m",yT).call(this,e);return this._engine.deleteLocalMessagesByTimestamp(t,i,!!s)}));return this.logger.summary(n.A_DEL_LOCAL_MSGS_BY_TIME_R,o,t),o}))}batchClearLocalMessagesByTimestamp(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_BATCH_CLEAR_LOCAL_MSGS_BY_TIME_T,JSON.stringify({options:e}),t);const r=yield nr.create("batchClearLocalMessagesByTimestamp").check((t=>{t.isLimitedTypedArray("options",e,20,(e=>(td(t,e,V),!t.isFailed&&ut({min:0})(e.timestamp)))).fail(exports.ErrorCode.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST)})).result().tryTrans(this.validateLogin).next((()=>{const t=e.map((e=>Object.assign(Object.assign({},e),{channelId:this._channelIdConvert(e.conversationType,e.channelId)})));return this._engine.batchClearLocalMessagesByTimestamp(t)}));return this.logger.summary(n.A_BATCH_CLEAR_LOCAL_MSGS_BY_TIME_R,r,t),r}))}batchClearRemoteHistoryMessages(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_BATCH_CLEAR_REMOTE_MSG_T,JSON.stringify({options:e,isDeleteLocal:r}),t);const i=yield nr.create("batchClearRemoteHistoryMessages").isLimitedArray("options",e,20,!0,1).check((t=>{e.forEach((e=>{td(t,e,V).isTimestamp("timestamp",null==e?void 0:e.timestamp)}))})).fail(exports.ErrorCode.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST,void 0,!0).check((t=>{e.some((e=>e.conversationType===exports.ConversationType.ULTRA_GROUP))&&t.setFailed(exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT)})).result().tryTrans(this.validateConnected).next((()=>this._engine.chat.batchClearRemoteHistoryMessages(e,!!r)));return this.logger.summary(n.A_BATCH_CLEAR_REMOTE_MSG_R,i,t),i}))}clearLocalMessages(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_CLEAR_LOCAL_MSG_T,JSON.stringify({conversation:e}),t);const r=yield nr.create("clearLocalMessages").check((t=>td(t,e,F))).result().tryTrans(this.validateLogin).next((()=>this._engine.clearLocalMessages(e)));return this.logger.summary(n.A_CLEAR_LOCAL_MSG_R,r,t),r}))}getLocalMessage(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_LOCAL_MESSAGE_T,JSON.stringify({messageId:e}),t);const r=nr.create("getLocalMessage").validate("messageId",e,(()=>gt(e)||_t(e)),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).result(),i=yield r.next((()=>this._engine.getMessage(e)));return this.logger.summary(n.A_GET_LOCAL_MESSAGE_R,i,t,{messageId:e}),i}))}_innerSetMessageContent(e,r,i){return t(this,void 0,void 0,(function*(){return this._engine.setMessageContent(e,r,i)}))}setMessageContent(e,r,i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_SET_MSG_CONTENT_T,JSON.stringify({messageId:e,messageType:i}),t);const s=yield nr.create("setMessageContent").isInteger("messageId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).isNotEmptyString("messageType",i,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).isObject("content",r,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_CONTENT).result().tryTrans(this.validateLogin).next((()=>{const t=JSON.stringify(r);return this._innerSetMessageContent(e,t,i)}));return this.logger.summary(n.A_SET_MSG_CONTENT_R,s,t),s}))}setMessageSearchField(e,r,i){return t(this,void 0,void 0,(function*(){return this._engine.setMessageSearchField(e,r,i)}))}setMessageSentStatus(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_E_SET_MSG_SENT_STATUS_T,JSON.stringify({messageId:e,sentStatus:r}),t);const i=yield nr.create("setMessageSentStatus").isInteger("messageId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).isNumberEnum("sentStatus",r,exports.SentStatus,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SENT_STATUS).result().tryTrans(this.validateLogin).next((()=>this._engine.setMessageSentStatus(e,r)));return this.logger.summary(n.A_E_SET_MSG_SENT_STATUS_R,i,t),i}))}setMessageReceivedStatus(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_E_SET_MSG_RECEIVED_STATUS_T,JSON.stringify({messageId:e,receivedStatus:r}),t);const i=yield nr.create("setMessageReceivedStatus").isInteger("messageId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).isInteger("receivedStatus",r,!0).fail(exports.ErrorCode.INVALID_PARAMETER_RECEIVED_STATUS).result().tryTrans(this.validateLogin).next((()=>this._engine.setMessageReceivedStatus(e,r)));return this.logger.summary(n.A_E_SET_MSG_RECEIVED_STATUS_R,i,t),i}))}setMessageStatusToRead(e,r){return t(this,void 0,void 0,(function*(){const t=ed("setMessageStatusToRead",e,w).isNumber("timestamp",r,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin);if(!t.isOk)return t.wipe();const i=this.logger.createTraceId(),{conversationType:s,targetId:o,channelId:a}=e;this.logger.info(n.A_E_SET_MESSAGE_STATUS_TO_READ_T,JSON.stringify({conversation:e,timestamp:r}),i);const l=yield this._engine.updateMessageReceiptStatus(s,o,r,a);return this.logger.summary(n.A_E_SET_MESSAGE_STATUS_TO_READ_R,l,i),l}))}setUserStatus(e){return t(this,void 0,void 0,(function*(){return this._engine.setUserStatus(e)}))}getUserStatus(e){return t(this,void 0,void 0,(function*(){return this._engine.getUserStatus(e)}))}searchConversationByContent(e,r,i,s){return t(this,void 0,void 0,(function*(){const t=nr.create("searchConversationByContent").isNotEmptyString("keyword",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEYWORD).isTypedArray("messageTypes",r,(e=>gt(e))).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).validate("channelId",i,mt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",s,(e=>W(e,V))).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateLogin);if(!t.isOk)return t.wipe();const o=this.logger.createTraceId();this.logger.info(n.A_E_SEARCH_CONVERSATION_BY_CONTENT_T,JSON.stringify({keyword:e,messageTypes:r,channelId:i,conversationTypes:s}),o);const a=yield this._engine.chat.searchConversationByContent(e,r&&0!==r.length?r:[Q.TEXT,Q.FILE],i||"",s&&0!==s.length?s:Y(V));return this.logger.summary(n.A_E_SEARCH_CONVERSATION_BY_CONTENT_R,a,o,void 0,(e=>({size:e.length}))),a}))}searchConversationByContentWithAllChannel(e,r,i){return t(this,void 0,void 0,(function*(){return this._engine.searchConversationByContentWithAllChannel(e,r&&0!==r.length?r:[Q.TEXT,Q.FILE],i&&0!==i.length?i:Y(V))}))}searchMessages(e,i){var s,n;return t(this,void 0,void 0,(function*(){const t=ed("searchMessages",e,F).isLimitedString("keyword",null==i?void 0:i.keyword,0,1e3,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEYWORD).isLimitedInteger("limit",null==i?void 0:i.limit,1,it,!0).fail(exports.ErrorCode.INVALID_PARAMETER_LIMIT).isLimitedInteger("offset",null==i?void 0:i.offset,0,it).fail(exports.ErrorCode.INVALID_PARAMETER_OFFSET).isLimitedInteger("order",null==i?void 0:i.order,0,1,!0).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isObject("timeRange",i.timeRange).validate("timeRange",i.timeRange,(e=>{let{startTime:t,endTime:r}=e;return!t&&!r||!(t&&!_t(t)||r&&!_t(r))&&(t=null!=t?t:0,r=null!=r?r:Date.now(),t>=0&&t<=r)})).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isTypedArray("objectNames",null===(s=null==i?void 0:i.messageFilter)||void 0===s?void 0:s.objectNames,(e=>"string"==typeof e&&e.length>0&&e.length<=128)).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST).isTypedArray("senderIds",null===(n=null==i?void 0:i.messageFilter)||void 0===n?void 0:n.senderIds,St).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans((()=>Ct()?ir():sr(exports.ErrorCode.NOT_SUPPORT,"Only support electron platform."))).tryTrans(this.validateLogin);if(!t.isOk)return t.wipe();const o=r(this,ST,"m",yT).call(this,e);return(yield r(this,ST,"m",bT).call(this,Object.assign(Object.assign({},i),{conversationFilter:{conversationTypes:[o.conversationType],targetIds:[o.targetId],channelIds:"string"==typeof o.channelId?[o.channelId]:[]}}))).orSync((()=>ir({messages:[],totalMatched:0,conditionsMatched:0})))}))}searchMessagesWithParams(e){var i,s,n,o,a,l;return t(this,void 0,void 0,(function*(){const t=nr.create("searchMessagesWithParams").isObject("params",e,!0).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER).isLimitedString("keyword",null==e?void 0:e.keyword,0,1e3).fail(exports.ErrorCode.INVALID_PARAMETER_KEYWORD).isLimitedInteger("limit",null==e?void 0:e.limit,1,it,!0).fail(exports.ErrorCode.INVALID_PARAMETER_LIMIT).isLimitedInteger("offset",null==e?void 0:e.offset,0,it).fail(exports.ErrorCode.INVALID_PARAMETER_OFFSET).isLimitedInteger("order",null==e?void 0:e.order,0,1,!0).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isObject("timeRange",null==e?void 0:e.timeRange).validate("timeRange",null==e?void 0:e.timeRange,(e=>{let{startTime:t,endTime:r}=e;return!t&&!r||!(t&&!_t(t)||r&&!_t(r))&&(t=null!=t?t:0,r=null!=r?r:Date.now(),t>=0&&t<=r)})).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isTypedArray("conversationTypes",null===(i=null==e?void 0:e.conversationFilter)||void 0===i?void 0:i.conversationTypes,(e=>W(e,F))).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isLimitedTypedArray("targetIds",null===(s=null==e?void 0:e.conversationFilter)||void 0===s?void 0:s.targetIds,20,St,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGETID_LIST).isLimitedTypedArray("channelIds",null===(n=null==e?void 0:e.conversationFilter)||void 0===n?void 0:n.channelIds,10,mt,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isLimitedTypedArray("senderIds",null===(o=null==e?void 0:e.messageFilter)||void 0===o?void 0:o.senderIds,20,St,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).isTypedArray("objectNames",null===(a=null==e?void 0:e.messageFilter)||void 0===a?void 0:a.objectNames,(e=>"string"==typeof e&&e.length>0&&e.length<=128)).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST).result().tryTrans(this.validateLogin);return t.isOk?(e.limit=Math.min(e.limit,100),(null===(l=e.messageFilter)||void 0===l?void 0:l.objectNames)&&e.messageFilter.objectNames.length>300&&(e.messageFilter.objectNames=e.messageFilter.objectNames.slice(0,300)),r(this,ST,"m",bT).call(this,e)):t.wipe()}))}getMessagesAroundTimestamp(e,i,s,o){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_MSGS_AROUND_TIMESTAMP_T,JSON.stringify({conversation:e,timestamp:i,beforeCount:s,afterCount:o}),t);const a=yield nr.create("getMessagesAroundTimestamp").check((t=>td(t,e,F))).isLimitedInteger("timestamp",i,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("beforeCount",s,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_BEFORE).isLimitedInteger("afterCount",o,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_AFTER).result().tryTrans(this.validateLogin).next((()=>{const t=r(this,ST,"m",yT).call(this,e);return this._engine.chat.getMessagesAroundTimestamp(t,i,s,o)}));return this.logger.summary(n.A_GET_MSGS_AROUND_TIMESTAMP_R,a,t,void 0,(e=>({size:e.length}))),a}))}getUnreadMentionedMessages(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_UNREAD_MENTIONED_MSGS_T,JSON.stringify(e),t);const i=yield nr.create("getUnreadMentionedMessages").check((t=>td(t,e,F))).result().tryTrans(this.validateLogin).next((()=>{const t=r(this,ST,"m",yT).call(this,e);return this._engine.chat.getUnreadMentionedMessages(t)}));return this.logger.summary(n.A_GET_UNREAD_MENTIONED_MSGS_R,i,t,void 0,(e=>({size:e.length}))),i}))}getUltraGroupDefaultNotificationLevel(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_UG_DEFAULT_NTF_LEVEL_T,JSON.stringify({targetId:e,channelId:r}),t);const i=yield nr.create("getUltraGroupDefaultNotificationLevel").validate("targetId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("channelId",r,mt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((()=>{const t="string"==typeof r?this._channelIdConvert(exports.ConversationType.ULTRA_GROUP,r):r;return this._engine.chat.getUGDefaultNotificationLevel(e,t)}));return this.logger.summary(n.A_GET_UG_DEFAULT_NTF_LEVEL_R,i,t),i}))}setUltraGroupDefaultNotificationLevel(e,r,i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_SET_UG_DEFAULT_NTF_LEVEL_T,JSON.stringify({targetId:e,notificationLevel:r,channelId:i}),t);const s=yield nr.create("setUltraGroupDefaultNotificationLevel").validate("targetId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("channelId",i,mt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isNumberEnum("notificationLevel",r,exports.NotificationLevel,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected).next((()=>{const t="string"==typeof i?this._channelIdConvert(exports.ConversationType.ULTRA_GROUP,i):i;return this._engine.chat.setUGDefaultNotificationLevel(e,r,t)}));return this.logger.summary(n.A_SET_UG_DEFAULT_NTF_LEVEL_R,s,t),s}))}getConversationNotificationLevel(e){return t(this,void 0,void 0,(function*(){const t=ed("getConversationNotificationLevel",e,V).result();return t.isOk?this._engine.chat.getConversationNotificationLevel(r(this,ST,"m",yT).call(this,e)):t.wipe()}))}setConversationTypeNotificationLevel(e,r){return t(this,void 0,void 0,(function*(){const t=nr.create("setConversationTypeNotificationLevel").validate("conversationType",e,(()=>W(e,V)),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE).isNumberEnum("level",r,exports.NotificationLevel,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected);return t.isOk?this._engine.chat.setConversationTypeNotificationLevel(e,r):t.wipe()}))}getConversationTypeNotificationLevel(e){return t(this,void 0,void 0,(function*(){const t=nr.create("getConversationTypeNotificationLevel").validate("conversationType",e,(()=>W(e,V)),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE).result().tryTrans(this.validateConnected);return t.isOk?this._engine.chat.getConversationTypeNotificationLevel(e):t.wipe()}))}getRemoteHistoryMessages(e,i){return t(this,void 0,void 0,(function*(){const t=null==i?void 0:i.timestamp,s=null==i?void 0:i.count,o=null==i?void 0:i.order,a=this.logger.createTraceId();this.logger.info(n.A_GET_REMOTE_HISTORY_MSG_T,JSON.stringify({conversation:e,options:i}),a);const l=yield nr.create("getRemoteHistoryMessages").check((t=>td(t,e,k))).isLimitedInteger("timestamp",t,0,Number.MAX_SAFE_INTEGER).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("order",o,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isLimitedInteger("count",s,1,100).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).next((()=>{const i={timestamp:t||0,count:s||20,order:o||0,messageType:""},n=r(this,ST,"m",yT).call(this,e);return this._engine.getHistoryMessage(n,i,!1)}));return this.logger.summary(n.A_GET_REMOTE_HISTORY_MSG_R,l,a,void 0,(({list:e})=>({size:e.length}))),l}))}clearLocalData(){return this.logger.info(n.A_CLEAR_LOCAL_CACHE_O),this._engine.clearLocalData()}createLogger(e,t){return this._engine.createLogger(e,t)}getConversations(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_CONVERSATIONS_T,JSON.stringify({identifiers:e}),t);const i=yield nr.create("getConversations").check((t=>{t.isLimitedTypedArray("identifiers",e,100,(e=>!td(t,e,F).isFailed),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST)})).result().tryTrans(this.validateLogin).next((()=>{const t=e.map((e=>r(this,ST,"m",yT).call(this,e)));return this._engine.chat.getConversations(t)}));return this.logger.summary(n.A_GET_CONVERSATIONS_R,i,t,void 0,(e=>({size:e.length}))),i}))}setCheckDuplicateMessage(e){return this._engine.setCheckDuplicateMessage(!!e)}rtcSignaling(e,r,i,s){return t(this,void 0,void 0,(function*(){return yield this.validateConnected().next((()=>this._engine.rtcSignaling(e,r,i,s)))}))}rtcPing(e,t,r){return this._engine.rtcPing(e,t,r)}setProxy(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_SET_PROXY_T,JSON.stringify({proxy:e}),t);const r=yield nr.create("setProxy").check((t=>sd(t,e))).result().next((()=>this._engine.setProxy(e)));return this.logger.summary(n.A_SET_PROXY_R,r,t),r}))}getProxy(){return t(this,void 0,void 0,(function*(){const e=this.logger.createTraceId();this.logger.info(n.A_GET_PROXY_T,JSON.stringify({}),e);const t=yield this._engine.getProxy();return this.logger.summary(n.A_GET_PROXY_R,t,e),t}))}testProxy(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_TEST_PROXY_T,JSON.stringify({proxy:e,testHost:r}),t);const i=yield nr.create("testProxy").check((t=>sd(t,e))).isString("testHost",r,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TESTHOST).result().next((()=>this._engine.testProxy(e,r)));return this.logger.summary(n.A_TEST_PROXY_R,i,t),i}))}getRealtimeConversations(e,r,i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_REALTIME_CONVERSATIONS_T,JSON.stringify({count:e,startTime:r,order:i}),t);const s=yield nr.create("getRealtimeConversations").isLimitedInteger("count",e,1,50,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isTimestamp("startTime",r,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("order",i,0,1,!0).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).result().tryTrans(this.validateConnected).tryTrans(Id).next((()=>this._engine.chat.getRealtimeConversations(e,r,i)));return this.logger.summary(n.A_GET_REALTIME_CONVERSATIONS_R,s,t,void 0,(e=>({size:e.length}))),s}))}getRealtimeConTotalUnreadCount(){return t(this,void 0,void 0,(function*(){const e=this.logger.createTraceId();this.logger.info(n.A_GET_REALTIM_CON_TOTAL_UNREAD_COUNT_T,"",e);const t=yield this.validateConnected().tryTrans(Id).next((()=>this._engine.chat.getRealtimeConTotalUnreadCount()));return this.logger.summary(n.A_GET_REALTIM_CON_TOTAL_UNREAD_COUNT_R,t,e),t}))}clearRealtimeConUnreadCount(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_CLEAR_REALTIME_CON_UNREAD_COUNT_T,JSON.stringify(e),t);const r=yield this.validateConnected().tryTrans(Id).next((()=>this._engine.chat.clearRealtimeConUnreadCount(e)));return this.logger.summary(n.A_CLEAR_REALTIME_CON_UNREAD_COUNT_R,r,t),r}))}removeRealtimeConversations(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_REMOVE_REALTIME_CONVERSATIONS_T,JSON.stringify(e),t);const r=yield nr.create("removeRealtimeConversations").check((t=>{t.isLimitedTypedArray("identifiers",e,20,(e=>!td(t,e,F).isFailed),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST)})).result().tryTrans(this.validateConnected).tryTrans(Id).next((()=>this._engine.chat.removeRealtimeConversations(e)));return this.logger.summary(n.A_REMOVE_REALTIME_CONVERSATIONS_R,r,t),r}))}batchGetRealtimeConUnreadCount(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_BATCH_GET_REALTIME_CON_UNREAD_COUNT_T,JSON.stringify(e),t);const r=yield nr.create("batchGetRealtimeConUnreadCount").check((t=>{t.isLimitedTypedArray("identifiers",e,10,(e=>!td(t,e,F).isFailed),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST)})).result().tryTrans(this.validateConnected).tryTrans(Id).next((()=>this._engine.chat.batchGetRealtimeConUnreadCount(e)));return this.logger.summary(n.A_BATCH_GET_REALTIME_CON_UNREAD_COUNT_R,r,t,void 0,(e=>({size:e.length}))),r}))}setNotificationQuietHoursWithSetting(e){return nr.create("setNotificationQuietHoursWithSetting").isObject("opts",e,!0).isString("timezone",e.timezone).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER).validate("startTime",e.startTime,(e=>/^\d{2}(:\d{2}){2}$/.test(e)),!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTRING).isLimitedNumber("spanMinutes",e.spanMinutes,1,1439,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SPAN_MINUTES).isNumberEnum("level",e.level,exports.PushNotificationQuietHoursLevel,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected).next((()=>this._engine.setNotificationQuietHoursWithSetting(e)))}removeNotificationQuietHoursSetting(){return this.validateConnected().next((()=>this._engine.removeNotificationQuietHoursSetting()))}getNotificationQuietHoursSetting(){return this.validateConnected().next((()=>this._engine.getNotificationQuietHoursSetting()))}getStatsUrlList(){return this._engine.getStatsUrlList()}sendReadReceiptResponseV5(e,r){return t(this,void 0,void 0,(function*(){const t=ed("sendReadReceiptResponseV5",e,G).isTypedArray("messageUIdArray",r,(e=>St(e)),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",r.length,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((e=>4===e.grpRRVer?ir():sr(exports.ErrorCode.READ_RECEIPT_ERROR)));return t.isOk?this._engine.chat.sendReadReceiptResponseV5(e,r):t.wipe()}))}getMessageReadReceiptInfoV5(e,r){return t(this,void 0,void 0,(function*(){const t=ed("getMessageReadReceiptInfoV5",e,G).isTypedArray("messageUIdArray",r,(e=>St(e)),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",r.length,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((e=>4===e.grpRRVer?ir():sr(exports.ErrorCode.READ_RECEIPT_ERROR)));if(!t.isOk)return t.wipe();const i=r.map((t=>({identifier:e,messageUId:t})));return this._engine.chat.getMessageReadReceiptInfoV5ByIdentifiers(i)}))}getMessageReadReceiptInfoV5ByIdentifiers(e){return t(this,void 0,void 0,(function*(){const t=nr.create(""),r=nr.create("getMessageReadReceiptInfoV5ByIdentifiers").isTypedArray("identifiers",e,(e=>td(t,e.identifier,G).isNotEmptyString("messageUId",e.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).result().isOk),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",e.length,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((e=>4===e.grpRRVer?ir():sr(exports.ErrorCode.READ_RECEIPT_ERROR)));return r.isOk?this._engine.chat.getMessageReadReceiptInfoV5ByIdentifiers(e):r.wipe()}))}getMessagesReadReceiptUsersByPageV5(e,r,i){return t(this,void 0,void 0,(function*(){const t=ed("getMessageReadReceiptInfoV5",e,G).isNotEmptyString("messageUId",r,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isObject("option",i,!0).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,"option type error").isString("pageToken",i.pageToken).fail(exports.ErrorCode.INVALID_PARAMETER_PAGING_QUERY_OPTION).isLimitedInteger("pageCount",i.pageCount,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((e=>4===e.grpRRVer?ir():sr(exports.ErrorCode.READ_RECEIPT_ERROR)));return t.isOk?(i.order=1!==i.order?0:1,i.readStatus=1!==i.readStatus?0:1,this._engine.chat.getMessagesReadReceiptUsersByPageV5(e,r,i)):t.wipe()}))}getMessagesReadReceiptByUsersV5(e,r,i){return t(this,void 0,void 0,(function*(){const t=ed("getMessagesReadReceiptByUsersV5",e,G).isNotEmptyString("messageUId",r,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isTypedArray("userList",i,(e=>St(e)),!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isLimitedInteger("userList",i.length,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((e=>4===e.grpRRVer?ir():sr(exports.ErrorCode.READ_RECEIPT_ERROR)));return t.isOk?this._engine.chat.getMessagesReadReceiptByUsersV5(e,r,i):t.wipe()}))}requestSpeechToTextForMessage(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_REQUEST_SPEECH_TO_TEXT_FOR_MESSAGE_T,JSON.stringify({messageUId:e,option:r}),t);const i=yield nr.create("requestSpeechToTextForMessage").isNotEmptyString("messageUId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).tryTrans((e=>!!(1&(e.AIBusinessSub||0))?ir():sr(exports.ErrorCode.SPEECH_TO_TEXT_DISABLE))).next((()=>this._engine.chat.requestSpeechToTextForMessage(e,r)));return this.logger.summary(n.A_REQUEST_SPEECH_TO_TEXT_FOR_MESSAGE_R,i,t),i}))}setMessageSpeechToTextVisible(e,r){return t(this,void 0,void 0,(function*(){return yield nr.create("setMessageSpeechToTextVisible").isNumber("messageId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).result().tryTrans(this.validateLogin).next((()=>this._engine.chat.setMessageSpeechToTextVisible(e,!!r)))}))}getUntaggedConversationListByPage(e,r,i){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_UNTAGGED_CONVERSATION_LIST_BY_PAGE_T,JSON.stringify({timestamp:e,count:r,topPriority:i}),t);const s=yield nr.create("getUntaggedConversationListByPage").isLimitedInteger("timestamp",e,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isInteger("count",r,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateLogin).next((()=>{const t=r<=0?20:Math.min(r,100);return this._engine.chat.getUntaggedConversationListByPage(e,t,!!i)}));return this.logger.summary(n.A_GET_UNTAGGED_CONVERSATION_LIST_BY_PAGE_R,s,t,void 0,(e=>({size:e.length}))),s}))}translateMessagesWithParams(e){var i;return t(this,void 0,void 0,(function*(){const t=Ct(),s=yield nr.create("translateMessagesWithParams").isTypedArray("list",null==e?void 0:e.list,(e=>e instanceof gi&&e.isValid(!t)),!0).fail(exports.ErrorCode.TRANSLATION_PARAMS_TYPE_INVALID).isLimitedInteger("list",null===(i=null==e?void 0:e.list)||void 0===i?void 0:i.length,1,10,!0).fail(exports.ErrorCode.TRANSLATION_PARAMS_LIST_INVALID).isNumberEnum("mode",null==e?void 0:e.mode,hi).fail(exports.ErrorCode.INVALID_PARAMETER_TRANSLATE_MODE).result().tryTrans(this.validateConnected);if(!s.isOk)return s.wipe();const{list:n,force:o,mode:a}=e;return r(this,ST,"m",LT).call(this,n,0,a,o)}))}translateTextsWithParams(e){var i;return t(this,void 0,void 0,(function*(){const t=yield nr.create("translateTextsWithParams").isTypedArray("list",null==e?void 0:e.list,(e=>e instanceof Ii&&e.isValid(!0)),!0).fail(exports.ErrorCode.TRANSLATION_PARAMS_TYPE_INVALID).isLimitedInteger("list",null===(i=null==e?void 0:e.list)||void 0===i?void 0:i.length,1,10,!0).fail(exports.ErrorCode.TRANSLATION_PARAMS_LIST_INVALID).isNumberEnum("mode",null==e?void 0:e.mode,hi).fail(exports.ErrorCode.INVALID_PARAMETER_TRANSLATE_MODE).result().tryTrans(this.validateConnected);if(!t.isOk)return t.wipe();const{list:s,mode:n}=e;return r(this,ST,"m",LT).call(this,s,1,n)}))}setTranslationLanguage(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_SET_TRANSLATION_LANGUAGE_T,JSON.stringify({language:e}),t);const r=yield nr.create("setTranslationLanguage").isLimitedString("language",e,1,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_LAUGUAGE).result().tryTrans(this.validateConnected).next((()=>this._engine.userSettings.setTranslationLanguage(e)));return this.logger.summary(n.A_SET_TRANSLATION_LANGUAGE_R,r,t),r}))}getTranslationLanguage(){return t(this,void 0,void 0,(function*(){const e=this.logger.createTraceId();this.logger.info(n.A_GET_TRANSLATION_LANGUAGE_T,void 0,e);const t=yield this.validateLogin().next((()=>this._engine.userSettings.getTranslationLanguage()));return this.logger.summary(n.A_GET_TRANSLATION_LANGUAGE_R,t,e),t}))}setAutoTranslateEnabled(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_SET_AUTO_TRANSLATE_ENABLED_T,JSON.stringify({enabled:!!e}),t);const r=yield this.validateConnected().next((()=>this._engine.userSettings.setAutoTranslateEnabled(!!e)));return this.logger.summary(n.A_SET_AUTO_TRANSLATE_ENABLED_R,r,t),r}))}getAutoTranslateEnabled(){return t(this,void 0,void 0,(function*(){const e=this.logger.createTraceId();this.logger.info(n.A_GET_AUTO_TRANSLATE_ENABLED_T,void 0,e);const t=yield this.validateLogin().next((()=>this._engine.userSettings.getAutoTranslateEnabled()));return this.logger.summary(n.A_GET_AUTO_TRANSLATE_ENABLED_R,t,e),t}))}modifyMessageWithParams(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId(),r=null==e?void 0:e.messageUId,i=null==e?void 0:e.messageContent;this.logger.info(n.A_MODIFY_MESSAGE_WITH_PARAMS_T,JSON.stringify({messageUId:r,conversation:null==e?void 0:e.conversation}),t);const s=yield nr.create("modifyMessageWithParams").check((t=>td(t,null==e?void 0:e.conversation,B))).isNotEmptyString("messageUId",r,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isObject("messageContent",i,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_CONTENT).isLimitedInteger("messageContent",nd(JSON.stringify(i)),1,Ge,!0).fail(exports.ErrorCode.RC_MSG_CONTENT_EXCEED_LIMIT).result().tryTrans(this.validateConnected).next((()=>this._engine.chat.modifyMessageWithParams(e)));return this.logger.summary(n.A_MODIFY_MESSAGE_WITH_PARAMS_R,s,t),s}))}refreshReferenceMessageWithParams(e){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId(),r=null==e?void 0:e.messageUIds;this.logger.info(n.A_REFRESH_REFERENCE_MESSAGE_WITH_PARAMS_T,JSON.stringify({messageUIds:r}),t);const i=yield ed("refreshReferenceMessageWithParams",null==e?void 0:e.conversationIdentifier,B).isObject("params",e,!0).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER).isTypedArray("messageUIds",r,(e=>gt(e)),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("messageUIds",null==r?void 0:r.length,1,20,!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).next((()=>this._engine.chat.refreshReferenceMessageWithParams(r,e.conversationIdentifier,e.remoteMessageBlock,e.localMessageBlock,e.messageInfoMap)));return this.logger.summary(n.A_REFRESH_REFERENCE_MESSAGE_WITH_PARAMS_R,i,t),i}))}syncRemoteConversations(){return t(this,void 0,void 0,(function*(){const e=this.logger.createTraceId();this.logger.info(n.A_SYNC_REMOTE_CONVERSATIONS_T,void 0,e);const t=yield this.validateConnected().next((()=>this._engine.chat.syncRemoteConversations()));return this.logger.summary(n.A_SYNC_REMOTE_CONVERSATIONS_R,t,e),t}))}deleteLocalUGMessagesForAllChannel(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_DEL_LOCAL_UG_MSGS_FOR_ALL_CHANNEL_T,JSON.stringify({targetId:e,timestamp:r}),t);const i=yield nr.create("deleteLocalUGMessagesForAllChannel").isNotEmptyString("targetId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isTimestamp("timestamp",r,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin).next((()=>this._engine.chat.deleteLocalUGMessagesForAllChannel(e,r)));return this.logger.summary(n.A_DEL_LOCAL_UG_MSGS_FOR_ALL_CHANNEL_R,i,t),i}))}getUnreadMentionMeConversationList(e){return t(this,void 0,void 0,(function*(){const r=this.logger.createTraceId();this.logger.info(n.A_GET_UNREAD_MENTION_ME_CONVERSATION_LIST_T,JSON.stringify({params:e}),r);const i=yield nr.create("getUnreadMentionMeConversationList").isLimitedTypedArray("conversationTypes",null==e?void 0:e.conversationTypes,Number.MAX_SAFE_INTEGER,(e=>W(e,V)),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isTimestamp("timestamp",null==e?void 0:e.timestamp,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("count",null==e?void 0:e.count,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).next((r=>t(this,void 0,void 0,(function*(){const t=yI(r);if(t){if(!this._engine.chat.ugSynced)return sr(exports.ErrorCode.METHOD_NOT_AVAILABLE)}else if(e.conversationTypes=e.conversationTypes.filter((e=>e!==exports.ConversationType.ULTRA_GROUP)),0===e.conversationTypes.length)return ir([]);return this._engine.chat.getUnreadMentionMeConversationList(e,t)}))));return this.logger.summary(n.A_GET_UNREAD_MENTION_ME_CONVERSATION_LIST_R,i,r,void 0,(e=>({size:e.length}))),i}))}getAllRobots(){return t(this,void 0,void 0,(function*(){const e=this.logger.createTraceId();this.logger.info(n.A_GET_ALL_ROBOTS_T,void 0,e);const t=yield this.validateConnected().next((()=>this._engine.getAllRobots()));return this.logger.summary(n.A_GET_ALL_ROBOTS_R,t,e,void 0,(e=>({size:e.length}))),t}))}getRobotById(e){return t(this,void 0,void 0,(function*(){const r=this.logger.createTraceId();this.logger.info(n.A_GET_ROBOT_BY_ID_T,JSON.stringify({id:e}),r);const i=yield nr.create("getRobotById").validate("id",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateConnected).next((()=>t(this,void 0,void 0,(function*(){return this._engine.getAllRobots()})))),s=i.trans((t=>t.find((t=>t.robotId===e))||null));return this.logger.summary(n.A_GET_ROBOT_BY_ID_R,i,r,{id:e,robot:s.data}),s}))}getMessagesByUIds(e,r){return t(this,void 0,void 0,(function*(){const t=this.logger.createTraceId();this.logger.info(n.A_GET_MESSAGES_T,JSON.stringify({conversation:e,messageUIds:r}),t);const i=yield nr.create("getMessages").check((t=>td(t,e,V))).isTypedArray("messageUIds",r,gt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("messageUIds",null==r?void 0:r.length,1,20,!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).next((()=>{const t=Array.from(new Set(r));return this._engine.getMessagesByUIds(e,t)}));return this.logger.summary(n.A_GET_MESSAGES_R,i,t,void 0,(e=>{const t=Array.from(new Set(r)).filter((t=>!e.some((e=>e.messageUId===t))));return{size:e.length,missingMessageUIds:t}})),i}))}}ST=new WeakSet,vT=function(e,r,i){return t(this,void 0,void 0,(function*(){const s=yield nr.create("connect").isNotEmptyString("token",e).fail(exports.ErrorCode.RC_CONN_TOKEN_INCORRECT).result().next((()=>t(this,void 0,void 0,(function*(){this._token=e;const t=yield io.getNetworkType();this._engine.setNetwork({status:!0,type:t},!0);const s=!!this._pluginInstanseMap.RCCallPlus;return this._engine.connect(e,r,s,i)}))));if(s.isOk){if(1!==this._engine.naviInfo.type){const e=ot.getInfo();this._engine.reportSDKInfo(e)}}return s}))},CT=function(e,r){return t(this,void 0,void 0,(function*(){return clearInterval(this._typingInternalTimer),this._typingInternalTimer=-1,this._typingInfo={},yield this._engine.disconnect(e,r),this._pluginContextQueue.forEach((e=>{if(e.ondisconnect)try{e.ondisconnect()}catch(e){this.logger.error(n.L_CALLBACK_E,null==e?void 0:e.stack)}})),Promise.resolve()}))},yT=function(e){return Object.assign(Object.assign({},e),{channelId:this._channelIdConvert(e.conversationType,e.channelId)})},OT=function(e,i,s,n){return t(this,void 0,void 0,(function*(){return yield nr.create("sendMessage").check((t=>td(t,e,F))).isObject("content",i.content,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_CONTENT).check((e=>{const t=$c(i.messageType,i.content);t.isOk||e.setFailed(t.code)})).isNumber("messageId",i.messageId).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).isBoolean("isStatusMessage",i.isStatusMessage).fail(exports.ErrorCode.INVALID_PARAMETER_IS_STATUS_MESSAGE).isBoolean("disableNotification",i.disableNotification).fail(exports.ErrorCode.INVALID_PARAMETER_DISABLE_NOTIFICATION).isString("pushContent",i.pushContent).fail(exports.ErrorCode.INVALID_PARAMETER_PUSH_CONTENT).isString("pushData",i.pushData).fail(exports.ErrorCode.INVALID_PARAMETER_PUSH_DATA).isObject("pushConfig",i.pushConfig).fail(exports.ErrorCode.INVALID_PARAMETER_PUSH_CONFIG).isBoolean("isVoipPush",i.isVoipPush).fail(exports.ErrorCode.INVALID_PARAMETER_IS_VOIP_PUSH).isBoolean("canIncludeExpansion",i.canIncludeExpansion).fail(exports.ErrorCode.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION).check((e=>{i.canIncludeExpansion&&i.expansion&&id(e,i.expansion,!0)})).check((t=>{t.isBoolean("disableUpdateLastMessage",i.disableUpdateLastMessage).fail(exports.ErrorCode.INVALID_DISABLE_UPDATE_LAST_MESSAGE),t.isFailed||e.conversationType===exports.ConversationType.ULTRA_GROUP&&i.disableUpdateLastMessage&&t.setFailed(exports.ErrorCode.INVALID_DISABLE_UPDATE_LAST_MESSAGE)})).check((t=>{if(!!t.isLimitedTypedArray("directionalUserIdList",i.directionalUserIdList,300,St,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).isFailed||!i.directionalUserIdList||0===i.directionalUserIdList.length)return;const{conversationType:r}=e;[exports.ConversationType.GROUP,exports.ConversationType.ULTRA_GROUP,exports.ConversationType.APP_PUBLIC_SERVICE,exports.ConversationType.PUBLIC_SERVICE].includes(r)||t.setFailed(exports.ErrorCode.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE)})).isBoolean("isMentioned",i.isMentioned).fail(exports.ErrorCode.INVALID_PARAMETER_IS_MENTIONED).check((e=>{if(!i.isMentioned)return void delete i.content.mentionedInfo;const t=i.content.mentionedInfo||{type:i.mentionedType,userIdList:i.mentionedUserIdList};!e.isNumberEnum("mentionedType",null==t?void 0:t.type,exports.MentionedType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MENTIONED_TYPE).isTypedArray("mentionedUserIdList",null==t?void 0:t.userIdList,St,(null==t?void 0:t.type)===exports.MentionedType.SINGAL).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).isString("mentionedContent",null==t?void 0:t.mentionedContent).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_CONTENT).isFailed&&(i.content.mentionedInfo=t)})).check((e=>{const{quoteInfo:t}=i;t&&e.isObject("quoteInfo",t,!0).isNotEmptyString("quoteInfo.messageUId",t.messageUId,!0).isNotEmptyString("quoteInfo.senderId",t.senderId,!0).isNotEmptyString("quoteInfo.objectName",t.objectName,!0).isNumberEnum("quoteInfo.quoteMessageStatus",t.quoteMessageStatus,be).fail(exports.ErrorCode.INVALID_PARAMETER_QUOTE_INFO)})).result().tryTrans(this.validateConnected).tryTrans((t=>{if(!i.needReceipt)return ir(t);if(t.grpRRVer!==Me.V5)return sr(exports.ErrorCode.READ_RECEIPT_ERROR);const{conversationType:r}=e,{isPersited:s,isStatusMessage:n}=_i(i.messageType);return(r!==exports.ConversationType.GROUP&&r!==exports.ConversationType.PRIVATE||i.isStatusMessage||n||!s||r===exports.ConversationType.GROUP&&i.directionalUserIdList&&i.directionalUserIdList.length>0)&&(i.needReceipt=!1),ir(t)})).tryTrans((t=>{const{conversationType:r}=e,{messageType:s}=i;if(r===exports.ConversationType.SYSTEM&&s!==Q.SYNC_READ_STATUS)return sr(exports.ErrorCode.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE);if(s===Q.STREAM_MESSAGE)return sr(exports.ErrorCode.MESSAGE_NOT_SUPPORT_SENDING);if(s===Q.READ_RECEIPT_RESPONSE&&t.grpRRVer)return sr(exports.ErrorCode.READ_RECEIPT_ERROR);const n=nd(JSON.stringify(i.content));if(n>Ge)return sr(exports.ErrorCode.RC_MSG_CONTENT_EXCEED_LIMIT);const o=[Q.VOICE,Q.IMAGE,Q.LOCATION,Q.REFERENCE,Q.SIGHT,Q.COMBINE,Q.COMBINE_V2,Q.STREAM_MESSAGE],a=t.msgMaxLengthV2||0;return a&&!o.includes(s)&&n>a?sr(exports.ErrorCode.RC_MSG_CONTENT_EXCEED_LIMIT):ir()})).next((()=>r(this,ST,"m",NT).call(this,e,i,s,n)))}))},NT=function(e,t,i,s){const n=r(this,ST,"m",yT).call(this,e),{conversationType:o}=n;return o===exports.ConversationType.ULTRA_GROUP?this._engine.sendUltraMessage(n,t,i,s):this._engine.sendMessage(n,t,i,s)},MT=function(e,r,i){return t(this,void 0,void 0,(function*(){return(yield this._engine.sendMessage(e,{content:r,messageType:Q.EXPANSION_NOTIFY},i)).wipe()}))},bT=function(e){return t(this,void 0,void 0,(function*(){const{startTime:t,endTime:r}=e.timeRange||{},i={startTime:null!=t?t:0,endTime:null!=r?r:Number.MAX_SAFE_INTEGER};e.timeRange=i;const s=this.logger.createTraceId();this.logger.info(n.A_SEARCH_MSGS_BY_PARAMS_T,JSON.stringify(e),s);const o=yield this._engine.searchMessagesWithParams(e);return this.logger.summary(n.A_SEARCH_MSGS_BY_PARAMS_R,o,s,void 0,(({messages:e})=>({size:e.length}))),o}))},LT=function(e,r,i,s){return t(this,void 0,void 0,(function*(){return this._engine.translateWithParams(e.map((e=>e.toInnerParam())),i||hi.MECHANICAL,!!s,r)}))},exports.APIContext=PT,exports.BaseTranslateParam=Ei,exports.BasicLogger=Dr,exports.Codec=Uc,exports.ConversationUnreadCountFilter=Ue,exports.EventEmitter=class{constructor(){Object.defineProperty(this,"_map",{enumerable:!0,configurable:!0,writable:!0,value:{}})}on(e,t,r){const i=this._map[e]||(this._map[e]=[]);i.some((e=>e.listener===t&&e.target===r))||i.push({listener:t,target:r})}once(e,t,r){const i=this._map[e]||(this._map[e]=[]);i.some((e=>e.listener===t&&e.target===r))||i.push({listener:t,target:r,once:!0})}off(e,t,r){let i=this._map[e];i&&(i=i.filter((e=>e.listener!==t||e.target!==r)),i.length?this._map[e]=i:delete this._map[e])}emit(e,...t){const r=this._map[e];if(r)for(let e=0;e<r.length;e+=1){const{target:i,once:s,listener:n}=r[e];s&&(r.splice(e,1),e-=1);try{n.call(i,...t)}catch(e){null===console||void 0===console||console.error(e)}}}removeAll(e){delete this._map[e]}clear(){Object.keys(this._map).forEach(this.removeAll,this)}},exports.FilterRobotType=Oe,exports.GroupReadReceiptVersion=Me,exports.LogDBProxy=Kr,exports.LogTagId=n,exports.MAX_MESSAGE_CONTENT_BYTES=Ge,exports.MAX_U32_INTEGER=it,exports.MAX_UPLOAD_FILE_SIZE=5368709120,exports.MessageAuditType={DISALLOW:0,ALLOW:1},exports.MessageModifyStatus=Cr,exports.MessageReactionOperationType=Le,exports.MessageType=Q,exports.PBCodec=hc,exports.PluginContext=Kc,exports.QuoteMessageStatus=be,exports.RCResult=rr,exports.RTCPluginContext=Qc,exports.ReferenceMessageStatus=yr,exports.SpeechToTextStatus=Ne,exports.SuspendablePromise=tr,exports.TranslateMessageParam=gi,exports.TranslateMode=hi,exports.TranslateStatus=pi,exports.TranslateStrategy=Ti,exports.TranslateTextParam=Ii,exports.UPLOAD_FILE_CHUNK_SIZE=10485760,exports.UUId=at,exports.UserSettingsChangedKey=Or,exports.UserType={NORMAL:0,ROBOT:1},exports.Validator=nr,exports.VersionManage=ot,exports.assert=(e,t,r,i=!1)=>{if(!Zc(e,t,r,i))throw new zc(`'${e}' is invalid: ${JSON.stringify(t)}`)},exports.createLogDBProxy=Qr,exports.fail=sr,exports.fixUrlProtocol=qt,exports.forEach=Lc,exports.getMessageTypeDescription=_i,exports.getUUID=()=>at.gen(),exports.getUUID22=()=>at.genWithLen(22),exports.hasMessageTypeDescription=ui,exports.httpRequest=Sr,exports.isArray=ht,exports.isBoolean=e=>"boolean"==typeof e,exports.isFunction=pt,exports.isHttpUrl=Rt,exports.isInteger=ut,exports.isLimitedString=Et,exports.isNull=e=>"[object Null]"===Object.prototype.toString.call(e),exports.isNumber=_t,exports.isObject=It,exports.isString=dt,exports.isUndefined=Tt,exports.isValidConversationType=e=>_t(e)&&Object.prototype.hasOwnProperty.call(exports.ConversationType,e),exports.isValidEnum=e=>Object.values(e.type).includes(e.value),exports.isValidFileType=e=>_t(e)&&Object.prototype.hasOwnProperty.call(exports.FileType,e),exports.isValidGroupId=vt,exports.isValidTargetId=St,exports.map=(e,t)=>(Lc(e,((r,i)=>{e[i]=t(r,i)})),e),exports.notEmptyArray=e=>ht(e)&&e.length>0,exports.notEmptyObject=ft,exports.notEmptyString=gt,exports.ok=ir,exports.promiseWithResolvers=lr,exports.runtime=io,exports.trans2IReceivedStatusInfo=yt,exports.trans2NotificationLevel=e=>e===exports.NotificationStatus.OPEN?exports.NotificationLevel.AT_MESSAGE_NOTIFICATION:exports.NotificationLevel.NOT_SET,exports.trans2NotificationStatus=pe,exports.transformReceivedStatusFlag=e=>{let t=exports.ReceivedStatus.UNREAD;return(null==e?void 0:e.isRead)&&(t|=exports.ReceivedStatus.READ),(null==e?void 0:e.isListened)&&(t|=exports.ReceivedStatus.LISTENED),(null==e?void 0:e.isDownload)&&(t|=exports.ReceivedStatus.DOWNLOADED),(null==e?void 0:e.isRetrieved)&&(t|=exports.ReceivedStatus.RETRIEVED),t},exports.usingCppEngine=Ct,exports.validate=Zc;