@rongcloud/engine 5.20.0-c-esm-alpha.1 → 5.20.0-c-unikit.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 +1 -1
- package/index.cjs.js +1 -1
- package/index.d.ts +68 -4
- package/index.esm.js +1 -2
- package/index.mjs +1 -2
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -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,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};function t(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var n,r,o,i,s,a,u,c,l,d,p,h,_,f,E,I,T,C,v,R,y,m,S,A,N,O,M,L,U,b,P,w,x,D,V,G,k,F,B,H,q,Y,K,Q,W,j,J,z,Z,X,$,ee,te,ne,re,oe,ie,se=function(){return se=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},se.apply(this,arguments)};function ae(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s}function ue(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))}function ce(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function le(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function de(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}function pe(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function he(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function _e(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n}exports.UploadMethod=void 0,(n=exports.UploadMethod||(exports.UploadMethod={}))[n.QINIU=1]="QINIU",n[n.ALI=2]="ALI",n[n.AWS=3]="AWS",n[n.STC=4]="STC",n[n.MINIO=5]="MINIO",exports.LogTagId=void 0,(r=exports.LogTagId||(exports.LogTagId={})).L_IMSDK_VER_O="L-imsdk_ver-O",r.A_INIT_REPEAT_O="A_INIT_REPEAT_O",r.L_INIT_O="L-init-O",r.A_DESTROY_O="A_DESTROY_O",r.L_DESTROY_O="L_DESTROY_O",r.A_CONNECT_T="A-connect-T",r.A_CONNECT_R="A-connect-R",r.A_CONNECT_S="A-connect-S",r.A_DISCONNECT_O="A-disconnect-O",r.A_RECONNECT_T="A-reconnect-T",r.A_RECONNECT_R="A_RECONNECT_R",r.L_CONNECT_T="L-connect-T",r.L_CONNECT_R="L-connect-R",r.L_CONNECT_S="L-connect-S",r.L_DB_UPGRATE_START_S="L-db_upgrate_start-S",r.L_DB_UPGRATING_S="L-db_upgrating-S",r.L_DB_UPGRATE_COMPLETE_S="L-db_upgrate_complete-S",r.L_NOTIFY_ULTRA_ONLINE_S="L-notify-ultra-online-S",r.L_ULTRA_SYNC_DONE_S="L-ultra-sync-done-S",r.L_BATCH_MESSAGE_O="L-BATCH_MESSAGE-O",r.A_MSG_LISTENER_E="A-MSG_LISTENER-E",r.O="L-original-O",r.T="L-TEST-O",r.L_INSTALL_PLUGIN_T="L-INSTALL_PLUGIN-T",r.L_INSTALL_PLUGIN_R="L-INSTALL_PLUGIN-R",r.L_NAVI_CONF_E="L-NAVI_CONF_ERROR-E",r.L_NAVI_CMP_R="L-NAVI_CPM-R",r.A_SEND_MSG_T="A-send_msg-T",r.A_SEND_MSG_R="A-send_msg-R",r.L_SEND_MSG_T="L-send_msg-T",r.L_SEND_MSG_R="L-send_msg-R",r.L_PULL_MSG_T="L-pull_msg-T",r.L_PULL_MSG_R="L-pull_msg-R",r.L_PULL_MSG_E="L-pull_msg-E",r.L_PULL_MSG_O="L-pull_msg-O",r.L_PULL_ULTRA_MSG_T="L-pull_ultra_msg-T",r.L_PULL_ULTRA_MSG_R="L-pull_ultra_msg-R",r.L_PULL_CHATROOM_KV_T="L-pull_chatroom_kv-T",r.L_PULL_CHATROOM_KV_R="L-pull_chatroom_kv-R",r.L_PULL_CHATROOM_MSG_T="L-pull_chatroom_msg-T",r.L_PULL_CHATROOM_MSG_R="L-pull_chatroom_msg-R",r.L_RECV_MULTI_SYNC_MSG_O="L-recv_multi_sync_msg-O",r.L_RECV_S_MSG_O="L-recv_s_msg-O",r.A_DELETE_MESSAGES_S="A-delete_messages-S",r.P_DELETE_MSG_S="P-delete_msg-S",r.L_PULL_CONVERSATION_S="L-pull_conversation-S",r.A_RECALL_MESSAGE_T="A-recall_msg-T",r.A_RECALL_MESSAGE_R="A-recall_msg-R",r.A_RECALL_MESSAGE_E="A-recall_msg-E",r.A_REGTYP_O="A-regtyp-O",r.P_REGTYP_E="P-regtype-E",r.L_GET_NAVI_T="L-get_navi-T",r.L_GET_NAVI_R="L-get_navi-R",r.L_REQUEST_T="L-request-T",r.L_REQUEST_R="L-request-R",r.L_PARSE_NAVI_E="L-parse_navi-E",r.L_ENV_S="L-Env-S",r.L_GET_INDEX_NAVI_S="L-get_index_navi-S",r.A_JOIN_CHATROOM_T="A-join_chatroom-T",r.A_JOIN_CHATROOM_R="A-join_chatroom-R",r.L_JOIN_CHATROOM_T="L-join_chatroom-T",r.L_JOIN_CHATROOM_R="L-join_chatroom-R",r.A_QUIT_CHATROOM_T="A-quit_chatroom-T",r.A_QUIT_CHATROOM_R="A-quit_chatroom-R",r.L_REJOIN_CHATROOM_T="L-rejoin_chatroom-T",r.L_REJOIN_CHATROOM_R="L-rejoin_chatroom-R",r.L_REJOIN_CHATROOM_S="L-rejoin_chatroom-S",r.L_MEDIA_S="L-media-S",r.L_MEDIA_UPLOAD_T="L-media_upload-T",r.L_MEDIA_UPLOAD_R="L-media_upload-R",r.G_UPLOAD_LOG_S="G-upload_log-S",r.G_REPORT_LOG_S="G-report_log-S",r.G_UPLOAD_LOG_E="G-upload_log-E",r.G_GET_REAL_TIMELOG_COMMAND_S="G-get_real_timelog_command-S",r.L_CHECK_ALIVE_IM_T="L-check_alive_im-T",r.L_CHECK_ALIVE_IM_R="L-check_alive_im-R",r.L_CHECK_ALIVE_IM_S="L-check_alive_im-S",r.A_GET_LOCAL_MESSAGE_T="A-get_local_message-T",r.A_GET_LOCAL_MESSAGE_R="A-get_local_message-R",r.A_GET_HISTORY_MSG_T="A-get_history_msg-T",r.A_GET_HISTORY_MSG_R="A-get_history_msg-R",r.L_GET_HISTORY_MSG_T="L-get_history_msg-T",r.L_GET_HISTORY_MSG_R="L-get_history_msg-R",r.A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E="A-get_privage_message_deliver_time-E",r.A_GET_GROUP_MESSAGE_DELIVER_LIST_E="A-get_group_message_deliver_list-E",r.A_CALLBACK_O="A-callback-O",r.A_CALLBACK_E="A-callback-E",r.L_CALLBACK_E="L-callback-E",r.A_SEND_MESSAGE_READ_RECEIPT_V4_T="A-send_message_read_receipt_V4-T",r.A_SEND_MESSAGE_READ_RECEIPT_V4_R="A-send_message_read_receipt_V4-R",r.A_GET_MESSAGE_READ_RECEIPT_V4_T="A-get_message_read_receipt_V4-T",r.A_GET_MESSAGE_READ_RECEIPT_V4_R="A-get_message_read_receipt_V4-R",r.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_T="A-batch_get_message_read_receipt_info_V4-T",r.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_R="A-batch_get_message_read_receipt_info_V4-R",r.A_SYNC_READ_STATUS_T="A-sync_read_status-T",r.A_SYNC_READ_STATUS_R="A-sync_read_status-R",r.A_GET_TOP_CONVERSATION_LIST_E="A-get_top_conversation_list-E",r.L_PB_ENCODE_E="L-pb-encode-E",r.L_PB_DECODE_E="L-pb-decode-E",r.L_NOTIFY_NAVI_CHANGE_E="L-notify_navi_change-E",r.L_REPORT_FULL_LOG_O="L-report_full_log-O",r.L_REPORT_FULL_LOG_T="L-report_full_log-T",r.L_REPORT_FULL_LOG_R="L-report_full_log-R",r.L_REPORT_LOG_POLICY_E="L-parse_navi_logpolicy-E",r.L_UNSUPPORT_INDEXDB_O="L-unsupport_IndexDB-O",r.L_LOGDB_OPEN_FAILED_E="L-logDB_open_failed-E",r.L_LOGDB_CLOSED_S="L-logDB_closed-S",r.L_LOGDB_ERROR_E="L-logDB_error-S",r.L_LOGDB_ABORT_S="L-logDB_abort-S",r.L_REALTIME_LOG_R="L_REALTIME_LOG_R",r.L_REALTIME_LOG_O="L_REALTIME_LOG_O",r.L_REALTIME_LOG_T="L_REALTIME_LOG_T",r.L_STATISTIC_LOG_R="L_STATISTIC_LOG_R",r.L_STATISTIC_LOG_O="L_STATISTIC_LOG_O",r.L_STATISTIC_LOG_T="L_STATISTIC_LOG_T",r.L_UNKNOWN_TOPIC_E="L_UNKNOWN_TOPIC_E",r.L_RECV_RMTP_O="L_RECV_RMTP_O",r.L_RECV_RMTP_E="L_RECV_RMTP_E",r.L_RECV_S_NTF_O="L-recv_s_ntf_O",r.L_VER_REPORT_T="L-VER_REPORT-T",r.L_VER_REPORT_R="L-VER_REPORT-R",r.L_CALL_MAIN_SYNC_O="L_CALL_MAIN_SYNC_O",r.L_UNSUPPORT_NTF_FROM_MAIN_E="L_UNSUPPORT_NTF_FROM_MAIN_E",r.A_SET_MSG_CONTENT_O="A_SET_MSG_CONTENT_O",r.A_REMOVE_PROXY_O="A-remove_proxy-O",r.A_SET_PROXY_O="A-set_proxy-O",r.A_TEST_PROXY_O="A-test_proxy-O",r.L_WEBSOCKET_DISACCORD_E="L-websocket_disaccord-e",r.A_SEARCH_MESSAGE_BY_USER_T="A-search_messages_by_user-T",r.A_SEARCH_MESSAGE_BY_USER_R="A-search_messages_by_user-R",r.L_GET_STATIC_CONF_T="L-get_static_conf-T",r.L_GET_STATIC_CONF_R="L-get_static_conf-R",r.L_GET_STATIC_CONF_E="L-get_static_conf-E",r.L_CLOUD_DISABLED="L-cloud_disabled",r.L_CLOUD_EXPIRE="L-cloud_expire",r.L_CLOUD_OVERCLOCK="L-cloud_overclock",r.L_CLOUD_APPKEY_REGION_E="L-cloud_appkey_region_error",r.L_CLOUD_CONFIG_DATA_E="L-cloud_config_data_error",r.L_CLOUD_SET_CACHE_O="L-cloud_set_cache-O",r.L_CLOUD_GET_CACHE_O="L-cloud_get_cache-O",r.L_CLOUD_MSG_NTF_O="L-cloud_msg_ntf-O",r.L_CLOUD_SET_AREA_CODE_O="L-cloud_set_area_code-O",r.L_CLOUD_SET_MRTR_O="L-cloud_set_mrtr-O",r.L_SYNC_SUBSCRIBED_USER_STATUS_FINISHED_S="L-sync_subscribed_user_status_finished-S",r.L_PULL_SUBSCRIBED_USER_RELATION_T="L-pull_subscribed_user_relation-T",r.L_PULL_SUBSCRIBED_USER_RELATION_R="L-pull_subscribed_user_relation-R",r.L_PULL_SUBSCRIBED_USER_STATUS_T="L-pull_subscribed_user_status-T",r.L_PULL_SUBSCRIBED_USER_STATUS_R="L-pull_subscribed_user_status-R",r.L_OWN_USER_PROFILE_CHANGED_S="L-own_user_profile_changed-S",r.L_QUERY_SUBSCRIBE_DATA_T="L-query_subscribe_data-T",r.L_QUERY_SUBSCRIBE_DATA_R="L-query_subscribe_data-R",r.L_PULL_USER_PROFILE_T="L-pull_user_profile-T",r.L_PULL_USER_PROFILE_R="L-pull_user_profile-R",r.L_PULL_OWN_PROFILE_T="L-pull_own_profile-T",r.L_PULL_OWN_PROFILE_R="L-pull_own_profile-R",r.L_QUERY_FRIEND_LIST_T="L-query_friend_list-T",r.L_QUERY_FRIEND_LIST_R="L-query_friend_list-R",r.L_PULL_USER_PROFILE_REQ_T="L-pull_user_profile_req-T",r.L_PULL_USER_PROFILE_REQ_R="L-pull_user_profile_req-R",r.L_PULL_EVENT_CHANGE_NOTIFY_ULTRA_ONLINE_S="L-pull_event_change_notify_ultra_online-S",r.L_PULL_EVENT_CHANGE_T="L-pull_event_change-T",r.L_PULL_EVENT_CHANGE_R="L-pull_event_change-R",r.L_PARSE_JSON_E="L-parse_json-E",r.L_REQ_STREAM_MSG_CONTENT_T="L-req_stream_msg_content-T",r.L_REQ_STREAM_MSG_CONTENT_R="L-req_stream_msg_content-R",r.L_REQ_STREAM_MSG_CONTENT_O="L-req_stream_msg_content-O",r.L_REQ_STREAM_MSG_CONTENT_E="L-req_stream_msg_content-E",exports.DirectionType=void 0,(o=exports.DirectionType||(exports.DirectionType={}))[o.BOTH=2]="BOTH",exports.QueryFriendsDirectionType=void 0,(i=exports.QueryFriendsDirectionType||(exports.QueryFriendsDirectionType={}))[i.BOTH=2]="BOTH",exports.FriendAddPermission=void 0,(s=exports.FriendAddPermission||(exports.FriendAddPermission={}))[s.FREE=1]="FREE",s[s.NEED_VERIFY=2]="NEED_VERIFY",s[s.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED",exports.FriendRelationType=void 0,(a=exports.FriendRelationType||(exports.FriendRelationType={}))[a.NONE=0]="NONE",a[a.IN_MY_FRIEND_LIST=1]="IN_MY_FRIEND_LIST",a[a.IN_OTHER_FRIEND_LIST=2]="IN_OTHER_FRIEND_LIST",a[a.BOTH_WAY=3]="BOTH_WAY",exports.FriendApplicationType=void 0,(u=exports.FriendApplicationType||(exports.FriendApplicationType={}))[u.SENT=1]="SENT",u[u.RECEIVED=2]="RECEIVED",exports.FriendApplicationStatus=void 0,(c=exports.FriendApplicationStatus||(exports.FriendApplicationStatus={}))[c.UNHANDLED=0]="UNHANDLED",c[c.ACCEPTED=1]="ACCEPTED",c[c.REFUSED=2]="REFUSED",c[c.EXPIRED=3]="EXPIRED",function(e){e[e.FRIEND_APPLICATION=31]="FRIEND_APPLICATION"}(l||(l={})),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"}(d||(d={})),exports.GroupJoinPermission=void 0,(p=exports.GroupJoinPermission||(exports.GroupJoinPermission={}))[p.OWNER_VERIFY=0]="OWNER_VERIFY",p[p.FREE=1]="FREE",p[p.OWNER_OR_MANAGER_VERIFY=2]="OWNER_OR_MANAGER_VERIFY",p[p.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED",exports.GroupOperationPermission=void 0,(h=exports.GroupOperationPermission||(exports.GroupOperationPermission={}))[h.OWNER=0]="OWNER",h[h.OWNER_OR_MANAGER=1]="OWNER_OR_MANAGER",h[h.EVERYONE=2]="EVERYONE",exports.GroupMemberInfoEditPermission=void 0,(_=exports.GroupMemberInfoEditPermission||(exports.GroupMemberInfoEditPermission={}))[_.OWNER_OR_MANAGER_OR_SELF=0]="OWNER_OR_MANAGER_OR_SELF",_[_.OWNER_OR_SELF=1]="OWNER_OR_SELF",_[_.SELF=2]="SELF",exports.GroupInviteHandlePermission=void 0,(f=exports.GroupInviteHandlePermission||(exports.GroupInviteHandlePermission={}))[f.FREE=0]="FREE",f[f.INVITEE_VERIFY=1]="INVITEE_VERIFY",exports.GroupMemberRole=void 0,(E=exports.GroupMemberRole||(exports.GroupMemberRole={}))[E.UNDEF=0]="UNDEF",E[E.NORMAL=1]="NORMAL",E[E.MANAGER=2]="MANAGER",E[E.OWNER=3]="OWNER",exports.GroupOperation=void 0,(I=exports.GroupOperation||(exports.GroupOperation={}))[I.CREATE=0]="CREATE",I[I.JOIN=1]="JOIN",I[I.KICK=2]="KICK",I[I.QUIT=3]="QUIT",I[I.DISMISS=4]="DISMISS",I[I.ADD_MANAGER=5]="ADD_MANAGER",I[I.REMOVE_MANAGER=6]="REMOVE_MANAGER",I[I.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"}(T||(T={})),exports.GroupOperationType=void 0,(C=exports.GroupOperationType||(exports.GroupOperationType={}))[C.ADD=1]="ADD",C[C.REMOVE=2]="REMOVE",exports.GroupApplicationStatus=void 0,(v=exports.GroupApplicationStatus||(exports.GroupApplicationStatus={}))[v.MANAGER_UNHANDLED=0]="MANAGER_UNHANDLED",v[v.MANAGER_REFUSED=1]="MANAGER_REFUSED",v[v.INVITEE_UNHANDLED=2]="INVITEE_UNHANDLED",v[v.INVITEE_REFUSED=3]="INVITEE_REFUSED",v[v.JOINED=4]="JOINED",v[v.EXPIRED=5]="EXPIRED",exports.GroupOperationStatus=void 0,(R=exports.GroupOperationStatus||(exports.GroupOperationStatus={}))[R.REFUSE=0]="REFUSE",R[R.ACCEPT=1]="ACCEPT",exports.GroupOperationRole=void 0,(y=exports.GroupOperationRole||(exports.GroupOperationRole={}))[y.APPLICANT=0]="APPLICANT",y[y.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"}(m||(m={})),exports.GroupApplicationType=void 0,(S=exports.GroupApplicationType||(exports.GroupApplicationType={}))[S.APPLICATION=0]="APPLICATION",S[S.INVITATION=1]="INVITATION",exports.GroupApplicationDirection=void 0,(A=exports.GroupApplicationDirection||(exports.GroupApplicationDirection={}))[A.APPLICATION_SENT=0]="APPLICATION_SENT",A[A.INVITATION_SENT=1]="INVITATION_SENT",A[A.INVITATION_RECEIVED=2]="INVITATION_RECEIVED",A[A.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,(O=exports.ChrmSyncStatus||(exports.ChrmSyncStatus={}))[O.QUIT=0]="QUIT",O[O.JOIN=1]="JOIN",exports.ChatroomSyncStatusReason=void 0,(M=exports.ChatroomSyncStatusReason||(exports.ChatroomSyncStatusReason={}))[M.LeaveOnMyOwn=0]="LeaveOnMyOwn",M[M.OtherDeviceLogin=1]="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,(b=exports.ChrmMemOperateType||(exports.ChrmMemOperateType={}))[b.Deblock=0]="Deblock",b[b.Blocked=1]="Blocked",exports.ErrorCode=void 0,(P=exports.ErrorCode||(exports.ErrorCode={}))[P.SUCCESS=0]="SUCCESS",P[P.ACTIVE_DISCONNECT=2]="ACTIVE_DISCONNECT",P[P.REJECTED_BY_BLACKLIST=405]="REJECTED_BY_BLACKLIST",P[P.FORBIDDEN_IN_PRIVATE=20106]="FORBIDDEN_IN_PRIVATE",P[P.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE=20109]="SYS_CONVERSATION_NOT_SUPPORT_MESSAGE",P[P.CLOUD_DATA_CENTER_INVALID=20512]="CLOUD_DATA_CENTER_INVALID",P[P.SEND_FREQUENCY_TOO_FAST=20604]="SEND_FREQUENCY_TOO_FAST",P[P.OPERATION_BLOCKED=20605]="OPERATION_BLOCKED",P[P.OPERATION_NOT_SUPPORT=20606]="OPERATION_NOT_SUPPORT",P[P.REQUEST_OVER_FREQUENCY=20607]="REQUEST_OVER_FREQUENCY",P[P.NOT_IN_DISCUSSION=21406]="NOT_IN_DISCUSSION",P[P.SENSITIVE_SHIELD=21501]="SENSITIVE_SHIELD",P[P.SENSITIVE_REPLACE=21502]="SENSITIVE_REPLACE",P[P.MESSAGE_EXPAND_NOT_EXIST=22201]="MESSAGE_EXPAND_NOT_EXIST",P[P.MESSAGE_EXPAND_NOT_SUPPORT=22202]="MESSAGE_EXPAND_NOT_SUPPORT",P[P.MESSAGE_EXPAND_FORMAT_ERROR=22203]="MESSAGE_EXPAND_FORMAT_ERROR",P[P.MESSAGE_EXPAND_NOT_AUTHORIZED=22204]="MESSAGE_EXPAND_NOT_AUTHORIZED",P[P.NOT_IN_GROUP=22406]="NOT_IN_GROUP",P[P.FORBIDDEN_IN_GROUP=22408]="FORBIDDEN_IN_GROUP",P[P.NOT_IN_CHATROOM=23406]="NOT_IN_CHATROOM",P[P.GET_USERINFO_ERROR=23407]="GET_USERINFO_ERROR",P[P.FORBIDDEN_IN_CHATROOM=23408]="FORBIDDEN_IN_CHATROOM",P[P.RC_CHATROOM_USER_KICKED=23409]="RC_CHATROOM_USER_KICKED",P[P.RC_CHATROOM_NOT_EXIST=23410]="RC_CHATROOM_NOT_EXIST",P[P.RC_CHATROOM_IS_FULL=23411]="RC_CHATROOM_IS_FULL",P[P.RC_CHATROOM_PATAMETER_INVALID=23412]="RC_CHATROOM_PATAMETER_INVALID",P[P.CHATROOM_GET_HISTORYMSG_ERROR=23413]="CHATROOM_GET_HISTORYMSG_ERROR",P[P.CHATROOM_NOT_OPEN_HISTORYMSG_STORE=23414]="CHATROOM_NOT_OPEN_HISTORYMSG_STORE",P[P.CHATROOM_KV_EXCEED=23423]="CHATROOM_KV_EXCEED",P[P.CHATROOM_KV_OVERWRITE_INVALID=23424]="CHATROOM_KV_OVERWRITE_INVALID",P[P.CHATROOM_SET_PROPERTY_OVER_FREQUENCY=23425]="CHATROOM_SET_PROPERTY_OVER_FREQUENCY",P[P.CHATROOM_KV_STORE_NOT_OPEN=23426]="CHATROOM_KV_STORE_NOT_OPEN",P[P.CHATROOM_KEY_NOT_EXIST=23427]="CHATROOM_KEY_NOT_EXIST",P[P.CHATROOM_KV_STORE_NOT_ALL_SUCCESS=23428]="CHATROOM_KV_STORE_NOT_ALL_SUCCESS",P[P.CHATROOM_KV_STORE_OUT_LIMIT=23429]="CHATROOM_KV_STORE_OUT_LIMIT",P[P.CHATROOM_KV_SET_ERROR=23431]="CHATROOM_KV_SET_ERROR",P[P.HAVNODEVICEID=24001]="HAVNODEVICEID",P[P.DEVICEIDISHAVE=24002]="DEVICEIDISHAVE",P[P.FEILD=24009]="FEILD",P[P.INTERNALERRROR=24015]="INTERNALERRROR",P[P.RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET=24360]="RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET",P[P.RC_USER_PROFILE_KEY_NOT_EXIST=24361]="RC_USER_PROFILE_KEY_NOT_EXIST",P[P.RC_USER_PROFILE_EXT_KEY_NOT_EXIST=24362]="RC_USER_PROFILE_EXT_KEY_NOT_EXIST",P[P.RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT=24363]="RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT",P[P.RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT=24364]="RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT",P[P.RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT=24365]="RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT",P[P.RC_USER_PROFILE_USER_NOT_EXIST=24366]="RC_USER_PROFILE_USER_NOT_EXIST",P[P.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS=24367]="RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS",P[P.RC_USER_PROFILE_VALUE_EXCEED_RANGE=24368]="RC_USER_PROFILE_VALUE_EXCEED_RANGE",P[P.RC_USER_PROFILE_SERVICE_UNAVAILABLE=24369]="RC_USER_PROFILE_SERVICE_UNAVAILABLE",P[P.ULTRA_GROUP_SERVICE_UNAVAILABLE=24401]="ULTRA_GROUP_SERVICE_UNAVAILABLE",P[P.ULTRA_GROUP_SERVICE_ERROR=24402]="ULTRA_GROUP_SERVICE_ERROR",P[P.ULTRA_GROUP_PARAMETER_ERROR=24403]="ULTRA_GROUP_PARAMETER_ERROR",P[P.ULTRA_GROUP_UNKNOWN_ERROR=24404]="ULTRA_GROUP_UNKNOWN_ERROR",P[P.NOT_IN_ULTRA_GROUP=24406]="NOT_IN_ULTRA_GROUP",P[P.FORBIDDEN_IN_ULTRA_GROUP=24408]="FORBIDDEN_IN_ULTRA_GROUP",P[P.ULTRA_GROUP_NOT_EXIST=24410]="ULTRA_GROUP_NOT_EXIST",P[P.ULTRA_GROUP_MEMBERS_OVERSIZE=24411]="ULTRA_GROUP_MEMBERS_OVERSIZE",P[P.ULTRA_GROUP_JOINED_OVERSIZE=24412]="ULTRA_GROUP_JOINED_OVERSIZE",P[P.ULTRA_GROUP_CHANNELS_OVERSIZE=24413]="ULTRA_GROUP_CHANNELS_OVERSIZE",P[P.ULTRA_GROUP_CHANNEL_ID_NOT_EXIST=24414]="ULTRA_GROUP_CHANNEL_ID_NOT_EXIST",P[P.ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY=24415]="ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY",P[P.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL=24416]="ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL",P[P.RECALL_MESSAGE=25101]="RECALL_MESSAGE",P[P.MESSAGE_STORAGE_SERVICE_UNAVAILABLE=25102]="MESSAGE_STORAGE_SERVICE_UNAVAILABLE",P[P.RC_SERVER_UNKOWN_ERROR=25104]="RC_SERVER_UNKOWN_ERROR",P[P.RECALL_MESSAGE_USER_INVALID=25107]="RECALL_MESSAGE_USER_INVALID",P[P.RC_ENTRUST_SERVER_ERROR=25402]="RC_ENTRUST_SERVER_ERROR",P[P.RC_ENTRUST_SERVER_PARAMETER_ERROR=25403]="RC_ENTRUST_SERVER_PARAMETER_ERROR",P[P.RC_GROUP_ILLEGAL_ERROR=25404]="RC_GROUP_ILLEGAL_ERROR",P[P.RC_GROUP_AUTHORITY_ERROR=25405]="RC_GROUP_AUTHORITY_ERROR",P[P.RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT=25406]="RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT",P[P.RC_GROUP_PARAMETER_FORMAT_ERROR=25407]="RC_GROUP_PARAMETER_FORMAT_ERROR",P[P.RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS=25408]="RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS",P[P.RC_GROUP_ID_ALREADY_EXIST=25409]="RC_GROUP_ID_ALREADY_EXIST",P[P.RC_GROUP_ID_NOT_EXIST=25410]="RC_GROUP_ID_NOT_EXIST",P[P.RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT=25411]="RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT",P[P.RC_GROUP_MEMBERS_ALREADY_IN_GROUP=25412]="RC_GROUP_MEMBERS_ALREADY_IN_GROUP",P[P.RC_GROUP_NOT_ALLOW_SDK_OPERATION=25413]="RC_GROUP_NOT_ALLOW_SDK_OPERATION",P[P.RC_GROUP_NOT_ALLOW_JOIN=25414]="RC_GROUP_NOT_ALLOW_JOIN",P[P.RC_GROUP_EXT_KEY_NOT_EXIST=25415]="RC_GROUP_EXT_KEY_NOT_EXIST",P[P.RC_GROUP_REQUEST_OVERFREQUENCY=25416]="RC_GROUP_REQUEST_OVERFREQUENCY",P[P.RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK=25417]="RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK",P[P.RC_GROUP_USER_NOT_IN_GROUP=25418]="RC_GROUP_USER_NOT_IN_GROUP",P[P.RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT=25419]="RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT",P[P.RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP=25420]="RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP",P[P.RC_GROUP_APPLICATION_NOT_EXIST=25421]="RC_GROUP_APPLICATION_NOT_EXIST",P[P.RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT=25422]="RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT",P[P.RC_GROUP_NAME_INVALID=25423]="RC_GROUP_NAME_INVALID",P[P.RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT=25424]="RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT",P[P.RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER=25425]="RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER",P[P.RC_GROUP_NO_INVITE_PERMISSION=25426]="RC_GROUP_NO_INVITE_PERMISSION",P[P.RC_GROUP_NEED_INVITEE_ACCEPT=25427]="RC_GROUP_NEED_INVITEE_ACCEPT",P[P.RC_GROUP_APPLICATION_ALREADY_HANDLE=25428]="RC_GROUP_APPLICATION_ALREADY_HANDLE",P[P.RC_GROUP_OLD_GROUP_NOT_ENTRUST=25429]="RC_GROUP_OLD_GROUP_NOT_ENTRUST",P[P.RC_GROUP_ID_INVALID=25430]="RC_GROUP_ID_INVALID",P[P.RC_PAGE_TOKEN_PARSING_FAILED=25432]="RC_PAGE_TOKEN_PARSING_FAILED",P[P.RC_FRIEND_ALREADY_FRIEND=25460]="RC_FRIEND_ALREADY_FRIEND",P[P.RC_FRIEND_NEED_ACCEPT=25461]="RC_FRIEND_NEED_ACCEPT",P[P.RC_FRIEND_IN_OTHER_BLACK_LIST=25462]="RC_FRIEND_IN_OTHER_BLACK_LIST",P[P.RC_FRIEND_NOT_IN_OTHER_WHITE_LIST=25463]="RC_FRIEND_NOT_IN_OTHER_WHITE_LIST",P[P.RC_FRIEND_IN_MY_BLACK_LIST=25464]="RC_FRIEND_IN_MY_BLACK_LIST",P[P.RC_FRIEND_NOT_IN_MY_WHITE_LIST=25465]="RC_FRIEND_NOT_IN_MY_WHITE_LIST",P[P.RC_FRIEND_APPLICATION_NOT_EXIST=25466]="RC_FRIEND_APPLICATION_NOT_EXIST",P[P.RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT=25467]="RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT",P[P.RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT=25468]="RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT",P[P.RC_FRIEND_NOT_FRIEND=25469]="RC_FRIEND_NOT_FRIEND",P[P.RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT=25470]="RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT",P[P.RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND=25471]="RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND",P[P.RC_FRIEND_NOT_EXIST=25472]="RC_FRIEND_NOT_EXIST",P[P.RC_FRIEND_NOT_ALLOW_ADD_SELF=25473]="RC_FRIEND_NOT_ALLOW_ADD_SELF",P[P.SERVICE_INFORMATION_AUDIT_FAILED=25480]="SERVICE_INFORMATION_AUDIT_FAILED",P[P.PUSH_PARAMETER_INVALID=26001]="PUSH_PARAMETER_INVALID",P[P.USER_SETTING_SYNCED_ERROR=26002]="USER_SETTING_SYNCED_ERROR",P[P.CONVERSATION_TAG_OVERSIZE=26004]="CONVERSATION_TAG_OVERSIZE",P[P.RC_READ_RECEIPT_V4_INVALID=26005]="RC_READ_RECEIPT_V4_INVALID",P[P.RC_SERVER_DRIVE_UNREAD_COUNT_INVALID=26006]="RC_SERVER_DRIVE_UNREAD_COUNT_INVALID",P[P.RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED=26007]="RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED",P[P.RC_SERVER_PARAMETER_MESSAGEUID_INVALID=26009]="RC_SERVER_PARAMETER_MESSAGEUID_INVALID",P[P.RC_SERVER_PARAMETER_INVALID=26010]="RC_SERVER_PARAMETER_INVALID",P[P.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE=26020]="RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE",P[P.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT=26021]="RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT",P[P.RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT=26022]="RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT",P[P.RC_FILE_SIZE_EXCEED_LIMIT=26106]="RC_FILE_SIZE_EXCEED_LIMIT",P[P.INVALID_PARAMETER_SIZE_NOT_FOUND=26107]="INVALID_PARAMETER_SIZE_NOT_FOUND",P[P.RC_NET_CHANNEL_INVALID=30001]="RC_NET_CHANNEL_INVALID",P[P.RC_NET_UNAVAILABLE=30002]="RC_NET_UNAVAILABLE",P[P.RC_MSG_RESP_TIMEOUT=30003]="RC_MSG_RESP_TIMEOUT",P[P.RC_HTTP_SEND_FAIL=30004]="RC_HTTP_SEND_FAIL",P[P.RC_HTTP_REQ_FAIL=30005]="RC_HTTP_REQ_FAIL",P[P.RC_HTTP_RECV_FAIL=30006]="RC_HTTP_RECV_FAIL",P[P.RC_NAVI_REQ_FAILED=30007]="RC_NAVI_REQ_FAILED",P[P.RC_NODE_NOT_FOUND=30008]="RC_NODE_NOT_FOUND",P[P.RC_DOMAIN_NOT_RESOLVE=30009]="RC_DOMAIN_NOT_RESOLVE",P[P.RC_SOCKET_NOT_CREATED=30010]="RC_SOCKET_NOT_CREATED",P[P.RC_SOCKET_DISCONNECTED=30011]="RC_SOCKET_DISCONNECTED",P[P.RC_PING_EXCEED_LIMIT=30012]="RC_PING_EXCEED_LIMIT",P[P.PONG_RECEIVED_ERROR=30013]="PONG_RECEIVED_ERROR",P[P.RC_MSG_SEND_FAIL=30014]="RC_MSG_SEND_FAIL",P[P.CONNECT_OVER_FREQUENCY=30015]="CONNECT_OVER_FREQUENCY",P[P.RC_MSG_CONTENT_EXCEED_LIMIT=30016]="RC_MSG_CONTENT_EXCEED_LIMIT",P[P.MESSAGE_NOT_SUPPORT_SENDING=30017]="MESSAGE_NOT_SUPPORT_SENDING",P[P.RC_NETWORK_DOWN=30019]="RC_NETWORK_DOWN",P[P.RC_TCP_DISCONNECTED_NO_RMTP=30021]="RC_TCP_DISCONNECTED_NO_RMTP",P[P.RC_CONN_ACK_TIMEOUT=31e3]="RC_CONN_ACK_TIMEOUT",P[P.RC_CONN_PROTO_VERSION_ERROR=31001]="RC_CONN_PROTO_VERSION_ERROR",P[P.RC_CONN_IDENTIFIER_REJECTED=31002]="RC_CONN_IDENTIFIER_REJECTED",P[P.RC_CONN_SERVER_UNAVAILABLE=31003]="RC_CONN_SERVER_UNAVAILABLE",P[P.RC_CONN_TOKEN_INCORRECT=31004]="RC_CONN_TOKEN_INCORRECT",P[P.RC_CONN_NOT_AUTHRORIZED=31005]="RC_CONN_NOT_AUTHRORIZED",P[P.RC_CONN_REDIRECTED=31006]="RC_CONN_REDIRECTED",P[P.RC_CONN_PACKAGE_NAME_INVALID=31007]="RC_CONN_PACKAGE_NAME_INVALID",P[P.RC_CONN_APP_BLOCKED_OR_DELETED=31008]="RC_CONN_APP_BLOCKED_OR_DELETED",P[P.RC_CONN_USER_BLOCKED=31009]="RC_CONN_USER_BLOCKED",P[P.RC_DISCONN_KICK=31010]="RC_DISCONN_KICK",P[P.RC_DISCONN_EXCEPTION=31011]="RC_DISCONN_EXCEPTION",P[P.CONNECTION_ENCRYPT_AUTHORIZED_ERROR=31012]="CONNECTION_ENCRYPT_AUTHORIZED_ERROR",P[P.RC_CONN_TOKEN_EXPIRED=31020]="RC_CONN_TOKEN_EXPIRED",P[P.RC_CONN_DEVICE_ERROR=31021]="RC_CONN_DEVICE_ERROR",P[P.RC_CONN_HOSTNAME_ERROR=31022]="RC_CONN_HOSTNAME_ERROR",P[P.RC_DISCONN_SAME_CLIENT_ON_LINE=31023]="RC_DISCONN_SAME_CLIENT_ON_LINE",P[P.RC_LISCENSE_COUNT_OUT_OF_LIMIT=31024]="RC_LISCENSE_COUNT_OUT_OF_LIMIT",P[P.RC_CONN_WRONG_CLUSTER=31025]="RC_CONN_WRONG_CLUSTER",P[P.RC_APP_AUTH_NOT_PASS=31026]="RC_APP_AUTH_NOT_PASS",P[P.RC_OTP_USED=31027]="RC_OTP_USED",P[P.RC_PLATFORM_ERROR=31028]="RC_PLATFORM_ERROR",P[P.RC_ACCOUNT_CANCELLATION=31029]="RC_ACCOUNT_CANCELLATION",P[P.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",P[P.RC_QUERY_ACK_NO_DATA=32001]="RC_QUERY_ACK_NO_DATA",P[P.RC_MSG_DATA_INCOMPLETE=32002]="RC_MSG_DATA_INCOMPLETE",P[P.RC_UDP_DISCONNECTED=32011]="RC_UDP_DISCONNECTED",P[P.RC_TCP_RESET=32054]="RC_TCP_RESET",P[P.CONNECTION_REFUSED=32061]="CONNECTION_REFUSED",P[P.PROTOCOL_MESSAGE_SAVED_ERROR=33e3]="PROTOCOL_MESSAGE_SAVED_ERROR",P[P.BIZ_ERROR_CLIENT_NOT_INIT=33001]="BIZ_ERROR_CLIENT_NOT_INIT",P[P.BIZ_ERROR_DATABASE_ERROR=33002]="BIZ_ERROR_DATABASE_ERROR",P[P.BIZ_ERROR_INVALID_PARAMETER=33003]="BIZ_ERROR_INVALID_PARAMETER",P[P.BIZ_ERROR_NO_CHANNEL=33004]="BIZ_ERROR_NO_CHANNEL",P[P.BIZ_ERROR_RECONNECT_SUCCESS=33005]="BIZ_ERROR_RECONNECT_SUCCESS",P[P.BIZ_ERROR_CONNECTING=33006]="BIZ_ERROR_CONNECTING",P[P.MSG_ROAMING_SERVICE_UNAVAILABLE=33007]="MSG_ROAMING_SERVICE_UNAVAILABLE",P[P.MSG_INSERT_ERROR=33008]="MSG_INSERT_ERROR",P[P.MSG_DEL_ERROR=33009]="MSG_DEL_ERROR",P[P.TAG_NOT_EXIST=33100]="TAG_NOT_EXIST",P[P.TAG_EXISTS=33101]="TAG_EXISTS",P[P.NO_TAG_IN_CONVER=33102]="NO_TAG_IN_CONVER",P[P.RC_CONNECTION_EXIST=34001]="RC_CONNECTION_EXIST",P[P.PACKAGE_ENVIRONMENT_ERROR=34005]="PACKAGE_ENVIRONMENT_ERROR",P[P.CONNECTION_TIMEOUT=34006]="CONNECTION_TIMEOUT",P[P.MESSAGE_KV_NOT_SUPPORT=34008]="MESSAGE_KV_NOT_SUPPORT",P[P.MESSAGE_EXPANDED_ERROR=34009]="MESSAGE_EXPANDED_ERROR",P[P.EXPANSION_LIMIT_EXCEET=34010]="EXPANSION_LIMIT_EXCEET",P[P.UPLOAD_FAIL=34011]="UPLOAD_FAIL",P[P.CONVER_OUT_LIMIT_ERROR=34013]="CONVER_OUT_LIMIT_ERROR",P[P.READ_RECEIPT_ERROR=34014]="READ_RECEIPT_ERROR",P[P.PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE=34016]="PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE",P[P.MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE=34017]="MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE",P[P.MEDIA_EXCEPTION=34018]="MEDIA_EXCEPTION",P[P.MESSAGE_NOT_REGISTERED=34021]="MESSAGE_NOT_REGISTERED",P[P.METHOD_NOT_SUPPORT=34022]="METHOD_NOT_SUPPORT",P[P.ULTRA_GROUP_CHANNEL_NOT_EXIST=34024]="ULTRA_GROUP_CHANNEL_NOT_EXIST",P[P.INCONSISTENT_CONVERSATION_TYPE=34025]="INCONSISTENT_CONVERSATION_TYPE",P[P.CONVERSATION_TYPE_NOT_SUPPORT=34201]="CONVERSATION_TYPE_NOT_SUPPORT",P[P.INVALID_PARAMETER_TIMESTAMP=34202]="INVALID_PARAMETER_TIMESTAMP",P[P.INVALID_PARAMETER_MESSAGE_UID=34203]="INVALID_PARAMETER_MESSAGE_UID",P[P.INVALID_PARAMETER_MESSAGE_ID=34204]="INVALID_PARAMETER_MESSAGE_ID",P[P.INVALID_PARAMETER_MESSAGE_CONTENT=34205]="INVALID_PARAMETER_MESSAGE_CONTENT",P[P.MSG_LIMIT_ERROR=34206]="MSG_LIMIT_ERROR",P[P.INVALID_PARAMETER_MEDIA_TYPE=34207]="INVALID_PARAMETER_MEDIA_TYPE",P[P.INVALID_PARAMETER_CONVERSATION_TYPE=34209]="INVALID_PARAMETER_CONVERSATION_TYPE",P[P.INVALID_PARAMETER_TARGET_ID=34210]="INVALID_PARAMETER_TARGET_ID",P[P.INVALID_PARAMETER_CHANNEL_ID=34211]="INVALID_PARAMETER_CHANNEL_ID",P[P.INVALID_PARAMETER_TAG_ID=34212]="INVALID_PARAMETER_TAG_ID",P[P.INVALID_PARAMETER_TAG_NAME=34213]="INVALID_PARAMETER_TAG_NAME",P[P.INVALID_PARAMETER_USER_ID=34214]="INVALID_PARAMETER_USER_ID",P[P.INVALID_PARAMETER_USERIDLIST=34215]="INVALID_PARAMETER_USERIDLIST",P[P.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME=34217]="INVALID_PARAMETER_DOWNLOADMEDIAFILENAME",P[P.INVALID_PARAMETER_MESSAGE_EXPANSION=34220]="INVALID_PARAMETER_MESSAGE_EXPANSION",P[P.INVALID_PARAMETER_TIMESTRING=34224]="INVALID_PARAMETER_TIMESTRING",P[P.INVALID_PARAMETER_CONVERSATION=34225]="INVALID_PARAMETER_CONVERSATION",P[P.INVALID_PARAMETER_NOTIFICATION_LEVEL=34228]="INVALID_PARAMETER_NOTIFICATION_LEVEL",P[P.INVALID_PARAMETER_MESSAGE_ARRAY=34229]="INVALID_PARAMETER_MESSAGE_ARRAY",P[P.INVALID_PARAMETER_RECEIVED_STATUS=34230]="INVALID_PARAMETER_RECEIVED_STATUS",P[P.INVALID_PARAMETER_CHANNEL_TYPE=34231]="INVALID_PARAMETER_CHANNEL_TYPE",P[P.INVALID_PARAMETER_COUNT=34232]="INVALID_PARAMETER_COUNT",P[P.INVALID_PARAMETER_MEDIA_URL=34235]="INVALID_PARAMETER_MEDIA_URL",P[P.INVALID_PARAMETER_UNIQUE_ID=34236]="INVALID_PARAMETER_UNIQUE_ID",P[P.INVALID_PARAMETER_PROXY=34238]="INVALID_PARAMETER_PROXY",P[P.INVALID_PARAMETER_TESTHOST=34239]="INVALID_PARAMETER_TESTHOST",P[P.INVALID_CONNECT_TESTHOST_FAILED=34240]="INVALID_CONNECT_TESTHOST_FAILED",P[P.INVALID_PARAMETER_CONVERSATIONS=34242]="INVALID_PARAMETER_CONVERSATIONS",P[P.INVALID_PARAMETER_SENT_STATUS=34244]="INVALID_PARAMETER_SENT_STATUS",P[P.RC_CONN_PROXY_UNAVAILABLE=34245]="RC_CONN_PROXY_UNAVAILABLE",P[P.INVALID_PARAMETER_RTCROOMID=34259]="INVALID_PARAMETER_RTCROOMID",P[P.INVALID_PARAMETER_KEY=34260]="INVALID_PARAMETER_KEY",P[P.INVALID_PARAMETER_KEYS=34261]="INVALID_PARAMETER_KEYS",P[P.INVALID_PARAMETER_VALUE=34262]="INVALID_PARAMETER_VALUE",P[P.INVALID_PARAMETER_ENTRIES=34263]="INVALID_PARAMETER_ENTRIES",P[P.INVALID_PARAMETER_NOTIFICATION_EXTRA=34264]="INVALID_PARAMETER_NOTIFICATION_EXTRA",P[P.INVALID_PARAMETER_MESSAGE_OBJECT_NAME=34271]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME",P[P.INVALID_PARAMETER_BEFORE=34272]="INVALID_PARAMETER_BEFORE",P[P.INVALID_PARAMETER_AFTER=34273]="INVALID_PARAMETER_AFTER",P[P.INVALID_PARAMETER_KEYWORD=34274]="INVALID_PARAMETER_KEYWORD",P[P.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST=34275]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST",P[P.INVALID_PARAMETER_OFFSET=34276]="INVALID_PARAMETER_OFFSET",P[P.INVALID_PARAMETER_START_TIME=34277]="INVALID_PARAMETER_START_TIME",P[P.INVALID_PARAMETER_END_TIME=34278]="INVALID_PARAMETER_END_TIME",P[P.INVALID_PARAMETER_LIMIT=34279]="INVALID_PARAMETER_LIMIT",P[P.INVALID_MESSAGE_DIRECTION=34280]="INVALID_MESSAGE_DIRECTION",P[P.INVALID_MESSAGE_SENT_STATUS=34281]="INVALID_MESSAGE_SENT_STATUS",P[P.INVALID_PARAMETER_TARGETID_LIST=34282]="INVALID_PARAMETER_TARGETID_LIST",P[P.INVALID_PARAMETER_SPAN_MINUTES=34283]="INVALID_PARAMETER_SPAN_MINUTES",P[P.INVALID_PARAMETER_CONVERSATION_TYPE_LIST=34284]="INVALID_PARAMETER_CONVERSATION_TYPE_LIST",P[P.INVALID_PARAMETER_CONVERSATION_LIST=34287]="INVALID_PARAMETER_CONVERSATION_LIST",P[P.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST=34288]="INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST",P[P.INVALID_PARAMETER_START_MESSAGE_UID=34289]="INVALID_PARAMETER_START_MESSAGE_UID",P[P.INVALID_PARAMETER_END_MESSAGE_UID=34290]="INVALID_PARAMETER_END_MESSAGE_UID",P[P.READ_RECEIPT_V4_NOT_SUPPORT=34291]="READ_RECEIPT_V4_NOT_SUPPORT",P[P.READ_RECEIPT_V4_UPDATE_NOT_SUPPORT=34292]="READ_RECEIPT_V4_UPDATE_NOT_SUPPORT",P[P.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE=34296]="RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE",P[P.RC_DB_NOT_INIT=34301]="RC_DB_NOT_INIT",P[P.RC_DB_CORRUPT=34302]="RC_DB_CORRUPT",P[P.RC_DB_SQL_ERROR=34303]="RC_DB_SQL_ERROR",P[P.RC_DB_DATA_NOT_FOUND=34304]="RC_DB_DATA_NOT_FOUND",P[P.RC_NET_DATA_ERROR=34305]="RC_NET_DATA_ERROR",P[P.INVALID_PARAMETER_SUBSCRIBE_TYPE=34306]="INVALID_PARAMETER_SUBSCRIBE_TYPE",P[P.INVALID_PARAMETER_SUBSCRIBE_EXPIRY=34307]="INVALID_PARAMETER_SUBSCRIBE_EXPIRY",P[P.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS=34308]="INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS",P[P.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE=34309]="INVALID_PARAMETER_SUBSCRIBE_PAGESIZE",P[P.SUB_PROCESS_EXIT=34310]="SUB_PROCESS_EXIT",P[P.ADDON_NOT_EXIST=34311]="ADDON_NOT_EXIST",P[P.INVALID_PARAMETER_USER_PROFILE=34312]="INVALID_PARAMETER_USER_PROFILE",P[P.INVALID_PARAMETER_USER_PROFILE_VISIBILITY=34313]="INVALID_PARAMETER_USER_PROFILE_VISIBILITY",P[P.INVALID_PARAMETER_EXTRA=34314]="INVALID_PARAMETER_EXTRA",P[P.DB_UPGRADE_FAILED=34315]="DB_UPGRADE_FAILED",P[P.INVALID_PARAMETER_GROUP_INFO=34318]="INVALID_PARAMETER_GROUP_INFO",P[P.INVALID_PARAMETER_GROUP_ID=34319]="INVALID_PARAMETER_GROUP_ID",P[P.INVALID_PARAMETER_GROUP_NAME=34320]="INVALID_PARAMETER_GROUP_NAME",P[P.INVALID_PARAMETER_GROUP_IDS=34321]="INVALID_PARAMETER_GROUP_IDS",P[P.INVALID_PARAMETER_GROUP_MEMBER_ROLE=34322]="INVALID_PARAMETER_GROUP_MEMBER_ROLE",P[P.INVALID_PARAMETER_GROUP_APPLICATION_STATUS=34323]="INVALID_PARAMETER_GROUP_APPLICATION_STATUS",P[P.INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION=34324]="INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION",P[P.INVALID_PARAMETER_NICK_NAME=34325]="INVALID_PARAMETER_NICK_NAME",P[P.INVALID_PARAMETER_REASON=34326]="INVALID_PARAMETER_REASON",P[P.INVALID_PARAMETER_REMARK=34327]="INVALID_PARAMETER_REMARK",P[P.INVALID_PARAMETER_PAGING_QUERY_OPTION=34328]="INVALID_PARAMETER_PAGING_QUERY_OPTION",P[P.NET_DATA_IS_SYNCHRONIZING=34329]="NET_DATA_IS_SYNCHRONIZING",P[P.INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE=34330]="INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE",P[P.INVALID_PARAMETER_DIRECTION_TYPE=34331]="INVALID_PARAMETER_DIRECTION_TYPE",P[P.INVALID_PARAMETER_FRIEND_APPLICATION_TYPE=34332]="INVALID_PARAMETER_FRIEND_APPLICATION_TYPE",P[P.INVALID_PARAMETER_FRIEND_APPLICATION_STATUS=34333]="INVALID_PARAMETER_FRIEND_APPLICATION_STATUS",P[P.INVALID_PARAMETER_FRIEND_ADD_PERMISSION=34334]="INVALID_PARAMETER_FRIEND_ADD_PERMISSION",P[P.INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS=34335]="INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS",P[P.RC_REAL_TIME_CONVERSATION_UNAVAILABLE=34336]="RC_REAL_TIME_CONVERSATION_UNAVAILABLE",P[P.GROUP_SYNC_ERROR=35001]="GROUP_SYNC_ERROR",P[P.GROUP_MATCH_ERROR=35002]="GROUP_MATCH_ERROR",P[P.NOT_SUPPORT=35004]="NOT_SUPPORT",P[P.MAIN_PROCESS_ERROR=35005]="MAIN_PROCESS_ERROR",P[P.CAN_NOT_RECONNECT=35007]="CAN_NOT_RECONNECT",P[P.SERVER_UNAVAILABLE=35008]="SERVER_UNAVAILABLE",P[P.HOSTNAME_ERROR=35009]="HOSTNAME_ERROR",P[P.HAS_OHTER_SAME_CLIENT_ON_LINE=35010]="HAS_OHTER_SAME_CLIENT_ON_LINE",P[P.METHOD_NOT_AVAILABLE=35011]="METHOD_NOT_AVAILABLE",P[P.METHOD_ONLY_SUPPORT_ULTRA_GROUP=35014]="METHOD_ONLY_SUPPORT_ULTRA_GROUP",P[P.DRAFT_SAVE_ERROR=35015]="DRAFT_SAVE_ERROR",P[P.DRAFT_REMOVE_ERROR=35016]="DRAFT_REMOVE_ERROR",P[P.CONVER_REMOVE_ERROR=35020]="CONVER_REMOVE_ERROR",P[P.CONVER_GET_ERROR=35021]="CONVER_GET_ERROR",P[P.SEARCH_PROPS_LIMIT_ERROR=35022]="SEARCH_PROPS_LIMIT_ERROR",P[P.INVALID_PARAMETER_MESSAGE_TYPE=35024]="INVALID_PARAMETER_MESSAGE_TYPE",P[P.INVALID_PARAMETER_ORDER=35025]="INVALID_PARAMETER_ORDER",P[P.INVALID_PARAMETER_DRAFT=35028]="INVALID_PARAMETER_DRAFT",P[P.INVALID_PARAMETER_MESSAGE=35029]="INVALID_PARAMETER_MESSAGE",P[P.INVALID_PARAMETER_PUSH_CONTENT=35030]="INVALID_PARAMETER_PUSH_CONTENT",P[P.INVALID_PARAMETER_SENDOPTIONS=35031]="INVALID_PARAMETER_SENDOPTIONS",P[P.INVALID_PARAMETER_CONTENT_DISPOSITION=35032]="INVALID_PARAMETER_CONTENT_DISPOSITION",P[P.INVALID_PARAMETER_SAVE_NAME=35033]="INVALID_PARAMETER_SAVE_NAME",P[P.INVALID_PARAMETER_SERVER_TYPE=35034]="INVALID_PARAMETER_SERVER_TYPE",P[P.INVALID_PARAMETER_CLEAN_SPACE=35035]="INVALID_PARAMETER_CLEAN_SPACE",P[P.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION=35036]="INVALID_PARAMETER_CAN_INCLUDE_EXPANSION",P[P.INVALID_PARAMETER_DISABLE_NOTIFICATION=35037]="INVALID_PARAMETER_DISABLE_NOTIFICATION",P[P.INVALID_PARAMETER_CHECK_DUPLICATE=35038]="INVALID_PARAMETER_CHECK_DUPLICATE",P[P.INVALID_PARAMETER_IS_AUTO_DELETE=35039]="INVALID_PARAMETER_IS_AUTO_DELETE",P[P.INVALID_PARAMETER_IS_SEND_NOTIFICATION=35040]="INVALID_PARAMETER_IS_SEND_NOTIFICATION",P[P.INVALID_PARAMETER_IS_FORCE=35041]="INVALID_PARAMETER_IS_FORCE",P[P.INVALID_PARAMETER_IS_TOP=35042]="INVALID_PARAMETER_IS_TOP",P[P.INVALID_PARAMETER_IS_UPDATE_TIME=35043]="INVALID_PARAMETER_IS_UPDATE_TIME",P[P.INVALID_PARAMETER_CONTAIN_MUTED=35044]="INVALID_PARAMETER_CONTAIN_MUTED",P[P.INVALID_PARAMETER_IS_STATUS_MESSAGE=35045]="INVALID_PARAMETER_IS_STATUS_MESSAGE",P[P.INVALID_PARAMETER_IS_MENTIONED=35046]="INVALID_PARAMETER_IS_MENTIONED",P[P.INVALID_PARAMETER_IS_VOIP_PUSH=35047]="INVALID_PARAMETER_IS_VOIP_PUSH",P[P.INVALID_PARAMETER_MENTIONED_TYPE=35048]="INVALID_PARAMETER_MENTIONED_TYPE",P[P.INVALID_PARAMETER_PUSH_CONFIG=35049]="INVALID_PARAMETER_PUSH_CONFIG",P[P.INVALID_PARAMETER_PUSH_DATA=35050]="INVALID_PARAMETER_PUSH_DATA",P[P.DNS_PROXY_TIMEOUT=35051]="DNS_PROXY_TIMEOUT",P[P.DNS_PROXY_ERROR=35052]="DNS_PROXY_ERROR",P[P.DNS_PROXY_DATA_DESTRUCTUR_ERROR=35053]="DNS_PROXY_DATA_DESTRUCTUR_ERROR",P[P.INVALID_DISABLE_UPDATE_LAST_MESSAGE=35054]="INVALID_DISABLE_UPDATE_LAST_MESSAGE",P[P.CHATROOM_ID_ISNULL=36001]="CHATROOM_ID_ISNULL",P[P.CHARTOOM_JOIN_ERROR=36002]="CHARTOOM_JOIN_ERROR",P[P.CHATROOM_HISMESSAGE_ERROR=36003]="CHATROOM_HISMESSAGE_ERROR",P[P.CHATROOM_KV_NOT_FOUND=36004]="CHATROOM_KV_NOT_FOUND",P[P.BLACK_ADD_ERROR=37001]="BLACK_ADD_ERROR",P[P.BLACK_GETSTATUS_ERROR=37002]="BLACK_GETSTATUS_ERROR",P[P.BLACK_REMOVE_ERROR=37003]="BLACK_REMOVE_ERROR",P[P.DRAF_GET_ERROR=38001]="DRAF_GET_ERROR",P[P.STREAM_MESSAGE_DISABLE=39001]="STREAM_MESSAGE_DISABLE",P[P.STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED=39002]="STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED",P[P.STREAM_MESSAGE_EXPANSION_KEY_ERROR=39003]="STREAM_MESSAGE_EXPANSION_KEY_ERROR",P[P.STREAM_MESSAGE_REQUEST_FAIL=39005]="STREAM_MESSAGE_REQUEST_FAIL",P[P.STREAM_MESSAGE_REQUEST_IN_PROCESS=39006]="STREAM_MESSAGE_REQUEST_IN_PROCESS",P[P.STREAM_MESSAGE_SYNCED=39007]="STREAM_MESSAGE_SYNCED",P[P.QNTKN_GET_ERROR=41002]="QNTKN_GET_ERROR",P[P.TIMEOUT=-1]="TIMEOUT",exports.ConversationType=void 0,(w=exports.ConversationType||(exports.ConversationType={}))[w.NONE=0]="NONE",w[w.PRIVATE=1]="PRIVATE",w[w.DISCUSSION=2]="DISCUSSION",w[w.GROUP=3]="GROUP",w[w.CHATROOM=4]="CHATROOM",w[w.CUSTOMER_SERVICE=5]="CUSTOMER_SERVICE",w[w.SYSTEM=6]="SYSTEM",w[w.APP_PUBLIC_SERVICE=7]="APP_PUBLIC_SERVICE",w[w.PUBLIC_SERVICE=8]="PUBLIC_SERVICE",w[w.ULTRA_GROUP=10]="ULTRA_GROUP",w[w.RTC_ROOM=12]="RTC_ROOM",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"}(x||(x={})),exports.FileType=void 0,(D=exports.FileType||(exports.FileType={}))[D.IMAGE=1]="IMAGE",D[D.AUDIO=2]="AUDIO",D[D.VIDEO=3]="VIDEO",D[D.FILE=4]="FILE",D[D.SIGHT=5]="SIGHT",D[D.COMBINE_HTML=6]="COMBINE_HTML",exports.MentionedType=void 0,(V=exports.MentionedType||(exports.MentionedType={}))[V.ALL=1]="ALL",V[V.SINGAL=2]="SINGAL",exports.MessageType=void 0,(G=exports.MessageType||(exports.MessageType={})).TextMessage="RC:TxtMsg",G.VOICE="RC:VcMsg",G.HQ_VOICE="RC:HQVCMsg",G.IMAGE="RC:ImgMsg",G.GIF="RC:GIFMsg",G.RICH_CONTENT="RC:ImgTextMsg",G.LOCATION="RC:LBSMsg",G.FILE="RC:FileMsg",G.SIGHT="RC:SightMsg",G.COMBINE="RC:CombineMsg",G.COMBINE_V2="RC:CombineV2Msg",G.CHRM_KV_NOTIFY="RC:chrmKVNotiMsg",G.LOG_COMMAND="RC:LogCmdMsg",G.EXPANSION_NOTIFY="RC:MsgExMsg",G.REFERENCE="RC:ReferenceMsg",G.RECALL="RC:RcCmd",G.RECALL_NOTIFICATION_MESSAGE="RC:RcNtf",G.READ_RECEIPT="RC:ReadNtf",G.READ_RECEIPT_REQUEST="RC:RRReqMsg",G.READ_RECEIPT_RESPONSE="RC:RRRspMsg",G.SYNC_READ_STATUS="RC:SRSMsg",G.GROUP_READ_RECEIPT_REQUEST="RC:RRMsg",G.READ_STATE="RC:RSMsg",G.DELIVERED="RC:Delivered",G.DELIVERED_MSG="RC:DRMsg",G.CHATROOM_MERGE_CHANGE="RC:ChrmMemChange",G.CHATROOM_SYNC_MSG="RC:ChrmSyncMsg",G.CHATROOM_MERGE_BLOCK="RC:ChrmBlockMsg",G.CHATROOM_MERGE_BAN="RC:ChrmBanMsg",G.TYPING_STATUS="RC:TypSts",G.INTERCEPT="RC:InterceptMsg",G.CLOUD_CONTROL="RC:CCConfigChangeRequestMsg",G.STREAM_MESSAGE="RC:StreamMsg",exports.UltraGroupChannelType=void 0,(k=exports.UltraGroupChannelType||(exports.UltraGroupChannelType={}))[k.PUBLIC=0]="PUBLIC",k[k.PRIVATE=1]="PRIVATE",exports.UltraGroupChannelChangeType=void 0,(F=exports.UltraGroupChannelChangeType||(exports.UltraGroupChannelChangeType={}))[F.PUBLIC_TO_PRIVATE=2]="PUBLIC_TO_PRIVATE",F[F.PRIVATE_TO_PUBLIC=3]="PRIVATE_TO_PUBLIC",F[F.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"}(B||(B={})),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"}(H||(H={})),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"}(q||(q={})),function(e){e[e.NOT_MENTIONED=0]="NOT_MENTIONED",e[e.ALL=1]="ALL",e[e.ME=2]="ME"}(Y||(Y={})),exports.SentStatus=void 0,(K=exports.SentStatus||(exports.SentStatus={}))[K.SENDING=10]="SENDING",K[K.FAILED=20]="FAILED",K[K.SENT=30]="SENT",K[K.RECEIVED=40]="RECEIVED",K[K.READ=50]="READ",K[K.DESTROYED=60]="DESTROYED",exports.OperateStatus=void 0,(Q=exports.OperateStatus||(exports.OperateStatus={}))[Q.typing=0]="typing",exports.OnlineStatus=void 0,(W=exports.OnlineStatus||(exports.OnlineStatus={}))[W.ONLINE=1]="ONLINE",W[W.OFFLINE=0]="OFFLINE",exports.PlatformInfo=void 0,(j=exports.PlatformInfo||(exports.PlatformInfo={}))[j.Other=0]="Other",j[j.iOS=1]="iOS",j[j.Android=2]="Android",j[j.Web=3]="Web",j[j.PC=4]="PC",j[j.Mini=5]="Mini",j[j.HarmonyOS=6]="HarmonyOS",exports.SubscribeType=void 0,(J=exports.SubscribeType||(exports.SubscribeType={}))[J.ONLINE_STATUS=1]="ONLINE_STATUS",J[J.USER_PROFILE=2]="USER_PROFILE",J[J.FRIEND_ONLINE_STATUS=3]="FRIEND_ONLINE_STATUS",J[J.FRIEND_USER_PROFILE=4]="FRIEND_USER_PROFILE",exports.SubscribeOperationType=void 0,(z=exports.SubscribeOperationType||(exports.SubscribeOperationType={}))[z.SUBSCRIBE=0]="SUBSCRIBE",z[z.UNSUBSCRIBE=1]="UNSUBSCRIBE",exports.UserProfileVisibility=void 0,(Z=exports.UserProfileVisibility||(exports.UserProfileVisibility={}))[Z.NOT_SET=0]="NOT_SET",Z[Z.INVISIBLE=1]="INVISIBLE",Z[Z.EVERYONE=2]="EVERYONE",Z[Z.FriendVisible=3]="FriendVisible",exports.RCConnectionStatus=void 0,(X=exports.RCConnectionStatus||(exports.RCConnectionStatus={}))[X.CONNECTED=0]="CONNECTED",X[X.CONNECTING=1]="CONNECTING",X[X.DISCONNECTED=2]="DISCONNECTED",X[X.SUSPENDED=3]="SUSPENDED",exports.MessageBlockType=void 0,($=exports.MessageBlockType||(exports.MessageBlockType={}))[$.GLOBAL=1]="GLOBAL",$[$.CUSTOM=2]="CUSTOM",$[$.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,(te=exports.MessageDirection||(exports.MessageDirection={}))[te.SEND=1]="SEND",te[te.RECEIVE=2]="RECEIVE",exports.PushImportanceHonor=void 0,(ne=exports.PushImportanceHonor||(exports.PushImportanceHonor={})).NORMAL="NORMAL",ne.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"}(re||(re={})),exports.NotificationLevel=void 0,(oe=exports.NotificationLevel||(exports.NotificationLevel={}))[oe.ALL_MESSAGE=-1]="ALL_MESSAGE",oe[oe.NOT_SET=0]="NOT_SET",oe[oe.AT_MESSAGE_NOTIFICATION=1]="AT_MESSAGE_NOTIFICATION",oe[oe.AT_USER_NOTIFICATION=2]="AT_USER_NOTIFICATION",oe[oe.AT_GROUP_ALL_USER_NOTIFICATION=4]="AT_GROUP_ALL_USER_NOTIFICATION",oe[oe.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";var ge,fe,Ee,Ie,Te,Ce,ve,Re,ye,me,Se,Ae=function(e){return e===exports.NotificationStatus.OPEN?exports.NotificationLevel.AT_MESSAGE_NOTIFICATION:exports.NotificationLevel.NOT_SET},Ne=function(e){return e<=exports.NotificationLevel.NOT_SET?exports.NotificationStatus.CLOSE:exports.NotificationStatus.OPEN};exports.ReceivedStatus=void 0,(ge=exports.ReceivedStatus||(exports.ReceivedStatus={}))[ge.READ=1]="READ",ge[ge.LISTENED=2]="LISTENED",ge[ge.DOWNLOADED=4]="DOWNLOADED",ge[ge.RETRIEVED=8]="RETRIEVED",ge[ge.UNREAD=0]="UNREAD",function(e){e[e.PRIVATE=1]="PRIVATE",e[e.OPEN=0]="OPEN"}(fe||(fe={})),function(e){e[e.NAVI=1]="NAVI",e[e.TCP=2]="TCP",e[e.WS=3]="WS"}(Ee||(Ee={})),function(e){e[e.REQUEST=0]="REQUEST",e[e.LOCAL=1]="LOCAL"}(Ie||(Ie={})),function(e){e[e.CURRENT=2]="CURRENT"}(Te||(Te={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT"}(Ce||(Ce={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT",e[e.REDIRECTED=3]="REDIRECTED",e[e.TIMEOUT=4]="TIMEOUT"}(ve||(ve={})),exports.InterruptionLevel=void 0,(Re=exports.InterruptionLevel||(exports.InterruptionLevel={})).PASSIVE="passive",Re.ACTIVE="active",Re.TIME_SENSITIVE="time-sensitive",Re.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",function(e){e.WIFI="wifi",e.FOUR_G="4g",e.THREE_G="3g",e.TWO_G="2g",e.FIVE_G="2g",e.THREE_GENT="3gnet",e.UNKONWN="unknown"}(me||(me={})),exports.HttpMethod=void 0,(Se=exports.HttpMethod||(exports.HttpMethod={})).GET="GET",Se.POST="POST",Se.PUT="PUT";var Oe=72e5,Me=6e4,Le=131072,Ue={"RC:TxtMsg":{isCounted:!0,isPersited:!0},"RC:ImgMsg":{isCounted:!0,isPersited:!0},"RC:VcMsg":{isCounted:!0,isPersited:!0},"RC:ImgTextMsg":{isCounted:!0,isPersited:!0,searchProps:["content","title"]},"RC:FileMsg":{isCounted:!0,isPersited:!0,searchProps:["name"]},"RC:HQVCMsg":{isCounted:!0,isPersited:!0},"RC:LBSMsg":{isCounted:!0,isPersited:!0},"RC:PSImgTxtMsg":{isCounted:!0,isPersited:!0},"RC:PSMultiImgTxtMsg":{isCounted:!0,isPersited:!0},"RCJrmf:RpMsg":{isCounted:!0,isPersited:!0},"RCJrmf:RpOpendMsg":{isCounted:!0,isPersited:!0},"RC:CombineMsg":{isCounted:!0,isPersited:!0},"RC:CombineV2Msg":{isCounted:!0,isPersited:!0},"RC:ReferenceMsg":{isCounted:!0,isPersited:!0,searchProps:["content"]},"RC:SightMsg":{isCounted:!0,isPersited:!0},"RC:GIFMsg":{isCounted:!0,isPersited:!0},"RC:RLStart":{isCounted:!0,isPersited:!0},"RC:RLEnd":{isCounted:!0,isPersited:!0},"RC:StreamMsg":{isCounted:!0,isPersited:!0},"RC:InfoNtf":{isCounted:!1,isPersited:!0},"RC:ContactNtf":{isCounted:!1,isPersited:!0},"RC:ProfileNtf":{isCounted:!1,isPersited:!0},"RC:CmdNtf":{isCounted:!1,isPersited:!0},"RC:GrpNtf":{isCounted:!1,isPersited:!0},"RC:RcNtf":{isCounted:!1,isPersited:!0},"RC:CmdMsg":{isCounted:!1,isPersited:!1},"RC:TypSts":{isCounted:!1,isPersited:!1},"RC:PSCmd":{isCounted:!1,isPersited:!1},"RC:SRSMsg":{isCounted:!1,isPersited:!1},"RC:RcCmd":{isCounted:!1,isPersited:!1},"RC:RRReqMsg":{isCounted:!1,isPersited:!1},"RC:RRRspMsg":{isCounted:!1,isPersited:!1},"RC:CsChaR":{isCounted:!1,isPersited:!1},"RC:CSCha":{isCounted:!1,isPersited:!1},"RC:CsEva":{isCounted:!1,isPersited:!1},"RC:CsContact":{isCounted:!1,isPersited:!1},"RC:CsHs":{isCounted:!1,isPersited:!1},"RC:CsHsR":{isCounted:!1,isPersited:!1},"RC:CsSp":{isCounted:!1,isPersited:!1},"RC:CsEnd":{isCounted:!1,isPersited:!1},"RC:CsUpdate":{isCounted:!1,isPersited:!1},"RC:ReadNtf":{isCounted:!1,isPersited:!1},"RC:chrmKVNotiMsg":{isCounted:!1,isPersited:!1},"RC:VCAccept":{isCounted:!1,isPersited:!1},"RC:VCRinging":{isCounted:!1,isPersited:!1},"RC:VCSummary":{isCounted:!1,isPersited:!1},"RC:VCHangup":{isCounted:!1,isPersited:!1},"RC:VCInvite":{isCounted:!1,isPersited:!1},"RC:VCModifyMedia":{isCounted:!1,isPersited:!1},"RC:VCModifyMem":{isCounted:!1,isPersited:!1},"RC:MsgExMsg":{isCounted:!1,isPersited:!1},"RC:Delivered":{isCounted:!1,isPersited:!1},"RC:RRMsg":{isCounted:!1,isPersited:!1},"RC:LogCmdMsg":{isCounted:!1,isPersited:!1},"RC:InterceptMsg":{isCounted:!1,isPersited:!1},"RC:RLJoin":{isCounted:!1,isPersited:!1},"RC:RLQuit":{isCounted:!1,isPersited:!1},"RC:RL":{isCounted:!1,isPersited:!1},"RC:CCConfigChangeRequestMsg":{isCounted:!1,isPersited:!1}},be="5.20.0-c-esm-alpha.1".replace(/-.+$/,""),Pe="rongcloudsystem",we=864e5,xe=function(e){return"navi_".concat(e)},De=function(e,t){return"RCV4-con-s-".concat(e,"-").concat(t)},Ve=function(e,t){return"RCV4-con-".concat(e,"-").concat(t)},Ge=function(e,t){return"RCV4-CONVER-".concat(e,"-").concat(t)},ke=function(e,t){return"RCV4-ultragroupconversation-".concat(e,"-").concat(t)},Fe=function(e,t){return"outbox_".concat(e,"_").concat(t)},Be=function(e,t){return"inbox_".concat(e,"_").concat(t)},He=function(e,t){return"broadcastbox_".concat(e,"_").concat(t)},qe=function(e,t){return"send_msg_".concat(e,"_").concat(t)},Ye=function(e,t){return"RC-us-".concat(e,"-").concat(t)},Ke=function(e){return"rc-static-config-".concat(e)},Qe=function(e){return"RC-cc-".concat(e)},We=function(e,t){return"RC-RR-".concat(e,"-").concat(t)},je=function(e,t){return"RC-PEC-".concat(e,"-").concat(t)},Je="undefined"!=typeof window&&window?(window.__RCVersionInfo||(window.__RCVersionInfo={}),window.__RCVersionInfo):{};Je.engine="5.20.0-c-esm-alpha.1";var ze=function(){function e(){}return e.add=function(e,t){Je[e]=t},e.validEngine=function(e){var t=e.match(/\d+\.\d+\.\d+/);if(!t)return!1;var n=t[0].split(".").map((function(e){return e.padStart(3,"0")})).join("");return Je.engine.match(/\d+\.\d+\.\d+/)[0].split(".").map((function(e){return e.padStart(3,"0")})).join("")>=n},e.getInfo=function(){return Je},e}();var Ze={gen:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=Math.floor(36*Math.random());return("x"===e?t:3&t|8).toString(36)}))},genWithLen:function(e){void 0===e&&(e=22);var t,n=Date.now(),r=n.toString(36),o=Math.floor(Math.random()*n).toString(36),i=e-r.length-o.length;return[o,r,i>0?(t=i,Array.from({length:t}).map((function(){return Math.floor(36*Math.random()).toString(36)})).join("")):""].join("").slice(0,e)}},Xe=Ze.genWithLen(22),$e=Date.now(),et=function(e){function n(t){var n=e.call(this,t)||this;return n.name="CMSYError",n}return t(n,e),n.InvalidParameters=function(e){return(null==e?void 0:e.length)?new n("Invalid parameter -> ".concat(e)):new n("Invalid parameters.")},n.ParameterTypeError=function(){return new n("Wrong parameter type")},n}(Error),nt=function(){function e(){this._map=new Map,this._piped=new Set}return e.prototype._addItem=function(e,t,n,r,o){void 0===o&&(o=0);var i=Symbol(),s=this._map.get(e)||this._map.set(e,[]).get(e),a={symbol:i,priority:Math.min(o,100),listener:t.bind(r),once:n},u=s.findIndex((function(e){return e.priority>o}));return-1===u?s.push(a):s.splice(u,0,a),i},e.prototype.on=function(e,t,n,r){return void 0===r&&(r=0),this._addItem(e,t,!1,n,r)},e.prototype.once=function(e,t,n,r){return void 0===r&&(r=0),this._addItem(e,t,!0,n,r)},e.prototype.off=function(e){var t,n;try{for(var r=le(this._map),o=r.next();!o.done;o=r.next()){var i=de(o.value,2),s=(i[0],i[1]),a=s.findIndex((function(t){return t.symbol===e}));if(-1!==a)return void s.splice(a,1)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=this._map.get(e);if(r&&r.length>0)for(var o=r.length-1;o>=0;o-=1){var i=r[o],s=i.once,a=i.listener;s&&r.splice(o,1);try{a.apply(void 0,pe([],de(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}pe([],de(this._piped.values()),!1).forEach((function(n){return n.emit.apply(n,pe([e],de(t),!1))}))},e.prototype.removeAll=function(e){this._map.delete(e)},e.prototype.clear=function(){this._piped.clear(),this._map.clear()},e.prototype.pipe=function(e){this._piped.add(e)},e}();!function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t._versionQueue=[],t._isPulling=null,t._dataVersion=0,t._invervalTimer=-1,t._intervalGap=0,t}t(n,e),n.prototype.setInitVersion=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){switch(n.label){case 0:return 0!==this._dataVersion?[2]:(this._dataVersion=e,t?[4,this._execPulling()]:[3,2]);case 1:n.sent(),n.label=2;case 2:return[2]}}))}))},n.prototype.push=function(e){e<this._dataVersion||(this._versionQueue.push(e),0!==this._dataVersion&&this._execPulling())},n.prototype._execPulling=function(){return ue(this,void 0,void 0,(function(){var e,t,n,r,o;return ce(this,(function(i){switch(i.label){case 0:return this._isPulling?[4,this._isPulling]:[3,2];case 1:return i.sent(),[2];case 2:return this._isPulling=this._sendRequest(this._dataVersion),[4,this._isPulling];case 3:if(e=i.sent(),t=e.code,n=e.version,r=e.hasNext,this._isPulling=null,0!==t)return[2];if(void 0===n||n<this._dataVersion)throw new Error("version error, please check: lastVersion: ".concat(this._dataVersion,", newVersion: ").concat(n));return o=this._versionQueue.filter((function(e){return e>n})),this._versionQueue=pe([],de(o),!1),this._dataVersion=n,this._resetIntervalTimer(),r?(this._execPulling(),[2]):(this._versionQueue.length>0&&(this._versionQueue.length=0,this._execPulling()),[2])}}))}))},n.prototype.startInterval=function(e){var t=this;-1===this._invervalTimer&&(this._intervalGap=e,this._invervalTimer=setInterval((function(){return t._execPulling()}),e))},n.prototype._resetIntervalTimer=function(){var e=this;-1!==this._invervalTimer&&(clearInterval(this._invervalTimer),this._invervalTimer=setInterval((function(){return e._execPulling()}),this._intervalGap))},n.prototype.stopInterval=function(){-1!==this._invervalTimer&&clearInterval(this._invervalTimer)},n.prototype.reset=function(){this.stopInterval(),this._versionQueue.length=0,this._dataVersion=0}}(nt);var rt=function(){function e(e,t){var n=this;this._promise=new Promise((function(t){n._resolve=t,e(n._onResolve.bind(n))})),this._onCancel=t}return e.prototype._onResolve=function(e){this._resolve(e)},e.prototype.result=function(){return this._promise},e.prototype.abort=function(){this._onCancel(this._onResolve.bind(this))},e}(),ot=function(){function e(e,t,n){this.code=e,this.msg=t,this.data=n,this.isOk=0===e}return e.prototype.next=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return this.isOk?[2,e(this.data)]:[2,this.wipe()]}))}))},e.prototype.or=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return this.isOk?[2,this]:[2,e(this.code)]}))}))},e.prototype.trans=function(e){return this.isOk?it(e(this.data)):this.wipe()},e.prototype.tryTrans=function(e){return this.isOk?e(this.data):this.wipe()},e.prototype.errmsg=function(){return JSON.stringify({code:this.code,msg:this.msg})},e.prototype.wipe=function(){return this.isOk?it(void 0,this.msg):st(this.code,this.msg)},e}(),it=function(e,t){return new ot(0,t||"success",e)},st=function(e,t,n){return new ot(e,t||"fail: ".concat(e),n)},at=function(){function e(e){this._apiName=e,this._isValid=!0,this._code=0}return e.create=function(t){return new e(t)},e.prototype.fail=function(e,t){return this._isValid||0!==this._code||(this._code=e,this._errmsg=t||this._errmsg),this},e.prototype.result=function(){if(!this._isValid&&0===this._code)throw new Error("Validator: result() should not be called without fail()");return this._isValid?it():st(this._code,this._errmsg)},e.prototype.validate=function(e,t,n,r){if(void 0===r&&(r=!1),!this._isValid)return this;var o=r?n(t):null==t||n(t);return this._isValid=o,o||(this._errmsg="param '".concat(e,"' is invalid")),this},e.prototype.assert=function(e,t,n,r){if(void 0===r&&(r=!1),!this._isValid)return this;if(this.validate(e,t,n,r),!this._isValid)throw et.InvalidParameters("'".concat(e,"' at '").concat(this._apiName,"'"));return this},e.prototype.isString=function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(){return"string"==typeof t}),n)},e.prototype.assertString=function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(){return"string"==typeof t}),n)},e.prototype.isNotEmptyString=function(e,t,n){return void 0===n&&(n=!1),this.isString(e,t,n).validate(e,t,(function(e){return e.trim().length>0}),n)},e.prototype.assertNotEmptyString=function(e,t,n){return void 0===n&&(n=!1),this.assertString(e,t,n),this.assert(e,t,(function(e){return e.trim().length>0}),n)},e.prototype.isLimitedString=function(e,t,n,r,o){return void 0===o&&(o=!1),this.isString(e,t,o).validate(e,t,(function(e){return e.length>=n&&e.length<=r}),o)},e.prototype.assertLimitedString=function(e,t,n,r,o){return void 0===o&&(o=!1),this.assertString(e,t,o),this.assert(e,t,(function(e){return e.length>=n&&e.length<=r}),o)},e.prototype.isBoolean=function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return"boolean"==typeof e}),n)},e.prototype.assertBoolean=function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return"boolean"==typeof e}),n)},e.prototype.isNumber=function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return"number"==typeof e&&!Number.isNaN(e)}),n)},e.prototype.assertNumber=function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return"number"==typeof e&&!Number.isNaN(e)}),n)},e.prototype.isLimitedNumber=function(e,t,n,r,o){return void 0===o&&(o=!1),this.isNumber(e,t,o).validate(e,t,(function(e){return e>=n&&e<=r}),o)},e.prototype.assertLimitedNumber=function(e,t,n,r,o){return void 0===o&&(o=!1),this.assertNumber(e,t,o),this.assert(e,t,(function(e){return e>=n&&e<=r}),o)},e.prototype.isInteger=function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return Number.isInteger(e)}),n)},e.prototype.assertInteger=function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return Number.isInteger(e)}),n)},e.prototype.isLimitedInteger=function(e,t,n,r,o){return void 0===o&&(o=!1),this.isInteger(e,t,o).validate(e,t,(function(e){return e>=n&&e<=r}),o)},e.prototype.assertLimitedInteger=function(e,t,n,r,o){return void 0===o&&(o=!1),this.assertInteger(e,t,o),this.assert(e,t,(function(e){return e>=n&&e<=r}),o)},e.prototype.isArray=function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")}),n)},e.prototype.assertArray=function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")}),n)},e.prototype.isLimitedArray=function(e,t,n,r,o){return void 0===r&&(r=!1),void 0===o&&(o=1),this.isArray(e,t,r).validate(e,t,(function(e){return e.length>=o&&e.length<=n}),r)},e.prototype.assertLimitedArray=function(e,t,n,r,o){return void 0===r&&(r=!1),void 0===o&&(o=1),this.assertArray(e,t,r),this.assert(e,t,(function(e){return e.length>=o&&e.length<=n}),r)},e.prototype.isTypedArray=function(e,t,n,r){return void 0===r&&(r=!1),this.isArray(e,t,r).validate(e,t,(function(e){return e.every(n)}),r)},e.prototype.assertTypedArray=function(e,t,n,r){return void 0===r&&(r=!1),this.assertArray(e,t,r),this.assert(e,t,(function(e){return e.every(n)}),r)},e.prototype.isLimitedTypedArray=function(e,t,n,r,o,i){return void 0===o&&(o=!1),void 0===i&&(i=1),this.isLimitedArray(e,t,n,o,i).validate(e,t,(function(e){return e.every(r)}),o)},e.prototype.assertLimitedTypedArray=function(e,t,n,r,o,i){return void 0===o&&(o=!1),void 0===i&&(i=1),this.assertLimitedArray(e,t,n,o,i),this.assert(e,t,(function(e){return e.every(r)}),o)},e.prototype.isObject=function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return"[object Object]"===Object.prototype.toString.call(e)}),n)},e.prototype.assertObject=function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return"[object Object]"===Object.prototype.toString.call(e)}),n)},e.prototype.isValueOf=function(e,t,n,r){return void 0===r&&(r=!1),this.validate(e,t,(function(){return Object.values(n).includes(t)}),r)},e.prototype.assertValueOf=function(e,t,n,r){return void 0===r&&(r=!1),this.assert(e,t,(function(){return Object.values(n).includes(t)}),r)},e.prototype.isFunction=function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return"[object Function]"===Object.prototype.toString.call(e)}),n)},e.prototype.assertFunction=function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return"[object Function]"===Object.prototype.toString.call(e)}),n)},e}(),ut="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function ct(e){var t,n,r,o,i,s,a="",u=0;for(e=e.replace(/[^A-Za-z0-9+/=]/g,"");u<e.length;)t=ut.indexOf(e.charAt(u++))<<2|(o=ut.indexOf(e.charAt(u++)))>>4,n=(15&o)<<4|(i=ut.indexOf(e.charAt(u++)))>>2,r=(3&i)<<6|(s=ut.indexOf(e.charAt(u++))),a+=String.fromCharCode(t),64!==i&&(a+=String.fromCharCode(n)),64!==s&&(a+=String.fromCharCode(r));return a}var lt=function(e){return"string"==typeof e},dt=function(e){return"number"==typeof e&&!Number.isNaN(e)},pt=function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")},ht=function(e){return function(t){return lt(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))}},_t=function(e){return lt(e)&&e.length>0},gt=function(e){return"[object Object]"===Object.prototype.toString.call(e)},ft=function(e){return"[object Function]"===Object.prototype.toString.call(e)},Et=function(e){return void 0===e||"[object Undefined]"===Object.prototype.toString.call(e)},It=function(e){return lt(e)&&/https?:\/\//.test(e)},Tt=function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1},Ct=function(e){return dt(e)&&Object.prototype.hasOwnProperty.call(exports.ConversationType,e)},vt=function(e){var t=!1;return lt(e)&&!/_/g.test(e)&&e.length<=20&&(t=!0),t},Rt=function(e){return ht({minLength:1,maxLength:64})(e)},yt=function(e){var t=!1,n=!1,r=!1;if(gt(e)){var o=Object.keys(e).length;for(var i in t=o>20,e)if(n||(n=lt(i)&&!/^[A-Za-z0-9_=+-]+$/.test(i)),!r){var s=e[i];r=i.length>32||s.length>4096}}return{isExceedLimit:t,isIllgalEx:n,isExKeyOrValLengthExceedLimit:r}},mt=function(e){if(!gt(e)||void 0===e.low||void 0===e.high)return e;var t=e.low;return t<0&&(t+=4294967296),t=t.toString(16),parseInt(e.high.toString(16)+"00000000".replace(new RegExp("0{".concat(t.length,"}$")),t),16)},St=function(e,t,n){var r=null==n?void 0:n.isReverse;gt(e)&&function(){for(var n in e)t(e[n],n,e)}(),(pt(e)||lt(e))&&function(){if(r)for(var n=e.length-1;n>=0;n--)t(e[n],n);else for(var o=0,i=e.length;o<i;o++)t(e[o],o)}()},At=function(e,t){return St(e,(function(n,r){e[r]=t(n,r)})),e},Nt=function(e){return JSON.parse(JSON.stringify(e))},Ot=function(){return"undefined"!=typeof RCCppEngine},Mt=function(e){var t;if("object"==typeof e&&null!==e)if(Array.isArray(e))for(var n in t=[],e)t.push(Mt(e[n]));else for(var n in t={},e)t[n]=Mt(e[n]);else t=e;return t},Lt=function(e){var t;try{t=Mt(e)}catch(n){t=JSON.parse(JSON.stringify(e))}return t},Ut=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}},bt=function(e){return[exports.PlatformInfo.Android,exports.PlatformInfo.iOS,exports.PlatformInfo.Web,exports.PlatformInfo.PC,exports.PlatformInfo.Mini,exports.PlatformInfo.HarmonyOS].map((function(t){var n=e.findIndex((function(e){return e.platform===t}));return-1===n?{platform:t,changeTime:0,eventValue:0}:e[n]}))},Pt=function(e,t,n){var r=t.reduce((function(e,t){return["gender","role","level"].includes(t.key)?e[t.key]=Number(t.value):e[t.key]=t.value,e}),{});return r.userId=e,n.forEach((function(e){r.extraProfile=r.extraProfile||{},r.extraProfile[e.key]=e.value})),r},wt=function(e,t,n){return t?1===n?x.TLS:x.RMTP:"http"===e?x.WS:x.WSS},xt=function(e,t){var n=e.server,r=e.backupServer,o=e.bs,i=e.serverAddr,s=e.protocol,a=e.openTLS;if(i)return pe([],de(i.filter((function(e){return e.addr}))),!1);var u=[],c=[];return n&&c.push(n),(r||o||"").split(",").forEach((function(e){c.indexOf(e)<0&&c.push(e)})),c.forEach((function(e,r){e&&u.push({addr:e,protocol:wt(s,t,a),weight:n.length-r,race:!1})})),pe([],de(u),!1)},Dt=function(e){return void 0===e&&(e=[]),e.map((function(e){var t,n,r,o,i,s,a,u,c,l=Bt(e.settingProfile)||{},d=e.extProfile||[],p=e.targetId,h=e.baseInfo,_=e.userInfo;return{groupId:p,groupName:null!==(t=l.name)&&void 0!==t?t:"",portraitUri:null!==(n=l.portraitUrl)&&void 0!==n?n:"",introduction:null!==(r=l.introduction)&&void 0!==r?r:"",notice:null!==(o=l.announcement)&&void 0!==o?o:"",extProfile:Bt(d),joinPermission:~~l.joinPerm,removeMemberPermission:~~l.removePerm,invitePermission:~~l.memInvitePerm,inviteHandlePermission:~~l.invitePerm,groupInfoEditPermission:~~l.profilePerm,memberInfoEditPermission:~~l.memProfilePerm,creatorId:null!==(i=null==h?void 0:h.creatorId)&&void 0!==i?i:"",ownerId:null!==(s=null==h?void 0:h.ownerId)&&void 0!==s?s:"",createTime:(null==h?void 0:h.createTime)?mt(h.createTime):0,membersCount:null!==(a=null==h?void 0:h.memberCount)&&void 0!==a?a:0,remark:null!==(u=null==_?void 0:_.remarkName)&&void 0!==u?u:"",joinedTime:(null==_?void 0:_.joinTime)?mt(_.joinTime):0,role:null!==(c=null==_?void 0:_.role)&&void 0!==c?c:exports.GroupMemberRole.UNDEF}}))},Vt=function(e){return void 0===e&&(e=[]),e.map((function(e){var t=Bt(e.settingProfile),n=e.extProfile||[],r=e.targetId,o=e.baseInfo,i=e.userInfo;return JSON.parse(JSON.stringify(se(se({groupId:r},kt(t)),{extProfile:n.length>0?Bt(n):void 0,creatorId:null==o?void 0:o.creatorId,ownerId:null==o?void 0:o.ownerId,createTime:(null==o?void 0:o.createTime)?mt(o.createTime):void 0,membersCount:null==o?void 0:o.memberCount,remark:null==i?void 0:i.remarkName})))}))},Gt=function(e){if(void 0!==e){var t=Number(e);return Number.isNaN(t)?void 0:t}},kt=function(e){return JSON.parse(JSON.stringify({groupName:e.name,portraitUri:e.portraitUrl,introduction:e.introduction,notice:e.announcement,joinPermission:Gt(e.joinPerm),removeMemberPermission:Gt(e.removePerm),invitePermission:Gt(e.memInvitePerm),inviteHandlePermission:Gt(e.invitePerm),groupInfoEditPermission:Gt(e.profilePerm),memberInfoEditPermission:Gt(e.memProfilePerm)}))},Ft=function(e){void 0===e&&(e=[]);var t=e.map((function(e){var t=e||{},n=t.ext,r=t.userId,o=t.name,i=t.portraitUrl,s=n||{},a=s.role,u=s.joinTime,c=s.channelNickName,l=s.additional;return{userId:r,name:o||"",portraitUri:i||"",nickname:c||"",role:a||exports.GroupMemberRole.UNDEF,joinedTime:mt(u)||0,extra:l||""}}));return t},Bt=function(e){var t={};return e&&0!==e.length?(e.forEach((function(e){t[e.key]=e.value})),t):t},Ht=function(e){return e.map((function(e){var t=e.targetId,n=e.joinUserInfo,r=e.inviterInfo,o=e.status,i=e.directionType,s=e.detail,a=e.joinType,u=e.processInfo,c=e.processTime;return se(se(se(se({groupId:t},n&&{joinMemberInfo:Ft([n])[0]}),r&&{inviterInfo:Ft([r])[0]}),u&&{operatorInfo:Ft([u])[0]}),{status:o,direction:i,type:a,operationTime:mt(c),reason:s})}))},qt=function(e,t){if(e=e.replace(/\?$/,""),!t)return e;var n=Object.keys(t).map((function(e){return"".concat(e,"=").concat(t[e])})).filter((function(e){return!!e}));return n.length?[e,n.join("&")].join("?"):e};function Yt(e){for(var t=null===window||void 0===window?void 0:window.atob(e),n=new Uint8Array(t.length),r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n.buffer}var Kt,Qt=function(e,t){var n=Math.floor(1e3*Math.random()%1e4),r=Ze.gen(),o=function(e){e=e||"-";var t=new Date,n=t.getFullYear(),r=t.getMonth()+1,o=t.getDate();return"".concat(n).concat(e).concat(r).concat(e).concat(o)}(),i=(new Date).getTime(),s="";if(t){var a=t.split(".");s=".".concat(a[a.length-1])}return"".concat(e,"__RC-").concat(o,"_").concat(n,"_").concat(i).concat(r).concat(s)},Wt=function(e){var t=/^[A-Za-z0-9_=+-]+$/.test(e),n=e.length;return t&&(n<=128&&n>=1)},jt=function(e){var t=e.length;return t<=4096&&t>=1},Jt=(Kt=0,function(){var e=((4294967295&Date.now())>>>0).toString(2),t=Math.floor(Math.random()*(Math.pow(2,20)-1)),n=e+Kt.toString(2).padStart(11,"0")+t.toString(2).padStart(20,"0");return Kt=2047&++Kt,parseInt(n,2)}),zt=function(){var e=ze.getInfo(),t="electron";for(var n in e)"engine"!==n&&(t=["imlib-v2-adapter","imlib-next"].includes(n)?n:"electron");return t},Zt=function(e,t,n){return ue(void 0,void 0,void 0,(function(){var r,o;return ce(this,(function(i){switch(i.label){case 0:return[4,window.crypto.subtle.importKey("raw",(new TextEncoder).encode(t),"AES-CBC",!0,["decrypt"])];case 1:return r=i.sent(),[4,window.crypto.subtle.decrypt({name:"AES-CBC",iv:(new TextEncoder).encode(n)},r,Yt(e))];case 2:return o=i.sent(),[2,(new TextDecoder).decode(o)]}}))}))};function Xt(e,t){var n;if(!e)return"";var r="undefined"!=typeof window&&"https:"===(null===(n=null===window||void 0===window?void 0:window.location)||void 0===n?void 0:n.protocol);return/^https?:\/\//.test(e)?r?e.replace(/^https?:\/\//i,"https://"):e:t!==x.HTTP||r?"https://".concat(e):"http://".concat(e)}var $t,en,tn,nn=function(e,t){if(!e)return"";var n=e.ossConfig,r=void 0===n?"":n,o="";try{var i=JSON.parse(r);if(i.length>0){var s=i.find((function(e){return e.minio}));s&&(o=s.minio)}}catch(e){t.warn(exports.LogTagId.L_PARSE_JSON_E,JSON.stringify({ossConfig:r,error:e}))}return o};function rn(e){var t=e.method||exports.HttpMethod.GET,n=e.timeout||Me,r=e.headers,o=e.query,i=e.body,s=e.onProgress,a=qt(e.url,o),u=new XMLHttpRequest;if(u.open(t,a),r&&u.setRequestHeader)for(var c in r)u.setRequestHeader(c,r[c]);return function(e,t,n,r){return new rt((function(o){e.onreadystatechange=function(){4===e.readyState&&o({data:e.responseText,status:e.status,xhr:e})},e.onerror=function(){o({status:e.status})},r&&(e.upload.onprogress=function(e){return r(e)}),0!==t&&setTimeout((function(){e.abort(),o({status:e.status})}),t),e.send(n)}),(function(t){e.abort(),t({status:-1})}))}(u,n,i,s)}!function(e){e[e.add=1]="add",e[e.update=2]="update",e[e.delete=3]="delete"}($t||($t={})),exports.AreaCode=void 0,(tn=exports.AreaCode||(exports.AreaCode={}))[tn.BJ=1]="BJ",tn[tn.SG=2]="SG",tn[tn.NA=3]="NA",tn[tn.SG_A=4]="SG_A",tn[tn.SG_B=4]="SG_B",tn[tn.SA=5]="SA";var on=((en={})[exports.AreaCode.BJ]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5yb25nLWVkZ2UuY29t","bmF2LWIucm9uZy1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ucm9uZy1lZGdlLmNvbQ==",protocol:x.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnJvbmctZWRnZS5jb20=","d3MtYi5yb25nLWVkZ2UuY29t"],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWMtMS5vc3MtY24tYmVpamluZy5hbGl5dW5jcy5jb20="],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5yb25nLWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIucm9uZy1lZGdlLmNvbQ=="]},en[exports.AreaCode.SG]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zZy1saWdodC1lZGdlLmNvbQ==","bmF2LWIuc2ctbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2ctbGlnaHQtZWRnZS5jb20=",protocol:x.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWxpZ2h0LWVkZ2UuY29t","d3MtYi5zZy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWItMi5zMy5hcC1zb3V0aGVhc3QtMS5hbWF6b25hd3MuY29t"],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIuc2ctbGlnaHQtZWRnZS5jb20="]},en[exports.AreaCode.NA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi51cy1saWdodC1lZGdlLmNvbQ==","bmF2LWIudXMtbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24udXMtbGlnaHQtZWRnZS5jb20=",protocol:x.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnVzLWxpZ2h0LWVkZ2UuY29t","d3MtYi51cy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC51cy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIudXMtbGlnaHQtZWRnZS5jb20="]},en[exports.AreaCode.SG_B]={naviUrlBase64:["bmF2LnNnLWItbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zZy1iLWxpZ2h0LWVkZ2UuY29t",protocol:x.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWItbGlnaHQtZWRnZS5jb20=","d3MtYi5zZy1iLWxpZ2h0LWVkZ2UuY29t"],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1iLWxpZ2h0LWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="]},en[exports.AreaCode.SA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zYXUtbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2F1LWxpZ2h0LWVkZ2UuY29t",protocol:x.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNhdS1saWdodC1lZGdlLmNvbQ==","d3MtYi5zYXUtbGlnaHQtZWRnZS5jb20="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zYXUtbGlnaHQtZWRnZS5jb20=","Y2xvdWRjb250cm9sLWIuc2F1LWxpZ2h0LWVkZ2UuY29t"]},en);function sn(e){return exports.AreaCode[e]?e:exports.AreaCode.BJ}var an,un=function(){function e(){this.initOption={}}return e.prototype.init=function(e){this.initOption=e},e.prototype.getNaviUrlList=function(e,t){var n,r=this.initOption||{},o=r.areaCode,i=r.navigators,s=(n=o,void 0===n&&(n=exports.AreaCode.BJ),on[sn(n)].naviUrlBase64).map((function(e){return ct(e)})),a=[],u=de(e.split("@"),2)[1];t&&(a=u?u.split(";"):[]);var c=i&&i.length>0?pe(pe([],de(a),!1),de(i),!1):pe(pe([],de(a),!1),de(s),!1);return c.filter((function(e,t){return c.indexOf(e)===t})).map((function(e){return Xt(e)}))},e.prototype.getLogUrlPolicyList=function(e,t){var n,r=e||{},o=r.log,i=r.logPolicy,s=this.initOption||{},a=s.areaCode,u=s.logServerUrl,c=(n=a,void 0===n&&(n=exports.AreaCode.BJ),on[sn(n)].logUrlBase64).map((function(e){return se(se({},e),{addr:ct(e.addr)})})),l=[],d={level:1,itv:6,times:5};if(o)l.push.apply(l,pe([],de(o.addrs),!1)),Object.assign(d,o.policy);else if(i)try{var p=JSON.parse(i);l.push({addr:p.url,protocol:x.HTTPS,weight:1}),d.level=p.level,d.itv=p.itv,d.times=p.times}catch(n){t.warn(exports.LogTagId.L_REPORT_LOG_POLICY_E,JSON.stringify({policy:e.logPolicy}))}var h=u?pe([{addr:u,protocol:x.HTTPS,weight:101}],de(l),!1):pe(pe([],de(l),!1),de(c),!1);return{policy:d,addrs:h.filter((function(e,t){return h.findIndex((function(t){return t.addr===e.addr&&t.protocol===e.protocol}))===t})).map((function(e){return se(se({},e),{addr:Xt(e.addr,e.protocol)})})).sort((function(e,t){return t.weight-e.weight}))}},e.prototype.getMiniCmpUrlList=function(){var e,t,n=(t=null===(e=this.initOption)||void 0===e?void 0:e.areaCode,void 0===t&&(t=exports.AreaCode.BJ),on[sn(t)].miniCmpBase64).map((function(e){return ct(e)})),r=(this.initOption||{}).miniCMPProxy;return r&&r.length>0?r:n},e.prototype.getStaticConfigUrl=function(){var e,t;return(t=null===(e=this.initOption)||void 0===e?void 0:e.areaCode,void 0===t&&(t=exports.AreaCode.BJ),on[sn(t)].staticConfigUrlBase64).map((function(e){return ct(e)}))},e.prototype.getCloudControllerUrl=function(e){var t,n,r=null!=e?e:null===(t=this.initOption)||void 0===t?void 0:t.areaCode;return(n=r,void 0===n&&(n=exports.AreaCode.BJ),on[sn(n)].cloudControllerUrlBase64).map((function(e){return ct(e)}))},e.prototype.getAreaCode=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},e.prototype.setAreaCode=function(e){return!(!e||!exports.AreaCode[e]||e===this.initOption.areaCode)&&(this.initOption.areaCode=e,!0)},e}(),cn=new un,ln=function(){function e(e,t){this.appkey=e,this.logger=t,this.staticUrls=[]}return e.prototype.getStaticConfig=function(){var e;return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a,u;return ce(this,(function(c){switch(c.label){case 0:if(!(t=this.getCache()))return[3,6];c.label=1;case 1:return c.trys.push([1,4,,5]),n=JSON.parse(t),Date.now()-(null==n?void 0:n.time)<18e5?[4,this.decryptData(n.val)]:[3,3];case 2:return r=c.sent(),(o=r.resources.navi.slice()).sort((function(e,t){return t.weight-e.weight})),[2,{navi:o.map((function(e){return Xt(e.addr,e.protocol)}))||[]}];case 3:return[3,5];case 4:return i=c.sent(),this.logger.error(exports.LogTagId.L_GET_STATIC_CONF_E,JSON.stringify({error:null==i?void 0:i.stack})),[3,5];case 5:this.clearCache(),c.label=6;case 6:return[4,this._requestHandle()];case 7:return(s=c.sent())?[4,this.decryptData(s)]:[2];case 8:return(null==(a=c.sent())?void 0:a.areaCode)!==cn.getAreaCode()?[2]:(this.setCache(JSON.stringify({time:Date.now(),val:s})),this.staticUrls=(null==a?void 0:a.bootstrap)||[],(u=null===(e=null==a?void 0:a.resources)||void 0===e?void 0:e.navi.slice()).sort((function(e,t){return t.weight-e.weight})),[2,{navi:u.map((function(e){return Xt(e.addr,e.protocol)}))||[]}])}}))}))},e.prototype._requestHandle=function(){return ue(this,void 0,void 0,(function(){var e,t,n,r,o,i,s,a,u,c,l;return ce(this,(function(d){switch(d.label){case 0:e=(e=pe(pe([],de(this.staticUrls),!1),de(cn.getStaticConfigUrl()),!1).map((function(e){return Xt(e)}))).filter((function(t,n){return e.indexOf(t)===n})),d.label=1;case 1:d.trys.push([1,6,7,8]),t=le(e),n=t.next(),d.label=2;case 2:return n.done?[3,5]:(r=n.value,this.logger.info(exports.LogTagId.L_GET_STATIC_CONF_T,JSON.stringify({url:r})),o=Date.now(),[4,this.sendRequest("".concat(r,"/").concat(this.appkey))]);case 3:if(i=d.sent(),s=i.code,a=i.data,200===s)return this.logger.info(exports.LogTagId.L_GET_STATIC_CONF_R,JSON.stringify({url:r,code:s,duration:Date.now()-o})),[2,a];this.logger.warn(exports.LogTagId.L_GET_STATIC_CONF_R,JSON.stringify({url:r,code:s,duration:Date.now()-o})),d.label=4;case 4:return n=t.next(),[3,2];case 5:return[3,8];case 6:return u=d.sent(),c={error:u},[3,8];case 7:try{n&&!n.done&&(l=t.return)&&l.call(t)}finally{if(c)throw c.error}return[7];case 8:return[2]}}))}))},e}();exports.LogL=void 0,(an=exports.LogL||(exports.LogL={}))[an.STATISTICS=-2]="STATISTICS",an[an.RECORD=-1]="RECORD",an[an.FATAL=0]="FATAL",an[an.ERROR=1]="ERROR",an[an.WARN=2]="WARN",an[an.INFO=3]="INFO",an[an.DEBUG=4]="DEBUG";var dn,pn=function(){function e(e,t,n){this._appkey=e,this._id=t,this._type=n,this.outputLevel=exports.LogL.WARN,this.debug=this._log.bind(this,exports.LogL.DEBUG),this.info=this._log.bind(this,exports.LogL.INFO),this.warn=this._log.bind(this,exports.LogL.WARN),this.error=this._log.bind(this,exports.LogL.ERROR),this.__statistics=this._log.bind(this,exports.LogL.STATISTICS),this.record=this.__statistics}return e.prototype._write=function(e){var t=e.tag,n=e.level,r=e.content,o=e.traceId;/^[\w-]+$/.test(t)?n!==exports.LogL.DEBUG&&this._handleWrite(e):console.error("".concat((new Date).toISOString(),"[").concat(this._id,"]['ERROR']: ").concat(t," | ").concat(r," | ").concat(o))},e.prototype.createTraceId=function(){return"".concat(++e._traceIdCount)},e.prototype.getSessionId=function(){return Xe},e.prototype._stdout=function(e){var t=e.time,n=e.tag,r=e.content,o=e.traceId,i=e.level,s=e.loggerId;if(console&&!(i<=exports.LogL.FATAL||i>this.outputLevel)){var a=["error","warn","info","debug"][i-1],u="".concat(new Date(t).toISOString(),"[").concat(null!=s?s:this._id,"][").concat((a||"stat").toUpperCase(),"]: ").concat(n," | ").concat(r," | ").concat(o);console[a||"warn"](u)}},e.prototype.setOutputLevel=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)},e.prototype._log=function(e,t,n,r){var o={time:Date.now(),level:e,tag:t,content:n,traceId:r,loggerId:this._id,sessionId:this.getSessionId(),type:this._type};this._stdout(o),this._write(o)},e.prototype.summary=function(e,t,n,r,o,i){var s,a;void 0===r&&(r={}),t.isOk?this.info(e,null!==(s=null==o?void 0:o())&&void 0!==s?s:JSON.stringify(se({isOk:!0},r)),n):this.warn(e,null!==(a=null==i?void 0:i())&&void 0!==a?a:JSON.stringify(se({code:t.code,msg:t.msg},r)),n)},e._traceIdCount=0,e}(),hn=function(){function e(e,t,n,r,o,i){void 0===i&&(i=!1),this.appkey=e,this.deviceId=t,this.deviceInfo=n,this.logDB=r,this.logger=o,this.disableLogReport=i,this.userId="",this.timer=null,this.started=!1,this.reportFailedNumber=0,this.itvByNavi=6,this.timesByNavi=5}return e.prototype.checkStart=function(e,t){return ue(this,void 0,void 0,(function(){var n,r,o;return ce(this,(function(i){return this.started?[2]:(this.userId=e.userId,!e.logSwitch||this.disableLogReport||(n=cn.getLogUrlPolicyList(e,this.logger),r=n.policy,o=n.addrs,this.started=!0,this.itvByNavi=r.itv,this.timesByNavi=r.times,o.length>0&&this.realtimeReport(o[0].addr,r.level,r.itv,t)),[2])}))}))},e.prototype._sendLogs2Realtime=function(e,t,n,r){return ue(this,void 0,void 0,(function(){var o,i,s,a,u,c,l,d,p,h;return ce(this,(function(_){switch(_.label){case 0:return this.logger.debug(exports.LogTagId.L_REALTIME_LOG_O,"compress logs: ".concat(e.length)),[4,this.compressLogs(e)];case 1:return o=_.sent(),i=o.success,s=o.data,i?(this.logger.debug(exports.LogTagId.L_REALTIME_LOG_O,"compress done",t),a=It(n)?n:"https://".concat(n),a+="?version=".concat("5.20.0-c-esm-alpha.1","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.deviceId,"&deviceInfo=").concat(this.deviceInfo,"&platform=Web"),[4,this.send({url:a,body:s,method:"POST"})]):(this.logger.warn(exports.LogTagId.L_REALTIME_LOG_R,"compress failed",t),[2,{isOk:!1,itv:r}]);case 2:if(u=_.sent(),c=u.status,l=u.data,this.logger.debug(exports.LogTagId.L_REALTIME_LOG_R,JSON.stringify({status:c,data:l}),t),200!==c)return this.reportFailedNumber>this.timesByNavi&&this.itvByNavi<60&&(r+=r),this.reportFailedNumber++,[2,{isOk:!1,itv:r}];if(this.reportFailedNumber=0,l)try{(h=JSON.parse(l)).nextTime&&(r=h.nextTime),d=h.level,p=h.logSwitch}catch(e){this.logger.warn(exports.LogTagId.L_PARSE_JSON_E,JSON.stringify({error:null==e?void 0:e.stack}),t)}return[2,{isOk:!0,itv:r,level:d,logSwitch:p}]}}))}))},e.prototype.realtimeReport=function(e,t,n,r){return ue(this,void 0,void 0,(function(){var o,i,s,a,u,c,l,d,p,h,_,g,f=this;return ce(this,(function(E){switch(E.label){case 0:return o=Date.now(),i=this.logDB.getTimestamp4RealtimeLog()||$e,s=Math.max(o-3e4,i+1),a=this.logger.createTraceId(),this.logger.debug(exports.LogTagId.L_REALTIME_LOG_T,JSON.stringify({startTime:i,endTime:s,level:t,itv:n}),a),[4,this.logDB.getLogs(i,s,t,!0,r)];case 1:return u=E.sent(),c=u.dbReady,l=u.logs,c?[3,2]:(this.logger.warn(exports.LogTagId.L_REALTIME_LOG_R,"get logs failed",a),[3,5]);case 2:return 0!==l.length?[3,3]:(this.logger.debug(exports.LogTagId.L_REALTIME_LOG_R,"no logs",a),[3,5]);case 3:return l.length>0?[4,this._sendLogs2Realtime(l,a,e,n)]:[3,5];case 4:d=E.sent(),p=d.itv,h=d.level,_=d.logSwitch,d.isOk&&(g=Math.max.apply(Math,pe([],de(l.map((function(e){return e.time}))),!1)),this.logDB.setTimestamp4RealtimeLog(g+1),0===_&&(this.started=!1),void 0!==h&&(t=h)),n=p,E.label=5;case 5:return this.started&&(n>=60&&this.itvByNavi<60&&(n=60),this.timer=setTimeout((function(){return f.realtimeReport(e,t,n,r)}),1e3*n)),[2]}}))}))},e.prototype.report=function(e,t,n,r,o,i,s){return void 0===s&&(s=!1),ue(this,void 0,void 0,(function(){var a,u,c,l,d,p,h,_,g,f;return ce(this,(function(E){switch(E.label){case 0:return"web"!==n.toLowerCase()||this.disableLogReport?[2]:(a=this.logger.createTraceId(),this.logger.info(exports.LogTagId.L_REPORT_FULL_LOG_T,JSON.stringify({startTime:e,endTime:t,logId:o,messageUId:i,isCloudControl:s}),a),[4,this.logDB.getLogs(e,t,exports.LogL.DEBUG,!1)]);case 1:return u=E.sent(),c=u.dbReady,l=u.logs,this.logger.info(exports.LogTagId.L_REPORT_FULL_LOG_O,JSON.stringify({count:l.length}),a),d=It(r)?r:"https://".concat(r),d+="?version=".concat("5.20.0-c-esm-alpha.1","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.deviceId,"&deviceInfo=").concat(this.deviceInfo,"&platform=Web&logId=").concat(o),c?l.length>0?[4,this.compressLogs(l)]:[3,3]:[3,5];case 2:return h=E.sent(),_=h.success,g=h.data,p=_?g:"compress failed",[3,4];case 3:p="no data",E.label=4;case 4:return[3,6];case 5:p="no database",E.label=6;case 6:return this.logger.debug(exports.LogTagId.L_REPORT_FULL_LOG_O,"compress done",a),s&&(d+="&source=cloud"),[4,this.send({url:d,body:p,method:"POST"})];case 7:return f=E.sent().status,this.logger.info(exports.LogTagId.L_REPORT_FULL_LOG_R,JSON.stringify({status:f}),a),[2]}}))}))},e.prototype.stop=function(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.started=!1},e}(),_n=function(e){var t=e.sessionId,n=e.level,r=e.loggerId,o=e.traceId,i=e.time,s=e.tag,a=e.type,u=e.content;lt(u)||(u=JSON.stringify(u));var c=n<0?u||"":JSON.stringify({content:u,traceId:o,from:r});return c='"'.concat(c.replace(/"/g,'""'),'"'),"".concat(t,",").concat(i,",").concat(a,",").concat(n,",").concat(s,",").concat(c,"\n")};!function(e){e[e.init=1]="init",e[e.newWorkChange=2]="newWorkChange",e[e.other=3]="other"}(dn||(dn={}));var gn=function(){function e(e){this.reporter=e,this.logId="",this.uploadTask=[],this.taskLock=!0}return e.prototype.uploadLogCmdTask=function(e){this.uploadTask.push(e),this.enqueueTask()},e.prototype.reportLogCmdTask=function(e){var t,n,r,o,i=this;this.taskLock=!1;var s=null!==(t=e.startTime)&&void 0!==t?t:0,a=null!==(n=e.endTime)&&void 0!==n?n:0,u=null!==(r=e.platform)&&void 0!==r?r:"",c=null!==(o=e.uri)&&void 0!==o?o:"";e.logId!==this.logId&&""!==c&&(this.logId=e.logId,this.reporter.report(s,a,u,c,e.logId,"",!0).finally((function(){i.taskLock=!0,i.uploadTask.length>0&&i.enqueueTask()})))},e.prototype.enqueueTask=function(){if(this.taskLock){var e=this.uploadTask.shift();e&&this.reportLogCmdTask(e)}},e}();var fn,En,In,Tn,Cn=function(){function e(e,t,n){this.logger=e,this.appkey=t,this.reporter=n,this.isEable=!0,this.expire=0,this.interval=0,this.timestamp=0,this.lastRequestTime=0,this.changeAreaCode=0,this._cache=null,this.uploadTaskManage=new gn(n)}return e.prototype.init=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)))},e.prototype.isExire=function(){return(new Date).getTime()-this.timestamp<this.expire},e.prototype.isOverclock=function(){return(new Date).getTime()-this.lastRequestTime<this.interval},e.prototype.logCmdMsgTasks=function(e){var t=this;e.uploadLog&&e.uploadLog.tasks.forEach((function(e){e.objectName===exports.MessageType.LOG_COMMAND&&t.uploadTaskManage.uploadLogCmdTask(e)}))},e.prototype.dataHandle=function(e){var t=this._cache;t.lastRequestTime=this.lastRequestTime,Tt(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)},e.prototype.request=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o,i,s,a,u,c,l,d,p;return ce(this,(function(h){switch(h.label){case 0:return!this.isEable&&t===dn.init&&this.isExire()?(this.logger.info(exports.LogTagId.L_CLOUD_DISABLED,JSON.stringify({msg:"cloud controller is disabled"})),[2,this.timestamp]):!this.isEable&&t===dn.newWorkChange&&this.isOverclock()?(this.logger.info(exports.LogTagId.L_CLOUD_OVERCLOCK,JSON.stringify({msg:"cloud controller is overclock"})),[2,this.timestamp]):(r=Xt(e),this.lastRequestTime=(new Date).getTime(),o="".concat(r,"/v1/config"),i={"Content-Type":"application/json","RC-App-Key":this.appkey},n&&(i["RC-Token"]=n),s={platform:"web",version:"5.20.0-c-esm-alpha.1",timestamp:this.timestamp},this.logger.record(re.L_CLOUD_INFO_FETCH_T,JSON.stringify({appKey:this.appkey,timestamp:this.timestamp,token:!!n,uri:o})),[4,this.httpRequest(o,exports.HttpMethod.POST,i,s)]);case 1:return a=h.sent(),u=a.code,c=a.data,this.logger.record(re.L_CLOUD_INFO_FETCH_R,JSON.stringify({appkey:this.appkey,info:c})),u===exports.ErrorCode.CLOUD_DATA_CENTER_INVALID&&c&&c.targetRegion?(l=c.targetRegion,this.changeAreaCode===l?[2,this.timestamp]:(d=cn.setAreaCode(l),this.logger.info(exports.LogTagId.L_CLOUD_SET_AREA_CODE_O,JSON.stringify({isChangeSuccess:d,originAreaCode:cn.getAreaCode(),newAreaCode:l})),this.changeAreaCode=l,(p=cn.getCloudControllerUrl(l))[0]?[2,this.request(p[0],dn.other)]:(this.logger.info(exports.LogTagId.L_CLOUD_APPKEY_REGION_E,JSON.stringify({appkey:this.appkey,uri:o,msg:"appkey region error"})),[2,this.timestamp]))):(c&&this.dataHandle(c),[2,this.timestamp||this.lastRequestTime])}}))}))},e.prototype._handleMrtrData=function(e){return{chatroom:(null==e?void 0:e.chatroom)||0,group:(null==e?void 0:e.group)||0,private:(null==e?void 0:e.private)||0,ultraGroup:(null==e?void 0:e.ultraGroup)||0,temporary:!!(null==e?void 0:e.temporary)}},e}(),vn=function(e){return e===exports.ErrorCode.RC_CONN_REDIRECTED},Rn=function(e){function n(t,n,r){var o=e.call(this)||this;return o.appkey=t,o.navi=n,o.logger=r,fn.add(o),o.token="",o.curCmpUrl="",o.retryCount=0,o.uuid="",Tn.set(o,0),o._doConnectReason=0,o._network={status:!0,type:me.UNKONWN},o._checkAliveTimer=null,o._crtConnectionStatus=exports.RCConnectionStatus.DISCONNECTED,o._crtUserId="",o._openCallPlus=!1,o._crtConnectionTask=null,o.reconnectTimer=null,o._failedCount=0,o.ALLOW_FAILED_TIMES=2,o}return t(n,e),n.prototype.getToken=function(){return this.token},Object.defineProperty(n.prototype,"cid",{get:function(){return"".concat(this.uuid,"_").concat(this.retryCount)},enumerable:!1,configurable:!0}),n.prototype.getCurrentUserId=function(){return this._crtUserId},n.prototype.setConnectionStatus=function(e,t){if(this._crtConnectionStatus!==e){if(this._crtConnectionStatus===exports.RCConnectionStatus.DISCONNECTED&&e===exports.RCConnectionStatus.CONNECTING&&(this._doConnectReason=ve.CONNECT,he(this,fn,"m",In).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){var n={bid:zt(),cod:t,net:this.getNetwork().type,dur:Date.now()-he(this,Tn,"f"),cid:this.cid};this.logger.record(re.IM_CONNECTION_DURATION,JSON.stringify(n)),e===exports.RCConnectionStatus.SUSPENDED&&he(this,fn,"m",In).call(this)}switch(this._crtConnectionStatus=e,e){case exports.RCConnectionStatus.CONNECTED:this.logger.info(exports.LogTagId.L_CONNECT_S,"status: ".concat(e)),this.checkAlive(),he(this,fn,"m",En).call(this).emit("onConnected");break;case exports.RCConnectionStatus.CONNECTING:this.logger.warn(exports.LogTagId.L_CONNECT_S,"status: ".concat(e)),he(this,fn,"m",En).call(this).emit("onConnecting");break;case exports.RCConnectionStatus.SUSPENDED:this.logger.warn(exports.LogTagId.L_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),vn(t)&&this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),he(this,fn,"m",En).call(this).emit("onSuspend",t);break;default:this.logger.warn(exports.LogTagId.L_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),he(this,fn,"m",En).call(this).emit("onDisconnected",t)}}},n.prototype.getConnectionStatus=function(){return this._crtConnectionStatus},n.prototype.setNetwork=function(e,t){if(!t){var n={cid:this.cid,cn:e.type,on:this._network.type};this.logger.record(re.IM_NETWORK_CHANGE,JSON.stringify(n))}this._network=e},n.prototype.getNetwork=function(){return this._network},n.prototype.connect=function(e,t,n,r){return ue(this,void 0,void 0,(function(){var o,i,s;return ce(this,(function(a){switch(a.label){case 0:return this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTED?[2,it(this._crtUserId)]:this._crtConnectionTask?[2,this._crtConnectionTask]:(this._openCallPlus=n,this.token=e,this.setConnectionStatus(exports.RCConnectionStatus.CONNECTING),[4,this.try2Connect(e,t,!1,r,!0)]);case 1:return o=a.sent(),i=o.code,s=o.data,i!==exports.ErrorCode.SUCCESS?(this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,i),[2,st(i)]):(this.setConnectionStatus(exports.RCConnectionStatus.CONNECTED),[2,it(s)])}}))}))},n.prototype.try2Connect=function(e,t,n,r,o){return ue(this,void 0,void 0,(function(){var i;return ce(this,(function(s){switch(s.label){case 0:return this._crtConnectionTask?[2,this._crtConnectionTask]:(this._crtConnectionTask=this.createConnectionTask(e,t,n,r,o),[4,this._crtConnectionTask]);case 1:return i=s.sent(),this._crtConnectionTask=null,[2,i]}}))}))},n.prototype.createConnectionTask=function(e,t,n,r,o){return ue(this,void 0,void 0,(function(){var i,s,a,u,c,l,d,p,h,_;return ce(this,(function(g){switch(g.label){case 0:return i={cid:this.cid,reason:this._doConnectReason,net:this.getNetwork().type,spr:0,sts:Date.now(),timelimit:0},this.logger.record(re.IM_STATS_CS,JSON.stringify(i)),s={retryCount:this.retryCount,uuid:this.uuid,type:this.getNetwork().type,reason:this._doConnectReason},[4,this.navi.request(e,n,!1,r,s)];case 1:return a=g.sent(),u=a.code,c=a.data,u!==exports.ErrorCode.SUCCESS?[2,st(u)]:1===(l=c).type?[2,st(exports.ErrorCode.PACKAGE_ENVIRONMENT_ERROR)]:(this.logger.info(exports.LogTagId.L_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),r),[4,this.connectWithToken(e.replace(/@.+$/,"@"),l,t,r)]);case 2:return d=g.sent(),p=d.code,h=d.data,o||p===exports.ErrorCode.SUCCESS||(this.retryCount+=1),vn(p)?(this.logger.warn(exports.LogTagId.L_CONNECT_R,"redirect code: ".concat(p),r),this.clearCmpWeightCache(),[2,this.createConnectionTask(e,t,!0,r,o)]):[exports.ErrorCode.RC_TCP_RESET,exports.ErrorCode.RC_CONN_ACK_TIMEOUT,exports.ErrorCode.RC_TCP_DISCONNECTED_NO_RMTP].includes(p)&&this.cmpWeightCache&&this.cmpWeightCache.length>1?(this.updateCmpWeight(this.curCmpUrl,!1),_=this.cmpWeightCache.every((function(e){return e.failed})),o&&_?(this.logger.warn(exports.LogTagId.L_CONNECT_R,"cpp code:".concat(p,",reture code:").concat(exports.ErrorCode.SERVER_UNAVAILABLE),r),[2,st(exports.ErrorCode.SERVER_UNAVAILABLE)]):(this.logger.warn(exports.LogTagId.L_CONNECT_R,"cmp ack timeout, code: ".concat(p),r),this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,p),this.setConnectionStatus(exports.RCConnectionStatus.CONNECTING),[2,this.createConnectionTask(e,t,!1,r,o)])):p!==exports.ErrorCode.SUCCESS?(this.logger.warn(exports.LogTagId.L_CONNECT_R,"code: ".concat(p),r),[2,st(p)]):(this.logger.info(exports.LogTagId.L_CONNECT_R,"userId: ".concat(h),r),_e(this,Tn,Date.now(),"f"),this._crtUserId=h,[2,it(h)])}}))}))},n.prototype.try2Reconnect=function(e,t){return ue(this,void 0,void 0,(function(){var n,r,o=this;return ce(this,(function(i){return n=this.logger.createTraceId(),this.logger.debug(exports.LogTagId.T,"try2Reconnect -> ignoreNaviCache: ".concat(e,", reason: ").concat(t),n),this.stopReconnectTimer(),r=function(){return ue(o,void 0,void 0,(function(){var o;return ce(this,(function(i){switch(i.label){case 0:return this._crtConnectionStatus!==exports.RCConnectionStatus.SUSPENDED?[2]:(this.setConnectionStatus(exports.RCConnectionStatus.CONNECTING,t),[4,this.try2Connect(this.token,!0,e,n,!1)]);case 1:return o=i.sent().code,this.reconnectTimer=null,o===exports.ErrorCode.SUCCESS?(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(r,5e3)),[2]):(this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,o),[2])}}))}))},r(),[2]}))}))},n.prototype.onDisconnectByServer=function(e,t){var n=this;return vn(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(){n.try2Reconnect(!0,e)}),1e3*(t||0))):void this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,e)},n.prototype.onDisconenctUnusual=function(e){this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,e),this.try2Reconnect(!1,e)},n.prototype.checkAlive=function(){return ue(this,void 0,void 0,(function(){var e,t,n=this;return ce(this,(function(r){switch(r.label){case 0:return this._crtConnectionStatus!==exports.RCConnectionStatus.CONNECTED?(this._failedCount=0,this.logger.debug(exports.LogTagId.L_CHECK_ALIVE_IM_S,"stop ping because of no connection"),[2]):(e=this.logger.createTraceId(),this.logger.debug(exports.LogTagId.L_CHECK_ALIVE_IM_T,null,e),[4,this.sendPing(15e3)]);case 1:return(t=r.sent())===exports.ErrorCode.SUCCESS?(this.logger.debug(exports.LogTagId.L_CHECK_ALIVE_IM_R,t,e),this._failedCount=0,this._checkAliveTimer=setTimeout((function(){return n.checkAlive()}),15e3),[2]):this._crtConnectionStatus!==exports.RCConnectionStatus.CONNECTED?[2]:(this._failedCount+=1,this.logger.debug(exports.LogTagId.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(exports.LogTagId.L_CHECK_ALIVE_IM_S,"ping timeout, close connection to reconnect!"),this.close(!0,!1),this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,exports.ErrorCode.RC_PING_EXCEED_LIMIT),this.try2Reconnect(!1,exports.ErrorCode.RC_PING_EXCEED_LIMIT),[2]))}}))}))},n.prototype.disconnect=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){switch(t.label){case 0:return this.stopReconnectTimer(),this._crtConnectionTask?[4,this._crtConnectionTask]:[3,2];case 1:t.sent(),t.label=2;case 2:return this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,exports.ErrorCode.ACTIVE_DISCONNECT),this.close(!1,e),[2]}}))}))},n.prototype.stopReconnectTimer=function(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)},n.prototype.getCmpList=function(e,t){if(this.cmpWeightCache&&this.cmpWeightCache.length>0)return pe([],de(this.cmpWeightCache),!1);var n=xt(e,t);return this.cmpWeightCache=pe([],de(n),!1),pe([],de(n),!1)},n.prototype.updateCmpWeight=function(e,t,n){if(this.cmpWeightCache){var r=this.cmpWeightCache.find((function(t){return n?t.addr===e&&t.protocol===x.QUIC:t.addr===e}));if(r)if(t){var o=Math.max.apply(Math,pe([],de(this.cmpWeightCache.map((function(e){return e.weight}))),!1));r.weight!==o&&(r.weight=o+1)}else{var i=Math.min.apply(Math,pe([],de(this.cmpWeightCache.map((function(e){return e.weight}))),!1));r.weight!==i&&(r.weight=i-1),r.failed=!0}}},n.prototype.clearCmpWeightCache=function(){this.cmpWeightCache=void 0},n.prototype.reconnect=function(e,t,n,r){this.token=e,this._openCallPlus=n,this.onDisconenctUnusual(r)},n}(nt);Tn=new WeakMap,fn=new WeakSet,En=function(){return this},In=function(){this.uuid=Ze.gen(),this.retryCount=0};var yn,mn,Sn,An=function(e){return e.replace(/@.+$/,"@")},Nn=function(){function e(e,t,n,r,o){void 0===r&&(r=!0),void 0===o&&(o=!0),this.appkey=e,this.logger=t,this.staticConfigManager=n,this.isRequestProfile=r,this.isUseDynamicNaviUrl=o,this.crtRequest=null,this._environment="default"}return e.prototype.getCatchKey=function(e){return e+(this._environment?"-".concat(this._environment):"")},e.prototype.request=function(e,t,n,r,o){return ue(this,void 0,void 0,(function(){var i;return ce(this,(function(s){switch(s.label){case 0:return this.crtRequest?[2,this.crtRequest]:(this.crtRequest=this.sendRequest(e,t,n,r,o),[4,this.crtRequest]);case 1:return i=s.sent(),this.crtRequest=null,[2,i]}}))}))},e.prototype.sendRequest=function(e,t,n,r,o){var i;return ue(this,void 0,void 0,(function(){var s,a,u,c,l,d,p,h,_,g,f,E,I,T,C,v,R;return ce(this,(function(y){switch(y.label){case 0:return s=An(e),a=this.getNaviCache(s),!t&&a&&(u=a.timestamp,c=a.naviInfo,n||Date.now()-u<Oe)?(this.logger.info(exports.LogTagId.L_REQUEST_T,JSON.stringify({fromCache:!0,naviInfo:c}),r),o&&(l=o.uuid,d=o.retryCount,p=o.reason,h={bid:zt(),ptc:Ee.NAVI,cod:exports.ErrorCode.SUCCESS,net:o.type,dur:0,spr:0,pr:null!==(i=c.type)&&void 0!==i?i:0,hos:"",cache:Ie.LOCAL,v:Te.CURRENT,rsn:p,cid:"".concat(l,"_").concat(d),count:d},this.logger.record(re.IM_NAVI,JSON.stringify(h),r)),[2,it(c)]):(_=cn.getNaviUrlList(e,this.isUseDynamicNaviUrl),this.logger.info(exports.LogTagId.L_GET_NAVI_T,JSON.stringify({token:e,uris:_}),r),[4,this.requestHandler(_,e,r,o)]);case 1:return g=y.sent(),f=g.code,E=g.data,f===exports.ErrorCode.RC_NAVI_REQ_FAILED&&this.isRequestProfile?[4,this.staticConfigManager.getStaticConfig()]:[3,4];case 2:return(null==(I=y.sent())?void 0:I.navi)&&(null==I?void 0:I.navi.length)>0?(T=I.navi,[4,this.requestHandler(T,e,r,o)]):[3,4];case 3:C=y.sent(),f=C.code,E=C.data,y.label=4;case 4:return f!==exports.ErrorCode.SUCCESS?(this.logger.warn(exports.LogTagId.L_GET_NAVI_R,f,r),[2,st(f)]):(v=E).code&&200!==v.code?(this.logger.warn(exports.LogTagId.L_GET_NAVI_R,v.code,r),[2,st(this.transHttpCode(v.code))]):xt(v).length>0?(this.logger.info(exports.LogTagId.L_GET_NAVI_R,JSON.stringify({naviInfo:v}),r),this.setNaviCache(s,v),[2,it(v)]):(R={server:v.server,backupServer:v.backupServer,serverAddr:v.serverAddr,bs:v.bs},this.logger.warn(exports.LogTagId.L_GET_NAVI_R,"navi server address invalid: ".concat(JSON.stringify(R)),r),[2,st(exports.ErrorCode.SERVER_UNAVAILABLE)])}}))}))},e.prototype.requestHandler=function(e,t,n,r){return ue(this,void 0,void 0,(function(){var o,i,s,a,u,c,l,d,p;return ce(this,(function(h){switch(h.label){case 0:o=0,i=e.length,h.label=1;case 1:return o<i?(s=o===e.length-1,a=this.useV2Navi()?this.httpRequestV2:this.httpRequest,u=Date.now(),[4,a.call(this,e[o],this.appkey,t,n,s)]):[3,4];case 2:if(c=h.sent(),l=c.code,d=c.data,p={bid:zt(),ptc:Ee.NAVI,cod:l,net:null==r?void 0:r.type,dur:Date.now()-u,spr:0,pr:(null==d?void 0:d.type)||0,hos:e[o],cache:Ie.REQUEST,v:Te.CURRENT,rsn:null==r?void 0:r.reason,cid:"".concat(null==r?void 0:r.uuid,"_").concat(null==r?void 0:r.retryCount),count:null==r?void 0:r.retryCount},this.logger.record(re.IM_NAVI,JSON.stringify(p),n),[exports.ErrorCode.SUCCESS,exports.ErrorCode.RC_CONN_TOKEN_INCORRECT,exports.ErrorCode.RC_LICENSE_EXPIRED].includes(l))return[2,l===exports.ErrorCode.SUCCESS?it(d):st(l)];h.label=3;case 3:return o+=1,[3,1];case 4:return[2,st(exports.ErrorCode.RC_NAVI_REQ_FAILED)]}}))}))},e.prototype.transHttpCode=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}},e.prototype.getNaviInfoFromCache=function(e){var t=this.getNaviCache(An(e));return t?t.naviInfo:null},e.prototype.updateVoipCallInfo=function(e,t){var n=this.getNaviInfoFromCache(e);n&&this.setNaviCache(An(e),se(se({},n),{voipCallInfo:t}))},e.prototype.getNaviV2RequestOption=function(e){var t,n=e.uri,r=e.token,o=e.platform,i=e.protocol,s=e.mac;t="".concat(n,"/v2/navi.json?cloud=").concat(0);var a="token=".concat(encodeURIComponent(r),"&version=").concat("5.20.0-c-esm-alpha.1","&platfrom=").concat(o);return s&&(a+="&m=".concat(s)),{method:"POST",headers:{"RC-Appkey":this.appkey,"Content-Type":"Application/x-www-form-urlencoded","RC-Negotiate":"conn=".concat(i,";rtc=4;log=2;iptype=v4,v6")},body:a,url:t,timeout:1e4}},e.prototype.useV2Navi=function(){return!0},e}(),On=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],n=0,r=t.length;n<r;n++)if(!e[t[n]])return!1;return!0}(uni))},Mn=function(){function e(e){yn.add(this),mn.set(this,void 0),_e(this,mn,e,"f"),this._logger=e.logger}return e.prototype.open=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return e=e.sort((function(e,t){return t.weight-e.weight})),[2,he(this,yn,"m",Sn).call(this,e,he(this,mn,"f"))]}))}))},e}();mn=new WeakMap,yn=new WeakSet,Sn=function e(t,n){return ue(this,void 0,void 0,(function(){var r,o,i,s=this;return ce(this,(function(a){switch(a.label){case 0:return 0===t.length?[2,st(exports.ErrorCode.STREAM_MESSAGE_REQUEST_FAIL,"All addrs failed")]:(r=t.shift(),o=Xt(r.addr,r.protocol),o="".concat(o,"/v3/message/get_stream.json?sdkVersion=").concat("5.20.0-c-esm-alpha.1","&platform=").concat(this._platform,"&messageUID=").concat(n.msgUId),[4,this._openHandler(o,n)]);case 1:return[2,(i=a.sent()).or((function(r){return ue(s,void 0,void 0,(function(){return ce(this,(function(o){return-1===r?[2,he(this,yn,"m",e).call(this,t,n)]:[2,i]}))}))}))]}}))}))};var Ln=On();var Un=null,bn=function(e){return ue(void 0,void 0,void 0,(function(){var t;return ce(this,(function(n){switch(n.label){case 0:return[4,wn.getNetworkType()];case 1:return t=n.sent(),Un({status:"online"===e.type,type:t}),[2]}}))}))};var Pn=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t._platform="Websocket",t}return t(n,e),n.prototype._openHandler=function(e,t){return ue(this,void 0,void 0,(function(){var n=this;return ce(this,(function(r){return[2,new Promise((function(r){n._logger.debug(exports.LogTagId.L_REQ_STREAM_MSG_CONTENT_O,"try open -> ".concat(e));var o=new XMLHttpRequest;o.open("GET",e,!0),o.timeout=t.timeout,o.ontimeout=function(){n._logger.warn(exports.LogTagId.L_REQ_STREAM_MSG_CONTENT_E,"timeout -> ".concat(e)),r(st(-1,"timeout"))},o.onreadystatechange=function(i){if(o.readyState===XMLHttpRequest.HEADERS_RECEIVED){var s=o.getResponseHeader("Content-Type"),a=null==s?void 0:s.startsWith("text/event-stream");if(200===o.status&&a){r(it());var u=0;o.onprogress=function(e){var n=o.response.slice(u);u=o.response.length,t.onRawContent(n)},o.onerror=function(r){n._logger.warn(exports.LogTagId.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);r(st(e.code,e.message))}}},o.onerror=function(t){n._logger.warn(exports.LogTagId.L_REQ_STREAM_MSG_CONTENT_E,"req fail -> ".concat(e)),r(st(-1))},o.setRequestHeader("Content-Type","application/json;charset=UTF-8"),o.setRequestHeader("App-Key",t.appkey),o.setRequestHeader("Authorization","Bearer ".concat(t.token)),o.send()}))]}))}))},n}(Mn),wn={tag:"browser",httpReq:function(e){return rn(e).result()},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:Ln,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",{id:Date.now(),onClose:function(e){n.onclose=function(t){var n=t.code,r=t.reason;e(n,r)}},onError:function(e){n.onerror=e},onMessage:function(e){n.onmessage=function(t){e(t.data)}},onOpen:function(e){n.onopen=e},send:function(e){n.send(e)},close:function(e,t){n.close()}}},getNetworkType:function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection||{effectiveType:me.UNKONWN},t=e.type,n=e.effectiveType,r=t||n||me.UNKONWN;return Promise.resolve(r)},setNetworkStatusListener:function(e){Un=e,"undefined"!=typeof window&&window&&(window.addEventListener("offline",bn),window.addEventListener("online",bn))},removeNetworkStatusListener:function(){"undefined"!=typeof window&&window&&(window.removeEventListener("offline",bn),window.removeEventListener("online",bn)),Un=null},createSSEClient:function(e){return it(new Pn(e))}},xn=On(),Dn=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return wx[e].apply(wx,pe([],de(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},Vn={setItem:Dn("setStorageSync"),getItem:Dn("getStorageSync"),removeItem:Dn("removeStorageSync"),clear:Dn("clearStorageSync")},Gn=null,kn=function(e){var t=e.isConnected,n=e.networkType;Gn({status:t,type:n})};var Fn={tag:"wechat",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,n=e.timeout||Me,r=e.headers,o=e.query,i=e.body,s=qt(e.url,o);return new Promise((function(e){wx.request({url:s,method:t,header:r,timeout:n,data:i,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:Vn,sessionStorage:Vn,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:xn,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return{id:Date.now(),onClose:function(e){n.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){e(t.data)}))},onOpen:function(e){n.onOpen(e)},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){wx.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(me.UNKONWN)}})}))},setNetworkStatusListener:function(e){Gn=e,wx.onNetworkStatusChange(kn)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(kn),Gn=null},createSSEClient:function(e){return st(exports.ErrorCode.NOT_SUPPORT)}},Bn=On(),Hn=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{if("setStorageSync"===e)return my[e]({key:t[0],data:JSON.parse(t[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:t[0]});var r=my[e]({key:t[0]}).data;return r?JSON.stringify(r):r}catch(e){}}},qn={setItem:Hn("setStorageSync"),getItem:Hn("getStorageSync"),removeItem:Hn("removeStorageSync"),clear:Hn("clearStorageSync")},Yn=null,Kn=function(e){var t=e.isConnected,n=e.networkType;Yn({status:t,type:n})};var Qn={tag:"alipay",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,n=e.timeout||Me,r=e.headers,o=e.query,i=e.body,s=qt(e.url,o),a=e.dataType||"json";return new Promise((function(e){my.request({url:s,method:t,headers:r,timeout:n,data:i,dataType:a,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:qn,sessionStorage:qn,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Bn,createWebSocket:function(e){var t=my.connectSocket({url:e,multiple:!0});return{id:Date.now(),onClose:function(e){t.onClose(e)},onError:function(e){t.onError((function(t){e(t.errMsg)}))},onMessage:function(e){t.onMessage((function(t){t.data.isBuffer?e(my.base64ToArrayBuffer(t.data.data)):e(t.data.data)}))},onOpen:function(e){t.onOpen(e)},send:function(e){t.send({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){t.close()}}},getNetworkType:function(){return new Promise((function(e){my.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(me.UNKONWN)}})}))},setNetworkStatusListener:function(e){Yn=e,my.onNetworkStatusChange(Kn)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(Kn),Yn=null},createSSEClient:function(e){return st(exports.ErrorCode.NOT_SUPPORT,"Not supported yet")}},Wn=On(),jn=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return tt[e].apply(tt,pe([],de(t),!1))}catch(e){}}},Jn={setItem:jn("setStorageSync"),getItem:jn("getStorageSync"),removeItem:jn("removeStorageSync"),clear:jn("clearStorageSync")},zn=null,Zn=function(e){var t=e.isConnected,n=e.networkType;zn({status:t,type:n})};var Xn={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Wn,localStorage:Jn,sessionStorage:Jn,httpReq:function(e){return new Promise((function(t){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},r={data:JSON.stringify(n),status:e.statusCode};t(r)},fail:function(e){t({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=tt.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){tt.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(me.UNKONWN)}})}))},setNetworkStatusListener:function(e){zn=e,tt.onNetworkStatusChange(Zn)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(Zn),zn=null},createSSEClient:function(e){return st(exports.ErrorCode.NOT_SUPPORT)}},$n=On(),er=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return swan[e].apply(swan,pe([],de(t),!1))}catch(e){}}},tr={setItem:er("setStorageSync"),getItem:er("getStorageSync"),removeItem:er("removeStorageSync"),clear:er("clearStorageSync")},nr=null,rr=function(e){var t=e.isConnected,n=e.networkType;nr({status:t,type:n})};var or={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:$n,localStorage:tr,sessionStorage:tr,httpReq:function(e){return new Promise((function(t){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},r={data:JSON.stringify(n),status:e.statusCode};t(r)},fail:function(e){t({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=swan.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){return[2,new Promise((function(e){swan.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(me.UNKONWN)}})}))]}))}))},setNetworkStatusListener:function(e){nr=e,swan.onNetworkStatusChange(rr)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(rr),nr=null},createSSEClient:function(e){return st(exports.ErrorCode.NOT_SUPPORT)}},ir=On(),sr=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return jd[e].apply(jd,pe([],de(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},ar={setItem:sr("setStorageSync"),getItem:sr("getStorageSync"),removeItem:sr("removeStorageSync"),clear:sr("clearStorageSync")},ur=null,cr=function(e){var t=e.isConnected,n=e.networkType;ur({status:t,type:n})};var lr={tag:"jingdong",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,n=e.timeout||Me,r=e.headers,o=e.query,i=e.body,s=qt(e.url,o);return new Promise((function(e){jd.request({url:s,method:t,header:r,timeout:n,data:i,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:ar,sessionStorage:ar,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:ir,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),{id:Date.now(),onClose:function(e){jd.onSocketClose((function(t){e(t.code,t.reason)}))},onError:function(e){jd.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){jd.onSocketMessage((function(t){e(t.data)}))},onOpen:function(e){jd.onSocketOpen(e)},send:function(e){jd.sendSocketMessage({data:e})},close:function(e,t){jd.closeSocket({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){jd.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(me.UNKONWN)}})}))},setNetworkStatusListener:function(e){ur=e,jd.onNetworkStatusChange(cr)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(cr),ur=null},createSSEClient:function(e){return st(exports.ErrorCode.NOT_SUPPORT)}},dr=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return uni[e].apply(uni,pe([],de(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},pr={setItem:dr("setStorageSync"),getItem:dr("getStorageSync"),removeItem:dr("removeStorageSync"),clear:dr("clearStorageSync")},hr=null,_r=function(e){var t=e.isConnected,n=e.networkType;hr({status:t,type:n})};var gr,fr,Er={tag:"uniapp",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,n=e.timeout||Me,r=e.headers,o=e.query,i=e.body,s=qt(e.url,o);return new Promise((function(e){uni.request({url:s,method:t,header:r,timeout:n,data:i,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:pr,sessionStorage:pr,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},r=uni.connectSocket(n);return{id:Date.now(),onClose:function(e){r.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){r.onError((function(t){e(t.errMsg)}))},onMessage:function(e){r.onMessage((function(t){e(t.data)}))},onOpen:function(e){r.onOpen(e)},send:function(e){r.send({data:e})},close:function(e,t){r.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){uni.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(me.UNKONWN)}})}))},setNetworkStatusListener:function(e){hr=e,uni.onNetworkStatusChange(_r)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(_r),hr=null},createSSEClient:function(e){return st(exports.ErrorCode.NOT_SUPPORT)}},Ir=function(e){return e&&e.request&&e.getSystemInfo},Tr="undefined"!=typeof uni&&Ir(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":case"app":return Er;case"mp-jd":return lr;case"mp-baidu":return or;case"mp-toutiao":return Xn;case"mp-alipay":return Qn;case"mp-weixin":return Fn;default:return wn}}():"undefined"!=typeof jd&&Ir(jd)?lr:"undefined"!=typeof my&&Ir(my)?Qn:"undefined"!=typeof tt&&Ir(tt)?Xn:"undefined"!=typeof swan&&Ir(swan)?or:"undefined"!=typeof wx&&Ir(wx)?Fn:wn;function Cr(e){var t=function(){function e(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function t(e){return!0===(e&&e.__isLong__)}function n(e,t){var n,r,i;return t?(i=(e>>>=0)>=0&&e<256)&&(r=u[e])?r:(n=o(e,(0|e)<0?-1:0,!0),i&&(u[e]=n),n):(i=(e|=0)>=-128&&e<128)&&(r=a[e])?r:(n=o(e,e<0?-1:0,!1),i&&(a[e]=n),n)}function r(e,t){if(isNaN(e)||!isFinite(e))return t?g:_;if(t){if(e<0)return g;if(e>=d)return C}else{if(-p>=e)return v;if(e+1>=p)return T}return e<0?r(-e,t).neg():o(0|e%l,0|e/l,t)}function o(t,n,r){return new e(t,n,r)}function i(e,t,n){var o,s,a,u,l,d,p;if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return _;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||n>36)throw RangeError("radix");if((o=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===o)return i(e.substring(1),t,n).neg();for(s=r(c(n,8)),a=_,u=0;u<e.length;u+=8)l=Math.min(8,e.length-u),d=parseInt(e.substring(u,u+l),n),l<8?(p=r(c(n,l)),a=a.mul(p).add(r(d))):a=(a=a.mul(s)).add(r(d));return a.unsigned=t,a}function s(t){return t instanceof e?t:"number"==typeof t?r(t):"string"==typeof t?i(t):o(t.low,t.high,t.unsigned)}var a,u,c,l,d,p,h,_,g,f,E,I,T,C,v,R;return e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t,a={},u={},e.fromInt=n,e.fromNumber=r,e.fromBits=o,c=Math.pow,e.fromString=i,e.fromValue=s,p=(d=(l=4294967296)*l)/2,h=n(16777216),_=n(0),e.ZERO=_,g=n(0,!0),e.UZERO=g,f=n(1),e.ONE=f,E=n(1,!0),e.UONE=E,I=n(-1),e.NEG_ONE=I,T=o(-1,2147483647,!1),e.MAX_VALUE=T,C=o(-1,-1,!0),e.MAX_UNSIGNED_VALUE=C,v=o(0,-2147483648,!1),e.MIN_VALUE=v,(R=e.prototype).toInt=function(){return this.unsigned?this.low>>>0:this.low},R.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},R.toString=function(e){var t,n,o,i,s,a,u,l;if((e=e||10)<2||e>36)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())return this.eq(v)?(t=r(e),o=(n=this.div(t)).mul(t).sub(this),n.toString(e)+o.toInt().toString(e)):"-"+this.neg().toString(e);for(i=r(c(e,6),this.unsigned),s=this,a="";;){if(u=s.div(i),l=(s.sub(u.mul(i)).toInt()>>>0).toString(e),(s=u).isZero())return l+a;for(;l.length<6;)l="0"+l;a=""+l+a}},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(){var e,t;if(this.isNegative())return this.eq(v)?64:this.neg().getNumBitsAbs();for(e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<<t);t--);return 0!=this.high?t+33:t+1},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=s(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=s(e)),this.eq(e))return 0;var n=this.isNegative(),r=e.isNegative();return n&&!r?-1:!n&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},R.comp=R.compare,R.negate=function(){return!this.unsigned&&this.eq(v)?v:this.not().add(f)},R.neg=R.negate,R.add=function(e){var n,r,i,a,u,c,l,d,p,h,_;return t(e)||(e=s(e)),n=this.high>>>16,r=65535&this.high,i=this.low>>>16,a=65535&this.low,u=e.high>>>16,c=65535&e.high,l=e.low>>>16,d=0,p=0,h=0,_=0,h+=(_+=a+(65535&e.low))>>>16,p+=(h+=i+l)>>>16,d+=(p+=r+c)>>>16,d+=n+u,o((h&=65535)<<16|(_&=65535),(d&=65535)<<16|(p&=65535),this.unsigned)},R.subtract=function(e){return t(e)||(e=s(e)),this.add(e.neg())},R.sub=R.subtract,R.multiply=function(e){var n,i,a,u,c,l,d,p,g,f,E,I;return this.isZero()?_:(t(e)||(e=s(e)),e.isZero()?_:this.eq(v)?e.isOdd()?v:_:e.eq(v)?this.isOdd()?v:_:this.isNegative()?e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg():e.isNegative()?this.mul(e.neg()).neg():this.lt(h)&&e.lt(h)?r(this.toNumber()*e.toNumber(),this.unsigned):(n=this.high>>>16,i=65535&this.high,a=this.low>>>16,u=65535&this.low,c=e.high>>>16,l=65535&e.high,d=e.low>>>16,g=0,f=0,E=0,I=0,E+=(I+=u*(p=65535&e.low))>>>16,f+=(E+=a*p)>>>16,E&=65535,f+=(E+=u*d)>>>16,g+=(f+=i*p)>>>16,f&=65535,g+=(f+=a*d)>>>16,f&=65535,g+=(f+=u*l)>>>16,g+=n*p+i*d+a*l+u*c,o((E&=65535)<<16|(I&=65535),(g&=65535)<<16|(f&=65535),this.unsigned)))},R.mul=R.multiply,R.divide=function(e){var n,o,i,a,u,l,d;if(t(e)||(e=s(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?g:_;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return E;i=g}else{if(this.eq(v))return e.eq(f)||e.eq(I)?v:e.eq(v)?f:(n=this.shr(1).div(e).shl(1)).eq(_)?e.isNegative()?f:I:(o=this.sub(e.mul(n)),i=n.add(o.div(e)));if(e.eq(v))return this.unsigned?g:_;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=_}for(o=this;o.gte(e);){for(n=Math.max(1,Math.floor(o.toNumber()/e.toNumber())),u=(a=Math.ceil(Math.log(n)/Math.LN2))<=48?1:c(2,a-48),d=(l=r(n)).mul(e);d.isNegative()||d.gt(o);)d=(l=r(n-=u,this.unsigned)).mul(e);l.isZero()&&(l=f),i=i.add(l),o=o.sub(d)}return i},R.div=R.divide,R.modulo=function(e){return t(e)||(e=s(e)),this.sub(this.div(e).mul(e))},R.mod=R.modulo,R.not=function(){return o(~this.low,~this.high,this.unsigned)},R.and=function(e){return t(e)||(e=s(e)),o(this.low&e.low,this.high&e.high,this.unsigned)},R.or=function(e){return t(e)||(e=s(e)),o(this.low|e.low,this.high|e.high,this.unsigned)},R.xor=function(e){return t(e)||(e=s(e)),o(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?o(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):o(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?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)},R.shr=R.shiftRight,R.shiftRightUnsigned=function(e){var n;return t(e)&&(e=e.toInt()),0===(e&=63)?this:(n=this.high,e<32?o(this.low>>>e|n<<32-e,n>>>e,this.unsigned):o(32===e?n:n>>>e-32,0,this.unsigned))},R.shru=R.shiftRightUnsigned,R.toSigned=function(){return this.unsigned?o(this.low,this.high,!1):this},R.toUnsigned=function(){return this.unsigned?this:o(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,255&t>>>8,255&t>>>16,255&t>>>24,255&e,255&e>>>8,255&e>>>16,255&e>>>24]},R.toBytesBE=function(){var e=this.high,t=this.low;return[255&e>>>24,255&e>>>16,255&e>>>8,255&e,255&t>>>24,255&t>>>16,255&t>>>8,255&t]},e}(),n=function(e){function t(e){var t=0;return function(){return t<e.length?e.charCodeAt(t++):null}}function n(){var e=[],t=[];return function(){return 0===arguments.length?t.join("")+a.apply(String,e):(e.length+arguments.length>1024&&(t.push(a.apply(String,e)),e.length=0),void Array.prototype.push.apply(e,arguments))}}function r(e,t,n,r,o){var i,s,a=8*o-r-1,u=(1<<a)-1,c=u>>1,l=-7,d=n?o-1:0,p=n?-1:1,h=e[t+d];for(d+=p,i=h&(1<<-l)-1,h>>=-l,l+=a;l>0;i=256*i+e[t+d],d+=p,l-=8);for(s=i&(1<<-l)-1,i>>=-l,l+=r;l>0;s=256*s+e[t+d],d+=p,l-=8);if(0===i)i=1-c;else{if(i===u)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,r),i-=c}return(h?-1:1)*s*Math.pow(2,i-r)}function o(e,t,n,r,o,i){var s,a,u,c=8*i-o-1,l=(1<<c)-1,d=l>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,_=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||1/0===t?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+d>=1?p/u:p*Math.pow(2,1-d))*u>=2&&(s++,u/=2),s+d>=l?(a=0,s=l):s+d>=1?(a=(t*u-1)*Math.pow(2,o),s+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,o),s=0));o>=8;e[n+h]=255&a,h+=_,a/=256,o-=8);for(s=s<<o|a,c+=o;c>0;e[n+h]=255&s,h+=_,s/=256,c-=8);e[n+h-_]|=128*g}var i,s,a,u,c,l=function(e,t,n){if(void 0===e&&(e=l.DEFAULT_CAPACITY),void 0===t&&(t=l.DEFAULT_ENDIAN),void 0===n&&(n=l.DEFAULT_NOASSERT),!n){if((e|=0)<0)throw RangeError("Illegal capacity");t=!!t,n=!!n}this.buffer=0===e?s:new ArrayBuffer(e),this.view=0===e?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=e,this.littleEndian=t,this.noAssert=n};return l.VERSION="5.0.1",l.LITTLE_ENDIAN=!0,l.BIG_ENDIAN=!1,l.DEFAULT_CAPACITY=16,l.DEFAULT_ENDIAN=l.BIG_ENDIAN,l.DEFAULT_NOASSERT=!1,l.Long=e||null,(i=l.prototype).__isByteBuffer__,Object.defineProperty(i,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1}),s=new ArrayBuffer(0),a=String.fromCharCode,l.accessor=function(){return Uint8Array},l.allocate=function(e,t,n){return new l(e,t,n)},l.concat=function(e,t,n,r){var o,i,s,a,u,c;for(("boolean"==typeof t||"string"!=typeof t)&&(r=n,n=t,t=void 0),o=0,s=0,a=e.length;a>s;++s)l.isByteBuffer(e[s])||(e[s]=l.wrap(e[s],t)),(i=e[s].limit-e[s].offset)>0&&(o+=i);if(0===o)return new l(0,n,r);for(c=new l(o,n,r),s=0;a>s;)(i=(u=e[s++]).limit-u.offset)<=0||(c.view.set(u.view.subarray(u.offset,u.limit),c.offset),c.offset+=i);return c.limit=c.offset,c.offset=0,c},l.isByteBuffer=function(e){return!0===(e&&e.__isByteBuffer__)},l.type=function(){return ArrayBuffer},l.wrap=function(e,t,n,r){var o,s;if("string"!=typeof t&&(r=n,n=t,t=void 0),"string"==typeof e)switch(void 0===t&&(t="utf8"),t){case"base64":return l.fromBase64(e,n);case"hex":return l.fromHex(e,n);case"binary":return l.fromBinary(e,n);case"utf8":return l.fromUTF8(e,n);case"debug":return l.fromDebug(e,n);default:throw Error("Unsupported encoding: "+t)}if(null===e||"object"!=typeof e)throw TypeError("Illegal buffer");if(l.isByteBuffer(e))return(o=i.clone.call(e)).markedOffset=-1,o;if(e instanceof Uint8Array)o=new l(0,n,r),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 l(0,n,r),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");for((o=new l(e.length,n,r)).limit=e.length,s=0;s<e.length;++s)o.view[s]=e[s]}return o},i.writeBitSet=function(e,t){var n,r,o,i,s,a,u=void 0===t;if(u&&(t=this.offset),!this.noAssert){if(!(e instanceof Array))throw TypeError("Illegal BitSet: Not an array");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}for(r=t,i=(o=e.length)>>3,s=0,t+=this.writeVarint32(o,t);i--;)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(o>s){for(a=0,n=0;o>s;)n|=(1&!!e[s++])<<a++;this.writeByte(n,t++)}return u?(this.offset=t,this):t-r},i.readBitSet=function(e){var t,n,r,o,i,s,a,u=void 0===e;for(u&&(e=this.offset),o=(r=(n=this.readVarint32(e)).value)>>3,i=0,s=[],e+=n.length;o--;)t=this.readByte(e++),s[i++]=!!(1&t),s[i++]=!!(2&t),s[i++]=!!(4&t),s[i++]=!!(8&t),s[i++]=!!(16&t),s[i++]=!!(32&t),s[i++]=!!(64&t),s[i++]=!!(128&t);if(r>i)for(a=0,t=this.readByte(e++);r>i;)s[i++]=!!(1&t>>a++);return u&&(this.offset=e),s},i.readBytes=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+e+") <= "+this.buffer.byteLength)}return n=this.slice(t,t+e),r&&(this.offset+=e),n},i.writeBytes=i.append,i.writeInt8=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=1)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=1,this.view[t]=e,r&&(this.offset+=1),this},i.writeByte=i.writeInt8,i.readInt8=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return!(128&~(t=this.view[e]))&&(t=-(255-t+1)),n&&(this.offset+=1),t},i.readByte=i.readInt8,i.writeUint8=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=1)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=1,this.view[t]=e,r&&(this.offset+=1),this},i.writeUInt8=i.writeUint8,i.readUint8=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return t=this.view[e],n&&(this.offset+=1),t},i.readUInt8=i.readUint8,i.writeInt16=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=2)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),r&&(this.offset+=2),this},i.writeShort=i.writeInt16,i.readInt16=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e],t|=this.view[e+1]<<8):(t=this.view[e]<<8,t|=this.view[e+1]),!(32768&~t)&&(t=-(65535-t+1)),n&&(this.offset+=2),t},i.readShort=i.readInt16,i.writeUint16=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=2)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),r&&(this.offset+=2),this},i.writeUInt16=i.writeUint16,i.readUint16=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e],t|=this.view[e+1]<<8):(t=this.view[e]<<8,t|=this.view[e+1]),n&&(this.offset+=2),t},i.readUInt16=i.readUint16,i.writeInt32=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=4)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=4,this.littleEndian?(this.view[t+3]=255&e>>>24,this.view[t+2]=255&e>>>16,this.view[t+1]=255&e>>>8,this.view[t]=255&e):(this.view[t]=255&e>>>24,this.view[t+1]=255&e>>>16,this.view[t+2]=255&e>>>8,this.view[t+3]=255&e),r&&(this.offset+=4),this},i.writeInt=i.writeInt32,i.readInt32=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e+2]<<16,t|=this.view[e+1]<<8,t|=this.view[e],t+=this.view[e+3]<<24>>>0):(t=this.view[e+1]<<16,t|=this.view[e+2]<<8,t|=this.view[e+3],t+=this.view[e]<<24>>>0),t|=0,n&&(this.offset+=4),t},i.readInt=i.readInt32,i.writeUint32=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=4)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=4,this.littleEndian?(this.view[t+3]=255&e>>>24,this.view[t+2]=255&e>>>16,this.view[t+1]=255&e>>>8,this.view[t]=255&e):(this.view[t]=255&e>>>24,this.view[t+1]=255&e>>>16,this.view[t+2]=255&e>>>8,this.view[t+3]=255&e),r&&(this.offset+=4),this},i.writeUInt32=i.writeUint32,i.readUint32=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e+2]<<16,t|=this.view[e+1]<<8,t|=this.view[e],t+=this.view[e+3]<<24>>>0):(t=this.view[e+1]<<16,t|=this.view[e+2]<<8,t|=this.view[e+3],t+=this.view[e]<<24>>>0),n&&(this.offset+=4),t},i.readUInt32=i.readUint32,e&&(i.writeInt64=function(t,n){var r,o,i,s=void 0===n;if(s&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),(n+=8)>(r=this.buffer.byteLength)&&this.resize((r*=2)>n?r:n),n-=8,o=t.low,i=t.high,this.littleEndian?(this.view[n+3]=255&o>>>24,this.view[n+2]=255&o>>>16,this.view[n+1]=255&o>>>8,this.view[n]=255&o,n+=4,this.view[n+3]=255&i>>>24,this.view[n+2]=255&i>>>16,this.view[n+1]=255&i>>>8,this.view[n]=255&i):(this.view[n]=255&i>>>24,this.view[n+1]=255&i>>>16,this.view[n+2]=255&i>>>8,this.view[n+3]=255&i,n+=4,this.view[n]=255&o>>>24,this.view[n+1]=255&o>>>16,this.view[n+2]=255&o>>>8,this.view[n+3]=255&o),s&&(this.offset+=8),this},i.writeLong=i.writeInt64,i.readInt64=function(t){var n,r,o,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+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}return n=0,r=0,this.littleEndian?(n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0,t+=4,r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0):(r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0,t+=4,n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0),o=new e(n,r,!1),i&&(this.offset+=8),o},i.readLong=i.readInt64,i.writeUint64=function(t,n){var r,o,i,s=void 0===n;if(s&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),(n+=8)>(r=this.buffer.byteLength)&&this.resize((r*=2)>n?r:n),n-=8,o=t.low,i=t.high,this.littleEndian?(this.view[n+3]=255&o>>>24,this.view[n+2]=255&o>>>16,this.view[n+1]=255&o>>>8,this.view[n]=255&o,n+=4,this.view[n+3]=255&i>>>24,this.view[n+2]=255&i>>>16,this.view[n+1]=255&i>>>8,this.view[n]=255&i):(this.view[n]=255&i>>>24,this.view[n+1]=255&i>>>16,this.view[n+2]=255&i>>>8,this.view[n+3]=255&i,n+=4,this.view[n]=255&o>>>24,this.view[n+1]=255&o>>>16,this.view[n+2]=255&o>>>8,this.view[n+3]=255&o),s&&(this.offset+=8),this},i.writeUInt64=i.writeUint64,i.readUint64=function(t){var n,r,o,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+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}return n=0,r=0,this.littleEndian?(n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0,t+=4,r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0):(r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0,t+=4,n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0),o=new e(n,r,!0),i&&(this.offset+=8),o},i.readUInt64=i.readUint64),i.writeFloat32=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=4)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=4,o(this.view,e,t,this.littleEndian,23,4),r&&(this.offset+=4),this},i.writeFloat=i.writeFloat32,i.readFloat32=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=r(this.view,e,this.littleEndian,23,4),n&&(this.offset+=4),t},i.readFloat=i.readFloat32,i.writeFloat64=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=8)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=8,o(this.view,e,t,this.littleEndian,52,8),r&&(this.offset+=8),this},i.writeDouble=i.writeFloat64,i.readFloat64=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}return t=r(this.view,e,this.littleEndian,52,8),n&&(this.offset+=8),t},i.readDouble=i.readFloat64,l.MAX_VARINT32_BYTES=5,l.calculateVarint32=function(e){return(e>>>=0)<128?1:e<16384?2:1<<21>e?3:1<<28>e?4:5},l.zigZagEncode32=function(e){return((e|=0)<<1^e>>31)>>>0},l.zigZagDecode32=function(e){return e>>>1^-(1&e)},i.writeVarint32=function(e,t){var n,r,o,i=void 0===t;if(i&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}for((t+=r=l.calculateVarint32(e))>(o=this.buffer.byteLength)&&this.resize((o*=2)>t?o:t),t-=r,e>>>=0;e>=128;)n=128|127&e,this.view[t++]=n,e>>>=7;return this.view[t++]=e,i?(this.offset=t,this):r},i.writeVarint32ZigZag=function(e,t){return this.writeVarint32(l.zigZagEncode32(e),t)},i.readVarint32=function(e){var t,n,r,o,i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}n=0,r=0;do{if(!this.noAssert&&e>this.limit)throw(o=Error("Truncated")).truncated=!0,o;t=this.view[e++],n<5&&(r|=(127&t)<<7*n),++n}while(128&t);return r|=0,i?(this.offset=e,r):{value:r,length:n}},i.readVarint32ZigZag=function(e){var t=this.readVarint32(e);return"object"==typeof t?t.value=l.zigZagDecode32(t.value):t=l.zigZagDecode32(t),t},e&&(l.MAX_VARINT64_BYTES=10,l.calculateVarint64=function(t){"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t));var n=t.toInt()>>>0,r=t.shiftRightUnsigned(28).toInt()>>>0,o=t.shiftRightUnsigned(56).toInt()>>>0;return 0==o?0==r?n<16384?n<128?1:2:1<<21>n?3:4:r<16384?r<128?5:6:1<<21>r?7:8:o<128?9:10},l.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()},l.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()},i.writeVarint64=function(t,n){var r,o,i,s,a,u=void 0===n;if(u&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}switch("number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),r=l.calculateVarint64(t),o=t.toInt()>>>0,i=t.shiftRightUnsigned(28).toInt()>>>0,s=t.shiftRightUnsigned(56).toInt()>>>0,(n+=r)>(a=this.buffer.byteLength)&&this.resize((a*=2)>n?a:n),n-=r,r){case 10:this.view[n+9]=1&s>>>7;case 9:this.view[n+8]=9!==r?128|s:127&s;case 8:this.view[n+7]=8!==r?128|i>>>21:127&i>>>21;case 7:this.view[n+6]=7!==r?128|i>>>14:127&i>>>14;case 6:this.view[n+5]=6!==r?128|i>>>7:127&i>>>7;case 5:this.view[n+4]=5!==r?128|i:127&i;case 4:this.view[n+3]=4!==r?128|o>>>21:127&o>>>21;case 3:this.view[n+2]=3!==r?128|o>>>14:127&o>>>14;case 2:this.view[n+1]=2!==r?128|o>>>7:127&o>>>7;case 1:this.view[n]=1!==r?128|o:127&o}return u?(this.offset+=r,this):r},i.writeVarint64ZigZag=function(e,t){return this.writeVarint64(l.zigZagEncode64(e),t)},i.readVarint64=function(t){var n,r,o,i,s,a,u=void 0===t;if(u&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}if(n=t,r=0,o=0,i=0,s=0,r=127&(s=this.view[t++]),128&s&&(r|=(127&(s=this.view[t++]))<<7,(128&s||this.noAssert&&void 0===s)&&(r|=(127&(s=this.view[t++]))<<14,(128&s||this.noAssert&&void 0===s)&&(r|=(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)&&(i=127&(s=this.view[t++]),(128&s||this.noAssert&&void 0===s)&&(i|=(127&(s=this.view[t++]))<<7,128&s||this.noAssert&&void 0===s))))))))))throw Error("Buffer overrun");return a=e.fromBits(r|o<<28,o>>>4|i<<24,!1),u?(this.offset=t,a):{value:a,length:t-n}},i.readVarint64ZigZag=function(t){var n=this.readVarint64(t);return n&&n.value instanceof e?n.value=l.zigZagDecode64(n.value):n=l.zigZagDecode64(n),n}),i.writeCString=function(e,n){var r,o,i,s=void 0===n;if(s&&(n=this.offset),o=e.length,!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");for(r=0;o>r;++r)if(0===e.charCodeAt(r))throw RangeError("Illegal str: Contains NULL-characters");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return o=c.calculateUTF16asUTF8(t(e))[1],n+=o+1,i=this.buffer.byteLength,n>i&&this.resize((i*=2)>n?i:n),n-=o+1,c.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),this.view[n++]=0,s?(this.offset=n,this):o},i.readCString=function(e){var t,r,o,i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return t=e,o=-1,c.decodeUTF8toUTF16(function(){if(0===o)return null;if(e>=this.limit)throw RangeError("Illegal range: Truncated data, "+e+" < "+this.limit);return 0===(o=this.view[e++])?null:o}.bind(this),r=n(),!0),i?(this.offset=e,r()):{string:r(),length:e-t}},i.writeIString=function(e,n){var r,o,i,s=void 0===n;if(s&&(n=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}if(o=n,r=c.calculateUTF16asUTF8(t(e),this.noAssert)[1],n+=4+r,i=this.buffer.byteLength,n>i&&this.resize((i*=2)>n?i:n),n-=4+r,this.littleEndian?(this.view[n+3]=255&r>>>24,this.view[n+2]=255&r>>>16,this.view[n+1]=255&r>>>8,this.view[n]=255&r):(this.view[n]=255&r>>>24,this.view[n+1]=255&r>>>16,this.view[n+2]=255&r>>>8,this.view[n+3]=255&r),n+=4,c.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),n!==o+4+r)throw RangeError("Illegal range: Truncated data, "+n+" == "+(n+4+r));return s?(this.offset=n,this):n-o},i.readIString=function(e){var t,n,r,o=void 0===e;if(o&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=e,n=this.readUint32(e),r=this.readUTF8String(n,l.METRICS_BYTES,e+=4),e+=r.length,o?(this.offset=e,r.string):{string:r.string,length:e-t}},l.METRICS_CHARS="c",l.METRICS_BYTES="b",i.writeUTF8String=function(e,n){var r,o,i,s=void 0===n;if(s&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return o=n,r=c.calculateUTF16asUTF8(t(e))[1],n+=r,i=this.buffer.byteLength,n>i&&this.resize((i*=2)>n?i:n),n-=r,c.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),s?(this.offset=n,this):n-o},i.writeString=i.writeUTF8String,l.calculateUTF8Chars=function(e){return c.calculateUTF16asUTF8(t(e))[0]},l.calculateUTF8Bytes=function(e){return c.calculateUTF16asUTF8(t(e))[1]},l.calculateString=l.calculateUTF8Bytes,i.readUTF8String=function(e,t,r){var o,i,s,a,u;if("number"==typeof t&&(r=t,t=void 0),(o=void 0===r)&&(r=this.offset),void 0===t&&(t=l.METRICS_CHARS),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");if(e|=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}if(s=0,a=r,t===l.METRICS_CHARS){if(i=n(),c.decodeUTF8(function(){return e>s&&r<this.limit?this.view[r++]:null}.bind(this),(function(e){++s,c.UTF8toUTF16(e,i)})),s!==e)throw RangeError("Illegal range: Truncated data, "+s+" == "+e);return o?(this.offset=r,i()):{string:i(),length:r-a}}if(t===l.METRICS_BYTES){if(!this.noAssert){if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+"+e+") <= "+this.buffer.byteLength)}if(u=r+e,c.decodeUTF8toUTF16(function(){return u>r?this.view[r++]:null}.bind(this),i=n(),this.noAssert),r!==u)throw RangeError("Illegal range: Truncated data, "+r+" == "+u);return o?(this.offset=r,i()):{string:i(),length:r-a}}throw TypeError("Unsupported metrics: "+t)},i.readString=i.readUTF8String,i.writeVString=function(e,n){var r,o,i,s,a=void 0===n;if(a&&(n=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}if(i=n,r=c.calculateUTF16asUTF8(t(e),this.noAssert)[1],o=l.calculateVarint32(r),n+=o+r,s=this.buffer.byteLength,n>s&&this.resize((s*=2)>n?s:n),n-=o+r,n+=this.writeVarint32(r,n),c.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),n!==i+r+o)throw RangeError("Illegal range: Truncated data, "+n+" == "+(n+r+o));return a?(this.offset=n,this):n-i},i.readVString=function(e){var t,n,r,o=void 0===e;if(o&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return t=e,n=this.readVarint32(e),r=this.readUTF8String(n.value,l.METRICS_BYTES,e+=n.length),e+=r.length,o?(this.offset=e,r.string):{string:r.string,length:e-t}},i.append=function(e,t,n){var r,o,i;if(("number"==typeof t||"string"!=typeof t)&&(n=t,t=void 0),(r=void 0===n)&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return e instanceof l||(e=l.wrap(e,t)),(o=e.limit-e.offset)<=0||((n+=o)>(i=this.buffer.byteLength)&&this.resize((i*=2)>n?i:n),n-=o,this.view.set(e.view.subarray(e.offset,e.limit),n),e.offset+=o,r&&(this.offset+=o)),this},i.appendTo=function(e,t){return e.append(this,t),this},i.assert=function(e){return this.noAssert=!e,this},i.capacity=function(){return this.buffer.byteLength},i.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},i.clone=function(e){var t=new l(0,this.littleEndian,this.noAssert);return e?(t.buffer=new ArrayBuffer(this.buffer.byteLength),t.view=new Uint8Array(t.buffer)):(t.buffer=this.buffer,t.view=this.view),t.offset=this.offset,t.markedOffset=this.markedOffset,t.limit=this.limit,t},i.compact=function(e,t){var n,r,o;if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}return 0===e&&t===this.buffer.byteLength?this:0===(n=t-e)?(this.buffer=s,this.view=null,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=0,this):(r=new ArrayBuffer(n),(o=new Uint8Array(r)).set(this.view.subarray(e,t)),this.buffer=r,this.view=o,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=n,this)},i.copy=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(e===t)return new l(0,this.littleEndian,this.noAssert);var n=t-e,r=new l(n,this.littleEndian,this.noAssert);return r.offset=0,r.limit=n,r.markedOffset>=0&&(r.markedOffset-=e),this.copyTo(r,0,e,t),r},i.copyTo=function(e,t,n,r){var o,i,s;if(!this.noAssert&&!l.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(t=(i=void 0===t)?e.offset:0|t,n=(o=void 0===n)?this.offset:0|n,r=void 0===r?this.limit:0|r,t<0||t>e.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+t+" <= "+e.buffer.byteLength);if(n<0||r>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+n+" <= "+this.buffer.byteLength);return 0===(s=r-n)?e:(e.ensureCapacity(t+s),e.view.set(this.view.subarray(n,r),t),o&&(this.offset+=s),i&&(e.offset+=s),this)},i.ensureCapacity=function(e){var t=this.buffer.byteLength;return e>t?this.resize((t*=2)>e?t:e):this},i.fill=function(e,t,n){var r=void 0===t;if(r&&(t=this.offset),"string"==typeof e&&e.length>0&&(e=e.charCodeAt(0)),void 0===t&&(t=this.offset),void 0===n&&(n=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal end: Not an integer");if(n>>>=0,t<0||t>n||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+n+" <= "+this.buffer.byteLength)}if(t>=n)return this;for(;n>t;)this.view[t++]=e;return r&&(this.offset=t),this},i.flip=function(){return this.limit=this.offset,this.offset=0,this},i.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},i.order=function(e){if(!this.noAssert&&"boolean"!=typeof e)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!e,this},i.LE=function(e){return this.littleEndian=void 0===e||!!e,this},i.BE=function(e){return this.littleEndian=void 0!==e&&!e,this},i.prepend=function(e,t,n){var r,o,i,s,a;if(("number"==typeof t||"string"!=typeof t)&&(n=t,t=void 0),(r=void 0===n)&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return e instanceof l||(e=l.wrap(e,t)),(o=e.limit-e.offset)<=0||((i=o-n)>0?(s=new ArrayBuffer(this.buffer.byteLength+i),(a=new Uint8Array(s)).set(this.view.subarray(n,this.buffer.byteLength),o),this.buffer=s,this.view=a,this.offset+=i,this.markedOffset>=0&&(this.markedOffset+=i),this.limit+=i,n+=i):new Uint8Array(this.buffer),this.view.set(e.view.subarray(e.offset,e.limit),n-o),e.offset=e.limit,r&&(this.offset-=o)),this},i.prependTo=function(e,t){return e.prepend(this,t),this},i.printDebug=function(e){"function"!=typeof e&&(e=console.log.bind(console)),e(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},i.remaining=function(){return this.limit-this.offset},i.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},i.resize=function(e){var t,n;if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal capacity: "+e+" (not an integer)");if((e|=0)<0)throw RangeError("Illegal capacity: 0 <= "+e)}return this.buffer.byteLength<e&&(t=new ArrayBuffer(e),(n=new Uint8Array(t)).set(this.view),this.buffer=t,this.view=n),this},i.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},i.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},i.slice=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var n=this.clone();return n.offset=e,n.limit=t,n},i.toBuffer=function(e){var t,n=this.offset,r=this.limit;if(!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: Not an integer");if(n>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal limit: Not an integer");if(r>>>=0,n<0||n>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+n+" <= "+r+" <= "+this.buffer.byteLength)}return e||0!==n||r!==this.buffer.byteLength?n===r?s:(t=new ArrayBuffer(r-n),new Uint8Array(t).set(new Uint8Array(this.buffer).subarray(n,r),0),t):this.buffer},i.toArrayBuffer=i.toBuffer,i.toString=function(e,t,n){if(void 0===e)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof e&&(n=t=e="utf8"),e){case"utf8":return this.toUTF8(t,n);case"base64":return this.toBase64(t,n);case"hex":return this.toHex(t,n);case"binary":return this.toBinary(t,n);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+e)}},u=function(){var e,t,n={},r=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],o=[];for(e=0,t=r.length;t>e;++e)o[r[e]]=e;return n.encode=function(e,t){for(var n,o;null!==(n=e());)t(r[63&n>>2]),o=(3&n)<<4,null!==(n=e())?(t(r[63&((o|=15&n>>4)|15&n>>4)]),o=(15&n)<<2,null!==(n=e())?(t(r[63&(o|3&n>>6)]),t(r[63&n])):(t(r[63&o]),t(61))):(t(r[63&o]),t(61),t(61))},n.decode=function(e,t){function n(e){throw Error("Illegal character code: "+e)}for(var r,i,s;null!==(r=e());)if(void 0===(i=o[r])&&n(r),null!==(r=e())&&(void 0===(s=o[r])&&n(r),t(i<<2>>>0|(48&s)>>4),null!==(r=e()))){if(void 0===(i=o[r])){if(61===r)break;n(r)}if(t((15&s)<<4>>>0|(60&i)>>2),null!==(r=e())){if(void 0===(s=o[r])){if(61===r)break;n(r)}t((3&i)<<6>>>0|s)}}},n.test=function(e){return/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)},n}(),i.toBase64=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),t|=0,(e|=0)<0||t>this.capacity||e>t)throw RangeError("begin, end");var r;return u.encode(function(){return t>e?this.view[e++]:null}.bind(this),r=n()),r()},l.fromBase64=function(e,n){if("string"!=typeof e)throw TypeError("str");var r=new l(e.length/4*3,n),o=0;return u.decode(t(e),(function(e){r.view[o++]=e})),r.limit=o,r},l.btoa=function(e){return l.fromBinary(e).toBase64()},l.atob=function(e){return l.fromBase64(e).toBinary()},i.toBinary=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),t|=0,(e|=0)<0||t>this.capacity()||e>t)throw RangeError("begin, end");if(e===t)return"";for(var n=[],r=[];t>e;)n.push(this.view[e++]),n.length>=1024&&(r.push(String.fromCharCode.apply(String,n)),n=[]);return r.join("")+String.fromCharCode.apply(String,n)},l.fromBinary=function(e,t){if("string"!=typeof e)throw TypeError("str");for(var n,r=0,o=e.length,i=new l(o,t);o>r;){if((n=e.charCodeAt(r))>255)throw RangeError("illegal char code: "+n);i.view[r++]=n}return i.limit=o,i},i.toDebug=function(e){for(var t,n=-1,r=this.buffer.byteLength,o="",i="",s="";r>n;){if(-1!==n&&(o+=(t=this.view[n])<16?"0"+t.toString(16).toUpperCase():t.toString(16).toUpperCase(),e&&(i+=t>32&&t<127?String.fromCharCode(t):".")),++n,e&&n>0&&n%16==0&&n!==r){for(;o.length<51;)o+=" ";s+=o+i+"\n",o=i=""}o+=n===this.offset&&n===this.limit?n===this.markedOffset?"!":"|":n===this.offset?n===this.markedOffset?"[":"<":n===this.limit?n===this.markedOffset?"]":">":n===this.markedOffset?"'":e||0!==n&&n!==r?" ":""}if(e&&" "!==o){for(;o.length<51;)o+=" ";s+=o+i+"\n"}return e?s:o},l.fromDebug=function(e,t,n){for(var r,o,i=e.length,s=new l(0|(i+1)/3,t,n),a=0,u=0,c=!1,d=!1,p=!1,h=!1,_=!1;i>a;){switch(r=e.charAt(a++)){case"!":if(!n){if(d||p||h){_=!0;break}d=p=h=!0}s.offset=s.markedOffset=s.limit=u,c=!1;break;case"|":if(!n){if(d||h){_=!0;break}d=h=!0}s.offset=s.limit=u,c=!1;break;case"[":if(!n){if(d||p){_=!0;break}d=p=!0}s.offset=s.markedOffset=u,c=!1;break;case"<":if(!n){if(d){_=!0;break}d=!0}s.offset=u,c=!1;break;case"]":if(!n){if(h||p){_=!0;break}h=p=!0}s.limit=s.markedOffset=u,c=!1;break;case">":if(!n){if(h){_=!0;break}h=!0}s.limit=u,c=!1;break;case"'":if(!n){if(p){_=!0;break}p=!0}s.markedOffset=u,c=!1;break;case" ":c=!1;break;default:if(!n&&c){_=!0;break}if(o=parseInt(r+e.charAt(a++),16),!n&&(isNaN(o)||o<0||o>255))throw TypeError("Illegal str: Not a debug encoded string");s.view[u++]=o,c=!0}if(_)throw TypeError("Illegal str: Invalid symbol at "+a)}if(!n){if(!d||!h)throw TypeError("Illegal str: Missing offset or limit");if(u<s.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+u+" < "+i)}return s},i.toHex=function(e,t){if(e=void 0===e?this.offset:e,t=void 0===t?this.limit:t,!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}for(var n,r=new Array(t-e);t>e;)(n=this.view[e++])<16?r.push("0",n.toString(16)):r.push(n.toString(16));return r.join("")},l.fromHex=function(e,t,n){var r,o,i,s,a;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(o=e.length,i=new l(0|o/2,t),s=0,a=0;o>s;s+=2){if(r=parseInt(e.substring(s,s+2),16),!n&&(!isFinite(r)||r<0||r>255))throw TypeError("Illegal str: Contains non-hex characters");i.view[a++]=r}return i.limit=a,i},c=function(){var e={MAX_CODEPOINT:1114111,encodeUTF8:function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)n<128?t(127&n):n<2048?(t(192|31&n>>6),t(128|63&n)):n<65536?(t(224|15&n>>12),t(128|63&n>>6),t(128|63&n)):(t(240|7&n>>18),t(128|63&n>>12),t(128|63&n>>6),t(128|63&n)),n=null},decodeUTF8:function(e,t){for(var n,r,o,i,s=function(e){e=e.slice(0,e.indexOf(null));var t=Error(e.toString());throw t.name="TruncatedError",t.bytes=e,t};null!==(n=e());)if(128&n)if(192==(224&n))null===(r=e())&&s([n,r]),t((31&n)<<6|63&r);else if(224==(240&n))(null===(r=e())||null===(o=e()))&&s([n,r,o]),t((15&n)<<12|(63&r)<<6|63&o);else{if(240!=(248&n))throw RangeError("Illegal starting byte: "+n);(null===(r=e())||null===(o=e())||null===(i=e()))&&s([n,r,o,i]),t((7&n)<<18|(63&r)<<12|(63&o)<<6|63&i)}else t(n)},UTF16toUTF8:function(e,t){for(var n,r=null;null!==(n=null!==r?r:e());)n>=55296&&n<=57343&&null!==(r=e())&&r>=56320&&r<=57343?(t(1024*(n-55296)+r-56320+65536),r=null):t(n);null!==r&&t(r)},UTF8toUTF16:function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)n<=65535?t(n):(t(55296+((n-=65536)>>10)),t(n%1024+56320)),n=null},encodeUTF16toUTF8:function(t,n){e.UTF16toUTF8(t,(function(t){e.encodeUTF8(t,n)}))},decodeUTF8toUTF16:function(t,n){e.decodeUTF8(t,(function(t){e.UTF8toUTF16(t,n)}))},calculateCodePoint:function(e){return e<128?1:e<2048?2:e<65536?3:4},calculateUTF8:function(e){for(var t,n=0;null!==(t=e());)n+=t<128?1:t<2048?2:t<65536?3:4;return n},calculateUTF16asUTF8:function(t){var n=0,r=0;return e.UTF16toUTF8(t,(function(e){++n,r+=e<128?1:e<2048?2:e<65536?3:4})),[n,r]}};return e}(),i.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 t>e?this.view[e++]:null}.bind(this),r=n())}catch(n){if(e!==t)throw RangeError("Illegal range: Truncated data, "+e+" != "+t)}return r()},l.fromUTF8=function(e,n,r){if(!r&&"string"!=typeof e)throw TypeError("Illegal str: Not a string");var o=new l(c.calculateUTF16asUTF8(t(e),!0)[1],n,r),i=0;return c.encodeUTF16toUTF8(t(e),(function(e){o.view[i++]=e})),o.limit=i,o},l}(t),r=function(t,n){var r,o,i={};return i.ByteBuffer=t,i.c=t,r=t,i.Long=n||null,i.VERSION="5.0.1",i.WIRE_TYPES={},i.WIRE_TYPES.VARINT=0,i.WIRE_TYPES.BITS64=1,i.WIRE_TYPES.LDELIM=2,i.WIRE_TYPES.STARTGROUP=3,i.WIRE_TYPES.ENDGROUP=4,i.WIRE_TYPES.BITS32=5,i.PACKABLE_WIRE_TYPES=[i.WIRE_TYPES.VARINT,i.WIRE_TYPES.BITS64,i.WIRE_TYPES.BITS32],i.TYPES={int32:{name:"int32",wireType:i.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:"uint32",wireType:i.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:"sint32",wireType:i.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:"int64",wireType:i.WIRE_TYPES.VARINT,defaultValue:i.Long?i.Long.ZERO:void 0},uint64:{name:"uint64",wireType:i.WIRE_TYPES.VARINT,defaultValue:i.Long?i.Long.UZERO:void 0},sint64:{name:"sint64",wireType:i.WIRE_TYPES.VARINT,defaultValue:i.Long?i.Long.ZERO:void 0},bool:{name:"bool",wireType:i.WIRE_TYPES.VARINT,defaultValue:!1},double:{name:"double",wireType:i.WIRE_TYPES.BITS64,defaultValue:0},string:{name:"string",wireType:i.WIRE_TYPES.LDELIM,defaultValue:""},bytes:{name:"bytes",wireType:i.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:"fixed32",wireType:i.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:"sfixed32",wireType:i.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:"fixed64",wireType:i.WIRE_TYPES.BITS64,defaultValue:i.Long?i.Long.UZERO:void 0},sfixed64:{name:"sfixed64",wireType:i.WIRE_TYPES.BITS64,defaultValue:i.Long?i.Long.ZERO:void 0},float:{name:"float",wireType:i.WIRE_TYPES.BITS32,defaultValue:0},enum:{name:"enum",wireType:i.WIRE_TYPES.VARINT,defaultValue:0},message:{name:"message",wireType:i.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:"group",wireType:i.WIRE_TYPES.STARTGROUP,defaultValue:null}},i.MAP_KEY_TYPES=[i.TYPES.int32,i.TYPES.sint32,i.TYPES.sfixed32,i.TYPES.uint32,i.TYPES.fixed32,i.TYPES.int64,i.TYPES.sint64,i.TYPES.sfixed64,i.TYPES.uint64,i.TYPES.fixed64,i.TYPES.bool,i.TYPES.string,i.TYPES.bytes],i.ID_MIN=1,i.ID_MAX=536870911,i.convertFieldsToCamelCase=!1,i.populateAccessors=!0,i.populateDefaults=!0,i.Util=function(){var e={};return e.IS_NODE=!("object"!=typeof process||process+""!="[object process]"||process.browser),e.XHR=function(){var e,t=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],n=null;for(e=0;e<t.length;e++){try{n=t[e]()}catch(e){continue}break}if(!n)throw Error("XMLHttpRequest is not supported");return n},e.fetch=function(t,n){if(n&&"function"!=typeof n&&(n=null),e.IS_NODE)if(n)g.readFile(t,(function(e,t){n(e?null:""+t)}));else try{return g.readFileSync(t)}catch(e){return null}else{var r=e.XHR();if(r.open("GET",t,!!n),r.setRequestHeader("Accept","text/plain"),"function"==typeof r.overrideMimeType&&r.overrideMimeType("text/plain"),!n)return r.send(null),200==r.status||0==r.status&&"string"==typeof r.responseText?r.responseText:null;if(r.onreadystatechange=function(){4==r.readyState&&(200==r.status||0==r.status&&"string"==typeof r.responseText?n(r.responseText):n(null))},4==r.readyState)return;r.send(null)}},e.toCamelCase=function(e){return e.replace(/_([a-zA-Z])/g,(function(e,t){return t.toUpperCase()}))},e}(),i.Lang={DELIM:/[\s\{\}=;:\[\],'"\(\)<>]/g,RULE:/^(?:required|optional|repeated|map)$/,TYPE:/^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,NAME:/^[a-zA-Z_][a-zA-Z_0-9]*$/,TYPEDEF:/^[a-zA-Z][a-zA-Z_0-9]*$/,TYPEREF:/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,FQTYPEREF:/^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,NUMBER:/^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,NUMBER_DEC:/^(?:[1-9][0-9]*|0)$/,NUMBER_HEX:/^0[xX][0-9a-fA-F]+$/,NUMBER_OCT:/^0[0-7]+$/,NUMBER_FLT:/^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,BOOL:/^(?:true|false)$/i,ID:/^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,NEGID:/^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,WHITESPACE:/\s/,STRING:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,STRING_DQ:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,STRING_SQ:/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g},i.DotProto=function(e,t){function n(e,n){var r=-1,o=1;if("-"==e.charAt(0)&&(o=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))r=parseInt(e);else if(t.NUMBER_HEX.test(e))r=parseInt(e.substring(2),16);else{if(!t.NUMBER_OCT.test(e))throw Error("illegal id value: "+(o<0?"-":"")+e);r=parseInt(e.substring(1),8)}if(r=0|o*r,!n&&r<0)throw Error("illegal id value: "+(o<0?"-":"")+e);return r}function r(e){var n=1;if("-"==e.charAt(0)&&(n=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))return n*parseInt(e,10);if(t.NUMBER_HEX.test(e))return n*parseInt(e.substring(2),16);if(t.NUMBER_OCT.test(e))return n*parseInt(e.substring(1),8);if("inf"===e)return 1/0*n;if("nan"===e)return NaN;if(t.NUMBER_FLT.test(e))return n*parseFloat(e);throw Error("illegal number value: "+(n<0?"-":"")+e)}function o(e,t,n){void 0===e[t]?e[t]=n:(Array.isArray(e[t])||(e[t]=[e[t]]),e[t].push(n))}var i,s,a={},u=function(e){this.source=e+"",this.index=0,this.line=1,this.stack=[],this._stringOpen=null},c=u.prototype;return c._readString=function(){var e,n='"'===this._stringOpen?t.STRING_DQ:t.STRING_SQ;if(n.lastIndex=this.index-1,!(e=n.exec(this.source)))throw Error("unterminated string");return this.index=n.lastIndex,this.stack.push(this._stringOpen),this._stringOpen=null,e[1]},c.next=function(){var e,n,r,o,i;if(this.stack.length>0)return this.stack.shift();if(this.index>=this.source.length)return null;if(null!==this._stringOpen)return this._readString();do{for(e=!1;t.WHITESPACE.test(r=this.source.charAt(this.index));)if("\n"===r&&++this.line,++this.index===this.source.length)return null;if("/"===this.source.charAt(this.index))if(++this.index,"/"===this.source.charAt(this.index)){for(;"\n"!==this.source.charAt(++this.index);)if(this.index==this.source.length)return null;++this.index,++this.line,e=!0}else{if("*"!==(r=this.source.charAt(this.index)))return"/";do{if("\n"===r&&++this.line,++this.index===this.source.length)return null;n=r,r=this.source.charAt(this.index)}while("*"!==n||"/"!==r);++this.index,e=!0}}while(e);if(this.index===this.source.length)return null;if(o=this.index,t.DELIM.lastIndex=0,!t.DELIM.test(this.source.charAt(o++)))for(;o<this.source.length&&!t.DELIM.test(this.source.charAt(o));)++o;return('"'===(i=this.source.substring(this.index,this.index=o))||"'"===i)&&(this._stringOpen=i),i},c.peek=function(){if(0===this.stack.length){var e=this.next();if(null===e)return null;this.stack.push(e)}return this.stack[0]},c.skip=function(e){var t=this.next();if(t!==e)throw Error("illegal '"+t+"', '"+e+"' expected")},c.omit=function(e){return this.peek()===e&&(this.next(),!0)},c.toString=function(){return"Tokenizer ("+this.index+"/"+this.source.length+" at line "+this.line+")"},a.Tokenizer=u,i=function(e){this.tn=new u(e),this.proto3=!1},(s=i.prototype).parse=function(){var e,n={name:"[ROOT]",package:null,messages:[],enums:[],imports:[],options:{},services:[]},r=!0;try{for(;e=this.tn.next();)switch(e){case"package":if(!r||null!==n.package)throw Error("unexpected 'package'");if(e=this.tn.next(),!t.TYPEREF.test(e))throw Error("illegal package name: "+e);this.tn.skip(";"),n.package=e;break;case"import":if(!r)throw Error("unexpected 'import'");"public"===(e=this.tn.peek())&&this.tn.next(),e=this._readString(),this.tn.skip(";"),n.imports.push(e);break;case"syntax":if(!r)throw Error("unexpected 'syntax'");this.tn.skip("="),"proto3"===(n.syntax=this._readString())&&(this.proto3=!0),this.tn.skip(";");break;case"message":this._parseMessage(n,null),r=!1;break;case"enum":this._parseEnum(n),r=!1;break;case"option":this._parseOption(n);break;case"service":this._parseService(n);break;case"extend":this._parseExtend(n);break;default:throw Error("unexpected '"+e+"'")}}catch(e){throw e.message="Parse error at line "+this.tn.line+": "+e.message,e}return delete n.name,n},i.parse=function(e){return new i(e).parse()},s._readString=function(){var e,t,n="";do{if("'"!==(t=this.tn.next())&&'"'!==t)throw Error("illegal string delimiter: "+t);n+=this.tn.next(),this.tn.skip(t),e=this.tn.peek()}while('"'===e||'"'===e);return n},s._readValue=function(e){var n=this.tn.peek();if('"'===n||"'"===n)return this._readString();if(this.tn.next(),t.NUMBER.test(n))return r(n);if(t.BOOL.test(n))return"true"===n.toLowerCase();if(e&&t.TYPEREF.test(n))return n;throw Error("illegal value: "+n)},s._parseOption=function(e,n){var r,o=this.tn.next(),i=!1;if("("===o&&(i=!0,o=this.tn.next()),!t.TYPEREF.test(o))throw Error("illegal option name: "+o);r=o,i&&(this.tn.skip(")"),r="("+r+")",o=this.tn.peek(),t.FQTYPEREF.test(o)&&(r+=o,this.tn.next())),this.tn.skip("="),this._parseOptionValue(e,r),n||this.tn.skip(";")},s._parseOptionValue=function(e,n){var r=this.tn.peek();if("{"!==r)o(e.options,n,this._readValue(!0));else for(this.tn.skip("{");"}"!==(r=this.tn.next());){if(!t.NAME.test(r))throw Error("illegal option name: "+n+"."+r);this.tn.omit(":")?o(e.options,n+"."+r,this._readValue(!0)):this._parseOptionValue(e,n+"."+r)}},s._parseService=function(e){var n,r=this.tn.next();if(!t.NAME.test(r))throw Error("illegal service name at line "+this.tn.line+": "+r);for(n={name:r,rpc:{},options:{}},this.tn.skip("{");"}"!==(r=this.tn.next());)if("option"===r)this._parseOption(n);else{if("rpc"!==r)throw Error("illegal service token: "+r);this._parseServiceRPC(n)}this.tn.omit(";"),e.services.push(n)},s._parseServiceRPC=function(e){var n,r,o="rpc",i=this.tn.next();if(!t.NAME.test(i))throw Error("illegal rpc service method name: "+i);if(n=i,r={request:null,response:null,request_stream:!1,response_stream:!1,options:{}},this.tn.skip("("),"stream"===(i=this.tn.next()).toLowerCase()&&(r.request_stream=!0,i=this.tn.next()),!t.TYPEREF.test(i))throw Error("illegal rpc service request type: "+i);if(r.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()&&(r.response_stream=!0,i=this.tn.next()),r.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(r)}this.tn.omit(";")}else this.tn.skip(";");void 0===e[o]&&(e[o]={}),e[o][n]=r},s._parseMessage=function(e,r){var o=!!r,i=this.tn.next(),s={name:"",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!t.NAME.test(i))throw Error("illegal "+(o?"group":"message")+" name: "+i);for(s.name=i,o&&(this.tn.skip("="),r.id=n(this.tn.next()),s.isGroup=!0),"["===(i=this.tn.peek())&&r&&this._parseFieldOptions(r),this.tn.skip("{");"}"!==(i=this.tn.next());)if(t.RULE.test(i))this._parseMessageField(s,i);else if("oneof"===i)this._parseMessageOneOf(s);else if("enum"===i)this._parseEnum(s);else if("message"===i)this._parseMessage(s);else if("option"===i)this._parseOption(s);else if("service"===i)this._parseService(s);else if("extensions"===i)s.extensions=this._parseExtensionRanges();else if("reserved"===i)this._parseIgnored();else if("extend"===i)this._parseExtend(s);else{if(!t.TYPEREF.test(i))throw Error("illegal message token: "+i);if(!this.proto3)throw Error("illegal field rule: "+i);this._parseMessageField(s,"optional",i)}return this.tn.omit(";"),e.messages.push(s),s},s._parseIgnored=function(){for(;";"!==this.tn.peek();)this.tn.next();this.tn.skip(";")},s._parseMessageField=function(e,r,o){var i,s,a;if(!t.RULE.test(r))throw Error("illegal message field rule: "+r);if(i={rule:r,type:"",name:"",options:{},id:0},"map"===r){if(o)throw Error("illegal type: "+o);if(this.tn.skip("<"),s=this.tn.next(),!t.TYPE.test(s)&&!t.TYPEREF.test(s))throw Error("illegal message field type: "+s);if(i.keytype=s,this.tn.skip(","),s=this.tn.next(),!t.TYPE.test(s)&&!t.TYPEREF.test(s))throw Error("illegal message field: "+s);if(i.type=s,this.tn.skip(">"),s=this.tn.next(),!t.NAME.test(s))throw Error("illegal message field name: "+s);i.name=s,this.tn.skip("="),i.id=n(this.tn.next()),"["===(s=this.tn.peek())&&this._parseFieldOptions(i),this.tn.skip(";")}else if("group"===(o=void 0!==o?o:this.tn.next())){if(a=this._parseMessage(e,i),!/^[A-Z]/.test(a.name))throw Error("illegal group name: "+a.name);i.type=a.name,i.name=a.name.toLowerCase(),this.tn.omit(";")}else{if(!t.TYPE.test(o)&&!t.TYPEREF.test(o))throw Error("illegal message field type: "+o);if(i.type=o,s=this.tn.next(),!t.NAME.test(s))throw Error("illegal message field name: "+s);i.name=s,this.tn.skip("="),i.id=n(this.tn.next()),"["===(s=this.tn.peek())&&this._parseFieldOptions(i),this.tn.skip(";")}return e.fields.push(i),i},s._parseMessageOneOf=function(e){var n,r,o,i=this.tn.next();if(!t.NAME.test(i))throw Error("illegal oneof name: "+i);for(r=i,o=[],this.tn.skip("{");"}"!==(i=this.tn.next());)(n=this._parseMessageField(e,"optional",i)).oneof=r,o.push(n.id);this.tn.omit(";"),e.oneofs[r]=o},s._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()},s._parseEnum=function(e){var r,o={name:"",values:[],options:{}},i=this.tn.next();if(!t.NAME.test(i))throw Error("illegal name: "+i);for(o.name=i,this.tn.skip("{");"}"!==(i=this.tn.next());)if("option"===i)this._parseOption(o);else{if(!t.NAME.test(i))throw Error("illegal name: "+i);this.tn.skip("="),r={name:i,id:n(this.tn.next(),!0)},"["===(i=this.tn.peek())&&this._parseFieldOptions({options:{}}),this.tn.skip(";"),o.values.push(r)}this.tn.omit(";"),e.enums.push(o)},s._parseExtensionRanges=function(){var t,n,o,i=[];do{for(n=[];;){switch(t=this.tn.next()){case"min":o=e.ID_MIN;break;case"max":o=e.ID_MAX;break;default:o=r(t)}if(n.push(o),2===n.length)break;if("to"!==this.tn.peek()){n.push(o);break}this.tn.next()}i.push(n)}while(this.tn.omit(","));return this.tn.skip(";"),i},s._parseExtend=function(e){var n,r=this.tn.next();if(!t.TYPEREF.test(r))throw Error("illegal extend reference: "+r);for(n={ref:r,fields:[]},this.tn.skip("{");"}"!==(r=this.tn.next());)if(t.RULE.test(r))this._parseMessageField(n,r);else{if(!t.TYPEREF.test(r))throw Error("illegal extend token: "+r);if(!this.proto3)throw Error("illegal field rule: "+r);this._parseMessageField(n,"optional",r)}return this.tn.omit(";"),e.messages.push(n),n},s.toString=function(){return"Parser at line "+this.tn.line},a.Parser=i,a}(i,i.Lang),i.Reflect=function(e){function n(t,n){if(t&&"number"==typeof t.low&&"number"==typeof t.high&&"boolean"==typeof t.unsigned&&t.low==t.low&&t.high==t.high)return new e.Long(t.low,t.high,void 0===n?t.unsigned:n);if("string"==typeof t)return e.Long.fromString(t,n||!1,10);if("number"==typeof t)return e.Long.fromNumber(t,n||!1);throw Error("not convertible to Long")}function o(t,n){var r=n.readVarint32(),i=7&r,s=r>>>3;switch(i){case e.WIRE_TYPES.VARINT:do{r=n.readUint8()}while(!(128&~r));break;case e.WIRE_TYPES.BITS64:n.offset+=8;break;case e.WIRE_TYPES.LDELIM:r=n.readVarint32(),n.offset+=r;break;case e.WIRE_TYPES.STARTGROUP:o(s,n);break;case e.WIRE_TYPES.ENDGROUP:if(s===t)return!1;throw Error("Illegal GROUPEND after unknown group: "+s+" ("+t+" expected)");case e.WIRE_TYPES.BITS32:n.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+t+": "+i)}return!0}var i,s,a,u,c,l,d,p,h,_,g,f,E,I,T,C,v={},R=function(e,t,n){this.builder=e,this.parent=t,this.name=n,this.className},y=R.prototype;return y.fqn=function(){for(var e=this.name,t=this;null!=(t=t.parent);)e=t.name+"."+e;return e},y.toString=function(e){return(e?this.className+" ":"")+this.fqn()},y.build=function(){throw Error(this.toString(!0)+" cannot be built directly")},v.T=R,i=function(e,t,n,r,o){R.call(this,e,t,n),this.className="Namespace",this.children=[],this.options=r||{},this.syntax=o||"proto2"},(s=i.prototype=Object.create(R.prototype)).getChildren=function(e){var t,n,r;if(null==(e=e||null))return this.children.slice();for(t=[],n=0,r=this.children.length;r>n;++n)this.children[n]instanceof e&&t.push(this.children[n]);return t},s.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)},s.getChild=function(e){var t,n,r="number"==typeof e?"id":"name";for(t=0,n=this.children.length;n>t;++t)if(this.children[t][r]===e)return this.children[t];return null},s.resolve=function(e,t){var n,r="string"==typeof e?e.split("."):e,o=this,i=0;if(""===r[i]){for(;null!==o.parent;)o=o.parent;i++}do{do{if(!(o instanceof v.Namespace)){o=null;break}if(!((n=o.getChild(r[i]))&&n instanceof v.T&&(!t||n instanceof v.Namespace))){o=null;break}o=n,i++}while(i<r.length);if(null!=o)break;if(null!==this.parent)return this.parent.resolve(e,t)}while(null!=o);return o},s.qn=function(e){var t,n,r=[],o=e;do{r.unshift(o.name),o=o.parent}while(null!==o);for(t=1;t<=r.length;t++)if(n=r.slice(r.length-t),e===this.resolve(n,e instanceof v.Namespace))return n.join(".");return e.fqn()},s.build=function(){var e,t,n,r={},o=this.children;for(t=0,n=o.length;n>t;++t)(e=o[t])instanceof i&&(r[e.name]=e.build());return Object.defineProperty&&Object.defineProperty(r,"$options",{value:this.buildOpt()}),r},s.buildOpt=function(){var e,t,n,r,o={},i=Object.keys(this.options);for(e=0,t=i.length;t>e;++e)n=i[e],r=this.options[i[e]],o[n]=r;return o},s.getOption=function(e){return void 0===e?this.options:void 0!==this.options[e]?this.options[e]:null},v.Namespace=i,a=function(t,n,r,o){if(this.type=t,this.resolvedType=n,this.isMapKey=r,this.syntax=o,r&&e.MAP_KEY_TYPES.indexOf(t)<0)throw Error("Invalid map key type: "+t.name)},u=a.prototype,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},u.verifyValue=function(r){var o,i,s,a=function(e,t){throw Error("Illegal value for "+this.toString(!0)+" of type "+this.type.name+": "+e+" ("+t+")")}.bind(this);switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:return("number"!=typeof r||r==r&&r%1!=0)&&a(typeof r,"not an integer"),r>4294967295?0|r:r;case e.TYPES.uint32:case e.TYPES.fixed32:return("number"!=typeof r||r==r&&r%1!=0)&&a(typeof r,"not an integer"),r<0?r>>>0:r;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:if(e.Long)try{return n(r,!1)}catch(e){a(typeof r,e.message)}else a(typeof r,"requires Long.js");case e.TYPES.uint64:case e.TYPES.fixed64:if(e.Long)try{return n(r,!0)}catch(e){a(typeof r,e.message)}else a(typeof r,"requires Long.js");case e.TYPES.bool:return"boolean"!=typeof r&&a(typeof r,"not a boolean"),r;case e.TYPES.float:case e.TYPES.double:return"number"!=typeof r&&a(typeof r,"not a number"),r;case e.TYPES.string:return"string"==typeof r||r&&r instanceof String||a(typeof r,"not a string"),""+r;case e.TYPES.bytes:return t.isByteBuffer(r)?r:t.wrap(r);case e.TYPES.enum:for(o=this.resolvedType.getChildren(e.Reflect.Enum.Value),s=0;s<o.length;s++){if(o[s].name==r)return o[s].id;if(o[s].id==r)return o[s].id}if("proto3"===this.syntax)return("number"!=typeof r||r==r&&r%1!=0)&&a(typeof r,"not an integer"),(r>4294967295||r<0)&&a(typeof r,"not in range for uint32"),r;a(r,"not a valid enum value");case e.TYPES.group:case e.TYPES.message:if(r&&"object"==typeof r||a(typeof r,"object expected"),r instanceof this.resolvedType.clazz)return r;if(r instanceof e.Builder.Message){for(s in i={},r)r.hasOwnProperty(s)&&(i[s]=r[s]);r=i}return new this.resolvedType.clazz(r)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+r+" (undefined type "+this.type+")")},u.calculateLength=function(t,n){if(null===n)return 0;var o;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 o=r.calculateUTF8Bytes(n),r.calculateVarint32(o)+o;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 o=this.resolvedType.calculate(n),r.calculateVarint32(o)+o;case e.TYPES.group:return(o=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,o){var i,s;if(null===n)return o;switch(this.type){case e.TYPES.int32:n<0?o.writeVarint64(n):o.writeVarint32(n);break;case e.TYPES.uint32:o.writeVarint32(n);break;case e.TYPES.sint32:o.writeVarint32ZigZag(n);break;case e.TYPES.fixed32:o.writeUint32(n);break;case e.TYPES.sfixed32:o.writeInt32(n);break;case e.TYPES.int64:case e.TYPES.uint64:o.writeVarint64(n);break;case e.TYPES.sint64:o.writeVarint64ZigZag(n);break;case e.TYPES.fixed64:o.writeUint64(n);break;case e.TYPES.sfixed64:o.writeInt64(n);break;case e.TYPES.bool:"string"==typeof n?o.writeVarint32("false"===n.toLowerCase()?0:!!n):o.writeVarint32(n?1:0);break;case e.TYPES.enum:o.writeVarint32(n);break;case e.TYPES.float:o.writeFloat32(n);break;case e.TYPES.double:o.writeFloat64(n);break;case e.TYPES.string:o.writeVString(n);break;case e.TYPES.bytes:if(n.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+n.remaining()+" bytes remaining");i=n.offset,o.writeVarint32(n.remaining()),o.append(n),n.offset=i;break;case e.TYPES.message:s=(new r).LE(),this.resolvedType.encode(n,s),o.writeVarint32(s.offset),o.append(s.flip());break;case e.TYPES.group:this.resolvedType.encode(n,o),o.writeVarint32(t<<3|e.WIRE_TYPES.ENDGROUP);break;default:throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+n+" (unknown type)")}return o},u.decode=function(t,n,r){if(n!=this.type.wireType)throw Error("Unexpected wire type for element");var o,i;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(i=t.readVarint32(),t.remaining()<i)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+i+" required but got only "+t.remaining());return(o=t.clone()).limit=o.offset+i,t.offset+=i,o;case e.TYPES.message:return i=t.readVarint32(),this.resolvedType.decode(t,i);case e.TYPES.group:return this.resolvedType.decode(t,-1,r)}throw Error("[INTERNAL] Illegal decode type")},u.valueFromString=function(t){if(!this.isMapKey)throw Error("valueFromString() called on non-map-key element");switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return this.verifyValue(parseInt(t));case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return this.verifyValue(t);case e.TYPES.bool:return"true"===t;case e.TYPES.string:return this.verifyValue(t);case e.TYPES.bytes:return r.fromBinary(t)}},u.valueToString=function(t){if(!this.isMapKey)throw Error("valueToString() called on non-map-key element");return this.type===e.TYPES.bytes?t.toString("binary"):t.toString()},v.Element=a,c=function(e,t,n,r,o,s){i.call(this,e,t,n,r,s),this.className="Message",this.extensions=void 0,this.clazz=null,this.isGroup=!!o,this._fields=null,this._fieldsById=null,this._fieldsByName=null},(l=c.prototype=Object.create(i.prototype)).build=function(n){var o,i,s,a;if(this.clazz&&!n)return this.clazz;for(o=function(e,n){function o(t,n,i,s){var a,u,c,l,d,p,h;if(null===t||"object"!=typeof t)return s&&s instanceof e.Reflect.Enum&&null!==(a=e.Reflect.Enum.getName(s.object,t))?a:t;if(r.isByteBuffer(t))return n?t.toBase64():t.toBuffer();if(e.Long.isLong(t))return i?t.toString():e.Long.fromValue(t);if(Array.isArray(t))return u=[],t.forEach((function(e,t){u[t]=o(e,n,i,s)})),u;if(u={},t instanceof e.Map){for(l=(c=t.entries()).next();!l.done;l=c.next())u[t.keyElem.valueToString(l.value[0])]=o(l.value[1],n,i,t.valueElem.resolvedType);return u}for(h in d=t.$type,p=void 0,t)t.hasOwnProperty(h)&&(u[h]=d&&(p=d.getChild(h))?o(t[h],n,i,p.resolvedType):o(t[h],n,i));return u}var i,s,a=n.getChildren(e.Reflect.Message.Field),u=n.getChildren(e.Reflect.Message.OneOf),c=function(t){var o,i,s,l;for(e.Builder.Message.call(this),o=0,i=u.length;i>o;++o)this[u[o].name]=null;for(o=0,i=a.length;i>o;++o)this[(s=a[o]).name]=s.repeated?[]:s.map?new e.Map(s):null,!s.required&&"proto3"!==n.syntax||null===s.defaultValue||(this[s.name]=s.defaultValue);if(arguments.length>0)if(1!==arguments.length||null===t||"object"!=typeof t||!("function"!=typeof t.encode||t instanceof c)||Array.isArray(t)||t instanceof e.Map||r.isByteBuffer(t)||t instanceof ArrayBuffer||e.Long&&t instanceof e.Long)for(o=0,i=arguments.length;i>o;++o)void 0!==(l=arguments[o])&&this.$set(a[o].name,l);else this.$set(t)},l=c.prototype=Object.create(e.Builder.Message.prototype);for(l.add=function(t,r,o){var i=n._fieldsByName[t];if(!o){if(!i)throw Error(this+"#"+t+" is undefined");if(!(i instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+i.toString(!0));if(!i.repeated)throw Error(this+"#"+t+" is not a repeated field");r=i.verifyValue(r,!0)}return null===this[t]&&(this[t]=[]),this[t].push(r),this},l.$add=l.add,l.set=function(t,r,o){var i,s,a;if(t&&"object"==typeof t){for(i in o=r,t)t.hasOwnProperty(i)&&void 0!==(r=t[i])&&this.$set(i,r,o);return this}if(s=n._fieldsByName[t],o)this[t]=r;else{if(!s)throw Error(this+"#"+t+" is not a field: undefined");if(!(s instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+s.toString(!0));this[s.name]=r=s.verifyValue(r)}return s&&s.oneof&&(a=this[s.oneof.name],null!==r?(null!==a&&a!==s.name&&(this[a]=null),this[s.oneof.name]=s.name):a===t&&(this[s.oneof.name]=null)),this},l.$set=l.set,l.get=function(t,r){if(r)return this[t];var o=n._fieldsByName[t];if(!(o&&o instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: undefined");if(!(o instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+o.toString(!0));return this[o.name]},l.$get=l.get,i=0;i<a.length;i++)(s=a[i])instanceof e.Reflect.Message.ExtensionField||n.builder.options.populateAccessors&&function(e){var t,r,o,i=e.originalName.replace(/(_[a-zA-Z])/g,(function(e){return e.toUpperCase().replace("_","")}));i=i.substring(0,1).toUpperCase()+i.substring(1),t=e.originalName.replace(/([A-Z])/g,(function(e){return"_"+e})),r=function(t,n){return this[e.name]=n?t:e.verifyValue(t),this},o=function(){return this[e.name]},null===n.getChild("set"+i)&&(l["set"+i]=r),null===n.getChild("set_"+t)&&(l["set_"+t]=r),null===n.getChild("get"+i)&&(l["get"+i]=o),null===n.getChild("get_"+t)&&(l["get_"+t]=o)}(s);return l.encode=function(e,r){var o,i;"boolean"==typeof e&&(r=e,e=void 0),o=!1,e||(e=new t,o=!0),i=e.littleEndian;try{return n.encode(this,e.LE(),r),(o?e.flip():e).LE(i)}catch(t){throw e.LE(i),t}},c.encode=function(e,t,n){return new c(e).encode(t,n)},l.calculate=function(){return n.calculate(this)},l.encodeDelimited=function(e){var t,o=!1;return e||(e=new r,o=!0),t=(new r).LE(),n.encode(this,t).flip(),e.writeVarint32(t.remaining()),e.append(t),o?e.flip():e},l.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toArrayBuffer()),e}},l.toArrayBuffer=l.encodeAB,l.encodeNB=function(){try{return this.encode().toBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBuffer()),e}},l.toBuffer=l.encodeNB,l.encode64=function(){try{return this.encode().toBase64()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBase64()),e}},l.toBase64=l.encode64,l.encodeHex=function(){try{return this.encode().toHex()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toHex()),e}},l.toHex=l.encodeHex,l.toRaw=function(e,t){return o(this,!!e,!!t,this.$type)},l.encodeJSON=function(){return JSON.stringify(o(this,!0,!0,this.$type))},c.decode=function(e,t){var o,i;"string"==typeof e&&(e=r.wrap(e,t||"base64")),o=(e=r.isByteBuffer(e)?e:r.wrap(e)).littleEndian;try{return i=n.decode(e.LE()),e.LE(o),i}catch(t){throw e.LE(o),t}},c.decodeDelimited=function(e,t){var o,i,s;if("string"==typeof e&&(e=r.wrap(e,t||"base64")),(e=r.isByteBuffer(e)?e:r.wrap(e)).remaining()<1)return null;if(o=e.offset,i=e.readVarint32(),e.remaining()<i)return e.offset=o,null;try{return s=n.decode(e.slice(e.offset,e.offset+i).LE()),e.offset+=i,s}catch(t){throw e.offset+=i,t}},c.decode64=function(e){return c.decode(e,"base64")},c.decodeHex=function(e){return c.decode(e,"hex")},c.decodeJSON=function(e){return new c(JSON.parse(e))},l.toString=function(){return n.toString()},Object.defineProperty&&(Object.defineProperty(c,"$options",{value:n.buildOpt()}),Object.defineProperty(l,"$options",{value:c.$options}),Object.defineProperty(c,"$type",{value:n}),Object.defineProperty(l,"$type",{value:n})),c}(e,this),this._fields=[],this._fieldsById={},this._fieldsByName={},s=0,a=this.children.length;a>s;s++)if((i=this.children[s])instanceof g||i instanceof c||i instanceof I){if(o.hasOwnProperty(i.name))throw Error("Illegal reflect child of "+this.toString(!0)+": "+i.toString(!0)+" cannot override static property '"+i.name+"'");o[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||i instanceof E))throw Error("Illegal reflect child of "+this.toString(!0)+": "+this.children[s].toString(!0));return this.clazz=o},l.encode=function(e,t,n){var r,o,i,s,a,u=null;for(i=0,s=this._fields.length;s>i;++i)o=e[(r=this._fields[i]).name],r.required&&null===o?null===u&&(u=r):r.encode(n?o:r.verifyValue(o),t,e);if(null!==u)throw(a=Error("Missing at least one required field for "+this.toString(!0)+": "+u)).encoded=t,a;return t},l.calculate=function(e){for(var t,n,r=0,o=0,i=this._fields.length;i>o;++o){if(n=e[(t=this._fields[o]).name],t.required&&null===n)throw Error("Missing at least one required field for "+this.toString(!0)+": "+t);r+=t.calculate(n,e)}return r},l.decode=function(t,n,r){var i,s,a,u,c,l,d,p,h,_,g,f;for(n="number"==typeof n?n:-1,c=t.offset,l=new this.clazz;t.offset<c+n||-1===n&&t.remaining()>0;){if(a=(i=t.readVarint32())>>>3,(s=7&i)===e.WIRE_TYPES.ENDGROUP){if(a!==r)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+a+" ("+(r?r+" expected":"not a group")+")");break}if(u=this._fieldsById[a])u.repeated&&!u.options.packed?l[u.name].push(u.decode(s,t)):u.map?(p=u.decode(s,t),l[u.name].set(p[0],p[1])):(l[u.name]=u.decode(s,t),u.oneof&&(null!==(h=l[u.oneof.name])&&h!==u.name&&(l[h]=null),l[u.oneof.name]=u.name));else switch(s){case e.WIRE_TYPES.VARINT:t.readVarint32();break;case e.WIRE_TYPES.BITS32:t.offset+=4;break;case e.WIRE_TYPES.BITS64:t.offset+=8;break;case e.WIRE_TYPES.LDELIM:d=t.readVarint32(),t.offset+=d;break;case e.WIRE_TYPES.STARTGROUP:for(;o(a,t););break;default:throw Error("Illegal wire type for unknown field "+a+" in "+this.toString(!0)+"#decode: "+s)}}for(_=0,g=this._fields.length;g>_;++_)if(null===l[(u=this._fields[_]).name])if("proto3"===this.syntax)l[u.name]=u.defaultValue;else{if(u.required)throw(f=Error("Missing at least one required field for "+this.toString(!0)+": "+u.name)).decoded=l,f;e.populateDefaults&&null!==u.defaultValue&&(l[u.name]=u.defaultValue)}return l},v.Message=c,d=function(t,n,r,o,i,s,a,u,l,d){R.call(this,t,n,s),this.className="Message.Field",this.required="required"===r,this.repeated="repeated"===r,this.map="map"===r,this.keyType=o||null,this.type=i,this.resolvedType=null,this.id=a,this.options=u||{},this.defaultValue=null,this.oneof=l||null,this.syntax=d||"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=d.prototype=Object.create(R.prototype)).build=function(){this.element=new a(this.type,this.resolvedType,!1,this.syntax),this.map&&(this.keyElement=new a(this.keyType,void 0,!0,this.syntax)),"proto3"!==this.syntax||this.repeated||this.map?void 0!==this.options.default&&(this.defaultValue=this.verifyValue(this.options.default)):this.defaultValue=a.defaultFieldValue(this.type)},p.verifyValue=function(t,n){var r,o,i;if(n=n||!1,r=function(e,t){throw Error("Illegal value for "+this.toString(!0)+" of type "+this.type.name+": "+e+" ("+t+")")}.bind(this),null===t)return this.required&&r(typeof t,"required"),"proto3"===this.syntax&&this.type!==e.TYPES.message&&r(typeof t,"proto3 field without field presence cannot be null"),null;if(this.repeated&&!n){for(Array.isArray(t)||(t=[t]),i=[],o=0;o<t.length;o++)i.push(this.element.verifyValue(t[o]));return i}return this.map&&!n?t instanceof e.Map?t:(t instanceof Object||r(typeof t,"expected ProtoBuf.Map or raw object for map field"),new e.Map(this,t)):(!this.repeated&&Array.isArray(t)&&r(typeof t,"no array expected"),this.element.verifyValue(t))},p.hasWirePresence=function(t,n){if("proto3"!==this.syntax)return null!==t;if(this.oneof&&n[this.oneof.name]===this.name)return!0;switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return 0!==t;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return 0!==t.low||0!==t.high;case e.TYPES.bool:return t;case e.TYPES.float:case e.TYPES.double:return 0!==t;case e.TYPES.string:return t.length>0;case e.TYPES.bytes:return t.remaining()>0;case e.TYPES.enum:return 0!==t;case e.TYPES.message:return null!==t;default:return!0}},p.encode=function(t,n,o){var i,s,a,u,c;if(null===this.type||"object"!=typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===t||this.repeated&&0==t.length)return n;try{if(this.repeated)if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(n.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),n.ensureCapacity(n.offset+=1),s=n.offset,i=0;i<t.length;i++)this.element.encodeValue(this.id,t[i],n);a=n.offset-s,(u=r.calculateVarint32(a))>1&&(c=n.slice(s,n.offset),s+=u-1,n.offset=s,n.append(c)),n.writeVarint32(a,s-u)}else for(i=0;i<t.length;i++)n.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,t[i],n);else this.map?t.forEach((function(t,o){var i=r.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,o)+r.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,t);n.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),n.writeVarint32(i),n.writeVarint32(8|this.keyType.wireType),this.keyElement.encodeValue(1,o,n),n.writeVarint32(16|this.type.wireType),this.element.encodeValue(2,t,n)}),this):this.hasWirePresence(t,o)&&(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){var o,i,s;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;o=0;try{if(this.repeated)if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(o+=r.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),s=0,i=0;i<t.length;i++)s+=this.element.calculateLength(this.id,t[i]);o+=r.calculateVarint32(s),o+=s}else for(i=0;i<t.length;i++)o+=r.calculateVarint32(this.id<<3|this.type.wireType),o+=this.element.calculateLength(this.id,t[i]);else this.map?t.forEach((function(t,n){var i=r.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,n)+r.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,t);o+=r.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),o+=r.calculateVarint32(i),o+=i}),this):this.hasWirePresence(t,n)&&(o+=r.calculateVarint32(this.id<<3|this.type.wireType),o+=this.element.calculateLength(this.id,t))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+t+" ("+e+")")}return o},p.decode=function(t,n,r){var o,i,s,u,c,l,d;if(!(!this.map&&t==this.type.wireType||!r&&this.repeated&&this.options.packed&&t==e.WIRE_TYPES.LDELIM||this.map&&t==e.WIRE_TYPES.LDELIM))throw Error("Illegal wire type for field "+this.toString(!0)+": "+t+" ("+this.type.wireType+" expected)");if(t==e.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0&&!r){for(i=n.readVarint32(),i=n.offset+i,s=[];n.offset<i;)s.push(this.decode(this.type.wireType,n,!0));return s}if(this.map){if(u=a.defaultFieldValue(this.keyType),o=a.defaultFieldValue(this.type),i=n.readVarint32(),n.remaining()<i)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+i+" required but got only "+n.remaining());for((c=n.clone()).limit=c.offset+i,n.offset+=i;c.remaining()>0;)if(t=7&(l=c.readVarint32()),1===(d=l>>>3))u=this.keyElement.decode(c,t,d);else{if(2!==d)throw Error("Unexpected tag in map field key/value submessage");o=this.element.decode(c,t,d)}return[u,o]}return this.element.decode(n,t,this.id)},v.Message.Field=d,h=function(e,t,n,r,o,i,s){d.call(this,e,t,n,null,r,o,i,s),this.extension},h.prototype=Object.create(d.prototype),v.Message.ExtensionField=h,_=function(e,t,n){R.call(this,e,t,n),this.fields=[]},v.Message.OneOf=_,g=function(e,t,n,r,o){i.call(this,e,t,n,r,o),this.className="Enum",this.object=null},g.getName=function(e,t){var n,r,o=Object.keys(e);for(r=0;r<o.length;++r)if(e[n=o[r]]===t)return n;return null},(g.prototype=Object.create(i.prototype)).build=function(t){var n,r,o,i;if(this.object&&!t)return this.object;for(n=new e.Builder.Enum,o=0,i=(r=this.getChildren(g.Value)).length;i>o;++o)n[r[o].name]=r[o].id;return Object.defineProperty&&Object.defineProperty(n,"$options",{value:this.buildOpt(),enumerable:!1}),this.object=n},v.Enum=g,f=function(e,t,n,r){R.call(this,e,t,n),this.className="Enum.Value",this.id=r},f.prototype=Object.create(R.prototype),v.Enum.Value=f,E=function(e,t,n,r){R.call(this,e,t,n),this.field=r},E.prototype=Object.create(R.prototype),v.Extension=E,I=function(e,t,n,r){i.call(this,e,t,n,r),this.className="Service",this.clazz=null},(I.prototype=Object.create(i.prototype)).build=function(t){return this.clazz&&!t?this.clazz:this.clazz=function(e,t){var n,o=function(t){e.Builder.Service.call(this),this.rpcImpl=t||function(e,t,n){setTimeout(n.bind(this,Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")),0)}},i=o.prototype=Object.create(e.Builder.Service.prototype),s=t.getChildren(e.Reflect.Service.RPCMethod);for(n=0;n<s.length;n++)!function(e){i[e.name]=function(n,o){try{try{n=e.resolvedRequestType.clazz.decode(r.wrap(n))}catch(e){if(!(e instanceof TypeError))throw e}if(null===n||"object"!=typeof n)throw Error("Illegal arguments");n instanceof e.resolvedRequestType.clazz||(n=new e.resolvedRequestType.clazz(n)),this.rpcImpl(e.fqn(),n,(function(n,r){if(!n){try{r=e.resolvedResponseType.clazz.decode(r)}catch(e){}return r&&r instanceof e.resolvedResponseType.clazz?void o(null,r):void o(Error("Illegal response type received in service method "+t.name+"#"+e.name))}o(n)}))}catch(e){setTimeout(o.bind(this,e),0)}},o[e.name]=function(t,n,r){new o(t)[e.name](n,r)},Object.defineProperty&&(Object.defineProperty(o[e.name],"$options",{value:e.buildOpt()}),Object.defineProperty(i[e.name],"$options",{value:o[e.name].$options}))}(s[n]);return Object.defineProperty&&(Object.defineProperty(o,"$options",{value:t.buildOpt()}),Object.defineProperty(i,"$options",{value:o.$options}),Object.defineProperty(o,"$type",{value:t}),Object.defineProperty(i,"$type",{value:t})),o}(e,this)},v.Service=I,T=function(e,t,n,r){R.call(this,e,t,n),this.className="Service.Method",this.options=r||{}},(T.prototype=Object.create(R.prototype)).buildOpt=s.buildOpt,v.Service.Method=T,C=function(e,t,n,r,o,i,s,a){T.call(this,e,t,n,a),this.className="Service.RPCMethod",this.requestName=r,this.responseName=o,this.requestStream=i,this.responseStream=s,this.resolvedRequestType=null,this.resolvedResponseType=null},C.prototype=Object.create(T.prototype),v.Service.RPCMethod=C,v}(i),i.Builder=function(e,t,n){function r(e){e.messages&&e.messages.forEach((function(t){t.syntax=e.syntax,r(t)})),e.enums&&e.enums.forEach((function(t){t.syntax=e.syntax}))}var o=function(e){this.ns=new n.Namespace(this,null,""),this.ptr=this.ns,this.resolved=!1,this.result=null,this.files={},this.importRoot=null,this.options=e||{}},i=o.prototype;return o.isMessage=function(e){return"string"==typeof e.name&&(void 0===e.values&&void 0===e.rpc)},o.isMessageField=function(e){return"string"==typeof e.rule&&"string"==typeof e.name&&"string"==typeof e.type&&void 0!==e.id},o.isEnum=function(e){return"string"==typeof e.name&&!(void 0===e.values||!Array.isArray(e.values)||0===e.values.length)},o.isService=function(e){return!("string"!=typeof e.name||"object"!=typeof e.rpc||!e.rpc)},o.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 n.Namespace(this,this.ptr,e)),this.ptr=t}),this),this},i.create=function(t){var r,i,s,a,u;if(!t)return this;if(Array.isArray(t)){if(0===t.length)return this;t=t.slice()}else t=[t];for(r=[t];r.length>0;){if(t=r.pop(),!Array.isArray(t))throw Error("not a valid namespace: "+JSON.stringify(t));for(;t.length>0;){if(i=t.shift(),o.isMessage(i)){if(s=new n.Message(this,this.ptr,i.name,i.options,i.isGroup,i.syntax),a={},i.oneofs&&Object.keys(i.oneofs).forEach((function(e){s.addChild(a[e]=new n.Message.OneOf(this,s,e))}),this),i.fields&&i.fields.forEach((function(e){if(null!==s.getChild(0|e.id))throw Error("duplicate or invalid field id in "+s.name+": "+e.id);if(e.options&&"object"!=typeof e.options)throw Error("illegal field options in "+s.name+"#"+e.name);var t=null;if("string"==typeof e.oneof&&!(t=a[e.oneof]))throw Error("illegal oneof in "+s.name+"#"+e.name+": "+e.oneof);e=new n.Message.Field(this,s,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,i.syntax),t&&t.fields.push(e),s.addChild(e)}),this),u=[],i.enums&&i.enums.forEach((function(e){u.push(e)})),i.messages&&i.messages.forEach((function(e){u.push(e)})),i.services&&i.services.forEach((function(e){u.push(e)})),i.extensions&&(s.extensions="number"==typeof i.extensions[0]?[i.extensions]:i.extensions),this.ptr.addChild(s),u.length>0){r.push(t),t=u,u=null,this.ptr=s,s=null;continue}u=null}else if(o.isEnum(i))s=new n.Enum(this,this.ptr,i.name,i.options,i.syntax),i.values.forEach((function(e){s.addChild(new n.Enum.Value(this,s,e.name,e.id))}),this),this.ptr.addChild(s);else if(o.isService(i))s=new n.Service(this,this.ptr,i.name,i.options),Object.keys(i.rpc).forEach((function(e){var t=i.rpc[e];s.addChild(new n.Service.RPCMethod(this,s,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))}),this),this.ptr.addChild(s);else{if(!o.isExtend(i))throw Error("not a valid definition: "+JSON.stringify(i));if(s=this.ptr.resolve(i.ref,!0))i.fields.forEach((function(t){var r,o,i,a;if(null!==s.getChild(0|t.id))throw Error("duplicate extended field id in "+s.name+": "+t.id);if(s.extensions&&(r=!1,s.extensions.forEach((function(e){t.id>=e[0]&&t.id<=e[1]&&(r=!0)})),!r))throw Error("illegal extended field id in "+s.name+": "+t.id+" (not within valid ranges)");o=t.name,this.options.convertFieldsToCamelCase&&(o=e.Util.toCamelCase(o)),i=new n.Message.ExtensionField(this,s,t.rule,t.type,this.ptr.fqn()+"."+o,t.id,t.options),a=new n.Extension(this,this.ptr,t.name,i),i.extension=a,this.ptr.addChild(a),s.addChild(i)}),this);else if(!/\.?google\.protobuf\./.test(i.ref))throw Error("extended message "+i.ref+" is not defined")}i=null,s=null}t=null,this.ptr=this.ptr.parent}return this.resolved=!1,this.result=null,this},i.import=function(t,n){var o,i,s,a,u,c,l,d,p="/";if("string"==typeof n){if(e.Util.IS_NODE,!0===this.files[n])return this.reset();this.files[n]=!0}else if("object"==typeof n){if(o=n.root,e.Util.IS_NODE,(o.indexOf("\\")>=0||n.file.indexOf("\\")>=0)&&(p="\\"),i=o+p+n.file,!0===this.files[i])return this.reset();this.files[i]=!0}if(t.imports&&t.imports.length>0){for(a=!1,"object"==typeof n?(this.importRoot=n.root,a=!0,s=this.importRoot,n=n.file,(s.indexOf("\\")>=0||n.indexOf("\\")>=0)&&(p="\\")):"string"==typeof n?this.importRoot?s=this.importRoot:n.indexOf("/")>=0?""===(s=n.replace(/\/[^\/]*$/,""))&&(s="/"):n.indexOf("\\")>=0?(s=n.replace(/\\[^\\]*$/,""),p="\\"):s=".":s=null,u=0;u<t.imports.length;u++)if("string"==typeof t.imports[u]){if(!s)throw Error("cannot determine import root");if("google/protobuf/descriptor.proto"===(c=t.imports[u]))continue;if(c=s+p+c,!0===this.files[c])continue;if(/\.proto$/i.test(c)&&!e.DotProto&&(c=c.replace(/\.proto$/,".json")),null===(l=e.Util.fetch(c)))throw Error("failed to import '"+c+"' in '"+n+"': file not found");/\.json$/i.test(c)?this.import(JSON.parse(l+""),c):this.import(e.DotProto.Parser.parse(l),c)}else n?/\.(\w+)$/.test(n)?this.import(t.imports[u],n.replace(/^(.+)\.(\w+)$/,(function(e,t,n){return t+"_import"+u+"."+n}))):this.import(t.imports[u],n+"_import"+u):this.import(t.imports[u]);a&&(this.importRoot=null)}return t.package&&this.define(t.package),t.syntax&&r(t),d=this.ptr,t.options&&Object.keys(t.options).forEach((function(e){d.options[e]=t.options[e]})),t.messages&&(this.create(t.messages),this.ptr=d),t.enums&&(this.create(t.enums),this.ptr=d),t.services&&(this.create(t.services),this.ptr=d),t.extends&&this.create(t.extends),this.reset()},i.resolveAll=function(){var r;if(null==this.ptr||"object"==typeof this.ptr.type)return this;if(this.ptr instanceof n.Namespace)this.ptr.children.forEach((function(e){this.ptr=e,this.resolveAll()}),this);else if(this.ptr instanceof n.Message.Field){if(t.TYPE.test(this.ptr.type))this.ptr.type=e.TYPES[this.ptr.type];else{if(!t.TYPEREF.test(this.ptr.type))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(!(r=(this.ptr instanceof n.Message.ExtensionField?this.ptr.extension.parent:this.ptr.parent).resolve(this.ptr.type,!0)))throw Error("unresolvable type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(this.ptr.resolvedType=r,r instanceof n.Enum){if(this.ptr.type=e.TYPES.enum,"proto3"===this.ptr.syntax&&"proto3"!==r.syntax)throw Error("proto3 message cannot reference proto2 enum")}else{if(!(r instanceof n.Message))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);this.ptr.type=r.isGroup?e.TYPES.group:e.TYPES.message}}if(this.ptr.map){if(!t.TYPE.test(this.ptr.keyType))throw Error("illegal key type for map field in "+this.ptr.toString(!0)+": "+this.ptr.keyType);this.ptr.keyType=e.TYPES[this.ptr.keyType]}}else if(this.ptr instanceof e.Reflect.Service.Method){if(!(this.ptr instanceof e.Reflect.Service.RPCMethod))throw Error("illegal service type in "+this.ptr.toString(!0));if(!((r=this.ptr.parent.resolve(this.ptr.requestName,!0))&&r instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.requestName);if(this.ptr.resolvedRequestType=r,!((r=this.ptr.parent.resolve(this.ptr.responseName,!0))&&r instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.responseName);this.ptr.resolvedResponseType=r}else if(!(this.ptr instanceof e.Reflect.Message.OneOf||this.ptr instanceof e.Reflect.Extension||this.ptr instanceof e.Reflect.Enum.Value))throw Error("illegal object in namespace: "+typeof this.ptr+": "+this.ptr);return this.reset()},i.build=function(e){var t,n,r;if(this.reset(),this.resolved||(this.resolveAll(),this.resolved=!0,this.result=null),null===this.result&&(this.result=this.ns.build()),!e)return this.result;for(t="string"==typeof e?e.split("."):e,n=this.result,r=0;r<t.length;r++){if(!n[t[r]]){n=null;break}n=n[t[r]]}return n},i.lookup=function(e,t){return e?this.ns.resolve(e,t):this.ns},i.toString=function(){return"Builder"},o.Message=function(){},o.Enum=function(){},o.Service=function(){},o}(i,i.Lang,i.Reflect),i.Map=function(e,t){function n(e){var t=0;return{next:function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}}var r=function(e,n){var r,o,i,s;if(!e.map)throw Error("field is not a map");if(this.field=e,this.keyElem=new t.Element(e.keyType,null,!0,e.syntax),this.valueElem=new t.Element(e.type,e.resolvedType,!1,e.syntax),this.map={},Object.defineProperty(this,"size",{get:function(){return Object.keys(this.map).length}}),n)for(r=Object.keys(n),o=0;o<r.length;o++)i=this.keyElem.valueFromString(r[o]),s=this.valueElem.verifyValue(n[r[o]]),this.map[this.keyElem.valueToString(i)]={key:i,value:s}},o=r.prototype;return o.clear=function(){this.map={}},o.delete=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e)),n=t in this.map;return delete this.map[t],n},o.entries=function(){var e,t,r=[],o=Object.keys(this.map);for(t=0;t<o.length;t++)r.push([(e=this.map[o[t]]).key,e.value]);return n(r)},o.keys=function(){var e,t=[],r=Object.keys(this.map);for(e=0;e<r.length;e++)t.push(this.map[r[e]].key);return n(t)},o.values=function(){var e,t=[],r=Object.keys(this.map);for(e=0;e<r.length;e++)t.push(this.map[r[e]].value);return n(t)},o.forEach=function(e,t){var n,r,o=Object.keys(this.map);for(r=0;r<o.length;r++)e.call(t,(n=this.map[o[r]]).value,n.key,this)},o.set=function(e,t){var n=this.keyElem.verifyValue(e),r=this.valueElem.verifyValue(t);return this.map[this.keyElem.valueToString(n)]={key:n,value:r},this},o.get=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e));return t in this.map?this.map[t].value:void 0},o.has=function(e){return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map},r}(0,i.Reflect),i.loadProto=function(e,t,n){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(n=t,t=void 0),i.loadJson(i.DotProto.Parser.parse(e),t,n)},i.protoFromString=i.loadProto,i.loadProtoFile=function(e,t,n){if(t&&"object"==typeof t?(n=t,t=null):t&&"function"==typeof t||(t=null),t)return i.Util.fetch("string"==typeof e?e:e.root+"/"+e.file,(function(r){if(null!==r)try{t(null,i.loadProto(r,n,e))}catch(e){t(e)}else t(Error("Failed to fetch file"))}));var r=i.Util.fetch("object"==typeof e?e.root+"/"+e.file:e);return null===r?null:i.loadProto(r,n,e)},i.protoFromFile=i.loadProtoFile,i.newBuilder=function(e){return void 0===(e=e||{}).convertFieldsToCamelCase&&(e.convertFieldsToCamelCase=i.convertFieldsToCamelCase),void 0===e.populateAccessors&&(e.populateAccessors=i.populateAccessors),new i.Builder(e)},i.loadJson=function(e,t,n){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(n=t,t=null),t&&"object"==typeof t||(t=i.newBuilder()),"string"==typeof e&&(e=JSON.parse(e)),t.import(e,n),t.resolveAll(),t},i.loadJsonFile=function(e,t,n){if(t&&"object"==typeof t?(n=t,t=null):t&&"function"==typeof t||(t=null),t)return i.Util.fetch("string"==typeof e?e:e.root+"/"+e.file,(function(r){if(null!==r)try{t(null,i.loadJson(JSON.parse(r),n,e))}catch(e){t(e)}else t(Error("Failed to fetch file"))}));var r=i.Util.fetch("object"==typeof e?e.root+"/"+e.file:e);return null===r?null:i.loadJson(JSON.parse(r),n,e)},o=e,i.loadProto(o,void 0,"").build("Modules").probuf}(n,t);return r}var vr=function(e,t,n){if(void 0===t||void 0===n)return e.toUpperCase();var r=e.slice(t,n);return e=e.replace(r,(function(e){return e.toUpperCase()}))},Rr=function(){function e(e,t){this.nestedMap=t,gr.add(this),this.pbModules=Cr(e)}return e.prototype._encode=function(e,t,n){var r=this,o=new this.pbModules[e];if(t)try{Object.keys(t).forEach((function(n){var i=t[n];if(void 0!==i){var s=r.nestedMap.get("".concat(e,"_").concat(n));if(s){var a=i instanceof Array?i.map((function(e){return r._encode(s,e,!0)})):r._encode(s,i,!0);o["set".concat(vr(n,0,1))](a)}else o["set".concat(vr(n,0,1))](i)}}))}catch(t){var i="name: ".concat(e,", stack: ").concat(t.stack);null===console||void 0===console||console.error("pb encode error!",i)}return n?o:o.toArrayBuffer()},e.prototype.encode=function(e,t){return this._encode(e,t)},e.prototype.decode=function(e,t){var n=this.pbModules[e].decode(t);return he(this,gr,"m",fr).call(this,n)},e.prototype.getModule=function(e){return new this.pbModules[e]},e}();gr=new WeakSet,fr=function e(t){var n,r=this;if(t instanceof Array)return t.map((function(t){return he(r,gr,"m",e).call(r,t)}));if(n=t,"[object Object]"!==Object.prototype.toString.call(n))return t;if(t.buffer instanceof ArrayBuffer&&"number"==typeof t.offset&&"number"==typeof t.limit){var o=t.buffer,i=t.offset,s=t.limit;return o.slice(i,s)}if(void 0!==t.low&&void 0!==t.high&&Object.prototype.hasOwnProperty.call(t,"unsigned")){var a=t.low;return a<0&&(a+=4294967296),a=a.toString(16),parseInt(t.high.toString(16)+"00000000".replace(new RegExp("0{".concat(a.length,"}$")),a),16)}var u=t;return Object.keys(t).forEach((function(n){u[n]=he(r,gr,"m",e).call(r,t[n])})),u};var yr,mr,Sr,Ar,Nr="NotifyMsg",Or="SyncRequestMsg",Mr="UpStreamMessage",Lr="PushExtra",Ur="DownStreamMessages",br="DownStreamMessage",Pr="GetQNupTokenInput",wr="GetDownloadUrlInput",xr="GetQNupTokenOutput",Dr="GetDownloadUrlOutput",Vr="ChrmInput",Gr="ChrmOutput",kr="ChrmPullMsg",Fr="RelationQryInput",Br="RelationsInput",Hr="RelationsOutput",qr="QryRemindListReq",Yr="QryRemindListResp",Kr="CleanHisMsgInput",Qr="CleanMsgBatchReq",Wr="QueryChatRoomInfoInput",jr="QueryChatRoomInfoOutput",Jr="HistoryMsgInput",zr="HistoryMsgOuput",Zr="SessionsAttQryInput",Xr="SessionsAttOutput",$r="SessionMsgReadInput",eo="DeleteSessionsInput",to="SessionInfo",no="QuerySessionsInput",ro="QuerySessionsOutPut",oo="RelationDelBatchReq",io="RelationOpInput",so="DeleteMsgInput",ao="SetChrmKV",uo="SetChrmKVS",co="ChrmKVOutput",lo="ChrmKVSOutput",po="QueryChrmKV",ho="SetUserSettingOutput",_o="PullUserSettingInput",go="PullUserSettingOutput",fo="SessionReq",Eo="SessionStates",Io="SessionState",To="SessionStateItem",Co="SessionStateModifyReq",vo="GroupUnpushQuery",Ro="GroupUnpushSet",yo="GroupUnpushResult",mo="SessionStateModifyResp",So="TypeUnpushInput",Ao="TypeUnpushOutput",No="GrpReadReceiptMsg",Oo="GrpReadReceiptQryResp",Mo="SessionTagAddInput",Lo="SessionTagItem",Uo="SessionTagDelInput",bo="SessionDisTagReq",Po="UserSettingNotification",wo="ReportSDKInput",xo="UltraGrpPullSes",Do="UltraGrpPullMsg",Vo="MsgChangeReq",Go="QueryMsgChange",ko="EventChangeList",Fo="MsgChangeList",Bo="MsgQuery",Ho="MsgQueryAck",qo="OperateStatus",Yo="OperateStatusNotify",Ko="SetRtcRoomIdInput",Qo="CallInfoUpStream",Wo="CallInfoDownStream",jo="KvInput",Jo="KvOutput",zo="ReadReceiptMsg",Zo="ReceiptQryReq",Xo="QueryReceiptResp",$o="ReceiptCntQryReq",ei="ReceiptCntQryResp",ti="UpdateUserSubReq",ni="UserSubDetail",ri="UpdateUserSubResp",oi="PullUserSubReq",ii="PUllUserSubResp",si="PullSubDataReq",ai="PullSubDataResp",ui="SubDataDetail",ci="QrySubDataReq",li="UserProfile",di="ProfileInfo",pi="SetUserProfileResp",hi="PullUserProfileReq",_i="UserProfiles",gi="UserProfileInput",fi="UserProfilePermission",Ei="SearchUserProfile",Ii="ChannelsInput",Ti="ChannelsOutput",Ci="MultiChannels",vi="ModifyChannelsInput",Ri="QuitChannelsSetting",yi="ChannelsQueryInput",mi="ChannelsPageParam",Si="ChannelsListResult",Ai="ChannelsMemberUpdateInput",Ni="ChannelsMemberResponseInput",Oi="ChannelsMembersInput",Mi="FriendInput",Li="FriendsInput",Ui="FriendsCheckOutput",bi="FriendProfileInput",Pi="FriendProfileOutput",wi="FriendQueryInput",xi="FriendsListInput",Di="FriendLevelSet",Vi="FriendUserInfos",Gi="AddUnpushPeriodInput",ki="DeleteUnpushPeriodInput",Fi="QueryUnpushPeriodInput",Bi="QueryUnpushPeriodOutput",Hi=new Map([["UpStreamMessage_pushExt","PushExtra"],["DownStreamMessages_list","DownStreamMessage"],["DownStreamMessage_pushExt","PushExtra"],["ChannelInfosOutput_channels","ChannelInfoOutput"],["GroupMembersOutput_members","MemberInfo"],["GroupInput_groupInfo","GroupInfo"],["RelationsInput_msg","DownStreamMessage"],["RelationsOutput_info","RelationInfo"],["RelationInfo_msg","DownStreamMessage"],["RelationInfo_msgInfo","UnreadMsgInfo"],["QryRemindListResp_msgInfo","UnreadMsgInfo"],["CleanMsgBatchReq_input","CleanHisMsgInput"],["HistoryMessagesOuput_list","DownStreamMessage"],["QueryChatRoomInfoOutput_userInfos","ChrmMember"],["MPFollowOutput_info","MpInfo"],["MCFollowOutput_info","MpInfo"],["SearchMpOutput_info","MpInfo"],["PullMpOutput_info","MpInfo"],["HistoryMsgOuput_list","DownStreamMessage"],["DeleteSessionsInput_sessions","SessionInfo"],["QuerySessionsInput_sessions","SessionInfo"],["QuerySessionsOutPut_sessions","SessionInfo"],["RelationDelBatchReq_relation","RelationOpInput"],["DeleteMsgInput_msgs","DeleteMsg"],["SetChrmKV_entry","ChrmKVEntity"],["SetChrmKV_notification","UpStreamMessage"],["SetChrmKVS_entry","ChrmKVEntity"],["SetChrmKVS_notification","UpStreamMessage"],["DeleteChrmKVS_entry","ChrmKVEntity"],["DeleteChrmKVS_notification","UpStreamMessage"],["ChrmKVOutput_entries","ChrmKVEntity"],["ChrmKVSOutput_errorKeys","ChrmKVSOutputEntity"],["ChrmKVSOutput_keysVersion","ChrmKVSVersionEntity"],["PullUserSettingOutput_items","UserSettingItem"],["UserSettingItem_tags","SessionTagItem"],["SessionStates_state","SessionState"],["SessionState_stateItem","SessionStateItem"],["SessionStateItem_tags","SessionTagItem"],["SessionStateModifyReq_state","SessionState"],["GrpReadReceiptQryResp_list","GrpMsgReadUser"],["SessionTagAddInput_tags","SessionTagItem"],["SessionTagDelInput_tags","SessionTagItem"],["EventChangeList_list","EventChange"],["MsgChangeList_list","MsgChange"],["MsgQuery_query","MessageQueryInfo"],["MsgQueryAck_list","DownStreamMessage"],["OperateStatusNotify_info","OperateInfo"],["OperateStatusNotify_summary","OperateSummary"],["KvOutput_info","KvInfo"],["QueryReceiptResp_list","ReceiptUser"],["ReceiptCntQryResp_result","MsgReadCnt"],["UpdateUserSubReq_subUsers","UserSubDetail"],["UpdateUserSubResp_subUsers","UserSubDetail"],["PUllUserSubResp_list","UserSubList"],["UserSubList_subUsers","UserSubDetail"],["PullSubDataResp_list","SubDataDetail"],["SubDataDetail_data","SubData"],["QrySubDataReq_subUsers","UserSubDetail"],["UserProfile_userProfile","ProfileInfo"],["UserProfile_userExtProfile","ProfileInfo"],["UserProfiles_UserProfile","UserProfile"],["ChannelsInput_settingProfile","ProfileInfo"],["ChannelsInput_extProfile","ProfileInfo"],["ChannelsInput_baseInfo","ChannelBaseInfo"],["ChannelsOutput_channelInfo","ChannelsJoinedInfo"],["ChannelsOutput_userInfos","ChannelsUserInfo"],["ChannelsOutput_friendInviteInfo","FriendInviteInfo"],["ChannelsOutput_friendUserInfo","FriendUserInfo"],["MultiChannels_list","ChannelsInput"],["ModifyChannelsInput_settingInfo","QuitChannelsSetting"],["ChannelsQueryInput_page","ChannelsPageParam"],["ChannelsListResult_page","ChannelsPageParam"],["ChannelsInviteStatusInfos_list","ChannelsInviteStatusInfo"],["ChannelsUserInfos_list","ChannelsUserInfo"],["ChannelsJoinedInfos_list","ChannelsJoinedInfo"],["ChannelsUserInfo_ext","ChannelsUserExtInfo"],["ChannelsJoinedInfo_settingProfile","ProfileInfo"],["ChannelsJoinedInfo_extProfile","ProfileInfo"],["ChannelsJoinedInfo_baseInfo","ChannelBaseInfo"],["ChannelsJoinedInfo_userInfo","ChannelsUserExtInfo"],["ChannelsInviteStatusInfo_joinUserInfo","ChannelsUserInfo"],["ChannelsInviteStatusInfo_inviterInfo","ChannelsUserInfo"],["ChannelsInviteStatusInfo_processInfo","ChannelsUserInfo"],["FriendsOutput_list","FriendOutput"],["FriendsCheckOutput_list","FriendCheckOutput"],["FriendProfileInput_extProfile","ProfileInfo"],["FriendQueryInput_page","ChannelsPageParam"],["FriendUserInfo_extProfile","ProfileInfo"],["FriendUserInfos_list","FriendUserInfo"],["FriendInviteInfos_list","FriendInviteInfo"],["UpdateChannnelInfo_channelInfo","ChannelsJoinedInfo"],["UpdateChannnelInfo_userInfo","ChannelsUserInfo"],["UpdateUserInfo_updatedUserInfo","ChannelsUserInfo"],["UpdateUserInfo_optUserInfo","ChannelsUserInfo"],["ChannelApplyInfo_statusInfo","ChannelsInviteStatusInfo"],["ChannelEventData_optUserInfo","ChannelsUserInfo"],["ChannelEventData_channelInfo","ChannelsJoinedInfo"],["ChannelEventData_userInfos","ChannelsUserInfo"],["ChannelEventData_channelFullInfo","ChannelsJoinedInfo"],["FriendUpdateEvent_extProfile","ProfileInfo"]]);!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"}(yr||(yr={})),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"}(mr||(mr={})),function(e){e[e.GROUP_SUCCESS=0]="GROUP_SUCCESS",e[e.GROUP_FAILURE=1]="GROUP_FAILURE"}(Sr||(Sr={})),function(e){e[e.IsSilent=1]="IsSilent",e[e.IsTop=2]="IsTop",e[e.Tags=3]="Tags"}(Ar||(Ar={}));var qi,Yi,Ki,Qi,Wi,ji,Ji,zi,Zi,Xi=new Rr("package Modules;\nmessage probuf {\n message SetUserStatusOutput {\n optional int32 nothing=1;\n }\n message GetUserStatusInput {\n optional int32 nothing=1;\n }\n message GetUserStatusOutput {\n optional string status=1;\n optional string subUserId=2;\n }\n message SubUserStatusInput {\n repeated string userid =1;\n }\n message SubUserStatusOutput {\n optional int32 nothing=1;\n }\n message VoipDynamicInput {\n required int32 engineType = 1;\n required string channelName = 2;\n optional string channelExtra = 3;\n }\n message VoipDynamicOutput {\n required string dynamicKey=1;\n }\n message NotifyMsg {\n required int32 type = 1;\n optional int64 time = 2;\n optional string chrmId=3;\n }\n message SyncRequestMsg {\n required int64 syncTime = 1;\n required bool ispolling = 2;\n optional bool isweb=3;\n optional bool isPullSend=4;\n optional bool isKeeping=5;\n optional int64 sendBoxSyncTime=6;\n optional int64 broadcastSyncTime=7;\n optional int64 endTime = 8;\n optional bool compressioEnabled = 9;\n }\n message UpStreamMessage {\n required int32 sessionId = 1;\n required string classname = 2;\n required string content = 3;\n optional string pushText = 4;\n optional string appData = 5;\n repeated string toUserIds = 6;\n optional int64 delMsgTime = 7;\n optional string delMsgId = 8;\n optional int32 configFlag = 9;\n optional int64 clientUniqueId = 10;\n optional string extraContent = 11;\n optional PushExtra pushExt = 12;\n optional string busChannel = 13;\n optional string systemId = 16;\n optional string senderPortrait = 21;\n optional int64 optionBits = 22;\n }\n message PushExtra {\n optional string title = 1;\n optional int32 templateIdNoUse= 2;\n optional string pushId = 3;\n optional string pushConfigs = 4;\n optional string templateId = 5;\n }\n message DownStreamMessages {\n repeated DownStreamMessage list = 1;\n required int64 syncTime = 2;\n optional bool finished = 3;\n optional int64 broadcastSyncTime = 4;\n optional int64 systemTime = 5;\n optional int64 credibleStartTime = 6;\n optional int64 credibleEndTime = 7;\n optional bool compressioEnabled = 8;\n optional bytes compressedData = 9;\n }\n message DownStreamMessage {\n required string fromUserId = 1;\n required ChannelType type = 2;\n optional string groupId = 3;\n required string classname = 4;\n required string content = 5;\n required int64 dataTime = 6;\n required int64 status = 7;\n optional int64 extra = 8;\n optional string msgId = 9;\n optional int32 direction = 10;\n optional int32 plantform =11;\n optional int32 isRemoved = 12;\n optional string source = 13;\n optional int64 clientUniqueId = 14;\n optional string extraContent = 15;\n optional string pushContent = 16;\n optional int32 configFlag = 17;\n optional PushExtra pushExt = 18;\n optional string busChannel = 19;\n optional int64 extStatus = 20;\n repeated string toUserIds = 21;\n optional int32 groupUnpush = 22;\n optional int64 optionBits = 23;\n }\n enum ChannelType {\n PERSON = 1;\n PERSONS = 2;\n GROUP = 3;\n TEMPGROUP = 4;\n CUSTOMERSERVICE = 5;\n NOTIFY = 6;\n MC=7;\n MP=8;\n ULTRAGROUP = 10;\n }\n message CreateDiscussionInput {\n optional string name = 1;\n }\n message CreateDiscussionOutput {\n required string id = 1;\n }\n message ChannelInvitationInput {\n repeated string users = 1;\n }\n message LeaveChannelInput {\n required int32 nothing = 1;\n }\n message ChannelEvictionInput {\n required string user = 1;\n }\n message RenameChannelInput {\n required string name = 1;\n }\n message ChannelInfoInput {\n required int32 nothing = 1;\n }\n message ChannelInfoOutput {\n required ChannelType type = 1;\n required string channelId = 2;\n required string channelName = 3;\n required string adminUserId = 4;\n repeated string firstTenUserIds = 5;\n required int32 openStatus = 6;\n }\n message ChannelInfosInput {\n required int32 page = 1;\n optional int32 number = 2;\n }\n message ChannelInfosOutput {\n repeated ChannelInfoOutput channels = 1;\n required int32 total = 2;\n }\n message MemberInfo {\n required string userId = 1;\n required string userName = 2;\n required string userPortrait = 3;\n required string extension = 4;\n }\n message GroupMembersInput {\n required int32 page = 1;\n optional int32 number = 2;\n }\n message GroupMembersOutput {\n repeated MemberInfo members = 1;\n required int32 total = 2;\n }\n message GetUserInfoInput {\n required int32 nothing = 1;\n }\n message GetUserInfoOutput {\n required string userId = 1;\n required string userName = 2;\n required string userPortrait = 3;\n }\n message GetSessionIdInput {\n required int32 nothing = 1;\n }\n message GetSessionIdOutput {\n required int32 sessionId = 1;\n }\n enum FileType {\n IMAGE = 1;\n AUDIO = 2;\n VIDEO = 3;\n FILE = 4;\n SIGHT = 5;\n COMBINE_HTML = 6;\n }\n message GetQNupTokenInput {\n required FileType type = 1;\n optional string key = 2;\n optional string httpMethod = 3;\n optional string queryString = 4;\n optional string url = 5;\n optional string ext = 6;\n optional int64 size = 7;\n optional int32 ipType = 8;\n }\n message GetQNdownloadUrlInput {\n required FileType type = 1;\n required string key = 2;\n optional string fileName = 3;\n }\n message GetDownloadUrlInput {\n required FileType type = 1;\n required string key = 2;\n optional string fileName = 3;\n optional string ext = 4;\n optional int64 size = 5;\n optional int32 ipType = 6;\n }\n message GetQNupTokenOutput {\n required int64 deadline = 1;\n required string token = 2;\n optional string bosToken = 3;\n optional string bosDate = 4;\n optional string path = 5;\n\n optional string osskeyId = 6;\n optional string ossPolicy = 7;\n optional string ossSign = 8;\n optional string ossBucketName = 9;\n\n optional string s3Credential = 10;\n optional string s3Algorithm = 11;\n optional string s3Date = 12;\n optional string s3Policy = 13;\n optional string s3Signature = 14;\n optional string s3BucketName = 15;\n\n optional string stcAuthorization = 16;\n optional string stcContentSha256 = 17;\n optional string stcDate = 18;\n optional string stcBucketName = 19;\n\n optional string minioAuthorization = 20;\n optional string minioContentSha256 = 21;\n optional string minioDate = 22;\n optional string minioBucketName = 23;\n\n optional string downloadAuthInfo = 24;\n optional string ossConfig = 25;\n }\n message GetQNdownloadUrlOutput {\n required string downloadUrl = 1;\n }\n message GetDownloadUrlOutput {\n required string downloadUrl = 1;\n }\n message Add2BlackListInput {\n required string userId = 1;\n }\n message RemoveFromBlackListInput {\n required string userId = 1;\n }\n message QueryBlackListInput {\n required int32 nothing = 1;\n }\n message QueryBlackListOutput {\n repeated string userIds = 1;\n }\n message BlackListStatusInput {\n required string userId = 1;\n }\n message BlockPushInput {\n required string blockeeId = 1;\n }\n message ModifyPermissionInput {\n required int32 openStatus = 1;\n }\n message GroupInput {\n repeated GroupInfo groupInfo = 1;\n }\n message GroupOutput {\n required int32 nothing = 1;\n }\n message GroupInfo {\n required string id = 1;\n required string name = 2;\n }\n message GroupHashInput {\n required string userId = 1;\n required string groupHashCode = 2;\n }\n message GroupHashOutput {\n required GroupHashType result = 1;\n }\n enum GroupHashType {\n GROUP_SUCCESS = 0x00;\n GROUP_FAILURE = 0x01;\n }\n message ChrmInput {\n required int32 nothing = 1;\n optional string extra = 2;\n }\n message ChrmOutput {\n required int32 nothing = 1;\n optional string sessionId = 2;\n optional int64 joinTime = 3;\n optional int64 createTime = 4;\n optional int32 memberCount = 5;\n optional int32 chatroomBanState = 6;\n optional int32 whiteListState = 7;\n }\n message ChrmPullMsg {\n required int64 syncTime = 1;\n required int32 count = 2;\n optional int32 pullMsgType = 3;\n optional bool compressioEnabled = 4;\n }\n message ChrmPullMsgNew {\n required int32 count = 1;\n required int64 syncTime = 2;\n optional string chrmId=3;\n }\n message RelationQryInput {\n optional ChannelType type = 1;\n optional int32 count = 2;\n optional int64 startTime = 3;\n optional int32 order = 4;\n optional bool isEraseMsgContent = 5;\n optional int64 endTime = 6;\n optional bool compressioEnabled = 7;\n optional int32 qryType = 8;\n }\n message RelationsInput {\n required ChannelType type = 1;\n optional DownStreamMessage msg =2;\n optional int32 count = 3;\n repeated string busChannel = 4;\n optional int64 startTime = 5;\n optional int64 endTime = 6;\n }\n message RelationsOutput {\n repeated RelationInfo info = 1;\n optional bool isFinished = 2;\n optional int64 pullTime = 3;\n optional bool compressioEnabled = 4; \n optional bytes compressedData = 5;\n }\n message RelationInfo {\n required ChannelType type = 1;\n required string userId = 2;\n optional DownStreamMessage msg =3;\n optional int64 readMsgTime= 4;\n optional int64 unreadCount= 5;\n optional string busChannel = 6;\n optional int64 versionTime = 7;\n optional int64 remindCount = 8;\n optional int32 busChannelType = 9;\n optional UnreadMsgInfo msgInfo = 10;\n optional int32 remindMeCount = 11;\n }\n message UnreadMsgInfo {\n required string msgId = 1;\n required int64 msgTime= 2;\n optional int32 remindType= 3;\n optional string className = 4;\n }\n message QryRemindListReq {\n required string groupId = 1;\n optional string busChannel = 2;\n optional int64 msgTime = 3;\n optional int32 size = 4;\n }\n message QryRemindListResp {\n repeated UnreadMsgInfo msgInfo = 1;\n }\n message RelationInfoReadTime {\n required ChannelType type = 1;\n required int64 readMsgTime= 2;\n required string targetId = 3;\n }\n message CleanHisMsgInput {\n required string targetId = 1;\n required int64 dataTime = 2;\n optional int32 conversationType= 3;\n optional string busChannel = 4;\n }\n message CleanMsgBatchReq {\n repeated CleanHisMsgInput input = 1;\n }\n message HistoryMessageInput {\n required string targetId = 1;\n required int64 dataTime =2;\n required int32 size = 3;\n }\n\n message HistoryMessagesOuput {\n repeated DownStreamMessage list = 1;\n required int64 syncTime = 2;\n required int32 hasMsg = 3;\n optional int64 credibleStartTime = 4;\n optional int64 credibleEndTime = 5;\n optional bool compressioEnabled = 6; \n optional bytes compressedData = 7;\n }\n message QueryChatRoomInfoInput {\n required int32 count= 1;\n optional int32 order= 2;\n }\n\n message QueryChatRoomInfoOutput {\n optional int32 userTotalNums = 1;\n repeated ChrmMember userInfos = 2;\n }\n message ChrmMember {\n required int64 time = 1;\n required string id = 2;\n }\n message MPFollowInput {\n required string id = 1;\n }\n\n message MPFollowOutput {\n required int32 nothing = 1;\n optional MpInfo info =2;\n }\n\n message MCFollowOutput {\n required int32 nothing = 1;\n optional MpInfo info =2;\n }\n\n message MpInfo {\n required string mpid=1;\n required string name = 2;\n required string type = 3;\n required int64 time=4;\n optional string portraitUrl=5;\n optional string extra =6;\n }\n\n message SearchMpInput {\n required int32 type=1;\n required string id=2;\n }\n\n message SearchMpOutput {\n required int32 nothing=1;\n repeated MpInfo info = 2;\n }\n\n message PullMpInput {\n required int64 time=1;\n required string mpid=2;\n }\n\n message PullMpOutput {\n required int32 status=1;\n repeated MpInfo info = 2;\n }\n message HistoryMsgInput {\n optional string targetId = 1;\n optional int64 time = 2;\n optional int32 count = 3;\n optional int32 order = 4;\n optional string busChannel = 5;\n optional bool compressioEnabled = 6;\n }\n\n message HistoryMsgOuput {\n repeated DownStreamMessage list=1;\n required int64 syncTime=2;\n required int32 hasMsg=3;\n optional int64 credibleStartTime = 4;\n optional int64 credibleEndTime = 5;\n optional bool compressioEnabled = 6;\n optional bytes compressedData = 7;\n }\n message SessionsAttQryInput {\n required int32 nothing = 1;\n }\n message SessionsAttOutput {\n required int64 inboxTime = 1;\n required int64 sendboxTime = 2;\n required int64 totalUnreadCount = 3;\n }\n message SessionMsgReadInput {\n required ChannelType type = 1;\n required int64 msgTime = 2;\n required string channelId = 3;\n optional string busChannel = 4;\n }\n message SessionMsgReadOutput {\n optional int32 nothing=1;\n }\n message DeleteSessionsInput {\n repeated SessionInfo sessions = 1;\n }\n message SessionInfo {\n required ChannelType type = 1;\n required string channelId = 2;\n optional int64 unreadCount = 3;\n optional string busChannel = 4;\n }\n message QuerySessionsInput {\n repeated SessionInfo sessions = 1;\n }\n message QuerySessionsOutPut {\n repeated SessionInfo sessions = 1;\n }\n message DeleteSessionsOutput {\n optional int32 nothing=1;\n }\n message RelationDelBatchReq {\n repeated RelationOpInput relation = 1;\n }\n message RelationOpInput {\n required string conversationId = 1;\n required ChannelType conversationType = 2;\n optional string busChannel = 3;\n }\n message DeleteMsgInput {\n optional ChannelType type = 1;\n optional string conversationId = 2;\n repeated DeleteMsg msgs = 3;\n optional string busChannel = 4;\n }\n message DeleteMsg {\n optional string msgId = 1;\n optional int64 msgDataTime = 2;\n optional int32 direct = 3;\n }\n message ChrmKVEntity {\n required string key = 1;\n required string value = 2;\n optional int32 status = 3;\n optional int64 timestamp = 4;\n optional string uid = 5;\n optional int64 version = 6;\n }\n message SetChrmKV {\n required ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message SetChrmKVS {\n repeated ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message DeleteChrmKVS {\n repeated ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message ChrmKVOutput {\n repeated ChrmKVEntity entries = 1;\n optional bool bFullUpdate = 2;\n optional int64 syncTime = 3;\n optional bool compressioEnabled = 4; \n optional bytes compressedData = 5;\n }\n message ChrmKVSVersionEntity {\n optional int64 version = 1;\n optional string key = 2;\n }\n\n message ChrmKVSOutput {\n repeated ChrmKVSOutputEntity errorKeys = 1;\n repeated ChrmKVSVersionEntity keysVersion = 2;\n }\n message ChrmKVSOutputEntity {\n optional string key = 1;\n optional int32 errorCode = 2;\n }\n message QueryChrmKV {\n required int64 timestamp = 1;\n optional bool compressioEnabled = 2;\n }\n message SetUserSettingInput {\n required int64 version=1;\n required string value=2;\n }\n message SetUserSettingOutput {\n required int64 version=1;\n required bool reserve=2;\n }\n message PullUserSettingInput {\n required int64 version=1;\n optional bool reserve=2;\n optional int32 ipType = 3;\n }\n message PullUserSettingOutput {\n repeated UserSettingItem items = 1;\n required int64 version=2;\n }\n message UserSettingItem {\n required string targetId= 1;\n required ChannelType type = 2;\n required string key = 4;\n required bytes value = 5;\n required int64 version=6;\n required int32 status=7;\n repeated SessionTagItem tags= 8;\n }\n message SessionReq {\n required int64 time = 1;\n }\n message SessionStates {\n required int64 version=1;\n repeated SessionState state= 2;\n }\n message SessionState {\n required ChannelType type = 1;\n required string channelId = 2;\n optional int64 time = 3;\n repeated SessionStateItem stateItem = 4;\n optional string busChannel = 5;\n }\n message SessionStateItem {\n required SessionStateType sessionStateType = 1;\n required string value = 2;\n repeated SessionTagItem tags = 3;\n }\n enum SessionStateType {\n IsSilent = 1;\n IsTop = 2;\n Tags = 3;\n }\n message SessionStateModifyReq {\n required int64 version=1;\n repeated SessionState state= 2;\n }\n message GroupUnpushQuery {\n optional string busChannel = 1;\n }\n message GroupUnpushSet{\n optional string busChannel = 1;\n required int32 unpushLevel = 2;\n }\n message GroupUnpushResult {\n required string groupId = 1;\n optional string busChannel = 2;\n required int32 unpushLevel = 3;\n }\n message SessionStateModifyResp {\n required int64 version=1;\n }\n message TypeUnpushInput {\n required ChannelType type = 1;\n required int64 version = 2;\n required int32 unpushLevel = 3;\n }\n message TypeUnpushOutput {\n required int64 version = 1;\n }\n message GrpReadReceiptMsg {\n repeated string msgId=1;\n optional string channelId = 2;\n }\n message GrpReadReceiptQryReq {\n repeated string msgId=1;\n optional string channelId = 2;\n }\n message GrpReadReceiptQryResp {\n required int32 totalMemberNum = 1;\n repeated GrpMsgReadUser list = 2;\n }\n message GrpMsgReadUser {\n required int64 readTime = 1;\n required string userId = 2;\n }\n message SessionTagAddInput {\n required int64 version=1;\n repeated SessionTagItem tags=2;\n }\n message SessionTagItem {\n required string tagId=1;\n optional string name=2;\n optional int64 createdTime=3;\n optional bool isTop=4;\n }\n message SessionTagDelInput {\n required int64 version=1;\n repeated SessionTagItem tags=2;\n }\n message SessionDisTagReq {\n repeated string tagId=1;\n }\n message UserSettingNotification {\n required int64 version=1;\n required bool reserve=2;\n }\n message ReportSDKInput {\n required string sdkInfo=1;\n }\n message ReportSDKOutput {\n optional int32 nothing=1;\n }\n message UltraGrpPullSes {\n required int64 syncTime = 1;\n optional bool isEraseMsgContent = 2;\n }\n message UltraGrpPullMsg {\n required int64 syncTime = 1;\n optional bool compressioEnabled = 2;\n }\n message MsgChangeReq {\n required string fromUserId = 1;\n required string targetId = 2;\n required ChannelType type = 3;\n required string msgUID = 4;\n required int64 msgTime = 5;\n optional string busChannel = 6;\n optional string content = 7;\n }\n message QueryMsgChange {\n required int64 syncTime = 1;\n optional int32 needCompress = 2;\n optional int64 onlineTime = 3;\n optional string targetId = 4;\n }\n message EventChangeList {\n repeated EventChange list = 1;\n required int64 syncTime = 2;\n optional bool hasNext = 3 ;\n optional string targetId = 4;\n optional bool isCompress = 5 ;\n }\n message EventChange {\n optional string businessId = 1;\n optional ChannelType channelType = 2;\n optional int64 time = 3;\n optional int32 changeType = 4;\n optional string originalId = 5;\n optional int64 originalTime = 6;\n optional string secondaryId = 7;\n optional bool isAdmin = 8;\n optional bool additionalMark = 9; \n optional string operatorId = 10;\n optional int32 subChangeType = 11;\n optional int32 secondaryType = 12;\n optional bool isRemindMe = 13;\n repeated string extIds = 14;\n optional int32 remindType = 15;\n optional bytes eventData = 16;\n }\n message MsgChangeList {\n repeated MsgChange list = 1;\n required int64 syncTime = 2;\n optional bool hasNext = 3 ;\n }\n message MsgChange {\n required string targetId = 1;\n required ChannelType type = 2;\n required int64 time = 3;\n required int32 changeType = 4;\n required string msgUID = 5;\n required int64 msgTime = 6;\n optional string busChannel = 7;\n optional bool isAdmin = 8;\n optional bool isDel = 9;\n optional string operatorId = 10;\n optional int32 subChangeType = 11;\n optional int32 busChannelType = 12;\n optional bool isRemindMe = 13;\n repeated string userGroupIds = 14;\n optional int32 remindType = 15;\n }\n message MsgQuery {\n required string targetId = 1;\n required ChannelType type = 2;\n repeated MessageQueryInfo query = 3; //\n }\n message MessageQueryInfo {\n required int64 msgTime = 1;\n required string msgUID = 2;\n optional string busChannel = 3;\n }\n message MsgQueryAck {\n repeated DownStreamMessage list = 1;\n }\n message OperateStatus {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional int32 opType = 3;\n optional string busChannel = 4;\n }\n message OperateStatusNotify {\n optional ChannelType type = 1;\n optional int64 notifyType = 2;\n repeated OperateInfo info = 3 ;\n repeated OperateSummary summary = 4 ;\n }\n message OperateInfo {\n optional string targetId = 1;\n optional string busChannel = 2;\n optional string userId = 3;\n optional int32 opType = 4;\n optional int64 optime = 5;\n }\n \n message OperateSummary {\n optional string targetId = 1;\n optional string busChannel = 2;\n optional int32 count = 3;\n optional int32 opType = 4;\n }\n\n message SetRtcRoomIdInput {\n required string rtcRoomId= 1;\n }\n message SetRtcRoomIdOutput {\n required int32 nothing = 1;\n }\n message CallInfoUpStream {\n required string key= 1;\n required string dataContent=2;\n }\n message CallInfoDownStream {\n required string key= 1;\n required string dataContent=2;\n required int64 maxTime=3;\n }\n message KvInput {\n required int64 syncTime = 1;\n }\n message KvOutput {\n required int64 maxTime = 1;\n repeated KvInfo info = 2;\n }\n message KvInfo {\n required string key =1;\n required string value =2;\n }\n message ReadReceiptMsg {\n required string targetId = 1;\n required ChannelType type = 2;\n optional string busChannel = 3;\n optional string startMsgId = 4;\n optional string endMsgId = 5;\n }\n message ReceiptQryReq {\n required string msgId = 1;\n optional string busChannel = 2;\n required string targetId = 3;\n }\n message QueryReceiptResp {\n optional int32 num = 1;\n repeated ReceiptUser list = 2;\n optional int32 readCnt = 3;\n }\n message ReceiptUser {\n required int64 receiptTime = 1;\n required string userId = 2;\n }\n message ReceiptCntQryReq {\n optional ChannelType type = 1;\n optional string channelId = 2;\n optional string busChannel = 3;\n repeated string msgId = 4;\n }\n message ReceiptCntQryResp {\n repeated MsgReadCnt result= 1;\n }\n\n message MsgReadCnt {\n optional string msgId = 1;\n optional int32 cnt = 2;\n optional int32 tmn = 3;\n }\n message UpdateUserSubReq {\n optional int32 subType = 1;\n repeated UserSubDetail subUsers = 2;\n optional int32 opType = 3;\n optional int32 expiry = 4;\n }\n message UserSubDetail {\n optional string subUserId = 1;\n }\n message UpdateUserSubResp {\n repeated UserSubDetail subUsers = 1;\n optional int64 subTime = 2;\n }\n message PullUserSubReq {\n optional int64 version = 1;\n optional string pageToken = 2;\n }\n message PUllUserSubResp {\n repeated UserSubList list = 1;\n optional int64 version = 2;\n optional bool hasNext = 3;\n optional string pageToken = 4;\n optional bool isFull = 5;\n }\n message UserSubList {\n repeated UserSubDetail subUsers = 1;\n optional int32 subType = 2;\n optional int64 subTime = 3;\n optional int32 expiry = 4;\n optional int32 opType = 5;\n }\n message PullSubDataReq {\n optional int64 versionTime = 1;\n optional bool needAllData = 2;\n optional string pageToken = 3;\n }\n message PullSubDataResp {\n repeated SubDataDetail list = 1;\n optional int64 versionTime = 2;\n optional bool hasNext = 3;\n optional string pageToken = 4;\n optional bool isFull = 5;\n }\n message SubDataDetail {\n optional string statusStr = 1;\n optional string subUserId = 2;\n repeated SubData data = 3;\n optional int32 subType = 4;\n }\n\n message SubData {\n optional int32 platformInfo = 1;\n optional int32 value = 2;\n optional int64 versionTime = 3;\n }\n message QrySubDataReq {\n optional int32 subType = 1;\n repeated UserSubDetail subUsers = 2;\n }\n message UserProfile {\n optional int64 version = 1;\n optional string userId = 2;\n repeated ProfileInfo userProfile = 3;\n repeated ProfileInfo userExtProfile = 4;\n }\n message ProfileInfo {\n optional string key = 1;\n optional string value = 2;\n }\n message SetUserProfileResp {\n optional int64 version = 1;\n optional string key = 2;\n repeated string censorFailedFields = 3;\n }\n message PullUserProfileReq {\n repeated string userId = 1;\n }\n message UserProfiles {\n repeated UserProfile UserProfile = 1;\n }\n message UserProfileInput {\n required int32 nothing = 1;\n }\n message UserProfilePermission {\n optional int32 permission = 1;\n }\n message UserProfileOutput {\n required int32 nothing = 1;\n }\n message SearchUserProfile {\n optional string uniqueId = 1;\n }\n message ChannelsInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n repeated ProfileInfo settingProfile = 3;\n repeated ProfileInfo extProfile = 4;\n optional ChannelBaseInfo baseInfo = 5;\n repeated string users = 6;\n }\n\n message ChannelBaseInfo {\n optional string creatorId = 1;\n optional string ownerId = 2;\n optional int64 createTime = 3;\n optional int32 memberCount = 4;\n }\n\n message ChannelsOutput {\n optional int64 operateTime = 1;\n optional int32 flag = 2;\n optional string msg = 3;\n optional int32 processCode = 4;\n optional ChannelsJoinedInfo channelInfo = 5;\n repeated ChannelsUserInfo userInfos = 6;\n optional FriendInviteInfo friendInviteInfo = 7;\n optional FriendUserInfo friendUserInfo = 8;\n repeated string censorFailedFields = 9;\n }\n\n message MultiChannels {\n optional ChannelType type = 1;\n repeated ChannelsInput list = 2;\n }\n\n message ModifyChannelsInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional QuitChannelsSetting settingInfo = 3;\n repeated string users = 4;\n optional int32 operateType = 5;\n }\n\n message QuitChannelsSetting {\n optional bool isQuit = 1;\n optional bool isDelBan = 2;\n optional bool isDelWhite = 3;\n optional bool isDelAttention = 4;\n }\n\n message ChannelsQueryInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional ChannelsPageParam page = 3;\n repeated string ids = 4;\n optional int32 roleType = 5;\n }\n\n message ChannelsPageParam {\n optional int32 size = 1;\n optional string pageToken = 2;\n optional bool hasNext = 3 ;\n optional int32 total = 4 ;\n optional int32 order = 5 ;\n }\n\n message ChannelsListResult {\n optional int32 listType = 1;\n optional bytes result = 2;\n optional ChannelsPageParam page = 3;\n }\n \n message ChannelsInviteStatusInfos {\n repeated ChannelsInviteStatusInfo list = 1;\n }\n \n message ChannelsUserInfos {\n repeated ChannelsUserInfo list = 1;\n }\n \n message ChannelsJoinedInfos {\n repeated ChannelsJoinedInfo list = 1;\n }\n\n message ChannelsUserInfo {\n optional string userId = 1;\n optional ChannelsUserExtInfo ext = 2;\n optional int64 opTime = 3;\n optional string name = 4;\n optional string portraitUrl = 5;\n }\n\n message ChannelsUserExtInfo {\n optional int32 role = 1;\n optional int64 joinTime = 2;\n optional string channelNickName = 3;\n optional string additional = 4;\n optional string remarkName = 5;\n }\n\n message ChannelsMemberUpdateInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional string userId = 3;\n optional string channelNickName = 4;\n optional string additional = 5;\n optional int32 operateType = 6;\n }\n message ChannelsJoinedInfo {\n optional string targetId = 1;\n repeated ProfileInfo settingProfile = 2;\n repeated ProfileInfo extProfile = 3;\n optional ChannelBaseInfo baseInfo = 4;\n optional ChannelsUserExtInfo userInfo = 5;\n }\n message ChannelsInviteStatusInfo {\n optional string targetId = 1;\n optional ChannelsUserInfo joinUserInfo = 2;\n optional ChannelsUserInfo inviterInfo = 3;\n optional int32 status = 4;\n optional int32 directionType = 5;\n optional int32 joinType = 6;\n optional string detail = 7;\n optional int64 applyTime = 8;\n optional ChannelsUserInfo processInfo = 9;\n optional int64 processTime = 10;\n }\n message ChannelsMemberResponseInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional int32 optType = 3;\n optional int32 optResult = 4;\n optional string joinUserId = 5;\n optional string inviterId = 6;\n optional string detail = 7;\n }\n message ChannelsMembersInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n repeated string userIds = 3;\n }\n message FriendInput {\n optional string targetId = 1;\n optional int32 type = 2;\n optional string info = 3;\n }\n message FriendsOutput {\n repeated FriendOutput list = 1;\n }\n message FriendOutput {\n optional string userId = 1;\n optional int64 operateTime = 2;\n optional string flag = 3;\n }\n message FriendsInput {\n repeated string targetId = 1;\n optional int32 type = 2;\n }\n message FriendsCheckOutput {\n repeated FriendCheckOutput list = 1;\n }\n\n message FriendCheckOutput {\n optional string targetId = 1;\n optional int32 status = 2;\n }\n message FriendProfileInput {\n optional string targetId = 1;\n optional string remarkName = 2;\n repeated ProfileInfo extProfile = 3;\n }\n message FriendProfileOutput {\n repeated string censorFailedFields = 1;\n }\n message FriendQueryInput {\n optional int32 queryType = 1;\n optional ChannelsPageParam page = 2;\n optional int32 friendType= 3;\n }\n message FriendUserInfo {\n optional string userId = 1;\n optional int64 relationTime = 2;\n optional int32 friendType = 3;\n optional int32 flag = 4;\n optional string remarkName = 5;\n optional string name = 6;\n optional string portraitUrl = 7;\n repeated ProfileInfo extProfile = 8;\n \n }\n message FriendInviteInfo {\n optional string userId = 1;\n optional string name = 2;\n optional string portraitUrl = 3;\n optional int32 type = 4;\n optional int32 status = 5;\n optional int64 operateTime = 6;\n optional string info = 7;\n optional int32 friendType = 8;\n }\n message FriendsListInput {\n repeated string targetId = 1;\n optional int32 type = 2;\n }\n message FriendLevelSet {\n optional int32 level = 1;\n }\n\n message FriendPageParam {\n optional int32 size = 1;\n optional string pageToken = 2;\n }\n message FriendUserInfos {\n repeated FriendUserInfo list = 1;\n }\n\n message FriendInviteInfos {\n repeated FriendInviteInfo list = 1;\n }\n \n message FriendApplyEvent {\n optional int32 applyType = 1;\n optional int32 friendType = 2;\n optional string info = 3;\n optional string name = 4;\n optional string portraitUrl = 5;\n }\n message UpdateChannnelInfo {\n optional ChannelsJoinedInfo channelInfo = 1;\n optional ChannelsUserInfo userInfo = 2;\n }\n message UpdateUserInfo {\n optional ChannelsUserInfo updatedUserInfo = 1;\n optional ChannelsUserInfo optUserInfo = 2;\n }\n message ChannelApplyInfo {\n repeated ChannelsInviteStatusInfo statusInfo = 1;\n }\n message ChannelEventData {\n optional ChannelsUserInfo optUserInfo = 1;\n optional ChannelsJoinedInfo channelInfo = 2;\n repeated ChannelsUserInfo userInfos = 3;\n optional ChannelsJoinedInfo channelFullInfo = 4;\n }\n message FriendTypeChangeEvent {\n optional string friendId = 1;\n optional int32 friendType = 2;\n }\n message FriendUpdateEvent {\n optional string remarkname = 1;\n repeated ProfileInfo extProfile = 2;\n }\n message AddUnpushPeriodInput {\n required string startTime = 1;\n required int32 spanMinutes = 2;\n optional int32 level = 3;\n optional string timezone = 4;\n }\n message DeleteUnpushPeriodInput {\n required int32 nothing = 1;\n }\n message QueryUnpushPeriodInput {\n required int32 nothing = 1;\n }\n message QueryUnpushPeriodOutput {\n required int32 isUnpush = 1;\n optional string startTime = 2;\n optional int32 spanMinutes = 3;\n optional int32 level = 4;\n optional string timezone = 5;\n }\n}\n",Hi);exports.LogLevel=void 0,(qi=exports.LogLevel||(exports.LogLevel={}))[qi.LOG=0]="LOG",qi[qi.DEBUG=0]="DEBUG",qi[qi.INFO=1]="INFO",qi[qi.WARN=2]="WARN",qi[qi.ERROR=3]="ERROR",qi[qi.FATAL=4]="FATAL",qi[qi.STATISTICS=6]="STATISTICS",qi[qi.NONE=1e3]="NONE",exports.LogSource=void 0,(Yi=exports.LogSource||(exports.LogSource={})).IM="IM",Yi.RTC="RTC",exports.ConnectionStatus=void 0,(Ki=exports.ConnectionStatus||(exports.ConnectionStatus={}))[Ki.CONNECTED=0]="CONNECTED",Ki[Ki.CONNECTING=1]="CONNECTING",Ki[Ki.DISCONNECTED=2]="DISCONNECTED",Ki[Ki.NETWORK_UNAVAILABLE=3]="NETWORK_UNAVAILABLE",Ki[Ki.CONNECTION_CLOSED=4]="CONNECTION_CLOSED",Ki[Ki.KICKED_OFFLINE_BY_OTHER_CLIENT=6]="KICKED_OFFLINE_BY_OTHER_CLIENT",Ki[Ki.WEBSOCKET_UNAVAILABLE=7]="WEBSOCKET_UNAVAILABLE",Ki[Ki.WEBSOCKET_ERROR=8]="WEBSOCKET_ERROR",Ki[Ki.BLOCKED=9]="BLOCKED",Ki[Ki.DOMAIN_INCORRECT=12]="DOMAIN_INCORRECT",Ki[Ki.DISCONNECT_BY_SERVER=13]="DISCONNECT_BY_SERVER",Ki[Ki.REDIRECT=14]="REDIRECT",Ki[Ki.USER_LOGOUT=19]="USER_LOGOUT",Ki[Ki.APPKEY_IS_FAKE=20]="APPKEY_IS_FAKE",Ki[Ki.FORBID_RECONNECT_BY_OTHER_SAME_CLIENT=31023]="FORBID_RECONNECT_BY_OTHER_SAME_CLIENT",Ki[Ki.ULTRALIMIT=1101]="ULTRALIMIT",Ki[Ki.REQUEST_NAVI=201]="REQUEST_NAVI",Ki[Ki.RESPONSE_NAVI=202]="RESPONSE_NAVI",Ki[Ki.RESPONSE_NAVI_ERROR=203]="RESPONSE_NAVI_ERROR",Ki[Ki.RESPONSE_NAVI_TIMEOUT=204]="RESPONSE_NAVI_TIMEOUT",Ki[Ki.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",Ki[Ki.RC_CONN_USER_OR_PASSWD_ERROR=31004]="RC_CONN_USER_OR_PASSWD_ERROR",exports.RTCMode=void 0,(Qi=exports.RTCMode||(exports.RTCMode={}))[Qi.RTC=0]="RTC",Qi[Qi.LIVE=2]="LIVE",Qi[Qi.SIP=4]="SIP",Qi[Qi.CALL=5]="CALL",Qi[Qi.MEETING=6]="MEETING",Qi[Qi.CROSS_MUTI=7]="CROSS_MUTI",Qi[Qi.CROSS_LIVE=8]="CROSS_LIVE",function(e){e[e.AUDIO_AND_VIDEO=0]="AUDIO_AND_VIDEO",e[e.AUDIO=1]="AUDIO"}(Wi||(Wi={})),function(e){e[e.ANCHOR=1]="ANCHOR",e[e.AUDIENCE=2]="AUDIENCE"}(ji||(ji={})),exports.RTCApiType=void 0,(Ji=exports.RTCApiType||(exports.RTCApiType={}))[Ji.ROOM=1]="ROOM",Ji[Ji.PERSON=2]="PERSON",function(e){e[e.AnchorToViewer=1]="AnchorToViewer",e[e.ViewerToAnchor=2]="ViewerToAnchor"}(zi||(zi={})),exports.RTCJoinType=void 0,(Zi=exports.RTCJoinType||(exports.RTCJoinType={}))[Zi.KICK=0]="KICK",Zi[Zi.REFUSE=1]="REFUSE",Zi[Zi.COEXIST=2]="COEXIST";var $i=null;function es(e,t,n,r){void 0===n&&(n={});var o=["error","warn","info","debug"][3-e];if($i&&e<exports.LogLevel.FATAL)try{var i=JSON.stringify(n);$i[o](t,i)}catch(e){console.error(e)}}var ts,ns,rs=es.bind(null,exports.LogLevel.DEBUG),os={init:function(e){$i=e},info:es.bind(null,exports.LogLevel.INFO),debug:rs,warn:es.bind(null,exports.LogLevel.WARN),error:es.bind(null,exports.LogLevel.ERROR),fatal:es.bind(null,exports.LogLevel.FATAL)},is=function(){function e(){this._map={}}return e.prototype.on=function(e,t,n){var r=this._map[e]||(this._map[e]=[]);r.some((function(e){return e.listener===t&&e.target===n}))||r.push({listener:t,target:n})},e.prototype.once=function(e,t,n){var r=this._map[e]||(this._map[e]=[]);r.some((function(e){return e.listener===t&&e.target===n}))||r.push({listener:t,target:n,once:!0})},e.prototype.off=function(e,t,n){var r=this._map[e];r&&((r=r.filter((function(e){return e.listener!==t||e.target!==n}))).length?this._map[e]=r:delete this._map[e])},e.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=this._map[e];if(r)for(var o=r.length-1;o>=0;o-=1){var i=r[o],s=i.target,a=i.once,u=i.listener;a&&r.splice(o,1);try{u.call.apply(u,pe([s],de(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},e.prototype.removeAll=function(e){delete this._map[e]},e.prototype.clear=function(){Object.keys(this._map).forEach(this.removeAll,this)},e}(),ss=function(){function e(e,t,n){this.pbmaps=e,this.logger=n,this.pbModules=Cr(t)}return e.prototype.getModule=function(e){return new this.pbModules[e]},e.prototype.encode=function(e,t,n){var r=new this.pbModules[e];if(t)try{this.pbmaps[e].forEach((function(e){var n=t[e];void 0!==n&&r["set".concat(function(e,t,n){if(void 0===t||void 0===n)return e.toUpperCase();var r=e.slice(t,n);return e.replace(r,(function(e){return e.toUpperCase()}))}(e,0,1))](n)}))}catch(t){var o="pbname: ".concat(e,", stack: ").concat(t.stack);this.logger?this.logger.error(exports.LogTagId.L_PB_ENCODE_E,o):null===console||void 0===console||console.error(exports.LogTagId.L_PB_ENCODE_E,o)}return n?r:r.toArrayBuffer()},e.prototype.decode=function(e,t){var n=this.pbModules[e].decode(t);return this.fixInt64Values(n)},e.prototype.fixInt64Values=function(e){var t=this;if(e instanceof Array)return e.map((function(e){return t.fixInt64Values(e)}));if(!gt(e))return e;if(void 0!==e.low&&void 0!==e.high&&Object.prototype.hasOwnProperty.call(e,"unsigned")){var n=e.low;return n<0&&(n+=4294967296),n=n.toString(16),parseInt(e.high.toString(16)+"00000000".replace(new RegExp("0{".concat(n.length,"}$")),n),16)}for(var r in e)e[r]=this.fixInt64Values(e[r]);return e},e}();!function(e){e.RtcInput="RtcInput",e.RtcUserListOutput="RtcUserListOutput",e.SetUserStatusInput="SetUserStatusInput",e.RtcSetDataInput="RtcSetDataInput",e.RtcUserSetDataInput="RtcUserSetDataInput",e.RtcDataInput="RtcDataInput",e.RtcSetOutDataInput="RtcSetOutDataInput",e.MCFollowInput="MCFollowInput",e.RtcTokenOutput="RtcTokenOutput",e.RtcQryOutput="RtcQryOutput",e.RtcQryUserOutDataInput="RtcQryUserOutDataInput",e.RtcUserOutDataOutput="RtcUserOutDataOutput",e.RtcQueryListInput="RtcQueryListInput",e.RtcRoomInfoOutput="RtcRoomInfoOutput",e.RtcValueInfo="RtcValueInfo",e.RtcKeyDeleteInput="RtcKeyDeleteInput",e.RtcNotifyMsg="RtcNotifyMsg",e.RtcPullKV="RtcPullKV",e.RtcKVOutput="RtcKVOutput",e.RtcQueryUserJoinedInput="RtcQueryUserJoinedInput",e.RtcQueryUserJoinedOutput="RtcQueryUserJoinedOutput",e.RtcViewerJoinedOutput="RtcViewerJoinedOutput",e.RtcInviteInput="RtcInviteInput",e.RtcCancelInviteInput="RtcCancelInviteInput",e.RtcInviteAnswerInput="RtcInviteAnswerInput",e.RtcEndInviteInput="RtcEndInviteInput",e.RtcOutput="RtcOutput"}(ns||(ns={}));var as,us=((ts={})[ns.RtcInput]=["roomType","broadcastType","extraInnerData","needSysChatroom","identityChangeType","joinType","innerDatas","outerDatas"],ts[ns.RtcUserListOutput]=["users","token","sessionId","roomInfo"],ts[ns.SetUserStatusInput]=["status"],ts[ns.RtcSetDataInput]=["interior","target","key","value","objectName","content"],ts[ns.RtcUserSetDataInput]=["valueInfo","objectName","content"],ts[ns.RtcDataInput]=["interior","target","key","objectName","content"],ts[ns.RtcSetOutDataInput]=["target","valueInfo","objectName","content"],ts[ns.MCFollowInput]=["state"],ts[ns.RtcTokenOutput]=["rtcToken"],ts[ns.RtcQryOutput]=["outInfo"],ts[ns.RtcQryUserOutDataInput]=["userId"],ts[ns.RtcUserOutDataOutput]=["user"],ts[ns.RtcQueryListInput]=["order"],ts[ns.RtcRoomInfoOutput]=["roomId","roomData","userCount","list"],ts[ns.RtcValueInfo]=["key","value"],ts[ns.RtcKeyDeleteInput]=["key"],ts[ns.RtcNotifyMsg]=["type","time","roomId"],ts[ns.RtcPullKV]=["timestamp","roomId"],ts[ns.RtcKVOutput]=["entries","bFullUpdate","syncTime"],ts[ns.RtcQueryUserJoinedInput]=["userId"],ts[ns.RtcQueryUserJoinedOutput]=["info"],ts[ns.RtcInviteInput]=["invitedUserId","timeoutTime","invitedRoomId","inviteInfo","inviteSessionId"],ts[ns.RtcCancelInviteInput]=["invitedUserId","invitedRoomId","inviteInfo","inviteSessionId"],ts[ns.RtcInviteAnswerInput]=["inviteUserId","answerCode","inviteRoomId","inviteSessionId","content","key","value"],ts[ns.RtcEndInviteInput]=["inviteRoomId","inviteSessionId","inviteContent","inviteRoomKeys"],ts),cs="\npackage Modules;\nmessage probuf {\n enum JoinType {\n KICK = 0; //踢前一个设备\n REFUSE = 1; //当前加入拒绝\n COEXIST = 2; //两个设备共存\n }\n enum targetType {\n ROOM =1 ;\n PERSON = 2;\n }\n message ".concat(ns.SetUserStatusInput,"\n {\n optional int32 status=1;\n }\n message ").concat(ns.MCFollowInput,"\n {\n required string state = 1;\n }\n message ").concat(ns.RtcQueryListInput,"{\n optional int32 order=1;\n }\n message ").concat(ns.RtcKeyDeleteInput,"{\n repeated string key=1;\n }\n message ").concat(ns.RtcValueInfo,"{\n required string key=1;\n required string value=2;\n }\n message RtcUserInfo{\n required string userId=1;\n repeated ").concat(ns.RtcValueInfo," userData=2; //用户资源信息\n }\n message ").concat(ns.RtcUserListOutput,"{\n repeated RtcUserInfo users=1;\n optional string token=2;\n optional string sessionId=3;\n repeated RtcValueInfo roomInfo = 4; //房间key value\n repeated RtcKVEntity entries = 5;//直播KV属性对象集合\n optional int64 syncTime = 6;//所有属性的最大时间戳(下次拉取KV时用)。\n optional int32 offlineKickTime = 7;//server超时踢人时间,默认60s\n }\n message RtcRoomInfoOutput{\n optional string roomId = 1;\n repeated ").concat(ns.RtcValueInfo," roomData = 2;\n optional int32 userCount = 3;\n repeated RtcUserInfo list=4;\n }\n message ").concat(ns.RtcInput,"{\n required int32 roomType=1;\n optional int32 broadcastType=2;\n optional RtcValueInfo extraInnerData = 3;\n optional bool needSysChatroom = 4; //是否需要同步聊天室\n optional IdentityChangeType identityChangeType = 5; //身份变更类型\n optional JoinType joinType = 6; // 加入房间类型\n repeated ").concat(ns.RtcValueInfo," innerDatas = 7; //用户内部inner数据,角色或者连麦信息等\n repeated ").concat(ns.RtcValueInfo," outerDatas = 8; //用户内部outer数据,自定义数据结构RtcInput。\n }\n message ").concat(ns.RtcQryOutput,"{\n repeated ").concat(ns.RtcValueInfo," outInfo=1;\n }\n message ").concat(ns.RtcDataInput,"{\n required bool interior=1;\n required targetType target=2;\n repeated string key=3;\n optional string objectName=4;\n optional string content=5;\n }\n message ").concat(ns.RtcSetDataInput,"{\n required bool interior=1;\n required targetType target=2;\n required string key=3;\n required string value=4;\n optional string objectName=5;\n optional string content=6;\n }\n message ").concat(ns.RtcUserSetDataInput," {\n repeated ").concat(ns.RtcValueInfo," valueInfo = 1;\n required string objectName = 2;\n repeated ").concat(ns.RtcValueInfo," content = 3;\n }\n message RtcQryInput{\n required bool isInterior=1;\n required targetType target=2;\n repeated string key=3;\n }\n message RtcDelDataInput{\n repeated string key=1;\n required bool isInterior=2;\n required targetType target=3;\n }\n message RtcOutput\n {\n optional int32 nothing=1;\n optional int64 version=2;\n }\n message ").concat(ns.RtcTokenOutput,"{\n required string rtcToken=1;\n }\n message ").concat(ns.RtcSetOutDataInput,"{\n required targetType target=1;\n repeated ").concat(ns.RtcValueInfo," valueInfo=2;\n optional string objectName=3;\n optional string content=4;\n }\n message ").concat(ns.RtcQryUserOutDataInput,"{\n repeated string userId = 1;\n }\n message ").concat(ns.RtcUserOutDataOutput,"{\n repeated RtcUserInfo user = 1;\n }\n message ").concat(ns.RtcNotifyMsg," \n {\n required int32 type= 1; //(通知类型 1:rtc房间状态KV变更通知)\n optional int64 time= 2; //消息产生时间\n optional string roomId=3; //主播房间id\n }\n message ").concat(ns.RtcPullKV,"\n {\n required int64 timestamp = 1;\n required string roomId = 2;\n }\n message RtcKVEntity \n {\n required string key = 1;\n required string value = 2;\n optional int32 status = 3;\n optional int64 timestamp = 4;\n optional string uid = 5;\n }\n message ").concat(ns.RtcKVOutput,"\n {\n repeated RtcKVEntity entries = 1;\n optional bool bFullUpdate = 2;\n optional int64 syncTime = 3; \n }\n enum IdentityChangeType \n {\n AnchorToViewer = 1; //1为主播变观众\n ViewerToAnchor = 2; //2为观众变主播\n }\n message ").concat(ns.RtcQueryUserJoinedInput,"\n {\n required string userId = 1;\n }\n message RtcJoinedInfo\n {\n required string deviceId = 1; //设备ID\n required string roomId = 2; //加入的房间ID\n optional int64 joinTime = 3; //加入的时间\n }\n message ").concat(ns.RtcQueryUserJoinedOutput,"\n {\n repeated RtcJoinedInfo info = 1;\n }\n message ").concat(ns.RtcViewerJoinedOutput,"\n {\n required string rtcToken=1;\n repeated RtcKVEntity entries = 2;//KV属性对象集合\n optional int64 syncTime = 3;//所有属性的最大时间戳(下次拉取KV时用)。\n }\n message ").concat(ns.RtcInviteInput,"\n {\n required string invitedUserId=1; //被邀请的人的uid\n optional int32 timeoutTime=2; //邀请超时时间(秒),默认三十秒\n required string invitedRoomId=3; //被邀请的房间\n required string inviteInfo=4; //邀请的信息(包含邀请人,被邀请人,各自userid)客户端定义好.协议栈和server透传\n required string inviteSessionId= 5; //客户端保证唯一性(建议roomid_userid_时间戳_随机数)\n }\n message ").concat(ns.RtcCancelInviteInput,"\n {\n required string invitedUserId=1; //被邀请的人的uid\n required string invitedRoomId=2; //被邀请的房间\n required string inviteInfo=3; //取消邀请的信息(包含邀请人,被邀请人,各自userid)客户端定义好.协议栈和server透传\n required string inviteSessionId=4; //邀请的sessionId,客户端发起邀请时产生\n }\n message ").concat(ns.RtcInviteAnswerInput,"\n {\n required string inviteUserId=1; //邀请的人的uid\n required int32 answerCode=2; //是否接受连麦邀请.0为拒绝,1为接受\n required string inviteRoomId=3; //邀请的房间\n required string inviteSessionId=4; //邀请的sessionId\n required string content=5; //需要转发的content\n optional string key=6; //如果接受的话,需要加这个字段,放在room级别的k和v,新加入房间的能拉取到\n optional string value=7; //如果接受的话,需要加这个字段,放在room级别的k和v,新加入房间的能拉取到\n }\n message ").concat(ns.RtcEndInviteInput,"\n {\n required string inviteRoomId=1; //邀请的房间\n required string inviteSessionId=2; //邀请的sessionId\n required string inviteContent=3; //结束连麦的信息(需要透传给房间内其他人)\n repeated string inviteRoomKeys=4; //需要删除连麦的信息的key\n }\n}\n"),ls=function(e,t,n,r,o,i){var s=o?Object.keys(o).map((function(t){return e.encode(ns.RtcValueInfo,{key:t,value:o[t]},!0)})):void 0,a=i?Object.keys(i).map((function(t){return e.encode(ns.RtcValueInfo,{key:t,value:i[t]},!0)})):void 0;return e.encode(ns.RtcInput,{roomType:t,broadcastType:n,joinType:r,innerDatas:s,outerDatas:a})},ds=function(e,t){var n=e.decode(ns.RtcUserListOutput,t),r=n.users,o=n.token,i=n.sessionId,s=n.roomInfo,a=n.entries,u=n.offlineKickTime,c={};return St(r,(function(e){var t=e.userId,n=e.userData,r={};St(n,(function(e){var t=e.key,n=e.value;r[t]=n})),c[t]=r})),{users:c,token:o,sessionId:i,roomInfo:s,kvEntries:a,offlineKickTime:u}};!function(e){e[e.ppMsgP=1]="ppMsgP",e[e.ppMsgN=2]="ppMsgN",e[e.ppMsgS=3]="ppMsgS",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.pullUS=24]="pullUS",e[e.sendMsgRead=25]="sendMsgRead",e[e.qryMsgRead=26]="qryMsgRead",e[e.qryMsgReadCntBatch=27]="qryMsgReadCntBatch",e[e.updRTime=28]="updRTime",e[e.pgMsgS=29]="pgMsgS",e[e.chatMsgS=30]="chatMsgS",e[e.qrySessionsAtt=31]="qrySessionsAtt",e[e.pullMsg=32]="pullMsg",e[e.qrySessions=33]="qrySessions",e[e.delSessions=34]="delSessions",e[e.delMsg=35]="delMsg",e[e.delUgMsg=36]="delUgMsg",e[e.updRRTime=37]="updRRTime",e[e.qrySessionsUnread=38]="qrySessionsUnread",e[e.setTypeUnpush=39]="setTypeUnpush",e[e.chrmPull=40]="chrmPull",e[e.joinChrm=41]="joinChrm",e[e.joinChrmR=42]="joinChrmR",e[e.exitChrm=43]="exitChrm",e[e.queryChrmI=44]="queryChrmI",e[e.setKV=45]="setKV",e[e.delKV=46]="delKV",e[e.setKVS=47]="setKVS",e[e.delKVS=48]="delKVS",e[e.pullKV=49]="pullKV",e[e.qryRelation=50]="qryRelation",e[e.qryRelationR=51]="qryRelationR",e[e.delRelation=52]="delRelation",e[e.delRelationBatch=53]="delRelationBatch",e[e.pullSeAtts=54]="pullSeAtts",e[e.setSeAtt=55]="setSeAtt",e[e.qnTkn=56]="qnTkn",e[e.qnUrl=57]="qnUrl",e[e.aliUrl=58]="aliUrl",e[e.s3Url=59]="s3Url",e[e.stcUrl=60]="stcUrl",e[e.minioUrl=61]="minioUrl",e[e.cleanPMsg=62]="cleanPMsg",e[e.cleanGMsg=63]="cleanGMsg",e[e.cleanCMsg=64]="cleanCMsg",e[e.cleanSMsg=65]="cleanSMsg",e[e.cleanMCMsg=66]="cleanMCMsg",e[e.cleanMPMsg=67]="cleanMPMsg",e[e.cleanMsgBatch=68]="cleanMsgBatch",e[e.rtcPing=69]="rtcPing",e[e.rtc_ntf=70]="rtc_ntf",e[e.rtcSetOutData=71]="rtcSetOutData",e[e.rtcQryUserOutData=72]="rtcQryUserOutData",e[e.addSeTag=73]="addSeTag",e[e.delSeTag=74]="delSeTag",e[e.addTag=75]="addTag",e[e.delTag=76]="delTag",e[e.disTag=77]="disTag",e[e.reportsdk=78]="reportsdk",e[e.pullUgSes=79]="pullUgSes",e[e.pullUgMsg=80]="pullUgMsg",e[e.ugMsg=81]="ugMsg",e[e.qryUgMsg=82]="qryUgMsg",e[e.updUgRTime=83]="updUgRTime",e[e.upMsgEx=84]="upMsgEx",e[e.modifyMsg=85]="modifyMsg",e[e.qryMsgChange=86]="qryMsgChange",e[e.qryMsg=87]="qryMsg",e[e.operate=88]="operate",e[e.s_opNtf=89]="s_opNtf",e[e.ugUnpushQuery=90]="ugUnpushQuery",e[e.ugUnpushSet=91]="ugUnpushSet",e[e.setRtcRoomId=92]="setRtcRoomId",e[e.qryUgUal=93]="qryUgUal",e[e.updUserSub=94]="updUserSub",e[e.pullUserSub=95]="pullUserSub",e[e.pullSubData=96]="pullSubData",e[e.qrySubData=97]="qrySubData",e[e.pullUserProfile=98]="pullUserProfile",e[e.pullOwnProfile=99]="pullOwnProfile",e[e.updProfilePermiss=100]="updProfilePermiss",e[e.qProfilePermiss=101]="qProfilePermiss",e[e.searchUserProfile=102]="searchUserProfile",e[e.updUserProfile=103]="updUserProfile",e[e.pullEventChange=104]="pullEventChange",e[e.channelCreate=105]="channelCreate",e[e.upChannelInfo=106]="upChannelInfo",e[e.qChannelInfo=107]="qChannelInfo",e[e.channelMemKick=108]="channelMemKick",e[e.channelMemQuit=109]="channelMemQuit",e[e.channelDismiss=110]="channelDismiss",e[e.channelTransfer=111]="channelTransfer",e[e.upChannelManager=112]="upChannelManager",e[e.qChannelMem=113]="qChannelMem",e[e.qChannelSpeMem=114]="qChannelSpeMem",e[e.upChannelMem=115]="upChannelMem",e[e.channelMemJoin=116]="channelMemJoin",e[e.channelMemInvite=117]="channelMemInvite",e[e.channelApplyResp=118]="channelApplyResp",e[e.qChannelApplyList=119]="qChannelApplyList",e[e.qChannelMemJoin=120]="qChannelMemJoin",e[e.qChannelMemSpeJoin=121]="qChannelMemSpeJoin",e[e.upChannelRemark=122]="upChannelRemark",e[e.qChannelRemark=123]="qChannelRemark",e[e.upChannelFollow=124]="upChannelFollow",e[e.qChannelFollow=125]="qChannelFollow",e[e.qSimpleUserProfile=126]="qSimpleUserProfile",e[e.friendAdd=127]="friendAdd",e[e.friendDel=128]="friendDel",e[e.friendHandle=129]="friendHandle",e[e.friendSetPf=130]="friendSetPf",e[e.friendCheck=131]="friendCheck",e[e.friendsQuery=132]="friendsQuery",e[e.friendApplyDel=133]="friendApplyDel",e[e.friendsInfoQry=134]="friendsInfoQry",e[e.friendAuthSet=135]="friendAuthSet",e[e.friendAuthGet=136]="friendAuthGet",e[e.addUnpush=137]="addUnpush",e[e.qryUnpush=138]="qryUnpush",e[e.delUnpush=139]="delUnpush",e[e.s_pubCall=140]="s_pubCall",e[e.reqCall=141]="reqCall",e[e.pullKvMsg=142]="pullKvMsg"}(as||(as={}));var ps,hs,_s,gs=function(e){var t=as[e];return t},fs=function(e){return as[e]};!function(e){e[e.AT_MOST_ONCE=0]="AT_MOST_ONCE",e[e.AT_LEAST_ONCE=1]="AT_LEAST_ONCE",e[e.EXACTLY_ONCE=2]="EXACTLY_ONCE",e[e.DEFAULT=3]="DEFAULT"}(ps||(ps={})),function(e){e[e.SYMMETRIC=0]="SYMMETRIC",e[e.CONNECT=1]="CONNECT",e[e.CONN_ACK=2]="CONN_ACK",e[e.PUBLISH=3]="PUBLISH",e[e.PUB_ACK=4]="PUB_ACK",e[e.QUERY=5]="QUERY",e[e.QUERY_ACK=6]="QUERY_ACK",e[e.QUERY_CONFIRM=7]="QUERY_CONFIRM",e[e.PING=12]="PING",e[e.PONG=13]="PONG",e[e.DISCONNECT=14]="DISCONNECT",e[e.PCONNECT=8]="PCONNECT",e[e.PCONNECT_ACK=9]="PCONNECT_ACK",e[e.RESERVED=10]="RESERVED",e[e.RESERVED_2=11]="RESERVED_2",e[e.RESERVED_3=15]="RESERVED_3"}(hs||(hs={})),function(e){e[e.V4=4]="V4",e[e.V3=3]="V3"}(_s||(_s={}));var Es,Is,Ts,Cs,vs,Rs,ys,ms,Ss,As,Ns,Os="rtcRJoin_data",Ms="rtcRExit",Ls="rtcRInfo",Us="rtcUData",bs="rtcUPut",Ps="rtcUDel",ws="rtcSetData",xs="userSetData",Ds="rtcQryData",Vs="rtcDelData",Gs="rtcToken",ks="rtcUserState",Fs="rtcUList",Bs="viewerJoinR",Hs="viewerExitR",qs="rtcPullKv",Ys="rtcIdentityChange",Ks="rtcInvite",Qs="rtcCancelInvite",Ws="rtcInviteAnswer",js="rtcEndInvite",Js="rtcQueryJoined",zs=function(){function e(){}return e.writeUTF=function(e,t){for(var n=this._getBackAndByteSize(e),r=n.back,o=n.byteSize,i=0,s=r.length;i<s;i++)r[i]>255&&(r[i]&=255);return t?r:o<=255?[0,o].concat(r):[o>>8,255&o].concat(r)},e._getBackAndByteSize=function(e){var t=[],n=0;if("string"==typeof e)for(var r=0,o=e.length;r<o;r++){var i=e.charCodeAt(r);i>=0&&i<=127?(n+=1,t.push(i)):i>=128&&i<=2047?(n+=2,t.push(192|31&i>>6),t.push(128|63&i)):i>=2048&&i<=65535&&(n+=3,t.push(224|15&i>>12),t.push(128|63&i>>6),t.push(128|63&i))}return{byteSize:n,back:t}},e.readUTF=function(e){for(var t,n,r=[],o=-1,i=e,s="";++o<i.length;){var a=Number(i[o]);if(a===(127&a)||(240&~a?224&~a?192&~a||(a=(a^=192)<<6|128^i[++o]):a=(a=(a^=224)<<6|128^i[++o])<<6|128^i[++o]:a=(a=(a=(a^=240)<<6|128^i[++o])<<6|128^i[++o])<<6|128^i[++o]),!Number.isFinite(a)||a<0||a>1114111||Math.floor(a)!==a)throw RangeError("Invalid code point: ".concat(a));a<=65535?r.push(a):(t=(a-=65536)>>10|55296,n=a%1024|56320,r.push(t,n)),(o+1===i.length||r.length>16384)&&(s+=String.fromCharCode.apply(null,r),r.length=0)}return s},e}(),Zs=function(){function e(e){this._position=0,this._poolLen=0,this._pool=e,this._poolLen=e.length}return e.prototype.check=function(){return this._position>=this._pool.length},e.prototype.read2Byte=function(){var e=this;if(e.check())return-1;for(var t="",n=0;n<2;n++){var r=e._pool[e._position++].toString(16);1===r.length&&(r="0".concat(r)),t+=r.toString()}return parseInt(t,16)},e.prototype.readInt32=function(){return(this.readByte()<<24)+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},e.prototype.readLong=function(){var e=this;if(e.check())return-1;for(var t="",n=0;n<8;n++){var r=e._pool[e._position++].toString(16);1===r.length&&(r="0".concat(r)),t+=r}return parseInt(t,16)},e.prototype.readByte=function(){if(this.check())return-1;var e=this._pool[this._position++];return e>255&&(e&=255),e},e.prototype.readUTF=function(){if(this.check())return"";var e=this.readByte()<<8|this.readByte(),t=this._position;this._position+=e;var n=this._pool.subarray(t,this._position);return zs.readUTF(n)},e.prototype.readAll=function(){return this._pool.subarray(this._position,this._poolLen)},e}(),Xs=function(){function e(){this._pool=[]}return e.prototype.writeByte=function(e){e>=0&&(e>255&&(e&=255),this._pool.push(e))},e.prototype.writeBuffer=function(e){this._pool=this._pool.concat(pe([],de(new Int8Array(e)),!1))},e.prototype.writeArr=function(e){this._pool=this._pool.concat(e)},e.prototype.writeUTF=function(e){var t=zs.writeUTF(e);this._pool=this._pool.concat(t)},e.prototype.getBytesArray=function(){return this._pool},e}(),$s=function(){function e(e,t,n,r,o){void 0===t&&(t=ps.AT_LEAST_ONCE),void 0===n&&(n=!1),void 0===r&&(r=!1),void 0===o&&(o=!1),this.command=e,this.qos=t,this._retain=n,this._dup=r,this.syncMsg=o}return e.parse=function(t){return new e(t>>4&15,(6&t)>>1,(1&t)>0,(8&t)>0,!(8&~t))},e.prototype.encode=function(){var e=this.command<<4;return e|=this._retain?1:0,e|=this.qos<<1,e|=this._dup?8:0},e}(),ea=function(){function e(e){this.header=e,this.timestamp=0}return e.prototype.read=function(e,t,n){this.readMessage(e,t,n)},e.prototype.readMessage=function(e,t,n){return{stream:e,length:t}},e}(),ta=function(){function e(e){this.messageId=0,this._header=new $s(e,ps.AT_MOST_ONCE)}return e.prototype.write=function(e){var t=this.getHeaderFlag();e.writeByte(t),this.writeMessage(e)},e.prototype.setHeaderQos=function(e){this._header.qos=e},e.prototype.getHeaderFlag=function(){return this._header.encode()},e.prototype.getArrayBuffer=function(){var e=new Xs;this.write(e);var t=e.getBytesArray();return new Int8Array(t).buffer},e}(),na=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.status=null,t.userId=null,t.timestamp=0,t.messageId=0,t.sessionId="",t}return t(n,e),n.prototype.readMessage=function(e,t,r){if(e.readByte(),this.status=e.readByte(),t<=n.MESSAGE_LENGTH)return{stream:e,length:t};if(r===_s.V4){var o=e.readByte();1&o&&(this.userId=e.readUTF()),2&o&&(this.sessionId=e.readUTF()),4&o&&(this.timestamp=e.readLong()),8&o&&(this.messageId=e.read2Byte())}else this.userId=e.readUTF(),this.sessionId=e.readUTF(),this.timestamp=e.readLong();return{stream:e,length:t}},n.MESSAGE_LENGTH=2,n}(ea),ra=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.status=0,t}return t(n,e),n.prototype.readMessage=function(e,t){return e.readByte(),this.status=e.readByte(),this.data=e.readAll(),{stream:e,length:t}},n.MESSAGE_LENGTH=2,n}(ea),oa=function(e){function n(){return e.call(this,hs.PING)||this}return t(n,e),n.prototype.writeMessage=function(e){},n}(ta),ia=function(e){function n(t){return e.call(this,t)||this}return t(n,e),n}(ea),sa=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.messageId=0,t}return t(n,e),n.prototype.readMessage=function(e,t){var n=256*e.readByte()+e.readByte();return this.messageId=parseInt(n.toString(),10),{stream:e,length:t}},n}(ea),aa=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),n.prototype.writeMessage=function(e){var t=this.messageId,n=255&t,r=(65280&t)>>8;e.writeByte(r),e.writeByte(n)},n}(ta),ua=function(e){function n(t){var n=e.call(this,t)||this;return n.topic="",n.targetId="",n.date=0,n.syncMsg=!1,n.syncMsg=t.syncMsg,n}return t(n,e),n.prototype.readMessage=function(t,n){return this.date=t.readInt32(),this.topic=t.readUTF(),this.targetId=t.readUTF(),e.prototype.readMessage.call(this,t,n),this.pbData=t.readAll(),{stream:t,length:n}},n}(sa),ca=function(e){function n(t,n,r,o){var i=e.call(this,t)||this;return i.targetId=r,i.pbData=o,i.topic="string"==typeof n?n:fs(n),i}return t(n,e),n.prototype.writeMessage=function(t){t.writeUTF(this.topic),t.writeUTF(this.targetId),e.prototype.writeMessage.call(this,t),t.writeBuffer(this.pbData)},n}(aa),la=function(e){function n(t,n,r){return e.call(this,hs.QUERY,t,r,n)||this}return t(n,e),n}(ca),da=function(e){function n(t,n,r){return e.call(this,hs.PUBLISH,t,r,n)||this}return t(n,e),n}(ca),pa=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.status=0,t.date=0,t.millisecond=0,t.messageUId="",t.timestamp=0,t}return t(n,e),n.prototype.readMessage=function(t,n){return e.prototype.readMessage.call(this,t,n),this.date=t.readInt32(),this.status=256*t.readByte()+t.readByte(),this.millisecond=256*t.readByte()+t.readByte(),this.timestamp=1e3*this.date+this.millisecond,this.messageUId=t.readUTF(),{stream:t,length:n}},n}(sa),ha=function(e){function n(t){var n=e.call(this,hs.PUB_ACK)||this;return n.messageId=t,n}return t(n,e),n}(aa),_a=function(e){function n(t){var n=e.call(this,hs.QUERY_CONFIRM)||this;return n.messageId=t,n}return t(n,e),n}(aa),ga=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.status=0,t.date=0,t}return t(n,e),n.prototype.readMessage=function(t,n){return e.prototype.readMessage.call(this,t,n),this.date=t.readInt32(),this.status=256*t.readByte()+t.readByte(),this.pbData=t.readAll(),{stream:t,length:n}},n}(sa),fa=function(e,t){var n=new Uint8Array(e),r=new Zs(n),o=r.readByte(),i=function(e){var t,n=e.command;switch(n){case hs.CONN_ACK:t=new na(e);break;case hs.PUBLISH:t=new ua(e);break;case hs.PUB_ACK:t=new pa(e);break;case hs.QUERY_ACK:t=new ga(e);break;case hs.PONG:t=new ia(e);break;case hs.DISCONNECT:t=new ra(e);break;default:console.error("No support for deserializing ".concat(n," messages"))}return t}($s.parse(o));return i&&i.read(r,n.length-1,t),i},Ea=function(){function e(e){this._pullQueue=[],this._isPulling=!1,this._pullTime=0,this._engine=e}return e.prototype._startPull=function(){return ue(this,void 0,void 0,(function(){var e,t,n,r,o,i,s;return ce(this,(function(a){switch(a.label){case 0:return this._isPulling||0===this._pullQueue.length?[2]:(this._isPulling=!0,e=this._pullQueue.splice(0,1)[0],t=e.roomId,n=e.timestamp,(r=this._pullTime)>n?(this._isPulling=!1,this._startPull(),[2]):[4,this._engine.pullRTCRoomEntry(t,r)]);case 1:return o=a.sent(),i=o.code,s=o.data,i===exports.ErrorCode.SUCCESS?(this._isPulling=!1,this._pullTime=s||0,this._startPull()):this._startPull(),[2]}}))}))},e.prototype.pullEntry=function(e,t){this._pullQueue.push({roomId:e,timestamp:t}),this._startPull()},e.prototype.reset=function(){this._pullTime=0,this._isPulling=!1},e}(),Ia=function(){function e(e,t,n,r){this.rtcCodec=e,this._watcher=t,this._options=n,this.logger=r,this._appkey=this._options.appkey,this._rtcKVManager=new Ea(this)}return e.prototype.registerRTCSignalingListener=function(e){this._rtcSignalingListener=e},e.prototype.getInnerLogger=function(){return this.logger},e.prototype.pullRTCRoomEntry=function(e,t){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return t=this.rtcCodec.encode(ns.RtcPullKV,{timestamp:0,roomId:e}),[4,this.rtcSignaling(e,qs,!0,t)];case 1:return n=u.sent(),r=n.code,o=n.buffer,r!==exports.ErrorCode.SUCCESS?[2,{code:r}]:(i=this.rtcCodec.decode(ns.RtcKVOutput,o),s=i.entries,a=i.syncTime,s=(s||[]).map((function(e){return se(se({},e),{timestamp:mt(e.timestamp)})})),this._watcher.onRTCDataChange(s,e),[2,{code:r,data:a}])}}))}))},e.prototype._receiveRtcKv=function(e){if(this._rtcSignalingListener)this._rtcSignalingListener(e);else{var t=this.rtcCodec.decode(ns.RtcNotifyMsg,e),n=t.time,r=t.type,o=t.roomId;1===r&&this._rtcKVManager.pullEntry(o,mt(n))}},e.prototype.destroy=function(){},e}();exports.StreamMessageResponseEventType=void 0,(Es=exports.StreamMessageResponseEventType||(exports.StreamMessageResponseEventType={})).INIT="INIT",Es.DATA="DATA",Es.END="END";var Ta=function(e){function n(t,n){var r=e.call(this)||this;return Is.add(r),Ts.set(r,void 0),Cs.set(r,new Map),vs.set(r,void 0),_e(r,Ts,t,"f"),_e(r,vs,n,"f"),r}return t(n,e),n.prototype.requestStreamMessageContent=function(e){return ue(this,void 0,void 0,(function(){var t,n,r=this;return ce(this,(function(o){switch(o.label){case 0:return t=he(this,Is,"a",Rs).createTraceId(),he(this,Is,"a",Rs).info(exports.LogTagId.L_REQ_STREAM_MSG_CONTENT_T,"messageUId: ".concat(e),t),[4,at.create("requestStreamMessageContent").isLimitedString("messageUId",e,1,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID,"messageUId is invalid.").result().tryTrans(he(this,Ts,"f").validatorConnected).tryTrans((function(e){var t,n;return(null===(n=null===(t=null==e?void 0:e.streamServer)||void 0===t?void 0:t.addrs)||void 0===n?void 0:n.length)?it(e.streamServer.addrs):st(exports.ErrorCode.STREAM_MESSAGE_DISABLE)})).next((function(t){return he(r,Is,"m",Ns).call(r,e,t)}))];case 1:return n=o.sent(),he(this,Is,"a",Rs).summary(exports.LogTagId.L_REQ_STREAM_MSG_CONTENT_R,n,t,{messageUId:e}),[2,n.wipe()]}}))}))},n}(nt);Ts=new WeakMap,Cs=new WeakMap,vs=new WeakMap,Is=new WeakSet,Rs=function(){return he(this,Ts,"f").logger},ys=function(e,t,n){var r=he(this,Cs,"f").get(e);r&&(he(this,Cs,"f").delete(e),he(this,Is,"m",ms).call(this,e,exports.StreamMessageResponseEventType.END,t,r.msg))},ms=function(e,t,n,r,o){this.emit("message",{code:n,messageUId:e,type:t,chunk:o,message:r})},Ss=function(e,t){e.content=se(se({},e.content),t),he(this,Ts,"f").setMessageContent(e.messageId,e.content,e.messageType)},As=function(e,t,n){var r,o,i=he(this,Cs,"f").get(t);switch(e){case"init":i.msg&&he(this,Is,"m",Ss).call(this,i.msg,{content:"",stopReason:0,completeReason:0,isSynced:!1}),he(this,Is,"m",ms).call(this,t,exports.StreamMessageResponseEventType.INIT,exports.ErrorCode.SUCCESS,i.msg);break;case"complete":o=(r=n.length?JSON.parse(n):{}).complete||!1,i.msg&&he(this,Is,"m",Ss).call(this,i.msg,{stopReason:r.stopReason||0,completeReason:r.completeReason||0,complete:o,isSynced:o}),he(this,Is,"m",ys).call(this,t,r.stopReason||0,o);break;default:r=JSON.parse(n),i.cached+=r.content,i.msg&&he(this,Is,"m",Ss).call(this,i.msg,{content:i.cached}),he(this,Is,"m",ms).call(this,t,exports.StreamMessageResponseEventType.DATA,exports.ErrorCode.SUCCESS,i.msg,{content:r.content,fullContent:i.cached})}},Ns=function(e,t){return ue(this,void 0,void 0,(function(){var n,r,o,i,s,a,u,c=this;return ce(this,(function(l){switch(l.label){case 0:return he(this,Cs,"f").has(e)?[2,st(exports.ErrorCode.STREAM_MESSAGE_REQUEST_IN_PROCESS,"Request in process, msgUId: ".concat(e))]:he(this,Cs,"f").size>=3?[2,st(exports.ErrorCode.STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED,"The request queue is full")]:(n=Tr.createSSEClient({logger:he(this,Is,"a",Rs),msgUId:e,appkey:he(this,Ts,"f").appkey,token:he(this,Ts,"f").token,timeout:3e4,onRawContent:function(t){var n=t.split("\n\n");console.log("recv events ->",n),n.forEach((function(t){if(0!==t.length){t.startsWith("data:")&&(t="event:delta\n".concat(t));var n=t.indexOf("\n"),r=t.slice(0,n).replace("event:",""),o=t.slice(n+1+5);he(c,Is,"m",As).call(c,r,e,o.trim())}}))},onNetworkError:function(t){he(c,Is,"m",ys).call(c,e,t,!1)}}),n.isOk?(r=n.data,o={client:r,cached:"",msg:void 0},he(this,Cs,"f").set(e,o),he(this,vs,"f")?[4,he(this,Ts,"f").getLocalMessage(e)]:[3,2]):[2,n.wipe()]);case 1:if(i=l.sent(),s=i.code,!(a=i.data))return he(this,Cs,"f").delete(e),[2,st(s,"message not found, msgUId: ".concat(e))];if(a.content.isSynced)return he(this,Cs,"f").delete(e),[2,st(exports.ErrorCode.STREAM_MESSAGE_SYNCED,"synced")];o.msg=a,l.label=2;case 2:return[4,r.open(t.slice())];case 3:return(u=l.sent()).isOk||he(this,Cs,"f").delete(e),[2,u.wipe()]}}))}))};var Ca,va,Ra=function(){function e(e){this._context=e}return e.prototype.__getContext=function(){return this._context},e.prototype.createCodec=function(e,t){return new ss(e,t)},e.prototype.createPBCodec=function(e,t){return new Rr(e,t)},e.prototype.refetchNaviInfo=function(){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){return[2,this._context.refetchNaviInfo()]}))}))},e.prototype.getNaviInfo=function(){return this._context.getNaviInfoFromCache()},e.prototype.getCoreVersion=function(){return"5.20.0-c-esm-alpha.1"},e.prototype.getAPIVersion=function(){return"5.20.0-c-esm-alpha.1"},e.prototype.getAppkey=function(){return this._context.appkey},e.prototype.getCurrentId=function(){return this._context.getCurrentUserId()},e.prototype.getConnectionStatus=function(){return this._context.getConnectionStatus()},e.prototype.getDeviceId=function(){return this._context.getDeviceId()},e.prototype.sendMessage=function(e,t,n){return this._context.sendMessage(e,t,n)},e.prototype.registerMessageType=function(e,t,n,r){void 0===r&&(r=[]),this._context.registerMessageType(e,t,n,r)},e.prototype.getServerTime=function(){return this._context.getServerTime()},e.prototype.getOSInfo=function(){return this._context.getOSInfo()},e.prototype.getProcessInfo=function(){return this._context.getProcessInfo()},e.prototype.getMainProcessInfo=function(){return this._context.getMainProcessInfo()},e.prototype.setCallInfo=function(e,t,n){return this._context.setCallInfo(e,t,n)},e.prototype.createLogger=function(e,t){return this._context.createLogger(e,t)},e}(),ya=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),n.prototype.joinRTCRoom=function(e,t,n,r,o,i){return ue(this,void 0,void 0,(function(){var s,a,u,c,l;return ce(this,(function(d){switch(d.label){case 0:return s=ls(this._context.rtcCodec,t,n,r,o,i),[4,this.rtcSignaling(e,Os,!0,s)];case 1:return a=d.sent(),u=a.code,c=a.buffer,u===exports.ErrorCode.SUCCESS&&c&&(l=ds(this._context.rtcCodec,c)),[2,{code:u,data:l}]}}))}))},n.prototype.quitRTCRoom=function(e){return ue(this,void 0,void 0,(function(){var t;return ce(this,(function(n){switch(n.label){case 0:return t=this._context.rtcCodec.encode(ns.SetUserStatusInput,{status:0}),[4,this.rtcSignaling(e,Ms,!0,t)];case 1:return[2,n.sent().code]}}))}))},n.prototype.rtcPing=function(e,t,n){return ue(this,void 0,void 0,(function(){return ce(this,(function(r){switch(r.label){case 0:return[4,this._context.rtcPing(e,t,n)];case 1:return[2,r.sent().code]}}))}))},n.prototype.rtcPingResVersion=function(e,t,n){return this._context.rtcPing(e,t,n)},n.prototype.getRTCRoomInfo=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i;return ce(this,(function(s){switch(s.label){case 0:return t=this._context.rtcCodec.encode(ns.RtcQueryListInput,{order:2}),[4,this.rtcSignaling(e,Ls,!0,t)];case 1:return n=s.sent(),r=n.code,o=n.buffer,r===exports.ErrorCode.SUCCESS&&o&&(i=this._context.rtcCodec.decode(ns.RtcRoomInfoOutput,o)),[2,{code:r,data:i}]}}))}))},n.prototype.getRTCUserInfoList=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s;return ce(this,(function(a){switch(a.label){case 0:return t=this._context.rtcCodec.encode(ns.RtcQueryListInput,{order:2}),[4,this.rtcSignaling(e,Us,!0,t)];case 1:return n=a.sent(),r=n.code,o=n.buffer,r===exports.ErrorCode.SUCCESS&&o&&(s=ds(this._context.rtcCodec,o),i={users:s.users}),[2,{code:r,data:i}]}}))}))},n.prototype.getRTCUserInfo=function(e){throw new Error("Method not implemented.")},n.prototype.setRTCUserInfo=function(e,t,n){return ue(this,void 0,void 0,(function(){var r;return ce(this,(function(o){switch(o.label){case 0:return r=this._context.rtcCodec.encode(ns.RtcValueInfo,{key:t,value:n}),[4,this.rtcSignaling(e,bs,!0,r)];case 1:return[2,o.sent().code]}}))}))},n.prototype.removeRTCUserInfo=function(e,t){return ue(this,void 0,void 0,(function(){var n;return ce(this,(function(r){switch(r.label){case 0:return n=this._context.rtcCodec.encode(ns.RtcKeyDeleteInput,{key:t}),[4,this.rtcSignaling(e,Ps,!1,n)];case 1:return[2,r.sent().code]}}))}))},n.prototype.setRTCData=function(e,t,n,r,o,i){return ue(this,void 0,void 0,(function(){var s;return ce(this,(function(a){switch(a.label){case 0:return s=this._context.rtcCodec.encode(ns.RtcSetDataInput,{interior:r,target:o,key:t,value:n,objectName:null==i?void 0:i.name,content:null==i?void 0:i.content}),[4,this.rtcSignaling(e,ws,!1,s)];case 1:return[2,a.sent().code]}}))}))},n.prototype.setRTCTotalRes=function(e,t,n,r,o){return void 0===o&&(o=""),ue(this,void 0,void 0,(function(){var i,s;return ce(this,(function(a){switch(a.label){case 0:return i={objectName:r,content:this._context.rtcCodec.encode(ns.RtcValueInfo,{key:t.name,value:t.content},!0),valueInfo:[this._context.rtcCodec.encode(ns.RtcValueInfo,{key:"uris",value:n},!0),this._context.rtcCodec.encode(ns.RtcValueInfo,{key:"mcu_uris",value:o},!0)]},s=this._context.rtcCodec.encode(ns.RtcUserSetDataInput,i),[4,this.rtcSignaling(e,xs,!0,s)];case 1:return[2,a.sent().code]}}))}))},n.prototype.setRTCCDNUris=function(e,t,n){return ue(this,void 0,void 0,(function(){var r;return ce(this,(function(o){switch(o.label){case 0:return r=this._context.rtcCodec.encode(ns.RtcUserSetDataInput,{objectName:t,valueInfo:this._context.rtcCodec.encode(ns.RtcValueInfo,{key:"cdn_uris",value:n},!0)}),[4,this.rtcSignaling(e,xs,!0,r)];case 1:return[2,o.sent().code]}}))}))},n.prototype.getRTCData=function(e,t,n,r){return ue(this,void 0,void 0,(function(){var o,i,s,a,u,c;return ce(this,(function(l){switch(l.label){case 0:return o=this._context.rtcCodec.encode(ns.RtcDataInput,{interior:n,target:r,key:t}),[4,this.rtcSignaling(e,Ds,!0,o)];case 1:return i=l.sent(),s=i.code,a=i.buffer,s===exports.ErrorCode.SUCCESS&&a?(u=this._context.rtcCodec.decode(ns.RtcQryOutput,a).outInfo,c={},u.forEach((function(e){c[e.key]=e.value})),[2,{code:s,data:c}]):[2,{code:s}]}}))}))},n.prototype.removeRTCData=function(e,t,n,r,o){return ue(this,void 0,void 0,(function(){var i;return ce(this,(function(s){switch(s.label){case 0:return i=this._context.rtcCodec.encode(ns.RtcDataInput,{interior:n,target:r,key:t,objectName:null==o?void 0:o.name,content:null==o?void 0:o.content}),[4,this.rtcSignaling(e,Vs,!1,i)];case 1:return[2,s.sent().code]}}))}))},n.prototype.setRTCOutData=function(e,t,n,r){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){throw new Error("JSEngine's method not implemented.")}))}))},n.prototype.getRTCOutData=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){throw new Error("JSEngine's method not implemented.")}))}))},n.prototype.getRTCToken=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return r=ls(this._context.rtcCodec,t,n),[4,this.rtcSignaling(e,Gs,!0,r)];case 1:return o=u.sent(),i=o.code,s=o.buffer,i===exports.ErrorCode.SUCCESS&&s?(a=this._context.rtcCodec.decode(ns.RtcTokenOutput,s).rtcToken,[2,{code:i,data:{rtcToken:a}}]):[2,{code:i}]}}))}))},n.prototype.setRTCState=function(e,t){return ue(this,void 0,void 0,(function(){var n;return ce(this,(function(r){switch(r.label){case 0:return n=this._context.rtcCodec.encode(ns.MCFollowInput,{state:t}),[4,this.rtcSignaling(e,ks,!0,n)];case 1:return[2,r.sent().code]}}))}))},n.prototype.getRTCUserList=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i;return ce(this,(function(s){switch(s.label){case 0:return t=this._context.rtcCodec.encode(ns.RtcQueryListInput,{order:2}),[4,this.rtcSignaling(e,Fs,!0,t)];case 1:return n=s.sent(),r=n.code,o=n.buffer,r===exports.ErrorCode.SUCCESS&&o?(i=ds(this._context.rtcCodec,o),[2,{code:r,data:i}]):[2,{code:r}]}}))}))},n.prototype.joinLivingRoomAsAudience=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o,i,s,a,u,c;return ce(this,(function(l){switch(l.label){case 0:return r=ls(this._context.rtcCodec,t,n),[4,this.rtcSignaling(e,Bs,!0,r)];case 1:return o=l.sent(),i=o.code,s=o.buffer,i===exports.ErrorCode.SUCCESS&&s?(a=this._context.rtcCodec.decode(ns.RtcViewerJoinedOutput,s),u=a.rtcToken,c=a.entries,[2,{code:i,data:{token:u,kvEntries:c}}]):[2,{code:i}]}}))}))},n.prototype.quitLivingRoomAsAudience=function(e){return ue(this,void 0,void 0,(function(){var t;return ce(this,(function(n){switch(n.label){case 0:return t=this._context.rtcCodec.encode(ns.SetUserStatusInput,{status:0}),[4,this.rtcSignaling(e,Hs,!0,t)];case 1:return[2,n.sent().code]}}))}))},n.prototype.rtcIdentityChange=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return r=this._context.rtcCodec.encode(ns.RtcInput,{roomType:exports.RTCMode.LIVE,broadcastType:n,identityChangeType:t,needSysChatroom:!1}),[4,this.rtcSignaling(e,Ys,!0,r)];case 1:return o=u.sent(),i=o.code,s=o.buffer,i===exports.ErrorCode.SUCCESS&&s?(a=ds(this._context.rtcCodec,s),[2,{code:i,data:a}]):[2,{code:i}]}}))}))},n.prototype.requestRoomPK=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return t=e.invitedRoomId,n=e.invitedUserId,r=e.inviteSessionId,o=e.inviteTimeout,i=e.inviteInfo,s=e.roomId,a=this._context.rtcCodec.encode(ns.RtcInviteInput,{invitedRoomId:t,invitedUserId:n,inviteSessionId:r,timeoutTime:o,inviteInfo:i}),[4,this.rtcSignaling(s,Ks,!0,a)];case 1:return[2,u.sent().code]}}))}))},n.prototype.cancelRoomPK=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s;return ce(this,(function(a){switch(a.label){case 0:return t=e.invitedRoomId,n=e.invitedUserId,r=e.inviteSessionId,o=e.inviteInfo,i=e.roomId,s=this._context.rtcCodec.encode(ns.RtcCancelInviteInput,{invitedRoomId:t,invitedUserId:n,inviteSessionId:r,inviteInfo:o}),[4,this.rtcSignaling(i,Qs,!0,s)];case 1:return[2,a.sent().code]}}))}))},n.prototype.responseRoomPK=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a,u,c;return ce(this,(function(l){switch(l.label){case 0:return t=e.inviteUserId,n=e.inviteRoomId,r=e.inviteSessionId,o=e.content,i=e.key,s=e.value,a=e.agree,u=e.roomId,c=this._context.rtcCodec.encode(ns.RtcInviteAnswerInput,{inviteUserId:t,inviteRoomId:n,inviteSessionId:r,content:o,key:i,value:s,answerCode:a?1:0}),[4,this.rtcSignaling(u,Ws,!0,c)];case 1:return[2,l.sent().code]}}))}))},n.prototype.endRoomPK=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s;return ce(this,(function(a){switch(a.label){case 0:return t=e.endRoomId,n=e.sessionId,r=e.content,o=e.keys,i=e.roomId,s=this._context.rtcCodec.encode(ns.RtcEndInviteInput,{inviteRoomId:t,inviteSessionId:n,inviteContent:r,inviteRoomKeys:o}),[4,this.rtcSignaling(i,js,!0,s)];case 1:return[2,a.sent().code]}}))}))},n.prototype.registerRTCSignalListener=function(e){this._context.registerRTCSignalingListener(e)},n.prototype.rtcSignaling=function(e,t,n,r){return this._context.rtcSignaling(e,t,n,r)},n.prototype.getRTCJoinedUserInfo=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i;return ce(this,(function(s){switch(s.label){case 0:return t=this._context.rtcCodec.encode(ns.RtcQueryUserJoinedInput,{userId:e}),[4,this.rtcSignaling("",Js,!0,t)];case 1:return n=s.sent(),r=n.code,o=n.buffer,r===exports.ErrorCode.SUCCESS&&o?(i=this._context.rtcCodec.decode(ns.RtcQueryUserJoinedOutput,o).info||[],[2,{code:r,data:i.map((function(e){return{deviceId:e.deviceId,roomId:e.roomId,joinTime:e.joinTime}}))}]):[2,{code:r}]}}))}))},n}(Ra),ma={"set.proxy":exports.ErrorCode.INVALID_PARAMETER_PROXY,"test.proxy":exports.ErrorCode.INVALID_PARAMETER_TESTHOST,"test.proxy.socksHost":exports.ErrorCode.INVALID_PARAMETER_TESTHOST,"test.proxy.socksPort":exports.ErrorCode.INVALID_PARAMETER_TESTHOST,channelId:exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID,count:exports.ErrorCode.INVALID_PARAMETER_COUNT,startTime:exports.ErrorCode.INVALID_PARAMETER_START_TIME,endTime:exports.ErrorCode.INVALID_PARAMETER_END_TIME,offset:exports.ErrorCode.INVALID_PARAMETER_OFFSET,limit:exports.ErrorCode.INVALID_PARAMETER_LIMIT,keyword:exports.ErrorCode.INVALID_PARAMETER_KEYWORD,messageTypes:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE,messageType:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE,typingContentType:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE,conversation:exports.ErrorCode.INVALID_PARAMETER_CONVERSATION,conversationType:exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE,targetId:exports.ErrorCode.INVALID_PARAMETER_TARGET_ID,targetIds:exports.ErrorCode.INVALID_PARAMETER_TARGET_ID,userId:exports.ErrorCode.INVALID_PARAMETER_USER_ID,senderUserId:exports.ErrorCode.INVALID_PARAMETER_USER_ID,timestamp:exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP,order:exports.ErrorCode.INVALID_PARAMETER_ORDER,messageId:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID,receivedStatus:exports.ErrorCode.INVALID_PARAMETER_RECEIVED_STATUS,receivedStatusInfo:exports.ErrorCode.INVALID_PARAMETER_RECEIVED_STATUS,sentStatus:exports.ErrorCode.INVALID_PARAMETER_SENT_STATUS,content:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_CONTENT,messageIds:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ARRAY,cleanSpace:exports.ErrorCode.INVALID_PARAMETER_CLEAN_SPACE,messageDirection:exports.ErrorCode.INVALID_MESSAGE_DIRECTION,canIncludeExpansion:exports.ErrorCode.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION,expansion:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_EXPANSION,disableNotification:exports.ErrorCode.INVALID_PARAMETER_DISABLE_NOTIFICATION,messages:exports.ErrorCode.MSG_LIMIT_ERROR,checkDuplicate:exports.ErrorCode.INVALID_PARAMETER_CHECK_DUPLICATE,messageUId:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID,key:exports.ErrorCode.INVALID_PARAMETER_KEY,keys:exports.ErrorCode.INVALID_PARAMETER_KEYS,value:exports.ErrorCode.INVALID_PARAMETER_VALUE,isAutoDelete:exports.ErrorCode.INVALID_PARAMETER_IS_AUTO_DELETE,isSendNotification:exports.ErrorCode.INVALID_PARAMETER_IS_SEND_NOTIFICATION,notificationExtra:exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_EXTRA,entries:exports.ErrorCode.INVALID_PARAMETER_ENTRIES,isForce:exports.ErrorCode.INVALID_PARAMETER_IS_FORCE,rtcRoomId:exports.ErrorCode.INVALID_PARAMETER_RTCROOMID,token:exports.ErrorCode.RC_CONN_TOKEN_INCORRECT,conversations:exports.ErrorCode.INVALID_PARAMETER_CONVERSATIONS,draft:exports.ErrorCode.INVALID_PARAMETER_DRAFT,conversationTypes:exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST,levels:exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL,notificationLevel:exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL,notificationLevels:exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL,notificationStatus:exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL,isTop:exports.ErrorCode.INVALID_PARAMETER_IS_TOP,isUpdateTime:exports.ErrorCode.INVALID_PARAMETER_IS_UPDATE_TIME,message:exports.ErrorCode.INVALID_PARAMETER_MESSAGE,mentionedUserIdList:exports.ErrorCode.INVALID_PARAMETER_USERIDLIST,directionalUserIdList:exports.ErrorCode.INVALID_PARAMETER_USERIDLIST,directedUserIds:exports.ErrorCode.INVALID_PARAMETER_USERIDLIST,isStatusMessage:exports.ErrorCode.INVALID_PARAMETER_IS_STATUS_MESSAGE,pushContent:exports.ErrorCode.INVALID_PARAMETER_PUSH_CONTENT,pushData:exports.ErrorCode.INVALID_PARAMETER_PUSH_DATA,isMentioned:exports.ErrorCode.INVALID_PARAMETER_IS_MENTIONED,mentionedType:exports.ErrorCode.INVALID_PARAMETER_MENTIONED_TYPE,isVoipPush:exports.ErrorCode.INVALID_PARAMETER_IS_VOIP_PUSH,pushConfig:exports.ErrorCode.INVALID_PARAMETER_PUSH_CONFIG,startMsgUId:exports.ErrorCode.INVALID_PARAMETER_START_MESSAGE_UID,endMsgUId:exports.ErrorCode.INVALID_PARAMETER_END_MESSAGE_UID,sentTime:exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP,clearMessageOption:exports.ErrorCode.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST,searchContent:exports.ErrorCode.SEARCH_PROPS_LIMIT_ERROR,tagId:exports.ErrorCode.INVALID_PARAMETER_TAG_ID,tagIds:exports.ErrorCode.INVALID_PARAMETER_TAG_ID,tagName:exports.ErrorCode.INVALID_PARAMETER_TAG_NAME,containMuted:exports.ErrorCode.INVALID_PARAMETER_CONTAIN_MUTED,channelType:exports.ErrorCode.INVALID_PARAMETER_CHANNEL_TYPE,file:exports.ErrorCode.MEDIA_EXCEPTION,fileType:exports.ErrorCode.INVALID_PARAMETER_MEDIA_TYPE,contentDisposition:exports.ErrorCode.INVALID_PARAMETER_CONTENT_DISPOSITION,mediaUrl:exports.ErrorCode.INVALID_PARAMETER_MEDIA_URL,filename:exports.ErrorCode.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME,saveName:exports.ErrorCode.INVALID_PARAMETER_SAVE_NAME,serverType:exports.ErrorCode.INVALID_PARAMETER_SERVER_TYPE,subscribeType:exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_TYPE,expiry:exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_EXPIRY,subscribeUserIds:exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS,subscribePageSize:exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE,beforeCount:exports.ErrorCode.INVALID_PARAMETER_BEFORE,afterCount:exports.ErrorCode.INVALID_PARAMETER_AFTER,conversationList:exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST,conversationTypeNotSupport:exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT,profile:exports.ErrorCode.INVALID_PARAMETER_USER_PROFILE,userProfileVisibility:exports.ErrorCode.INVALID_PARAMETER_USER_PROFILE_VISIBILITY,uniqueId:exports.ErrorCode.INVALID_PARAMETER_UNIQUE_ID,extra:exports.ErrorCode.INVALID_PARAMETER_EXTRA,disableUpdateLastMessage:exports.ErrorCode.INVALID_DISABLE_UPDATE_LAST_MESSAGE};exports.AssertRules=void 0,(va=exports.AssertRules||(exports.AssertRules={}))[va.STRING=0]="STRING",va[va.ONLY_STRING=1]="ONLY_STRING",va[va.NUMBER=2]="NUMBER",va[va.BOOLEAN=3]="BOOLEAN",va[va.OBJECT=4]="OBJECT",va[va.ARRAY=5]="ARRAY",va[va.CALLBACK=6]="CALLBACK",va[va.CHANNEL_ID=7]="CHANNEL_ID",va[va.CONVERSATION=8]="CONVERSATION",va[va.CONVERSATION_TYPE=9]="CONVERSATION_TYPE";var Sa,Aa=((Ca={})[exports.AssertRules.STRING]=_t,Ca[exports.AssertRules.ONLY_STRING]=lt,Ca[exports.AssertRules.NUMBER]=dt,Ca[exports.AssertRules.BOOLEAN]=function(e){return"boolean"==typeof e},Ca[exports.AssertRules.OBJECT]=gt,Ca[exports.AssertRules.ARRAY]=pt,Ca[exports.AssertRules.CALLBACK]=function(e){var t=!0;return gt(e)||(t=!1),(e=e||{}).onSuccess&&!ft(e.onSuccess)&&(t=!1),e.onError&&!ft(e.onError)&&(t=!1),t},Ca[exports.AssertRules.CHANNEL_ID]=vt,Ca[exports.AssertRules.CONVERSATION]=function(e){var t=!0;return gt(e)||(t=!1),lt(e.targetId)||(t=!1),Ct(e.conversationType)||(t=!1),Et(e.channelId)||vt(e.channelId)||(t=!1),t},Ca[exports.AssertRules.CONVERSATION_TYPE]=Ct,Ca),Na=function(e){function n(t){var n=e.call(this,t)||this;return n.name="RCAssertError",n}return t(n,e),n}(Error),Oa=function(e,t,n,r){void 0===r&&(r=!1),n=Aa[n]||n;var o=r?n(t):Et(t)||null==t||n(t);return o||null===console||void 0===console||console.error("'".concat(e,"' is invalid: ").concat(JSON.stringify(t))),o},Ma=function(){function e(e,t){var n,r;this._logTagT=e,this._logTagR=t,this.verificationFaileList=[],this.context=Kp.getContext(),this.logger=null===(n=this.context)||void 0===n?void 0:n.logger,this.option=null===(r=this.context)||void 0===r?void 0:r.getOptions()}return e.prototype.validate=function(e,t,n,r,o){if(void 0===r&&(r=!1),this.verificationFaileList.length>0)return this;n=Aa[n]||n;var i=r?n(t):Et(t)||null==t||n(t);if("object"==typeof i){var s=i.valid,a=i.errorKey;return!s&&a&&this.verificationFaileList.push({key:a,value:t,isValid:!1,message:o,code:ma[a]}),this}return i||this.verificationFaileList.push({key:e,value:t,isValid:i,message:o,code:ma[e]}),this},e.prototype.validateParameters=function(e,t,n,r,o,i){if(void 0===o&&(o=!1),this.verificationFaileList.length>0)return this;n=Aa[n]||n;var s=o?n(t):Et(t)||null==t||n(t);if("object"==typeof s){var a=s.valid,u=s.errorKey,c=s.errorCode;return!a&&u&&this.verificationFaileList.push({key:u,value:t,code:c||r,message:i,isValid:!1}),this}return s||this.verificationFaileList.push({key:e,value:t,code:r,message:i,isValid:!1}),this},e.prototype._getValidationResult=function(){if(this.verificationFaileList.length>0)return this.verificationFaileList[0]},e.prototype.ifReady=function(e){var t;if(!this.context)return Promise.resolve({code:exports.ErrorCode.BIZ_ERROR_CLIENT_NOT_INIT});var n=this._getValidationResult();if(n){var r=n.code,o=n.value,i=n.message,s=n.key;return null===(t=this.logger)||void 0===t||t.error(this._logTagR,JSON.stringify({code:r})),Promise.resolve({code:r,msg:"'".concat(s,"' is invalid: ").concat(i||JSON.stringify(o))})}var a=this.logger.createTraceId();return e(this.context,this.logger,this.option,a)},e.prototype.try2do=function(e){if(!this.context)throw new Error("Not initialized yet!");return e(this.context,this.logger,this.option)},e.prototype.ifReadySync=function(e){var t;if(!this.context)return{code:exports.ErrorCode.BIZ_ERROR_CLIENT_NOT_INIT};var n=this._getValidationResult();if(!n)return e(this.context,this.logger,this.option);var r=n.code,o=n.value,i=n.message,s=n.key;return null===(t=this.logger)||void 0===t||t.warn(this._logTagR,JSON.stringify({code:r})),{code:r,msg:"'".concat(s,"' is invalid: ").concat(i||o)}},e}(),La=function(){return Sa||(Sa={set:function(e,t){Tr.localStorage.setItem(e,JSON.stringify(t))},get:function(e){var t;try{t=JSON.parse(Tr.localStorage.getItem(e))}catch(e){t=null}return t},remove:function(e){return Tr.localStorage.removeItem(e)},getKeys:function(){var e=[];for(var t in Tr.localStorage)e.push(t);return e}}),Sa},Ua=function(){function e(e){this._caches={},e&&(this._caches=e)}return e.prototype.set=function(e,t){this._caches[e]=t},e.prototype.remove=function(e){var t=this.get(e);return delete this._caches[e],t},e.prototype.get=function(e){return this._caches[e]},e.prototype.getKeys=function(){var e=[];for(var t in this._caches)e.push(t);return e},e}(),ba=function(){function e(e){var t;this._rootStorage=La();var n=this._rootStorage.get(e)||{};this._cache=new Ua(((t={})[e]=n,t)),this._storageKey=e}return e.prototype._get=function(){var e=this._storageKey;return this._cache.get(e)||{}},e.prototype._set=function(e){var t=this._storageKey;e=e||{},this._cache.set(t,e),this._rootStorage.set(t,e)},e.prototype.set=function(e,t){var n=this._get();n[e]=t,this._set(n)},e.prototype.remove=function(e){var t=this._get();delete t[e],this._set(t)},e.prototype.clear=function(){var e=this._storageKey;this._rootStorage.remove(e),this._cache.remove(e)},e.prototype.get=function(e){return this._get()[e]},e.prototype.getKeys=function(){var e=this._get(),t=[];for(var n in e)t.push(n);return t},e.prototype.getValues=function(){return this._get()||{}},e.prototype.update=function(e){void 0===e&&(e={});var t=this._storageKey;this._cache.set(t,e),this._rootStorage.set(t,e)},e}(),Pa=function(){var e="";if("browser"===Tr.tag)return Xe;var t="RCDeviceId",n=La(),r=n.get(t);return r?e=r:(e=Ze.genWithLen(22),n.set(t,e)),e},wa=function(){if("browser"!==Tr.tag)return{type:Tr.tag,version:"UnKonw"};var e,t,n=navigator.userAgent,r={IE:/rv:([\d.]+)\) like Gecko|MSIE ([\d.]+)/,Edge:/Edge\/([\d.]+)/,Firefox:/Firefox\/([\d.]+)/,Opera:/(?:OPERA|OPR).([\d.]+)/,WeChat:/MicroMessenger\/([\d.]+)/,QQBrowser:/QQBrowser\/([\d.]+)/,Chrome:/Chrome\/([\d.]+)/,Safari:/Version\/([\d.]+).*Safari/,iOSChrome:/Mobile\/([\d.]+).*Safari/};for(var o in r)if(r.hasOwnProperty(o)){var i=n.match(r[o]);if(i){t=o,e=i[1]||i[2];break}}return{type:t||"UnKonw",version:e||"UnKonw"}};function xa(e){return Boolean(1&((null==e?void 0:e.sessionMode)||0))}var Da=function(){function e(){}return e.enable=function(){return!0},e}(),Va=48,Ga=64,ka=80,Fa=96,Ba="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Ha=function(e){for(var t={},n=0;n<e.length-1;n++){var r=e.charAt(n)+e.charAt(n+1);t.hasOwnProperty(r)?t[r].push(n):t[r]=[n]}for(var o=[],i=[],s=function(){if(i.length>0){var e=i.join("");if(i=[],e.length>26){var t=Ya(e.length),n=String.fromCharCode(ka|t.length);o.push(n+t)}else{var r=String.fromCharCode(Fa|e.length);o.push(r)}o.push(e)}},a=0;a<e.length;){var u=qa(t,e,a);if(u.length<2)i.push(e.charAt(a++));else if(u.length<4)i.push(e.substr(a,u.length)),a+=u.length;else{var c=Ya(a-u.offset),l=Ya(u.length);if(c.length+l.length>=u.length)i.push(e.substr(a,u.length)),a+=u.length;else{s();var d=String.fromCharCode(Ga|c.length<<2|l.length);o.push(d+c+l),a+=u.length}}}s();var p=Ya(e.length),h=String.fromCharCode(Va|p.length);return o.push(h+p),o.join("")},qa=function(e,t,n){var r={length:0,offset:-1};if(t.length,n>=t.length-1)return r;var o=e[t.charAt(n)+t.charAt(n+1)];if(o[0]===n)return r;for(var i=t.length-n,s=0,a=o.length;s<a;s++){var u=o[s],c=n-u;if(!(c>238327)){var l=Math.min(i,c);if(l<=r.length)break;if(!(r.length>2&&t.charAt(u+r.length-1)!==t.charAt(n+r.length-1))){for(var d=2,p=d;p<l&&t.charAt(u+p)===t.charAt(n+p);p++)d++;d>=r.length&&(r.length=d,r.offset=u)}}}return r},Ya=function(e){var t=[],n=0;do{n=e%62,t.push(Ba.charAt(n)),e=(e-n)/62}while(e>0);return t.join("")},Ka=function(){function e(){this._callerQueue=[],this._isCalling=!1,this._retryCount=0}return e.prototype.pushTask=function(e){var t=this;return new Promise((function(n){t._callerQueue.push({task:e,resolve:n}),t._startCall()}))},e.prototype._startCall=function(){return ue(this,void 0,void 0,(function(){var e,t;return ce(this,(function(n){switch(n.label){case 0:return this._isCalling||0===this._callerQueue.length?[2]:(this._isCalling=!0,e=this._callerQueue.shift(),[4,this._callHandler(e)]);case 1:return t=n.sent(),e.resolve(t),this._isCalling=!1,this._startCall(),[2]}}))}))},e.prototype._callHandler=function(e){return ue(this,void 0,void 0,(function(){var t,n,r;return ce(this,(function(o){switch(o.label){case 0:return t=e.task,n=this.getVersion(),[4,t(n)];case 1:return(r=o.sent()).code===exports.ErrorCode.USER_SETTING_SYNCED_ERROR&&this._retryCount<5?(this._retryCount++,[4,this._triggerPull(n)]):[3,3];case 2:return o.sent(),[2,this._callHandler(e)];case 3:return this._retryCount=0,[2,r]}}))}))},e.prototype.stopAllTask=function(){this._callerQueue.forEach((function(e){e.resolve({code:exports.ErrorCode.RC_NET_UNAVAILABLE})})),this._callerQueue=[]},e}(),Qa="converStatusChanged",Wa=function(e){function n(t,n,r){var o=e.call(this)||this;return o._eventEmitter=new is,o._pullQueue=[],o._isPulling=!1,o._pullPromise=null,o._storagePullTimeKey="con-s-".concat(n,"-").concat(r),o._oldStorage=La(),o._storage=new ba(De(n,r)),o._engine=t,o.adaptOldStatus(),o}return t(n,e),n.prototype.adaptOldStatus=function(){try{if(this._storage.get(this._storagePullTimeKey)||0)return;var e=this._oldStorage.get(this._storagePullTimeKey)||0;if(!e)return;this._storage.set(this._storagePullTimeKey,e),this._oldStorage.remove(this._storagePullTimeKey)}catch(e){this._engine.getInnerLogger().error(exports.LogTagId.A_CALLBACK_E,"adaptOldStatus error: ".concat(e.message))}},n.prototype._set=function(e){var t=this;if(!Et(e)&&Array.isArray(e)){var n=this._storage.get(this._storagePullTimeKey)||0,r=e.length;e.forEach((function(e,o){var i=e.updatedTime||0;n=i>n?i:n,t._eventEmitter.emit(Qa,{statusItem:e,isLastPull:o===r-1})})),this._storage.set(this._storagePullTimeKey,n),this._pullQueue=this._pullQueue.filter((function(e){return e>n}))}},n.prototype._startPull=function(){return ue(this,void 0,void 0,(function(){var e,t,n,r;return ce(this,(function(o){switch(o.label){case 0:return this._isPulling||0===this._pullQueue.length?[2,this._pullPromise]:(this._isPulling=!0,this._pullQueue.shift(),e=this.getVersion(),this._pullPromise=this._engine.pullConversationStatus(e),[4,this._pullPromise]);case 1:return t=o.sent(),n=t.code,r=t.data,this._isPulling=!1,this._pullPromise=null,n===exports.ErrorCode.SUCCESS&&this._set(r),0===this._pullQueue.length?this._startCall():this._startPull(),[2]}}))}))},n.prototype._startCall=function(){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return this._isPulling||e.prototype._startCall.call(this),[2]}))}))},n.prototype.pull=function(e){var t=this.getVersion();(e>t||0===e)&&(this._pullQueue.push(t),this._startPull())},n.prototype._triggerPull=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){switch(t.label){case 0:return this._pullQueue.push(e),[4,this._startPull()];case 1:return t.sent(),[2]}}))}))},n.prototype.watch=function(e){this._eventEmitter.on(Qa,(function(t){e(t)}))},n.prototype.setConversationUpdatedTime=function(e){var t=this._storage.get(this._storagePullTimeKey)||0;return e&&e>t?(this._storage.set(this._storagePullTimeKey,e),e):t},n.prototype.getVersion=function(){return this._storage.get(this._storagePullTimeKey)||0},n}(Ka),ja={c:{keyName:"unreadMessageCount",defaultVal:0},hm:{keyName:"hasMentioned",defaultVal:!1},m:{keyName:"mentionedInfo",defaultVal:null},t:{keyName:"lastUnreadTime",defaultVal:0},lt:{keyName:"lastReadTime",defaultVal:0},fut:{keyName:"firstUnreadTime",defaultVal:0},fuid:{keyName:"firstUnreadMessageUid",defaultVal:""},nc:{keyName:"notificationStatus",defaultVal:2},nl:{keyName:"notificationLevel",defaultVal:0},to:{keyName:"isTop",defaultVal:!1},tg:{keyName:"tags",defaultVal:{}},mc:{keyName:"unreadMentionedCount",defaultVal:0},st:{keyName:"lastMessageSentTime",defaultVal:0}},Ja={};for(var za in ja){var Za=ja[za].keyName;Ja[Za]=za}var Xa=function(){function e(e,t,n){this._currentUserId=t,this.logger=n,this.storage=new ba(Ve(e,t)),this._localStore=new ba(Ge(e,t))}return e.prototype._getStoreKey=function(e,t,n){return"".concat(n||"","_").concat(e,"_").concat(t)},e.prototype._getConOptionByKey=function(e){var t=(e=e||"").split("_");if(t.length>=2){var n=t.shift(),r=t.shift(),o=t.join("_");return{conversationType:Number(r),targetId:o,channelId:n}}return{conversationType:exports.ConversationType.PRIVATE,targetId:"",channelId:""}},e.prototype._updateMentionedUserList=function(e,t,n){var r=this,o=e.conversationType,i=e.messageType,s=e.isMentioned,a=e.senderUserId;s&&o===exports.ConversationType.GROUP&&((n.userIdList||[]).forEach((function(e){e===r._currentUserId&&t.indexOf(a)<0&&t.push(a)})),n.type===exports.MentionedType.ALL&&t.indexOf(a)<0&&t.push(a));if(i===exports.MessageType.RECALL&&o===exports.ConversationType.GROUP){var u=t.indexOf(a);u>=0&&t.splice(u,1)}return t},e.prototype.updateMentionedData=function(e){var t=e.conversationType,n=e.targetId,r=e.content,o=e.channelId,i=e.senderUserId,s=r.mentionedInfo;if(s&&i!==this._currentUserId){var a=this._getStoreKey(t,n,o),u=this._localStore.get(a)||{},c=Ja.mentionedInfo,l=Ja.hasMentioned,d=u[c]||{},p=d.userIdList||[];s={userIdList:p=this._updateMentionedUserList(e,p,s),type:(null==s?void 0:s.type)||d.type},0!==p.length?(u[c]=s,u[l]=!0):(delete u[c],delete u[l]),Tt(u)?this._localStore.set(a,u):this._localStore.remove(a)}},e.prototype._setLocal=function(e,t){if("tags"===e)for(var n in t)t[n].isTop||delete t[n].isTop;return t},e.prototype.set=function(e,t,n,r){var o=this._getStoreKey(e,t,r),i=this._localStore.get(o)||{};for(var s in n){var a=Ja[s],u=n[s];if(!Et(a)&&!Et(u)&&"hasMentioned"!==s&&"MentionedInfo"!==s)u===ja[a].defaultVal||"tags"===s&&!Tt(u)?delete i[a]:i[a]=this._setLocal(s,u),i.c||(delete i.t,delete i.fut,delete i.fuid,delete i.hm,delete i.m,delete i.mc)}var c=Object.keys(i);1===c.length&&c.includes("st")&&delete i.st,Tt(i)?this._localStore.set(o,i):this._localStore.remove(o)},e.prototype.get=function(e,t,n){void 0===n&&(n="");var r=this._getStoreKey(e,t,n),o=this._localStore.get(r)||{},i={};for(var s in ja){var a=ja[s],u=a.keyName,c=a.defaultVal;i[u]=o[s]||Nt(c)}return i},e.prototype.getValue=function(e){var t=this._localStore.getValues()||{},n=[];for(var r in t){var o=this._getConOptionByKey(r),i={conversationType:o.conversationType,targetId:o.targetId,channelId:o.channelId},s=t[r];for(var a in s)if(ja[a]){var u=ja[a],c=u.keyName,l=u.defaultVal;i[c]=s[a]||Nt(l)}i=e?e(i):i,n.push(i)}return n},e.prototype.getValueForTag=function(){var e=this._localStore.getValues()||{},t={};for(var n in e){var r=this._getConOptionByKey(n),o=r.conversationType,i=r.targetId,s={},a=e[n];for(var u in a){var c=ja[u],l=c.keyName,d=c.defaultVal;s[l]=a[u]||Nt(d)}for(var p in s.tags){Et(t[p])&&(t[p]=[]);var h=se(se({},s),{conversationType:o,targetId:i});delete h.tags,t[p].push(h)}}return t},e.prototype.adaptOldStore=function(){try{var e=this.storage.getValues();if(0===Object.keys(e).length)return;for(var t in e){var n="_".concat(t);this._localStore.set(n,e[t])}this.storage.clear()}catch(e){this.logger.error(exports.LogTagId.O,"adaptOldStore error: ".concat(e.message))}},e.prototype.remove=function(e,t,n){var r=this._getStoreKey(e,t,n);this._localStore.remove(r)},e}(),$a=[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP,exports.ConversationType.SYSTEM,exports.ConversationType.PUBLIC_SERVICE,exports.ConversationType.APP_PUBLIC_SERVICE],eu="conversationChanged",tu="conTagStatusChanged",nu=function(){function e(e,t,n,r,o,i){var s=this;this.isEnableRealtimeSession=i,this._updatedConversations={},this._conTagStatusChanged=!1,this._eventEmitter=new is,this._draftMap={},this._recallMsgTimeMap={},this._appkey=t,this._loginUserId=n,this._store=new Xa(t,n,e.getInnerLogger()),this._statusManager=new Wa(e,t,n),this._statusManager.watch((function(e){var t=e.statusItem,n=e.isLastPull;s.addStatus(t,n)})),this._eventEmitter.on(eu,(function(e){r(e)})),this._eventEmitter.on(tu,(function(){o()}));var a=this._store.getValue();a.length>1e3&&(a=a.sort((function(e,t){var n=e.lastMessageSentTime,r=void 0===n?0:n,o=t.lastMessageSentTime;return(void 0===o?0:o)-r})),a.splice(1e3,a.length).forEach((function(e){s._store.remove(e.conversationType,e.targetId,e.channelId)})))}return e.prototype._calcMsg=function(e,t,n,r){var o=!this._recallMsgTimeMap[e]||this._recallMsgTimeMap[e]&&!this._recallMsgTimeMap[e].find((function(e){return e===r.sentTime})),i=t>=r.sentTime;return n&&(i=n<r.sentTime),{isNotRead:i,isNotRepeadRecallSendTime:o}},e.prototype._calcUnreadCount=function(e,t){if(this.isEnableRealtimeSession)return{hasChanged:!1,localConversation:t,updateItems:{}};var n=e.content,r=e.messageType,o=e.sentTime,i=e.isCounted,s=e.messageDirection,a=e.senderUserId,u=e.messageUId,c=s===exports.MessageDirection.SEND&&a===this._loginUserId,l=r===exports.MessageType.RECALL,d=gt(n),p=!1,h={},_=t.lastUnreadTime,g=t.lastReadTime,f=t.unreadMessageCount;if(_>o||c)return{hasChanged:p,localConversation:t,updateItems:h};if(i&&(0===t.unreadMessageCount&&(t.firstUnreadMessageUid=u,t.firstUnreadTime=o),t.unreadMessageCount=f+1,t.lastUnreadTime=o,p=!0),l&&d){var E=this._handleRecall2UnreadCount(e,_,g,f,p),I=E.unreadMessageCount,T=E.hasChanged;t.unreadMessageCount=I,p=T,0===t.unreadMessageCount&&(t.firstUnreadMessageUid="",t.firstUnreadTime=0)}return p&&(h.unreadMessageCount={val:t.unreadMessageCount||0,time:o}),{hasChanged:p,localConversation:t,updateItems:h}},e.prototype._handleRecall2UnreadCount=function(e,t,n,r,o){var i="".concat(e.conversationType,"_").concat(e.channelId,"_").concat(e.targetId),s=this._calcMsg(i,t,n,e.content),a=s.isNotRead,u=s.isNotRepeadRecallSendTime;return a&&r&&u?(this._recallMsgTimeMap[i]||(this._recallMsgTimeMap[i]=[]),this._recallMsgTimeMap[i].push(e.content.sentTime),{unreadMessageCount:r-1,hasChanged:!0}):{unreadMessageCount:r,hasChanged:o}},e.prototype._calcMentionedInfo=function(e,t){var n=e.content,r=e.messageDirection,o=e.isMentioned,i=e.sentTime,s=r===exports.MessageDirection.SEND,a=gt(n),u=!1,c={};return!s&&o&&a&&n.mentionedInfo&&(t.hasMentioned=!0,u=!0,c.hasMentioned={val:!0,time:i},c.mentionedInfo={val:n.mentionedInfo,time:i}),{hasChanged:u,localConversation:t,updateItems:c}},e.prototype._calcMentionedCount=function(e,t){var n=e.content,r=e.messageDirection,o=!1;if(e.isMentioned&&r===exports.MessageDirection.RECEIVE&&(null==n?void 0:n.mentionedInfo)){var i=n.mentionedInfo,s=i.type,a=i.userIdList;if(s===exports.MentionedType.ALL||(a||[]).includes(this._loginUserId)){o=!0;var u=t.unreadMentionedCount||0;t.unreadMentionedCount=u+1}}return{hasChanged:o,localConversation:t}},e.prototype._setUpdatedConversation=function(e){if(gt(e)){var t=e.conversationType,n=e.targetId,r=e.channelId,o="".concat(t,"_").concat(n),i=this._store.get(t,n,r)||{};this._updatedConversations[o]=Object.assign(i,e)}},e.prototype._setConTagStatusChanged=function(e,t,n,r){var o=(this._store.get(e,t,r)||{}).tags||{};if(Object.keys(o).length===Object.keys(n).length){for(var i in o)if(!n[i]||!!o[i].isTop!=!!n[i].isTop)return void(this._conTagStatusChanged=!0)}else this._conTagStatusChanged=!0},e.prototype.addStatus=function(e,t){var n=e.conversationType,r=e.targetId,o=e.updatedTime,i=e.notificationStatus,s=e.notificationLevel,a=e.isTop,u=e.tags,c=e.channelId,l={},d={};if(n!==exports.ConversationType.ULTRA_GROUP){Et(s)||(d.notificationLevel={time:o,val:s},d.notificationStatus={time:o,val:Ne(s)}),Et(a)||(d.isTop={time:o,val:a}),Et(u)||(d.tags={time:o,val:u},null==u||u.forEach((function(e){l[e.tagId]={isTop:e.isTop}}))),this._setConTagStatusChanged(n,r,l,c);var p=this._store.get(n,r,c).lastMessageSentTime||(new Date).getTime();this._store.set(n,r,{notificationStatus:i,notificationLevel:s,isTop:a,tags:l,lastMessageSentTime:p},c),r&&(this._setUpdatedConversation({conversationType:n,targetId:r,updatedItems:d,channelId:c}),t&&this._notifyConversationChanged())}},e.prototype._notifyConversationChanged=function(){var e=[];for(var t in this._updatedConversations)e.push(this._updatedConversations[t]);0!==e.length&&(this._eventEmitter.emit(eu,e),this._updatedConversations={},this._conTagStatusChanged&&(this._eventEmitter.emit(tu),this._conTagStatusChanged=!1))},e.prototype.setConversationCacheByMessage=function(e,t){var n=this,r=e.conversationType,o=e.isPersited,i=e.targetId,s=e.channelId,a=e.sentTime,u=e.disableUpdateLastMessage;if($a.indexOf(r)>=0){var c=!1,l=this._store.get(r,i,s),d={};if(l.lastMessageSentTime=a,[this._calcUnreadCount,this._calcMentionedInfo,this._calcMentionedCount].forEach((function(t){var r=t.call(n,e,l),o=r.hasChanged,i=r.localConversation,s=r.updateItems;c=c||o,d=se(se({},d),s),l=Nt(i)})),this._store.set(r,i,l,s),this._store.updateMentionedData(e),o&&!u){var p=this._store.get(r,i,s);p.updatedItems=se({latestMessage:{time:e.sentTime,val:e}},d),p.latestMessage=e;var h=Object.assign(p,{conversationType:r,targetId:i,channelId:s});this._setUpdatedConversation(h)}(c||o&&!u)&&this._notifyConversationChanged()}},e.prototype.get=function(e,t,n){return void 0===n&&(n=""),this._store.get(e,t,n)},e.prototype.getAllUnreadCount=function(e,t,n){var r=this._store.getValue(),o=0;return r.forEach((function(e){var r=e.unreadMessageCount,i=e.notificationStatus,s=e.notificationLevel,a=e.conversationType;r=r||0,(n||void 0!==s&&s<=0||void 0===s&&i!==exports.NotificationStatus.OPEN)&&(t.length>0?t.includes(Number(a))&&(o+=Number(r)):o+=Number(r))})),o},e.prototype.getTotalUnreadCountByLevels=function(e,t,n){var r=this._store.getValue(),o=0;return r.forEach((function(r){var i=r.unreadMessageCount,s=r.notificationLevel,a=void 0===s?0:s,u=r.conversationType,c=r.unreadMentionedCount;e.includes(u)&&(0===t.length||t.includes(a))&&(o+=(n?c:i)||0)})),o},e.prototype.getUnreadCountByTag=function(e,t){var n=this._store.getValueForTag()[e]||[],r=0;return n.forEach((function(e){var n=e.unreadMessageCount,o=e.notificationStatus,i=e.notificationLevel;(t||1!==o||-1===i||0===i)&&(n=n||0,r+=Number(n))})),r},e.prototype.getUnreadCount=function(e,t,n){return this._store.get(e,t,n).unreadMessageCount||0},e.prototype.clearUnreadCount=function(e,t,n,r,o){void 0===o&&(o=!0);var i=this._store.get(e,t,n);i.lastReadTime=i.lastUnreadTime,this._recallMsgTimeMap["".concat(e,"_").concat(n,"_").concat(t)]=[];var s=i.unreadMessageCount,a=i.hasMentioned,u={};if(s&&(i.unreadMessageCount=0,u.unreadMessageCount={val:0,time:r}),a&&(i.hasMentioned=!1,i.unreadMentionedCount=0,i.mentionedInfo=void 0,u.hasMentioned={val:!1,time:r},u.mentionedInfo={val:void 0,time:r}),this._store.set(e,t,i,n),o&&0!==Object.keys(u).length){var c=Object.assign(i,{conversationType:e,targetId:t,channelId:n,updatedItems:u});this._setUpdatedConversation(c),this._notifyConversationChanged()}},e.prototype.clearAllUnreadCount=function(){var e=this;this._store.getValue().forEach((function(t){t.unreadMessageCount&&(t.unreadMessageCount=0,t.lastReadTime=t.lastUnreadTime,e._recallMsgTimeMap={},e._store.set(t.conversationType,t.targetId,t,t.channelId))}))},e.prototype.startPullConversationStatus=function(e){this._statusManager.pull(e)},e.prototype.setDraft=function(e,t,n,r){var o="".concat(e,"_").concat(t,"_").concat(r);this._draftMap[o]=n},e.prototype.getDraft=function(e,t,n){var r="".concat(e,"_").concat(t,"_").concat(n);return this._draftMap[r]},e.prototype.clearDraft=function(e,t,n){var r="".concat(e,"_").concat(t,"_").concat(n);delete this._draftMap[r]},e.prototype.addTagStatus=function(e,t,n,r){void 0===r&&(r="");var o=this._store.get(e,t,r),i=o.tags;i=Object.assign(i,n);var s=o.lastMessageSentTime||(new Date).getTime();this._store.set(e,t,{tags:i,lastMessageSentTime:s},r)},e.prototype.deleteTagStatus=function(e,t,n,r){void 0===r&&(r="");var o=this._store.get(e,t,r).tags;n.forEach((function(e){delete o[e]})),this._store.set(e,t,{tags:o},r)},e.prototype.getConversationListForTag=function(){return this._store.getValueForTag()},e.prototype.getBlockConversationList=function(){return this._store.getValue().filter((function(e){return e.notificationStatus===exports.NotificationStatus.OPEN||e.notificationLevel&&e.notificationLevel>0})).map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,notificationLevel:e.notificationLevel||0,notificationStatus:e.notificationStatus||2}}))},e.prototype.getTopConversationList=function(e,t){var n=this;return(this._store.getValue()||{}).filter((function(n){return e.includes(n.conversationType)&&(Et(t)||t===n.channelId)&&n.isTop})).map((function(e){return n._buildConversation(e)}))},e.prototype.adaptOldStore=function(){this._store.adaptOldStore()},e.prototype.getUnreadMentionedCount=function(e,t,n){return void 0===n&&(n=""),this.get(e,t,n).unreadMentionedCount||0},e.prototype.getAllUnreadMentionedCount=function(){var e=this._store.getValue(),t=0;return e.forEach((function(e){var n=e.unreadMentionedCount;n=n||0,t+=Number(n)})),t},e.prototype.getAllConversationState=function(){return this._store.getValue().filter((function(e){return e.unreadMessageCount||e.unreadMentionedCount})).map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,unreadCount:e.unreadMessageCount||0,unreadMentionedCount:e.unreadMentionedCount||0}}))},e.prototype.getUnreadConversationList=function(e){var t=this;return(this._store.getValue()||{}).filter((function(t){return e.includes(t.conversationType)&&t.unreadMessageCount&&t.unreadMessageCount>0})).map((function(e){return t._buildConversation(e)}))},e.prototype._buildConversation=function(e){var t=this.getDraft(e.conversationType,e.targetId,e.channelId);return{channelId:e.channelId,conversationType:e.conversationType,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount||0,latestMessage:null,hasMentioned:e.hasMentioned||!1,mentionedInfo:e.mentionedInfo,notificationStatus:e.notificationStatus||0,notificationLevel:e.notificationLevel||0,isTop:e.isTop||!1,lastUnreadTime:e.lastUnreadTime||0,unreadMentionedCount:e.unreadMentionedCount||0,draft:t}},e.prototype.setConversationUpdatedTime=function(e){return this._statusManager.setConversationUpdatedTime(e)},e.prototype.getConversationUpdatedTime=function(){return this._statusManager.getVersion()},e.prototype.pushTask=function(e){return this._statusManager.pushTask(e)},e.prototype.stopAllTask=function(){this._statusManager.stopAllTask()},e}(),ru=function(){function e(e,t){this._localStore=new ba(ke(e,t))}return e.prototype.set=function(e,t,n,r){var o=this._getStoreKey(e,t,r),i=this._localStore.get(o)||{};for(var s in n){var a=iu[s],u=n[s];if(!Et(a)&&!Et(u))u===ou[a].defaultVal?delete i[a]:i[a]=u}Tt(i)?this._localStore.set(o,i):this._localStore.remove(o)},e.prototype.get=function(e,t,n){void 0===n&&(n="");var r=this._getStoreKey(e,t,n),o=this._localStore.get(r)||{},i={};for(var s in ou){var a=ou[s],u=a.keyName,c=a.defaultVal;i[u]=o[s]||Nt(c)}return i},e.prototype._getStoreKey=function(e,t,n){return"".concat(n,"_").concat(e,"_").concat(t)},e}(),ou={nc:{keyName:"notificationStatus",defaultVal:2},nl:{keyName:"notificationLevel",defaultVal:0}},iu={};for(var su in ou){var au=ou[su].keyName;iu[au]=su}var uu=function(){function e(e,t){this._store=new ru(e,t)}return e.prototype.addUltraGroupStatus=function(e){var t=e.conversationType,n=e.targetId,r=e.notificationStatus,o=e.notificationLevel,i=e.channelId;t===exports.ConversationType.ULTRA_GROUP&&this._store.set(t,n,{notificationStatus:r,notificationLevel:o},i)},e.prototype.get=function(e,t,n){return void 0===n&&(n=""),this._store.get(e,t,n)},e}(),cu={_caches:{},set:function(e,t){this._caches[e]=t},get:function(e){return this._caches[e]||0},clear:function(e){this._caches[e]=0}},lu=function(){function e(e,t,n){this.logger=e,this._kvCaches={},this._chatroomId=t,this._currentUserId=n}return e.prototype._add=function(e){var t=e.key;e.isDeleted=!1,this._kvCaches[t]=e},e.prototype._remove=function(e){var t=e.key,n=this._kvCaches[t];n&&(n.isDeleted=!0,this._kvCaches[t]=n)},e.prototype._setEntry=function(e,t){var n=e.key,r=e.type,o=e.isOverwrite,i=e.userId,s=this._getSetUserId(n),a=r===exports.ChatroomEntryType.DELETE,u=s===i,c=!this._isExisted(n),l=a?this._remove:this._add;(t||o||u||c)&&l.call(this,e)},e.prototype.getValue=function(e){var t=this._kvCaches[e]||{};return t.isDeleted?null:t.value},e.prototype.getVersion=function(e){var t=this._kvCaches[e]||{};return t.isDeleted?null:t.version},e.prototype.getAllValue=function(){var e={};for(var t in this._kvCaches)this._kvCaches[t].isDeleted||(e[t]=this._kvCaches[t].value);return e},e.prototype._getSetUserId=function(e){return(this._kvCaches[e]||{}).userId},e.prototype._isExisted=function(e){var t=this._kvCaches[e]||{},n=t.value,r=t.isDeleted;return n&&!r},e.prototype.setEntries=function(e){var t=this,n=e.kvEntries,r=e.isFullUpdate;n=n||[],(r=r||!1)&&this.clear(),n.forEach((function(e){t._setEntry(e,r)}))},e.prototype.clear=function(){this._kvCaches={}},e}(),du=function(){function e(e){this._pullQueue=[],this._isPulling=!1,this._storeCaches={},this._engine=e}return e.prototype._startPull=function(){return ue(this,void 0,void 0,(function(){var e,t,n,r,o,i,s;return ce(this,(function(a){switch(a.label){case 0:return this._isPulling||0===this._pullQueue.length?[2]:(this._isPulling=!0,e=this._pullQueue.splice(0,1)[0],t=e.chrmId,n=e.timestamp,(r=cu.get(t))>n?(this._isPulling=!1,this._startPull(),[2]):[4,this._engine.pullChatroomEntry(t,r)]);case 1:return o=a.sent(),i=o.code,s=o.data,this._isPulling=!1,i===exports.ErrorCode.SUCCESS?(cu.set(t,s.syncTime||0),this._startPull()):this._startPull(),[2]}}))}))},e.prototype.reset=function(e){cu.clear(e);var t=this._storeCaches[e];null==t||t.clear()},e.prototype.pullEntry=function(e,t){this._pullQueue.push({chrmId:e,timestamp:t}),this._startPull()},e.prototype.setLocal=function(e,t,n){var r=this._storeCaches[e];Tt(r)||(r=new lu(this._engine.getInnerLogger(),e,n)),r.setEntries(t),this._storeCaches[e]=r},e.prototype.getValue=function(e,t){var n=this._storeCaches[e];return n?n.getValue(t):null},e.prototype.getVersion=function(e,t){var n=this._storeCaches[e];return n?n.getVersion(t):null},e.prototype.getAll=function(e){var t=this._storeCaches[e],n={};return t&&(n=t.getAllValue()),n},e}(),pu=function(){function e(e){this._canJoinMulipleChrm=e,this._joinedChrmsInfo={}}return e.prototype.set=function(e,t,n){void 0===t&&(t=10),void 0===n&&(n=""),this._canJoinMulipleChrm||(this._joinedChrmsInfo={}),this._joinedChrmsInfo[e]={count:t,extra:n}},e.prototype.get=function(){return JSON.parse(JSON.stringify(this._joinedChrmsInfo))},e.prototype.remove=function(e){delete this._joinedChrmsInfo[e]},e.prototype.clear=function(){this._joinedChrmsInfo={}},e}(),hu=function(e){function n(t,n,r,o){var i=e.call(this)||this;return i._tagKey="tags",i._versionKey="version",i._pullQueue=[],i._isPulling=!1,i._pullPromise=null,i._storageKey=Ye(n,r),i._storage=new ba(i._storageKey),i._engine=t,i._tagWatcherFunc=o,i}return t(n,e),n.prototype._updateTag=function(e){var t=e.tags,n={};t.forEach((function(e){n[e.tagId]={tagName:e.tagName,createdTime:e.createdTime}})),this._storage.set(this._tagKey,n),this._tagWatcherFunc()},n.prototype.addTag=function(e,t){var n,r=this._storage.get(this._tagKey)||{};e.forEach((function(e){var t,n=(null===(t=r[e.tagId])||void 0===t?void 0:t.createdTime)||e.createdTime||0;r[e.tagId]={tagName:e.tagName,createdTime:n}})),this._storage.update(((n={})[this._tagKey]=r,n[this._versionKey]=t,n))},n.prototype.deleteTag=function(e,t){var n,r=this._storage.get(this._tagKey)||{};e.forEach((function(e){delete r[e]})),this._storage.update(((n={})[this._tagKey]=r,n[this._versionKey]=t,n))},n.prototype.getTagsInfo=function(){return this._storage.get(this._tagKey)||{}},n.prototype.getTags=function(){var e=this._storage.get(this._tagKey)||{},t=[];for(var n in e)t.push({tagId:n,tagName:e[n].tagName,createdTime:e[n].createdTime,conversationCount:0});return t.sort((function(e,t){return(e.createdTime||0)-(t.createdTime||0)}))},n.prototype.getTagById=function(e){var t=this._storage.get(this._tagKey)||{};return t[e]?{tagId:e,tagName:t[e].tagName,createdTime:t[e].createdTime,conversationCount:0}:null},n.prototype._startPull=function(){return ue(this,void 0,void 0,(function(){var e,t,n,r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return this._isPulling||0===this._pullQueue.length?[2,this._pullPromise]:(this._isPulling=!0,this._pullQueue.shift(),e=this.getVersion(),this._pullPromise=this._engine.pullUserSettings(e),[4,this._pullPromise]);case 1:return t=u.sent(),n=t.code,r=t.data,this._isPulling=!1,this._pullPromise=null,n!==exports.ErrorCode.SUCCESS||Et(r)||(i=(o=r).settings,s=o.version,a=i.Tag,Et(a)||this._updateTag(a),this._storage.set(this._versionKey,s),this._pullQueue=this._pullQueue.filter((function(e){return e>s}))),0===this._pullQueue.length?this._startCall():this._startPull(),[2]}}))}))},n.prototype._startCall=function(){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return this._isPulling||e.prototype._startCall.call(this),[2]}))}))},n.prototype.pullUserSettings=function(e){var t=this.getVersion();(e>t||0===e)&&(this._pullQueue.push(t),this._startPull())},n.prototype._triggerPull=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){switch(t.label){case 0:return this._pullQueue.push(e),[4,this._startPull()];case 1:return t.sent(),[2]}}))}))},n.prototype.getVersion=function(){return this._storage.get(this._versionKey)||0},n.prototype.updateVersion=function(e){this._storage.set(this._versionKey,e)},n}(Ka),_u={};function gu(){return{code:200,protocol:"https",server:"",voipCallInfo:"",kvStorage:0,openHttpDNS:!1,historyMsg:!1,chatroomMsg:!1,location:"",monitor:0,joinMChrm:!1,openMp:0,openUS:0,grpMsgLimit:0,isFormatted:0,gifSize:2048,logSwitch:0,logPolicy:"",compDays:0,msgAck:"",activeServer:"",qnAddr:"",extkitSwitch:0,alone:!1,voipServer:"",offlinelogserver:"",backupServer:cn.getMiniCmpUrlList().join(",")}}var fu=function(e){function n(t,n,r,o){void 0===o&&(o="default");var i=e.call(this,t,n,r,Tr.useNavi&&"https:"===(null===window||void 0===window?void 0:window.location.protocol),Tr.useNavi)||this;return i._environment=o,i}return t(n,e),n.prototype.httpRequest=function(e,t,n,r,o){return ue(this,void 0,void 0,(function(){var i,s,a,u;return ce(this,(function(c){switch(c.label){case 0:return i="".concat(e,"/navi.js?appId=").concat(t,"&token=").concat(encodeURIComponent(n),"&callBack=x&v=").concat(be,"&r=").concat(Date.now(),"&env=").concat(this._environment),this.logger.debug(exports.LogTagId.L_REQUEST_T,"req navi => ".concat(i),r),[4,Tr.httpReq({url:i,timeout:1e4,dataType:"text"})];case 1:if(200!==(s=c.sent()).status)return this.logger.debug(exports.LogTagId.L_REQUEST_R,"request navi failed: ".concat(s.status),r),!Tr.useNavi&&o?[2,it(gu())]:[2,st(this.transHttpCode(s.status))];try{return 0===(a=s.data.match(/{[\d\D]+}/)[0]).indexOf('{\\"code\\":')&&(a=JSON.parse('"'.concat(a,'"'))),(u=JSON.parse(a)).protocol=/^https/.test(i)?"https":"http",u.code&&200!==u.code?[2,st(this.transHttpCode(u.code))]:(Tr.useNavi||(u.server="",u.backupServer=cn.getMiniCmpUrlList().join(","),u.logSwitch=0),[2,it(u)])}catch(e){this.logger.error(exports.LogTagId.L_PARSE_NAVI_E,s.data,r)}return[2,st(exports.ErrorCode.RC_NAVI_REQ_FAILED)]}}))}))},n.prototype.httpRequestV2=function(e,t,n,r,o){return ue(this,void 0,void 0,(function(){var i,s,a,u,c;return ce(this,(function(l){switch(l.label){case 0:return i=this.getNaviV2RequestOption({appkey:t,token:n,uri:e,platform:Tr.tag,protocol:(/^https/.test(e)?x.WSS:x.WS).toString()}),this.logger.debug(exports.LogTagId.L_REQUEST_T,"req navi => ".concat(i.url),r),[4,Tr.httpReq(i)];case 1:if(200!==(s=l.sent()).status)return this.logger.debug(exports.LogTagId.L_REQUEST_R,"request navi failed: ".concat(s.status),r),!Tr.useNavi&&o?[2,it(gu())]:[2,st(this.transHttpCode(s.status))];try{return a=s.data,(u="object"!=typeof a?JSON.parse(a):a).protocol=/^https/.test(i.url)?"https":"http",Tr.useNavi||(u.logSwitch=0,c=cn.getMiniCmpUrlList(),u.serverAddr=c.map((function(e,t){return{addr:e,protocol:/^https/.test(i.url)?x.WSS:x.WS,weight:c.length-t}}))),[2,it(u)]}catch(e){this.logger.error(exports.LogTagId.L_PARSE_NAVI_E,s.data,r)}return[2,st(exports.ErrorCode.RC_NAVI_REQ_FAILED)]}}))}))},n.prototype.getNaviCache=function(e){var t=this,n=this.getCatchKey(e);if(_u[n])return _u[n];var r,o=xe(this.appkey),i=Tr.localStorage;try{var s=i.getItem(o);r=s?JSON.parse(s):[]}catch(e){r=[]}if(0===r.length)return null;var a=r.find((function(n){return n.token===e&&n.environment===t._environment}))||null;return _u[n]=a,a},n.prototype.setNaviCache=function(e,t){var n,r=this,o=xe(this.appkey),i=Tr.localStorage;try{var s=i.getItem(o);n=s?JSON.parse(s):[]}catch(e){n=[]}var a=Date.now();n.length>0&&(n=n.filter((function(t){return a-t.timestamp<Oe&&(e!==t.token||r._environment!==t.environment)})));var u={timestamp:a,naviInfo:t,token:e,environment:this._environment};n.push(u),i.setItem(o,JSON.stringify(n)),_u[this.getCatchKey(e)]=u},n}(Nn),Eu=function(){function e(e){this._appkey=e,this._users={}}return e.prototype._getMemData=function(e){return this._users[e]=this._users[e]||{inboxTime:0,outboxTime:0,broadcastSyncTime:0},this._users[e]},e.prototype.setInboxTime=function(e,t){var n=this._getMemData(t);if(!(n.inboxTime>e)){n.inboxTime=e;var r=Be(this._appkey,t);Tr.localStorage.setItem(r,e.toString())}},e.prototype.getInboxTime=function(e){var t=this._getMemData(e);if(0===t.inboxTime){var n=Be(this._appkey,e);t.inboxTime=parseInt(Tr.localStorage.getItem(n),10)||0}return t.inboxTime},e.prototype.setBroadcastSyncTime=function(e,t){var n=this._getMemData(t);if(!(n.broadcastSyncTime>=e||Et(e))){n.broadcastSyncTime=e;var r=He(this._appkey,t);Tr.localStorage.setItem(r,e.toString())}},e.prototype.getBroadcastSyncTime=function(e){var t=this._getMemData(e);if(!t||0===t.broadcastSyncTime){var n=He(this._appkey,e);t.broadcastSyncTime=parseInt(Tr.localStorage.getItem(n),10)||1}return t.broadcastSyncTime},e.prototype.setOutboxTime=function(e,t){var n=this._getMemData(t);if(!(n.outboxTime>=e)){n.outboxTime=e;var r=Fe(this._appkey,t);Tr.localStorage.setItem(r,e.toString())}},e.prototype.getOutboxTime=function(e){var t=this._getMemData(e);if(0===t.outboxTime){var n=Fe(this._appkey,e);t.outboxTime=parseInt(Tr.localStorage.getItem(n),10)||0}return t.outboxTime},e}(),Iu=function(){function e(e){this._appkey=e,this._sendMessageMap={},this._userId=""}return e.prototype.init=function(e){this._userId=e;var t=qe(this._appkey,e);this._sendMessageMap=this._getLocalInfo(t)},e.prototype._getLocalInfo=function(e){var t=Tr.localStorage.getItem(e);try{return t?JSON.parse(t):{}}catch(e){return{}}},e.prototype.setMessage=function(e,t){this._sendMessageMap[e]=t;var n=qe(this._appkey,this._userId),r=this._getLocalInfo(n);r[e]=t,Tr.localStorage.setItem(n,JSON.stringify(r))},e.prototype.getSendMessageMap=function(){return this._sendMessageMap},e.prototype.removeByUID=function(e){delete this._sendMessageMap[e]},e.prototype.removeByTimestamp=function(e){var t=qe(this._appkey,this._userId),n=this._getLocalInfo(t);Object.keys(n).forEach((function(t){n[t]<e&&delete n[t]})),Tr.localStorage.setItem(t,JSON.stringify(n))},e}(),Tu=function(){function e(e){var t;this._delayTime=e,this.subscribeData=((t={})[exports.SubscribeType.ONLINE_STATUS]={},t[exports.SubscribeType.USER_PROFILE]={},t),this._ownProfile=null}return e.prototype.clearSubscribeRelation=function(){var e;this.subscribeData=((e={})[exports.SubscribeType.ONLINE_STATUS]={},e[exports.SubscribeType.USER_PROFILE]={},e)},e.prototype.clearSubscribeStatusData=function(e){var t=this;e===exports.SubscribeType.ONLINE_STATUS?Object.keys(this.subscribeData[e]).forEach((function(n){t.subscribeData[e][n].statusMap={}})):e===exports.SubscribeType.USER_PROFILE&&Object.keys(this.subscribeData[e]).forEach((function(n){t.subscribeData[e][n].profile=void 0}))},e.prototype.getSubscribeUserData=function(e,t){var n=this.subscribeData[e][t];return n?se({},n):void 0},e.prototype.removeSubscribeUserData=function(e,t){delete this.subscribeData[e][t]},e.prototype.updateSubscribeUserData=function(e,t,n){this.subscribeData[e][t]=n},e.prototype.clearExpiredData=function(e){for(var t in this.subscribeData[e]){var n=this.subscribeData[e][t];n.expiry<(Date.now()+this._delayTime-n.subscribeTime)/1e3&&delete this.subscribeData[e][t]}},e.prototype.getSubscribeUserList=function(e,t,n){return pe([],de(Object.values(this.subscribeData[e])),!1).sort((function(e,t){return e.subscribeTime-t.subscribeTime})).slice(n,n+t)},e.prototype.updateOwnProfile=function(e){this._ownProfile=se(se({},e),{extraProfile:se({},e.extraProfile)})},e.prototype.getOwnProfile=function(){return this._ownProfile?se(se({},this._ownProfile),{extraProfile:se({},this._ownProfile.extraProfile)}):null},e}(),Cu=function(){function e(e){this._delayTime=e,this._relationshipStatusVersion=0,this._subUserStatusVersion=0,this._ownProfileVersion=0,this._subStore=new Tu(e)}return e.prototype.updateRelationshipStatusVersion=function(e){e>this._relationshipStatusVersion&&(this._relationshipStatusVersion=e)},e.prototype.getRelationshipStatusVersion=function(){return this._relationshipStatusVersion},e.prototype.updateSubscribeUserStatusVersion=function(e){e>this._subUserStatusVersion&&(this._subUserStatusVersion=e)},e.prototype.getSubscribeUserStatusVersion=function(){return this._subUserStatusVersion},e.prototype._filterSubscribeRelationData=function(e){return e.reduce((function(e,t){return t.subUsers.forEach((function(n){var r=e.find((function(e){return e.subscribeType===t.subType&&e.userId===n.subUserId}));r?r.subscribeTime<t.subTime&&(r.expiry=t.expiry,r.operationType=t.opType,r.subscribeTime=t.subTime):e.push({userId:n.subUserId,subscribeTime:t.subTime,subscribeType:t.subType,expiry:t.expiry,operationType:t.opType})})),e}),[])},e.prototype.updateSubscribeRelation=function(e,t){var n=this;void 0===t&&(t=!1);var r=[],o=[],i=[];return t&&this._subStore.clearSubscribeRelation(),this._filterSubscribeRelationData(e).forEach((function(e){var t,s,a=e.userId,u=e.subscribeTime,c=e.subscribeType,l=e.expiry;if(e.operationType===exports.SubscribeOperationType.UNSUBSCRIBE)return n._subStore.removeSubscribeUserData(c,a),void i.push(e);var d=n._subStore.getSubscribeUserData(c,a);if(!(d&&d.subscribeTime>=u)){if(c===exports.SubscribeType.ONLINE_STATUS){r.push(a);var p=(null===(t=d)||void 0===t?void 0:t.statusMap)||{};n._subStore.updateSubscribeUserData(c,a,{subscribeTime:u,expiry:l,userId:a,subscribeType:c,statusMap:p})}else{o.push(a);var h=null===(s=d)||void 0===s?void 0:s.profile;n._subStore.updateSubscribeUserData(c,a,{subscribeTime:u,expiry:l,userId:a,subscribeType:c,profile:h,isSubscribed:!0})}i.push(e)}})),{newSubscribeOnlineStatusList:r,newSubscribeUserProfileList:o,subscribeUserChangeList:i}},e.prototype.clearSubscribeStatus=function(){this._subStore.clearSubscribeStatusData(exports.SubscribeType.ONLINE_STATUS),this._subStore.clearSubscribeStatusData(exports.SubscribeType.USER_PROFILE)},e.prototype.updateSubscribeUserOnlineStatus=function(e){var t=this,n=[];return e.forEach((function(e){var r=e.subUserId,o=e.data,i=t._subStore.getSubscribeUserData(exports.SubscribeType.ONLINE_STATUS,r);if(i){var s=[],a=se({},i.statusMap);o.forEach((function(e){var t=a[e.platformInfo];if(!(t&&t.changeTime>e.versionTime)){var n={eventValue:e.value,changeTime:e.versionTime};a[e.platformInfo]=n,s.push(se(se({},n),{platform:e.platformInfo}))}})),t._subStore.updateSubscribeUserData(exports.SubscribeType.ONLINE_STATUS,r,{subscribeTime:i.subscribeTime,expiry:i.expiry,userId:r,subscribeType:exports.SubscribeType.ONLINE_STATUS,statusMap:a}),n.push({userId:r,subscribeType:exports.SubscribeType.ONLINE_STATUS,subscribeTime:i.subscribeTime,expiry:i.expiry,details:s})}})),n},e.prototype.updateSubscribeUserProfile=function(e){var t=this,n=[];return e.forEach((function(e){var r=e.userId,o=e.version,i=e.userProfile,s=e.userExtProfile,a=t._subStore.getSubscribeUserData(exports.SubscribeType.USER_PROFILE,r),u=Pt(r,i,s);a?a.profile&&a.profile.version>=o||(t._subStore.updateSubscribeUserData(exports.SubscribeType.USER_PROFILE,r,{subscribeTime:a.subscribeTime,expiry:a.expiry,userId:r,subscribeType:exports.SubscribeType.USER_PROFILE,profile:{info:u,version:o},isSubscribed:a.isSubscribed}),a.isSubscribed&&n.push({userId:r,subscribeType:exports.SubscribeType.USER_PROFILE,subscribeTime:a.subscribeTime,expiry:a.expiry,userProfile:se({},u)})):t._subStore.updateSubscribeUserData(exports.SubscribeType.USER_PROFILE,r,{subscribeTime:0,expiry:0,userId:r,subscribeType:exports.SubscribeType.USER_PROFILE,profile:{info:u,version:o},isSubscribed:!1})})),n},e.prototype.getSubscribeUserStatus=function(e,t){var n=this,r=[];return t.forEach((function(t){var o=n._subStore.getSubscribeUserData(e,t);if(!o||o.expiry<(Date.now()+n._delayTime-o.subscribeTime)/1e3)n._subStore.removeSubscribeUserData(e,t);else{var i={subscribeTime:o.subscribeTime,expiry:o.expiry,userId:o.userId,subscribeType:o.subscribeType};if(e===exports.SubscribeType.ONLINE_STATUS){var s=o.statusMap,a=Object.keys(s).map((function(e){return se({platform:~~e},s[~~e])}));i.details=bt(a)}else if(e===exports.SubscribeType.USER_PROFILE&&!o.isSubscribed)return;r.push(i)}})),r},e.prototype.getUserProfiles=function(e){var t=this,n=[],r=[];return e.forEach((function(e){var o=t._subStore.getSubscribeUserData(exports.SubscribeType.USER_PROFILE,e);if(o&&o.profile){var i=o.profile,s=i.version,a=i.info;if(o.isSubscribed)return t._delayTime+Date.now()-s>6048e5?void r.push(e):void n.push(se(se({},a),{extraProfile:se({},a.extraProfile)}));t._delayTime+Date.now()-s>6e5?r.push(e):n.push(se(se({},a),{extraProfile:se({},a.extraProfile)}))}else r.push(e)})),{list:n,needQueryUserIds:r}},e.prototype.getSubscribeUserList=function(e,t,n){return this._subStore.clearExpiredData(e),this._subStore.getSubscribeUserList(e,t,n).map((function(t){var n={subscribeTime:t.subscribeTime,expiry:t.expiry,userId:t.userId,subscribeType:t.subscribeType};if(e===exports.SubscribeType.ONLINE_STATUS){var r=Object.keys(t.statusMap).map((function(e){return se({platform:~~e},t.statusMap[~~e])}));n.details=bt(r)}return n}))},e.prototype.updateOwnProfile=function(e,t){this._ownProfileVersion>t||this._subStore.updateOwnProfile(e)},e.prototype.getOwnProfile=function(){return this._subStore.getOwnProfile()},e}(),vu=function(){function e(e,t,n,r,o,i,s){this._connectManager=e,this._event=t,this._currentUserId=n,this._delayTime=r,this._logger=o,this._isOpenUserProfile=i,this._subDriven=s,this._isPullingRelationship=!1,this._pullRelationshipQueue=[],this._pullRelationshipFailTime=0,this._isPullingSubUserStatus=!1,this._pullSubUserStatusQueue=[],this._pullSubUserStatusFailTime=0,this._subscribeService=new Cu(r)}return e.prototype.syncData=function(){return ue(this,void 0,void 0,(function(){return ce(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]}}))}))},e.prototype.startSyncSubscribeRelationship=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return this._pullRelationshipQueue.push(e),this._syncSubscribeRelationship(),[2]}))}))},e.prototype._syncSubscribeRelationship=function(e){return void 0===e&&(e=!0),ue(this,void 0,void 0,(function(){return ce(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]}}))}))},e.prototype._pullSubscribeRelationship=function(e,t){return void 0===t&&(t=""),ue(this,void 0,void 0,(function(){var n,r,o,i,s,a,u,c,l,d,p,h,_,g,f;return ce(this,(function(E){switch(E.label){case 0:return n=this._subscribeService.getRelationshipStatusVersion(),r=this._logger.createTraceId(),this._logger.info(exports.LogTagId.L_PULL_SUBSCRIBED_USER_RELATION_T,JSON.stringify({version:n,_pageToken:t}),r),o=this._connectManager.codec.encodePullUserSubReq({version:n,pageToken:t}),i=new la(as.pullUserSub,o,this._currentUserId),[4,this._connectManager.send(i,ii)];case 1:return s=E.sent(),a=s.code,u=s.data,a===exports.ErrorCode.SUCCESS&&u?(this._pullRelationshipFailTime=0,c=u.list,l=u.version,d=u.hasNext,p=u.pageToken,l=mt(l),c.forEach((function(e){e.subTime=mt(e.subTime)})),this._logger.info(exports.LogTagId.L_PULL_SUBSCRIBED_USER_RELATION_R,JSON.stringify({code:a,data:u}),r),e?(h=this._subscribeService.updateSubscribeRelation(c),_=h.newSubscribeOnlineStatusList,g=h.newSubscribeUserProfileList,(f=h.subscribeUserChangeList).length>0&&this._event.subscribeRelationChanged(f),_.length>0&&this._queryAndUpdateUserOnlineStatus(_),g.length>0&&this._queryAndUpdateUserProfile(g)):this._subscribeService.updateSubscribeRelation(c,!t),this._subscribeService.updateRelationshipStatusVersion(l),this._pullRelationshipQueue=this._pullRelationshipQueue.filter((function(e){return e>l})),d?[4,this._pullSubscribeRelationship(e,p)]:[3,3]):(this._logger.error(exports.LogTagId.L_PULL_SUBSCRIBED_USER_RELATION_R,JSON.stringify({code:a,failTime:this._pullRelationshipFailTime}),r),this._pullRelationshipFailTime++,this._pullRelationshipFailTime>5?(this._pullRelationshipFailTime=0,[2]):[2,this._pullSubscribeRelationship(e,t)]);case 2:E.sent(),E.label=3;case 3:return[2]}}))}))},e.prototype.startsyncSubscribeUserStatus=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return this._pullSubUserStatusQueue.push(e),this._syncSubscribeUserStatus(),[2]}))}))},e.prototype._syncSubscribeUserStatus=function(e){return void 0===e&&(e=!1),ue(this,void 0,void 0,(function(){return ce(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]}}))}))},e.prototype._pullSubscribeUserStatus=function(e,t){return void 0===e&&(e=!1),void 0===t&&(t=""),ue(this,void 0,void 0,(function(){var n,r,o,i,s,a,u,c,l,d,p,h,_,g;return ce(this,(function(f){switch(f.label){case 0:return n=this._subscribeService.getSubscribeUserStatusVersion(),r=this._logger.createTraceId(),this._logger.info(exports.LogTagId.L_PULL_SUBSCRIBED_USER_STATUS_T,JSON.stringify({version:n,_pageToken:t,needAllData:e}),r),o=this._connectManager.codec.encodePullSubDataReq({version:n,needAllData:e,pageToken:t}),i=new la(as.pullSubData,o,this._currentUserId),[4,this._connectManager.send(i,ai)];case 1:return s=f.sent(),a=s.code,u=s.data,a===exports.ErrorCode.SUCCESS&&u?(this._pullSubUserStatusFailTime=0,c=u.list,l=u.versionTime,d=u.hasNext,p=u.pageToken,h=u.isFull,l=mt(l),this._logger.info(exports.LogTagId.L_PULL_SUBSCRIBED_USER_STATUS_R,JSON.stringify({code:a,data:u}),r),c.forEach((function(e){e.data.forEach((function(e){e.versionTime=mt(e.versionTime)}))})),this._pullSubUserStatusQueue=this._pullSubUserStatusQueue.filter((function(e){return e>l})),this._subscribeService.updateSubscribeUserStatusVersion(l),_=[],g=[],c.forEach((function(e){e.subType===exports.SubscribeType.ONLINE_STATUS?_.push(e):e.subType===exports.SubscribeType.USER_PROFILE&&g.push(e.subUserId)})),h&&""===t&&this._subscribeService.clearSubscribeStatus(),_.length>0&&this._updateUserOnlineStatus(_,!h),g.length>0?[4,this._queryAndUpdateUserProfile(g,!h)]:[3,3]):(this._logger.warn(exports.LogTagId.L_PULL_SUBSCRIBED_USER_STATUS_R,JSON.stringify({code:a,failTime:this._pullSubUserStatusFailTime}),r),this._pullSubUserStatusFailTime++,this._pullSubUserStatusFailTime>5?(this._pullSubUserStatusFailTime=0,[2]):[2,this._pullSubscribeUserStatus(e,t)]);case 2:f.sent(),f.label=3;case 3:return d?[4,this._pullSubscribeUserStatus(e,p)]:[3,5];case 4:f.sent(),f.label=5;case 5:return[2]}}))}))},e.prototype._queryAndUpdateUserOnlineStatus=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s;return ce(this,(function(a){switch(a.label){case 0:return t=this._logger.createTraceId(),this._logger.info(exports.LogTagId.L_QUERY_SUBSCRIBE_DATA_T,JSON.stringify(e),t),n=this._connectManager.codec.encodeQrySubDataReq(exports.SubscribeType.ONLINE_STATUS,e),r=new la(as.qrySubData,n,this._currentUserId),[4,this._connectManager.send(r,ai)];case 1:return o=a.sent(),i=o.code,s=o.data,this._logger.info(exports.LogTagId.L_QUERY_SUBSCRIBE_DATA_R,JSON.stringify({code:i,data:s}),t),i===exports.ErrorCode.SUCCESS&&s?(this._updateUserOnlineStatus(s.list),[2]):[2]}}))}))},e.prototype._updateUserOnlineStatus=function(e,t){void 0===t&&(t=!0),e.forEach((function(e){e.data.forEach((function(e){e.versionTime=mt(e.versionTime)}))}));var n=this._subscribeService.updateSubscribeUserOnlineStatus(e);n=n.filter((function(e){return e.details&&e.details.length>0})),t&&n.length>0&&this._event.subscribeUserStatusChanged(n)},e.prototype._queryAndUpdateUserProfile=function(e,t){return void 0===t&&(t=!0),ue(this,void 0,void 0,(function(){var n,r,o,i,s,a,u;return ce(this,(function(c){switch(c.label){case 0:return n=this._logger.createTraceId(),this._logger.info(exports.LogTagId.L_PULL_USER_PROFILE_T,JSON.stringify(e),n),r=this._connectManager.codec.encodePullUserProfileReq(e),o=new la(as.pullUserProfile,r,this._currentUserId),[4,this._connectManager.send(o,_i)];case 1:return i=c.sent(),s=i.code,a=i.data,this._logger.info(exports.LogTagId.L_PULL_USER_PROFILE_R,JSON.stringify({code:s,data:a}),n),s===exports.ErrorCode.SUCCESS&&a?(a.UserProfile.forEach((function(e){e.version=mt(e.version)})),u=this._subscribeService.updateSubscribeUserProfile(a.UserProfile),t&&u.length>0&&this._event.subscribeUserStatusChanged(u),[2,{code:s,data:a.UserProfile}]):[2,{code:s}]}}))}))},e.prototype.updateUserStatus=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o;return ce(this,(function(i){switch(i.label){case 0:return(t=this._connectManager.codec.decodeByPBName(e.pbData,ui)).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]:(n=t.data.map((function(e){return{changeTime:mt(e.versionTime),eventValue:e.value,platform:e.platformInfo}})),this._event.subscribeUserStatusChanged([{userId:t.subUserId,subscribeType:t.subType,subscribeTime:0,expiry:0,details:n}]),[3,5]);case 3:return t.subType!==exports.SubscribeType.FRIEND_USER_PROFILE?[3,5]:[4,this._queryAndUpdateUserProfile([t.subUserId])];case 4:r=i.sent(),(o=r.data)&&this._event.subscribeUserStatusChanged([{userId:t.subUserId,subscribeType:t.subType,subscribeTime:0,expiry:0,userProfile:Pt(t.subUserId,o[0].userProfile,o[0].userExtProfile)}]),i.label=5;case 5:return[2]}}))}))},e.prototype.getSubscribeUserStatus=function(e,t){return this._subscribeService.getSubscribeUserStatus(e,t)},e.prototype.getSubscribeUserList=function(e,t,n){return this._subscribeService.getSubscribeUserList(e,t,n)},e.prototype.updateSubscribeRelation=function(e,t,n,r){return void 0===r&&(r=0),ue(this,void 0,void 0,(function(){var o,i,s,a,u,c;return ce(this,(function(l){switch(l.label){case 0:return o=this._connectManager.codec.encodeUpdateUserSubReq(t,e,n,r),i=new la(as.updUserSub,o,this._currentUserId),[4,this._connectManager.send(i,ri)];case 1:return s=l.sent(),a=s.code,u=s.data,a===exports.ErrorCode.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT&&u?[2,{code:a,data:u.subUsers.map((function(e){return e.subUserId}))}]:a===exports.ErrorCode.SUCCESS&&u?(c=u.subTime,this._subscribeService.updateSubscribeRelation([{subType:t,subTime:c,expiry:r,opType:n,subUsers:e.map((function(e){return{subUserId:e}}))}]),n===exports.SubscribeOperationType.SUBSCRIBE&&(t===exports.SubscribeType.ONLINE_STATUS?this._queryAndUpdateUserOnlineStatus(e):t===exports.SubscribeType.USER_PROFILE&&this._queryAndUpdateUserProfile(e,!1)),[2,{code:a}]):[2,{code:a}]}}))}))},e.prototype.getUserProfiles=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return t=this._subscribeService.getUserProfiles(e),n=t.needQueryUserIds,r=t.list,0===n.length?[2,Promise.resolve({code:exports.ErrorCode.SUCCESS,data:r})]:[4,this._queryAndUpdateUserProfile(n,!1)];case 1:return o=u.sent(),i=o.code,s=o.data,i===exports.ErrorCode.SUCCESS&&s?(a=s.map((function(e){return Pt(e.userId,e.userProfile,e.userExtProfile)})),[2,{code:i,data:pe(pe([],de(r),!1),de(a),!1)}]):[2,{code:i,data:pe([],de(r),!1)}]}}))}))},e.prototype.syncOwnProfile=function(e){return void 0===e&&(e=!1),ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a,u,c,l,d,p;return ce(this,(function(h){switch(h.label){case 0:return this._isOpenUserProfile?(t=this._logger.createTraceId(),this._logger.info(exports.LogTagId.L_PULL_OWN_PROFILE_T,"",t),n=this._connectManager.codec.encodeUserProfileInput(),r=new la(as.pullOwnProfile,n,this._currentUserId),[4,this._connectManager.send(r,li)]):[2,Promise.resolve({code:exports.ErrorCode.RC_USER_PROFILE_SERVICE_UNAVAILABLE})];case 1:return o=h.sent(),i=o.code,s=o.data,this._logger.info(exports.LogTagId.L_PULL_OWN_PROFILE_R,JSON.stringify({code:i,data:s}),t),i===exports.ErrorCode.SUCCESS&&s?(a=s.userExtProfile,u=s.userProfile,c=s.version,l=s.userId,d=mt(c),p=Pt(l,u,a),this._subscribeService.updateOwnProfile(p,d),e&&this._event.ownUserProfileChanged(p),[2,{code:i,data:p}]):[2,{code:i}]}}))}))},e.prototype.getOwnProfile=function(){return ue(this,void 0,void 0,(function(){var e;return ce(this,(function(t){return(e=this._subscribeService.getOwnProfile())?[2,{code:exports.ErrorCode.SUCCESS,data:e}]:[2,this.syncOwnProfile()]}))}))},e.prototype.updateOwnProfile=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){return this._subscribeService.updateOwnProfile(e,t),[2]}))}))},e}(),Ru=function(){function e(e,t,n){this._storage=new ba(We(e,t)),this._delayTime=n,this.clear()}return e.prototype._getConversationKey=function(e){return"".concat(e.targetId,"_").concat(e.channelId)},e.prototype._removeExcessData=function(e){var t,n,r=Object.keys(e).map((function(t){return{key:t,value:e[t]}})).sort((function(e,t){return e.value.t-t.value.t})).slice(-30),o={};try{for(var i=le(r),s=i.next();!s.done;s=i.next()){var a=s.value;o[a.key]=a.value}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return o},e.prototype.insert=function(e,t,n,r,o){var i;if(!(r<Date.now()-this._delayTime-we)){var s=this._getConversationKey(e),a=this._storage.get(s)||{};if(!a[t]){var u={t:r,d:n};o&&(u.sId=o);var c=se(se({},a),((i={})[t]=u,i));Object.keys(c).length>30&&(c=this._removeExcessData(c)),this._storage.set(s,c)}}},e.prototype.addReadedUser=function(e,t,n){var r,o=this._getConversationKey(e),i=this._storage.get(o)||{},s=i[t];if(s){if(s.us){if(s.us.includes(n))return}else s.us=[];s.us.push(n),this._storage.set(o,se(se({},i),((r={})[t]=s,r)))}},e.prototype.getReadReceiptInfo=function(e,t){var n=this._getConversationKey(e),r=(this._storage.get(n)||{})[t];return r?{time:r.t,direction:r.d,users:r.us||[],senderId:r.sId}:null},e.prototype.getReceiptMessageDic=function(e){var t=this._getConversationKey(e),n=this._storage.get(t)||{},r={};for(var o in n){var i=n[o];i.d===exports.MessageDirection.RECEIVE&&(r[i.sId]||(r[i.sId]=[]),r[i.sId].push(o))}return r},e.prototype.remove=function(e,t){var n=this._getConversationKey(e),r=this._storage.get(n)||{};r[t]&&(delete r[t],0===Object.keys(r).length?this._storage.remove(n):this._storage.set(n,r))},e.prototype.clear=function(){var e=this._storage.getValues(),t={};for(var n in e){var r=e[n],o={};for(var i in r){var s=r[i];Date.now()-this._delayTime-s.t<we&&(o[i]=s)}Object.keys(o).length&&(t[n]=o)}this._storage.update(t)},e}(),yu=function(e){function n(t,n){var r=e.call(this,t,n)||this;return r.appkey=t,r.logger=n,r._storageKey="",r._storageKey=Ke(t),r}return t(n,e),n.prototype.getCache=function(){return Tr.localStorage.getItem(this._storageKey)},n.prototype.setCache=function(e){Tr.localStorage.setItem(this._storageKey,e)},n.prototype.clearCache=function(){Tr.localStorage.removeItem(this._storageKey)},n.prototype.sendRequest=function(e){return ue(this,void 0,void 0,(function(){var t,n,r;return ce(this,(function(o){switch(o.label){case 0:return[4,Tr.httpReq({url:e})];case 1:return t=o.sent(),n=t.status,r=t.data,[2,{code:n,data:r}]}}))}))},n.prototype.decryptData=function(e){return ue(this,void 0,void 0,(function(){var t,n;return ce(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,Zt(e,"cd4936151214ce45dc1d12673a59d94c","51ad078e5eb17a91")];case 1:return t=r.sent(),[2,JSON.parse(t)];case 2:return n=r.sent(),this.logger.error(exports.LogTagId.L_GET_STATIC_CONF_E,JSON.stringify({error:null==n?void 0:n.stack})),[3,3];case 3:return[2]}}))}))},n}(ln),mu=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t._pullQueue=[],t._isPulling=!1,t}return t(n,e),n.prototype.startPull=function(){return ue(this,void 0,void 0,(function(){var e,t,n,r,o,i,s;return ce(this,(function(a){switch(a.label){case 0:return this._isPulling?[2]:(this._isPulling=!0,[4,this.pullQueueConsumption()]);case 1:return e=a.sent(),t=e.code,n=e.data,this._isPulling=!1,r=n&&n.hasNext||!1,t!==exports.ErrorCode.SUCCESS||Et(n)||(this.pullDataHandler(n),o=this.getVersion(),i=this._pullQueue.filter((function(e){return e>o})),this._pullQueue.length=0,(s=this._pullQueue).push.apply(s,pe([],de(i),!1))),r?(this.startPull(),[2]):(this._pullQueue.length>0&&(this._pullQueue.length=0,this.startPull()),[2])}}))}))},n.prototype._triggerPull=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){switch(t.label){case 0:return this._pullQueue.push(e),[4,this.startPull()];case 1:return t.sent(),[2]}}))}))},n}(Ka),Su=function(e){function n(t,n,r,o,i){var s=e.call(this)||this;return s._connectManager=t,s._currentUserId=n,s._logger=r,s._appkey=o,s._callBack=i,s._lastPullingChangeMessageTime=0,s._lastPullingChangeMessageTimeLocal=(new Date).getTime(),s._duration=18e4,s._pullEventChangeIntervalTimer=-1,s._localStorageKey=je(o,n),s._storage=new ba(s._localStorageKey),s._lastPullingChangeMessageTime=s._storage.get(n)||0,s}return t(n,e),Object.defineProperty(n.prototype,"_isConnected",{get:function(){return this._connectManager.getConnectionStatus()===exports.RCConnectionStatus.CONNECTED},enumerable:!1,configurable:!0}),n.prototype._setLastPullingChangeMessageTime=function(e){this._lastPullingChangeMessageTime=e,this._storage.set(this._currentUserId,e)},n.prototype._startPullEventChangeInterval=function(){var e=this,t=function(){e._pullEventChangeIntervalTimer=setTimeout((function(){var n=Date.now();n-e._lastPullingChangeMessageTimeLocal>=e._duration&&(e.startPullEventChange(e._lastPullingChangeMessageTime,!0),e._lastPullingChangeMessageTimeLocal=n),e._stopUltraSyncInterval(),t()}),3e4)};t()},n.prototype._stopUltraSyncInterval=function(){-1!==this._pullEventChangeIntervalTimer&&(clearTimeout(this._pullEventChangeIntervalTimer),this._pullEventChangeIntervalTimer=-1)},n.prototype.startPullEventChange=function(e,t){void 0===t&&(t=!1);var n=this.getVersion();(e>n||0===e||t)&&this._triggerPull(n)},n.prototype.pullQueueConsumption=function(){if(!this._isConnected)return Promise.resolve({code:exports.ErrorCode.CONNECTION_TIMEOUT});this._logger.info(exports.LogTagId.L_PULL_EVENT_CHANGE_T,"PullEventChange time: ".concat(this._lastPullingChangeMessageTime));var e=this._connectManager.codec.encodeQueryMsgChange(this._lastPullingChangeMessageTime),t=new la(as.pullEventChange,e,this._currentUserId);return t.setHeaderQos(ps.AT_LEAST_ONCE),this._connectManager.send(t,ko)},n.prototype.pullDataHandler=function(e){this._logger.info(exports.LogTagId.L_PULL_EVENT_CHANGE_R,"PullEventChange data: ".concat(JSON.stringify(e)));var t=e.list,n=(null==e?void 0:e.syncTime)||0;this._callBack(t),this._setLastPullingChangeMessageTime(n)},n.prototype.getVersion=function(){return this._lastPullingChangeMessageTime||0},n.prototype.notificationOnline=function(){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){return this._isConnected?(this.startPullEventChange(this._lastPullingChangeMessageTime,!0),this._startPullEventChangeInterval(),this._logger.info(exports.LogTagId.L_PULL_EVENT_CHANGE_NOTIFY_ULTRA_ONLINE_S,"PullEventChange notify online"),[2]):[2]}))}))},n}(mu);function Au(e){let t=e.length;for(;--t>=0;)e[t]=0}const Nu=256,Ou=286,Mu=30,Lu=15,Uu=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]),bu=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]),Pu=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),wu=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),xu=new Array(576);Au(xu);const Du=new Array(60);Au(Du);const Vu=new Array(512);Au(Vu);const Gu=new Array(256);Au(Gu);const ku=new Array(29);Au(ku);const Fu=new Array(Mu);function Bu(e,t,n,r,o){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=o,this.has_stree=e&&e.length}let Hu,qu,Yu;function Ku(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}Au(Fu);const Qu=e=>e<256?Vu[e]:Vu[256+(e>>>7)],Wu=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},ju=(e,t,n)=>{e.bi_valid>16-n?(e.bi_buf|=t<<e.bi_valid&65535,Wu(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},Ju=(e,t,n)=>{ju(e,n[2*t],n[2*t+1])},zu=(e,t)=>{let n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1},Zu=(e,t,n)=>{const r=new Array(16);let o,i,s=0;for(o=1;o<=Lu;o++)s=s+n[o-1]<<1,r[o]=s;for(i=0;i<=t;i++){let t=e[2*i+1];0!==t&&(e[2*i]=zu(r[t]++,t))}},Xu=e=>{let t;for(t=0;t<Ou;t++)e.dyn_ltree[2*t]=0;for(t=0;t<Mu;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},$u=e=>{e.bi_valid>8?Wu(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},ec=(e,t,n,r)=>{const o=2*t,i=2*n;return e[o]<e[i]||e[o]===e[i]&&r[t]<=r[n]},tc=(e,t,n)=>{const r=e.heap[n];let o=n<<1;for(;o<=e.heap_len&&(o<e.heap_len&&ec(t,e.heap[o+1],e.heap[o],e.depth)&&o++,!ec(t,r,e.heap[o],e.depth));)e.heap[n]=e.heap[o],n=o,o<<=1;e.heap[n]=r},nc=(e,t,n)=>{let r,o,i,s,a=0;if(0!==e.sym_next)do{r=255&e.pending_buf[e.sym_buf+a++],r+=(255&e.pending_buf[e.sym_buf+a++])<<8,o=e.pending_buf[e.sym_buf+a++],0===r?Ju(e,o,t):(i=Gu[o],Ju(e,i+Nu+1,t),s=Uu[i],0!==s&&(o-=ku[i],ju(e,o,s)),r--,i=Qu(r),Ju(e,i,n),s=bu[i],0!==s&&(r-=Fu[i],ju(e,r,s)))}while(a<e.sym_next);Ju(e,256,t)},rc=(e,t)=>{const n=t.dyn_tree,r=t.stat_desc.static_tree,o=t.stat_desc.has_stree,i=t.stat_desc.elems;let s,a,u,c=-1;for(e.heap_len=0,e.heap_max=573,s=0;s<i;s++)0!==n[2*s]?(e.heap[++e.heap_len]=c=s,e.depth[s]=0):n[2*s+1]=0;for(;e.heap_len<2;)u=e.heap[++e.heap_len]=c<2?++c:0,n[2*u]=1,e.depth[u]=0,e.opt_len--,o&&(e.static_len-=r[2*u+1]);for(t.max_code=c,s=e.heap_len>>1;s>=1;s--)tc(e,n,s);u=i;do{s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],tc(e,n,1),a=e.heap[1],e.heap[--e.heap_max]=s,e.heap[--e.heap_max]=a,n[2*u]=n[2*s]+n[2*a],e.depth[u]=(e.depth[s]>=e.depth[a]?e.depth[s]:e.depth[a])+1,n[2*s+1]=n[2*a+1]=u,e.heap[1]=u++,tc(e,n,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const n=t.dyn_tree,r=t.max_code,o=t.stat_desc.static_tree,i=t.stat_desc.has_stree,s=t.stat_desc.extra_bits,a=t.stat_desc.extra_base,u=t.stat_desc.max_length;let c,l,d,p,h,_,g=0;for(p=0;p<=Lu;p++)e.bl_count[p]=0;for(n[2*e.heap[e.heap_max]+1]=0,c=e.heap_max+1;c<573;c++)l=e.heap[c],p=n[2*n[2*l+1]+1]+1,p>u&&(p=u,g++),n[2*l+1]=p,l>r||(e.bl_count[p]++,h=0,l>=a&&(h=s[l-a]),_=n[2*l],e.opt_len+=_*(p+h),i&&(e.static_len+=_*(o[2*l+1]+h)));if(0!==g){do{for(p=u-1;0===e.bl_count[p];)p--;e.bl_count[p]--,e.bl_count[p+1]+=2,e.bl_count[u]--,g-=2}while(g>0);for(p=u;0!==p;p--)for(l=e.bl_count[p];0!==l;)d=e.heap[--c],d>r||(n[2*d+1]!==p&&(e.opt_len+=(p-n[2*d+1])*n[2*d],n[2*d+1]=p),l--)}})(e,t),Zu(n,c,e.bl_count)},oc=(e,t,n)=>{let r,o,i=-1,s=t[1],a=0,u=7,c=4;for(0===s&&(u=138,c=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)o=s,s=t[2*(r+1)+1],++a<u&&o===s||(a<c?e.bl_tree[2*o]+=a:0!==o?(o!==i&&e.bl_tree[2*o]++,e.bl_tree[32]++):a<=10?e.bl_tree[34]++:e.bl_tree[36]++,a=0,i=o,0===s?(u=138,c=3):o===s?(u=6,c=3):(u=7,c=4))},ic=(e,t,n)=>{let r,o,i=-1,s=t[1],a=0,u=7,c=4;for(0===s&&(u=138,c=3),r=0;r<=n;r++)if(o=s,s=t[2*(r+1)+1],!(++a<u&&o===s)){if(a<c)do{Ju(e,o,e.bl_tree)}while(0!=--a);else 0!==o?(o!==i&&(Ju(e,o,e.bl_tree),a--),Ju(e,16,e.bl_tree),ju(e,a-3,2)):a<=10?(Ju(e,17,e.bl_tree),ju(e,a-3,3)):(Ju(e,18,e.bl_tree),ju(e,a-11,7));a=0,i=o,0===s?(u=138,c=3):o===s?(u=6,c=3):(u=7,c=4)}};let sc=!1;const ac=(e,t,n,r)=>{ju(e,0+(r?1:0),3),$u(e),Wu(e,n),Wu(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n};var uc=(e,t,n,r)=>{let o,i,s=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<Nu;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),rc(e,e.l_desc),rc(e,e.d_desc),s=(e=>{let t;for(oc(e,e.dyn_ltree,e.l_desc.max_code),oc(e,e.dyn_dtree,e.d_desc.max_code),rc(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*wu[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),o=e.opt_len+3+7>>>3,i=e.static_len+3+7>>>3,i<=o&&(o=i)):o=i=n+5,n+4<=o&&-1!==t?ac(e,t,n,r):4===e.strategy||i===o?(ju(e,2+(r?1:0),3),nc(e,xu,Du)):(ju(e,4+(r?1:0),3),((e,t,n,r)=>{let o;for(ju(e,t-257,5),ju(e,n-1,5),ju(e,r-4,4),o=0;o<r;o++)ju(e,e.bl_tree[2*wu[o]+1],3);ic(e,e.dyn_ltree,t-1),ic(e,e.dyn_dtree,n-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),nc(e,e.dyn_ltree,e.dyn_dtree)),Xu(e),r&&$u(e)},cc={_tr_init:e=>{sc||((()=>{let e,t,n,r,o;const i=new Array(16);for(n=0,r=0;r<28;r++)for(ku[r]=n,e=0;e<1<<Uu[r];e++)Gu[n++]=r;for(Gu[n-1]=r,o=0,r=0;r<16;r++)for(Fu[r]=o,e=0;e<1<<bu[r];e++)Vu[o++]=r;for(o>>=7;r<Mu;r++)for(Fu[r]=o<<7,e=0;e<1<<bu[r]-7;e++)Vu[256+o++]=r;for(t=0;t<=Lu;t++)i[t]=0;for(e=0;e<=143;)xu[2*e+1]=8,e++,i[8]++;for(;e<=255;)xu[2*e+1]=9,e++,i[9]++;for(;e<=279;)xu[2*e+1]=7,e++,i[7]++;for(;e<=287;)xu[2*e+1]=8,e++,i[8]++;for(Zu(xu,287,i),e=0;e<Mu;e++)Du[2*e+1]=5,Du[2*e]=zu(e,5);Hu=new Bu(xu,Uu,257,Ou,Lu),qu=new Bu(Du,bu,0,Mu,Lu),Yu=new Bu(new Array(0),Pu,0,19,7)})(),sc=!0),e.l_desc=new Ku(e.dyn_ltree,Hu),e.d_desc=new Ku(e.dyn_dtree,qu),e.bl_desc=new Ku(e.bl_tree,Yu),e.bi_buf=0,e.bi_valid=0,Xu(e)},_tr_stored_block:ac,_tr_flush_block:uc,_tr_tally:(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(Gu[n]+Nu+1)]++,e.dyn_dtree[2*Qu(t)]++),e.sym_next===e.sym_end),_tr_align:e=>{ju(e,2,3),Ju(e,256,xu),(e=>{16===e.bi_valid?(Wu(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 lc=(e,t,n,r)=>{let o=65535&e,i=e>>>16&65535,s=0;for(;0!==n;){s=n>2e3?2e3:n,n-=s;do{o=o+t[r++]|0,i=i+o|0}while(--s);o%=65521,i%=65521}return o|i<<16};const dc=new Uint32Array((()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t})());var pc=(e,t,n,r)=>{const o=dc,i=r+n;e^=-1;for(let n=r;n<i;n++)e=e>>>8^o[255&(e^t[n])];return~e},hc={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"},_c={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:gc,_tr_stored_block:fc,_tr_flush_block:Ec,_tr_tally:Ic,_tr_align:Tc}=cc,{Z_NO_FLUSH:Cc,Z_PARTIAL_FLUSH:vc,Z_FULL_FLUSH:Rc,Z_FINISH:yc,Z_BLOCK:mc,Z_OK:Sc,Z_STREAM_END:Ac,Z_STREAM_ERROR:Nc,Z_DATA_ERROR:Oc,Z_BUF_ERROR:Mc,Z_DEFAULT_COMPRESSION:Lc,Z_FILTERED:Uc,Z_HUFFMAN_ONLY:bc,Z_RLE:Pc,Z_FIXED:wc,Z_DEFAULT_STRATEGY:xc,Z_UNKNOWN:Dc,Z_DEFLATED:Vc}=_c,Gc=258,kc=262,Fc=42,Bc=113,Hc=666,qc=(e,t)=>(e.msg=hc[t],t),Yc=e=>2*e-(e>4?9:0),Kc=e=>{let t=e.length;for(;--t>=0;)e[t]=0},Qc=e=>{let t,n,r,o=e.w_size;t=e.hash_size,r=t;do{n=e.head[--r],e.head[r]=n>=o?n-o:0}while(--t);t=o,r=t;do{n=e.prev[--r],e.prev[r]=n>=o?n-o:0}while(--t)};let Wc=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask;const jc=e=>{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))},Jc=(e,t)=>{Ec(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,jc(e.strm)},zc=(e,t)=>{e.pending_buf[e.pending++]=t},Zc=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},Xc=(e,t,n,r)=>{let o=e.avail_in;return o>r&&(o=r),0===o?0:(e.avail_in-=o,t.set(e.input.subarray(e.next_in,e.next_in+o),n),1===e.state.wrap?e.adler=lc(e.adler,t,o,n):2===e.state.wrap&&(e.adler=pc(e.adler,t,o,n)),e.next_in+=o,e.total_in+=o,o)},$c=(e,t)=>{let n,r,o=e.max_chain_length,i=e.strstart,s=e.prev_length,a=e.nice_match;const u=e.strstart>e.w_size-kc?e.strstart-(e.w_size-kc):0,c=e.window,l=e.w_mask,d=e.prev,p=e.strstart+Gc;let h=c[i+s-1],_=c[i+s];e.prev_length>=e.good_match&&(o>>=2),a>e.lookahead&&(a=e.lookahead);do{if(n=t,c[n+s]===_&&c[n+s-1]===h&&c[n]===c[i]&&c[++n]===c[i+1]){i+=2,n++;do{}while(c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&i<p);if(r=Gc-(p-i),i=p-Gc,r>s){if(e.match_start=t,s=r,r>=a)break;h=c[i+s-1],_=c[i+s]}}}while((t=d[t&l])>u&&0!=--o);return s<=e.lookahead?s:e.lookahead},el=e=>{const t=e.w_size;let n,r,o;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-kc)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),Qc(e),r+=t),0===e.strm.avail_in)break;if(n=Xc(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=3)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=Wc(e,e.ins_h,e.window[o+1]);e.insert&&(e.ins_h=Wc(e,e.ins_h,e.window[o+3-1]),e.prev[o&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=o,o++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<kc&&0!==e.strm.avail_in)},tl=(e,t)=>{let n,r,o,i=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,s=0,a=e.strm.avail_in;do{if(n=65535,o=e.bi_valid+42>>3,e.strm.avail_out<o)break;if(o=e.strm.avail_out-o,r=e.strstart-e.block_start,n>r+e.strm.avail_in&&(n=r+e.strm.avail_in),n>o&&(n=o),n<i&&(0===n&&t!==yc||t===Cc||n!==r+e.strm.avail_in))break;s=t===yc&&n===r+e.strm.avail_in?1:0,fc(e,0,0,s),e.pending_buf[e.pending-4]=n,e.pending_buf[e.pending-3]=n>>8,e.pending_buf[e.pending-2]=~n,e.pending_buf[e.pending-1]=~n>>8,jc(e.strm),r&&(r>n&&(r=n),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+r),e.strm.next_out),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r,e.block_start+=r,n-=r),n&&(Xc(e.strm,e.strm.output,e.strm.next_out,n),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n)}while(0===s);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),s?4:t!==Cc&&t!==yc&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(o=e.window_size-e.strstart,e.strm.avail_in>o&&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++,o+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),o>e.strm.avail_in&&(o=e.strm.avail_in),o&&(Xc(e.strm,e.window,e.strstart,o),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.high_water<e.strstart&&(e.high_water=e.strstart),o=e.bi_valid+42>>3,o=e.pending_buf_size-o>65535?65535:e.pending_buf_size-o,i=o>e.w_size?e.w_size:o,r=e.strstart-e.block_start,(r>=i||(r||t===yc)&&t!==Cc&&0===e.strm.avail_in&&r<=o)&&(n=r>o?o:r,s=t===yc&&0===e.strm.avail_in&&n===r?1:0,fc(e,e.block_start,n,s),e.block_start+=n,jc(e.strm)),s?3:1)},nl=(e,t)=>{let n,r;for(;;){if(e.lookahead<kc){if(el(e),e.lookahead<kc&&t===Cc)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=Wc(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==n&&e.strstart-n<=e.w_size-kc&&(e.match_length=$c(e,n)),e.match_length>=3)if(r=Ic(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=Wc(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Wc(e,e.ins_h,e.window[e.strstart+1]);else r=Ic(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(Jc(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===yc?(Jc(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Jc(e,!1),0===e.strm.avail_out)?1:2},rl=(e,t)=>{let n,r,o;for(;;){if(e.lookahead<kc){if(el(e),e.lookahead<kc&&t===Cc)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=Wc(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==n&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-kc&&(e.match_length=$c(e,n),e.match_length<=5&&(e.strategy===Uc||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){o=e.strstart+e.lookahead-3,r=Ic(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=o&&(e.ins_h=Wc(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(Jc(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(r=Ic(e,0,e.window[e.strstart-1]),r&&Jc(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=Ic(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===yc?(Jc(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Jc(e,!1),0===e.strm.avail_out)?1:2};function ol(e,t,n,r,o){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=o}const il=[new ol(0,0,0,0,tl),new ol(4,4,8,4,nl),new ol(4,5,16,8,nl),new ol(4,6,32,32,nl),new ol(4,4,16,16,rl),new ol(8,16,32,32,rl),new ol(8,16,128,128,rl),new ol(8,32,128,256,rl),new ol(32,128,258,1024,rl),new ol(32,258,258,4096,rl)];function sl(){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=Vc,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),Kc(this.dyn_ltree),Kc(this.dyn_dtree),Kc(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),Kc(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Kc(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 al=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==Fc&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==Bc&&t.status!==Hc?1:0},ul=e=>{if(al(e))return qc(e,Nc);e.total_in=e.total_out=0,e.data_type=Dc;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?Fc:Bc,e.adler=2===t.wrap?0:1,t.last_flush=-2,gc(t),Sc},cl=e=>{const t=ul(e);var n;return t===Sc&&((n=e.state).window_size=2*n.w_size,Kc(n.head),n.max_lazy_match=il[n.level].max_lazy,n.good_match=il[n.level].good_length,n.nice_match=il[n.level].nice_length,n.max_chain_length=il[n.level].max_chain,n.strstart=0,n.block_start=0,n.lookahead=0,n.insert=0,n.match_length=n.prev_length=2,n.match_available=0,n.ins_h=0),t},ll=(e,t,n,r,o,i)=>{if(!e)return Nc;let s=1;if(t===Lc&&(t=6),r<0?(s=0,r=-r):r>15&&(s=2,r-=16),o<1||o>9||n!==Vc||r<8||r>15||t<0||t>9||i<0||i>wc||8===r&&1!==s)return qc(e,Nc);8===r&&(r=9);const a=new sl;return e.state=a,a.strm=e,a.status=Fc,a.wrap=s,a.gzhead=null,a.w_bits=r,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=o+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<<o+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=i,a.method=n,cl(e)};var dl={deflateInit:(e,t)=>ll(e,t,Vc,15,8,xc),deflateInit2:ll,deflateReset:cl,deflateResetKeep:ul,deflateSetHeader:(e,t)=>al(e)||2!==e.state.wrap?Nc:(e.state.gzhead=t,Sc),deflate:(e,t)=>{if(al(e)||t>mc||t<0)return e?qc(e,Nc):Nc;const n=e.state;if(!e.output||0!==e.avail_in&&!e.input||n.status===Hc&&t!==yc)return qc(e,0===e.avail_out?Mc:Nc);const r=n.last_flush;if(n.last_flush=t,0!==n.pending){if(jc(e),0===e.avail_out)return n.last_flush=-1,Sc}else if(0===e.avail_in&&Yc(t)<=Yc(r)&&t!==yc)return qc(e,Mc);if(n.status===Hc&&0!==e.avail_in)return qc(e,Mc);if(n.status===Fc&&0===n.wrap&&(n.status=Bc),n.status===Fc){let t=Vc+(n.w_bits-8<<4)<<8,r=-1;if(r=n.strategy>=bc||n.level<2?0:n.level<6?1:6===n.level?2:3,t|=r<<6,0!==n.strstart&&(t|=32),t+=31-t%31,Zc(n,t),0!==n.strstart&&(Zc(n,e.adler>>>16),Zc(n,65535&e.adler)),e.adler=1,n.status=Bc,jc(e),0!==n.pending)return n.last_flush=-1,Sc}if(57===n.status)if(e.adler=0,zc(n,31),zc(n,139),zc(n,8),n.gzhead)zc(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),zc(n,255&n.gzhead.time),zc(n,n.gzhead.time>>8&255),zc(n,n.gzhead.time>>16&255),zc(n,n.gzhead.time>>24&255),zc(n,9===n.level?2:n.strategy>=bc||n.level<2?4:0),zc(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(zc(n,255&n.gzhead.extra.length),zc(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=pc(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69;else if(zc(n,0),zc(n,0),zc(n,0),zc(n,0),zc(n,0),zc(n,9===n.level?2:n.strategy>=bc||n.level<2?4:0),zc(n,3),n.status=Bc,jc(e),0!==n.pending)return n.last_flush=-1,Sc;if(69===n.status){if(n.gzhead.extra){let t=n.pending,r=(65535&n.gzhead.extra.length)-n.gzindex;for(;n.pending+r>n.pending_buf_size;){let o=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+o),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>t&&(e.adler=pc(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex+=o,jc(e),0!==n.pending)return n.last_flush=-1,Sc;t=0,r-=o}let o=new Uint8Array(n.gzhead.extra);n.pending_buf.set(o.subarray(n.gzindex,n.gzindex+r),n.pending),n.pending+=r,n.gzhead.hcrc&&n.pending>t&&(e.adler=pc(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=73}if(73===n.status){if(n.gzhead.name){let t,r=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(e.adler=pc(e.adler,n.pending_buf,n.pending-r,r)),jc(e),0!==n.pending)return n.last_flush=-1,Sc;r=0}t=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,zc(n,t)}while(0!==t);n.gzhead.hcrc&&n.pending>r&&(e.adler=pc(e.adler,n.pending_buf,n.pending-r,r)),n.gzindex=0}n.status=91}if(91===n.status){if(n.gzhead.comment){let t,r=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(e.adler=pc(e.adler,n.pending_buf,n.pending-r,r)),jc(e),0!==n.pending)return n.last_flush=-1,Sc;r=0}t=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,zc(n,t)}while(0!==t);n.gzhead.hcrc&&n.pending>r&&(e.adler=pc(e.adler,n.pending_buf,n.pending-r,r))}n.status=103}if(103===n.status){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(jc(e),0!==n.pending))return n.last_flush=-1,Sc;zc(n,255&e.adler),zc(n,e.adler>>8&255),e.adler=0}if(n.status=Bc,jc(e),0!==n.pending)return n.last_flush=-1,Sc}if(0!==e.avail_in||0!==n.lookahead||t!==Cc&&n.status!==Hc){let r=0===n.level?tl(n,t):n.strategy===bc?((e,t)=>{let n;for(;;){if(0===e.lookahead&&(el(e),0===e.lookahead)){if(t===Cc)return 1;break}if(e.match_length=0,n=Ic(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(Jc(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===yc?(Jc(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Jc(e,!1),0===e.strm.avail_out)?1:2})(n,t):n.strategy===Pc?((e,t)=>{let n,r,o,i;const s=e.window;for(;;){if(e.lookahead<=Gc){if(el(e),e.lookahead<=Gc&&t===Cc)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(o=e.strstart-1,r=s[o],r===s[++o]&&r===s[++o]&&r===s[++o])){i=e.strstart+Gc;do{}while(r===s[++o]&&r===s[++o]&&r===s[++o]&&r===s[++o]&&r===s[++o]&&r===s[++o]&&r===s[++o]&&r===s[++o]&&o<i);e.match_length=Gc-(i-o),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=Ic(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=Ic(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(Jc(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===yc?(Jc(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Jc(e,!1),0===e.strm.avail_out)?1:2})(n,t):il[n.level].func(n,t);if(3!==r&&4!==r||(n.status=Hc),1===r||3===r)return 0===e.avail_out&&(n.last_flush=-1),Sc;if(2===r&&(t===vc?Tc(n):t!==mc&&(fc(n,0,0,!1),t===Rc&&(Kc(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),jc(e),0===e.avail_out))return n.last_flush=-1,Sc}return t!==yc?Sc:n.wrap<=0?Ac:(2===n.wrap?(zc(n,255&e.adler),zc(n,e.adler>>8&255),zc(n,e.adler>>16&255),zc(n,e.adler>>24&255),zc(n,255&e.total_in),zc(n,e.total_in>>8&255),zc(n,e.total_in>>16&255),zc(n,e.total_in>>24&255)):(Zc(n,e.adler>>>16),Zc(n,65535&e.adler)),jc(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?Sc:Ac)},deflateEnd:e=>{if(al(e))return Nc;const t=e.state.status;return e.state=null,t===Bc?qc(e,Oc):Sc},deflateSetDictionary:(e,t)=>{let n=t.length;if(al(e))return Nc;const r=e.state,o=r.wrap;if(2===o||1===o&&r.status!==Fc||r.lookahead)return Nc;if(1===o&&(e.adler=lc(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){0===o&&(Kc(r.head),r.strstart=0,r.block_start=0,r.insert=0);let e=new Uint8Array(r.w_size);e.set(t.subarray(n-r.w_size,n),0),t=e,n=r.w_size}const i=e.avail_in,s=e.next_in,a=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,el(r);r.lookahead>=3;){let e=r.strstart,t=r.lookahead-2;do{r.ins_h=Wc(r,r.ins_h,r.window[e+3-1]),r.prev[e&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=e,e++}while(--t);r.strstart=e,r.lookahead=2,el(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=s,e.input=a,e.avail_in=i,r.wrap=o,Sc},deflateInfo:"pako deflate (from Nodeca project)"};const pl=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var hl={assign:function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(const t in n)pl(n,t)&&(e[t]=n[t])}}return e},flattenChunks:e=>{let t=0;for(let n=0,r=e.length;n<r;n++)t+=e[n].length;const n=new Uint8Array(t);for(let t=0,r=0,o=e.length;t<o;t++){let o=e[t];n.set(o,r),r+=o.length}return n}};let _l=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){_l=!1}const gl=new Uint8Array(256);for(let e=0;e<256;e++)gl[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;gl[254]=gl[254]=1;var fl={string2buf:e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,n,r,o,i,s=e.length,a=0;for(o=0;o<s;o++)n=e.charCodeAt(o),55296==(64512&n)&&o+1<s&&(r=e.charCodeAt(o+1),56320==(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),o++)),a+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(a),i=0,o=0;i<a;o++)n=e.charCodeAt(o),55296==(64512&n)&&o+1<s&&(r=e.charCodeAt(o+1),56320==(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),o++)),n<128?t[i++]=n:n<2048?(t[i++]=192|n>>>6,t[i++]=128|63&n):n<65536?(t[i++]=224|n>>>12,t[i++]=128|n>>>6&63,t[i++]=128|63&n):(t[i++]=240|n>>>18,t[i++]=128|n>>>12&63,t[i++]=128|n>>>6&63,t[i++]=128|63&n);return t},buf2string:(e,t)=>{const n=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let r,o;const i=new Array(2*n);for(o=0,r=0;r<n;){let t=e[r++];if(t<128){i[o++]=t;continue}let s=gl[t];if(s>4)i[o++]=65533,r+=s-1;else{for(t&=2===s?31:3===s?15:7;s>1&&r<n;)t=t<<6|63&e[r++],s--;s>1?i[o++]=65533:t<65536?i[o++]=t:(t-=65536,i[o++]=55296|t>>10&1023,i[o++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&_l)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n})(i,o)},utf8border:(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let n=t-1;for(;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+gl[e[n]]>t?n:t}};var El=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 Il=Object.prototype.toString,{Z_NO_FLUSH:Tl,Z_SYNC_FLUSH:Cl,Z_FULL_FLUSH:vl,Z_FINISH:Rl,Z_OK:yl,Z_STREAM_END:ml,Z_DEFAULT_COMPRESSION:Sl,Z_DEFAULT_STRATEGY:Al,Z_DEFLATED:Nl}=_c;function Ol(e){this.options=hl.assign({level:Sl,method:Nl,chunkSize:16384,windowBits:15,memLevel:8,strategy:Al},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 El,this.strm.avail_out=0;let n=dl.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==yl)throw new Error(hc[n]);if(t.header&&dl.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?fl.string2buf(t.dictionary):"[object ArrayBuffer]"===Il.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,n=dl.deflateSetDictionary(this.strm,e),n!==yl)throw new Error(hc[n]);this._dict_set=!0}}Ol.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize;let o,i;if(this.ended)return!1;for(i=t===~~t?t:!0===t?Rl:Tl,"string"==typeof e?n.input=fl.string2buf(e):"[object ArrayBuffer]"===Il.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;)if(0===n.avail_out&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(i===Cl||i===vl)&&n.avail_out<=6)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else{if(o=dl.deflate(n,i),o===ml)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),o=dl.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===yl;if(0!==n.avail_out){if(i>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(0===n.avail_in)break}else this.onData(n.output)}return!0},Ol.prototype.onData=function(e){this.chunks.push(e)},Ol.prototype.onEnd=function(e){e===yl&&(this.result=hl.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const Ml=16209;var Ll=function(e,t){let n,r,o,i,s,a,u,c,l,d,p,h,_,g,f,E,I,T,C,v,R,y,m,S;const A=e.state;n=e.next_in,m=e.input,r=n+(e.avail_in-5),o=e.next_out,S=e.output,i=o-(t-e.avail_out),s=o+(e.avail_out-257),a=A.dmax,u=A.wsize,c=A.whave,l=A.wnext,d=A.window,p=A.hold,h=A.bits,_=A.lencode,g=A.distcode,f=(1<<A.lenbits)-1,E=(1<<A.distbits)-1;e:do{h<15&&(p+=m[n++]<<h,h+=8,p+=m[n++]<<h,h+=8),I=_[p&f];t:for(;;){if(T=I>>>24,p>>>=T,h-=T,T=I>>>16&255,0===T)S[o++]=65535&I;else{if(!(16&T)){if(64&T){if(32&T){A.mode=16191;break e}e.msg="invalid literal/length code",A.mode=Ml;break e}I=_[(65535&I)+(p&(1<<T)-1)];continue t}for(C=65535&I,T&=15,T&&(h<T&&(p+=m[n++]<<h,h+=8),C+=p&(1<<T)-1,p>>>=T,h-=T),h<15&&(p+=m[n++]<<h,h+=8,p+=m[n++]<<h,h+=8),I=g[p&E];;){if(T=I>>>24,p>>>=T,h-=T,T=I>>>16&255,16&T){if(v=65535&I,T&=15,h<T&&(p+=m[n++]<<h,h+=8,h<T&&(p+=m[n++]<<h,h+=8)),v+=p&(1<<T)-1,v>a){e.msg="invalid distance too far back",A.mode=Ml;break e}if(p>>>=T,h-=T,T=o-i,v>T){if(T=v-T,T>c&&A.sane){e.msg="invalid distance too far back",A.mode=Ml;break e}if(R=0,y=d,0===l){if(R+=u-T,T<C){C-=T;do{S[o++]=d[R++]}while(--T);R=o-v,y=S}}else if(l<T){if(R+=u+l-T,T-=l,T<C){C-=T;do{S[o++]=d[R++]}while(--T);if(R=0,l<C){T=l,C-=T;do{S[o++]=d[R++]}while(--T);R=o-v,y=S}}}else if(R+=l-T,T<C){C-=T;do{S[o++]=d[R++]}while(--T);R=o-v,y=S}for(;C>2;)S[o++]=y[R++],S[o++]=y[R++],S[o++]=y[R++],C-=3;C&&(S[o++]=y[R++],C>1&&(S[o++]=y[R++]))}else{R=o-v;do{S[o++]=S[R++],S[o++]=S[R++],S[o++]=S[R++],C-=3}while(C>2);C&&(S[o++]=S[R++],C>1&&(S[o++]=S[R++]))}break}if(64&T){e.msg="invalid distance code",A.mode=Ml;break e}I=g[(65535&I)+(p&(1<<T)-1)]}}break}}while(n<r&&o<s);C=h>>3,n-=C,h-=C<<3,p&=(1<<h)-1,e.next_in=n,e.next_out=o,e.avail_in=n<r?r-n+5:5-(n-r),e.avail_out=o<s?s-o+257:257-(o-s),A.hold=p,A.bits=h};const Ul=15,bl=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]),Pl=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]),wl=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]),xl=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 Dl=(e,t,n,r,o,i,s,a)=>{const u=a.bits;let c,l,d,p,h,_,g=0,f=0,E=0,I=0,T=0,C=0,v=0,R=0,y=0,m=0,S=null;const A=new Uint16Array(16),N=new Uint16Array(16);let O,M,L,U=null;for(g=0;g<=Ul;g++)A[g]=0;for(f=0;f<r;f++)A[t[n+f]]++;for(T=u,I=Ul;I>=1&&0===A[I];I--);if(T>I&&(T=I),0===I)return o[i++]=20971520,o[i++]=20971520,a.bits=1,0;for(E=1;E<I&&0===A[E];E++);for(T<E&&(T=E),R=1,g=1;g<=Ul;g++)if(R<<=1,R-=A[g],R<0)return-1;if(R>0&&(0===e||1!==I))return-1;for(N[1]=0,g=1;g<Ul;g++)N[g+1]=N[g]+A[g];for(f=0;f<r;f++)0!==t[n+f]&&(s[N[t[n+f]]++]=f);if(0===e?(S=U=s,_=20):1===e?(S=bl,U=Pl,_=257):(S=wl,U=xl,_=0),m=0,f=0,g=E,h=i,C=T,v=0,d=-1,y=1<<T,p=y-1,1===e&&y>852||2===e&&y>592)return 1;for(;;){O=g-v,s[f]+1<_?(M=0,L=s[f]):s[f]>=_?(M=U[s[f]-_],L=S[s[f]-_]):(M=96,L=0),c=1<<g-v,l=1<<C,E=l;do{l-=c,o[h+(m>>v)+l]=O<<24|M<<16|L}while(0!==l);for(c=1<<g-1;m&c;)c>>=1;if(0!==c?(m&=c-1,m+=c):m=0,f++,0==--A[g]){if(g===I)break;g=t[n+s[f]]}if(g>T&&(m&p)!==d){for(0===v&&(v=T),h+=E,C=g-v,R=1<<C;C+v<I&&(R-=A[C+v],!(R<=0));)C++,R<<=1;if(y+=1<<C,1===e&&y>852||2===e&&y>592)return 1;d=m&p,o[d]=T<<24|C<<16|h-i}}return 0!==m&&(o[h+m]=g-v<<24|64<<16),a.bits=T,0};const{Z_FINISH:Vl,Z_BLOCK:Gl,Z_TREES:kl,Z_OK:Fl,Z_STREAM_END:Bl,Z_NEED_DICT:Hl,Z_STREAM_ERROR:ql,Z_DATA_ERROR:Yl,Z_MEM_ERROR:Kl,Z_BUF_ERROR:Ql,Z_DEFLATED:Wl}=_c,jl=16180,Jl=16190,zl=16191,Zl=16192,Xl=16194,$l=16199,ed=16200,td=16206,nd=16209,rd=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function od(){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 id=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<jl||t.mode>16211?1:0},sd=e=>{if(id(e))return ql;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=jl,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,Fl},ad=e=>{if(id(e))return ql;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,sd(e)},ud=(e,t)=>{let n;if(id(e))return ql;const r=e.state;return t<0?(n=0,t=-t):(n=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?ql:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,ad(e))},cd=(e,t)=>{if(!e)return ql;const n=new od;e.state=n,n.strm=e,n.window=null,n.mode=jl;const r=ud(e,t);return r!==Fl&&(e.state=null),r};let ld,dd,pd=!0;const hd=e=>{if(pd){ld=new Int32Array(512),dd=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(Dl(1,e.lens,0,288,ld,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Dl(2,e.lens,0,32,dd,0,e.work,{bits:5}),pd=!1}e.lencode=ld,e.lenbits=9,e.distcode=dd,e.distbits=5},_d=(e,t,n,r)=>{let o;const i=e.state;return null===i.window&&(i.wsize=1<<i.wbits,i.wnext=0,i.whave=0,i.window=new Uint8Array(i.wsize)),r>=i.wsize?(i.window.set(t.subarray(n-i.wsize,n),0),i.wnext=0,i.whave=i.wsize):(o=i.wsize-i.wnext,o>r&&(o=r),i.window.set(t.subarray(n-r,n-r+o),i.wnext),(r-=o)?(i.window.set(t.subarray(n-r,n),0),i.wnext=r,i.whave=i.wsize):(i.wnext+=o,i.wnext===i.wsize&&(i.wnext=0),i.whave<i.wsize&&(i.whave+=o))),0};var gd={inflateReset:ad,inflateReset2:ud,inflateResetKeep:sd,inflateInit:e=>cd(e,15),inflateInit2:cd,inflate:(e,t)=>{let n,r,o,i,s,a,u,c,l,d,p,h,_,g,f,E,I,T,C,v,R,y,m=0;const S=new Uint8Array(4);let A,N;const O=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(id(e)||!e.output||!e.input&&0!==e.avail_in)return ql;n=e.state,n.mode===zl&&(n.mode=Zl),s=e.next_out,o=e.output,u=e.avail_out,i=e.next_in,r=e.input,a=e.avail_in,c=n.hold,l=n.bits,d=a,p=u,y=Fl;e:for(;;)switch(n.mode){case jl:if(0===n.wrap){n.mode=Zl;break}for(;l<16;){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}if(2&n.wrap&&35615===c){0===n.wbits&&(n.wbits=15),n.check=0,S[0]=255&c,S[1]=c>>>8&255,n.check=pc(n.check,S,2,0),c=0,l=0,n.mode=16181;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&c)<<8)+(c>>8))%31){e.msg="incorrect header check",n.mode=nd;break}if((15&c)!==Wl){e.msg="unknown compression method",n.mode=nd;break}if(c>>>=4,l-=4,R=8+(15&c),0===n.wbits&&(n.wbits=R),R>15||R>n.wbits){e.msg="invalid window size",n.mode=nd;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=512&c?16189:zl,c=0,l=0;break;case 16181:for(;l<16;){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}if(n.flags=c,(255&n.flags)!==Wl){e.msg="unknown compression method",n.mode=nd;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=nd;break}n.head&&(n.head.text=c>>8&1),512&n.flags&&4&n.wrap&&(S[0]=255&c,S[1]=c>>>8&255,n.check=pc(n.check,S,2,0)),c=0,l=0,n.mode=16182;case 16182:for(;l<32;){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}n.head&&(n.head.time=c),512&n.flags&&4&n.wrap&&(S[0]=255&c,S[1]=c>>>8&255,S[2]=c>>>16&255,S[3]=c>>>24&255,n.check=pc(n.check,S,4,0)),c=0,l=0,n.mode=16183;case 16183:for(;l<16;){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}n.head&&(n.head.xflags=255&c,n.head.os=c>>8),512&n.flags&&4&n.wrap&&(S[0]=255&c,S[1]=c>>>8&255,n.check=pc(n.check,S,2,0)),c=0,l=0,n.mode=16184;case 16184:if(1024&n.flags){for(;l<16;){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}n.length=c,n.head&&(n.head.extra_len=c),512&n.flags&&4&n.wrap&&(S[0]=255&c,S[1]=c>>>8&255,n.check=pc(n.check,S,2,0)),c=0,l=0}else n.head&&(n.head.extra=null);n.mode=16185;case 16185:if(1024&n.flags&&(h=n.length,h>a&&(h=a),h&&(n.head&&(R=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(i,i+h),R)),512&n.flags&&4&n.wrap&&(n.check=pc(n.check,r,h,i)),a-=h,i+=h,n.length-=h),n.length))break e;n.length=0,n.mode=16186;case 16186:if(2048&n.flags){if(0===a)break e;h=0;do{R=r[i+h++],n.head&&R&&n.length<65536&&(n.head.name+=String.fromCharCode(R))}while(R&&h<a);if(512&n.flags&&4&n.wrap&&(n.check=pc(n.check,r,h,i)),a-=h,i+=h,R)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=16187;case 16187:if(4096&n.flags){if(0===a)break e;h=0;do{R=r[i+h++],n.head&&R&&n.length<65536&&(n.head.comment+=String.fromCharCode(R))}while(R&&h<a);if(512&n.flags&&4&n.wrap&&(n.check=pc(n.check,r,h,i)),a-=h,i+=h,R)break e}else n.head&&(n.head.comment=null);n.mode=16188;case 16188:if(512&n.flags){for(;l<16;){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}if(4&n.wrap&&c!==(65535&n.check)){e.msg="header crc mismatch",n.mode=nd;break}c=0,l=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=zl;break;case 16189:for(;l<32;){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}e.adler=n.check=rd(c),c=0,l=0,n.mode=Jl;case Jl:if(0===n.havedict)return e.next_out=s,e.avail_out=u,e.next_in=i,e.avail_in=a,n.hold=c,n.bits=l,Hl;e.adler=n.check=1,n.mode=zl;case zl:if(t===Gl||t===kl)break e;case Zl:if(n.last){c>>>=7&l,l-=7&l,n.mode=td;break}for(;l<3;){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}switch(n.last=1&c,c>>>=1,l-=1,3&c){case 0:n.mode=16193;break;case 1:if(hd(n),n.mode=$l,t===kl){c>>>=2,l-=2;break e}break;case 2:n.mode=16196;break;case 3:e.msg="invalid block type",n.mode=nd}c>>>=2,l-=2;break;case 16193:for(c>>>=7&l,l-=7&l;l<32;){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}if((65535&c)!=(c>>>16^65535)){e.msg="invalid stored block lengths",n.mode=nd;break}if(n.length=65535&c,c=0,l=0,n.mode=Xl,t===kl)break e;case Xl:n.mode=16195;case 16195:if(h=n.length,h){if(h>a&&(h=a),h>u&&(h=u),0===h)break e;o.set(r.subarray(i,i+h),s),a-=h,i+=h,u-=h,s+=h,n.length-=h;break}n.mode=zl;break;case 16196:for(;l<14;){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}if(n.nlen=257+(31&c),c>>>=5,l-=5,n.ndist=1+(31&c),c>>>=5,l-=5,n.ncode=4+(15&c),c>>>=4,l-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=nd;break}n.have=0,n.mode=16197;case 16197:for(;n.have<n.ncode;){for(;l<3;){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}n.lens[O[n.have++]]=7&c,c>>>=3,l-=3}for(;n.have<19;)n.lens[O[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,A={bits:n.lenbits},y=Dl(0,n.lens,0,19,n.lencode,0,n.work,A),n.lenbits=A.bits,y){e.msg="invalid code lengths set",n.mode=nd;break}n.have=0,n.mode=16198;case 16198:for(;n.have<n.nlen+n.ndist;){for(;m=n.lencode[c&(1<<n.lenbits)-1],f=m>>>24,E=m>>>16&255,I=65535&m,!(f<=l);){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}if(I<16)c>>>=f,l-=f,n.lens[n.have++]=I;else{if(16===I){for(N=f+2;l<N;){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}if(c>>>=f,l-=f,0===n.have){e.msg="invalid bit length repeat",n.mode=nd;break}R=n.lens[n.have-1],h=3+(3&c),c>>>=2,l-=2}else if(17===I){for(N=f+3;l<N;){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}c>>>=f,l-=f,R=0,h=3+(7&c),c>>>=3,l-=3}else{for(N=f+7;l<N;){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}c>>>=f,l-=f,R=0,h=11+(127&c),c>>>=7,l-=7}if(n.have+h>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=nd;break}for(;h--;)n.lens[n.have++]=R}}if(n.mode===nd)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=nd;break}if(n.lenbits=9,A={bits:n.lenbits},y=Dl(1,n.lens,0,n.nlen,n.lencode,0,n.work,A),n.lenbits=A.bits,y){e.msg="invalid literal/lengths set",n.mode=nd;break}if(n.distbits=6,n.distcode=n.distdyn,A={bits:n.distbits},y=Dl(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,A),n.distbits=A.bits,y){e.msg="invalid distances set",n.mode=nd;break}if(n.mode=$l,t===kl)break e;case $l:n.mode=ed;case ed:if(a>=6&&u>=258){e.next_out=s,e.avail_out=u,e.next_in=i,e.avail_in=a,n.hold=c,n.bits=l,Ll(e,p),s=e.next_out,o=e.output,u=e.avail_out,i=e.next_in,r=e.input,a=e.avail_in,c=n.hold,l=n.bits,n.mode===zl&&(n.back=-1);break}for(n.back=0;m=n.lencode[c&(1<<n.lenbits)-1],f=m>>>24,E=m>>>16&255,I=65535&m,!(f<=l);){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}if(E&&!(240&E)){for(T=f,C=E,v=I;m=n.lencode[v+((c&(1<<T+C)-1)>>T)],f=m>>>24,E=m>>>16&255,I=65535&m,!(T+f<=l);){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}c>>>=T,l-=T,n.back+=T}if(c>>>=f,l-=f,n.back+=f,n.length=I,0===E){n.mode=16205;break}if(32&E){n.back=-1,n.mode=zl;break}if(64&E){e.msg="invalid literal/length code",n.mode=nd;break}n.extra=15&E,n.mode=16201;case 16201:if(n.extra){for(N=n.extra;l<N;){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}n.length+=c&(1<<n.extra)-1,c>>>=n.extra,l-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=16202;case 16202:for(;m=n.distcode[c&(1<<n.distbits)-1],f=m>>>24,E=m>>>16&255,I=65535&m,!(f<=l);){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}if(!(240&E)){for(T=f,C=E,v=I;m=n.distcode[v+((c&(1<<T+C)-1)>>T)],f=m>>>24,E=m>>>16&255,I=65535&m,!(T+f<=l);){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}c>>>=T,l-=T,n.back+=T}if(c>>>=f,l-=f,n.back+=f,64&E){e.msg="invalid distance code",n.mode=nd;break}n.offset=I,n.extra=15&E,n.mode=16203;case 16203:if(n.extra){for(N=n.extra;l<N;){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}n.offset+=c&(1<<n.extra)-1,c>>>=n.extra,l-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=nd;break}n.mode=16204;case 16204:if(0===u)break e;if(h=p-u,n.offset>h){if(h=n.offset-h,h>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=nd;break}h>n.wnext?(h-=n.wnext,_=n.wsize-h):_=n.wnext-h,h>n.length&&(h=n.length),g=n.window}else g=o,_=s-n.offset,h=n.length;h>u&&(h=u),u-=h,n.length-=h;do{o[s++]=g[_++]}while(--h);0===n.length&&(n.mode=ed);break;case 16205:if(0===u)break e;o[s++]=n.length,u--,n.mode=ed;break;case td:if(n.wrap){for(;l<32;){if(0===a)break e;a--,c|=r[i++]<<l,l+=8}if(p-=u,e.total_out+=p,n.total+=p,4&n.wrap&&p&&(e.adler=n.check=n.flags?pc(n.check,o,p,s-p):lc(n.check,o,p,s-p)),p=u,4&n.wrap&&(n.flags?c:rd(c))!==n.check){e.msg="incorrect data check",n.mode=nd;break}c=0,l=0}n.mode=16207;case 16207:if(n.wrap&&n.flags){for(;l<32;){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}if(4&n.wrap&&c!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=nd;break}c=0,l=0}n.mode=16208;case 16208:y=Bl;break e;case nd:y=Yl;break e;case 16210:return Kl;default:return ql}return e.next_out=s,e.avail_out=u,e.next_in=i,e.avail_in=a,n.hold=c,n.bits=l,(n.wsize||p!==e.avail_out&&n.mode<nd&&(n.mode<td||t!==Vl))&&_d(e,e.output,e.next_out,p-e.avail_out),d-=e.avail_in,p-=e.avail_out,e.total_in+=d,e.total_out+=p,n.total+=p,4&n.wrap&&p&&(e.adler=n.check=n.flags?pc(n.check,o,p,e.next_out-p):lc(n.check,o,p,e.next_out-p)),e.data_type=n.bits+(n.last?64:0)+(n.mode===zl?128:0)+(n.mode===$l||n.mode===Xl?256:0),(0===d&&0===p||t===Vl)&&y===Fl&&(y=Ql),y},inflateEnd:e=>{if(id(e))return ql;let t=e.state;return t.window&&(t.window=null),e.state=null,Fl},inflateGetHeader:(e,t)=>{if(id(e))return ql;const n=e.state;return 2&n.wrap?(n.head=t,t.done=!1,Fl):ql},inflateSetDictionary:(e,t)=>{const n=t.length;let r,o,i;return id(e)?ql:(r=e.state,0!==r.wrap&&r.mode!==Jl?ql:r.mode===Jl&&(o=1,o=lc(o,t,n,0),o!==r.check)?Yl:(i=_d(e,t,n,n),i?(r.mode=16210,Kl):(r.havedict=1,Fl)))},inflateInfo:"pako inflate (from Nodeca project)"};var fd=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 Ed=Object.prototype.toString,{Z_NO_FLUSH:Id,Z_FINISH:Td,Z_OK:Cd,Z_STREAM_END:vd,Z_NEED_DICT:Rd,Z_STREAM_ERROR:yd,Z_DATA_ERROR:md,Z_MEM_ERROR:Sd}=_c;function Ad(e){this.options=hl.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 El,this.strm.avail_out=0;let n=gd.inflateInit2(this.strm,t.windowBits);if(n!==Cd)throw new Error(hc[n]);if(this.header=new fd,gd.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=fl.string2buf(t.dictionary):"[object ArrayBuffer]"===Ed.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=gd.inflateSetDictionary(this.strm,t.dictionary),n!==Cd)))throw new Error(hc[n])}function Nd(e,t){const n=new Ad(t);if(n.push(e),n.err)throw n.msg||hc[n.err];return n.result}Ad.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize,o=this.options.dictionary;let i,s,a;if(this.ended)return!1;for(s=t===~~t?t:!0===t?Td:Id,"[object ArrayBuffer]"===Ed.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(0===n.avail_out&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),i=gd.inflate(n,s),i===Rd&&o&&(i=gd.inflateSetDictionary(n,o),i===Cd?i=gd.inflate(n,s):i===md&&(i=Rd));n.avail_in>0&&i===vd&&n.state.wrap>0&&0!==e[n.next_in];)gd.inflateReset(n),i=gd.inflate(n,s);switch(i){case yd:case md:case Rd:case Sd:return this.onEnd(i),this.ended=!0,!1}if(a=n.avail_out,n.next_out&&(0===n.avail_out||i===vd))if("string"===this.options.to){let e=fl.utf8border(n.output,n.next_out),t=n.next_out-e,o=fl.buf2string(n.output,e);n.next_out=t,n.avail_out=r-t,t&&n.output.set(n.output.subarray(e,e+t),0),this.onData(o)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(i!==Cd||0!==a){if(i===vd)return i=gd.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,!0;if(0===n.avail_in)break}}return!0},Ad.prototype.onData=function(e){this.chunks.push(e)},Ad.prototype.onEnd=function(e){e===Cd&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=hl.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Od={Inflate:Ad,inflate:Nd,inflateRaw:function(e,t){return(t=t||{}).raw=!0,Nd(e,t)},ungzip:Nd,constants:_c};const{Inflate:Md,inflate:Ld,inflateRaw:Ud,ungzip:bd}=Od;var Pd,wd,xd,Dd,Vd=bd;!function(e){e[e.ACCEPTED=0]="ACCEPTED",e[e.UNACCEPTABLE_PROTOCOL_VERSION=1]="UNACCEPTABLE_PROTOCOL_VERSION",e[e.IDENTIFIER_REJECTED=2]="IDENTIFIER_REJECTED",e[e.SERVER_UNAVAILABLE=3]="SERVER_UNAVAILABLE",e[e.TOKEN_INCORRECT=4]="TOKEN_INCORRECT",e[e.NOT_AUTHORIZED=5]="NOT_AUTHORIZED",e[e.REDIRECT=6]="REDIRECT",e[e.PACKAGE_ERROR=7]="PACKAGE_ERROR",e[e.APP_BLOCK_OR_DELETE=8]="APP_BLOCK_OR_DELETE",e[e.BLOCK=9]="BLOCK",e[e.TOKEN_EXPIRE=10]="TOKEN_EXPIRE",e[e.DEVICE_ERROR=11]="DEVICE_ERROR",e[e.HOSTNAME_ERROR=12]="HOSTNAME_ERROR",e[e.HASOHTERSAMECLIENTONLINE=13]="HASOHTERSAMECLIENTONLINE",e[e.OUT_OF_LIMIT=14]="OUT_OF_LIMIT",e[e.IN_OTHER_CLUSTER=15]="IN_OTHER_CLUSTER",e[e.APP_AUTH_NOT_PASS=16]="APP_AUTH_NOT_PASS",e[e.OTP_USED=17]="OTP_USED",e[e.PLATFORM_ERROR=18]="PLATFORM_ERROR",e[e.ACCOUNT_CANCELLATION=19]="ACCOUNT_CANCELLATION",e[e.LICENSE_EXPIRED=20]="LICENSE_EXPIRED"}(Pd||(Pd={})),function(e){e[e.OTHER_DEVICE_LOGIN=1]="OTHER_DEVICE_LOGIN",e[e.BLOCK=2]="BLOCK",e[e.BLOCK_NEW=5]="BLOCK_NEW",e[e.REDIRECT_NEW=6]="REDIRECT_NEW",e[e.TOKEN_EXPIRED=7]="TOKEN_EXPIRED",e[e.ILLEGAL_PROTOCOL_VERSION=8]="ILLEGAL_PROTOCOL_VERSION",e[e.ACCOUNT_CANCELLATION=9]="ACCOUNT_CANCELLATION"}(wd||(wd={}));var Gd,kd,Fd=((xd={})[wd.OTHER_DEVICE_LOGIN]=exports.ErrorCode.RC_DISCONN_KICK,xd[wd.BLOCK]=exports.ErrorCode.RC_DISCONN_EXCEPTION,xd[wd.BLOCK_NEW]=exports.ErrorCode.RC_DISCONN_EXCEPTION,xd[wd.REDIRECT_NEW]=exports.ErrorCode.RC_CONN_REDIRECTED,xd[wd.TOKEN_EXPIRED]=exports.ErrorCode.RC_CONN_TOKEN_EXPIRED,xd[wd.ILLEGAL_PROTOCOL_VERSION]=exports.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,xd[wd.ACCOUNT_CANCELLATION]=exports.ErrorCode.RC_ACCOUNT_CANCELLATION,xd),Bd=((Dd={})[Pd.ACCEPTED]=exports.ErrorCode.SUCCESS,Dd[Pd.UNACCEPTABLE_PROTOCOL_VERSION]=exports.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,Dd[Pd.IDENTIFIER_REJECTED]=exports.ErrorCode.RC_CONN_IDENTIFIER_REJECTED,Dd[Pd.SERVER_UNAVAILABLE]=exports.ErrorCode.RC_CONN_SERVER_UNAVAILABLE,Dd[Pd.TOKEN_INCORRECT]=exports.ErrorCode.RC_CONN_TOKEN_INCORRECT,Dd[Pd.NOT_AUTHORIZED]=exports.ErrorCode.RC_CONN_NOT_AUTHRORIZED,Dd[Pd.REDIRECT]=exports.ErrorCode.RC_CONN_REDIRECTED,Dd[Pd.PACKAGE_ERROR]=exports.ErrorCode.RC_CONN_PACKAGE_NAME_INVALID,Dd[Pd.APP_BLOCK_OR_DELETE]=exports.ErrorCode.RC_CONN_APP_BLOCKED_OR_DELETED,Dd[Pd.BLOCK]=exports.ErrorCode.RC_CONN_USER_BLOCKED,Dd[Pd.TOKEN_EXPIRE]=exports.ErrorCode.RC_CONN_TOKEN_EXPIRED,Dd[Pd.DEVICE_ERROR]=exports.ErrorCode.RC_CONN_DEVICE_ERROR,Dd[Pd.HOSTNAME_ERROR]=exports.ErrorCode.RC_CONN_HOSTNAME_ERROR,Dd[Pd.HASOHTERSAMECLIENTONLINE]=exports.ErrorCode.RC_DISCONN_SAME_CLIENT_ON_LINE,Dd[Pd.OUT_OF_LIMIT]=exports.ErrorCode.RC_LISCENSE_COUNT_OUT_OF_LIMIT,Dd[Pd.IN_OTHER_CLUSTER]=exports.ErrorCode.RC_CONN_WRONG_CLUSTER,Dd[Pd.APP_AUTH_NOT_PASS]=exports.ErrorCode.RC_APP_AUTH_NOT_PASS,Dd[Pd.OTP_USED]=exports.ErrorCode.RC_OTP_USED,Dd[Pd.PLATFORM_ERROR]=exports.ErrorCode.RC_PLATFORM_ERROR,Dd[Pd.ACCOUNT_CANCELLATION]=exports.ErrorCode.RC_ACCOUNT_CANCELLATION,Dd[Pd.LICENSE_EXPIRED]=exports.ErrorCode.RC_LICENSE_EXPIRED,Dd),Hd=function(e){return[as.ppMsgS,as.pgMsgS,as.chatMsgS].includes(gs(e))},qd=function(e,t){var n=0;return e.isAutoDelete&&(n|=1),e.isOverwrite&&(n|=2),2===t&&(n|=4),n};function Yd(e){return Object.keys(e).map((function(t){var n=e[t];return"string"!=typeof n&&(n="".concat(n)),{key:t,value:n}}))}function Kd(e,t,n,r){return Xi.encode(Ii,{targetId:e,type:exports.ConversationType.GROUP,users:r,extProfile:n?Yd(n):void 0,settingProfile:Yd(t)})}var Qd,Wd=((Gd={})[fs(as.ppMsgP)]=exports.ConversationType.PRIVATE,Gd[fs(as.pgMsgP)]=exports.ConversationType.GROUP,Gd[fs(as.chatMsg)]=exports.ConversationType.CHATROOM,Gd[fs(as.pcMsgP)]=exports.ConversationType.CUSTOMER_SERVICE,Gd[fs(as.pbMsgP)]=exports.ConversationType.SYSTEM,Gd),Jd=3,zd={1:"ChannelsUserInfos",2:"ChannelsInviteStatusInfos",3:"ChannelsJoinedInfos",11:"FriendUserInfos",12:"FriendInviteInfos"},Zd=((kd={})[m.GROUP_OPERATION]=function(e){return"ChannelEventData"},kd[m.GROUP_PROFILE_CHANGE]=function(e){return"ChannelEventData"},kd[m.GROUP_APPLICATION_INVITATION]=function(e){return"ChannelApplyInfo"},kd[l.FRIEND_APPLICATION]=function(e){return{0:"FriendApplyEvent",1:"FriendApplyEvent",2:"FriendUserInfo",3:"FriendsInput",5:"FriendTypeChangeEvent",6:"FriendUpdateEvent"}[e]},kd),Xd=function(){function e(e){this.logger=e}return e.prototype.decodeByPBName=function(e,t,n){var r,o=this,i=e,s=((r={})[Ur]=o._formatSyncMessages,r[br]=o._formatReceivedMessage,r[Mr]=o._formatSentMessage,r[zr]=o._formatHistoryMessages,r[Hr]=o._formatConversationList,r[jr]=o._formatChatRoomInfos,r[co]=o._formatChatRoomKVList,r[go]=o._formatUserSetting,r[Oo]=o._formatGrpReadReceiptQryResp,r[Xo]=o._formatQueryReceiptResp,r[ho]=o._formatSetUserSettingOutput,r[Po]=o._formatUserSettingNotification,r[ko]=o._formatEventChangeList,r[Fo]=o._formatUltraMsgChangeList,r[Yo]=o._formatUltraOperateStatusNotifyList,r[Ho]=o._formatUltraMsgList,r[Yr]=o._formatUltraGroupUnreadMentionedList,r[Gr]=o._formatChrmKVVersion,r[Jo]=o._formatCallKVInfo,r[Wo]=o._fromatCallInfoDownStream,r[$r]=o._formateSessionMsgReadInput,r[Si]=o._formateChannelsListResult,r)[t];try{i=e.length>0&&Xi.decode(t,e),ft(s)&&(i=s.call(this,i,n))}catch(e){this.logger.error(exports.LogTagId.L_PB_DECODE_E,t)}return i},e.prototype._readBytes=function(e){var t,n=e.offset,r=e.buffer,o=e.limit;if(n)try{var i=(t=r,"[object ArrayBuffer]"===Object.prototype.toString.call(t)?new Uint8Array(r):r);return zs.readUTF(i.subarray(n,o))}catch(e){this.logger.error(exports.LogTagId.O,null==e?void 0:e.stack)}return e},e.prototype._formatBytes=function(e){if(!e)return e;var t=this._readBytes(e);try{t=t?JSON.parse(t):t}catch(e){this.logger.error(exports.LogTagId.O,null==e?void 0:e.stack)}return t||e},e.prototype._formatSyncMessages=function(e,t){t=t||{};var n=this,r=e.list;e.syncTime;var o=e.finished,i=e.compressioEnabled,s=e.compressedData;if(i){var a=Vd(s),u=Xi.decode(Ur,a);return this._formatSyncMessages(u,t)}return(Et(o)||null===o)&&(e.finished=!0),e.list=At(r,(function(e){return n._formatReceivedMessage(e,t)})),e},e.prototype._getUtfContent=function(e){if(e.user){var t=e.user,n=t.portrait,r=t.portraitUri,o=n||r;o&&(e.user.portrait=e.user.portraitUri=o)}return e},e.prototype._setExpansion=function(e){var t;return e&&(t=function(e){var t={},n=JSON.parse(e);return St(n,(function(e,n){t[n]=e.v})),t}(e)),t},e.prototype._setPushConfig=function(e,t){var n=e.pushContent,r=e.pushExt,o=e.configFlag,i={};return r&&(i=function(e,t,n){var r={},o={notificationId:n||""},i={};if(!t)return{iOSConfig:r,androidConfig:o,harmonyOSConfig:i};try{var s=JSON.parse(t);null==s||s.forEach((function(e){var t,n,s,a,u,c,l,d,p,h,_,g,f=Object.keys(e);if(0!==f.length){var E=f[0];switch(E){case"HW":return o.channelIdHW=null===(t=e[E])||void 0===t?void 0:t.channelId,o.importanceHW=null===(n=e[E])||void 0===n?void 0:n.importance,o.imageUrlHW=null===(s=e[E])||void 0===s?void 0:s.image,void(o.categoryHW=null===(a=e[E])||void 0===a?void 0:a.category);case"MI":return void(o.channelIdMi=null===(u=e[E])||void 0===u?void 0:u.channelId);case"OPPO":return void(o.channelIdOPPO=null===(c=e[E])||void 0===c?void 0:c.channelId);case"VIVO":return o.typeVivo=null===(l=e[E])||void 0===l?void 0:l.classification,void(o.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(o.googleConfig={collapseKey:e[E].collapse_key||"",imageUrl:e[E].imageUrl||"",priority:e[E].priority||""});case"HONOR":return o.importanceHonor=null===(p=e[E])||void 0===p?void 0:p.importance,void(o.imageUrlHonor=null===(h=e[E])||void 0===h?void 0:h.image);case"OHOS":i.category=null===(_=e[E])||void 0===_?void 0:_.category,i.image=null===(g=e[E])||void 0===g?void 0:g.image}}}))}catch(n){e.error(exports.LogTagId.O,"Wrong format for pushConfigs field! content: ".concat(t))}return{iOSConfig:r,androidConfig:o,harmonyOSConfig:i}}(t,r.pushConfigs,r.pushId)),se(se({},i),{pushTitle:null==r?void 0:r.title,pushContent:n,pushData:"",disablePushTitle:!!o&&Boolean(4&o),forceShowDetailContent:!!o&&Boolean(8&o),templateId:null==r?void 0:r.templateId})},e.prototype._formatReceivedMessage=function(e,t){var n;if(!e)return e;var r=this,o=t||{},i=o.currentUserId,s=o.connectedTime,a=o.afterDecode,u=o.customMessageTypes,c=void 0===u?{}:u,l=e.content,d=e.fromUserId,p=e.type,h=e.groupId,_=e.status,g=e.dataTime,f=e.extraContent,E=e.extStatus,I=e.clientUniqueId,T=e.busChannel,C=e.msgId,v=e.classname,R=e.toUserIds,y=e.optionBits,m=e.direction||exports.MessageDirection.RECEIVE,S=function(e){var t=exports.ReceivedStatus.READ;return{isPersited:!!(16&e),isCounted:!!(32&e),isMentioned:!!(64&e),disableNotification:!!(512&e),receivedStatus:t=2&e?exports.ReceivedStatus.RETRIEVED:t,canIncludeExpansion:!!(1024&e)}}(_),A=S.isPersited,N=S.isCounted,O=S.isMentioned,M=S.disableNotification,L=S.receivedStatus,U=S.canIncludeExpansion,b=!!(2&(E||0)),P=!!(4&(E||0)),w=!!(8&(E||0))?exports.UltraGroupChannelType.PRIVATE:exports.UltraGroupChannelType.PUBLIC,x=[exports.ConversationType.GROUP,exports.ConversationType.CHATROOM,exports.ConversationType.RTC_ROOM,exports.ConversationType.ULTRA_GROUP].indexOf(p)>-1?h:d,D=d,V=exports.MessageDirection.RECEIVE;m===exports.MessageDirection.SEND&&(D=i,V=exports.MessageDirection.SEND);var G=mt(g),k=G<s,F=p===exports.ConversationType.CHATROOM,B=r._setExpansion(f),H=r._formatBytes(l);H=r._getUtfContent(H);var q=r._setPushConfig(e,this.logger);F&&d===i&&(V=exports.MessageDirection.SEND);var Y={conversationType:p,targetId:x,senderUserId:D,messageType:v,messageUId:C,isPersited:A,isCounted:N,isMentioned:O,sentTime:G,messageDirection:V,receivedTime:Date.now(),disableNotification:M,receivedStatus:L,receivedStatusInfo:Ut(L),canIncludeExpansion:U,content:H,expansion:B,pushConfig:q,channelId:T||"",isInterrupt:b,isModifyMessage:P,messageId:mt(I)||0,sentStatus:exports.SentStatus.SENT,isOffLineMessage:k,channelType:w,isStatusMessage:(null===(n=c[v])||void 0===n?void 0:n.isStatusMessage)||!1,readReceiptInfo:void 0,directedUserIds:R,disableUpdateLastMessage:!!(1&(y||0))};return(null==a?void 0:a(Y))||Y},e.prototype._formatSentMessage=function(e,t){var n=this,r=e.content,o=e.classname,i=e.sessionId,s=e.msgId,a=e.extraContent,u=e.pushExt,c=e.pushContent,l=e.configFlag,d=e.extStatus,p=e.clientUniqueId,h=e.systemId,_=e.toUserIds,g=e.optionBits,f=t.signal,E=t.currentUserId,I=f.date,T=f.topic,C=f.targetId,v=!!(2&(d||0)),R=function(e){return{isPersited:!!(1&e),isCounted:!!(2&e),disableNotification:!!(32&e),canIncludeExpansion:!!(64&e),isMentioned:!!(4&e)}}(i),y=R.isPersited,m=R.isCounted,S=R.disableNotification,A=R.canIncludeExpansion,N=R.isMentioned,O=Wd[T]||exports.ConversationType.PRIVATE,M=Hd(T),L=n._formatBytes(r),U=h||C;o===exports.MessageType.RECALL&&(O=L.conversationType||O,U=L.targetId||C);var b=n._setExpansion(a),P=n._setPushConfig(e,this.logger),w=se(se({},P),{pushTitle:null==u?void 0:u.title,pushContent:c,pushData:c,disablePushTitle:!!l&&Boolean(4&l),forceShowDetailContent:!!l&&Boolean(8&l),templateId:null==u?void 0:u.templateId});return{conversationType:O,targetId:U,messageType:o,messageUId:s,isPersited:y,isCounted:m,isStatusMessage:M,senderUserId:E,content:n._formatBytes(r),sentTime:1e3*I,receivedTime:Date.now(),messageDirection:exports.MessageDirection.SEND,isOffLineMessage:!1,disableNotification:S,canIncludeExpansion:A,expansion:b,pushConfig:w,channelId:e.busChannel||"",isInterrupt:v,messageId:mt(p)||0,receivedStatus:exports.ReceivedStatus.UNREAD,receivedStatusInfo:Ut(exports.ReceivedStatus.UNREAD),isMentioned:N,directedUserIds:_,disableUpdateLastMessage:!!(1&(g||0))}},e.prototype._formatHistoryMessages=function(e,t){var n=this,r=e.list,o=e.hasMsg,i=e.compressedData;if(e.compressioEnabled){var s=Vd(i),a=Xi.decode(zr,s);return this._formatHistoryMessages(a,t)}var u=t.conversation||{},c=u.targetId,l=mt(e.syncTime),d=[];return St(r,(function(e){var r=n._formatReceivedMessage(e,t);u.conversationType===exports.ConversationType.ULTRA_GROUP?r.targetId=e.groupId||u.targetId:r.targetId=c,d.push(r)}),{isReverse:!0}),{syncTime:l,list:d,hasMore:!!o}},e.prototype._formatUltraMsgChangeList=function(e){var t=e.list,n=e.syncTime,r=e.hasNext;return{syncTime:n,list:t&&t.map((function(e){var t=e.targetId,n=e.type,r=e.time,o=e.changeType,i=e.msgUID,s=e.msgTime,a=e.busChannel,u=e.isAdmin,c=e.isDel,l=e.operatorId,d=e.subChangeType,p=e.userGroupIds,h=e.busChannelType,_=e.remindType;return{targetId:t,conversationType:n,changeType:o,messageUId:i,changeTime:mt(r),sendTime:mt(s),channelId:a||"",isAdmin:u,isDel:c,operatorId:l,subChangeType:d,userGroupIds:p,busChannelType:h,mentionedType:_}})),hasNext:r}},e.prototype._formatEventChangeList=function(e){var t=this,n=e.list,r=e.syncTime,o=e.hasNext;return{syncTime:r,list:n&&n.map((function(e){var n,r=e.businessId,o=e.type,i=e.time,s=e.changeType,a=e.originalId,u=e.originalTime,c=e.secondaryId,l=e.isAdmin,d=e.additionalMark,p=e.operatorId,h=e.subChangeType,_=e.secondaryType,g=e.remindType,f=e.isRemindMe,E=e.extIds,I=e.eventData;return I&&(n=t._formatEventData(I,s,h)),{businessId:r,conversationType:o,changeType:s,originalId:a,time:mt(i),originalTime:mt(u),secondaryId:c||"",isAdmin:l,additionalMark:d,operatorId:p,subChangeType:h,userGroupIds:E,secondaryType:_,remindType:g,isRemindMe:f,eventData:n}})),hasNext:o}},e.prototype._formatEventData=function(e,t,n){var r={};return e&&Zd[t]&&Zd[t](n)&&(r=Xi.decode(Zd[t](n),e)||{}),r},e.prototype._formatUltraOperateStatusNotifyList=function(e){var t=e.type,n=e.notifyType,r=e.info,o=e.summary,i=[],s=[],a=!(2&~n),u=!(1&~n);return u&&Array.isArray(r)&&r.forEach((function(e){var t=e.targetId,n=e.busChannel,r=e.userId,o=e.opType,s=e.optime,a=mt(s);i.push({targetId:t,channelId:n,userId:r,operationType:o,operationTime:a})})),a&&Array.isArray(o)&&o.forEach((function(e){var t=e.targetId,n=e.busChannel,r=e.count,o=e.opType;s.push({targetId:t,channelId:n,count:r,operationType:o})})),{conversationType:t,info:i,summary:s,hasInfo:u,hasSummary:a}},e.prototype._formatUltraMsgList=function(e,t){var n=this,r=e.list;return{list:r&&r.map((function(e){return n._formatReceivedMessage(e,t)}))}},e.prototype._formatUltraGroupUnreadMentionedList=function(e){var t=e.msgInfo;return(void 0===t?[]:t).map((function(e){return{messageUId:e.msgId,sentTime:mt(e.msgTime),mentionedType:e.remindType,messageType:e.className||""}}))},e.prototype._getUltraGroupConversationInfo=function(e,t){var n=t.versionTime,r=t.unreadCount,o=t.remindCount,i=t.busChannelType,s=t.msgInfo,a=t.remindMeCount;return e.versionTime=mt(n)||0,e.unreadMessageCount=this._getUnreadCount(mt(r)||0),e.unreadMentionedCount=this._getUnreadCount(mt(o)||0),e.unreadMentionedMeCount=this._getUnreadCount(mt(a)||0),e.channelType=i||exports.UltraGroupChannelType.PUBLIC,e.lastReadTime=0,s&&(e.firstUnreadMessage={sentTime:mt(s.msgTime)},e.lastReadTime=mt(s.msgTime)-1),e},e.prototype._getUnreadCount=function(e){return e>999?999:e},e.prototype._formatConversationList=function(e,t){var n=this,r=this,o=e.info,i=e.compressedData;if(e.compressioEnabled){var s=Vd(i),a=Xi.decode(Hr,s);return this._formatConversationList(a,t)}var u=t.afterDecode,c={list:(o=At(o,(function(e){var o=e.msg,i=e.userId,s=e.type,a=e.unreadCount,c=e.busChannel,l=e.versionTime,d=null;o&&((d=r._formatReceivedMessage(o,t)).targetId=i);var p={targetId:i,conversationType:s,unreadMessageCount:mt(a)||0,latestMessage:d,channelId:c||"",operationTime:mt(l)||0};return s===exports.ConversationType.ULTRA_GROUP&&(p=n._getUltraGroupConversationInfo(p,e)),(null==u?void 0:u(p))||p})))||[]};return((null==t?void 0:t.conversationType)||exports.ConversationType.NONE)===exports.ConversationType.ULTRA_GROUP&&(c.isFinished=e.isFinished),c},e.prototype._formatSetUserSettingOutput=function(e){return e},e.prototype._formatChatRoomInfos=function(e){var t=e.userTotalNums,n=e.userInfos;return{userCount:t,userInfos:At(n,(function(e){var t=e.id,n=e.time;return{id:t,time:mt(n)}}))}},e.prototype._formatChatRoomKVList=function(e){var t=e.entries,n=e.bFullUpdate,r=e.syncTime,o=e.compressedData;if(e.compressioEnabled){var i=Vd(o),s=Xi.decode(co,i);return this._formatChatRoomKVList(s)}return t=At(t=t||[],(function(e){var t=e.key,n=e.value,r=e.status,o=e.timestamp,i=e.uid,s=e.version,a=function(e){return{isAutoDelete:!!(1&e),isOverwrite:!!(2&e),type:4&e?exports.ChatroomEntryType.DELETE:exports.ChatroomEntryType.UPDATE}}(r);return{key:t,value:n,isAutoDelete:a.isAutoDelete,isOverwrite:a.isOverwrite,type:a.type,userId:i,timestamp:mt(o),version:mt(s)}})),{kvEntries:t,isFullUpdate:n,syncTime:r}},e.prototype._formatUserSetting=function(e){var t=this,n=e.items,r=e.version,o={};return St(n||[],(function(e){var n=e.key,r=e.version,i=e.value;e.version=mt(r),e.value=t._readBytes(i),"Tag"===n&&e.tags.forEach((function(e){e.createdTime=mt(e.createdTime),e.tagName=e.name})),o[n]=e})),{settings:o,version:r}},e.prototype._formatGrpReadReceiptQryResp=function(e){var t=e.totalMemberNum,n=e.list;return n.forEach((function(e){e.readTime=mt(e.readTime)})),{totalMemberCount:t,list:n}},e.prototype._formatQueryReceiptResp=function(e){var t=e.list,n=void 0===t?[]:t,r=e.num,o=e.readCnt;return{list:n.map((function(e){return{readTime:mt(e.receiptTime),userId:e.userId}})),totalCount:r,readCount:o}},e.prototype._formatUserSettingNotification=function(e){return e},e.prototype._formatChrmKVVersion=function(e){var t=e.joinTime,n=e.createTime,r=e.memberCount,o=e.chatroomBanState;return{joinTime:t,createTime:n||0,memberCount:r||0,isAllChatroomBanned:!!(1&o),isCurrentUserBanned:!!(2&o),isCurrentChatroomBanned:!!(4&o),isCurrentChatroomInWhitelist:!!(1&e.whiteListState)}},e.prototype._formatRTCJoinedUserInfo=function(e){return(e.info||[]).map((function(e){return{deviceId:e.deviceId,roomId:e.roomId,joinTime:mt(e.joinTime)}}))},e.prototype._formatCallKVInfo=function(e){return e},e.prototype._fromatCallInfoDownStream=function(e){return e},e.prototype._formateSessionMsgReadInput=function(e){var t=e.busChannel,n=e.channelId,r=e.msgTime;return{conversationType:e.type,targetId:n,channelId:t||"",timestamp:r}},e.prototype._formateChannelsListResult=function(e){if(!e)return{result:{list:[]}};var t=e.listType,n=e.result,r=e.page;return n?{listType:t,result:Xi.decode(zd[t],n)||[],page:r}:{listType:t,result:{list:[]},page:r}},e.prototype.encodeSessionAttInput=function(){var e=Xi.getModule(Zr);return e.setNothing(1),e.toArrayBuffer()},e.prototype._calculateFlag=function(e){var t=e.isFilerWhiteBlacklist,n=e.isVoipPush,r=e.pushConfig||{},o=0;return o|=n?1:0,o|=t?2:0,o|=r.disablePushTitle?4:0,o|=r.forceShowDetailContent?8:0},e.prototype._getPushExtraModule=function(e){var t=e.pushTitle,n=e.iOSConfig,r=e.androidConfig,o=e.templateId,i=void 0===o?"":o,s=e.harmonyOSConfig,a=Xi.getModule(Lr);if(t&&a.setTitle(t),n||r||s){var u=function(e,t,n){void 0===e&&(e={}),void 0===t&&(t={}),void 0===n&&(n={});var r=t.channelIdMi,o=t.channelIdHW,i=t.channelIdOPPO,s=t.typeVivo,a=t.importanceHW,u=t.categoryHW,c=t.imageUrlHW,l=t.categoryVivo,d=t.importanceHonor,p=t.imageUrlHonor,h=function(e,t){void 0===e&&(e={}),void 0===t&&(t={});var n=e.threadId,r=e.apnsCollapseId,o=e.category,i=e.richMediaUri,s=e.interruptionLevel,a=t.googleConfig,u={};u["thread-id"]=n||"",u["apns-collapse-id"]=r||"",u.category=o||"",u.richMediaUri=i||"",u["interruption-level"]=s||"active";var c={};c.collapse_key=null==a?void 0:a.collapseKey,c.imageUrl=null==a?void 0:a.imageUrl;var l=null==a?void 0:a.priority;return l&&!["high","normal"].includes(l)&&(l="normal"),c.priority=l,{APNS:u,FCM:c}}(e,t),_=[{HW:{channelId:o||"",importance:a||"NORMAL",image:c||"",category:u||""}},{MI:{channelId:r||""}},{OPPO:{channelId:i||""}},{VIVO:{classification:s||"",category:l||""}},{APNS:h.APNS},{FCM:h.FCM},{HONOR:{importance:d||exports.PushImportanceHonor.NORMAL,image:p||""}},{OHOS:{category:n.category||null,image:n.image||""}}];return JSON.stringify(_)}(n,r,s);a.setPushConfigs(u)}return(null==r?void 0:r.notificationId)&&a.setPushId(null==r?void 0:r.notificationId),a.setTemplateId(i),a},e.prototype._getUpMsgModule=function(e,t){var n=t.messageType,r=t.content,o=t.directionalUserIdList,i=t.canIncludeExpansion,s=t.expansion,a=t.pushConfig,u=t.channelId,c=t.pushData,l=void 0===c?"":c,d=t.pushContent,p=void 0===d?"":d,h=t.messageId,_=void 0===h?0:h,g=t.disableUpdateLastMessage,f=void 0!==g&&g,E=t.isPersited,I=e.conversationType,T=e.targetId,C=Xi.getModule(Mr),v=function(e){var t=e.isStatusMessage,n=e.isPersited,r=e.isCounted;t&&(n=r=!1);var o=0;return n&&(o|=1),r&&(o|=2),e.isMentioned&&(o|=4),e.disableNotification&&(o|=32),e.canIncludeExpansion&&(o|=64),o}(t),R=a||{},y=R.pushContent,m=void 0===y?p:y,S=R.pushData,A=void 0===S?l:S;C.setSessionId(v),m&&C.setPushText(m),A&&C.setAppData(A),o&&C.setToUserIds(o);var N=this._calculateFlag(t);if(C.setConfigFlag(N),C.setClassname(n),r.user&&r.user.portraitUri&&(r.user.portrait=r.user.portraitUri),C.setContent(JSON.stringify(r)),i&&s){var O={};St(s,(function(e,t){O[t]={v:e}})),C.setExtraContent(JSON.stringify(O))}if(a){var M=this._getPushExtraModule(a);C.setPushExt(M)}C.setClientUniqueId(_),Et(u)||C.setBusChannel(u),I===exports.ConversationType.SYSTEM&&C.setSystemId(T);var L=0;return E&&f&&(L|=1),C.setOptionBits(L),C},e.prototype.encodeUpMsg=function(e,t){return this._getUpMsgModule(e,t).toArrayBuffer()},e.prototype.encodeGetHistoryMsg=function(e,t){var n=t.count,r=t.order,o=t.timestamp,i=t.channelId,s=Xi.getModule(Jr);return s.setTargetId(e),s.setTime(o),s.setCount(n),s.setOrder(r),s.setBusChannel(i||""),s.setCompressioEnabled(Da.enable()),s.toArrayBuffer()},e.prototype.encodeSuperSyncMsg=function(e){return Xi.encode(Do,{syncTime:e,compressioEnabled:Da.enable()})},e.prototype.encodeOldConversationList=function(e){var t=(e=e||{}).count,n=e.type,r=e.startTime,o=e.order;t=t||0,r=r||0,o=o||0;var i=Xi.getModule(Fr);return i.setType(n),i.setCount(t),i.setStartTime(r),i.setOrder(o),i.setCompressioEnabled(Da.enable()),i.toArrayBuffer()},e.prototype.encodeRemoveOldConversationList=function(e){var t=(e=e||{}).conversationType,n=e.channelId,r=Xi.getModule(Br);return r.setType(t),n&&r.setBusChannel([n]),r.toArrayBuffer()},e.prototype.encodeBatchDeleteConversation=function(e){var t=Xi.getModule(oo),n=[];return e.forEach((function(e){var t=e.conversationType,r=e.targetId,o=e.channelId,i=Xi.getModule(io);i.setConversationType(t),i.setConversationId(r),i.setBusChannel(o||""),n.push(i)})),t.setRelation(n),t.toArrayBuffer()},e.prototype._encodeSessions=function(e){return e.map((function(e){var t=e.conversationType,n=e.targetId,r=Xi.getModule(to);return r.setType(t),r.setChannelId(n),r}))},e.prototype.encodeRemoveConversationList=function(e){var t=Xi.getModule(eo);return t.setSessions(this._encodeSessions(e)),t.toArrayBuffer()},e.prototype.encodeDeleteMessages=function(e,t,n,r){var o=Xi.getModule(so),i=[];return St(n,(function(e){i.push({msgId:e.messageUId,msgDataTime:e.sentTime,direct:e.messageDirection})})),o.setType(e),o.setConversationId(t),o.setMsgs(i),o.setBusChannel(r),o.toArrayBuffer()},e.prototype.encodeClearMessages=function(e,t,n,r){var o=Xi.getModule(Kr);return t=t||(new Date).getTime(),o.setDataTime(t),o.setTargetId(e),o.setBusChannel(n),o.setConversationType(r),o.toArrayBuffer()},e.prototype.encodeBatchClearRemoteMessages=function(e){var t=Xi.getModule(Qr),n=e.map((function(e){var t=Xi.getModule(Kr);return t.setTargetId(e.targetId),t.setConversationType(e.conversationType),t.setBusChannel(e.channelId),t.setDataTime(e.timestamp),t}));return t.setInput(n),t.toArrayBuffer()},e.prototype.encodeClearUnreadCount=function(e,t){var n=e.conversationType,r=e.targetId,o=e.channelId,i=t.timestamp,s=Xi.getModule($r);return i=i||+new Date,s.setType(n),s.setChannelId(r),s.setMsgTime(i),s.setBusChannel(o),s.toArrayBuffer()},e.prototype.encodeExpandUltraMessage=function(e,t){var n=e.targetId,r=e.conversationType,o=e.channelId,i=e.messageUId,s=e.sendTime,a=e.keys,u={mid:i,put:e.expansion,del:a,clear:e.removeAll?1:0},c=Xi.getModule(Vo);return c.setFromUserId(t),c.setTargetId(n),c.setType(r),c.setBusChannel(o||""),c.setMsgUID(i),c.setMsgTime(s),c.setContent(JSON.stringify(u)),c.toArrayBuffer()},e.prototype.encodemodifyMessage=function(e,t){var n=e.targetId,r=e.conversationType,o=e.channelId,i=e.messageUId,s=e.sendTime,a=e.content,u=Xi.getModule(Vo);return u.setFromUserId(t),u.setTargetId(n),u.setType(r),u.setBusChannel(o||""),u.setMsgUID(i),u.setMsgTime(s),u.setContent(JSON.stringify(a)),u.toArrayBuffer()},e.prototype.encodeQueryMsgChange=function(e){var t=Xi.getModule(Go);return t.setSyncTime(e),t.toArrayBuffer()},e.prototype.encodeMsgQuery=function(e){var t=e.targetId,n=e.conversationType,r=e.messages,o=Xi.getModule(Bo),i=r.map((function(e){return{msgTime:e.sendTime,msgUID:e.messageUId,busChannel:e.channelId}}));return o.setTargetId(t),o.setType(n),o.setQuery(i),o.toArrayBuffer()},e.prototype.encodeUnreadMentionedMsgQuery=function(e){var t=e.targetId,n=e.channelId,r=e.sentTime,o=e.count,i=Xi.getModule(qr);return i.setGroupId(t),i.setBusChannel(n),i.setMsgTime(r),i.setSize(o),i.toArrayBuffer()},e.prototype.encodeOperateStatus=function(e,t,n,r){var o=Xi.getModule(qo);return o.setTargetId(e),o.setType(t),o.setBusChannel(n),o.setOpType(r),o.toArrayBuffer()},e.prototype.encodeGetChatRoomInfo=function(e,t){var n=Xi.getModule(Wr);return n.setCount(e),n.setOrder(t),n.toArrayBuffer()},e.prototype.encodeSetUltraGroupDefaultNotificationLevel=function(e,t){var n=Xi.getModule(Ro);return n.setUnpushLevel(e),n.setBusChannel(t),n.toArrayBuffer()},e.prototype.encodeGetUltraGroupDefaultNotificationLevel=function(e){var t=Xi.getModule(vo);return t.setBusChannel(e),t.toArrayBuffer()},e.prototype.encodeModifyChatRoomKV=function(e,t,n){var r=Xi.getModule(ao),o=t.key,i=t.value,s=t.notificationExtra,a=t.isSendNotification,u=t.type,c=t.timestamp,l=u||exports.ChatroomEntryType.UPDATE,d=qd(t,l),p={key:o,value:i||"",uid:n,version:c};if(Et(d)||(p.status=d),r.setEntry(p),a){var h={conversationType:exports.ConversationType.CHATROOM,targetId:e},_={key:o,value:i,extra:s,type:l},g=this._getUpMsgModule(h,{messageType:exports.MessageType.CHRM_KV_NOTIFY,content:_,isPersited:!1,isCounted:!1});r.setNotification(g),r.setBNotify(!0),r.setType(exports.ConversationType.CHATROOM)}return r.toArrayBuffer()},e.prototype.encodeModifyChatRoomKVS=function(e,t,n){var r=Xi.getModule(uo),o=t.entries,i=t.type||exports.ChatroomEntryType.UPDATE,s=qd(t,i),a=[];return o.forEach((function(e){var t={key:e.key,value:e.value||"",uid:n,version:e.timestamp};Et(s)||(t.status=s),a.push(t)})),r.setEntry(a),r.toArrayBuffer()},e.prototype.encodePullChatRoomKV=function(e){return Xi.encode(po,{timestamp:e,compressioEnabled:Da.enable()})},e.prototype.encodeSetConversationStatus=function(e,t){var n=Date.now();return Xi.encode(Co,{version:t,state:e.map((function(e){var t={type:e.conversationType,channelId:e.targetId,busChannel:e.channelId,time:n,stateItem:[]};return void 0!==e.notificationLevel&&(t.stateItem=[{sessionStateType:Ar.IsSilent,value:e.notificationLevel.toString()}]),void 0!==e.isTop&&(t.stateItem=[{sessionStateType:Ar.IsTop,value:e.isTop?"1":"0"}]),t}))})},e.prototype.encodeSetConversationTypeLevel=function(e,t,n){var r=Xi.getModule(So);return r.setType(e),r.setVersion(t),r.setUnpushLevel(n),r.toArrayBuffer()},e.prototype.encodeReadReceipt=function(e,t){var n=Xi.getModule(No);return n.setMsgId(e),t&&n.setChannelId(t),n.toArrayBuffer()},e.prototype.encodeCreateTag=function(e,t){var n=Xi.getModule(Mo),r=[];return e.forEach((function(e){var t=Xi.getModule(Lo);t.setTagId(e.tagId),t.setName(e.tagName),r.push(t)})),n.setTags(r),n.setVersion(t),n.toArrayBuffer()},e.prototype.encodeMessageReader=function(e,t){var n=Xi.getModule(No);return n.setMsgId(e),t&&n.setChannelId(t),n.toArrayBuffer()},e.prototype.encodeReadReceiptMsg=function(e,t,n){var r=Xi.getModule(zo),o=e.conversationType,i=e.targetId,s=e.channelId,a=void 0===s?"":s;return r.setType(o),r.setTargetId(i),r.setBusChannel(a),r.setStartMsgId(t),r.setEndMsgId(n),r.toArrayBuffer()},e.prototype.encodeReceiptQryReq=function(e,t){var n=Xi.getModule(Zo),r=e.targetId,o=e.channelId,i=void 0===o?"":o;return n.setTargetId(r),n.setBusChannel(i),n.setMsgId(t),n.toArrayBuffer()},e.prototype.encodeReceiptCntQryReq=function(e,t){var n=Xi.getModule($o),r=e.targetId,o=e.conversationType,i=e.channelId,s=void 0===i?"":i;return n.setChannelId(r),n.setBusChannel(s),n.setType(o),n.setMsgId(t),n.toArrayBuffer()},e.prototype.encodeSessionMsgReadInput=function(e,t){var n=Xi.getModule($r),r=e.conversationType,o=e.targetId,i=e.channelId,s=void 0===i?"":i;return n.setType(r),n.setChannelId(o),n.setBusChannel(s),n.setMsgTime(t),n.toArrayBuffer()},e.prototype.encodeRemoveTag=function(e,t){var n=Xi.getModule(Uo),r=[];return e.forEach((function(e){var t=Xi.getModule(Lo);t.setTagId(e),r.push(t)})),n.setTags(r),n.setVersion(t),n.toArrayBuffer()},e.prototype.encodeDisConversationTag=function(e){var t=Xi.getModule(bo);return t.setTagId(e),t.toArrayBuffer()},e.prototype.encodeUpdateConversationTag=function(e,t,n){var r=Xi.getModule(Co),o=[];return t.forEach((function(t){var n=Xi.getModule(Io),r=Xi.getModule(To),i=[];e.forEach((function(e){var t=Xi.getModule(Lo);t.setTagId(e.tagId),Et(e.isTop)||t.setIsTop(e.isTop),i.push(t)})),r.setSessionStateType(Jd),r.setValue(JSON.stringify(i)),r.setTags(i),n.setType(t.conversationType),n.setChannelId(t.targetId),n.setTime(Date.now()),n.setStateItem([r]),o.push(n)})),r.setState(o),r.setVersion(n),r.toArrayBuffer()},e.prototype.encodeReportSDKInfo=function(e){var t=Xi.getModule(wo);return t.setSdkInfo(e),t.toArrayBuffer()},e.prototype.encodeUltraGroup=function(e,t){var n=Xi.getModule(xo);return n.setSyncTime(e),n.setIsEraseMsgContent(t),n.toArrayBuffer()},e.prototype.encodebindRTCRoomForChatroom=function(e){var t=Xi.getModule(Ko);return t.setRtcRoomId(e.rtcRoomId),t.toArrayBuffer()},e.prototype.encodeSetCallInfo=function(e,t){var n=Xi.getModule(Qo);return n.setKey(e),n.setDataContent(t),n.toArrayBuffer()},e.prototype.encodePullKVMsg=function(e){var t=Xi.getModule(jo);return t.setSyncTime(e),t.toArrayBuffer()},e.prototype.encodeUpdateUserSubReq=function(e,t,n,r){var o=Xi.getModule(ti);o.setSubType(e),o.setOpType(n),o.setExpiry(r);var i=[];return t.forEach((function(e){var t=Xi.getModule(ni);t.setSubUserId(e),i.push(t)})),o.setSubUsers(i),o.toArrayBuffer()},e.prototype.encodePullUserSubReq=function(e){var t=e.version,n=e.pageToken,r=Xi.getModule(oi);return r.setVersion(t),r.setPageToken(n),r.toArrayBuffer()},e.prototype.encodePullSubDataReq=function(e){var t=e.version,n=e.needAllData,r=e.pageToken,o=Xi.getModule(si);return o.setVersionTime(t),o.setNeedAllData(n),o.setPageToken(r),o.toArrayBuffer()},e.prototype.encodeQrySubDataReq=function(e,t){var n=Xi.getModule(ci);n.setSubType(e);var r=[];return t.forEach((function(e){var t=Xi.getModule(ni);t.setSubUserId(e),r.push(t)})),n.setSubUsers(r),n.toArrayBuffer()},e.prototype.encodePullUserProfileReq=function(e){var t=Xi.getModule(hi);return t.setUserId(e),t.toArrayBuffer()},e.prototype.encodeUserProfileInput=function(){var e=Xi.getModule(gi);return e.setNothing(1),e.toArrayBuffer()},e.prototype.encodeUserProfilePermission=function(e){var t=Xi.getModule(fi);return t.setPermission(e),t.toArrayBuffer()},e.prototype.encodeSearchUserProfile=function(e){var t=Xi.getModule(Ei);return t.setUniqueId(e),t.toArrayBuffer()},e.prototype.encodeUserProfile=function(e){var t=Xi.getModule(li),n=[],r=[];return Object.keys(e).forEach((function(t){if("extraProfile"!==t){var o=e[t],i=Xi.getModule(di);i.setKey(t),i.setValue((null==o?void 0:o.toString())||""),n.push(i)}else if(e.extraProfile){var s=e.extraProfile;Object.keys(s).forEach((function(e){var t=s[e],n=Xi.getModule(di);n.setKey(e),n.setValue(t.toString()||""),r.push(n)}))}})),t.setUserProfile(n),t.setUserExtProfile(r),t.toArrayBuffer()},e.prototype.encodeMultiChannels=function(e){var t=Xi.getModule(Ci),n=[];return e.forEach((function(e){var t=Xi.getModule(Ii);t.setTargetId(e),n.push(t)})),t.setType(exports.ConversationType.GROUP),t.setList(n),t.toArrayBuffer()},e.prototype.encodeQuitGroup=function(e,t,n,r,o){void 0===n&&(n=[]),void 0===r&&(r=!0);var i=Xi.getModule(vi);if(i.setTargetId(t),i.setType(exports.ConversationType.GROUP),"dismiss"!==e&&o){var s=this.encodeQuitChannelsSetting(o,r);i.setSettingInfo(s)}return"quit"!==e&&"dismiss"!==e&&i.setUsers(n),i.toArrayBuffer()},e.prototype.encodeQuitChannelsSetting=function(e,t){var n=Xi.getModule(Ri);return n.setIsQuit(t),n.setIsDelBan(!!(null==e?void 0:e.removeMuteStatus)),n.setIsDelWhite(!!(null==e?void 0:e.removeWhiteList)),n.setIsDelAttention(!!(null==e?void 0:e.removeFollow)),n},e.prototype.encodeModifyChannelsInput=function(e,t,n){var r=Xi.getModule(vi);return r.setTargetId(t),r.setType(exports.ConversationType.GROUP),r.setUsers(n),r.setOperateType(e),r.toArrayBuffer()},e.prototype.encodeChannelsQueryInput=function(e){var t=e.type,n=e.groupId,r=e.option,o=e.ids,i=Xi.getModule(yi);if(n&&i.setTargetId(n),i.setType(exports.ConversationType.GROUP),["getGroupMembersByRole","getGroupApplications","getJoinedGroupsByRole"].includes(t)&&r){var s=this.encodePagingQuery(r);i.setPage(s)}return["getGroupMembers","getJoinedGroups"].includes(t)&&i.setIds(null!=o?o:[]),e.roleType&&i.setRoleType(e.roleType),i.toArrayBuffer()},e.prototype.encodePagingQuery=function(e){var t=Xi.getModule(mi),n=e.count,r=e.order,o=e.pageToken;return t.setSize(n),t.setOrder(r?0:1),t.setPageToken(o),t},e.prototype.encodeJoinGroup=function(e,t,n){void 0===n&&(n=[]);var r=Xi.getModule(Oi);return r.setTargetId(t),r.setType(exports.ConversationType.GROUP),"invite"===e&&r.setUserIds(n),r.toArrayBuffer()},e.prototype.encodeMemberResponseInput=function(e){var t=e.groupId,n=e.inviterId,r=e.optType,o=e.optResult,i=e.joinUserId,s=e.reason,a=Xi.getModule(Ni);return a.setTargetId(t),a.setType(exports.ConversationType.GROUP),a.setOptType(r),a.setOptResult(o),a.setInviterId(n),r===exports.GroupOperationRole.MANAGER&&a.setJoinUserId(i),o||a.setDetail(null!=s?s:""),a.toArrayBuffer()},e.prototype.encodeSetGroupRemark=function(e,t){var n=Xi.getModule(Ai),r=exports.GroupOperationType.ADD;return n.setTargetId(e),n.setType(exports.ConversationType.GROUP),t||(r=exports.GroupOperationType.REMOVE),n.setOperateType(r),n.setChannelNickName(t),n.toArrayBuffer()},e.prototype.encodeSetGroupFollows=function(e,t,n){var r=Xi.getModule(vi);return r.setTargetId(t),r.setType(exports.ConversationType.GROUP),r.setUsers(n),r.setOperateType(e),r.toArrayBuffer()},e.prototype.encodeFriendInput=function(e){var t=Xi.getModule(Mi);return t.setTargetId(e.targetId),e.type&&t.setType(e.type),e.info&&t.setInfo(e.info),t.toArrayBuffer()},e.prototype.encodeFriendsInput=function(e,t){return Xi.encode(Li,{targetId:e,type:t})},e.prototype.encodeFriendQueryInput=function(e,t,n){var r=null!=t?t:{},o=r.count,i=void 0===o?200:o,s=r.pageToken,a=void 0===s?"":s,u=r.order,c=void 0!==u&&u,l=Xi.getModule(wi);l.setQueryType(e),11===e&&l.setFriendType(n);var d=Xi.getModule(mi);return d.setSize(i),d.setOrder(c?0:1),d.setPageToken(a),l.setPage(d),l.toArrayBuffer()},e.prototype.encodeFriendsListInput=function(e,t){return Xi.encode(xi,{targetId:e,type:t})},e.prototype.encodeFriendLevelSet=function(e){return Xi.encode(Di,{level:e})},e.prototype.encodeQuerySessionsInput=function(e){var t=Xi.getModule(no);return t.setSessions(this._encodeSessions(e)),t.toArrayBuffer()},e}(),$d=function(e){function n(t,n,r){var o=e.call(this,t,n,r)||this;return o._socket=null,o._connectedTime=0,o._socketIndex=0,o._serverSessionId="",o._localConnectedTime=0,o._idCount=0,o._generateMessageId=function(){return o._idCount>=65535&&(o._idCount=0),++o._idCount},o._messageIds={},o._syncMessageIds={},o.codec=new Xd(o.logger),o}return t(n,e),n.prototype.getConnectedTime=function(){return this._connectedTime},n.prototype.getLocalConnectedTime=function(){return this._localConnectedTime},n.prototype.getCrtServerTime=function(){return Date.now()-this._localConnectedTime+this._connectedTime},n.prototype.getDelayTime=function(){return this._localConnectedTime-this._connectedTime},n.prototype.connectWithToken=function(e,t,n,r){return ue(this,void 0,void 0,(function(){var n,o,i,s,a,u,c,l,d,p;return ce(this,(function(h){switch(h.label){case 0:if(n=t.openAnti,o=t.type,i=t.baggageEnabled,s=this.getCmpList(t),this.logger.debug(exports.LogTagId.L_NAVI_CMP_R,JSON.stringify(s),r),0===(a=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(exports.LogTagId.L_NAVI_CONF_E,"no service available",r),[2,st(exports.ErrorCode.SERVER_UNAVAILABLE)];u=1===n?_s.V4:_s.V3,c=function(t){var n,s,c,d,p,h,_,g,f,E,I;return ce(this,(function(T){switch(T.label){case 0:return n=a[t],s=n.protocol,c=n.addr,d=n.weight,p=function(e,t,n,r,o,i,s,a){var u=wa(),c=u.type,l=u.version,d="browser"===Tr.tag?"|".concat(c,"|").concat(l):"||",p=s?"&protocolVer=".concat(s):"",h=Pa();return"".concat(e,"://").concat(t,"/websocket?appId=").concat(n,"&token=").concat(encodeURIComponent(r),"&sdkVer=").concat(be,"&pid=").concat(i,"&deviceId=").concat(h).concat(1===a?"&baggage=".concat(encodeURIComponent("cid=".concat(o))):"","&apiVer=").concat(Tr.isFromUniapp?"uniapp":Tr.tag+encodeURIComponent(d)).concat(Tr.connectPlatform?"&platform=".concat(Tr.connectPlatform):"").concat(p)}(s===x.WS?"ws":"wss",c,l.appkey,e,l.cid,"",u,i),h=Date.now(),[4,l.connectWebSocket(p,u,r)];case 1:return _=T.sent(),g=_.code,f=_.data,E=l.cmpWeightCache.findIndex((function(e){return e.addr===c})),I={bid:zt(),ptc:Ee.WS,cod:g,net:l.getNetwork().type,dur:Date.now()-h,spr:0,pr:o||0,hos:c,idx:E,rct:l.retryCount?Ce.RECONNECT:Ce.CONNECT,cid:l.cid,v:Te.CURRENT,rsn:l._doConnectReason,count:l.retryCount,weight:d,ssid:l._serverSessionId},l.logger.record(re.IM_WEBSOCKET,JSON.stringify(I),r),g===exports.ErrorCode.RC_SOCKET_DISCONNECTED||g===exports.ErrorCode.TIMEOUT?[2,"continue"]:g!==exports.ErrorCode.SUCCESS?[2,{value:st(g)}]:(l._localConnectedTime=Math.floor((Date.now()+h)/2),l._socket=f.socket,l.updateCmpWeight(a[t].addr,!0),l.curCmpUrl=a[t].addr,[2,{value:it(f.userId)}])}}))},l=this,d=0,h.label=1;case 1:return d<a.length?[5,c(d)]:[3,4];case 2:if("object"==typeof(p=h.sent()))return[2,p.value];h.label=3;case 3:return d+=1,[3,1];case 4:return[2,st(exports.ErrorCode.SERVER_UNAVAILABLE)]}}))}))},n.prototype.connectWebSocket=function(e,t,n){return ue(this,void 0,void 0,(function(){var r=this;return ce(this,(function(o){return this.logger.info(exports.LogTagId.T,"connect start: ".concat(e),n),[2,new Promise((function(o){var i=Tr.createWebSocket(e);r._socketIndex=i.id;var s=setTimeout((function(){r.logger.info(exports.LogTagId.T,"connect timeout: ".concat(e),n),o(st(exports.ErrorCode.TIMEOUT)),i&&i.close()}),5e3);i.onOpen((function(){clearTimeout(s),r.logger.info(exports.LogTagId.T,"socket open",n)})),i.onMessage((function(e){if(r._socketIndex===i.id){if("[object ArrayBuffer]"===Object.prototype.toString.call(e)){var s=fa(e,t);if(s){if(s instanceof na){var a=s.status;if(a!==Pd.ACCEPTED)return r.logger.info(exports.LogTagId.T,"connect failed: ".concat(a),n),void o(st((p=a,Bd[p])));r.logger.info(exports.LogTagId.T,"connect success",n);var u=s.timestamp,c=s.userId,l=s.messageId,d=s.sessionId;return r._serverSessionId=d,r._connectedTime=u,r._idCount=l,void o(it({userId:c,socket:i}))}var p;if(s instanceof ra){var h=s.status;return r.logger.info(exports.LogTagId.T,"recv disconnect signal -> status: ".concat(h)),void r.onRecvDisconnect(h,i)}r._onReceiveSignal(s)}}}else r.logger.warn(exports.LogTagId.L_WEBSOCKET_DISACCORD_E,JSON.stringify({msg:"WebSocket id disaccord",_socketIndex:r._socketIndex,curSocketId:i.id}))})),i.onClose((function(){r.logger.info(exports.LogTagId.T,"socket close",n);var e=exports.ErrorCode.RC_SOCKET_DISCONNECTED;o(st(e)),r.onSocketEnd(i,e)})),i.onError((function(e){r.logger.info(exports.LogTagId.T,"socket error",n);var t=exports.ErrorCode.RC_SOCKET_DISCONNECTED;o(st(t)),r.onSocketEnd(i,t)}))}))]}))}))},n.prototype._qosNeedAck=function(e){e.header.qos!==ps.AT_MOST_ONCE&&(e instanceof ua&&!e.syncMsg&&(this.logger.debug(exports.LogTagId.O,"send pubAck -> ".concat(e.messageId," ").concat(e.topic)),this.sendOnly(new ha(e.messageId))),e instanceof ga&&(this.logger.debug(exports.LogTagId.O,"send queryCon -> ".concat(e.messageId)),this.sendOnly(new _a(e.messageId))))},n.prototype._publishReader=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i=this;return ce(this,(function(s){switch(s.label){case 0:return t=e.syncMsg,n=e.topic,r=e.messageId,this.logger.debug(exports.LogTagId.O,"recv PublishReader -> messageId: ".concat(r," ").concat(n)),n===xs?[2]:!t||Hd(n)?(this.emit("signal",e),[2]):[4,new Promise((function(e){i._syncMessageIds[r]=e}))];case 1:return o=s.sent(),delete this._syncMessageIds[r],this.emit("signal",e,o),[2]}}))}))},n.prototype._onReceiveSignal=function(e){return ue(this,void 0,void 0,(function(){var t,n,r;return ce(this,(function(o){switch(o.label){case 0:return e instanceof ia&&this._pingResolve?(this._pingResolve(exports.ErrorCode.SUCCESS),this._pingResolve=void 0,[2]):(this._qosNeedAck(e),(e instanceof pa||e instanceof ga)&&(t=e.messageId,this.logger.debug(exports.LogTagId.O,"recv ack -> messageId: ".concat(t)),(n=this._messageIds[t])&&(n(e),delete this._messageIds[t]),(r=this._syncMessageIds[t])&&(delete this._syncMessageIds[t],r(e))),e instanceof ua?[4,this._publishReader(e)]:[3,2]);case 1:o.sent(),o.label=2;case 2:return[2]}}))}))},n.prototype.onRecvDisconnect=function(e,t){this._socket&&this._socket===t&&(this._socket=null,this.clearResolves(),this.onDisconnectByServer(function(e){return Fd[e]}(e)))},n.prototype.onSocketEnd=function(e,t){this._socket&&this._socket===e&&(this._socket=null,this.clearResolves(),this.onDisconenctUnusual(t),this._pingResolve&&(this._pingResolve(t),this._pingResolve=void 0))},n.prototype.clearResolves=function(){for(var e in this._messageIds){var t=this._messageIds[e];delete this._messageIds[e],t(exports.ErrorCode.RC_SOCKET_DISCONNECTED)}},n.prototype.sendPing=function(e){var t=this;return new Promise((function(n){t._pingResolve=n,setTimeout((function(){return n(exports.ErrorCode.TIMEOUT)}),e),t.sendOnly(new oa)}))},n.prototype.sendOnly=function(e){this._socket&&((e instanceof da||e instanceof la)&&(e.messageId=this._generateMessageId()),this._socket.send(e.getArrayBuffer()))},n.prototype._sendHandler=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o=this;return ce(this,(function(i){switch(i.label){case 0:return this._socket?(t=this._generateMessageId(),e.messageId=t,this._socket.send(e.getArrayBuffer()),[4,new Promise((function(e){o._messageIds[t]=e,setTimeout((function(){o._messageIds[t]&&delete o._messageIds[t],e(exports.ErrorCode.TIMEOUT)}),3e4)}))]):[2,st(exports.ErrorCode.RC_NET_CHANNEL_INVALID)];case 1:return n=i.sent(),(r="number"==typeof n?n:n.status)!==exports.ErrorCode.SUCCESS&&this.logger.warn(exports.LogTagId.O,"send rmtp fail -> messageId: ".concat(t,", code: ").concat(r,", topic: ").concat(e.topic)),"number"==typeof n?[2,st(n)]:[2,r===exports.ErrorCode.SUCCESS?it(n):st(r,"",n)]}}))}))},n.prototype.query=function(e,t,n,r,o){return ue(this,void 0,void 0,(function(){var i,s,a,u,c,l,d,p;return ce(this,(function(h){switch(h.label){case 0:return i=this.logger.createTraceId(),this.logger.debug(exports.LogTagId.O,"send query -> topic: ".concat(fs(e),", targetId: ").concat(t),i),s=new la(e,n,t),o&&s.setHeaderQos(o),[4,this._sendHandler(s)];case 1:return a=h.sent(),u=a.code,c=a.data,l=a.isOk,d=a.msg,p=c&&r?Xi.decode(r,c.pbData):void 0,l?(this.logger.info(exports.LogTagId.O,"send query success",i),[2,it(p)]):(this.logger.warn(exports.LogTagId.O,"send query fail -> ".concat(u),i),[2,st(u,d,p)])}}))}))},n.prototype.send=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o,i,s;return ce(this,(function(a){switch(a.label){case 0:return[4,this._sendHandler(e)];case 1:return(r=a.sent()).data?r.data instanceof pa?[2,r]:(o=r.data,i=t&&o.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(o.status)>=0,s=i?this.codec.decodeByPBName(o.pbData,t,n):o,0!==o.status?(this.logger.warn(exports.LogTagId.O,"send failed -> messageId: ".concat(o.messageId,", respPBName: ").concat(t,", status: ").concat(o.status)),[2,st(o.status,void 0,t&&o.pbData?s:null)]):[2,it(s)]):[2,r.wipe()]}}))}))},n.prototype.close=function(e){this._socket&&(this._socket.close(),this._socket=null),this.clearResolves()},n}(Rn),ep=function(e){this.conn=e},tp=function(e){function n(t,n,r){var o=e.call(this,n,t,r)||this;o._mrtr={chatroom:0,group:0,private:0,ultraGroup:0,temporary:!1};var i=wa();return o.deviceId=Pa(),o.model="Web|".concat(i.type,"|").concat(i.version),o.init(),o}return t(n,e),n.prototype.httpRequest=function(e,t,n,r){return ue(this,void 0,void 0,(function(){var o,i,s,a,u,c,l,d;return ce(this,(function(p){switch(p.label){case 0:return(o=r).deviceId=this.deviceId,o.model=this.model,i={url:e,method:t,headers:n,body:JSON.stringify(o)},this.logger.info(exports.LogTagId.L_REQUEST_T,JSON.stringify(i)),[4,Tr.httpReq(i)];case 1:s=p.sent(),a=s.status,u=s.data,c=void 0===u?"":u,this.logger.info(exports.LogTagId.L_REQUEST_R,JSON.stringify({status:a,data:c}));try{return l=JSON.parse(c),d=l.data,[2,{code:parseInt(l.code,10),data:d}]}catch(e){return this.logger.warn(exports.LogTagId.L_CLOUD_CONFIG_DATA_E,JSON.stringify({status:a,data:c,error:e})),[2,{code:a,msg:e}]}return[2]}}))}))},n.prototype.setCloudControllerCache=function(e){var t=Qe(this.appkey);Tr.localStorage.setItem(t,JSON.stringify(e)),this.logger.info(exports.LogTagId.L_CLOUD_SET_CACHE_O,JSON.stringify(e))},n.prototype.getLocalCloudControllerCache=function(){var e=Qe(this.appkey),t=Tr.localStorage.getItem(e);return this.logger.info(exports.LogTagId.L_CLOUD_SET_CACHE_O,JSON.stringify({appkey:this.appkey,key:e,data:t})),t},n.prototype.setMRTRConfig=function(e){this.logger.info(exports.LogTagId.L_CLOUD_SET_MRTR_O,JSON.stringify(e)),this._mrtr=e},n.prototype.getMRTRConfig=function(){return this._mrtr},n}(Cn),np=null,rp="RC_LOGS",op="RC_STATISTICS",ip="RC_CONF",sp=((Qd={})[rp]=["level","time"],Qd[ip]=["key"],Qd[op]=["level","time"],Qd),ap=function(e,t,n){return new Promise((function(r){var o=e.transaction(t,"readwrite").objectStore(t).index("time"),i=IDBKeyRange.upperBound(Date.now()-n),s=o.openCursor(i);s.onsuccess=function(e){var t=e.target.result;t?(t.delete(),t.continue()):r()},s.onerror=function(){r()}}))},up=null,cp=function(e){return ue(void 0,void 0,void 0,(function(){var t,n;return ce(this,(function(r){switch(r.label){case 0:return[4,np];case 1:return(t=r.sent())?(n=t.db,[4,ap(n,rp,e)]):[2];case 2:return r.sent(),[4,ap(n,op,e)];case 3:return r.sent(),up=setTimeout((function(){return cp(e)}),6e5),[2]}}))}))},lp=function(e,t,n){void 0===n&&(n=168),np||("undefined"!=typeof window&&window&&window.indexedDB&&"IE"!==wa().type?np=new Promise((function(r){var o=window.indexedDB;!function(e){var t=window.indexedDB;t.databases&&t.databases().then((function(n){n.forEach((function(n){n.name&&e.includes(n.name)&&t.deleteDatabase(n.name)}))}))}(["RC_ENGINE_DB","RC_STATISTIC_".concat(e)]);var i="RC_LOGS_".concat(e),s=o.open(i,2);s.onerror=function(e){t.error(exports.LogTagId.L_LOGDB_OPEN_FAILED_E,e.target.error),r(null)},s.onsuccess=function(o){var i=o.target.result;i?(i.onclose=function(e){np=null,t.warn(exports.LogTagId.L_LOGDB_CLOSED_S)},i.onerror=function(e){np=null,t.error(exports.LogTagId.L_LOGDB_ERROR_E,e.target.error)},i.onabort=function(e){t.info(exports.LogTagId.L_LOGDB_ABORT_S,e.target.error)},cp(3600*Math.max(24,Math.min(168,n))*1e3),r({appkey:e,db:i})):r(null)},s.onupgradeneeded=function(e){var t=e.target.result;Object.keys(sp).forEach((function(e){t.objectStoreNames.contains(e)&&t.deleteObjectStore(e);var n=e===ip?{keyPath:"key"}:{autoIncrement:!0},r=t.createObjectStore(e,n);sp[e].forEach((function(e){return r.createIndex(e,e,{unique:!1})}))}))}})):t.warn(exports.LogTagId.L_UNSUPPORT_INDEXDB_O))},dp=[],pp=function(e,t,n){return new Promise((function(r){var o=e.transaction(t,"readwrite");o.oncomplete=r,o.onabort=r;var i=o.objectStore(t);n.forEach((function(e){try{i.add(e)}catch(t){null===console||void 0===console||console.error("write failed ->",e,t)}}))}))},hp=[],_p=!1,gp=function(e){return ue(void 0,void 0,void 0,(function(){var t,n;return ce(this,(function(r){switch(r.label){case 0:return _p||0===hp.length?[2]:(_p=!0,t=hp.filter((function(e){return e.level<exports.LogL.FATAL})),n=hp.filter((function(e){return e.level>=exports.LogL.FATAL})),hp.length=0,[4,pp(e,rp,n)]);case 1:return r.sent(),[4,pp(e,op,t)];case 2:return r.sent(),_p=!1,0===hp.length&&dp.length>0&&(dp.forEach((function(e){return e.close()})),dp.length=0),setTimeout((function(){return gp(e)})),[2]}}))}))};function fp(e){return ue(this,void 0,void 0,(function(){var t;return ce(this,(function(n){switch(n.label){case 0:return[4,np];case 1:return(t=n.sent())?[2,new Promise((function(n){var r=t.db.transaction(ip,"readonly").objectStore(ip).get(e);r.onsuccess=function(e){var t;n({value:null===(t=r.result)||void 0===t?void 0:t.value,success:!0})},r.onerror=function(e){n({success:!1})}}))]:[2,{success:!1}]}}))}))}var Ep=$e,Ip=function(){return{setTimestamp4RealtimeLog:function(e){Ep=e},getTimestamp4RealtimeLog:function(){return Ep},getLogs:function(e,t,n,r,o){return void 0===o&&(o=rp),ue(this,void 0,void 0,(function(){var i;return ce(this,(function(s){switch(s.label){case 0:return[4,np];case 1:return(i=s.sent())?[2,new Promise((function(s){var a=i.db.transaction(o,"readonly").objectStore(o),u=[],c=IDBKeyRange.bound(e,t),l=a.index("time").openCursor(c);l.onsuccess=function(e){var t=e.target.result;if(t){var o=t.value;o.level<=n&&(r?o.sessionId===Xe:o.level>=0)&&u.push(o),t.continue()}else s({dbReady:!0,logs:u})},l.onerror=function(e){s({dbReady:!1,logs:[]})}}))]:[2,{dbReady:!1,logs:[]}]}}))}))}}},Tp="REPORT_SESSION",Cp=function(e,t){return ue(void 0,void 0,void 0,(function(){var n,r,o,i;return ce(this,(function(s){switch(s.label){case 0:return n="".concat(Tp,"_").concat(e),[4,fp("".concat(Tp,"_").concat(e))];case 1:return r=s.sent(),o=r.success,i=r.value,o?(t===(null==i?void 0:i.sessionId)||function(e,t){ue(this,void 0,void 0,(function(){var n,r;return ce(this,(function(o){switch(o.label){case 0:return[4,np];case 1:return(n=o.sent())?(r=n.db,r.transaction(ip,"readwrite").objectStore(ip).put({key:e,value:t}),[2,!0]):[2,!1]}}))}))}(n,{sessionId:t}),[2]):[2]}}))}))},vp=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),n.prototype._handleWrite=function(e){!function(e){ue(void 0,void 0,void 0,(function(){var t;return ce(this,(function(n){switch(n.label){case 0:return[4,np];case 1:if(!(t=n.sent()))return[2];if(e.content&<(e.content))try{e.content=JSON.parse(e.content)}catch(e){}return hp.push(e),gp(t.db),[2]}}))}))}(e)},n}(pn),Rp=144e5;if("undefined"!=typeof window){window.__rongcloud_devtools__={logger:{get:function(e,t,n){return void 0===t&&(t=Date.now()-Rp),void 0===n&&(n=Date.now()),ue(this,void 0,void 0,(function(){var r,o;return ce(this,(function(i){switch(i.label){case 0:return t=t<0?Date.now()+t:t,(n=n<=0?Date.now():n)-t>Rp&&(t=n-Rp),(r=new vp(e,"RC-IM","IM")).debug(exports.LogTagId.T,"get logs: startTime ".concat(t," endTime ").concat(n)),lp(e,r),[4,Ip().getLogs(t,n,exports.LogL.DEBUG,!1)];case 1:return o=i.sent().logs,r.debug(exports.LogTagId.T,"get logs ".concat(o.length)),function(e,t){var n=t.map((function(e){var t=e.sessionId,n=e.time,r=e.type,o=e.level,i=e.tag,s=e.traceId,a=e.loggerId,u=e.content;return"".concat(t,",").concat(n,",").concat(r,",").concat(o,",").concat(i,",").concat(s,",").concat(a,',"').concat(u,'"\n')})),r=new Blob(n,{type:"text/csv"}),o=URL.createObjectURL(r),i=document.createElement("a");i.href=o,i.download="".concat(e,".csv"),document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(o)}("".concat(e,"-").concat(t,"-").concat(n),o),[2]}}))}))}}}}var yp,mp,Sp=function(e){function n(t,n,r){var o=this,i=Pa(),s=wa(),a="".concat(s.type,"|").concat(s.version,"|").concat(n.getSessionId());return(o=e.call(this,t,i,a,Ip(),n)||this).tableName=r,o}return t(n,e),n.prototype.send=function(e){return Tr.httpReq(e)},n.prototype.checkStart=function(t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){switch(n.label){case 0:return[4,Cp(t.userId,this.logger.getSessionId())];case 1:return n.sent(),[2,e.prototype.checkStart.call(this,t,this.tableName)]}}))}))},n.prototype.compressLogs=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return[2,{success:!0,data:Ha(e.map(_n).join(""))}]}))}))},n.prototype.realtimeReport=function(t,n,r){return ue(this,void 0,void 0,(function(){return ce(this,(function(o){return[2,e.prototype.realtimeReport.call(this,t,n,r,this.tableName)]}))}))},n}(hn),Ap=function(e){function n(t,n){return e.call(this,t,n,rp)||this}return t(n,e),n.prototype.isReporter=function(){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){switch(e.label){case 0:return[4,(t=this.userId,n=this.logger.getSessionId(),ue(void 0,void 0,void 0,(function(){var e,r,o;return ce(this,(function(i){switch(i.label){case 0:return[4,fp("".concat(Tp,"_").concat(t))];case 1:return e=i.sent(),r=e.success,o=e.value,[2,r&&(null==o?void 0:o.sessionId)===n]}}))})))];case 1:return[2,e.sent()]}var t,n}))}))},n.prototype.report=function(t,n,r,o,i,s,a){return void 0===a&&(a=!1),ue(this,void 0,void 0,(function(){var u;return ce(this,(function(c){switch(c.label){case 0:return[4,this.isReporter()];case 1:return u=c.sent(),this.userId&&!u?[2]:[2,e.prototype.report.call(this,t,n,r,o,i,s,a)]}}))}))},n}(Sp),Np=function(e){function n(t,n){return e.call(this,t,n,op)||this}return t(n,e),n}(Sp),Op=function(e){this.conn=e},Mp=function(e){this.conn=e},Lp=((yp={})[exports.ConversationType.PRIVATE]=as.qryPMsg,yp[exports.ConversationType.GROUP]=as.qryGMsg,yp[exports.ConversationType.CHATROOM]=as.qryCHMsg,yp[exports.ConversationType.CUSTOMER_SERVICE]=as.qryCMsg,yp[exports.ConversationType.SYSTEM]=as.qrySMsg,yp[exports.ConversationType.APP_PUBLIC_SERVICE]=as.qryMCMsg,yp[exports.ConversationType.PUBLIC_SERVICE]=as.qryMPMsg,yp),Up=((mp={})[exports.ConversationType.PRIVATE]=as.cleanPMsg,mp[exports.ConversationType.GROUP]=as.cleanGMsg,mp[exports.ConversationType.ULTRA_GROUP]=as.cleanGMsg,mp[exports.ConversationType.CUSTOMER_SERVICE]=as.cleanCMsg,mp[exports.ConversationType.SYSTEM]=as.cleanSMsg,mp[exports.ConversationType.APP_PUBLIC_SERVICE]=as.cleanMCMsg,mp[exports.ConversationType.PUBLIC_SERVICE]=as.cleanMPMsg,mp),bp=function(e,t,n,r,o,i,s){return{conversationType:e,targetId:t,senderUserId:i,messageDirection:exports.MessageDirection.SEND,isCounted:!!n.isCounted,isMentioned:!!n.isMentioned,content:n.content,messageType:n.messageType,isOffLineMessage:!1,isPersited:!!n.isPersited,messageUId:r,sentTime:o,receivedTime:0,disableNotification:!!n.disableNotification,isStatusMessage:!!n.isStatusMessage,canIncludeExpansion:!!n.canIncludeExpansion,expansion:n.canIncludeExpansion?n.expansion:null,receivedStatus:exports.ReceivedStatus.UNREAD,receivedStatusInfo:Ut(exports.ReceivedStatus.UNREAD),pushConfig:n.pushConfig,channelId:n.channelId,isInterrupt:n.isInterrupt,messageId:s||0,sentStatus:exports.SentStatus.SENT,directedUserIds:n.directionalUserIdList,disableUpdateLastMessage:n.disableUpdateLastMessage}},Pp=function(e){return e.sort((function(e,t){var n,r,o=(null===(n=e.latestMessage)||void 0===n?void 0:n.sentTime)||0;return((null===(r=t.latestMessage)||void 0===r?void 0:r.sentTime)||0)-o})),e},wp=[m.GROUP_OPERATION,m.GROUP_PROFILE_CHANGE,m.GROUP_APPLICATION_INVITATION,m.GROUP_FOLLOW_USER_CHANGE],xp=[l.FRIEND_APPLICATION],Dp=["RC:TypSts","RC:InterceptMsg","RC:RL"];function Vp(){return function(e,t,n){var r=n.value;return n.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return this._isConnected?[2,r.apply(this,e)]:[2,Promise.resolve({code:exports.ErrorCode.RC_NET_UNAVAILABLE})]}))}))},n}}function Gp(){return function(e,t,n){var r=n.value;return n.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return this._isConnected?[2,r.apply(this,e)]:[2,Promise.resolve(st(exports.ErrorCode.RC_NET_UNAVAILABLE))]}))}))},n}}function kp(e){return e?e.map((function(e){var t;return{userId:e.userId,name:e.name,portraitUri:e.portraitUrl,remark:null!==(t=e.remarkName)&&void 0!==t?t:"",directionType:e.friendType,extProfile:e.extProfile,addTime:mt(e.relationTime),inBlackList:!!e.flag}})):[]}function Fp(e){return e&&e.list?e.list.map((function(e){return{userId:e.userId,name:e.name||"",portraitUri:e.portraitUrl||"",applicationType:e.type,applicationStatus:e.status,operationTime:mt(e.operateTime),extra:e.info||"",friendType:e.friendType}})):[]}var Bp=function(e){function n(t,n,o){var i=e.call(this,t,n,o,new vp(o.appkey,"IMLib","IM"))||this;r.add(i),i._customMessageType={},i._reconnectTimer=-1,i._pullOfflineFinished=!1,i.currentUserId="",i._openCallPlus=!1,i.cloudControllerUri="",i._pullingMsg=!1,i._pullQueue=[],i._chrmsQueue={},i._latestSyncTimestamp=0,i._intervalTimer=-1,i._latestPullKVMsgTimestamp=0,i._intervalTimerForChrmPull=-1,i._handleInnerMsgOptions=function(e,t,n){var r,o=n.messageType;if(o===exports.MessageType.SYNC_READ_STATUS&&function(e){return[exports.ConversationType.GROUP,exports.ConversationType.DISCUSSION,exports.ConversationType.ULTRA_GROUP,exports.ConversationType.PUBLIC_SERVICE,exports.ConversationType.APP_PUBLIC_SERVICE].includes(e)}(e)&&Object.assign(n,{directionalUserIdList:[i.currentUserId]}),o===exports.MessageType.READ_RECEIPT_RESPONSE){if(!n.content.receiptMessageDic||0===Object.keys(n.content.receiptMessageDic).length){var s=null===(r=i._readReceiptManager)||void 0===r?void 0:r.getReceiptMessageDic({conversationType:e,targetId:t,channelId:n.channelId});n.content.receiptMessageDic=s||{}}for(var a in n.directionalUserIdList=[],n.content.receiptMessageDic)n.directionalUserIdList.push(a)}return n},i._lastSyncUltraMsgTimeStamp=0,i._lastSyncUltraMsgLocalTimeStamp=0,i._ultraGroupTimer=-1,i._isUltraPulling=!1,i._ultraGroupTimeQue=[],i._isUltraGroupListExist=!1,i._ultraGroupMap={},i._ultraMsgMap={},i._pullUltraChangeMessageQue=[],i._isPullingUltraChangeMessage=!1,i._lastPullingUltraChangeMessageTime=0;var s=o.appkey,a=o.logOutputLevel,u=o.logExpireTime,c=o.navigators,l=o.areaCode,d=o.logServerUrl,p=o.miniCMPProxy,h=o.environment;i._environment=h||"default",i.logger.setOutputLevel(a),cn.init({areaCode:l,navigators:c,logServerUrl:d,miniCMPProxy:p}),lp(s,i.logger,u),i.reporter=new Ap(s,i.logger),i.navi=new fu(s,i.logger,new yu(s,i.logger),i._environment),i.reporterStatistic=new Np(s,i.logger),i._letterbox=new Eu(s),i._sendMessageStore=new Iu(s),i._chrmEntryHandler=new du(i);var _=i._connMgr=new $d(s,i.navi,i.logger);return"browser"===Tr.tag&&i._initCloudController(),i._chatroom=new ep(_),i._chat=new Op(_),i._dataHosting=new Mp(_),_.on("signal",i._signalHandler,i),_.on("onConnected",i.onConnected,i),_.on("onDisconnected",i.onDisconnected,i),_.on("onConnecting",i._watcher.onConnecting,i._watcher),_.on("onSuspend",i.onSuspend,i),i}var r,o;return t(n,e),Object.defineProperty(n.prototype,"chatroom",{get:function(){return this._chatroom},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"chat",{get:function(){return this._chat},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dataHosting",{get:function(){return this._dataHosting},enumerable:!1,configurable:!0}),n.prototype._initCloudController=function(){var e;e=de(cn.getCloudControllerUrl(),1),this.cloudControllerUri=e[0],this.cloudController=new tp(this._appkey,this.logger,this.reporter),this.cloudControllerUri&&this.cloudController.request(this.cloudControllerUri,dn.init)},n.prototype.onConnected=function(){var e,t=this.navi.getNaviInfoFromCache(this._connMgr.getToken()),n=this._connMgr.getCurrentUserId();this.currentUserId=n,this._pullOfflineFinished=!1,this._EventChangeManager||(this._EventChangeManager=new Su(this._connMgr,this.currentUserId,this.logger,this._appkey,this._handleEventChangeList.bind(this))),this._joinedChrmManager||(this._joinedChrmManager=new pu(t.joinMChrm)),this._conversationManager||(this._conversationManager=new nu(this,this._appkey,this.currentUserId,this._watcher.conversation,this._watcher.conversationTag,xa(t))),this._ultraGroupManager||(this._ultraGroupManager=new uu(this._appkey,this.currentUserId)),this._userSettingManager||(this._userSettingManager=new hu(this,this._appkey,this.currentUserId,this._watcher.tag)),this._readReceiptManager||(this._readReceiptManager=new Ru(this._appkey,this.currentUserId,this._connMgr.getDelayTime())),this._initSubscribeManager(t),this._conversationManager.startPullConversationStatus(0),this._conversationManager.adaptOldStore(),this._userSettingManager.pullUserSettings(0),this._sendMessageStore.init(this.currentUserId),this._rejoinChrm(),this._startSyncInterval(),this._openCallPlus&&this._syncCallPullKVMsg(),1===t.ugMsg&&this._notificationOnline(),1&~(t.eventDriven||0)||null===(e=this._EventChangeManager)||void 0===e||e.notificationOnline(),this._watcher.onConnected(),this.reporter.checkStart(t),this.reporterStatistic.checkStart(t)},n.prototype.onDisconnected=function(e){var t,n,r;this._resetMemoryState(),null===(t=this._userSettingManager)||void 0===t||t.stopAllTask(),null===(n=this._conversationManager)||void 0===n||n.stopAllTask(),null===(r=this._EventChangeManager)||void 0===r||r.stopAllTask(),this._watcher.onDisconnected(e)},n.prototype.onSuspend=function(e){var t,n,r;null===(t=this._userSettingManager)||void 0===t||t.stopAllTask(),null===(n=this._conversationManager)||void 0===n||n.stopAllTask(),null===(r=this._EventChangeManager)||void 0===r||r.stopAllTask(),this._watcher.onSuspend(e)},n.prototype._initSubscribeManager=function(e){var t=this;(e.subDriven||e.userProfile)&&(this._subscribeManager||(this._subscribeManager=new vu(this._connMgr,{syncSubscribeUserStatusFinished:function(e){var n,r;null===(r=(n=t._watcher).syncSubscribedUserStatusFinished)||void 0===r||r.call(n,e)},subscribeUserStatusChanged:function(e){var n,r;null===(r=(n=t._watcher).subscribedUserStatusChange)||void 0===r||r.call(n,e)},subscribeRelationChanged:function(e){var n,r;null===(r=(n=t._watcher).subscribedRelationChange)||void 0===r||r.call(n,e)},ownUserProfileChanged:function(e){var n,r;null===(r=(n=t._watcher).ownUserProfileChanged)||void 0===r||r.call(n,e)}},this.currentUserId,this._connMgr.getDelayTime(),this.logger,!!e.userProfile,e.subDriven||0)),this._subscribeManager.syncData())},n.prototype.createLogger=function(e,t){return new vp(this._appkey,e,t)},n.prototype.refetchNaviInfo=function(){return this.navi.request(this._connMgr.getToken(),!0,!0,this.logger.createTraceId())},n.prototype.getNaviInfoFromCache=function(){return this.navi.getNaviInfoFromCache(this._connMgr.getToken())},n.prototype.getConnectedTime=function(){return this._connMgr.getConnectedTime()},n.prototype.getConnectionStatus=function(){return this._connMgr.getConnectionStatus()},n.prototype.connect=function(e,t,n,r){return ue(this,void 0,void 0,(function(){return ce(this,(function(o){return this._openCallPlus=n,[2,this._connMgr.connect(e,t,n,r)]}))}))},n.prototype._signalHandler=function(e,t){var n,r=e.syncMsg,o=e.topic;if(r)this._receiveSyncMsg(e,t);else{var i=this.logger.createTraceId();this.logger.debug(exports.LogTagId.L_RECV_RMTP_O,o,i);var s=gs(o);if(s)switch(s){case as.s_ntf:this._pullMsg(e);break;case as.s_msg:this._receiveMsg(e);break;case as.s_cmd:this._receiveStateNotify(e);break;case as.s_us:this._receiveSettingNotify(e);break;case as.rtc_ntf:this._receiveRtcKv(e.pbData);break;case as.s_opNtf:this._pullOperateStatusNotify(e);break;case as.s_pubCall:this._pubCallInfo(e);break;case as.s_stat:null===(n=this._subscribeManager)||void 0===n||n.updateUserStatus(e)}else this.logger.error(exports.LogTagId.L_RECV_RMTP_E,o,i)}},n.prototype._receiveStateNotify=function(e){var t,n,r,o=this._connMgr.codec.decodeByPBName(e.pbData,Nr),i=o.time,s=o.type,a=o.chrmId;switch(s){case 2:if(!this._chrmsQueue[a])return;this._chrmEntryHandler.pullEntry(a,i);break;case 3:this._conversationManager.startPullConversationStatus(i);break;case 4:this._chrmEntryHandler.reset(a),this._watcher.chatroom({chatroomDestroyed:e.targetId});break;case 6:this._ultraGroupTimeQue.push(i),this._syncUltraMsg(this._lastSyncUltraMsgTimeStamp);break;case 7:this._pullUltraChangeMessageQue.push(i),this._pullUltraChangeMessageList(this._lastPullingUltraChangeMessageTime);break;case 8:null===(t=this._subscribeManager)||void 0===t||t.startsyncSubscribeUserStatus(i);break;case 9:null===(n=this._subscribeManager)||void 0===n||n.startSyncSubscribeRelationship(i);break;case 10:null===(r=this._subscribeManager)||void 0===r||r.syncOwnProfile(!0);break;case 11:this._EventChangeManager.startPullEventChange(i)}},n.prototype._receiveSettingNotify=function(e){var t=this._connMgr.codec.decodeByPBName(e.pbData,Po).version;this._userSettingManager.pullUserSettings(t)},n.prototype._receiveMessageExpansion=function(e){var t=e.content,n=e.channelId,r=void 0===n?"":n,o=e.conversationType,i=e.targetId,s=t.put,a=t.del,u=t.mid;s&&this._watcher.expansion({updatedExpansion:{messageUId:u,expansion:s,channelId:r,conversationType:o,targetId:i}}),a&&this._watcher.expansion({deletedExpansion:{messageUId:u,deletedKeys:a,channelId:r,conversationType:o,targetId:i}})},n.prototype._clearUltraGroupUnreadCount=function(e,t){var n=this._connMgr.codec.decodeByPBName(e.pbData,$r),r=n.targetId,o=n.channelId,i=n.timestamp,s=this._ultraGroupMap["".concat(o,"_").concat(r)];s&&(s.unreadMessageCount=0,s.unreadMentionedCount=0,s.unreadMentionedMeCount=0,s.firstUnreadMessage&&(s.firstUnreadMessage=null),s.lastReadTime=i,this._watcher.conversation(Lt([s]))),t&&(this._ultraMsgMap[t.messageUId]=t.timestamp)},n.prototype._receiveSyncMsg=function(e,t){var n,r=this,o=gs(e.topic),i=((n={})[as.ugMsg]=function(){r._ultraGroupTimeQue.push(t.timestamp),r._syncUltraMsg(r._lastSyncUltraMsgTimeStamp)},n[as.updRTime]=function(){r._receivesyncReadStatus(e)},n[as.updUgRTime]=function(){r._clearUltraGroupUnreadCount(e,t)},n[as.updUserSub]=function(){var e;null===(e=r._subscribeManager)||void 0===e||e.startSyncSubscribeRelationship(t.timestamp)},n);if(i[o])i[o]();else if([as.recallMsg,as.ppMsgS,as.pgMsgS,as.ppMsgP,as.pgMsgP,as.chatMsg,as.pcMsgP,as.prMsgS,as.pbMsgP].includes(o)){var s=this._connMgr.codec.decodeByPBName(e.pbData,Mr,{currentUserId:this.currentUserId,signal:e});((s=this._handleMsgProperties(s)).conversationType!==exports.ConversationType.CHATROOM||this._chrmsQueue[s.targetId])&&(this._pullingMsg?this._pullQueue.push((null==t?void 0:t.timestamp)||s.sentTime):(t&&(s.sentTime=t.timestamp,s.messageUId=t.messageUId,this._sendMessageStore.setMessage(t.messageUId,t.timestamp)),this.logger.info(exports.LogTagId.L_RECV_MULTI_SYNC_MSG_O,JSON.stringify({messageUId:s.messageUId,messgeId:s.messageId,sentTime:s.sentTime})),s.messageType!==exports.MessageType.EXPANSION_NOTIFY?((s.messageType===exports.MessageType.SYNC_READ_STATUS||s.messageType===exports.MessageType.READ_RECEIPT&&s.senderUserId===this.currentUserId)&&this._conversationManager.clearUnreadCount(s.conversationType,s.targetId,s.channelId,s.sentTime),s.messageType===exports.MessageType.READ_RECEIPT_REQUEST&&this._processRRReqMsg(s),s.messageType===exports.MessageType.READ_RECEIPT_RESPONSE&&this._processRRRspMsg(s),this._conversationManager.setConversationCacheByMessage(s,!0),this._batchMessage([s])):this._receiveMessageExpansion(s)))}},n.prototype._batchMessage=function(e){for(var t=this,n=[],r=[],o=[],i=e.length-1;i>=0;i-=1){var s=e[i];s.messageType===exports.MessageType.LOG_COMMAND&&s.senderUserId===Pe?r.unshift(s):s.messageType===exports.MessageType.CLOUD_CONTROL&&s.senderUserId===Pe?o.push(s):n.unshift(s)}this._watcher.batchMessage(n),r.forEach((function(e){var n=e.content,r=n.startTime,o=n.endTime,i=n.platform,s=n.logId,a=n.uri;t.reporter.report(parseInt(r,10),parseInt(o,10),i,a,s,e.messageUId)})),o.length>0&&this._ccMsgHandler(o)},n.prototype._ccMsgHandler=function(e){var t;return ue(this,void 0,void 0,(function(){var n,r,o;return ce(this,(function(i){switch(i.label){case 0:return e.shift()?(n=this._connMgr.getToken(),[4,null===(t=this.cloudController)||void 0===t?void 0:t.request(this.cloudControllerUri,dn.other,n)]):[3,2];case 1:r=i.sent()||0,(o=e.filter((function(e){return e.sentTime>r}))).length>0&&this._ccMsgHandler(o),i.label=2;case 2:return[2]}}))}))},n.prototype._pubCallInfo=function(e){var t=this._connMgr.codec.decodeByPBName(e.pbData,Wo),n=t.key,r=t.dataContent,o=t.maxTime;this._latestPullKVMsgTimestamp=o,this._watcher.callInfo(JSON.stringify({list:[{key:n,value:r}]}))},n.prototype._pullMsg=function(e){var t=this._connMgr.codec.decodeByPBName(e.pbData,Nr),n=t.type,r=t.chrmId,o=t.time;if(this.logger.info(exports.LogTagId.L_RECV_S_NTF_O,"type: ".concat(n,", chrmId: ").concat(n,", time: ").concat(o)),2===n){var i=this._chrmsQueue[r];if(!i)return;i.queue.push(o),this._pullChrmMsg(r)}else this._pullQueue.push(o),this._syncMsg()},n.prototype._receivesyncReadStatus=function(e){var t=this._connMgr.codec.decodeByPBName(e.pbData,$r),n=t.conversationType,r=t.targetId,o=t.channelId,i=t.timestamp,s=t.sentTime;this._conversationManager.clearUnreadCount(n,r,o,s),this._watcher.syncReadStatus({conversationType:n,targetId:r,channelId:o,timestamp:i})},n.prototype._startSyncInterval=function(){var e=this;this._stopSyncInterval();this._intervalTimer=setInterval((function(){Date.now()-e._latestSyncTimestamp>=18e4&&e._syncMsg()}),3e4),this._latestSyncTimestamp=Date.now(),this._syncMsg()},n.prototype._stopSyncInterval=function(){-1!==this._intervalTimer&&(clearInterval(this._intervalTimer),this._intervalTimer=-1)},n.prototype._syncCallPullKVMsg=function(){return ue(this,void 0,void 0,(function(){var e,t,n,r,o;return ce(this,(function(i){switch(i.label){case 0:return this._isConnected?(e=this._connMgr.codec.encodePullKVMsg(this._latestPullKVMsgTimestamp),t=new la(as.pullKvMsg,e,this.currentUserId),[4,this._connMgr.send(t,Jo)]):[2];case 1:return n=i.sent(),r=n.code,o=n.data,r===exports.ErrorCode.SUCCESS&&o?(this._latestPullKVMsgTimestamp=o.maxTime,this._watcher.callInfo(JSON.stringify({list:o.info})),[2]):[2]}}))}))},Object.defineProperty(n.prototype,"_isConnected",{get:function(){return this._connMgr.getConnectionStatus()===exports.RCConnectionStatus.CONNECTED},enumerable:!1,configurable:!0}),n.prototype._filterMessage=function(e){var t=e.messageType;return t===exports.MessageType.DELIVERED||t===exports.MessageType.DELIVERED_MSG||t===exports.MessageType.SYNC_READ_STATUS&&!this._processSRSMsg(e)},n.prototype._messageProcessor=function(e){var t=this,n=0,r=[],o=[],i=[],s=[],a=[];return e.forEach((function(e){var u=e.conversationType,c=e.targetId,l=e.channelId,d=e.messageDirection,p=e.messageUId,h=e.messageType,_=e.sentTime,g=e.senderUserId,f=e.content;if(r.push(p),d===exports.MessageDirection.SEND){n=Math.max(_,n);var E=t._sendMessageStore.getSendMessageMap(),I=h===exports.MessageType.RECALL?"Cmd:".concat(f.messageUId):p;if(E[I])return void t._sendMessageStore.removeByUID(I)}if(!t._filterMessage(e))if(h!==exports.MessageType.EXPANSION_NOTIFY)if(_>=t._connMgr.getConnectedTime()&&t._writeMessagesLog(u,p)&&a.push(p),h===exports.MessageType.READ_RECEIPT&&g===t.currentUserId&&t._conversationManager.clearUnreadCount(u,c,l,_),h!==exports.MessageType.READ_STATE){h===exports.MessageType.READ_RECEIPT_REQUEST&&t._processRRReqMsg(e),h===exports.MessageType.READ_RECEIPT_RESPONSE&&t._processRRRspMsg(e);var T=t._handleMsgProperties(e);t._conversationManager.setConversationCacheByMessage(T,!0),o.push(T)}else s.push(e);else i.push(e)})),{newOutboxTime:n,messageUIds:r,messages:o,messageExpansionList:i,RSMsgList:s,msgUIds2Statistic:a}},n.prototype._processSRSMsg=function(e){var t=e.conversationType,n=e.targetId,r=e.channelId,o=e.content,i=e.senderUserId,s=e.sentTime;if(i!==this.currentUserId)return!1;var a=this.getNaviInfoFromCache();return this._conversationManager.clearUnreadCount(t,n,r,s),1!==a.sesDriven||(s>this.getConnectedTime()||this._watcher.syncReadStatus({conversationType:t,targetId:n,channelId:r,timestamp:o.lastMessageSendTime}),!1)},n.prototype._processRSMsg=function(e){var t=e.conversationType,n=e.targetId,r=e.channelId,o=e.content,i={conversationType:t,targetId:n,channelId:r};this._watcher.messageReadReceipt(t===exports.ConversationType.PRIVATE?{privateReadReceipt:se(se({},i),{endMsgTime:o.endMsgTime})}:{groupReadReceipt:se(se({},i),{totalCount:o.tmn,readedCount:o.rrn,messageUId:o.msgId})})},n.prototype._processRRReqMsg=function(e){var t,n=e.conversationType,r=e.channelId,o=e.targetId,i=e.content,s=e.sentTime,a=e.messageDirection,u=e.senderUserId;null===(t=this._readReceiptManager)||void 0===t||t.insert({conversationType:n,channelId:r,targetId:o},i.messageUId,a,s,u)},n.prototype._processRRRspMsg=function(e){var t,n,r,o=this,i=e.conversationType,s=e.channelId,a=e.targetId,u=e.content,c=e.senderUserId,l=u.receiptMessageDic,d=void 0===l?{}:l;if(c===this.currentUserId)for(var p in d){var h=d[p];try{for(var _=(t=void 0,le(h)),g=_.next();!g.done;g=_.next()){var f=g.value;null===(r=this._readReceiptManager)||void 0===r||r.remove({conversationType:i,channelId:s,targetId:a},f)}}catch(e){t={error:e}}finally{try{g&&!g.done&&(n=_.return)&&n.call(_)}finally{if(t)throw t.error}}}else(d[this.currentUserId]||[]).forEach((function(e){var t;null===(t=o._readReceiptManager)||void 0===t||t.addReadedUser({conversationType:i,channelId:s,targetId:a},e,c)}))},n.prototype._syncMsg=function(){return ue(this,void 0,void 0,(function(){var e,t,n,r,o,i,s,a,u,c,l,d,p,h,_,g,f,E,I,T,C,v,R,y=this;return ce(this,(function(m){switch(m.label){case 0:return this._pullingMsg?[2]:this._isConnected?(this._pullingMsg=!0,e=this._letterbox.getOutboxTime(this.currentUserId),t=this._letterbox.getInboxTime(this.currentUserId),n=this._letterbox.getBroadcastSyncTime(this.currentUserId),r=Xi.encode(Or,{ispolling:!1,isPullSend:!0,sendBoxSyncTime:e,syncTime:t,broadcastSyncTime:n,compressioEnabled:Da.enable()}),o=new la(as.pullMsg,r,this.currentUserId),i=this.logger.createTraceId(),this.logger.info(exports.LogTagId.L_PULL_MSG_T,JSON.stringify({outboxTime:e,inboxTime:t,broadcastSyncTime:n}),i),[4,this._connMgr.send(o,Ur,{connectedTime:this._connMgr.getConnectedTime(),currentUserId:this.currentUserId,customMessageTypes:this._customMessageType})]):(this._pullingMsg=!1,[2]);case 1:if(s=m.sent(),a=s.code,u=s.data,this._latestSyncTimestamp=Date.now(),this._pullingMsg=!1,a!==exports.ErrorCode.SUCCESS||!u||Et(u.finished)||Et(u.list)||Et(u.syncTime))return this.logger.warn(exports.LogTagId.L_PULL_MSG_R,JSON.stringify({code:a,timestamp:this._latestSyncTimestamp}),i),[2];c=u.list,l=u.finished,d=u.syncTime,p=u.broadcastSyncTime,h=void 0===p?1:p,this.logger.info(exports.LogTagId.L_PULL_MSG_R,JSON.stringify({syncTime:d,finished:l,messages:c.map((function(e){return{messageUId:e.messageUId,messageId:e.messageId,sentTime:e.sentTime}}))}),i);try{if(_=this._messageProcessor(c),g=_.newOutboxTime,f=_.messageUIds,E=_.messages,I=_.messageExpansionList,T=_.RSMsgList,(C=_.msgUIds2Statistic).length>0&&this.logger.record(re.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:C.join(",")})),this._batchMessage(E),I.forEach((function(e){y._receiveMessageExpansion(e)})),T.forEach((function(e){y._processRSMsg(e)})),this._letterbox.setInboxTime(d,this.currentUserId),this._letterbox.setOutboxTime(g,this.currentUserId),this._letterbox.setBroadcastSyncTime(h,this.currentUserId),this._sendMessageStore.removeByTimestamp(g),v=this._pullQueue.filter((function(e){return e>d})),this._pullQueue.length=0,(R=this._pullQueue).push.apply(R,pe([],de(v),!1)),l&&!this._pullOfflineFinished&&(this._pullOfflineFinished=!0,this._watcher.pullFinished()),this.logger.info(exports.LogTagId.L_PULL_MSG_R,JSON.stringify({code:a,messageUIds:f.join(","),timestamp:this._latestSyncTimestamp,hasmore:!l,tmpPullQueue:v}),i),!l)return this._syncMsg(),[2];this._pullQueue.length>0&&(this._pullQueue.length=0,this._syncMsg())}catch(e){this.logger.error(exports.LogTagId.L_PULL_MSG_E,null==e?void 0:e.stack,i)}return[2]}}))}))},n.prototype._receiveMsg=function(e){if(this._isConnected){var t=this._connMgr.codec.decodeByPBName(e.pbData,br,{currentUserId:this.currentUserId,connectedTime:this._connMgr.getConnectedTime()}),n=(t=this._handleMsgProperties(t)).conversationType,r=t.messageType,o=t.senderUserId,i=t.messageUId,s=t.sentTime,a=t.isStatusMessage;if(this.logger.info(exports.LogTagId.L_RECV_S_MSG_O,JSON.stringify({messageUId:t.messageUId,messgeId:t.messageId,sentTime:t.sentTime})),this._writeMessagesLog(n,i)&&this.logger.record(re.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:i})),n!==exports.ConversationType.RTC_ROOM&&r!==exports.MessageType.INTERCEPT){if(this._pullingMsg)return;if(this._pullQueue.length>0)return void this._syncMsg()}o===this.currentUserId&&this._sendMessageStore.setMessage(i,s),a||o===this.currentUserId||this._letterbox.setInboxTime(s,this.currentUserId),this._handleNotNotifyMsg(t)||(r===exports.MessageType.READ_RECEIPT_REQUEST&&this._processRRReqMsg(t),r===exports.MessageType.READ_RECEIPT_RESPONSE&&this._processRRRspMsg(t),this._conversationManager.setConversationCacheByMessage(t,!0),this._batchMessage([t]))}},n.prototype._handleNotNotifyMsg=function(e){var t=e.messageType,n=e.senderUserId;return t===exports.MessageType.DELIVERED||(t===exports.MessageType.DELIVERED_MSG||(t===exports.MessageType.EXPANSION_NOTIFY?(this._receiveMessageExpansion(e),!0):t===exports.MessageType.SYNC_READ_STATUS&&n!==this.currentUserId||t===exports.MessageType.READ_STATE&&(this._processRSMsg(e),!0)))},n.prototype._handleMsgProperties=function(e,t){void 0===t&&(t=!1);var n,r=e.messageType,o=e.isStatusMessage,i=e.isCounted,s=void 0!==i&&i,a=e.isPersited,u=void 0!==a&&a,c=r in Ue,l=r in this._customMessageType;if(n=c?se(se({},Ue[r]),{isStatusMessage:Dp.includes(r)}):l?this._customMessageType[r]:{isCounted:s,isPersited:u,isStatusMessage:!1},Object.assign(e,n),t&&!Et(o)&&(e.isStatusMessage=o),!t){var d=e.content.user;if(d){var p=d.portrait,h=d.portraitUri,_=p||h;_&&(d.portrait=d.portraitUri=_)}}return e},n.prototype._fixDownstreamData=function(e,t,n){return e&&2===t.list.length&&(t.hasMore=!0,0===n?t.list.shift():t.list.pop()),t},n.prototype.getHistoryMessage=function(e,t,n,r,o,i,s,a){var u;return void 0===i&&(i=""),ue(this,void 0,void 0,(function(){var s,c,l,d,p,h,_,g,f,E,I,T=this;return ce(this,(function(C){switch(C.label){case 0:return c=(s=this).currentUserId,l=s._connMgr,d=Lp[e]||as.qryPMsg,p=1===r&&0===n,l?(h=l.codec.encodeGetHistoryMsg(t,{timestamp:n,count:p?2:r,order:o,channelId:i}),this.logger.info(exports.LogTagId.L_GET_HISTORY_MSG_T,JSON.stringify({targetId:t,conversationType:e,channelId:i,timestamp:n,count:r,order:o}),a),[4,l.send(new la(d,h,c),zr,{currentUserId:c,connectedTime:l.getConnectedTime(),conversation:{targetId:t},afterDecode:function(n){var r,o=null===(r=T._readReceiptManager)||void 0===r?void 0:r.getReadReceiptInfo({conversationType:e,channelId:i,targetId:t},n.messageUId);if(o){var s=o.users;n.readReceiptInfo={isReceiptRequestMessage:!0,readerList:s}}return n}})]):[3,2];case 1:return _=C.sent(),g=_.code,f=_.data,g===exports.ErrorCode.SUCCESS&&f?(E=this._fixDownstreamData(p,f,o),I=[],null===(u=E.list)||void 0===u||u.forEach((function(e){e&&I.push(e.messageUId)})),this.logger.info(exports.LogTagId.L_GET_HISTORY_MSG_R,JSON.stringify({code:g,messageUIds:I.join(",")}),a),[2,{code:g,data:{list:E.list,hasMore:E.hasMore}}]):(this.logger.warn(exports.LogTagId.L_GET_HISTORY_MSG_R,JSON.stringify({code:g,messageUIds:""}),a),[2,{code:g}]);case 2:return[2,{code:exports.ErrorCode.RC_NET_CHANNEL_INVALID}]}}))}))},n.prototype.getMessages=function(e,t,n,r,o,i,s){return this.getHistoryMessage(e,t,n,r,o,i,s)},n.prototype.reportSDKInfo=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a,u;return ce(this,(function(c){switch(c.label){case 0:return this._isConnected?(n=(t=this).currentUserId,r=t._connMgr,o=this.logger.createTraceId(),i=JSON.stringify(e),this.logger.debug(exports.LogTagId.L_VER_REPORT_T,i,o),s=r.codec.encodeReportSDKInfo(i),a=new la(as[as.reportsdk],s,n),[4,r.send(a)]):[2];case 1:return(u=c.sent().code)!==exports.ErrorCode.SUCCESS&&this.logger.warn(exports.LogTagId.L_VER_REPORT_R,u,o),[2]}}))}))},n.prototype.deleteRemoteMessage=function(e,t,n,r){return ue(this,void 0,void 0,(function(){var o,i,s,a,u,c,l;return ce(this,(function(d){switch(d.label){case 0:return this._isConnected?(i=(o=this).currentUserId,s=o._connMgr,a=s.codec.encodeDeleteMessages(e,t,n,r),u=as.delMsg,e===exports.ConversationType.ULTRA_GROUP&&(u=as.delUgMsg),c=new la(u,a,i),[4,s.send(c)]):[2,exports.ErrorCode.RC_NET_UNAVAILABLE];case 1:return l=d.sent(),[2,l.code]}}))}))},n.prototype.deleteRemoteMessageByTimestamp=function(e,t,n,r){return ue(this,void 0,void 0,(function(){var o,i,s,a,u,c,l;return ce(this,(function(d){switch(d.label){case 0:return this._isConnected?(i=(o=this).currentUserId,s=o._connMgr,a=s.codec.encodeClearMessages(t,n,r,e),u=Up[e],c=new la(u,a,i),[4,s.send(c)]):[2,exports.ErrorCode.RC_NET_UNAVAILABLE];case 1:return l=d.sent(),[2,l.code]}}))}))},n.prototype.batchClearRemoteHistoryMessages=function(e,t){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s;return ce(this,(function(a){switch(a.label){case 0:return this._isConnected?(n=(t=this).currentUserId,r=t._connMgr,o=r.codec.encodeBatchClearRemoteMessages(e),i=new la(as.cleanMsgBatch,o,n),[4,r.send(i)]):[2,exports.ErrorCode.RC_NET_UNAVAILABLE];case 1:return s=a.sent(),[2,s.code]}}))}))},n.prototype.getConversationList=function(e,t,n,r,o){return void 0===e&&(e=300),ue(this,void 0,void 0,(function(){var o,i,s,a,u,c,l,d,p=this;return ce(this,(function(h){switch(h.label){case 0:return this._isConnected?(i=(o=this).currentUserId,s=o._connMgr,t=t||exports.ConversationType.PRIVATE,a=s.codec.encodeOldConversationList({count:e,type:t,startTime:n,order:r}),u=new la(as.qryRelationR,a,i),[4,s.send(u,Hr,{currentUserId:i,connectedTime:s.getConnectedTime(),afterDecode:function(e){var t=e.conversationType,n=e.targetId,r=e.channelId,o=p._conversationManager.get(t,n,r);Object.assign(e,o);var i=p._conversationManager.getDraft(t,n,r);return e.draft=i,e}})]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return c=h.sent(),l=c.code,d=c.data,l!==exports.ErrorCode.SUCCESS?[2,{code:l}]:[2,{code:l,data:null==d?void 0:d.list}]}}))}))},n.prototype.removeConversation=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o,i;return ce(this,(function(s){switch(s.label){case 0:return this._isConnected?(r=this._connMgr,o=r.codec.encodeRemoveOldConversationList({conversationType:e,channelId:n,targetId:t}),i=new la(as.delRelation,o,t),[4,r.send(i)]):[2,exports.ErrorCode.RC_NET_UNAVAILABLE];case 1:return[2,s.sent().code]}}))}))},n.prototype.batchRemoveConversation=function(e){return ue(this,void 0,void 0,(function(){var t,n,r;return ce(this,(function(o){switch(o.label){case 0:return this._isConnected?(t=this._connMgr,n=t.codec.encodeBatchDeleteConversation(e),r=new la(as.delRelationBatch,n,this.getCurrentUserId()),[4,t.send(r)]):[2,exports.ErrorCode.RC_NET_UNAVAILABLE];case 1:return[2,o.sent().code]}}))}))},n.prototype.getConversation=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o,i,s,a,u,c;return ce(this,(function(l){switch(l.label){case 0:return e!==exports.ConversationType.ULTRA_GROUP?[3,1]:(r=this._ultraGroupMap["".concat(n,"_").concat(t)])?[3,3]:[2,{code:exports.ErrorCode.CONVER_GET_ERROR}];case 1:return(o=this._conversationManager.get(e,t,n))?[4,this.getHistoryMessage(e,t,0,1,0)]:[2,{code:exports.ErrorCode.CONVER_GET_ERROR}];case 2:if(i=l.sent(),s=i.code,a=i.data,s!==exports.ErrorCode.SUCCESS)return[2,{code:exports.ErrorCode.CONVER_GET_ERROR}];u=this._conversationManager.getDraft(e,t,n),c=(null==a?void 0:a.list[0])||null,r={conversationType:e,targetId:t,channelId:n,unreadMessageCount:o.unreadMessageCount||0,latestMessage:c,notificationStatus:o.notificationStatus||exports.NotificationStatus.CLOSE,notificationLevel:o.notificationLevel||exports.NotificationLevel.NOT_SET,isTop:o.isTop||!1,lastUnreadTime:o.lastUnreadTime||0,unreadMentionedCount:o.unreadMentionedCount||0,draft:u},l.label=3;case 3:return[2,{code:exports.ErrorCode.SUCCESS,data:r}]}}))}))},n.prototype.getAllConversationUnreadCount=function(e,t,n){var r=this._conversationManager.getAllUnreadCount(e,t,n);return Promise.resolve({code:exports.ErrorCode.SUCCESS,data:r})},n.prototype.getTotalUnreadCountByLevels=function(e,t,n){void 0===n&&(n=!1);var r=0;if(e.includes(exports.ConversationType.ULTRA_GROUP)){if(!this._isUltraGroupListExist)return Promise.resolve({code:exports.ErrorCode.METHOD_NOT_AVAILABLE});for(var o in this._ultraGroupMap){var i=this._ultraGroupMap[o];(0===t.length||t.includes(i.notificationLevel))&&(r+=n?i.unreadMentionedCount:i.unreadMessageCount)}}return r+=this._conversationManager.getTotalUnreadCountByLevels(e,t,n),Promise.resolve({code:exports.ErrorCode.SUCCESS,data:r})},n.prototype.getConversationUnreadCount=function(e,t,n){var r,o;return e===exports.ConversationType.ULTRA_GROUP?(o=(null===(r=this._ultraGroupMap["".concat(n,"_").concat(t)])||void 0===r?void 0:r.unreadMessageCount)||0,o=this._getUnreadCount(o)):o=this._conversationManager.getUnreadCount(e,t,n),Promise.resolve({code:exports.ErrorCode.SUCCESS,data:o})},n.prototype.clearConversationUnreadCount=function(e,t,n){return this._conversationManager.clearUnreadCount(e,t,n,this.getServerTime(),!1),Promise.resolve(exports.ErrorCode.SUCCESS)},n.prototype.clearAllUnreadCount=function(){return this._conversationManager.clearAllUnreadCount(),Promise.resolve(exports.ErrorCode.SUCCESS)},n.prototype.getFirstUnreadMessage=function(e,t){throw new Error("Method not implemented.")},n.prototype.getFirstUnreadMessageInfo=function(e,t,n){var r=this._conversationManager.get(e,t,n),o=r.firstUnreadMessageUid,i=r.firstUnreadTime;return Promise.resolve({code:exports.ErrorCode.SUCCESS,data:i&&o?{messageUId:o,sentTime:i}:null})},n.prototype.saveConversationMessageDraft=function(e,t,n,r){return this._conversationManager.setDraft(e,t,n,r),Promise.resolve(exports.ErrorCode.SUCCESS)},n.prototype.getConversationMessageDraft=function(e,t,n){var r=this._conversationManager.getDraft(e,t,n);return Promise.resolve({code:exports.ErrorCode.SUCCESS,data:r})},n.prototype.clearConversationMessageDraft=function(e,t,n){return this._conversationManager.clearDraft(e,t,n),Promise.resolve(exports.ErrorCode.SUCCESS)},n.prototype.pullConversationStatus=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s=this;return ce(this,(function(a){switch(a.label){case 0:return this._isConnected?(n=(t=this)._connMgr,r=t.currentUserId,o=Xi.encode(fo,{time:e}),[4,n.query(as.pullSeAtts,r,o,Eo)]):[2,st(exports.ErrorCode.RC_NET_UNAVAILABLE)];case 1:return i=a.sent(),this.logger.info(exports.LogTagId.L_PULL_CONVERSATION_S,JSON.stringify({timestamp:e,userId:r,resp:i})),[2,i.trans((function(e){var t=e.state;e.version;var n=[];return t.forEach((function(e){var t=e.stateItem,r=e.channelId,o=e.type,i=e.busChannel,a=e.time,u={conversationType:o,targetId:r,channelId:i,updatedTime:a};null==t||t.forEach((function(e){var t=e.sessionStateType,n=e.value,r=e.tags;switch(t){case Ar.IsSilent:u.notificationLevel=Number(n)||exports.NotificationLevel.NOT_SET,u.notificationStatus=u.notificationLevel?exports.NotificationStatus.OPEN:exports.NotificationStatus.CLOSE;break;case Ar.IsTop:u.isTop="1"===n;break;case Ar.Tags:u.tags=r}u.updatedTime=a})),a&&s._conversationManager.setConversationUpdatedTime(a),o===exports.ConversationType.ULTRA_GROUP?s._setUltraConversationStatus(u):n.push(u)})),n}))]}}))}))},n.prototype._setUltraConversationStatus=function(e){var t=e.targetId,n=e.notificationLevel,r=e.channelId,o=e.isTop,i=e.conversationType;if(""!==t||void 0===n){var s=this._ultraGroupMap["".concat(r,"_").concat(t)];return s&&void 0!==n&&(s.notificationLevel=n,s.notificationStatus=Ae(n),this._ultraGroupManager.addUltraGroupStatus(s)),s&&void 0!==o&&(s.isTop=o),s}this._ultraGroupManager.addUltraGroupStatus({conversationType:i,targetId:"",channelId:"",notificationLevel:n,notificationStatus:Ae(n)})},n.prototype.batchSetConversationStatus=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o=this;return ce(this,(function(i){switch(i.label){case 0:return this._isConnected?(n=(t=this).currentUserId,r=t._connMgr,[4,this._conversationManager.pushTask((function(t){return ue(o,void 0,void 0,(function(){var o,i,s,a,u,c,l,d,p=this;return ce(this,(function(h){switch(h.label){case 0:return o=r.codec.encodeSetConversationStatus(e,t),i=new la(as.setSeAtt,o,n),[4,r.send(i,mo)];case 1:return s=h.sent(),a=s.code,u=s.data,a!==exports.ErrorCode.SUCCESS?[2,{code:a}]:(c=u,this._conversationManager.setConversationUpdatedTime(c.version),l=[],e.forEach((function(e){if(e.conversationType!==exports.ConversationType.ULTRA_GROUP)p._conversationManager.addStatus(se(se({},e),{updatedTime:c.version}),!0);else{var t=p._setUltraConversationStatus(e);t&&l.push(t)}})),l.length>0&&(d=Lt(l),d=Pp(d),this._watcher.conversation(d)),[2,{code:a}])}}))}))}))]):[2,exports.ErrorCode.RC_NET_UNAVAILABLE];case 1:return[2,i.sent().code]}}))}))},n.prototype.setConversationToTop=function(e,t,n,r,o){return ue(this,void 0,void 0,(function(){return ce(this,(function(o){return[2,this.batchSetConversationStatus([{conversationType:e,targetId:t,isTop:n,channelId:r}])]}))}))},n.prototype.batchSetConversationToTop=function(e,t,n){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){return[2,this.batchSetConversationStatus(e.map((function(e){return se(se({},e),{isTop:t})})))]}))}))},n.prototype.setConversationNotificationLevel=function(e,t,n,r){return void 0===r&&(r=""),ue(this,void 0,void 0,(function(){return ce(this,(function(o){return[2,this.batchSetConversationStatus([{conversationType:e,targetId:t,notificationLevel:n,channelId:r}])]}))}))},n.prototype.batchSetConversationNotificationLevel=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){return[2,this.batchSetConversationStatus(e.map((function(e){return se(se({},e),{notificationLevel:t})})))]}))}))},n.prototype._joinChrm=function(e,t,n,r,o){return ue(this,void 0,void 0,(function(){var i,s,a,u,c,l,d,p,h,_,g,f,E,I,T,C;return ce(this,(function(v){switch(v.label){case 0:return this._isConnected?(i=this._connMgr,s=Xi.encode(Vr,{nothing:1,extra:r}),a=n?as.joinChrmR:as.joinChrm,u=new la(a,s,e),this.logger.info(exports.LogTagId.L_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t,topic:as[a]}),o),[4,i.send(u,Gr)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return c=v.sent(),l=c.code,d=c.data,p=l===exports.ErrorCode.SUCCESS?"info":"warn",this.logger[p](exports.LogTagId.L_JOIN_CHATROOM_R,JSON.stringify({code:l,timestamp:(new Date).getTime()}),o),l===exports.ErrorCode.SUCCESS?(_=(h=d).joinTime,g=h.createTime,f=h.memberCount,E=h.isAllChatroomBanned,I=h.isCurrentUserBanned,T=h.isCurrentChatroomBanned,C=h.isCurrentChatroomInWhitelist,this._chrmsQueue[e]||(this._chrmsQueue[e]={pulling:!1,queue:[],timestamp:0}),this._pullChrmMsg(e,t,_),this.getNaviInfoFromCache().kvStorage&&this._chrmEntryHandler.pullEntry(e,0),this._joinedChrmManager.set(e,t,r),this._startSyncIntervalForChrmPull(),[2,{code:l,data:{joinTime:_,createTime:g,memberCount:f,isAllChatroomBanned:E,isCurrentUserBanned:I,isCurrentChatroomBanned:T,isCurrentChatroomInWhitelist:C}}]):[2,{code:l}]}}))}))},n.prototype._rejoinChrm=function(){return ue(this,void 0,void 0,(function(){var e,t,n,r,o,i,s,a,u,c,l,d,p,h;return ce(this,(function(_){switch(_.label){case 0:for(n in e=this._joinedChrmManager.get(),t=[],e)t.push(n);r=0,_.label=1;case 1:return r<t.length?(o=t[r],i=e[o],s=i.count,a=void 0===s?10:s,u=i.extra,this.logger.info(exports.LogTagId.L_REJOIN_CHATROOM_T,JSON.stringify({chatroomId:o,count:a,extra:u})),c=this.logger.createTraceId(),[4,this._joinChrm(o,a,!0,u,c)]):[3,4];case 2:if(l=_.sent(),d=l.code,p=l.data,h=d===exports.ErrorCode.SUCCESS?"info":"warn",this.logger[h](exports.LogTagId.L_REJOIN_CHATROOM_R,JSON.stringify({code:d,timestamp:(new Date).getTime()}),c),d===exports.ErrorCode.SUCCESS)return this._watcher.chatroom({rejoinedRoom:se({chatroomId:o,count:a},p)}),[2];d===exports.ErrorCode.RC_CHATROOM_USER_KICKED&&(this._joinedChrmManager.remove(o),delete this._chrmsQueue[o]),this._watcher.chatroom({rejoinedRoom:{chatroomId:o,errorCode:d}}),_.label=3;case 3:return r++,[3,1];case 4:return[2]}}))}))},n.prototype._pullChrmMsg=function(e,t,n){return void 0===t&&(t=10),void 0===n&&(n=0),ue(this,void 0,void 0,(function(){var r,o,i,s,a,u,c,l,d,p,h,_,g,f,E,I=this;return ce(this,(function(T){switch(T.label){case 0:return this._isConnected?(r=this._chrmsQueue[e],o=r.pulling,i=r.timestamp,o?[2]:(r.pulling=!0,s=n?0:i,a=Xi.encode(kr,{count:t,syncTime:s,compressioEnabled:Da.enable()}),this.logger.info(exports.LogTagId.L_PULL_CHATROOM_MSG_T,JSON.stringify({chatroomId:e,syncTime:s})),u=new la(as[as.chrmPull],a,e),[4,this._connMgr.send(u,Ur,{connectedTime:this._connMgr.getConnectedTime(),currentUserId:this.currentUserId})])):[2];case 1:return c=T.sent(),l=c.code,d=c.data,r.pulling=!1,l===exports.ErrorCode.SUCCESS&&d?(p=d.list,h=d.syncTime,_=d.finished,r.timestamp=n?Math.max(h,n):h,r.queue=r.queue.filter((function(e){return e>h})),g=[],f=[],E=[],p.forEach((function(e){e.sentTime<i||(e.sentTime>=I._connMgr.getConnectedTime()&&I._writeMessagesLog(exports.ConversationType.CHATROOM,e.messageUId)&&f.push(e.messageUId),g.push(e.messageUId),E.push(e))})),this._batchMessage(E),this.logger.info(exports.LogTagId.L_PULL_CHATROOM_MSG_R,JSON.stringify({code:l,timestamp:i,messageUIds:g.join(",")})),f.length>0&&this.logger.record(re.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:f.join(",")})),_?(r.queue.length>0&&(r.queue.length=0,this._pullChrmMsg(e)),[2]):(this._pullChrmMsg(e),[2])):(this.logger.warn(exports.LogTagId.L_PULL_CHATROOM_MSG_R,JSON.stringify({code:l,timestamp:i,messageUIds:""})),[2])}}))}))},n.prototype.joinChatroom=function(e,t,n,r){return ue(this,void 0,void 0,(function(){return ce(this,(function(o){switch(o.label){case 0:return[4,this._joinChrm(e,t,!1,n,r)];case 1:return[2,o.sent().code]}}))}))},n.prototype.joinExistChatroom=function(e,t,n,r){return ue(this,void 0,void 0,(function(){return ce(this,(function(o){return[2,this._joinChrm(e,t,!0,n,r)]}))}))},n.prototype.quitChatroom=function(e){return ue(this,void 0,void 0,(function(){var t,n;return ce(this,(function(r){switch(r.label){case 0:return this._isConnected?(t=this._connMgr,delete this._chrmsQueue[e],this._chrmEntryHandler.reset(e),this._joinedChrmManager.remove(e),n=Xi.encode(Vr,{nothing:1}),[4,t.query(as.exitChrm,e,n)]):[2,exports.ErrorCode.RC_NET_UNAVAILABLE];case 1:return[2,r.sent().code]}}))}))},n.prototype.getChatroomInfo=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o,i,s,a,u;return ce(this,(function(c){switch(c.label){case 0:return this._isConnected?(r=this._connMgr,o=r.codec.encodeGetChatRoomInfo(t,n),i=new la(as[as.queryChrmI],o,e),[4,r.send(i,jr)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return s=c.sent(),a=s.code,u=s.data,a!==exports.ErrorCode.SUCCESS?[2,{code:a}]:[2,{code:a,data:u}]}}))}))},n.prototype.getChatroomHistoryMessages=function(e,t,n,r){return ue(this,void 0,void 0,(function(){var o,i,s,a,u,c;return ce(this,(function(l){switch(l.label){case 0:return this._isConnected?(o=this._connMgr,i=o.codec.encodeGetHistoryMsg(e,{timestamp:t,count:n,order:r}),s=new la(as.qryCHMsg,i,e),[4,o.send(s,zr,{conversation:{targetId:e}})]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return a=l.sent(),u=a.code,c=a.data,u!==exports.ErrorCode.SUCCESS?[2,{code:u}]:[2,{code:u,data:{list:c.list,hasMore:c.hasMore}}]}}))}))},n.prototype._modifyChatroomKV=function(e,t){return ue(this,void 0,void 0,(function(){var n,r,o,i,s,a,u,c,l;return ce(this,(function(d){switch(d.label){case 0:return this._isConnected?(r=(n=this)._connMgr,o=n.currentUserId,i=this._chrmEntryHandler.getVersion(e,t.key),t.version=null==i?this.getServerTime():i,s=r.codec.encodeModifyChatRoomKV(e,t,o),a=t.type===exports.ChatroomEntryType.UPDATE?as.setKV:as.delKV,u=new la(a,s,e),[4,r.send(u,Gr)]):[2,exports.ErrorCode.RC_NET_UNAVAILABLE];case 1:return c=d.sent(),(l=c.code)===exports.ErrorCode.SUCCESS?(this._chrmEntryHandler.setLocal(e,{kvEntries:[t],syncTime:this.getServerTime()},o),[2,l]):[2,l]}}))}))},n.prototype._chatroomKVStoreNotAllSuccess=function(e,t){var n=t.data,r=e;return n&&Array.isArray(n.errorKeys)&&n.errorKeys.forEach((function(e){var t=r.findIndex((function(t){return e.key===t.key}));-1!==t&&r.splice(t,1)})),r},n.prototype._modifyChatroomKVS=function(e,t){return ue(this,void 0,void 0,(function(){var n,r,o,i,s,a,u,c,l,d,p,h,_=this;return ce(this,(function(g){switch(g.label){case 0:return this._isConnected?(r=(n=this)._connMgr,o=n.currentUserId,t.entries.forEach((function(t){var n=_._chrmEntryHandler.getVersion(e,t.key);t.version=null==n?_.getServerTime():n})),i=r.codec.encodeModifyChatRoomKVS(e,t,o),s=t.type===exports.ChatroomEntryType.UPDATE?as.setKVS:as.delKVS,a=new la(s,i,e),[4,r.send(a,lo)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return u=g.sent(),c=u.code,-1!==[exports.ErrorCode.SUCCESS,exports.ErrorCode.CHATROOM_KV_STORE_NOT_ALL_SUCCESS].indexOf(c)&&(d=[],delete(p=se({},t)).entries,t.entries.forEach((function(e){d.push(se(se({},e),p))})),c===exports.ErrorCode.CHATROOM_KV_STORE_NOT_ALL_SUCCESS&&(h=u.data,l=h.errorKeys,d=this._chatroomKVStoreNotAllSuccess(d,u)),this._chrmEntryHandler.setLocal(e,{kvEntries:d,syncTime:(new Date).getTime()},o)),[2,{code:c,data:l}]}}))}))},n.prototype.setChatroomEntry=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){return t.type=exports.ChatroomEntryType.UPDATE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))},n.prototype.setChatroomEntries=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){return t.type=exports.ChatroomEntryType.UPDATE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKVS(e,t)]}))}))},n.prototype.forceSetChatroomEntry=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){return t.type=exports.ChatroomEntryType.UPDATE,t.isOverwrite=!0,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))},n.prototype.removeChatroomEntry=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){return t.type=exports.ChatroomEntryType.DELETE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))},n.prototype.removeChatroomEntries=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){return t.type=exports.ChatroomEntryType.DELETE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKVS(e,t)]}))}))},n.prototype.forceRemoveChatroomEntry=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){return t.type=exports.ChatroomEntryType.DELETE,t.isOverwrite=!0,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))},n.prototype.getChatroomEntry=function(e,t){return ue(this,void 0,void 0,(function(){var n,r,o,i,s,a,u;return ce(this,(function(c){switch(c.label){case 0:return(n=this._chrmEntryHandler.getValue(e,t))?[2,{code:exports.ErrorCode.SUCCESS,data:n}]:this._isConnected?(r=this._connMgr,o=r.codec.encodePullChatRoomKV(0),i=new la(as[as.pullKV],o,e),[4,r.send(i,co)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return s=c.sent(),(a=s.data)&&a.kvEntries&&a.kvEntries.length&&(u=a.kvEntries.find((function(e){return e.key===t})),void 0!==u)?[2,{code:exports.ErrorCode.SUCCESS,data:null==u?void 0:u.value}]:[2,{code:exports.ErrorCode.CHATROOM_KEY_NOT_EXIST}]}}))}))},n.prototype.getAllChatroomEntry=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s;return ce(this,(function(a){switch(a.label){case 0:return(t=this._chrmEntryHandler.getAll(e))&&Object.keys(t).length?[2,{code:exports.ErrorCode.SUCCESS,data:t}]:this._isConnected?(n=this._connMgr,t={},r=n.codec.encodePullChatRoomKV(0),o=new la(as[as.pullKV],r,e),[4,n.send(o,co)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return i=a.sent(),(s=i.data)&&s.kvEntries&&s.kvEntries.length&&s.kvEntries.forEach((function(e){e.key&&(t[e.key]=e.value||"")})),[2,{code:exports.ErrorCode.SUCCESS,data:t}]}}))}))},n.prototype.pullChatroomEntry=function(e,t){return ue(this,void 0,void 0,(function(){var n,r,o,i,s,a,u,c,l,d,p,h=this;return ce(this,(function(_){switch(_.label){case 0:return this._isConnected?(r=(n=this)._connMgr,o=n.currentUserId,this._chrmsQueue[e]?(i=r.codec.encodePullChatRoomKV(t),s=new la(as[as.pullKV],i,e),this.logger.info(exports.LogTagId.L_PULL_CHATROOM_KV_T,JSON.stringify({chatroomId:e,timestamp:t})),[4,r.send(s,co)]):[2,{code:exports.ErrorCode.RC_CHATROOM_NOT_EXIST}]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return a=_.sent(),u=a.code,c=a.data,this._chrmsQueue[e]?(l=u===exports.ErrorCode.SUCCESS?"info":"warn",this.logger[l](exports.LogTagId.L_PULL_CHATROOM_KV_R,JSON.stringify({code:u,timestamp:t})),u===exports.ErrorCode.SUCCESS&&c?(d=c.kvEntries,p=[],d.length>0&&(d.forEach((function(t){var n=t.key,r=t.value,o=t.type,i=t.timestamp,s=t.userId;h._chrmEntryHandler.getValue(e,n)===r&&s===h.getCurrentUserId()||p.push({key:n,value:r,type:o,timestamp:i,chatroomId:e})})),this._chrmEntryHandler.setLocal(e,c,o),p.length>0&&this._watcher.chatroom({updatedEntries:p})),[2,{code:u,data:c}]):[2,{code:u}]):[2,{code:exports.ErrorCode.RC_CHATROOM_NOT_EXIST}]}}))}))},n.prototype._startSyncIntervalForChrmPull=function(){var e=this;this._stopSyncIntervalForChrmPull(),this._intervalTimerForChrmPull=setInterval((function(){var t=Object.keys(e._chrmsQueue);0!==t.length&&e._isConnected?t.forEach((function(t){e._pullChrmMsg(t),e.getNaviInfoFromCache().kvStorage&&e._chrmEntryHandler.pullEntry(t,0)})):e._stopSyncIntervalForChrmPull()}),18e4)},n.prototype._stopSyncIntervalForChrmPull=function(){"number"!=typeof this._intervalTimerForChrmPull&&(clearInterval(this._intervalTimerForChrmPull),this._intervalTimerForChrmPull=-1)},n.prototype.removeChatroomFromCatch=function(e){var t;null===(t=this._joinedChrmManager)||void 0===t||t.remove(e)},n.prototype._writeMessagesLog=function(e,t){var n,r=null===(n=this.cloudController)||void 0===n?void 0:n.getMRTRConfig();if(!r)return!1;var o=function(e){if(!e)return Math.floor(4294967296*Math.random());var t=0;if(0===e.length)return t;for(var n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t)}(t),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&&o%(1/i)==0},n.prototype.sendMessage=function(e,t,n,r,o){var i;return ue(this,void 0,void 0,(function(){var s,a,u,c,l,d,p,h,_,g,f,E;return ce(this,(function(I){switch(I.label){case 0:return n=this._handleInnerMsgOptions(e,t,n),n=this._handleMsgProperties(n,!0),s=!1,[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP].includes(e)&&(n.isStatusMessage||(null===(i=this._customMessageType[n.messageType])||void 0===i?void 0:i.isStatusMessage))&&(s=!0),a=s?function(e){var t;return(t={},t[exports.ConversationType.PRIVATE]=as.ppMsgS,t[exports.ConversationType.GROUP]=as.pgMsgS,t)[e]}(e):function(e){var t;return(t={},t[exports.ConversationType.PRIVATE]=as.ppMsgP,t[exports.ConversationType.GROUP]=as.pgMsgP,t[exports.ConversationType.CHATROOM]=as.chatMsg,t[exports.ConversationType.CUSTOMER_SERVICE]=as.pcMsgP,t[exports.ConversationType.RTC_ROOM]=as.prMsgS,t[exports.ConversationType.SYSTEM]=as.pbMsgP,t)[e]}(e)||as.ppMsgP,s&&(n.isPersited=!1,n.isCounted=!1),u=n.messageId?n.messageId:Jt(),n.messageId=u,c=this._connMgr.codec.encodeUpMsg({conversationType:e,targetId:t},n),(l=new da(as[a],c,e===exports.ConversationType.SYSTEM?this.currentUserId:t)).setHeaderQos(ps.AT_LEAST_ONCE),s?(this._connMgr.sendOnly(l),[2,{code:exports.ErrorCode.SUCCESS,data:bp(e,t,se({},n),"",0,this.currentUserId,u)}]):(d=this._connMgr.getCrtServerTime(),p=bp(e,t,se(se({},n),{isStatusMessage:s}),"",d,this.currentUserId,u),null==r||r(u),this.logger.info(exports.LogTagId.L_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:e,targetId:t,channelId:n.channelId}),o),h=Date.now(),[4,this._connMgr.send(l)]);case 1:return _=I.sent(),g=_.code,f=_.data,g!==exports.ErrorCode.SUCCESS?(this.logger.warn(exports.LogTagId.L_SEND_MSG_R,JSON.stringify({code:g,messageUId:p.messageUId,messageId:p.messageId}),o),this._writeMessagesLog(e)&&this.logger.record(re.IM_MSG_SEND,JSON.stringify({channel:e,start_ts:h,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:g})),p.sentStatus=exports.SentStatus.FAILED,[2,{code:g,data:p}]):(this.logger.info(exports.LogTagId.L_SEND_MSG_R,JSON.stringify({code:g,messageUId:null==f?void 0:f.messageUId,messageId:null==f?void 0:f.messageId}),o),E=f,this._sendMessageSuccessHandle(p,E),this._writeMessagesLog(e,E.messageUId)&&this.logger.record(re.IM_MSG_SEND,JSON.stringify({msg_id:E.messageUId,channel:e,start_ts:h,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:g})),[2,{code:exports.ErrorCode.SUCCESS,data:p}])}}))}))},n.prototype._sendMessageSuccessHandle=function(e,t){var n,r=this;this._sendMessageStore.setMessage(t.messageUId,t.timestamp),e.sentTime=t.timestamp,e.messageUId=t.messageUId,this._conversationManager.setConversationCacheByMessage(e,!0);var o=e.messageType,i=e.conversationType,s=e.targetId,a=e.channelId,u=e.sentTime,c=e.content,l=e.messageDirection;if(o===exports.MessageType.READ_RECEIPT_REQUEST){var d=c.messageUId;null===(n=this._readReceiptManager)||void 0===n||n.insert({conversationType:i,targetId:s,channelId:a},d,l,u)}if(o===exports.MessageType.READ_RECEIPT_RESPONSE){var p=c.receiptMessageDic;if(!p)return;for(var h in p)p[h].forEach((function(e){var t;null===(t=r._readReceiptManager)||void 0===t||t.remove({conversationType:i,targetId:s,channelId:a},e)}))}},n.prototype.recallMsg=function(e,t){var n;return ue(this,void 0,void 0,(function(){var r,o,i,s,a,u,c,l,d,p,h,_,g,f,E,I,T,C;return ce(this,(function(v){switch(v.label){case 0:return r=e.targetId,o=e.conversationType,i=e.channelId||"",s=t.user,a=t.extra,u=t.isDelete,c=t.directionalUserIdList,l=t.disableUpdateLastMessage,d=t.messageUId,p=t.sentTime,h={conversationType:o,targetId:r,messageUId:d,sentTime:p,channelId:i,isDelete:u||!1,isAdmin:t.isAdmin},s&&(h.user=s),a&&(h.extra=a),_={content:h,messageType:"RC:RcCmd",disableNotification:null==t?void 0:t.disableNotification,pushConfig:null==t?void 0:t.pushConfig,pushContent:(null===(n=t.pushConfig)||void 0===n?void 0:n.pushContent)||t.pushContent||"",channelId:i,disableUpdateLastMessage:l},[exports.ConversationType.GROUP,exports.ConversationType.ULTRA_GROUP].includes(o)&&c&&(_.directionalUserIdList=c),g=this._connMgr.codec.encodeUpMsg({conversationType:o,targetId:r},_),(f=new da(as.recallMsg,g,this.currentUserId)).setHeaderQos(ps.AT_LEAST_ONCE),[4,this._connMgr.send(f)];case 1:return(E=v.sent()).isOk?(I=E.data,o!==exports.ConversationType.ULTRA_GROUP&&(T="Cmd:".concat(d),I.messageUId=T),C=bp(o,r,se(se({},_),{isPersited:!0}),I.messageUId,I.timestamp,this.currentUserId),o===exports.ConversationType.ULTRA_GROUP?(this._ultraMsgMap[I.messageUId]=I.timestamp,this._updateUltraGroupWhenRecallMsg(r,i,d)):(this._sendMessageStore.setMessage(I.messageUId,I.timestamp),this._conversationManager.setConversationCacheByMessage(C,!0)),[2,it(C)]):[2,E.wipe()]}}))}))},n.prototype.sendReadReceiptMessage=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o;return ce(this,(function(i){return this._isConnected?(r=this._connMgr.codec.encodeReadReceipt(t,n),o=new la(as[as.rrMsg],r,e),[2,this._connMgr.send(o)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))},n.prototype.getMessageReader=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o;return ce(this,(function(i){return this._isConnected?(r=this._connMgr.codec.encodeMessageReader(t,n),o=new la(as[as.rrList],r,e),[2,this._connMgr.send(o,Oo)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))},n.prototype.sendReadReceiptMessageV4=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o;return ce(this,(function(i){return r=this._connMgr.codec.encodeReadReceiptMsg(e,t,n),o=new da(as[as.sendMsgRead],r,e.targetId),[2,this._connMgr.send(o)]}))}))},n.prototype.getMessageReadReceiptV4=function(e,t){return ue(this,void 0,void 0,(function(){var n,r;return ce(this,(function(o){return n=this._connMgr.codec.encodeReceiptQryReq(e,t),r=new la(as[as.qryMsgRead],n,e.targetId),[2,this._connMgr.send(r,Xo)]}))}))},n.prototype.batchGetMessageReadReceiptInfoV4=function(e,t){return ue(this,void 0,void 0,(function(){var n,r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return n=this._connMgr.codec.encodeReceiptCntQryReq(e,t),r=new la(as[as.qryMsgReadCntBatch],n,e.targetId),[4,this._connMgr.send(r,ei)];case 1:return o=u.sent(),i=o.code,s=o.data,a=(s||{result:[]}).result,i===exports.ErrorCode.SUCCESS&&a?[2,{code:i,data:a.map((function(t){return se({messageUId:t.msgId,readedCount:t.cnt,totalCount:t.tmn},e)}))}]:[2,{code:i}]}}))}))},n.prototype.updateConversationReadTime=function(e,t){return ue(this,void 0,void 0,(function(){var n,r;return ce(this,(function(o){return n=this._connMgr.codec.encodeSessionMsgReadInput(e,t),r=new da(as[as.updRTime],n,this.currentUserId),[2,this._connMgr.send(r)]}))}))},n.prototype.pullUserSettings=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s;return ce(this,(function(a){switch(a.label){case 0:return this._isConnected?(t=this.getNaviInfoFromCache(),n=Xi.encode(_o,{version:e,ipType:t.ipType||0}),r=new la(as.pullUS,n,this.currentUserId),[4,this._connMgr.send(r,go)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return o=a.sent(),i=o.code,s=o.data,i===exports.ErrorCode.SUCCESS&&this._naviChangeHandler(s),[2,{code:i,data:s}]}}))}))},n.prototype._naviChangeHandler=function(e){var t;if(e){var n=e.settings,r=null===(t=null==n?void 0:n.VoipInfo)||void 0===t?void 0:t.value;if(r){var o=this._connMgr.getToken();this.navi.updateVoipCallInfo(o,r);var i=this.navi.getNaviInfoFromCache(o);this._watcher.onNaviDataChange(se({},i))}}else this.logger.warn(exports.LogTagId.L_NOTIFY_NAVI_CHANGE_E,JSON.stringify({data:e}))},n.prototype.getFileToken=function(e,t,n,r,o,i){return ue(this,void 0,void 0,(function(){var s,a,u,c,l;return ce(this,(function(d){switch(d.label){case 0:return this._isConnected?(s=r&&"uploads"!==r?t||"":Qt(e,t),a=this.getNaviInfoFromCache(),u=nn(a,this.logger),c="",u||(c=JSON.stringify({uploadDomain:u})),l=Xi.encode(Pr,{type:e,key:s,httpMethod:n||"",queryString:r||"",url:o||"",ext:c,size:i?Math.ceil(i):0,ipType:a.ipType||0}),[4,this._connMgr.query(as.qnTkn,this.currentUserId,l,xr)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return[2,d.sent().trans((function(e){return se(se({},e),{fileName:s,downloadAuthInfo:e.downloadAuthInfo?JSON.parse(e.downloadAuthInfo):null})}))]}}))}))},n.prototype.getFileUrl=function(e,t,n,r){return ue(this,void 0,void 0,(function(){var o,i,s,a,u;return ce(this,(function(c){switch(c.label){case 0:return this._isConnected?(o=this.getNaviInfoFromCache(),s="",a="",t===exports.UploadMethod.QINIU?i=as.qnUrl:t===exports.UploadMethod.AWS?i=as.s3Url:t===exports.UploadMethod.STC?i=as.stcUrl:t===exports.UploadMethod.MINIO?(i=as.minioUrl,s=nn(o,this.logger),a=JSON.stringify({url:s})):i=as.aliUrl,u=Xi.encode(wr,{type:e,key:n,fileName:r,ext:a,size:-1,ipType:o.ipType||0}),[4,this._connMgr.query(i,this.currentUserId,u,Dr)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return[2,c.sent().trans((function(e){return{downloadUrl:e.downloadUrl}}))]}}))}))},n.prototype.disconnect=function(){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){switch(e.label){case 0:return this.reporter.stop(),this.reporterStatistic.stop(),[4,this._connMgr.disconnect()];case 1:return e.sent(),this._resetMemoryState(),[2]}}))}))},n.prototype._resetMemoryState=function(){-1!==this._reconnectTimer&&(clearTimeout(this._reconnectTimer),this._reconnectTimer=-1),this._pullQueue.length=0,this._stopSyncInterval(),this.resetUltraGroupData(),this._joinedChrmManager&&(this._joinedChrmManager.clear(),delete this._joinedChrmManager),this._conversationManager&&delete this._conversationManager,this._ultraGroupManager&&delete this._ultraGroupManager,this._userSettingManager&&delete this._userSettingManager,this._readReceiptManager&&delete this._readReceiptManager,this._subscribeManager&&delete this._subscribeManager,this._chrmsQueue={}},n.prototype.resetUltraGroupData=function(){this._stopUltraSyncInterval(),this._lastSyncUltraMsgTimeStamp=0,this._lastSyncUltraMsgLocalTimeStamp=0,this._isUltraPulling=!1,this._ultraGroupTimeQue=[],this._isUltraGroupListExist=!1,this._ultraGroupMap={}},n.prototype.registerMessageType=function(e,t,n,r,o){this._customMessageType[e]={isPersited:t,isCounted:n,isStatusMessage:o}},n.prototype.getServerTime=function(){return this._connMgr.getCrtServerTime()},n.prototype.getCurrentUserId=function(){return this.currentUserId},n.prototype.createTag=function(e){return ue(this,void 0,void 0,(function(){var t=this;return ce(this,(function(n){return this._isConnected?[2,this._userSettingManager.pushTask((function(n){return ue(t,void 0,void 0,(function(){var t,r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return t=this._connMgr.codec.encodeCreateTag([e],n),r=new la(as[as.addSeTag],t,this.currentUserId),[4,this._connMgr.send(r,ho)];case 1:return o=u.sent(),i=o.code,s=o.data,i===exports.ErrorCode.SUCCESS&&s&&(a=s.version,this._userSettingManager.addTag([se(se({},e),{createdTime:a})],a)),[2,{code:i}]}}))}))}))]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))},n.prototype.removeTag=function(e){return ue(this,void 0,void 0,(function(){var t=this;return ce(this,(function(n){return this._isConnected?[2,this._userSettingManager.pushTask((function(n){return ue(t,void 0,void 0,(function(){var t,r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return t=this._connMgr.codec.encodeRemoveTag([e],n),r=new la(as[as.delSeTag],t,this.currentUserId),[4,this._connMgr.send(r,ho)];case 1:return o=u.sent(),i=o.code,s=o.data,i===exports.ErrorCode.SUCCESS&&s&&(a=s.version,this._userSettingManager.deleteTag([e],a)),[2,{code:i}]}}))}))}))]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))},n.prototype.updateTag=function(e){return ue(this,void 0,void 0,(function(){var t=this;return ce(this,(function(n){return this._isConnected?[2,this._userSettingManager.pushTask((function(n){return ue(t,void 0,void 0,(function(){var t,r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return t=this._connMgr.codec.encodeCreateTag([e],n),r=new la(as[as.addSeTag],t,this.currentUserId),[4,this._connMgr.send(r,ho)];case 1:return o=u.sent(),i=o.code,s=o.data,i===exports.ErrorCode.SUCCESS&&(a=s.version,this._userSettingManager.addTag([e],a)),[2,{code:i}]}}))}))}))]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))},n.prototype.getTagList=function(){return ue(this,void 0,void 0,(function(){var e,t;return ce(this,(function(n){return e=this._userSettingManager.getTags(),t=this._conversationManager.getConversationListForTag(),e.forEach((function(e){e.conversationCount=t[e.tagId]?t[e.tagId].length:0})),[2,{code:exports.ErrorCode.SUCCESS,data:e}]}))}))},n.prototype.addTagForConversations=function(e,t){return ue(this,void 0,void 0,(function(){var n=this;return ce(this,(function(r){return this._isConnected?[2,this._conversationManager.pushTask((function(r){return ue(n,void 0,void 0,(function(){var n,o,i,s,a,u,c=this;return ce(this,(function(l){switch(l.label){case 0:return this._userSettingManager.getTagById(e)?(n=this._connMgr.codec.encodeUpdateConversationTag([{tagId:e}],t,r),o=new la(as[as.addTag],n,this.currentUserId),[4,this._connMgr.send(o,mo)]):[2,{code:exports.ErrorCode.TAG_NOT_EXIST}];case 1:return i=l.sent(),s=i.code,a=i.data,s===exports.ErrorCode.SUCCESS&&a&&((u={})[e]={},t.forEach((function(e){c._conversationManager.addTagStatus(e.conversationType,e.targetId,u,e.channelId)})),this._conversationManager.setConversationUpdatedTime(a.version)),[2,{code:s}]}}))}))}))]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))},n.prototype.removeTagForConversations=function(e,t){return ue(this,void 0,void 0,(function(){var n=this;return ce(this,(function(r){return this._isConnected?[2,this._conversationManager.pushTask((function(r){return ue(n,void 0,void 0,(function(){var n,o,i,s,a,u=this;return ce(this,(function(c){switch(c.label){case 0:return n=this._connMgr.codec.encodeUpdateConversationTag([{tagId:e}],t,r),o=new la(as[as.delTag],n,this.currentUserId),[4,this._connMgr.send(o,mo)];case 1:return i=c.sent(),s=i.code,a=i.data,s===exports.ErrorCode.SUCCESS&&a&&(t.forEach((function(t){u._conversationManager.deleteTagStatus(t.conversationType,t.targetId,[e],t.channelId)})),this._conversationManager.setConversationUpdatedTime(a.version)),[2,{code:s}]}}))}))}))]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))},n.prototype.removeTagsForConversation=function(e,t){return ue(this,void 0,void 0,(function(){var n=this;return ce(this,(function(r){return this._isConnected?[2,this._conversationManager.pushTask((function(r){return ue(n,void 0,void 0,(function(){var n,o,i,s,a,u,c,l,d;return ce(this,(function(p){switch(p.label){case 0:return n=e.conversationType,o=e.targetId,i=e.channelId,s=t.map((function(e){return{tagId:e}})),a=this._connMgr.codec.encodeUpdateConversationTag(s,[e],r),u=new la(as[as.delTag],a,this.currentUserId),[4,this._connMgr.send(u,mo)];case 1:return c=p.sent(),l=c.code,d=c.data,l===exports.ErrorCode.SUCCESS&&d&&(this._conversationManager.deleteTagStatus(n,o,t,i),this._conversationManager.setConversationUpdatedTime(d.version)),[2,{code:l}]}}))}))}))]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))},n.prototype.getConversationListByTag=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o,i,s,a,u,c,l,d;return ce(this,(function(p){switch(p.label){case 0:return this._isConnected?(o=(r=this).currentUserId,i=r._connMgr,s=i.codec.encodeOldConversationList({count:n,type:exports.ConversationType.PRIVATE,startTime:t}),a=new la(as.qryRelationR,s,o),[4,i.send(a,Hr,{currentUserId:o,connectedTime:i.getConnectedTime()})]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return u=p.sent(),c=u.code,l=u.data,c!==exports.ErrorCode.SUCCESS?[2,{code:c}]:(d=this._conversationHasTagFilter(e,null==l?void 0:l.list),[2,{code:c,data:d}])}}))}))},n.prototype._conversationHasTagFilter=function(e,t){var n=this,r=[],o=[];function i(e,t){return e.latestMessage&&t.latestMessage?e.latestMessage.sentTime-t.latestMessage.sentTime:0}return t.forEach((function(t){var i=t.conversationType,s=t.targetId,a=t.channelId,u=n._conversationManager.get(i,s,a),c=u.hasMentioned,l=u.mentionedInfo,d=u.lastUnreadTime,p=u.notificationStatus,h=u.isTop,_=u.tags,g=u.unreadMessageCount,f=_&&_[e];if(f){var E=se(se({},t),{hasMentioned:c,mentionedInfo:l,lastUnreadTime:d,notificationStatus:p,isTop:h,unreadMessageCount:g});f.isTop?r.push(se(se({},E),{isTopInTag:!0})):o.push(se(se({},E),{isTopInTag:!1}))}})),r.sort(i),o.sort(i),pe(pe([],de(r),!1),de(o),!1)},n.prototype.getUnreadCountByTag=function(e,t){return ue(this,void 0,void 0,(function(){var n;return ce(this,(function(r){return this._isConnected?(n=this._conversationManager.getUnreadCountByTag(e,t),[2,{code:exports.ErrorCode.SUCCESS,data:n}]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))},n.prototype.setConversationStatusInTag=function(e,t,n){return ue(this,void 0,void 0,(function(){var r=this;return ce(this,(function(o){return this._isConnected?[2,this._conversationManager.pushTask((function(o){return ue(r,void 0,void 0,(function(){var r,i,s,a,u,c,l,d,p,h,_,g;return ce(this,(function(f){switch(f.label){case 0:return r=t.targetId,i=t.conversationType,s=t.channelId,a=n.isTop,u=[{tagId:e,isTop:a}],(c=this._conversationManager.get(i,r,s)).tags&&Object.hasOwnProperty.call(c.tags,e)?(l=this._connMgr.codec.encodeUpdateConversationTag(u,[t],o),d=new la(as[as.addTag],l,this.currentUserId),[4,this._connMgr.send(d,mo)]):[2,{code:exports.ErrorCode.NO_TAG_IN_CONVER}];case 1:return p=f.sent(),h=p.code,_=p.data,h===exports.ErrorCode.SUCCESS&&_&&((g={})[e]={},a&&(g[e].isTop=!0),this._conversationManager.addTagStatus(i,r,g,s),this._conversationManager.setConversationUpdatedTime(_.version)),[2,{code:h}]}}))}))}))]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))},n.prototype.getTagsForConversation=function(e){var t;return ue(this,void 0,void 0,(function(){var n,r,o,i;return ce(this,(function(s){if(!this._isConnected)return[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];if(n=this._conversationManager.get(e.conversationType,e.targetId,e.channelId),r=this._userSettingManager.getTagsInfo(),o=[],n.tags)for(i in n.tags)o.push({tagId:i,tagName:null===(t=r[i])||void 0===t?void 0:t.tagName});return[2,{code:exports.ErrorCode.SUCCESS,data:o}]}))}))},n.prototype.getBlockConversationList=function(){var e=this._conversationManager.getBlockConversationList();return Promise.resolve({code:exports.ErrorCode.SUCCESS,data:e})},n.prototype.getTopConversationList=function(e,t){var n=this._conversationManager.getTopConversationList(e,t);return Promise.resolve({code:exports.ErrorCode.SUCCESS,data:n})},n.prototype.getUnreadConversationList=function(e){return ue(this,void 0,void 0,(function(){var t;return ce(this,(function(n){return t=this._conversationManager.getUnreadConversationList(e),[2,Promise.resolve({code:exports.ErrorCode.SUCCESS,data:t})]}))}))},n.prototype.getUnreadMentionedCount=function(e){var t,n;return n=e.conversationType===exports.ConversationType.ULTRA_GROUP?(null===(t=this._ultraGroupMap["".concat(e.channelId,"_").concat(e.targetId)])||void 0===t?void 0:t.unreadMentionedCount)||0:this._conversationManager.getUnreadMentionedCount(e.conversationType,e.targetId,e.channelId),n=this._getUnreadCount(n),Promise.resolve({code:exports.ErrorCode.SUCCESS,data:n})},n.prototype.getAllUnreadMentionedCount=function(){var e=this._conversationManager.getAllUnreadMentionedCount();return Promise.resolve({code:exports.ErrorCode.SUCCESS,data:e})},n.prototype.getConversationNotificationLevel=function(e,t,n){if(!this._isUltraGroupListExist&&e===exports.ConversationType.ULTRA_GROUP)return Promise.resolve({code:exports.ErrorCode.METHOD_NOT_AVAILABLE});var r;if(!(r=e===exports.ConversationType.ULTRA_GROUP?this._ultraGroupManager.get(exports.ConversationType.ULTRA_GROUP,t,n):this._conversationManager.get(e,t,n)))return Promise.resolve({code:exports.ErrorCode.SUCCESS,data:exports.NotificationLevel.NOT_SET});var o=r.notificationLevel;return Et(r.notificationLevel)&&!Et(r.notificationStatus)&&(o=exports.NotificationStatus.OPEN===r.notificationStatus?1:0),Promise.resolve({code:exports.ErrorCode.SUCCESS,data:o})},n.prototype.getConversationNotificationStatus=function(e,t,n){var r;return(r=e===exports.ConversationType.ULTRA_GROUP?this._ultraGroupManager.get(exports.ConversationType.ULTRA_GROUP,t,n):this._conversationManager.get(e,t,n))?Promise.resolve({code:exports.ErrorCode.SUCCESS,data:Ne(r.notificationLevel||exports.NotificationLevel.NOT_SET)}):Promise.resolve({code:exports.ErrorCode.SUCCESS,data:exports.NotificationStatus.CLOSE})},n.prototype.setConversationTypeNotificationLevel=function(e,t){return ue(this,void 0,void 0,(function(){var n,r,o,i,s=this;return ce(this,(function(a){switch(a.label){case 0:return this._isConnected?(r=(n=this).currentUserId,o=n._connMgr,i=this._conversationManager.getConversationUpdatedTime(),[4,o.query(as.setTypeUnpush,r,Xi.encode(So,{type:e,unpushLevel:t,version:i}),Ao)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return[2,a.sent().trans((function(n){var r,o=n.version;s._conversationManager.setConversationUpdatedTime(o),e===exports.ConversationType.ULTRA_GROUP?null===(r=s._ultraGroupManager)||void 0===r||r.addUltraGroupStatus({conversationType:e,targetId:"",notificationLevel:t,channelId:""}):s._conversationManager.addStatus({conversationType:e,targetId:"",channelId:"",updatedTime:o,notificationLevel:t},!0)}))]}}))}))},n.prototype.getConversationTypeNotificationLevel=function(e){if(e===exports.ConversationType.ULTRA_GROUP){var t=this._ultraGroupManager.get(e,"","");return Promise.resolve({code:exports.ErrorCode.SUCCESS,data:t.notificationLevel||0})}var n=this._conversationManager.get(e,"","");return Promise.resolve({code:exports.ErrorCode.SUCCESS,data:n.notificationLevel||0})},n.prototype.getRemoteHistoryMessages=function(e,t,n,r,o,i){return this.getHistoryMessage(e,t,n,r,o,i)},n.prototype.getUltraGroupList=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i=this;return ce(this,(function(s){return t=e.targetId,n=e.channelType,this._isUltraGroupListExist?(r=(r=Object.values(this._ultraGroupMap).filter((function(e){return!(e.targetId!==t&&t||e.channelType!==n&&dt(n))}))).map((function(e){var t=e.unreadMessageCount,n=e.unreadMentionedCount,r=e.unreadMentionedMeCount;return t=i._getUnreadCount(t),n=i._getUnreadCount(n),r=i._getUnreadCount(r),se(se({},e),{unreadMessageCount:t,unreadMentionedCount:n,unreadMentionedMeCount:r})})),r=Pp(r),o=Lt(r),[2,{code:exports.ErrorCode.SUCCESS,data:o}]):[2,{code:exports.ErrorCode.METHOD_NOT_AVAILABLE}]}))}))},n.prototype._getUnreadCount=function(e){return e>999?999:e},n.prototype.getBlockUltraGroupList=function(){if(!this._isUltraGroupListExist)return Promise.resolve({code:exports.ErrorCode.METHOD_NOT_AVAILABLE});var e=Object.values(this._ultraGroupMap),t=[];return e.forEach((function(e){(e.notificationStatus===exports.NotificationStatus.OPEN||e.notificationLevel>0)&&t.push({conversationType:exports.ConversationType.ULTRA_GROUP,targetId:e.targetId,channelId:e.channelId})})),Promise.resolve({code:exports.ErrorCode.SUCCESS,data:t})},n.prototype.getTopUltraGroupList=function(){if(!this._isUltraGroupListExist)return Promise.resolve({code:exports.ErrorCode.METHOD_NOT_AVAILABLE});var e=Object.values(this._ultraGroupMap),t=[];return e.forEach((function(e){!0===e.isTop&&t.push({conversationType:exports.ConversationType.ULTRA_GROUP,targetId:e.targetId,channelId:e.channelId})})),Promise.resolve({code:exports.ErrorCode.SUCCESS,data:t})},n.prototype.getUltraGroupUnreadMentionedCountByTargetId=function(e,t){if(!this._isUltraGroupListExist)return Promise.resolve({code:exports.ErrorCode.METHOD_NOT_AVAILABLE});var n=0;for(var r in this._ultraGroupMap){r.match(/_.*/g)[0].substring(1)!==e||t&&0!==t.length&&!t.includes(this._ultraGroupMap[r].notificationLevel)||(n+=this._ultraGroupMap[r].unreadMentionedCount)}return n=this._getUnreadCount(n),Promise.resolve({code:exports.ErrorCode.SUCCESS,data:n})},n.prototype.getUltraGroupUnreadCountByTargetId=function(e,t){var n=0;for(var r in this._ultraGroupMap){var o=this._ultraGroupMap[r];o.targetId!==e||t&&0!==t.length&&!t.includes(this._ultraGroupMap[r].notificationLevel)||(n+=o.unreadMessageCount||0)}return n=this._getUnreadCount(n),Promise.resolve({code:exports.ErrorCode.SUCCESS,data:n})},n.prototype.getUltraGroupUnreadInfoList=function(e){var t=this;if(!this._isUltraGroupListExist)return Promise.resolve({code:exports.ErrorCode.METHOD_NOT_AVAILABLE});var n=[];return Object.keys(this._ultraGroupMap).forEach((function(r){var o=t._ultraGroupMap[r];e.includes(o.targetId)&&n.push({type:o.conversationType,targetId:o.targetId,channelId:o.channelId,unreadMessageCount:t._getUnreadCount(o.unreadMessageCount),mentionedCount:t._getUnreadCount(o.unreadMentionedCount),mentionedMeCount:t._getUnreadCount(o.unreadMentionedMeCount),notificationLevel:o.notificationLevel})})),Promise.resolve({code:exports.ErrorCode.SUCCESS,data:n})},n.prototype.getAllUltraGroupUnreadCount=function(e){if(void 0===e&&(e=!1),!this._isUltraGroupListExist)return Promise.resolve({code:exports.ErrorCode.METHOD_NOT_AVAILABLE});var t=0;for(var n in this._ultraGroupMap)t+=e?this._ultraGroupMap[n].unreadMentionedCount||0:this._ultraGroupMap[n].unreadMessageCount||0;return t=this._getUnreadCount(t),Promise.resolve({code:exports.ErrorCode.SUCCESS,data:t})},n.prototype.clearUltraUnreadcount=function(e,t){return void 0===t&&(t=""),ue(this,void 0,void 0,(function(){var n,r,o,i,s;return ce(this,(function(a){switch(a.label){case 0:return this._isUltraGroupListExist?this._isConnected?(n=this.getServerTime(),r=this._connMgr.codec.encodeClearUnreadCount({conversationType:exports.ConversationType.ULTRA_GROUP,targetId:e,channelId:t},{timestamp:n}),(o=new da(as[as.updUgRTime],r,this.currentUserId)).setHeaderQos(ps.AT_LEAST_ONCE),[4,this._connMgr.send(o)]):[2,exports.ErrorCode.RC_NET_UNAVAILABLE]:[2,Promise.resolve(exports.ErrorCode.METHOD_NOT_AVAILABLE)];case 1:return(i=a.sent().code)===exports.ErrorCode.SUCCESS&&((s=this._ultraGroupMap["".concat(t,"_").concat(e)])&&(s.unreadMessageCount=0,s.unreadMentionedCount=0,s.unreadMentionedMeCount=0,s.lastReadTime=n),s&&s.firstUnreadMessage&&(s.firstUnreadMessage=null)),[2,i]}}))}))},n.prototype._getUltraGroupList=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a,u,c,l,d,p,h,_=this;return ce(this,(function(g){switch(g.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodeUltraGroup(e,false),n=new la(as[as.pullUgSes],t,this.currentUserId),[4,this._connMgr.send(n,Hr,{currentUserId:this.currentUserId,conversationType:exports.ConversationType.ULTRA_GROUP})]):[2];case 1:return r=g.sent(),o=r.code,i=r.data,o===exports.ErrorCode.SUCCESS&&i?(a=i.list,u=i.isFinished,a.forEach((function(e){e.notificationStatus=exports.NotificationStatus.CLOSE,e.notificationLevel=exports.NotificationLevel.NOT_SET,e.isTop=!1,_._ultraGroupMap["".concat(e.channelId,"_").concat(e.targetId)]=e,_._ultraGroupManager.addUltraGroupStatus(e)})),!1!==u?[3,2]:(c=a.length>0&&a[a.length-1].versionTime||0,this._getUltraGroupList(c),[3,4])):(this.logger.warn(exports.LogTagId.L_ULTRA_SYNC_DONE_S,"Pull ultra group conversation failured, code: ".concat(o,", try again")),s=setTimeout((function(){_._getUltraGroupList(e),clearTimeout(s)}),3e3),[2]);case 2:return this.logger.info(exports.LogTagId.L_ULTRA_SYNC_DONE_S,"Pull ultra group conversation success"),[4,this.pullConversationStatus(0)];case 3:l=g.sent(),d=l.code,p=l.data,d!==exports.ErrorCode.SUCCESS&&this.logger.warn(exports.LogTagId.O,"pullConversationStatus fail code: ".concat(d,", data: ").concat(p)),h=Object.values(this._ultraGroupMap),h=Pp(h),this._isUltraGroupListExist=!0,this._watcher.ultraGroupEnable(Lt(h)),this._syncUltraMsg(this._lastSyncUltraMsgTimeStamp),g.label=4;case 4:return[2]}}))}))},n.prototype._startUltraSyncInterval=function(){var e=this,t=function(){e._ultraGroupTimer=setTimeout((function(){Date.now()-e._lastSyncUltraMsgLocalTimeStamp>=18e4&&e._syncUltraMsg(e._lastSyncUltraMsgTimeStamp),e._stopUltraSyncInterval(),t()}),3e4)};this._lastSyncUltraMsgLocalTimeStamp=Date.now(),t()},n.prototype._stopUltraSyncInterval=function(){-1!==this._ultraGroupTimer&&(clearTimeout(this._ultraGroupTimer),this._ultraGroupTimer=-1)},n.prototype._notificationOnline=function(){return ue(this,void 0,void 0,(function(){var e,t,n,r=this;return ce(this,(function(o){switch(o.label){case 0:return this._isConnected?[4,this._fetchUltraMsg(0)]:[2];case 1:return e=o.sent(),t=e.code,n=e.data,t===exports.ErrorCode.SUCCESS&&n?(this.logger.info(exports.LogTagId.L_NOTIFY_ULTRA_ONLINE_S,"Notify ultra group online success."),this._getUltraGroupList(0),-1===this._ultraGroupTimer&&this._startUltraSyncInterval(),[2]):(this.logger.warn(exports.LogTagId.L_NOTIFY_ULTRA_ONLINE_S,"Notify ultra group online failured, try again."),setTimeout((function(){r._notificationOnline()}),3e3),[2])}}))}))},n.prototype._fetchUltraMsg=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a,u,c;return ce(this,(function(l){switch(l.label){case 0:return t=this._connMgr.codec.encodeSuperSyncMsg(e),n=new la(as[as.pullUgMsg],t,this.currentUserId),r=this.logger.createTraceId(),this.logger.info(exports.LogTagId.L_PULL_ULTRA_MSG_T,JSON.stringify({timestamp:e}),r),[4,this._connMgr.send(n,Ur,{currentUserId:this.currentUserId,conversation:{conversationType:exports.ConversationType.ULTRA_GROUP}})];case 1:return o=l.sent(),i=o.code,s=o.data,i===exports.ErrorCode.SUCCESS&&s?(a=s.list,u=s.syncTime,c=a.map((function(e){return e.messageUId})).join(","),this.logger.info(exports.LogTagId.L_PULL_ULTRA_MSG_R,JSON.stringify({code:i,messageUIds:c,timestamp:e,syncTime:u}),r)):this.logger.warn(exports.LogTagId.L_PULL_ULTRA_MSG_R,JSON.stringify({code:i,timestamp:e}),r),[2,{code:i,data:s}]}}))}))},n.prototype._getUltraGroup=function(e,t,n){var r,o,i,s=e.targetId,a=e.messageType,u=e.channelId,c=e.isCounted,l=e.channelType,d=e.sentTime,p=e.senderUserId,h=e.content,_=e.isMentioned,g=this._ultraGroupMap["".concat(u,"_").concat(s)],f=g||{conversationType:exports.ConversationType.ULTRA_GROUP,targetId:s,channelId:u,unreadMessageCount:0,unreadMentionedCount:0,unreadMentionedMeCount:0,notificationStatus:exports.NotificationStatus.CLOSE,notificationLevel:exports.NotificationLevel.NOT_SET,isTop:!1};return c&&p!==this.currentUserId&&a!==exports.MessageType.RECALL&&(f.unreadMessageCount+=1,f.unreadMentionedCount+=t,f.firstUnreadMessage||(f.firstUnreadMessage={sentTime:d}),_&&(null===(r=null==h?void 0:h.mentionedInfo)||void 0===r?void 0:r.type)!==exports.MentionedType.ALL&&(null===(i=null===(o=null==h?void 0:h.mentionedInfo)||void 0===o?void 0:o.userIdList)||void 0===i?void 0:i.includes(this.currentUserId))&&(f.unreadMentionedMeCount+=1)),f.versionTime=n,f.latestMessage=e,f.channelType=l,g||(this._ultraGroupMap["".concat(u,"_").concat(s)]=f),f},n.prototype._syncUltraMsg=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a,u,c,l=this;return ce(this,(function(d){switch(d.label){case 0:return!this._isConnected||this._isUltraPulling?[2]:(this._isUltraPulling=!0,[4,this._fetchUltraMsg(e)]);case 1:return t=d.sent(),n=t.code,r=t.data,this._lastSyncUltraMsgLocalTimeStamp=Date.now(),this._isUltraPulling=!1,n===exports.ErrorCode.SUCCESS&&r?(o=r.list,i=r.syncTime,s=r.finished,a={},u=[],o.forEach((function(e){var t,n,r,o=e.targetId,s=e.content,c=e.messageUId,d=e.channelId,p=e.isMentioned;if(l._ultraMsgMap[c])delete l._ultraMsgMap[c];else{var h=0;p&&((null===(t=null==s?void 0:s.mentionedInfo)||void 0===t?void 0:t.type)===exports.MentionedType.ALL||(null===(r=null===(n=null==s?void 0:s.mentionedInfo)||void 0===n?void 0:n.userIdList)||void 0===r?void 0:r.includes(l.currentUserId)))&&(h=1);var _=l._getUltraGroup(e,h,i);a["".concat(d,"_").concat(o)]=_,l._ultraGroupManager.addUltraGroupStatus(_),u.push(e)}})),Object.keys(a).length>0&&(this.logger.debug(exports.LogTagId.O,"notice ultragroups"),c=Object.values(a),c=Pp(c),this._watcher.conversation(Lt(c))),this.logger.debug(exports.LogTagId.O,"notice ultragroup message"),this._batchMessage(u),this._ultraGroupTimeQue=this._ultraGroupTimeQue.filter((function(e){return e>i})),this._lastSyncUltraMsgTimeStamp=i,s?(this._ultraGroupTimeQue.length>0&&(this._ultraGroupTimeQue.length=0,this._syncUltraMsg(i)),[2]):(this._syncUltraMsg(i),[2])):[2]}}))}))},n.prototype.sendUltraMessage=function(e,t,n,r){return ue(this,void 0,void 0,(function(){var o,i,s,a,u,c,l,d,p,h,_,g;return ce(this,(function(f){switch(f.label){case 0:return this._isConnected?("RC:SRSMsg"===t.messageType&&this.logger.warn(exports.LogTagId.O,"ultra group -> direction message convert to message"),t=this._handleMsgProperties(t,!0),o=t.messageId?t.messageId:Jt(),t.messageId=o,i=this._connMgr.codec.encodeUpMsg({conversationType:exports.ConversationType.ULTRA_GROUP,targetId:e},t),(s=new da(as[as.ugMsg],i,e)).setHeaderQos(ps.AT_LEAST_ONCE),a=this._connMgr.getCrtServerTime(),u=bp(exports.ConversationType.ULTRA_GROUP,e,se({},t),"",a,this.currentUserId,o),n&&n(o),this.logger.info(exports.LogTagId.L_SEND_MSG_T,JSON.stringify({messageType:t.messageType,conversationType:exports.ConversationType.ULTRA_GROUP,targetId:e,channelId:t.channelId}),r),c=Date.now(),[4,this._connMgr.send(s)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return l=f.sent(),d=l.code,p=l.data,d!==exports.ErrorCode.SUCCESS?(this.logger.warn(exports.LogTagId.L_SEND_MSG_R,JSON.stringify({code:d,messageUId:u.messageUId,messageId:u.messageId}),r),this._writeMessagesLog(exports.ConversationType.ULTRA_GROUP)&&this.logger.record(re.IM_MSG_SEND,JSON.stringify({channel:exports.ConversationType.ULTRA_GROUP,start_ts:c,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:d})),u.sentStatus=exports.SentStatus.FAILED,[2,{code:d,data:u}]):(this.logger.info(exports.LogTagId.L_SEND_MSG_R,JSON.stringify({code:d,messageUId:null==p?void 0:p.messageUId,messageId:null==p?void 0:p.messageId}),r),h=p,this._writeMessagesLog(exports.ConversationType.ULTRA_GROUP,h.messageUId)&&this.logger.record(re.IM_MSG_SEND,JSON.stringify({msg_id:h.messageUId,channel:exports.ConversationType.ULTRA_GROUP,start_ts:c,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:d})),u.sentTime=h.timestamp,u.messageUId=h.messageUId,this._ultraMsgMap[h.messageUId]=h.timestamp,_=t.channelId||"",(g=this._ultraGroupMap["".concat(_,"_").concat(e)])?(g.latestMessage=u,dt(g.channelType)&&(u.channelType=g.channelType)):(g={conversationType:exports.ConversationType.ULTRA_GROUP,targetId:e,channelId:_,unreadMessageCount:0,unreadMentionedCount:0,versionTime:u.sentTime,latestMessage:u,notificationStatus:exports.NotificationStatus.CLOSE,notificationLevel:exports.NotificationLevel.NOT_SET,isTop:!1},this._ultraGroupMap["".concat(_,"_").concat(e)]=g,this._ultraGroupManager.addUltraGroupStatus(g)),this._watcher.conversation(Lt([g])),[2,{code:d,data:u}])}}))}))},n.prototype.sendUltraGroupTypingStatus=function(e,t){return ue(this,void 0,void 0,(function(){var n,r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return this._isConnected?(n=e.conversationType,r=e.channelId,o=e.targetId,i=this._connMgr.codec.encodeOperateStatus(o,n,r||"",t||0),(s=new da(as[as.operate],i,o)).setHeaderQos(ps.AT_LEAST_ONCE),[4,this._connMgr.send(s)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return(a=u.sent().code)!==exports.ErrorCode.SUCCESS?[2,{code:a,msg:exports.ErrorCode[a]}]:[2,{code:a}]}}))}))},n.prototype.getUltraGroupMessageListByMessageUId=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return this._isConnected?e.messages&&e.messages.length<1||e.messages&&e.messages.length>20?[2,{code:exports.ErrorCode.MSG_LIMIT_ERROR}]:(t={},e.messages.forEach((function(e){t[e.messageUId]=void 0})),n=this._connMgr.codec.encodeMsgQuery(e),(r=new la(as[as.qryMsg],n,this.currentUserId)).setHeaderQos(ps.AT_LEAST_ONCE),[4,this._connMgr.send(r,Ho,{connectedTime:this._connMgr.getConnectedTime(),currentUserId:this.currentUserId})]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return o=u.sent(),i=o.code,s=o.data,i!==exports.ErrorCode.SUCCESS?[2,{code:i,msg:exports.ErrorCode[i]}]:(a=(s||{}).list,Array.isArray(a)&&a.forEach((function(e){var n=e.messageUId;t[n]=e})),[2,{code:0,data:t}])}}))}))},n.prototype._pullOperateStatusNotify=function(e){if(this._isConnected){var t=this._connMgr.codec.decodeByPBName(e.pbData,Yo),n=t.conversationType,r=t.info,o=t.summary;this.logger.debug(exports.LogTagId.O,"s_opNtf -> type: ".concat(n,", info: ").concat(r,", summary: ").concat(o)),this._watcher.operateStatus(t)}},n.prototype.expandUltraMessage=function(e){return ue(this,void 0,void 0,(function(){var t,n,r;return ce(this,(function(o){switch(o.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodeExpandUltraMessage(e,this.currentUserId),(n=new la(as[as.upMsgEx],t,e.targetId)).setHeaderQos(ps.AT_LEAST_ONCE),[4,this._connMgr.send(n)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return(r=o.sent().code)!==exports.ErrorCode.SUCCESS?[2,{code:r,msg:exports.ErrorCode[r]}]:[2,{code:r}]}}))}))},n.prototype.modifyMessage=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s;return ce(this,(function(a){switch(a.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodemodifyMessage(e,this.currentUserId),(n=new la(as[as.modifyMsg],t,e.targetId)).setHeaderQos(ps.AT_LEAST_ONCE),[4,this._connMgr.send(n)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return r=a.sent(),o=r.code,i=r.data,o!==exports.ErrorCode.SUCCESS?[2,{code:o,msg:exports.ErrorCode[o]}]:(s=i,this._ultraMsgMap[s.messageUId]=s.timestamp,[2,{code:o}])}}))}))},n.prototype._handleEventChangeList=function(e){var t={Group:{map:{},types:wp},Friend:{map:{},types:xp}},n=function(e,t,n){e[t]||(e[t]=[]),e[t].push(n)};e.forEach((function(e){var r=e.changeType;for(var o in t)if(t[o].types.includes(r)){n(t[o].map,r,e);break}}));var r={Group:this._processChangeMapGroup.bind(this),Friend:this._processChangeMapFriend.bind(this)};for(var o in t)Object.keys(t[o].map).length>0&&r[o](t[o].map)},n.prototype._pullUltraChangeMessageList=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a,u,c,l;return ce(this,(function(d){switch(d.label){case 0:return this._isConnected?this._isPullingUltraChangeMessage?[2]:(this._isPullingUltraChangeMessage=!0,t=this._connMgr.codec.encodeQueryMsgChange(e),(n=new la(as[as.qryMsgChange],t,this.currentUserId)).setHeaderQos(ps.AT_LEAST_ONCE),[4,this._connMgr.send(n,Fo)]):[2];case 1:return r=d.sent(),o=r.code,i=r.data,this._isPullingUltraChangeMessage=!1,o===exports.ErrorCode.SUCCESS&&i?(s=i.hasNext,a=i.list,u=(null==i?void 0:i.syncTime)||0,this._handleUltraChangeList(a),c=this._pullUltraChangeMessageQue.filter((function(e){return e>u})),this._pullUltraChangeMessageQue.length=0,(l=this._pullUltraChangeMessageQue).push.apply(l,pe([],de(c),!1)),s?this._pullUltraChangeMessageList(u):this._lastPullingUltraChangeMessageTime=u,[2]):[2]}}))}))},n.prototype._handleUltraChangeList=function(e){var t={};e.forEach((function(e){var n=e.changeType;t[n]||(t[n]=[]),t[n].push(e)}));var n=B.CHANNEL_CHANGE,r=B.MSG_RECALL,o=B.MSG_EXPANSION,i=B.MSG_MODIFY,s=B.USER_GROUP_CHANGE;t[n]&&this._handleUltraChannelChange(t[n]),t[r]&&this._handleMsgRecall(t[r]),t[o]&&this._handleMsgUpdate(t[o]),t[i]&&this._handleMsgUpdate(t[i]),t[s]&&this._handleUserGroupStatus(t[s])},n.prototype._processChangeMapGroup=function(e){var t=m.GROUP_OPERATION,n=m.GROUP_PROFILE_CHANGE,r=m.GROUP_APPLICATION_INVITATION,o=m.GROUP_FOLLOW_USER_CHANGE;e[t]&&this._handleGroupOperation(e[t]),e[n]&&this._handleGroupProfileChange(e[n]),e[r]&&this._handleApplication(e[r]),e[o]&&this._handleFollowUserChange(e[o])},n.prototype._processChangeMapFriend=function(e){var t=this;(e[l.FRIEND_APPLICATION]||[]).forEach((function(e){var n,r,o,i,s,a,u,c,l,p,h=e.subChangeType,_=e.businessId,g=e.time,f=e.eventData,E=d.FRIEND_APPLY,I=d.FRIEND_REFUSE,T=d.FRIEND_USER_INFO,C=d.FRIENDS_INPUT,v=d.FRIEND_CLEAR,R=d.FRIEND_INFO_CHANGE,y=d.FRIEND_INFO_CHANGE_SYNC;switch(h){case E:case I:var m=h===E?exports.FriendApplicationStatus.UNHANDLED:exports.FriendApplicationStatus.REFUSED;null===(r=(n=t._watcher).friendApplicationStatusChanged)||void 0===r||r.call(n,{userId:_,applicationType:f.applyType,applicationStatus:m,directionType:f.friendType,operationTime:g,extra:f.info||""});break;case T:null===(i=(o=t._watcher).friendAdd)||void 0===i||i.call(o,{userId:_,name:f.name,portraitUri:f.portraitUrl,directionType:f.friendType,operationTime:g});break;case C:null===(a=(s=t._watcher).friendDelete)||void 0===a||a.call(s,{userIds:f.targetId,directionType:f.type,operationTime:g});break;case v:null===(c=(u=t._watcher).friendCleared)||void 0===c||c.call(u,g);break;case R:break;case y:null===(p=(l=t._watcher).friendInfoChangedSync)||void 0===p||p.call(l,{userId:_,remark:f.remarkname,extProfile:f.extProfile,operationTime:g})}}))},n.prototype._handleGroupOperation=function(e){var t=this;e.forEach((function(e){var n,r,o,i,s=e.subChangeType,a=e.businessId,u=e.time,c=e.eventData,l=c.optUserInfo,d=c.channelInfo,p=c.userInfos,h={groupId:a,operation:s,operationTime:u};l&&(n=de(Ft([l]),1),h.operatorInfo=n[0]),s===exports.GroupOperation.CREATE&&(r=de(Dt([d]),1),h.groupInfo=r[0]),[exports.GroupOperation.CREATE,exports.GroupOperation.DISMISS].includes(s)||(h.memberInfos=Ft(p)),null===(i=(o=t._watcher).groupOperation)||void 0===i||i.call(o,h)}))},n.prototype._handleGroupProfileChange=function(e){var t=this;e.forEach((function(e){var n,r,o,i,s,a,u=e.businessId,c=e.time,l=e.eventData,d=e.subChangeType,p=e.secondaryId;switch(d){case T.GROUP_INFO_CHANGE:var h=de(Ft([l.optUserInfo]),1)[0],_=de(Vt([l.channelInfo]),1)[0],g=de(l.channelFullInfo?Vt([l.channelFullInfo]):[void 0],1)[0];null===(r=(n=t._watcher).groupInfoChanged)||void 0===r||r.call(n,{operatorInfo:h,groupInfo:_,changedGroupInfo:_,operationTime:c,fullGroupInfo:g});break;case T.MEMBER_PROFILE_CHANGE:h=de(Ft([l.optUserInfo]),1)[0];var f=Ft(l.userInfos)[0];null===(i=(o=t._watcher).groupMemberInfoChanged)||void 0===i||i.call(o,{groupId:u,operatorInfo:h,memberInfo:f,operationTime:c});break;case T.GROUP_REMARK_DELETE:case T.GROUP_REMARK_SET:var E=d===T.GROUP_REMARK_SET?exports.GroupOperationType.ADD:exports.GroupOperationType.REMOVE;null===(a=(s=t._watcher).groupRemarkChangedSync)||void 0===a||a.call(s,{groupId:u,operationType:E,operationTime:c,groupRemark:p})}}))},n.prototype._handleApplication=function(e){var t=this;e.forEach((function(e){var n=e.eventData.statusInfo;Ht(n).forEach((function(e){var n,r;null===(r=(n=t._watcher).groupApplicationEvent)||void 0===r||r.call(n,e)}))}))},n.prototype._handleFollowUserChange=function(e){var t=this;e.forEach((function(e){var n,r,o=e.subChangeType,i=e.businessId,s=e.time,a=e.userGroupIds,u=1===o?exports.GroupOperationType.ADD:exports.GroupOperationType.REMOVE;null===(r=(n=t._watcher).groupFollowsChangedSync)||void 0===r||r.call(n,{groupId:i,operationType:u,operationTime:s,userIds:a})}))},n.prototype._handleUltraChannelChange=function(e){var t=this,n=[],r=[],o=[];e.forEach((function(e){var i=e.subChangeType,s=e.targetId,a=e.channelId,u=e.sendTime,c=e.operatorId,l="".concat(a,"_").concat(s),d=t._ultraGroupMap[l];if(d){var p=H.PUBLIC_TO_PRIVATE,h=H.PRIVATE_TO_PUBLIC,_=H.PUBLIC_TO_PRIVATE_USER_NOT_IN,g=H.CHANNEL_DELETE,f=H.CHANNEL_USER_KICKED;switch(i){case h:d.channelType=exports.UltraGroupChannelType.PUBLIC,n.push({targetId:s,channelId:a,changeType:exports.UltraGroupChannelChangeType.PRIVATE_TO_PUBLIC,channelType:d.channelType});break;case p:d.channelType=exports.UltraGroupChannelType.PRIVATE,n.push({targetId:s,channelId:a,changeType:exports.UltraGroupChannelChangeType.PUBLIC_TO_PRIVATE,channelType:d.channelType});break;case _:n.push({targetId:s,channelId:a,changeType:exports.UltraGroupChannelChangeType.PUBLIC_TO_PRIVATE_USER_NOT_IN,channelType:d.channelType}),delete t._ultraGroupMap[l];break;case g:r.push({targetId:s,channelId:a,channelType:d.channelType,deleteTime:u}),delete t._ultraGroupMap[l];break;case f:o.push({targetId:s,channelId:a,userId:c,channelType:exports.UltraGroupChannelType.PRIVATE}),c===t.currentUserId&&delete t._ultraGroupMap[l]}}})),n.length>0&&this._watcher.ultraGroupChannelChangeType(n),r.length>0&&this._watcher.ultraGroupChannelDelete(r),o.length>0&&this._watcher.ultraGroupChannelUserKicked(o)},n.prototype._handleMsgRecall=function(e){var t=this,n=[];e.forEach((function(e){var r=e.targetId,o=e.channelId,i=e.messageUId,s=e.sendTime,a=e.conversationType,u=e.operatorId,c=e.mentionedType;t._updateUltraGroupWhenRecallMsg(r,o,i,s,c),n.push({targetId:r,conversationType:a,sentTime:s,messageUId:i,senderUserId:u,channelId:o,content:{conversationType:a,targetId:r,messageUId:i,channelId:o},messageDirection:1,messageType:exports.MessageType.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:Ut(exports.ReceivedStatus.UNREAD)})})),this._watcher.ultraGroupMessageRecalled(n)},n.prototype._handleMsgUpdate=function(e){var t={};for(var n in e.forEach((function(e){var n=e.targetId,r=e.conversationType,o=e.sendTime,i=e.messageUId,s=e.channelId,a="".concat(r,"_").concat(n);t[a]||(t[a]=[]),t[a].push({messageUId:i,channelId:s,sendTime:o})})),t){var r=n.split("_"),o=r.shift(),i=r.join("_");this._pullUltraMessageList(e[0].changeType,{targetId:i,conversationType:Number(o),messages:pe([],de(t[n]),!1)})}},n.prototype._pullUltraMessageList=function(e,t){return ue(this,void 0,void 0,(function(){var n,r,o,i,s,a,u,c=this;return ce(this,(function(l){switch(l.label){case 0:return this._isConnected?(n=this._connMgr.codec.encodeMsgQuery(t),(r=new la(as[as.qryMsg],n,this.currentUserId)).setHeaderQos(ps.AT_LEAST_ONCE),[4,this._connMgr.send(r,Ho,{connectedTime:this._connMgr.getConnectedTime(),currentUserId:this.currentUserId})]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return o=l.sent(),i=o.code,s=o.data,i!==exports.ErrorCode.SUCCESS?[2,{code:i,msg:exports.ErrorCode[i]}]:(a=(s||{}).list,u=[],Array.isArray(a)&&a.forEach((function(e){var t=e.targetId,n=e.channelId,r=e.messageUId,o=c._ultraGroupMap["".concat(n,"_").concat(t)];o&&o.latestMessage.messageUId===r&&(o.latestMessage=e),u.push(e)})),e===B.MSG_EXPANSION&&this._watcher.ultraGroupMessageExpansionUpdated(u),e===B.MSG_MODIFY&&this._watcher.ultraGroupMessageModified(u),[2])}}))}))},n.prototype._handleUserGroupStatus=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a,u,c,l,d;return ce(this,(function(p){return t=q.REMOVE_USER_GROUP,n=q.JOIN_USER_GROUP,r=q.EXIT_USER_GROUP,o=q.CHANNEL_BIND_USER_GROUP,i=q.CHANNEL_UNBIND_USER_GROUP,s=[],a=[],u=[],c=[],l=[],e.forEach((function(e){var d=e.conversationType,p=e.targetId,h=e.userGroupIds,_=e.busChannelType,g=e.channelId;switch(e.subChangeType){case t:s.push({conversation:{conversationType:d,targetId:p},userGroupIds:h});break;case n:a.push({conversation:{conversationType:d,targetId:p},userGroupIds:h});break;case r:u.push({conversation:{conversationType:d,targetId:p},userGroupIds:h});break;case o:c.push({conversation:{conversationType:d,targetId:p,channelId:g},channelType:_,userGroupIds:h});break;case i:l.push({conversation:{conversationType:d,targetId:p,channelId:g},channelType:_,userGroupIds:h})}})),d={},s.length>0&&(d.userGroupDisband=s),a.length>0&&(d.userAdded=a),u.length>0&&(d.userRemoved=u),c.length>0&&(d.userGroupBindChannel=c),l.length>0&&(d.userGroupUnBindChannel=l),this._watcher.userGroupStatus(d),[2]}))}))},n.prototype.getUltraHistoryMsg=function(e,t,n){var r;return ue(this,void 0,void 0,(function(){var o,i,s,a,u,c;return ce(this,(function(l){switch(l.label){case 0:return this._isConnected?(o=this._connMgr.codec.encodeGetHistoryMsg(e,t),i=new la(as[as.qryUgMsg],o,this.currentUserId),this.logger.info(exports.LogTagId.L_GET_HISTORY_MSG_T,JSON.stringify({targetId:e,conversationType:exports.ConversationType.ULTRA_GROUP,channelId:t.channelId,timestamp:null==t?void 0:t.timestamp,count:null==t?void 0:t.count}),n),[4,this._connMgr.send(i,zr,{currentUserId:this.currentUserId,conversation:{conversationType:exports.ConversationType.ULTRA_GROUP,targetId:e}})]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return s=l.sent(),a=s.code,u=s.data,a===exports.ErrorCode.SUCCESS&&u?(c=[],null===(r=u.list)||void 0===r||r.forEach((function(e){e&&c.push(e.messageUId)})),this.logger.info(exports.LogTagId.L_GET_HISTORY_MSG_R,JSON.stringify({code:a,messageUIds:c.join(",")}),n),[2,{code:a,data:u}]):(this.logger.warn(exports.LogTagId.L_GET_HISTORY_MSG_R,JSON.stringify({code:a,messageUIds:""}),n),[2,{code:a}])}}))}))},n.prototype.setUltraGroupDefaultNotificationLevel=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o,i,s;return ce(this,(function(a){switch(a.label){case 0:return this._isUltraGroupListExist?this._isConnected?(r=this._connMgr.codec.encodeSetUltraGroupDefaultNotificationLevel(t,n),o=new la(as[as.ugUnpushSet],r,e),[4,this._connMgr.send(o)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]:[2,Promise.resolve({code:exports.ErrorCode.METHOD_NOT_AVAILABLE})];case 1:return i=a.sent(),s=i.code,exports.ErrorCode.SUCCESS,[2,{code:s}]}}))}))},n.prototype.getUltraGroupDefaultNotificationLevel=function(e,t){return ue(this,void 0,void 0,(function(){var n,r,o,i,s,a,u;return ce(this,(function(c){switch(c.label){case 0:return this._isUltraGroupListExist?this._isConnected?(n=this._connMgr,r=n.codec.encodeGetUltraGroupDefaultNotificationLevel(t),o=new la(as[as.ugUnpushQuery],r,e),[4,n.send(o,yo)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]:[2,Promise.resolve({code:exports.ErrorCode.METHOD_NOT_AVAILABLE})];case 1:return i=c.sent(),s=i.code,a=i.data,s===exports.ErrorCode.SUCCESS&&a?(u=a.unpushLevel,[2,{code:s,data:u}]):[2,{code:s}]}}))}))},n.prototype._updateUltraGroupWhenRecallMsg=function(e,t,n,r,o){var i="".concat(t,"_").concat(e);if(this._ultraGroupMap[i]){var s=this._ultraGroupMap[i],a=s.latestMessage,u=s.lastReadTime;a&&a.messageUId===n&&(s.latestMessage=null),r&&u<r&&s.unreadMessageCount>0&&(--s.unreadMessageCount,(o===Y.ALL||o===Y.ME)&&s.unreadMentionedCount>0&&--s.unreadMentionedCount,o===Y.ME&&s.unreadMentionedCount>0&&--s.unreadMentionedMeCount,this._watcher.conversation(Lt([s])))}},n.prototype.getAllConversationState=function(){return Promise.resolve({code:exports.ErrorCode.SUCCESS,data:this._conversationManager.getAllConversationState()})},n.prototype.getUltraGroupUnreadMentionedMessages=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i;return ce(this,(function(s){switch(s.label){case 0:return this._isConnected?this._isUltraGroupListExist?(t=this._connMgr.codec.encodeUnreadMentionedMsgQuery(e),n=new la(as[as.qryUgUal],t,this.currentUserId),[4,this._connMgr.send(n,Yr)]):[2,Promise.resolve({code:exports.ErrorCode.METHOD_NOT_AVAILABLE})]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return r=s.sent(),o=r.code,i=r.data,o===exports.ErrorCode.SUCCESS&&i?[2,{code:o,data:i}]:[2,{code:o}]}}))}))},n.prototype.getUltraGroupFirstUnreadMessageTimestamp=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o;return ce(this,(function(i){return this._isConnected?this._isUltraGroupListExist?(t=e.targetId,n=e.channelId,r=this._ultraGroupMap["".concat(n,"_").concat(t)]||{},o=r.firstUnreadMessage||null,[2,{code:exports.ErrorCode.SUCCESS,data:o}]):[2,Promise.resolve({code:exports.ErrorCode.METHOD_NOT_AVAILABLE})]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))},n.prototype.subscribeUser=function(e,t,n){return ue(this,void 0,void 0,(function(){return ce(this,(function(r){return this._isConnected?[2,this._subscribeManager.updateSubscribeRelation(e,t,exports.SubscribeOperationType.SUBSCRIBE,n)]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))},n.prototype.unSubscribeUser=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){switch(n.label){case 0:return this._isConnected?[4,this._subscribeManager.updateSubscribeRelation(e,t,exports.SubscribeOperationType.UNSUBSCRIBE)]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return[2,{code:n.sent().code}]}}))}))},n.prototype.getSubscribeUserList=function(e,t,n){var r;return ue(this,void 0,void 0,(function(){var o;return ce(this,(function(i){return this._isConnected?(o=null===(r=this._subscribeManager)||void 0===r?void 0:r.getSubscribeUserList(e,t,n),[2,Promise.resolve({code:exports.ErrorCode.SUCCESS,data:o})]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))},n.prototype.getSubscribeUserStatus=function(e,t){var n;return ue(this,void 0,void 0,(function(){var r;return ce(this,(function(o){return this._isConnected?(r=null===(n=this._subscribeManager)||void 0===n?void 0:n.getSubscribeUserStatus(e,t),[2,Promise.resolve({code:exports.ErrorCode.SUCCESS,data:r})]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))},n.prototype.updateMyUserProfile=function(e){var t;return ue(this,void 0,void 0,(function(){var n,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return this._isConnected?(n=Xi.encode(li,he(this,r,"m",o).call(this,e)),[4,this._connMgr.query(as.updUserProfile,this.currentUserId,n,pi)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return(i=u.sent()).isOk?(s=i.data.version,null===(t=this._subscribeManager)||void 0===t||t.updateOwnProfile(e,s),[2,i.wipe()]):(a=i.data.censorFailedFields,[2,st(i.code,"",a&&0!==a.length?{errorKeys:a,errorKey:a[0]}:void 0)])}}))}))},n.prototype.getMyUserProfile=function(){return this._isConnected?this._subscribeManager.getOwnProfile():Promise.resolve({code:exports.ErrorCode.RC_NET_UNAVAILABLE})},n.prototype.getUserProfiles=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return this._isConnected?[2,this._subscribeManager.getUserProfiles(e)]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))},n.prototype.updateMyUserProfileVisibility=function(e){return ue(this,void 0,void 0,(function(){var t,n;return ce(this,(function(r){switch(r.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodeUserProfilePermission(e),n=new la(as[as.updProfilePermiss],t,this.currentUserId),[4,this._connMgr.send(n)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return[2,{code:r.sent().code}]}}))}))},n.prototype.getMyUserProfileVisibility=function(){return ue(this,void 0,void 0,(function(){var e,t,n,r,o;return ce(this,(function(i){switch(i.label){case 0:return this._isConnected?(e=this._connMgr.codec.encodeUserProfileInput(),t=new la(as[as.qProfilePermiss],e,this.currentUserId),[4,this._connMgr.send(t,fi)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return n=i.sent(),r=n.code,o=n.data,r!==exports.ErrorCode.SUCCESS?[2,{code:r}]:[2,{code:r,data:null==o?void 0:o.permission}]}}))}))},n.prototype.searchUserProfileByUniqueId=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s;return ce(this,(function(a){switch(a.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodeSearchUserProfile(e),n=new la(as[as.searchUserProfile],t,this.currentUserId),[4,this._connMgr.send(n,li)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return r=a.sent(),o=r.code,i=r.data,o===exports.ErrorCode.SUCCESS&&i?(s=Pt(i.userId,i.userProfile,i.userExtProfile),[2,{code:o,data:s}]):[2,{code:o}]}}))}))},n.prototype.bindRTCRoomForChatroom=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o;return ce(this,(function(i){switch(i.label){case 0:return this._isConnected?(t=e.chatRoomId,n=this._connMgr.codec.encodebindRTCRoomForChatroom(e),r=new la(as[as.setRtcRoomId],n,t),[4,this._connMgr.send(r)]):[2,exports.ErrorCode.RC_NET_UNAVAILABLE];case 1:return o=i.sent(),[2,o.code]}}))}))},n.prototype.rtcSignaling=function(e,t,n,r){return ue(this,void 0,void 0,(function(){var o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return this._isConnected?(o=n?new la(t,r,e):new da(t,r,e),[4,this._connMgr.send(o)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return i=u.sent(),s=i.code,a=i.data,[2,{code:s,buffer:a instanceof pa||null==a?void 0:a.pbData}]}}))}))},n.prototype.rtcPing=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return r=ls(this.rtcCodec,t,n),[4,this.rtcSignaling(e,as[as.rtcPing],!0,r)];case 1:return o=u.sent(),i=o.code,s=o.buffer,i!==exports.ErrorCode.SUCCESS?[2,{code:i}]:((a=this.rtcCodec.decode(ns.RtcOutput,s)).version=mt(a.version),[2,{code:i,data:a}])}}))}))},n.prototype.getDeviceId=function(){return Pa()},n.prototype.getOSInfo=function(){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){return[2,{code:exports.ErrorCode.NOT_SUPPORT}]}))}))},n.prototype.getProcessInfo=function(){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){return[2,{code:exports.ErrorCode.NOT_SUPPORT}]}))}))},n.prototype.getMainProcessInfo=function(){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){return[2,{code:exports.ErrorCode.NOT_SUPPORT}]}))}))},n.prototype.destroy=function(){ue(void 0,void 0,void 0,(function(){var e,t;return ce(this,(function(n){switch(n.label){case 0:return np?(up&&(clearTimeout(up),up=null),[4,np]):[2];case 1:return(e=n.sent())&&(t=e.db,dp.push(t)),np=null,[2]}}))}))},n.prototype.callExtra=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return Promise.resolve({code:exports.ErrorCode.NOT_SUPPORT})},n.prototype.setProxy=function(e){return Promise.resolve({code:exports.ErrorCode.NOT_SUPPORT})},n.prototype.getProxy=function(){return Promise.resolve({code:exports.ErrorCode.NOT_SUPPORT})},n.prototype.testProxy=function(e,t){return Promise.resolve({status:exports.ErrorCode.NOT_SUPPORT})},n.prototype.setNetwork=function(e,t){var n;if(this._connMgr.setNetwork(e,t),e.status&&this.cloudControllerUri){var r=this._connMgr.getToken();null===(n=this.cloudController)||void 0===n||n.request(this.cloudControllerUri,dn.newWorkChange,r)}},n.prototype.createGroup=function(e,t,n,r){return ue(this,void 0,void 0,(function(){var o,i,s;return ce(this,(function(a){switch(a.label){case 0:return o=Kd(e,t,n,r),[4,this._connMgr.query(as.channelCreate,e,o,Ti)];case 1:return(i=a.sent()).data?(s={errorKeys:i.data.censorFailedFields,processCode:i.data.processCode||0},[2,i.isOk?it():st(i.code,i.msg,s)]):[2,i.wipe()]}}))}))},n.prototype.updateGroupInfo=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o;return ce(this,(function(i){switch(i.label){case 0:return r=Kd(e,t,n),[4,this._connMgr.query(as.upChannelInfo,e,r,Ti)];case 1:return(o=i.sent()).data?[2,o.isOk?it():st(o.code,o.msg,{errorKeys:o.data.censorFailedFields})]:[2,o.wipe()]}}))}))},n.prototype.getGroupsInfo=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return t=this._connMgr.codec.encodeMultiChannels(e),n=new la(as[as.qChannelInfo],t,e[0]),[4,this._connMgr.send(n,Si)];case 1:return r=u.sent(),o=r.code,i=r.data,o===exports.ErrorCode.SUCCESS&&i?(s=i.result.list,a=Dt(void 0===s?[]:s),[2,{code:o,data:a}]):[2,{code:o}]}}))}))},n.prototype.kickGroupMembers=function(e,t,n){var r;return ue(this,void 0,void 0,(function(){var o,i,s,a,u;return ce(this,(function(c){switch(c.label){case 0:return o=this._connMgr.codec.encodeQuitGroup("kick",e,t,!0,n),i=new la(as[as.channelMemKick],o,e),[4,this._connMgr.send(i,Ti)];case 1:return s=c.sent(),a=s.code,u=s.data,a!==exports.ErrorCode.SUCCESS?[2,{code:a,msg:null!==(r=null==u?void 0:u.msg)&&void 0!==r?r:""}]:[2,{code:a}]}}))}))},n.prototype.quitGroup=function(e,t){var n;return ue(this,void 0,void 0,(function(){var r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return r=this._connMgr.codec.encodeQuitGroup("quit",e,[],!0,t),o=new la(as[as.channelMemQuit],r,e),[4,this._connMgr.send(o,Ti)];case 1:return i=u.sent(),s=i.code,a=i.data,s!==exports.ErrorCode.SUCCESS?[2,{code:s,msg:null!==(n=null==a?void 0:a.msg)&&void 0!==n?n:""}]:[2,{code:s}]}}))}))},n.prototype.dismissGroup=function(e){var t;return ue(this,void 0,void 0,(function(){var n,r,o,i,s;return ce(this,(function(a){switch(a.label){case 0:return n=this._connMgr.codec.encodeQuitGroup("dismiss",e),r=new la(as[as.channelDismiss],n,e),[4,this._connMgr.send(r,Ti)];case 1:return o=a.sent(),i=o.code,s=o.data,i!==exports.ErrorCode.SUCCESS?[2,{code:i,msg:null!==(t=null==s?void 0:s.msg)&&void 0!==t?t:""}]:[2,{code:i}]}}))}))},n.prototype.transferGroupOwner=function(e,t,n,r){var o;return ue(this,void 0,void 0,(function(){var i,s,a,u,c;return ce(this,(function(l){switch(l.label){case 0:return i=this._connMgr.codec.encodeQuitGroup("transfer",e,[t],n,r),s=new la(as[as.channelTransfer],i,e),[4,this._connMgr.send(s,Ti)];case 1:return a=l.sent(),u=a.code,c=a.data,u!==exports.ErrorCode.SUCCESS?[2,{code:u,msg:null!==(o=null==c?void 0:c.msg)&&void 0!==o?o:""}]:[2,{code:u}]}}))}))},n.prototype.setGroupManagers=function(e,t,n){var r;return ue(this,void 0,void 0,(function(){var o,i,s,a,u;return ce(this,(function(c){switch(c.label){case 0:return o=this._connMgr.codec.encodeModifyChannelsInput(e,t,n),i=new la(as[as.upChannelManager],o,t),[4,this._connMgr.send(i,Ti)];case 1:return s=c.sent(),a=s.code,u=s.data,a!==exports.ErrorCode.SUCCESS?[2,{code:a,msg:null!==(r=null==u?void 0:u.msg)&&void 0!==r?r:""}]:[2,{code:a}]}}))}))},n.prototype.getGroupMembersByRole=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o,i,s,a,u,c,l,d,p,h;return ce(this,(function(_){switch(_.label){case 0:return r=this._connMgr.codec.encodeChannelsQueryInput({type:"getGroupMembersByRole",groupId:e,option:n,roleType:t}),o=new la(as[as.qChannelMem],r,e),[4,this._connMgr.send(o,Si)];case 1:return i=_.sent(),s=i.code,a=i.data,s===exports.ErrorCode.SUCCESS&&a?(u=a.result,c=a.page,d=(l=c||{}).pageToken,p=l.hasNext,[],h=Ft(u.list),[2,{code:s,data:{data:h,pageToken:p&&d?d:""}}]):[2,{code:s}]}}))}))},n.prototype.getGroupMembers=function(e,t){return ue(this,void 0,void 0,(function(){var n,r,o,i,s,a,u;return ce(this,(function(c){switch(c.label){case 0:return n=this._connMgr.codec.encodeChannelsQueryInput({type:"getGroupMembers",groupId:e,ids:t}),r=new la(as[as.qChannelSpeMem],n,e),[4,this._connMgr.send(r,Si)];case 1:return o=c.sent(),i=o.code,s=o.data,i!==exports.ErrorCode.SUCCESS?[2,{code:i}]:s?(a=s.result,[],u=Ft(a.list),[2,{code:i,data:u}]):[2,{code:i,data:[]}]}}))}))},n.prototype.setGroupMemberInfo=function(e,t,n,r){return ue(this,void 0,void 0,(function(){var o,i;return ce(this,(function(s){switch(s.label){case 0:return o=Xi.encode(Ai,{targetId:e,type:exports.ConversationType.GROUP,userId:t,channelNickName:n,additional:r}),[4,this._connMgr.query(as.upChannelMem,e,o,Ti)];case 1:return(i=s.sent()).data?[2,i.isOk?it():st(i.code,i.msg,{errorKeys:i.data.censorFailedFields})]:[2,i.wipe()]}}))}))},n.prototype.searchGroupMembers=function(e,t,n){return Promise.resolve({code:exports.ErrorCode.NOT_SUPPORT})},n.prototype.joinGroup=function(e){var t;return ue(this,void 0,void 0,(function(){var n,r,o,i,s;return ce(this,(function(a){switch(a.label){case 0:return n=this._connMgr.codec.encodeJoinGroup("join",e),r=new la(as[as.channelMemJoin],n,e),[4,this._connMgr.send(r,Ti)];case 1:return o=a.sent(),i=o.code,s=o.data,[2,{code:i,data:{processCode:null!==(t=null==s?void 0:s.processCode)&&void 0!==t?t:0}}]}}))}))},n.prototype.inviteUsersToGroup=function(e,t){var n,r;return ue(this,void 0,void 0,(function(){var o,i,s,a,u;return ce(this,(function(c){switch(c.label){case 0:return o=this._connMgr.codec.encodeJoinGroup("invite",e,t),i=new la(as[as.channelMemInvite],o,e),[4,this._connMgr.send(i,Ti)];case 1:return s=c.sent(),a=s.code,u=s.data,a!==exports.ErrorCode.SUCCESS?[2,{code:a,msg:null!==(n=null==u?void 0:u.msg)&&void 0!==n?n:""}]:[2,{code:a,data:{processCode:null!==(r=null==u?void 0:u.processCode)&&void 0!==r?r:0}}]}}))}))},n.prototype.memberInviteResponse=function(e){var t,n;return ue(this,void 0,void 0,(function(){var r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return r=this._connMgr.codec.encodeMemberResponseInput(e),o=new la(as[as.channelApplyResp],r,e.groupId),[4,this._connMgr.send(o,Ti)];case 1:return i=u.sent(),s=i.code,a=i.data,s!==exports.ErrorCode.SUCCESS?[2,{code:s,msg:null!==(t=null==a?void 0:a.msg)&&void 0!==t?t:""}]:[2,{code:s,data:{processCode:null!==(n=null==a?void 0:a.processCode)&&void 0!==n?n:0}}]}}))}))},n.prototype.getGroupApplications=function(e,t,n){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a,u,c,l,d;return ce(this,(function(p){switch(p.label){case 0:return t=this._connMgr.codec.encodeChannelsQueryInput({type:"getGroupApplications",option:e}),n=new la(as[as.qChannelApplyList],t,this.currentUserId),[4,this._connMgr.send(n,Si)];case 1:return r=p.sent(),o=r.code,i=r.data,o===exports.ErrorCode.SUCCESS&&i?(s=i.result,a=i.page,c=(u=a||{}).pageToken,l=u.hasNext,d=Ht(null==s?void 0:s.list)||[],[2,{code:o,data:{data:d,pageToken:l&&c?c:""}}]):[2,{code:o}]}}))}))},n.prototype.getJoinedGroupsByRole=function(e,t){return ue(this,void 0,void 0,(function(){var n,r,o,i,s,a,u,c,l,d,p;return ce(this,(function(h){switch(h.label){case 0:return n=this._connMgr.codec.encodeChannelsQueryInput({type:"getJoinedGroupsByRole",option:t,roleType:e}),r=new la(as[as.qChannelMemJoin],n,this.currentUserId),[4,this._connMgr.send(r,Si)];case 1:return o=h.sent(),i=o.code,s=o.data,i===exports.ErrorCode.SUCCESS&&s?(a=s.result,u=s.page,l=(c=u||{}).pageToken,d=c.hasNext,p=Dt(a.list),[2,{code:i,data:{data:p,pageToken:d&&l?l:""}}]):[2,{code:i}]}}))}))},n.prototype.searchJoinedGroups=function(e,t){return Promise.resolve({code:exports.ErrorCode.NOT_SUPPORT})},n.prototype.getJoinedGroups=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return t=this._connMgr.codec.encodeChannelsQueryInput({type:"getJoinedGroups",ids:e}),n=new la(as[as.qChannelMemSpeJoin],t,this.currentUserId),[4,this._connMgr.send(n,Si)];case 1:return r=u.sent(),o=r.code,i=r.data,o===exports.ErrorCode.SUCCESS&&i?(s=i.result.list,a=Dt(s),[2,{code:o,data:a}]):[2,{code:o}]}}))}))},n.prototype.setGroupRemark=function(e,t){return ue(this,void 0,void 0,(function(){var n,r;return ce(this,(function(o){switch(o.label){case 0:return n=this._connMgr.codec.encodeSetGroupRemark(e,t),r=new la(as[as.upChannelRemark],n,e),[4,this._connMgr.send(r)];case 1:return[2,{code:o.sent().code}]}}))}))},n.prototype.setGroupFollows=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o;return ce(this,(function(i){switch(i.label){case 0:return r=this._connMgr.codec.encodeSetGroupFollows(e,t,n),o=new la(as[as.upChannelFollow],r,t),[4,this._connMgr.send(o)];case 1:return[2,{code:i.sent().code}]}}))}))},n.prototype.getGroupFollows=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return t=this._connMgr.codec.encodeChannelsQueryInput({type:"getGroupFollows",groupId:e}),n=new la(as[as.qChannelFollow],t,this.currentUserId),[4,this._connMgr.send(n,Si)];case 1:return r=u.sent(),o=r.code,i=r.data,o===exports.ErrorCode.SUCCESS&&i?(s=i.result,c=s.list,a=c.map((function(e){var t=e.userId,n=e.opTime;return{userId:t,time:mt(n)}})),[2,{code:o,data:a}]):[2,{code:o}]}var c}))}))},n.prototype.addFriend=function(e,t,n){var r;return ue(this,void 0,void 0,(function(){var o,i,s,a,u;return ce(this,(function(c){switch(c.label){case 0:return o=this._connMgr.codec.encodeFriendInput({targetId:e,type:t,info:n}),i=new la(as[as.friendAdd],o,this.currentUserId),[4,this._connMgr.send(i,Ti)];case 1:return s=c.sent(),a=s.code,u=s.data,a===exports.ErrorCode.SUCCESS&&u?[2,{code:a,data:{processCode:null!==(r=null==u?void 0:u.processCode)&&void 0!==r?r:0}}]:[2,{code:a}]}}))}))},n.prototype.deleteFriends=function(e,t){return ue(this,void 0,void 0,(function(){var n,r;return ce(this,(function(o){switch(o.label){case 0:return n=this._connMgr.codec.encodeFriendsInput(e,t),r=new la(as[as.friendDel],n,this.currentUserId),[4,this._connMgr.send(r)];case 1:return[2,{code:o.sent().code}]}}))}))},n.prototype.acceptFriendApplication=function(e){return ue(this,void 0,void 0,(function(){var t,n;return ce(this,(function(r){switch(r.label){case 0:return t=this._connMgr.codec.encodeFriendInput({targetId:e,type:1}),n=new la(as[as.friendHandle],t,this.currentUserId),[4,this._connMgr.send(n)];case 1:return[2,{code:r.sent().code}]}}))}))},n.prototype.refuseFriendApplication=function(e,t){return ue(this,void 0,void 0,(function(){var n,r;return ce(this,(function(o){switch(o.label){case 0:return n=this._connMgr.codec.encodeFriendInput({targetId:e,type:2,info:t}),r=new la(as[as.friendHandle],n,this.currentUserId),[4,this._connMgr.send(r)];case 1:return[2,{code:o.sent().code}]}}))}))},n.prototype.setFriendInfo=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o;return ce(this,(function(i){switch(i.label){case 0:return r=Xi.encode(bi,{targetId:e,remarkName:t,extProfile:Yd(n)}),[4,this._connMgr.query(as.friendSetPf,this.currentUserId,r,Pi)];case 1:return(o=i.sent()).isOk?[2,o.wipe()]:[2,st(o.code,"",{errorKeys:o.data.censorFailedFields})]}}))}))},n.prototype.checkFriends=function(e,t){return ue(this,void 0,void 0,(function(){var n,r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return n=this._connMgr.codec.encodeFriendsInput(e,t),r=new la(as[as.friendCheck],n,this.currentUserId),[4,this._connMgr.send(r,Ui)];case 1:return o=u.sent(),i=o.code,s=o.data,i!==exports.ErrorCode.SUCCESS?[2,{code:i}]:s?(a=s.list.map((function(e){return{userId:e.targetId,relationType:e.status}})),[2,{code:i,data:a}]):[2,{code:i,data:[]}]}}))}))},n.prototype.getFriends=function(e,t){return ue(this,void 0,void 0,(function(){var n,r,o,i,s,a,u,c,l,d;return ce(this,(function(p){switch(p.label){case 0:return n=this._connMgr.codec.encodeFriendQueryInput(11,t,e),r=new la(as[as.friendsQuery],n,this.currentUserId),[4,this._connMgr.send(r,Si)];case 1:return o=p.sent(),i=o.code,s=o.data,i===exports.ErrorCode.SUCCESS&&s?(a=s.result,u=s.page,l=(c=u||{}).pageToken,d=c.hasNext,a&&a.list?[2,{code:i,data:{data:kp(a.list),pageToken:d&&l?l:""}}]:[2,{code:i,data:{data:[],pageToken:d&&l?l:""}}]):[2,{code:i}]}}))}))},n.prototype.getFriendApplications=function(e,t,n){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a,u,c,l;return ce(this,(function(d){switch(d.label){case 0:return t=this._connMgr.codec.encodeFriendQueryInput(12,e),n=new la(as[as.friendsQuery],t,this.currentUserId),[4,this._connMgr.send(n,Si)];case 1:return r=d.sent(),o=r.code,i=r.data,o!==exports.ErrorCode.SUCCESS?[2,{code:o}]:i?(s=i.result,a=i.page,c=(u=a||{}).pageToken,l=u.hasNext,[2,{code:o,data:{data:Fp(s),pageToken:l&&c?c:""}}]):[2,{code:o,data:{data:[],pageToken:""}}]}}))}))},n.prototype.deleteFriendApplication=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){return[2,{code:exports.ErrorCode.NOT_SUPPORT}]}))}))},n.prototype.getFriendsInfo=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i;return ce(this,(function(s){switch(s.label){case 0:return t=this._connMgr.codec.encodeFriendsListInput(e),n=new la(as[as.friendsInfoQry],t,this.currentUserId),[4,this._connMgr.send(n,Vi)];case 1:return r=s.sent(),o=r.code,i=r.data,o!==exports.ErrorCode.SUCCESS?[2,{code:o}]:i?[2,{code:o,data:kp(i.list)}]:[2,{code:o,data:[]}]}}))}))},n.prototype.searchFriendsInfo=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){return[2,Promise.resolve({code:exports.ErrorCode.NOT_SUPPORT})]}))}))},n.prototype.setFriendAddPermission=function(e){return ue(this,void 0,void 0,(function(){var t,n;return ce(this,(function(r){switch(r.label){case 0:return t=this._connMgr.codec.encodeFriendLevelSet(e),n=new la(as[as.friendAuthSet],t,this.currentUserId),[4,this._connMgr.send(n)];case 1:return[2,{code:r.sent().code}]}}))}))},n.prototype.getFriendAddPermission=function(){return ue(this,void 0,void 0,(function(){var e,t,n,r,o;return ce(this,(function(i){switch(i.label){case 0:return e=this._connMgr.codec.encodeFriendInput({targetId:this.currentUserId}),t=new la(as.friendAuthGet,e,this.currentUserId),[4,this._connMgr.send(t,Di)];case 1:return n=i.sent(),r=n.code,o=n.data,r===exports.ErrorCode.SUCCESS&&o?[2,{code:r,data:o}]:[2,{code:r}]}}))}))},n.prototype.getConversationListWithAllChannel=function(){throw new Error("Method not implemented.")},n.prototype.getConversationListWithAllChannelByPage=function(e,t){throw new Error("Method not implemented.")},n.prototype.getConversationsByPage=function(e,t,n,r,o){throw new Error("Method not implemented.")},n.prototype.getContinuousMessages=function(e,t,n,r,o,i){throw new Error("Method not implemented.")},n.prototype.getHistoryMessagesByObjectNames=function(e,t,n,r,o,i,s){throw new Error("Method not implemented.")},n.prototype.clearConversations=function(){throw new Error("Method not implemented.")},n.prototype.setUserStatusListener=function(e,t){throw new Error("Method not implemented.")},n.prototype.setUserStatus=function(e){throw new Error("Method not implemented.")},n.prototype.subscribeUserStatus=function(e){throw new Error("Method not implemented.")},n.prototype.getUserStatus=function(e){throw new Error("Method not implemented.")},n.prototype.addToBlacklist=function(e){return Promise.resolve(exports.ErrorCode.NOT_SUPPORT)},n.prototype.removeFromBlacklist=function(e){return Promise.resolve(exports.ErrorCode.NOT_SUPPORT)},n.prototype.getBlacklist=function(){return Promise.resolve({code:exports.ErrorCode.NOT_SUPPORT})},n.prototype.getBlacklistStatus=function(e){return Promise.resolve({code:exports.ErrorCode.NOT_SUPPORT})},n.prototype.insertMessage=function(e,t,n){throw new Error("Method not implemented.")},n.prototype.batchInsertMessage=function(e,t){throw new Error("Method not implemented.")},n.prototype.getMessageCount=function(e,t,n){throw new Error("Method not implemented.")},n.prototype.deleteMessages=function(e){throw new Error("Method not implemented.")},n.prototype.deleteMessagesByTimestamp=function(e,t,n,r,o){throw new Error("Method not implemented.")},n.prototype.batchClearMessagesByTimestamp=function(e){throw new Error("Method not implemented.")},n.prototype.clearMessages=function(e,t,n){throw new Error("Method not implemented.")},n.prototype.getMessage=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){return[2,st(exports.ErrorCode.NOT_SUPPORT,"Not support")]}))}))},n.prototype.setMessageContent=function(e,t,n){throw new Error("Method not implemented.")},n.prototype.setMessageSearchField=function(e,t,n){throw new Error("Method not implemented.")},n.prototype.searchConversationByContent=function(e,t,n,r){throw new Error("Method not implemented.")},n.prototype.searchConversationByContentWithAllChannel=function(e,t,n){throw new Error("Method not implemented.")},n.prototype.searchMessageByContent=function(e,t,n,r,o,i){throw new Error("Method not implemented.")},n.prototype.searchMessageByContentAndMessageType=function(e,t,n,r,o,i,s){throw new Error("Method not implemented.")},n.prototype.searchMessagesByUser=function(e,t,n,r,o,i){throw new Error("Method not implemented.")},n.prototype.getMessagesByTimestamp=function(e,t,n,r){throw new Error("Method not implemented.")},n.prototype.searchMessageByContentWithAllChannel=function(e,t,n,r,o){throw new Error("Method not implemented.")},n.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(e,t,n,r,o,i,s){throw new Error("Method not implemented.")},n.prototype.getUnreadMentionedMessages=function(e,t){throw new Error("Method not implemented.")},n.prototype.setMessageSentStatus=function(e,t){throw new Error("Method not implemented.")},n.prototype.updateMessageReceiptStatus=function(e,t,n,r){throw new Error("Method not implemented.")},n.prototype.setMessageReceivedStatus=function(e,t){throw new Error("Method not implemented.")},n.prototype.clearData=function(){throw new Error("Method not implemented.")},n.prototype.clearUnreadCountByTimestamp=function(e,t,n,r){throw new Error("Method not implemented.")},n.prototype.setCallInfo=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return(r=this._connMgr)?(o=r.codec.encodeSetCallInfo(t,n),[4,r.send(new la(as.reqCall,o,e),Qo)]):[3,2];case 1:return i=u.sent(),s=i.code,a=i.data,s===exports.ErrorCode.SUCCESS&&a?[2,Promise.resolve({code:s,data:{key:a.key,value:a.dataContent}})]:[2,Promise.resolve({code:s})];case 2:return[2,Promise.resolve({code:exports.ErrorCode.RC_NET_CHANNEL_INVALID})]}}))}))},n.prototype.getGroupMessageDeliverList=function(e,t,n){throw new Error("Method not implemented.")},n.prototype.getPrivateMessageDeliverTime=function(e,t){throw new Error("Method not implemented.")},n.prototype.setCheckDuplicateMessage=function(e){throw new Error("Method not implemented.")},n.prototype.setCheckChatRoomDuplicateMessage=function(e){throw new Error("Method not implemented.")},n.prototype.getConversations=function(e){throw new Error("Method not implemented.")},n.prototype.getRealtimeConversations=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o,i,s,a,u,c,l,d,p=this;return ce(this,(function(h){switch(h.label){case 0:return o=(r=this).currentUserId,i=r._connMgr,s=exports.ConversationType.PRIVATE,a=i.codec.encodeOldConversationList({count:e,type:s,startTime:t,order:n}),u=new la(as.qrySessions,a,o),[4,i.send(u,Hr,{currentUserId:o,connectedTime:i.getConnectedTime(),afterDecode:function(e){var t=e.conversationType,n=e.targetId,r=e.channelId,o=e.unreadMessageCount,i=p._conversationManager.get(t,n,r);Object.assign(e,i,{unreadMessageCount:o});var s=p._conversationManager.getDraft(t,n,r);return e.draft=s,e}})];case 1:return c=h.sent(),l=c.code,d=c.data,l!==exports.ErrorCode.SUCCESS?[2,{code:l}]:[2,{code:l,data:null==d?void 0:d.list.sort((function(e,t){var r,o,i=(null===(r=e.latestMessage)||void 0===r?void 0:r.sentTime)||0,s=(null===(o=t.latestMessage)||void 0===o?void 0:o.sentTime)||0;return 0===n?s-i:i-s}))}]}}))}))},n.prototype.getRealtimeConTotalUnreadCount=function(){return ue(this,void 0,void 0,(function(){var e,t,n,r,o;return ce(this,(function(i){switch(i.label){case 0:return e=this._connMgr.codec.encodeSessionAttInput(),t=new la(as.qrySessionsAtt,e,this.getCurrentUserId()),[4,this._connMgr.send(t,Xr)];case 1:return n=i.sent(),r=n.code,o=n.data,[2,{code:r,data:(null==o?void 0:o.totalUnreadCount)||0}]}}))}))},n.prototype.clearRealtimeConUnreadCount=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o;return ce(this,(function(i){switch(i.label){case 0:return t=e.conversationType,n=e.targetId,this._conversationManager.clearUnreadCount(t,n,"",this.getServerTime(),!1),r=this._connMgr.codec.encodeSessionMsgReadInput(e,this.getServerTime()),o=new da(as[as.updRRTime],r,this.currentUserId),[4,this._connMgr.send(o)];case 1:return[2,{code:i.sent().code}]}}))}))},n.prototype.removeRealtimeConversations=function(e){return ue(this,void 0,void 0,(function(){var t,n;return ce(this,(function(r){switch(r.label){case 0:return t=this._connMgr,n=new la(as.delSessions,t.codec.encodeRemoveConversationList(e),this.getCurrentUserId()),[4,t.send(n)];case 1:return[2,{code:r.sent().code}]}}))}))},n.prototype.getRealtimeConUnreadCounts=function(e){var t,n;return ue(this,void 0,void 0,(function(){var r,o,i;return ce(this,(function(s){switch(s.label){case 0:return r=this._connMgr.codec.encodeQuerySessionsInput(e),o=new la(as[as.qrySessionsUnread],r,this.currentUserId),[4,this._connMgr.send(o,ro)];case 1:return(i=s.sent()).code===exports.ErrorCode.SUCCESS&&i.data?[2,{code:i.code,data:null===(n=null===(t=i.data)||void 0===t?void 0:t.sessions)||void 0===n?void 0:n.map((function(e){return{conversationType:e.type,targetId:e.channelId,channelId:e.busChannel||"",unreadCount:mt(e.unreadCount)}}))}]:[2,{code:i.code}]}}))}))},n.prototype.setNotificationQuietHoursWithSetting=function(e){return ue(this,void 0,void 0,(function(){var t;return ce(this,(function(n){switch(n.label){case 0:return t=Xi.encode(Gi,e),[4,this._connMgr.query(as.addUnpush,this.currentUserId,t)];case 1:return[2,n.sent().wipe()]}}))}))},n.prototype.removeNotificationQuietHoursSetting=function(){return ue(this,void 0,void 0,(function(){var e;return ce(this,(function(t){switch(t.label){case 0:return e=Xi.encode(ki,{nothing:0}),[4,this._connMgr.query(as.delUnpush,this.currentUserId,e)];case 1:return[2,t.sent().wipe()]}}))}))},n.prototype.getNotificationQuietHoursSetting=function(){return ue(this,void 0,void 0,(function(){var e;return ce(this,(function(t){switch(t.label){case 0:return e=Xi.encode(Fi,{nothing:0}),[4,this._connMgr.query(as.qryUnpush,this.currentUserId,e,Bi)];case 1:return[2,t.sent().trans((function(e){var t=e.isUnpush,n=e.spanMinutes,r=e.startTime,o=e.level,i=e.timezone;return t?{spanMinutes:n,startTime:r,level:o,timezone:i}:{spanMinutes:0,startTime:"",level:exports.PushNotificationQuietHoursLevel.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT}}))]}}))}))},r=new WeakSet,o=function(e){var t={},n=e.extraProfile;return n&&(delete e.extraProfile,t.userExtProfile=Yd(n)),t.userProfile=Yd(e),t},ae([Vp()],n.prototype,"createGroup",null),ae([Vp()],n.prototype,"updateGroupInfo",null),ae([Vp()],n.prototype,"getGroupsInfo",null),ae([Vp()],n.prototype,"kickGroupMembers",null),ae([Vp()],n.prototype,"quitGroup",null),ae([Vp()],n.prototype,"dismissGroup",null),ae([Vp()],n.prototype,"transferGroupOwner",null),ae([Vp()],n.prototype,"setGroupManagers",null),ae([Vp()],n.prototype,"getGroupMembersByRole",null),ae([Vp()],n.prototype,"getGroupMembers",null),ae([Vp()],n.prototype,"setGroupMemberInfo",null),ae([Vp()],n.prototype,"joinGroup",null),ae([Vp()],n.prototype,"inviteUsersToGroup",null),ae([Vp()],n.prototype,"memberInviteResponse",null),ae([Vp()],n.prototype,"getGroupApplications",null),ae([Vp()],n.prototype,"getJoinedGroupsByRole",null),ae([Vp()],n.prototype,"getJoinedGroups",null),ae([Vp()],n.prototype,"setGroupRemark",null),ae([Vp()],n.prototype,"setGroupFollows",null),ae([Vp()],n.prototype,"getGroupFollows",null),ae([Vp()],n.prototype,"addFriend",null),ae([Vp()],n.prototype,"deleteFriends",null),ae([Vp()],n.prototype,"acceptFriendApplication",null),ae([Vp()],n.prototype,"refuseFriendApplication",null),ae([Vp()],n.prototype,"setFriendInfo",null),ae([Vp()],n.prototype,"checkFriends",null),ae([Vp()],n.prototype,"getFriends",null),ae([Vp()],n.prototype,"getFriendApplications",null),ae([Vp()],n.prototype,"deleteFriendApplication",null),ae([Vp()],n.prototype,"getFriendsInfo",null),ae([Vp()],n.prototype,"searchFriendsInfo",null),ae([Vp()],n.prototype,"setFriendAddPermission",null),ae([Vp()],n.prototype,"getFriendAddPermission",null),ae([Vp()],n.prototype,"getRealtimeConversations",null),ae([Vp()],n.prototype,"getRealtimeConTotalUnreadCount",null),ae([Vp()],n.prototype,"clearRealtimeConUnreadCount",null),ae([Vp()],n.prototype,"removeRealtimeConversations",null),ae([Vp()],n.prototype,"getRealtimeConUnreadCounts",null),ae([Gp()],n.prototype,"setNotificationQuietHoursWithSetting",null),ae([Gp()],n.prototype,"removeNotificationQuietHoursSetting",null),ae([Gp()],n.prototype,"getNotificationQuietHoursSetting",null),n}(Ia);function Hp(e){return se({},e)}function qp(e,t,n){var r=n.value;n.value=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1!==(null===(e=this.getNaviInfoFromCache())||void 0===e?void 0:e.userProfile)?Promise.resolve({code:exports.ErrorCode.RC_USER_PROFILE_SERVICE_UNAVAILABLE}):r.call.apply(r,pe([this],de(t),!1))}}function Yp(e,t,n){var r=n.value;n.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return xa(this.getNaviInfoFromCache())?r.call.apply(r,pe([this],de(e),!1)):Promise.resolve({code:exports.ErrorCode.RC_REAL_TIME_CONVERSATION_UNAVAILABLE})}}var Kp=function(){function e(e){var t,n;this._token="",this._pluginContextQueue=[],this._pluginInstanseMap={},this._versionInfo={},this._typingInfo={},this._compatibleMessageProccessor=((t={})[exports.MessageType.CHATROOM_MERGE_CHANGE]=this._processChrmMemChangeMessage.bind(this),t[exports.MessageType.TYPING_STATUS]=this._processTypingStatusMessage.bind(this),t[exports.MessageType.INTERCEPT]=this._processInterceptMessage.bind(this),t[exports.MessageType.CHATROOM_SYNC_MSG]=this._processChrmSyncMessage.bind(this),t[exports.MessageType.CHATROOM_MERGE_BLOCK]=this._processChrmMemBlockMessage.bind(this),t[exports.MessageType.CHATROOM_MERGE_BAN]=this._processChrmMemBanMessage.bind(this),t),this._messageProccessor=((n={})[exports.MessageType.READ_RECEIPT]=this._processReadReceiptMessage.bind(this),n[exports.MessageType.READ_RECEIPT_REQUEST]=this._processReadReceiptRequestMessage.bind(this),n[exports.MessageType.READ_RECEIPT_RESPONSE]=this._processReadReceiptResponseMessage.bind(this),n),this._watcher={message:void 0,batchMessage:void 0,conversationState:void 0,chatroomState:void 0,connection:void 0,expansion:void 0,tag: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,operateStatus:void 0,ultraGroupMessageExpansionUpdated:void 0,ultraGroupMessageModified:void 0,ultraGroupMessageRecalled:void 0,messageDelivered:void 0,groupMessageDeliveredStatus:void 0,ultraGroupChannelChangeType:void 0,ultraGroupChannelUserKicked:void 0,ultraGroupChannelDelete:void 0,userGroupStatus:void 0,messageReadReceipt:void 0,syncReadStatus:void 0,subscribedUserStatusChange:void 0,subscribedRelationChange:void 0,syncSubscribedUserStatusFinished:void 0,ownUserProfileChanged:void 0,groupOperation:void 0,groupInfoChanged:void 0,groupMemberInfoChanged:void 0,groupApplicationEvent:void 0,groupRemarkChangedSync:void 0,groupFollowsChangedSync:void 0,friendAdd:void 0,friendDelete:void 0,friendApplicationStatusChanged:void 0,friendCleared:void 0,friendInfoChangedSync:void 0,databaseUpgradeWillStart:void 0,databaseUpgrading:void 0,databaseUpgradeDidComplete:void 0},this._typingInternalTimer=-1,this._typingExpireTime=2e3,this._typingChangedList=[],this._registerMessageSearchPropsMapping={},this.getChatRoomHistoryMessages=this.getChatroomHistoryMessages,this._options=se({},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 r={onConnected:this._onConnectionStatusChange.bind(this,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),expansion:this._expansionInfoListener.bind(this),tag:this._tagListener.bind(this),conversationTag:this._conversationTagListener.bind(this),onRTCDataChange:this._rtcDataChange.bind(this),pullFinished:this._pullFinishedListener.bind(this),ultraGroupEnable:this._ultraGroupEnableListener.bind(this),operateStatus:this._operateStatusListener.bind(this),ultraGroupMessageExpansionUpdated:this._ultraGroupMessageExpansionUpdatedListener.bind(this),ultraGroupMessageModified:this._ultraGroupMessageModifiedListener.bind(this),ultraGroupMessageRecalled:this._ultraGroupMessageRecalledListener.bind(this),messageDelivered:this._messageDeliveredListerer.bind(this),groupMessageDeliveredStatus:this._groupMessageDeliveredStatusListerer.bind(this),callInfo:this._callInfoListener.bind(this),ultraGroupChannelChangeType:this._ultraGroupChannelChangeTypeListener.bind(this),ultraGroupChannelUserKicked:this._ultraGroupChannelUserKickedListener.bind(this),ultraGroupChannelDelete:this._ultraGroupChannelDeleteListener.bind(this),onNaviDataChange:this._naviDataChange.bind(this),userGroupStatus:this._userGroupStatusListener.bind(this),messageReadReceipt:this._messageReadReceipt.bind(this),syncReadStatus:this._syncReadStatus.bind(this),subscribedUserStatusChange:this._subscribedUserStatusChange.bind(this),subscribedRelationChange:this._subscribedRelationChange.bind(this),syncSubscribedUserStatusFinished:this._syncSubscribedUserStatusFinished.bind(this),ownUserProfileChanged:this._ownUserProfileChanged.bind(this),groupOperation:this._groupOperation.bind(this),groupInfoChanged:this._groupInfoChanged.bind(this),groupMemberInfoChanged:this._groupMemberInfoChanged.bind(this),groupApplicationEvent:this._groupApplicationEvent.bind(this),groupRemarkChangedSync:this._groupRemarkChangedSync.bind(this),groupFollowsChangedSync:this._groupFollowsChangedSync.bind(this),friendAdd:this._friendAdd.bind(this),friendDelete:this._friendDelete.bind(this),friendApplicationStatusChanged:this._friendApplicationStatusChanged.bind(this),friendCleared:this._friendCleared.bind(this),friendInfoChangedSync:this._friendInfoChangedSync.bind(this),databaseUpgradeWillStart:this._databaseUpgradeWillStart.bind(this),databaseUpgrading:this._databaseUpgrading.bind(this),databaseUpgradeDidComplete:this._databaseUpgradeDidComplete.bind(this)};this.rtcCodec=new ss(us,cs);var o=Ot();this._engine=o?new RCCppEngine(this.rtcCodec,r,this._options):new Bp(this.rtcCodec,r,this._options),this.logger=this._engine.getInnerLogger(),this.sse=new Ta(this,o)}return e.init=function(t){if(this._context)return this._context.logger.warn(exports.LogTagId.A_INIT_REPEAT_O),this._context;this._context=new e(t),this._context.logger.info(exports.LogTagId.L_INIT_O,JSON.stringify({appkey:t.appkey,navigators:t.navigators,typingExpireTime:t.typingExpireTime})),this._context.logger.warn(exports.LogTagId.L_IMSDK_VER_O,JSON.stringify({commitId:"d147c2773305ac3e7fde48a06f3798170850a662",version:"5.20.0-c-esm-alpha.1"}));var n=this._context._engine;return Tr.setNetworkStatusListener(n.setNetwork.bind(n)),this._context},e.getContext=function(){return this._context},e.prototype.getOptions=function(){return this._options},e.destroy=function(){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){switch(e.label){case 0:return this._context?(this._context.logger.info(exports.LogTagId.L_DESTROY_O),[4,this._context._destroy()]):[2];case 1:return e.sent(),this._context=void 0,[2]}}))}))},Object.defineProperty(e.prototype,"chatroom",{get:function(){return this._engine.chatroom},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"chat",{get:function(){return this._engine.chat},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataHosting",{get:function(){return this._engine.dataHosting},enumerable:!1,configurable:!0}),e.prototype.install=function(e,t){var n=this.logger.createTraceId();if(this.logger.info(exports.LogTagId.L_INSTALL_PLUGIN_T,JSON.stringify({tag:e.tag}),n),this._pluginInstanseMap[e.tag])return this.logger.warn(exports.LogTagId.L_INSTALL_PLUGIN_R,"repeat install",n),this._pluginInstanseMap[e.tag];var r="RCRTC"===e.tag?new ya(this):new Ra(this),o=null;try{if(!e.verify(Tr))return null;o=e.setup(r,Tr,t)}catch(e){this.logger.error(exports.LogTagId.L_INSTALL_PLUGIN_R,null==e?void 0:e.stack,n)}return["RCRTC","RCCall"].includes(e.tag)&&e.version&&e.name&&(this._versionInfo[e.name]=e.version),o&&(this._pluginContextQueue.push(r),this._pluginInstanseMap[e.tag]=o),o},e.prototype._onConnectionStatusChange=function(e,t){var n,r;this.logger.warn(exports.LogTagId.A_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),null===(r=(n=this._watcher).connection)||void 0===r||r.call(n,e,t),this._pluginContextQueue.forEach((function(n){var r;null===(r=n.onconnectionstatechange)||void 0===r||r.call(n,e,t)}))},e.prototype._processChrmMemChangeMessage=function(e){if("function"==typeof this._watcher.chatroomState){var t={},n=[],r=e.content.memberCount,o=void 0===r?0:r;Array.isArray(e.content.userList)&&e.content.userList.forEach((function(e){t[e.userId]=e.status,n.push({userId:e.userId,action:e.status,extra:e.extra})})),this._watcher.chatroomState({userChange:{users:t,chatroomId:e.targetId,memberCount:o,userList:n}})}return!0},e.prototype._processTypingStatusMessage=function(e){if(this._addTypingInfo(Hp(e)),this._watcher.typingState)return!0},e.prototype._processInterceptMessage=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 n=e.content.sourceType;if(t.sourceType=n,(n===exports.MessageBlockSourceType.MSG_EXPANSION||n===exports.MessageBlockSourceType.MSG_MODIFY)&&e.content.sourceContent)try{t.sourceContent=JSON.parse(e.content.sourceContent)}catch(e){this.logger.warn(exports.LogTagId.L_CALLBACK_E,JSON.stringify({source:"message.content.sourceContent",msg:e.message}))}}return this._MessageBlockedListener(t),!0},e.prototype._processChrmSyncMessage=function(e){return"function"==typeof this._watcher.chatroomState&&this._watcher.chatroomState({chatroomNotifyMultiLoginSync:{chatroomId:e.content.chatroomId,status:e.content.status,reason:e.content.reason,time:e.content.time,extra:e.content.extra||null}}),!0},e.prototype._processChrmMemBlockMessage=function(e){var t,n=e.content;return n.operateType===exports.ChrmMemOperateType.Blocked&&(null===(t=n.userList)||void 0===t?void 0:t.includes(this.getCurrentUserId()))&&this._engine.removeChatroomFromCatch(n.chatroomId),"function"==typeof this._watcher.chatroomState&&this._watcher.chatroomState({chatroomNotifyBlock:{chatroomId:n.chatroomId,operateType:n.operateType,durationTime:n.durationTime,operateTime:n.operateTime,userIdList:n.userList,extra:n.extra||null}}),!0},e.prototype._processChrmMemBanMessage=function(e){return"function"==typeof this._watcher.chatroomState&&this._watcher.chatroomState({chatroomNotifyBan:{chatroomId:e.content.chatroomId,banType:e.content.operateType,durationTime:e.content.durationTime,operateTime:e.content.operateTime,userIdList:e.content.userList,extra:e.content.extra||null}}),!0},e.prototype._processReadReceiptMessage=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)},e.prototype._processReadReceiptRequestMessage=function(e){"function"==typeof this._watcher.messageReceiptRequest&&this._watcher.messageReceiptRequest({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.content.messageUId,e.senderUserId)},e.prototype._processReadReceiptResponseMessage=function(e){var t,n=null===(t=e.content)||void 0===t?void 0:t.receiptMessageDic,r=this._engine.getCurrentUserId();n&&Array.isArray(n[r])&&"function"==typeof this._watcher.messageReceiptResponse&&this._watcher.messageReceiptResponse({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.senderUserId,n[r])},e.prototype._messageReceiver=function(e,t,n){var r,o,i,s,a=this;if(!(null===(o=(r=this._compatibleMessageProccessor)[e.messageType])||void 0===o?void 0:o.call(r,e))&&!this._pluginContextQueue.some((function(t){if(!t.onmessage)return!1;try{return t.onmessage(Hp(e))}catch(e){return a.logger.error(exports.LogTagId.A_MSG_LISTENER_E,null==e?void 0:e.stack),!1}})))return null===(s=(i=this._watcher).message)||void 0===s||s.call(i,Hp(e),t,n),e},e.prototype._batchMessageReceiver=function(e,t,n){var r=this,o=[],i=[],s=[exports.MessageType.READ_RECEIPT,exports.MessageType.READ_RECEIPT_REQUEST,exports.MessageType.READ_RECEIPT_RESPONSE];e.forEach((function(e){var a=r._messageReceiver(e,t,n);a&&s.includes(a.messageType)?i.push(a):a&&o.push(a)})),o.length&&this._watcher.batchMessage&&(this.logger.debug(exports.LogTagId.L_BATCH_MESSAGE_O,o.map((function(e){return e.messageUId})).join(",")),this._watcher.batchMessage(o)),i.length&&i.forEach((function(e){r._messageProccessor[e.messageType]&&r._messageProccessor[e.messageType](e)}))},e.prototype._chatroomInfoListener=function(e){var t,n;null===(n=(t=this._watcher).chatroomState)||void 0===n||n.call(t,e)},e.prototype._conversationInfoListener=function(e){var t,n;null===(n=(t=this._watcher).conversationState)||void 0===n||n.call(t,e)},e.prototype._expansionInfoListener=function(e){var t,n;null===(n=(t=this._watcher).expansion)||void 0===n||n.call(t,e)},e.prototype._tagListener=function(){var e,t;null===(t=(e=this._watcher).tag)||void 0===t||t.call(e)},e.prototype._conversationTagListener=function(){var e,t;null===(t=(e=this._watcher).conversationTagChanged)||void 0===t||t.call(e)},e.prototype._typingStatusListener=function(e){var t,n;null===(n=(t=this._watcher).typingState)||void 0===n||n.call(t,e)},e.prototype._pullFinishedListener=function(){var e,t;null===(t=(e=this._watcher).pullFinished)||void 0===t||t.call(e)},e.prototype._MessageBlockedListener=function(e){var t,n;null===(n=(t=this._watcher).messageBlocked)||void 0===n||n.call(t,e)},e.prototype._messageDeliveredListerer=function(e){var t,n;null===(n=(t=this._watcher).messageDelivered)||void 0===n||n.call(t,e)},e.prototype._groupMessageDeliveredStatusListerer=function(e){var t,n;null===(n=(t=this._watcher).groupMessageDeliveredStatus)||void 0===n||n.call(t,e)},e.prototype._callInfoListener=function(e){var t=this;this._pluginContextQueue.forEach((function(n){try{n.onCallInfo&&n.onCallInfo(e)}catch(e){t.logger.warn(exports.LogTagId.L_CALLBACK_E,null==e?void 0:e.stack)}}))},e.prototype._ultraGroupEnableListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupEnable)||void 0===n||n.call(t,e)},e.prototype._operateStatusListener=function(e){var t,n;null===(n=(t=this._watcher).operateStatus)||void 0===n||n.call(t,e)},e.prototype._ultraGroupMessageExpansionUpdatedListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupMessageExpansionUpdated)||void 0===n||n.call(t,e)},e.prototype._ultraGroupMessageModifiedListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupMessageModified)||void 0===n||n.call(t,e)},e.prototype._ultraGroupMessageRecalledListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupMessageRecalled)||void 0===n||n.call(t,e)},e.prototype._ultraGroupChannelChangeTypeListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupChannelChangeType)||void 0===n||n.call(t,e)},e.prototype._ultraGroupChannelUserKickedListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupChannelUserKicked)||void 0===n||n.call(t,e)},e.prototype._ultraGroupChannelDeleteListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupChannelDelete)||void 0===n||n.call(t,e)},e.prototype._userGroupStatusListener=function(e){var t,n;null===(n=(t=this._watcher).userGroupStatus)||void 0===n||n.call(t,e)},e.prototype._messageReadReceipt=function(e){var t,n;null===(n=(t=this._watcher).messageReadReceipt)||void 0===n||n.call(t,e)},e.prototype._syncReadStatus=function(e){var t,n;null===(n=(t=this._watcher).syncReadStatus)||void 0===n||n.call(t,e)},e.prototype._subscribedUserStatusChange=function(e){var t,n;null===(n=(t=this._watcher).subscribedUserStatusChange)||void 0===n||n.call(t,e)},e.prototype._subscribedRelationChange=function(e){var t,n;null===(n=(t=this._watcher).subscribedRelationChange)||void 0===n||n.call(t,e)},e.prototype._syncSubscribedUserStatusFinished=function(e){var t,n;this.logger.info(exports.LogTagId.L_SYNC_SUBSCRIBED_USER_STATUS_FINISHED_S),null===(n=(t=this._watcher).syncSubscribedUserStatusFinished)||void 0===n||n.call(t,e)},e.prototype._ownUserProfileChanged=function(e){var t,n;this.logger.info(exports.LogTagId.L_OWN_USER_PROFILE_CHANGED_S),null===(n=(t=this._watcher).ownUserProfileChanged)||void 0===n||n.call(t,e)},e.prototype._groupOperation=function(e){var t,n;null===(n=(t=this._watcher).groupOperation)||void 0===n||n.call(t,e)},e.prototype._groupInfoChanged=function(e){var t,n;null===(n=(t=this._watcher).groupInfoChanged)||void 0===n||n.call(t,e)},e.prototype._groupMemberInfoChanged=function(e){var t,n;null===(n=(t=this._watcher).groupMemberInfoChanged)||void 0===n||n.call(t,e)},e.prototype._groupApplicationEvent=function(e){var t,n;null===(n=(t=this._watcher).groupApplicationEvent)||void 0===n||n.call(t,e)},e.prototype._groupRemarkChangedSync=function(e){var t,n;null===(n=(t=this._watcher).groupRemarkChangedSync)||void 0===n||n.call(t,e)},e.prototype._groupFollowsChangedSync=function(e){var t,n;null===(n=(t=this._watcher).groupFollowsChangedSync)||void 0===n||n.call(t,e)},e.prototype._friendAdd=function(e){var t,n;null===(n=(t=this._watcher).friendAdd)||void 0===n||n.call(t,e)},e.prototype._friendDelete=function(e){var t,n;null===(n=(t=this._watcher).friendDelete)||void 0===n||n.call(t,e)},e.prototype._friendApplicationStatusChanged=function(e){var t,n;null===(n=(t=this._watcher).friendApplicationStatusChanged)||void 0===n||n.call(t,e)},e.prototype._friendCleared=function(e){var t,n;null===(n=(t=this._watcher).friendCleared)||void 0===n||n.call(t,e)},e.prototype._friendInfoChangedSync=function(e){var t,n;null===(n=(t=this._watcher).friendInfoChangedSync)||void 0===n||n.call(t,e)},e.prototype._rtcDataChange=function(e,t){this._pluginContextQueue.forEach((function(n){var r;null===(r=n.onrtcdatachange)||void 0===r||r.call(n,e,t)}))},e.prototype._naviDataChange=function(e){this._pluginContextQueue.forEach((function(t){var n;null===(n=t.onnavidatachange)||void 0===n||n.call(t,e)}))},e.prototype._databaseUpgradeWillStart=function(){var e,t;this.logger.info(exports.LogTagId.L_DB_UPGRATE_START_S),null===(t=(e=this._watcher).databaseUpgradeWillStart)||void 0===t||t.call(e)},e.prototype._databaseUpgrading=function(e){var t,n;this.logger.info(exports.LogTagId.L_DB_UPGRATING_S,e),null===(n=(t=this._watcher).databaseUpgrading)||void 0===n||n.call(t,e)},e.prototype._databaseUpgradeDidComplete=function(e){var t,n;this.logger.info(exports.LogTagId.L_DB_UPGRATE_COMPLETE_S),null===(n=(t=this._watcher).databaseUpgradeDidComplete)||void 0===n||n.call(t,e)},e.prototype.assignWatcher=function(e){var t=this;Object.keys(this._watcher).forEach((function(n){if(Object.prototype.hasOwnProperty.call(e,n)){var r=e[n];t._watcher[n]=ft(r)||gt(r)?r:void 0}}))},e.prototype._resetWatcher=function(){var e=this;Object.keys(this._watcher).forEach((function(t){e._watcher[t]=void 0}))},e.prototype._addTypingInfo=function(e){var t=e.senderUserId,n=e.conversationType,r=e.targetId,o=e.content,i=e.channelId,s=o.typingContentType,a=i||"",u="".concat(n,"#").concat(r,"#").concat(a);this._typingInfo[u]||(this._typingInfo[u]=[]);var c=this._typingInfo[u].findIndex((function(e){return e.userId===t}));c>=0&&this._typingInfo[u][c].messageType===s?this._typingInfo[u][c].timestamp=Date.now():(c>=0&&this._typingInfo[u].splice(c,1),this._typingInfo[u].push({userId:t,messageType:s,timestamp:Date.now()}),this._typingChangedList.includes(u)||this._typingChangedList.push(u),this._startCheckTypingInfo())},e.prototype._startCheckTypingInfo=function(){var e=this;-1===this._typingInternalTimer&&0!==Object.keys(this._typingInfo).length&&(this._typingInternalTimer=setInterval((function(){for(var t in e._typingInfo){var n=e._typingInfo[t].length;e._typingInfo[t]=e._typingInfo[t].filter((function(t){return Date.now()-t.timestamp<e._typingExpireTime})),e._typingInfo[t].length===n||e._typingChangedList.includes(t)||e._typingChangedList.push(t),0===e._typingInfo[t].length&&delete e._typingInfo[t]}e._notifyTypingChanged()}),500))},e.prototype._notifyTypingChanged=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)},e.prototype.getConnectedTime=function(){return this._engine.getConnectedTime()},e.prototype.getServerTime=function(){return this._engine.getServerTime()},e.prototype.getDeviceId=function(){return this._engine.getDeviceId()},e.prototype.getCurrentUserId=function(){return this._engine.getCurrentUserId()},e.prototype.getConnectionStatus=function(){return this._engine.getConnectionStatus()},Object.defineProperty(e.prototype,"validatorConnected",{get:function(){var e=this;return function(){return e._engine.getConnectionStatus()===exports.RCConnectionStatus.CONNECTED?it(e._engine.getNaviInfoFromCache()):st(exports.ErrorCode.RC_NET_UNAVAILABLE)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"token",{get:function(){return this._token},enumerable:!1,configurable:!0}),e.prototype.refetchNaviInfo=function(){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){return[2,this._engine.refetchNaviInfo()]}))}))},e.prototype.connect=function(e,t,n){var r,o;return ue(this,void 0,void 0,(function(){var i,s,a,u,c,l;return ce(this,(function(d){switch(d.label){case 0:return this._token=e,[4,Tr.getNetworkType()];case 1:return i=d.sent(),this._engine.setNetwork({status:!0,type:i},!0),s=!!this._pluginInstanseMap.RCCallPlus,[4,this._engine.connect(e,t,s,n)];case 2:return a=d.sent(),u=a.code,c=a.data,u!==exports.ErrorCode.SUCCESS?[2,{code:u}]:(1!==this._engine.getNaviInfoFromCache().type&&(l=ze.getInfo(),null===(o=(r=this._engine).reportSDKInfo)||void 0===o||o.call(r,l)),[2,{code:u,userId:c}])}}))}))},e.prototype.disconnect=function(e){return ue(this,void 0,void 0,(function(){var t=this;return ce(this,(function(n){switch(n.label){case 0:return clearInterval(this._typingInternalTimer),this._typingInternalTimer=-1,this._typingInfo={},[4,this._engine.disconnect(e)];case 1:return n.sent(),this._pluginContextQueue.forEach((function(e){if(e.ondisconnect)try{e.ondisconnect()}catch(e){t.logger.error(exports.LogTagId.L_CALLBACK_E,null==e?void 0:e.stack)}})),[2,Promise.resolve()]}}))}))},e.prototype.reconnect=function(e){return this.connect(this.token,!!e,this.logger.createTraceId())},e.prototype._getTokenWithoutNavi=function(){return this._token.replace(/@.+$/,"@")},e.prototype._channelIdConvert=function(e,t){if(e!==exports.ConversationType.ULTRA_GROUP)return t;var n=this.getNaviInfoFromCache();return!!(2&((null==n?void 0:n.ugDriven)||0))&&!t?"RCDefault":t},e.prototype.getNaviInfoFromCache=function(){return this._engine.getNaviInfoFromCache()},e.prototype.registerMessageType=function(e,t,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=!1),pt(r)&&r.length>0&&(this._registerMessageSearchPropsMapping[e]=r),this._engine.registerMessageType(e,t,n,r,o)},e.prototype.registerRTCSignalingListener=function(e){this._engine.registerRTCSignalingListener(e)},e.prototype.checkSearchPropsMsg=function(e,t){var n=this._registerMessageSearchPropsMapping[e],r={};return n&>(t)&&Object.keys(t).forEach((function(e){if(n.includes(e)){var o=t[e];dt(o)&&(o>-Math.pow(2,64)&&o<Math.pow(2,64)&&Number.isInteger(o)||(r[e]=o))}})),Object.keys(r).length>0?{msg:JSON.stringify(r),code:exports.ErrorCode.SEARCH_PROPS_LIMIT_ERROR}:{code:exports.ErrorCode.SUCCESS}},e.prototype._handleExpansioResult=function(e,t){if(t){var n=yt(e),r=n.isIllgalEx,o=n.isExKeyOrValLengthExceedLimit;return n.isExceedLimit||o?exports.ErrorCode.EXPANSION_LIMIT_EXCEET:r?exports.ErrorCode.INVALID_PARAMETER_MESSAGE_EXPANSION:void 0}},e.prototype.sendMessage=function(e,t,n,r,o){var i=this.checkSearchPropsMsg(n.messageType,n.content),s=i.code,a=i.msg;if(s!==exports.ErrorCode.SUCCESS)return Promise.resolve({code:s,msg:a});if(e===exports.ConversationType.SYSTEM&&n.messageType!==exports.MessageType.SYNC_READ_STATUS)return Promise.resolve({code:exports.ErrorCode.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE});if(n.messageType===exports.MessageType.STREAM_MESSAGE)return Promise.resolve({code:exports.ErrorCode.MESSAGE_NOT_SUPPORT_SENDING});var u=n.canIncludeExpansion,c=void 0!==u&&u,l=n.expansion,d=this._handleExpansioResult(l,c);if(d)return Promise.resolve({code:d});var p=n.isMentioned,h=n.mentionedUserIdList,_=n.mentionedType;p&&[exports.ConversationType.GROUP,exports.ConversationType.ULTRA_GROUP].includes(e)?n.content.mentionedInfo=function(e,t,n){var r,o,i;return{userIdList:(null===(r=e.mentionedInfo)||void 0===r?void 0:r.userIdList)||t,type:(null===(o=e.mentionedInfo)||void 0===o?void 0:o.type)||n||exports.MentionedType.ALL,mentionedContent:(null===(i=e.mentionedInfo)||void 0===i?void 0:i.mentionedContent)||""}}(n.content,h,_):delete n.content.mentionedInfo;var g=JSON.stringify(n.content);if(function(e){for(var t,n=0,r=0,o=e.length;r<o;r++)n+=(t=e.charCodeAt(r))<127?1:t<=2047?2:t<=65535?3:4;return n}(g)>Le)return Promise.resolve({code:exports.ErrorCode.RC_MSG_CONTENT_EXCEED_LIMIT});if(e===exports.ConversationType.ULTRA_GROUP)return n.channelId=this._channelIdConvert(e,n.channelId),this._engine.sendUltraMessage(t,n,r,o);var f=this.getNaviInfoFromCache();return(null==f?void 0:f.grpRRVer)&&n.messageType===exports.MessageType.READ_RECEIPT_RESPONSE?Promise.resolve({code:exports.ErrorCode.READ_RECEIPT_ERROR}):this._engine.sendMessage(e,t,n,r,o)},e.prototype.sendExpansionMessage=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a,u,c,l,d,p;return ce(this,(function(h){switch(h.label){case 0:return t=e.channelId,n=e.conversationType,r=e.targetId,o=e.messageUId,i=e.keys,s=e.expansion,a=e.removeAll,u=e.canIncludeExpansion,e.messageType===exports.MessageType.STREAM_MESSAGE&&((null==i?void 0:i.includes("RC_Ext_StreamMsgSummary"))||(null==s?void 0:s.RC_Ext_StreamMsgSummary))?[2,{code:exports.ErrorCode.STREAM_MESSAGE_EXPANSION_KEY_ERROR}]:u?(c=yt(s),l=c.isIllgalEx,d=c.isExKeyOrValLengthExceedLimit,c.isExceedLimit||d?[2,Promise.resolve({code:exports.ErrorCode.EXPANSION_LIMIT_EXCEET})]:l?[2,Promise.resolve({code:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_EXPANSION})]:(p={mid:o},s&&(p.put=s),i&&(p.del=i),a&&(p.removeAll=1),[4,this._engine.sendMessage(n,r,{content:p,messageType:exports.MessageType.EXPANSION_NOTIFY,channelId:t})])):[2,{code:exports.ErrorCode.MESSAGE_KV_NOT_SUPPORT}];case 1:return[2,{code:h.sent().code}]}}))}))},e.prototype.sendReadReceiptMessage=function(e,t,n){return ue(this,void 0,void 0,(function(){var r;return ce(this,(function(o){return r=this.getNaviInfoFromCache(),1!==((null==r?void 0:r.grpRRVer)||0)?[2,{code:exports.ErrorCode.READ_RECEIPT_ERROR,msg:"The read receipt switch is not on, please call the sendMessage method!"}]:[2,this._engine.sendReadReceiptMessage(e,t,n)]}))}))},e.prototype.getMessageReader=function(e,t,n){return ue(this,void 0,void 0,(function(){var r;return ce(this,(function(o){return r=this.getNaviInfoFromCache(),1!==((null==r?void 0:r.grpRRVer)||0)?[2,{code:exports.ErrorCode.READ_RECEIPT_ERROR}]:[2,this._engine.getMessageReader(e,t,n||"")]}))}))},e.prototype.sendReadReceiptMessageV4=function(e,t,n){return ue(this,void 0,void 0,(function(){return ce(this,(function(r){return[2,this._engine.sendReadReceiptMessageV4(e,t,n)]}))}))},e.prototype.getMessageReadReceiptV4=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){return[2,this._engine.getMessageReadReceiptV4(e,t)]}))}))},e.prototype.batchGetMessageReadReceiptInfoV4=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){return[2,this._engine.batchGetMessageReadReceiptInfoV4(e,t)]}))}))},e.prototype.updateConversationReadTime=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){return[2,this._engine.updateConversationReadTime(e,t)]}))}))},e.prototype._destroy=function(){return ue(this,void 0,void 0,(function(){var e=this;return ce(this,(function(t){switch(t.label){case 0:return this._resetWatcher(),this._engine.destroy(),Tr.removeNetworkStatusListener(),[4,this.disconnect()];case 1:return t.sent(),this._pluginContextQueue.forEach((function(t){if(t.ondestroy)try{t.ondestroy()}catch(t){e.logger.error(exports.LogTagId.L_CALLBACK_E,null==t?void 0:t.stack)}})),this._pluginContextQueue.length=0,this._pluginInstanseMap={},[2]}}))}))},e.prototype.getHistoryMessage=function(e,t,n,r,o,i,s,a){var u={timestamp:n||0,count:r||20,order:o||0,channelId:i||""};if(e===exports.ConversationType.ULTRA_GROUP){var c=this._channelIdConvert(e,u.channelId);return u.channelId=c,this._engine.getUltraHistoryMsg(t,u,a)}return this._engine.getHistoryMessage(e,t,u.timestamp,u.count,u.order,u.channelId,s||"",a)},e.prototype.getMessages=function(e,t,n,r,o,i,s){var a={timestamp:n||0,count:r||20,order:o||0,channelId:i||""};if(e===exports.ConversationType.ULTRA_GROUP){var u=this._channelIdConvert(e,a.channelId);return a.channelId=u,this._engine.getUltraHistoryMsg(t,a,s)}return this._engine.getMessages(e,t,a.timestamp,a.count,a.order,a.channelId,s)},e.prototype.getContinuousMessages=function(e,t,n,r,o,i){return void 0===n&&(n=0),void 0===r&&(r=20),void 0===o&&(o=0),void 0===i&&(i=""),this._engine.getContinuousMessages(e,t,n,r,o,i)},e.prototype.getHistoryMessagesByObjectNames=function(e,t,n,r,o,i,s){return this._engine.getHistoryMessagesByObjectNames(e,t,n,r,o,i,s)},e.prototype.getConversationList=function(e,t,n,r,o){if(t===exports.ConversationType.ULTRA_GROUP){var i=exports.ErrorCode.METHOD_NOT_SUPPORT;return Promise.resolve({code:i,msg:exports.ErrorCode[i]})}return this._engine.getConversationList(e||300,t,n,r,o||"")},e.prototype.getConversationsByPage=function(e,t,n,r,o){return this._engine.getConversationsByPage(e,t,n,r,o)},e.prototype.getConversation=function(e,t,n){var r=this._channelIdConvert(e,n);return this._engine.getConversation(e,t,r||"")},e.prototype.removeConversation=function(e,t,n){return e===exports.ConversationType.ULTRA_GROUP?Promise.resolve(exports.ErrorCode.METHOD_NOT_SUPPORT):this._engine.removeConversation(e,t,n||"")},e.prototype.batchRemoveConversation=function(e){return this._engine.batchRemoveConversation(e)},e.prototype.getUltraGroupList=function(e){return this._engine.getUltraGroupList(e)},e.prototype.getBlockUltraGroupList=function(){return this._engine.getBlockUltraGroupList()},e.prototype.getTopUltraGroupList=function(){return this._engine.getTopUltraGroupList()},e.prototype.clearUnreadCount=function(e,t,n){if(e===exports.ConversationType.ULTRA_GROUP){var r=this._channelIdConvert(e,n);return this._engine.clearUltraUnreadcount(t,r||"")}return this._engine.clearConversationUnreadCount(e,t,n||"")},e.prototype.clearAllUnreadCount=function(){return this._engine.clearAllUnreadCount()},e.prototype.getUnreadCount=function(e,t,n){var r=this._channelIdConvert(e,n);return this._engine.getConversationUnreadCount(e,t,r||"")},e.prototype.getTotalUnreadCount=function(e,t,n){if(t&&t.includes(exports.ConversationType.ULTRA_GROUP)){var r=exports.ErrorCode.METHOD_NOT_SUPPORT;return Promise.resolve({code:r,msg:exports.ErrorCode[r]})}return this._engine.getAllConversationUnreadCount(e,t&&t.length>0?t:[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP,exports.ConversationType.SYSTEM,exports.ConversationType.PUBLIC_SERVICE],!!n)},e.prototype.getTotalUnreadCountByLevels=function(e,t,n){return this._engine.getTotalUnreadCountByLevels(e,t,n)},e.prototype.getFirstUnreadMessage=function(e,t,n){return this._engine.getFirstUnreadMessage(e,t,n||"")},e.prototype.getFirstUnreadMessageInfo=function(e,t,n){return this._engine.getFirstUnreadMessageInfo(e,t,n)},e.prototype.setConversationNotificationLevel=function(e,t,n,r){return ue(this,void 0,void 0,(function(){var o;return ce(this,(function(i){return o=this._channelIdConvert(e,r),[2,this._engine.setConversationNotificationLevel(e,t,n,o||"")]}))}))},e.prototype.batchSetConversationNotificationLevel=function(e,t){return this._engine.batchSetConversationNotificationLevel(e,t)},e.prototype.setConversationStatus=function(e,t,n,r,o,i){if(void 0===i&&(i=!0),e===exports.ConversationType.ULTRA_GROUP&&void 0!==n)return Promise.resolve(exports.ErrorCode.METHOD_NOT_SUPPORT);var s=this._channelIdConvert(e,o),a=[{conversationType:e,targetId:t,isTop:n,notificationLevel:r?Ae(r):void 0,channelId:s||"",isUpdateTime:i}];return this._engine.batchSetConversationStatus(a)},e.prototype.setConversationToTop=function(e,t,n,r,o){return this._engine.setConversationToTop(e,t,n,r,o)},e.prototype.batchSetConversationToTop=function(e,t,n){return this._engine.batchSetConversationToTop(e,t,!!n)},e.prototype.saveConversationMessageDraft=function(e,t,n,r){var o=this._channelIdConvert(e,r);return this._engine.saveConversationMessageDraft(e,t,n,o||"")},e.prototype.getConversationMessageDraft=function(e,t,n){var r=this._channelIdConvert(e,n);return this._engine.getConversationMessageDraft(e,t,r||"")},e.prototype.clearConversationMessageDraft=function(e,t,n){var r=this._channelIdConvert(e,n);return this._engine.clearConversationMessageDraft(e,t,r||"")},e.prototype.recallMessage=function(e,t){return ue(this,void 0,void 0,(function(){var n,r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return n=function(e,t){return at.create(e).isObject("conversatino",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION).isValueOf("conversationType",t.conversationType,exports.ConversationType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE).validate("targetId",t.targetId,Rt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("channelId",t.channelId,vt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID)}("recallMessage",e).isString("messageUId",t.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isInteger("sentTime",t.sentTime,!1).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,Rt,!1,1).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validatorConnected),n.isOk?(r=t.messageUId,o=this.logger.createTraceId(),this.logger.info(exports.LogTagId.A_RECALL_MESSAGE_T,JSON.stringify({messageUId:r}),o),i=e.conversationType,s=e.channelId,e.channelId=this._channelIdConvert(i,s)||"",[4,this._engine.recallMsg(e,t)]):(this.logger.warn(exports.LogTagId.A_RECALL_MESSAGE_E,n.errmsg()),[2,n.wipe()]);case 1:return a=u.sent(),this.logger.summary(exports.LogTagId.A_RECALL_MESSAGE_R,a,o,{messageUId:r}),[2,a]}}))}))},e.prototype.deleteRemoteMessage=function(e,t,n,r){if(e===exports.ConversationType.ULTRA_GROUP&&Ot())return Promise.resolve(exports.ErrorCode.METHOD_NOT_SUPPORT);var o=this._channelIdConvert(e,r);return this._engine.deleteRemoteMessage(e,t,n,o||"")},e.prototype.deleteRemoteMessageByTimestamp=function(e,t,n,r){var o=this._channelIdConvert(e,r);return this._engine.deleteRemoteMessageByTimestamp(e,t,n,o||"")},e.prototype.joinChatroom=function(e,t,n,r){return void 0===t&&(t=10),this._engine.joinChatroom(e,t,r,n)},e.prototype.joinExistChatroom=function(e,t,n,r){return void 0===t&&(t=10),this._engine.joinExistChatroom(e,t,r,n)},e.prototype.quitChatroom=function(e){return this._engine.quitChatroom(e)},e.prototype.getChatroomInfo=function(e,t,n){return this._engine.getChatroomInfo(e,t||0,n||0)},e.prototype.setChatroomEntry=function(e,t){var n=t.key,r=t.value;return Wt(n)?jt(r)?this._engine.setChatroomEntry(e,t):Promise.resolve(exports.ErrorCode.INVALID_PARAMETER_VALUE):Promise.resolve(exports.ErrorCode.INVALID_PARAMETER_KEY)},e.prototype.setChatroomEntries=function(e,t){for(var n=0;n<t.entries.length;n++){var r=t.entries[n],o=r.key,i=r.value;if(!Wt(o))return Promise.resolve({code:exports.ErrorCode.INVALID_PARAMETER_KEY});if(!jt(i))return Promise.resolve({code:exports.ErrorCode.INVALID_PARAMETER_VALUE})}var s=se(se({},t),{isOverwrite:t.isForce});return this._engine.setChatroomEntries(e,s)},e.prototype.forceSetChatroomEntry=function(e,t){var n=t.key,r=t.value;return Wt(n)?jt(r)?this._engine.forceSetChatroomEntry(e,t):Promise.resolve(exports.ErrorCode.INVALID_PARAMETER_VALUE):Promise.resolve(exports.ErrorCode.INVALID_PARAMETER_KEY)},e.prototype.removeChatroomEntry=function(e,t){var n=t.key;return Wt(n)?this._engine.removeChatroomEntry(e,t):Promise.resolve(exports.ErrorCode.INVALID_PARAMETER_KEY)},e.prototype.removeChatroomEntries=function(e,t){for(var n=0;n<t.entries.length;n++){var r=t.entries[n].key;if(!Wt(r))return Promise.resolve({code:exports.ErrorCode.INVALID_PARAMETER_KEY})}return this._engine.removeChatroomEntries(e,t)},e.prototype.forceRemoveChatroomEntry=function(e,t){var n=t.key;return Wt(n)?this._engine.forceRemoveChatroomEntry(e,t):Promise.resolve(exports.ErrorCode.INVALID_PARAMETER_KEY)},e.prototype.getChatroomEntry=function(e,t){return this._engine.getChatroomEntry(e,t)},e.prototype.getAllChatroomEntries=function(e){return this._engine.getAllChatroomEntry(e)},e.prototype.getChatroomHistoryMessages=function(e,t,n,r){return this._engine.getChatroomHistoryMessages(e,r||0,t||20,n||0)},e.prototype.getFileToken=function(e,t,n,r,o,i){return ue(this,void 0,void 0,(function(){var s,a,u,c,l,d;return ce(this,(function(p){switch(p.label){case 0:return s=this.getNaviInfoFromCache(),a=(null==s?void 0:s.uploadServer)||"",u=(null==s?void 0:s.ossConfig)||"",[4,this._engine.getFileToken(e,t,n,r,o,i)];case 1:return c=p.sent(),l=c.code,d=c.data,l===exports.ErrorCode.SUCCESS&&d?[2,Promise.resolve(Object.assign(d,{qiniu:a,ossConfig:d.ossConfig||u}))]:[2,Promise.reject(l)]}}))}))},e.prototype.getFileUrl=function(e,t,n,r){return ue(this,void 0,void 0,(function(){var o,i,s;return ce(this,(function(a){switch(a.label){case 0:return[4,this._engine.getFileUrl(e,n,t,r)];case 1:return o=a.sent(),i=o.code,s=o.data,i===exports.ErrorCode.SUCCESS?[2,Promise.resolve(s)]:[2,Promise.reject(i)]}}))}))},e.prototype.createTag=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return[2,this._engine.createTag(e)]}))}))},e.prototype.removeTag=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return[2,this._engine.removeTag(e)]}))}))},e.prototype.updateTag=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return[2,this._engine.updateTag(e)]}))}))},e.prototype.getTagList=function(){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){return[2,this._engine.getTagList()]}))}))},e.prototype.addTagForConversations=function(e,t){return ue(this,void 0,void 0,(function(){var n,r=this;return ce(this,(function(o){return t.length>1e3?[2,Promise.resolve({code:exports.ErrorCode.CONVER_OUT_LIMIT_ERROR})]:(n=t.map((function(e){var t=e.conversationType,n=e.targetId,o=e.channelId;return{conversationType:t,targetId:n,channelId:r._channelIdConvert(t,o)}})),[2,this._engine.addTagForConversations(e,n)])}))}))},e.prototype.removeTagForConversations=function(e,t){return ue(this,void 0,void 0,(function(){var n,r=this;return ce(this,(function(o){return n=t.map((function(e){var t=e.conversationType,n=e.targetId,o=e.channelId;return{conversationType:t,targetId:n,channelId:r._channelIdConvert(t,o)}})),[2,this._engine.removeTagForConversations(e,n)]}))}))},e.prototype.removeTagsForConversation=function(e,t){return ue(this,void 0,void 0,(function(){var n;return ce(this,(function(r){return n=this._channelIdConvert(e.conversationType,e.channelId),e.channelId=n,[2,this._engine.removeTagsForConversation(e,t)]}))}))},e.prototype.getConversationListByTag=function(e,t,n,r){return ue(this,void 0,void 0,(function(){return ce(this,(function(o){return[2,this._engine.getConversationListByTag(e,t,n,r)]}))}))},e.prototype.getUnreadCountByTag=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){return[2,this._engine.getUnreadCountByTag(e,t)]}))}))},e.prototype.setConversationStatusInTag=function(e,t,n){return ue(this,void 0,void 0,(function(){var r;return ce(this,(function(o){return r=this._channelIdConvert(t.conversationType,t.channelId),t.channelId=r,[2,this._engine.setConversationStatusInTag(e,t,n)]}))}))},e.prototype.getTagsForConversation=function(e){return ue(this,void 0,void 0,(function(){var t;return ce(this,(function(n){return t=this._channelIdConvert(e.conversationType,e.channelId),e.channelId=t,[2,this._engine.getTagsForConversation(e)]}))}))},e.prototype.getBlockConversationList=function(){return this._engine.getBlockConversationList()},e.prototype.getTopConversationList=function(e,t){return e&&0!==e.length||(e=[exports.ConversationType.PRIVATE,exports.ConversationType.CHATROOM,exports.ConversationType.GROUP,exports.ConversationType.SYSTEM,exports.ConversationType.APP_PUBLIC_SERVICE,exports.ConversationType.PUBLIC_SERVICE]),this._engine.getTopConversationList(e,t||"")},e.prototype.getUnreadConversationList=function(e){return e&&0!==e.length||(e=[exports.ConversationType.PRIVATE,exports.ConversationType.CHATROOM,exports.ConversationType.GROUP,exports.ConversationType.SYSTEM,exports.ConversationType.APP_PUBLIC_SERVICE,exports.ConversationType.PUBLIC_SERVICE]),this._engine.getUnreadConversationList(e)},e.prototype.getUnreadMentionedCount=function(e){var t=this._channelIdConvert(e.conversationType,e.channelId);return e.channelId=t,this._engine.getUnreadMentionedCount(e)},e.prototype.getAllUnreadMentionedCount=function(){return this._engine.getAllUnreadMentionedCount()},e.prototype.sendUltraGroupTypingStatus=function(e){if(e.conversationType!==exports.ConversationType.ULTRA_GROUP){var t=exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT;return Promise.resolve({code:t,msg:exports.ErrorCode[t]})}var n=this._channelIdConvert(e.conversationType,e.channelId);return e.channelId=n,this._engine.sendUltraGroupTypingStatus(e)},e.prototype.getUltraGroupMessageListByMessageUId=function(e){var t=this,n=e.messages.map((function(n){var r=n.sendTime,o=n.messageUId,i=n.channelId;return{sendTime:r,messageUId:o,channelId:t._channelIdConvert(e.conversationType,i)}}));return e.messages=n,this._engine.getUltraGroupMessageListByMessageUId(e)},e.prototype.expandUltraMessage=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return t=e.conversationType,n=e.expansion,r=e.canIncludeExpansion,t!==exports.ConversationType.ULTRA_GROUP?[2,{code:o=exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT,msg:exports.ErrorCode[o]}]:r?(i=yt(n),s=i.isIllgalEx,a=i.isExKeyOrValLengthExceedLimit,i.isExceedLimit||a?[2,{code:exports.ErrorCode.EXPANSION_LIMIT_EXCEET}]:s?[2,{code:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_EXPANSION}]:[4,this._engine.expandUltraMessage(e)]):[2,{code:exports.ErrorCode.MESSAGE_KV_NOT_SUPPORT}];case 1:return[2,{code:u.sent().code}]}}))}))},e.prototype.modifyMessage=function(e){return ue(this,void 0,void 0,(function(){var t;return ce(this,(function(n){switch(n.label){case 0:return e.conversationType!==exports.ConversationType.ULTRA_GROUP?[2,{code:t=exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT,msg:exports.ErrorCode[t]}]:[4,this._engine.modifyMessage(e)];case 1:return[2,{code:n.sent().code}]}}))}))},e.prototype.getUltraGroupUnreadMentionedCountByTargetId=function(e,t){return this._engine.getUltraGroupUnreadMentionedCountByTargetId(e,t)},e.prototype.getUltraGroupUnreadCountByTargetId=function(e,t){return this._engine.getUltraGroupUnreadCountByTargetId(e,t)},e.prototype.getAllUltraGroupUnreadCount=function(e){return void 0===e&&(e=!1),this._engine.getAllUltraGroupUnreadCount(e)},e.prototype.getAllConversationState=function(){return this._engine.getAllConversationState()},e.prototype.getUltraGroupUnreadMentionedMessages=function(e){var t=this._channelIdConvert(exports.ConversationType.ULTRA_GROUP,e.channelId);return e.channelId=t,this._engine.getUltraGroupUnreadMentionedMessages(e)},e.prototype.getUltraGroupFirstUnreadMessageTimestamp=function(e){var t=this._channelIdConvert(exports.ConversationType.ULTRA_GROUP,e.channelId);return e.channelId=t,this._engine.getUltraGroupFirstUnreadMessageTimestamp(e)},e.prototype.getUltraGroupUnreadInfoList=function(e){return this._engine.getUltraGroupUnreadInfoList(e)},e.prototype.callExtra=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return(t=this._engine).callExtra.apply(t,pe([e],de(n),!1))},e.prototype.getOSInfo=function(){return this._engine.getOSInfo()},e.prototype.getProcessInfo=function(){return this._engine.getProcessInfo()},e.prototype.getMainProcessInfo=function(){return this._engine.getMainProcessInfo()},e.prototype.setCallInfo=function(e,t,n){return this._engine.setCallInfo(e,t,n)},e.prototype.getGroupMessageDeliverList=function(e,t,n){return void 0===n&&(n=""),this._engine.getGroupMessageDeliverList(e,t,n)},e.prototype.getPrivateMessageDeliverTime=function(e,t){return void 0===t&&(t=""),this._engine.getPrivateMessageDeliverTime(e,t)},e.prototype._isEnableSubDriven=function(e){var t=(this.getNaviInfoFromCache()||{}).subDriven,n=void 0===t?0:t;switch(e){case exports.SubscribeType.ONLINE_STATUS:return 1&n;case exports.SubscribeType.USER_PROFILE:return 2&n;default:return!1}},e.prototype.subscribeUser=function(e,t,n){return this._isEnableSubDriven(t)?this._engine.subscribeUser(e,t,n):Promise.resolve({code:exports.ErrorCode.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})},e.prototype.unSubscribeUser=function(e,t){return this._isEnableSubDriven(t)?this._engine.unSubscribeUser(e,t):Promise.resolve({code:exports.ErrorCode.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})},e.prototype.getSubscribeUserList=function(e,t,n){return this._isEnableSubDriven(e)?this._engine.getSubscribeUserList(e,t,n):Promise.resolve({code:exports.ErrorCode.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})},e.prototype.getSubscribeUserStatus=function(e,t){return this._isEnableSubDriven(e)?this._engine.getSubscribeUserStatus(e,t):Promise.resolve({code:exports.ErrorCode.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})},e.prototype.updateMyUserProfile=function(e){return this._engine.updateMyUserProfile(e)},e.prototype.getUserProfiles=function(e){return this._engine.getUserProfiles(e)},e.prototype.getMyUserProfile=function(){return this._engine.getMyUserProfile()},e.prototype.updateMyUserProfileVisibility=function(e){return this._engine.updateMyUserProfileVisibility(e)},e.prototype.getMyUserProfileVisibility=function(){return this._engine.getMyUserProfileVisibility()},e.prototype.searchUserProfileByUniqueId=function(e){return this._engine.searchUserProfileByUniqueId(e)},e.prototype.clearConversations=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){return[2,this._engine.clearConversations(e,t)]}))}))},e.prototype.setUserStatusListener=function(e,t){var n=this;return this._engine.setUserStatusListener(e,(function(e){try{t(e)}catch(e){n.logger.error(exports.LogTagId.L_CALLBACK_E,null==e?void 0:e.stack)}}))},e.prototype.addToBlacklist=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return[2,this._engine.addToBlacklist(e)]}))}))},e.prototype.removeFromBlacklist=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return[2,this._engine.removeFromBlacklist(e)]}))}))},e.prototype.getBlacklist=function(){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){return[2,this._engine.getBlacklist()]}))}))},e.prototype.getBlacklistStatus=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return[2,this._engine.getBlacklistStatus(e)]}))}))},e.prototype.insertMessage=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o,i;return ce(this,(function(s){return r=this.checkSearchPropsMsg(n.messageType,n.content),o=r.code,i=r.msg,o!==exports.ErrorCode.SUCCESS?[2,Promise.resolve({code:o,msg:i})]:[2,this._engine.insertMessage(e,t,n)]}))}))},e.prototype.batchInsertMessage=function(e,t){return this._engine.batchInsertMessage(e,t)},e.prototype.getMessageCount=function(e,t,n){return void 0===n&&(n=""),ue(this,void 0,void 0,(function(){return ce(this,(function(r){return[2,this._engine.getMessageCount(e,t,n)]}))}))},e.prototype.deleteMessages=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return[2,this._engine.deleteMessages(e)]}))}))},e.prototype.deleteMessagesByTimestamp=function(e,t,n,r,o){return void 0===o&&(o=""),ue(this,void 0,void 0,(function(){return ce(this,(function(i){return[2,this._engine.deleteMessagesByTimestamp(e,t,n,!!r,o)]}))}))},e.prototype.batchClearMessagesByTimestamp=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return[2,this._engine.batchClearMessagesByTimestamp(e)]}))}))},e.prototype.batchClearRemoteHistoryMessages=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){return[2,this._engine.batchClearRemoteHistoryMessages(e,t)]}))}))},e.prototype.clearMessages=function(e,t,n){return void 0===n&&(n=""),ue(this,void 0,void 0,(function(){return ce(this,(function(r){return[2,this._engine.clearMessages(e,t,n)]}))}))},e.prototype.getLocalMessage=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o=this;return ce(this,(function(i){switch(i.label){case 0:return t=at.create("getLocalMessage").validate("messageId",e,(function(){return lt(e)||dt(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).result(),n=this.logger.createTraceId(),this.logger.info(exports.LogTagId.A_GET_LOCAL_MESSAGE_T,JSON.stringify({messageId:e}),n),[4,t.next((function(){return o._engine.getMessage(e)}))];case 1:return r=i.sent(),this.logger.summary(exports.LogTagId.A_GET_LOCAL_MESSAGE_R,r,n,{messageId:e}),[2,r]}}))}))},e.prototype.setMessageContent=function(e,t,n){return ue(this,void 0,void 0,(function(){return ce(this,(function(r){return[2,this._engine.setMessageContent(e,t,n)]}))}))},e.prototype.setMessageSearchField=function(e,t,n){return ue(this,void 0,void 0,(function(){return ce(this,(function(r){return[2,this._engine.setMessageSearchField(e,t,n)]}))}))},e.prototype.setMessageSentStatus=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){return[2,this._engine.setMessageSentStatus(e,t)]}))}))},e.prototype.setMessageReceivedStatus=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){return[2,this._engine.setMessageReceivedStatus(e,t)]}))}))},e.prototype.setMessageStatusToRead=function(e,t,n,r){return ue(this,void 0,void 0,(function(){return ce(this,(function(o){return[2,this._engine.updateMessageReceiptStatus(e,t,n,r)]}))}))},e.prototype.setUserStatus=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return[2,this._engine.setUserStatus(e)]}))}))},e.prototype.subscribeUserStatus=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return[2,this._engine.subscribeUserStatus(e)]}))}))},e.prototype.getUserStatus=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return[2,this._engine.getUserStatus(e)]}))}))},e.prototype.searchConversationByContent=function(e,t,n,r){return void 0===t&&(t=[]),ue(this,void 0,void 0,(function(){return ce(this,(function(o){return[2,this._engine.searchConversationByContent(e,t,n||"",r)]}))}))},e.prototype.searchConversationByContentWithAllChannel=function(e,t,n){return void 0===t&&(t=[]),ue(this,void 0,void 0,(function(){return ce(this,(function(r){return[2,this._engine.searchConversationByContentWithAllChannel(e,t,n)]}))}))},e.prototype.searchMessageByContent=function(e,t,n,r,o,i,s){return void 0===s&&(s=""),ue(this,void 0,void 0,(function(){return ce(this,(function(a){return[2,this._engine.searchMessageByContent(e,t,n,r,o,i,s)]}))}))},e.prototype.searchMessageByContentAndMessageType=function(e,t,n,r,o,i,s){return ue(this,void 0,void 0,(function(){return ce(this,(function(a){return[2,this._engine.searchMessageByContentAndMessageType(e,t,n,r,o,i,s)]}))}))},e.prototype.searchMessagesByUser=function(e,t,n,r,o,i){return void 0===o&&(o=5),void 0===i&&(i=""),ue(this,void 0,void 0,(function(){return ce(this,(function(s){return[2,this._engine.searchMessagesByUser(e,t,n,r,o,i)]}))}))},e.prototype.getMessagesByTimestamp=function(e,t,n,r){return ue(this,void 0,void 0,(function(){return ce(this,(function(o){return[2,this._engine.getMessagesByTimestamp(e,t,n,r)]}))}))},e.prototype.searchMessageByContentWithAllChannel=function(e,t,n,r,o){return ue(this,void 0,void 0,(function(){return ce(this,(function(i){return[2,this._engine.searchMessageByContentWithAllChannel(e,t,n,r,o)]}))}))},e.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(e,t,n,r,o,i,s){return ue(this,void 0,void 0,(function(){return ce(this,(function(a){return[2,this._engine.searchMessageByContentInTimeRangeWithAllChannel(e,t,n,r,o,i,s)]}))}))},e.prototype.getUnreadMentionedMessages=function(e,t,n){return void 0===n&&(n=""),this._engine.getUnreadMentionedMessages(e,t,n)},e.prototype.clearUnreadCountByTimestamp=function(e,t,n,r){return void 0===r&&(r=""),this._engine.clearUnreadCountByTimestamp(e,t,n,r)},e.prototype.getUltraGroupDefaultNotificationLevel=function(e,t){var n=this._channelIdConvert(exports.ConversationType.ULTRA_GROUP,t);return this._engine.getUltraGroupDefaultNotificationLevel(e,n||"")},e.prototype.setUltraGroupDefaultNotificationLevel=function(e,t,n){var r=this._channelIdConvert(exports.ConversationType.ULTRA_GROUP,n);return this._engine.setUltraGroupDefaultNotificationLevel(e,t,r||"")},e.prototype.getConversationNotificationLevel=function(e,t,n){var r=this._channelIdConvert(e,n);return this._engine.getConversationNotificationLevel(e,t,r||"")},e.prototype.setConversationTypeNotificationLevel=function(e,t){return this._engine.setConversationTypeNotificationLevel(e,t)},e.prototype.getConversationTypeNotificationLevel=function(e){return this._engine.getConversationTypeNotificationLevel(e)},e.prototype.getConversationNotificationStatus=function(e,t,n){var r=this._channelIdConvert(e,n);return this._engine.getConversationNotificationStatus(e,t,r||"")},e.prototype.getRemoteHistoryMessages=function(e,t,n,r,o,i){return this._engine.getRemoteHistoryMessages(e,t,n,r,o,i)},e.prototype.getConversationListWithAllChannel=function(){return this._engine.getConversationListWithAllChannel()},e.prototype.getConversationListWithAllChannelByPage=function(e,t){return this._engine.getConversationListWithAllChannelByPage(e,t)},e.prototype.clearData=function(){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){return[2,this._engine.clearData()]}))}))},e.prototype.createLogger=function(e,t){return this._engine.createLogger(e,t)},e.prototype.getConversations=function(e){return this._engine.getConversations(e)},e.prototype.setCheckDuplicateMessage=function(e){return this._engine.setCheckDuplicateMessage(e)},e.prototype.setCheckChatRoomDuplicateMessage=function(e){return this._engine.setCheckChatRoomDuplicateMessage(e)},e.prototype.rtcSignaling=function(e,t,n,r){return this._engine.rtcSignaling(e,t,n,r)},e.prototype.rtcPing=function(e,t,n){return this._engine.rtcPing(e,t,n)},e.prototype.bindRTCRoomForChatroom=function(e){return this._engine.bindRTCRoomForChatroom(e)},e.prototype.setProxy=function(e){return this._engine.setProxy(e)},e.prototype.getProxy=function(){return this._engine.getProxy()},e.prototype.testProxy=function(e,t){return this._engine.testProxy(e,t)},e.prototype.createGroup=function(e,t,n,r){return void 0===r&&(r=[]),this._engine.createGroup(e,t,n,r)},e.prototype.updateGroupInfo=function(e,t,n){return this._engine.updateGroupInfo(e,t,n)},e.prototype.getGroupsInfo=function(e){return this._engine.getGroupsInfo(e)},e.prototype.kickGroupMembers=function(e,t,n){return this._engine.kickGroupMembers(e,t,n)},e.prototype.quitGroup=function(e,t){return this._engine.quitGroup(e,t)},e.prototype.dismissGroup=function(e){return this._engine.dismissGroup(e)},e.prototype.transferGroupOwner=function(e,t,n,r){return void 0===r&&(r=!1),this._engine.transferGroupOwner(e,t,r,n)},e.prototype.setGroupManagers=function(e,t,n){return this._engine.setGroupManagers(e,t,n)},e.prototype.getGroupMembersByRole=function(e,t,n){return this._engine.getGroupMembersByRole(e,t,n)},e.prototype.getGroupMembers=function(e,t){return this._engine.getGroupMembers(e,t)},e.prototype.setGroupMemberInfo=function(e,t,n,r){return this._engine.setGroupMemberInfo(e,t,n,r)},e.prototype.searchGroupMembers=function(e,t,n){return this._engine.searchGroupMembers(e,t,n)},e.prototype.joinGroup=function(e){return this._engine.joinGroup(e)},e.prototype.inviteUsersToGroup=function(e,t){return this._engine.inviteUsersToGroup(e,t)},e.prototype.acceptGroupInvite=function(e,t){return this._engine.memberInviteResponse({groupId:e,inviterId:t,optType:0,optResult:exports.GroupOperationStatus.ACCEPT})},e.prototype.refuseGroupInvite=function(e,t,n){return this._engine.memberInviteResponse({groupId:e,inviterId:t,optType:0,optResult:exports.GroupOperationStatus.REFUSE,reason:n})},e.prototype.acceptGroupApplication=function(e,t,n){return this._engine.memberInviteResponse({groupId:e,joinUserId:t,inviterId:n,optType:1,optResult:exports.GroupOperationStatus.ACCEPT})},e.prototype.refuseGroupApplication=function(e,t,n,r){return this._engine.memberInviteResponse({groupId:e,joinUserId:t,inviterId:n,optType:1,optResult:exports.GroupOperationStatus.REFUSE,reason:r})},e.prototype.getGroupApplications=function(e,t,n){return this._engine.getGroupApplications(e,t,n)},e.prototype.getJoinedGroupsByRole=function(e,t){return this._engine.getJoinedGroupsByRole(e,t)},e.prototype.searchJoinedGroups=function(e,t){return this._engine.searchJoinedGroups(e,t)},e.prototype.getJoinedGroups=function(e){return this._engine.getJoinedGroups(e)},e.prototype.setGroupRemark=function(e,t){return this._engine.setGroupRemark(e,t)},e.prototype.addGroupFollows=function(e,t){return this._engine.setGroupFollows(exports.GroupOperationType.ADD,e,t)},e.prototype.removeGroupFollows=function(e,t){return this._engine.setGroupFollows(exports.GroupOperationType.REMOVE,e,t)},e.prototype.getGroupFollows=function(e){return this._engine.getGroupFollows(e)},e.prototype.addFriend=function(e,t,n){return this._engine.addFriend(e,t,n)},e.prototype.deleteFriends=function(e,t){return this._engine.deleteFriends(e,t)},e.prototype.acceptFriendApplication=function(e){return this._engine.acceptFriendApplication(e)},e.prototype.refuseFriendApplication=function(e,t){return this._engine.refuseFriendApplication(e,t)},e.prototype.setFriendInfo=function(e,t,n){return this._engine.setFriendInfo(e,t,n)},e.prototype.checkFriends=function(e,t){return this._engine.checkFriends(e,t)},e.prototype.getFriends=function(e,t){return this._engine.getFriends(e,t)},e.prototype.getFriendApplications=function(e,t,n){return this._engine.getFriendApplications(e,t,n)},e.prototype.getFriendsInfo=function(e){return this._engine.getFriendsInfo(e)},e.prototype.searchFriendsInfo=function(e){return this._engine.searchFriendsInfo(e)},e.prototype.setFriendAddPermission=function(e){return this._engine.setFriendAddPermission(e)},e.prototype.getFriendAddPermission=function(){return this._engine.getFriendAddPermission()},e.prototype.getRealtimeConversations=function(e,t,n){return this._engine.getRealtimeConversations(e,t,n)},e.prototype.getRealtimeConTotalUnreadCount=function(){return this._engine.getRealtimeConTotalUnreadCount()},e.prototype.clearRealtimeConUnreadCount=function(e){return this._engine.clearRealtimeConUnreadCount(e)},e.prototype.removeRealtimeConversations=function(e){return this._engine.removeRealtimeConversations(e)},e.prototype.getRealtimeConUnreadCounts=function(e){return this._engine.getRealtimeConUnreadCounts(e)},e.prototype.setNotificationQuietHoursWithSetting=function(e){var t=this;return at.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).isValueOf("level",e.level,exports.PushNotificationQuietHoursLevel,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().next((function(){return t._engine.setNotificationQuietHoursWithSetting(e)}))},e.prototype.removeNotificationQuietHoursSetting=function(){return this._engine.removeNotificationQuietHoursSetting()},e.prototype.getNotificationQuietHoursSetting=function(){return this._engine.getNotificationQuietHoursSetting()},ae([qp],e.prototype,"updateMyUserProfile",null),ae([qp],e.prototype,"getUserProfiles",null),ae([qp],e.prototype,"getMyUserProfile",null),ae([qp],e.prototype,"updateMyUserProfileVisibility",null),ae([qp],e.prototype,"getMyUserProfileVisibility",null),ae([qp],e.prototype,"searchUserProfileByUniqueId",null),ae([qp],e.prototype,"createGroup",null),ae([qp],e.prototype,"updateGroupInfo",null),ae([qp],e.prototype,"getGroupsInfo",null),ae([qp],e.prototype,"kickGroupMembers",null),ae([qp],e.prototype,"quitGroup",null),ae([qp],e.prototype,"dismissGroup",null),ae([qp],e.prototype,"transferGroupOwner",null),ae([qp],e.prototype,"setGroupManagers",null),ae([qp],e.prototype,"getGroupMembersByRole",null),ae([qp],e.prototype,"getGroupMembers",null),ae([qp],e.prototype,"setGroupMemberInfo",null),ae([qp],e.prototype,"searchGroupMembers",null),ae([qp],e.prototype,"joinGroup",null),ae([qp],e.prototype,"inviteUsersToGroup",null),ae([qp],e.prototype,"acceptGroupInvite",null),ae([qp],e.prototype,"refuseGroupInvite",null),ae([qp],e.prototype,"acceptGroupApplication",null),ae([qp],e.prototype,"refuseGroupApplication",null),ae([qp],e.prototype,"getGroupApplications",null),ae([qp],e.prototype,"getJoinedGroupsByRole",null),ae([qp],e.prototype,"searchJoinedGroups",null),ae([qp],e.prototype,"getJoinedGroups",null),ae([qp],e.prototype,"setGroupRemark",null),ae([qp],e.prototype,"addGroupFollows",null),ae([qp],e.prototype,"removeGroupFollows",null),ae([qp],e.prototype,"getGroupFollows",null),ae([qp],e.prototype,"addFriend",null),ae([qp],e.prototype,"deleteFriends",null),ae([qp],e.prototype,"acceptFriendApplication",null),ae([qp],e.prototype,"refuseFriendApplication",null),ae([qp],e.prototype,"setFriendInfo",null),ae([qp],e.prototype,"checkFriends",null),ae([qp],e.prototype,"getFriends",null),ae([qp],e.prototype,"getFriendApplications",null),ae([qp],e.prototype,"getFriendsInfo",null),ae([qp],e.prototype,"searchFriendsInfo",null),ae([qp],e.prototype,"setFriendAddPermission",null),ae([qp],e.prototype,"getFriendAddPermission",null),ae([Yp],e.prototype,"getRealtimeConversations",null),ae([Yp],e.prototype,"getRealtimeConTotalUnreadCount",null),ae([Yp],e.prototype,"clearRealtimeConUnreadCount",null),ae([Yp],e.prototype,"removeRealtimeConversations",null),ae([Yp],e.prototype,"getRealtimeConUnreadCounts",null),e}();exports.APIContext=Kp,exports.AppStorage=ba,exports.BasicEngine=Ia,exports.BasicLogger=pn,exports.Codec=ss,exports.EventEmitter=is,exports.MAX_MESSAGE_CONTENT_BYTES=Le,exports.MAX_UPLOAD_FILE_SIZE=5368709120,exports.PBCodec=Rr,exports.PluginContext=Ra,exports.RCResult=ot,exports.RTCPluginContext=ya,exports.SEND_MESSAGE_TYPE_OPTION=Ue,exports.SuspendablePromise=rt,exports.UPLOAD_FILE_CHUNK_SIZE=10485760,exports.UUId=Ze,exports.Validator=at,exports.ValidatorManage=Ma,exports.VersionManage=ze,exports.assert=function(e,t,n,r){if(void 0===r&&(r=!1),!Oa(e,t,n,r))throw new Na("'".concat(e,"' is invalid: ").concat(JSON.stringify(t)))},exports.fail=st,exports.fixUrlProtocol=Xt,exports.forEach=St,exports.getUUID=function(){return Ze.gen()},exports.getUUID22=function(){return Ze.genWithLen(22)},exports.httpRequest=rn,exports.isArray=pt,exports.isBoolean=function(e){return"boolean"==typeof e},exports.isFunction=ft,exports.isHttpUrl=It,exports.isInteger=function(e){return function(t){return Number.isInteger(t)&&(void 0===e.min||t>=e.min)&&(void 0===e.max||t<=e.max)}},exports.isLimitedArray=function(e){return function(t){if(!pt(t)||void 0!==e.minLength&&t.length<e.minLength||void 0!==e.maxLength&&t.length>e.maxLength)return!1;if(!e.itemValidator)return!0;var n=!0;return t.every((function(t){var r=e.itemValidator&&e.itemValidator(t);return"object"==typeof r?r.errorKey?(n={errorKey:r.errorKey,valid:r.valid},!1):(n=r.valid,r.valid):(n=!!r,r)})),n}},exports.isLimitedString=ht,exports.isNull=function(e){return"[object Null]"===Object.prototype.toString.call(e)},exports.isNumber=dt,exports.isObject=gt,exports.isString=lt,exports.isUndefined=Et,exports.isValidConversation=function(e,t){var n;return gt(e)?(t&&!t.includes(e.conversationType)&&(n="conversationTypeNotSupport"),Rt(e.targetId)||(n="targetId"),Ct(e.conversationType)||(n="conversationType"),Et(e.channelId)||vt(e.channelId)||(n="channelId"),Et(n)?{valid:!0}:{valid:Et(n),errorKey:n}):{valid:!1,errorKey:"conversation"}},exports.isValidConversationType=Ct,exports.isValidEnum=function(e){return Object.values(e.type).includes(e.value)},exports.isValidFileType=function(e){return dt(e)&&Object.prototype.hasOwnProperty.call(exports.FileType,e)},exports.isValidGroupId=function(e){return ht({minLength:1,maxLength:64})(e)&&/^[a-zA-Z0-9+=\-_|:]*$/.test(e)},exports.isValidNotificationLevel=function(e){return dt(e)&&Object.prototype.hasOwnProperty.call(exports.NotificationLevel,e)},exports.isValidTargetId=Rt,exports.logger=os,exports.map=At,exports.notEmptyArray=function(e){return pt(e)&&e.length>0},exports.notEmptyObject=Tt,exports.notEmptyString=_t,exports.ok=it,exports.runtime=Tr,exports.transformNotificationLevel=Ne,exports.transformNotificationStatus=Ae,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.transformReceivedStatusInfo=Ut,exports.usingCppEngine=Ot,exports.validate=Oa;
|
|
16
|
+
var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};function t(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var n,r,o,i,s,a,u,c,l,d,p,h,_,f,E,I,T,v,C,R,y,m,S,A,N,O,M,L,U,b,P,w,x,D,V,G,k,F,B,H,q,Y,K,Q,W,j,J,z,Z,X,$,ee,te,ne,re,oe,ie,se=function(){return se=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},se.apply(this,arguments)};function ae(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s}function ue(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{u(r.next(e))}catch(e){i(e)}}function a(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))}function ce(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function le(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function de(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}function pe(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function he(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function _e(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n}exports.UploadMethod=void 0,(n=exports.UploadMethod||(exports.UploadMethod={}))[n.QINIU=1]="QINIU",n[n.ALI=2]="ALI",n[n.AWS=3]="AWS",n[n.STC=4]="STC",n[n.MINIO=5]="MINIO",exports.LogTagId=void 0,(r=exports.LogTagId||(exports.LogTagId={})).L_IMSDK_VER_O="L-imsdk_ver-O",r.A_INIT_REPEAT_O="A_INIT_REPEAT_O",r.L_INIT_O="L-init-O",r.A_DESTROY_O="A_DESTROY_O",r.L_DESTROY_O="L_DESTROY_O",r.A_CONNECT_T="A-connect-T",r.A_CONNECT_R="A-connect-R",r.A_CONNECT_S="A-connect-S",r.A_DISCONNECT_O="A-disconnect-O",r.A_RECONNECT_T="A-reconnect-T",r.A_RECONNECT_R="A_RECONNECT_R",r.L_CONNECT_T="L-connect-T",r.L_CONNECT_R="L-connect-R",r.L_CONNECT_S="L-connect-S",r.L_DB_UPGRATE_START_S="L-db_upgrate_start-S",r.L_DB_UPGRATING_S="L-db_upgrating-S",r.L_DB_UPGRATE_COMPLETE_S="L-db_upgrate_complete-S",r.L_NOTIFY_ULTRA_ONLINE_S="L-notify-ultra-online-S",r.L_ULTRA_SYNC_DONE_S="L-ultra-sync-done-S",r.L_BATCH_MESSAGE_O="L-BATCH_MESSAGE-O",r.A_MSG_LISTENER_E="A-MSG_LISTENER-E",r.O="L-original-O",r.T="L-TEST-O",r.L_INSTALL_PLUGIN_T="L-INSTALL_PLUGIN-T",r.L_INSTALL_PLUGIN_R="L-INSTALL_PLUGIN-R",r.L_NAVI_CONF_E="L-NAVI_CONF_ERROR-E",r.L_NAVI_CMP_R="L-NAVI_CPM-R",r.A_SEND_MSG_T="A-send_msg-T",r.A_SEND_MSG_R="A-send_msg-R",r.L_SEND_MSG_T="L-send_msg-T",r.L_SEND_MSG_R="L-send_msg-R",r.L_PULL_MSG_T="L-pull_msg-T",r.L_PULL_MSG_R="L-pull_msg-R",r.L_PULL_MSG_E="L-pull_msg-E",r.L_PULL_MSG_O="L-pull_msg-O",r.L_PULL_ULTRA_MSG_T="L-pull_ultra_msg-T",r.L_PULL_ULTRA_MSG_R="L-pull_ultra_msg-R",r.L_PULL_CHATROOM_KV_T="L-pull_chatroom_kv-T",r.L_PULL_CHATROOM_KV_R="L-pull_chatroom_kv-R",r.L_PULL_CHATROOM_MSG_T="L-pull_chatroom_msg-T",r.L_PULL_CHATROOM_MSG_R="L-pull_chatroom_msg-R",r.L_RECV_MULTI_SYNC_MSG_O="L-recv_multi_sync_msg-O",r.L_RECV_S_MSG_O="L-recv_s_msg-O",r.A_DELETE_MESSAGES_S="A-delete_messages-S",r.P_DELETE_MSG_S="P-delete_msg-S",r.L_PULL_CONVERSATION_S="L-pull_conversation-S",r.A_RECALL_MESSAGE_T="A-recall_msg-T",r.A_RECALL_MESSAGE_R="A-recall_msg-R",r.A_RECALL_MESSAGE_E="A-recall_msg-E",r.A_REGTYP_O="A-regtyp-O",r.P_REGTYP_E="P-regtype-E",r.L_GET_NAVI_T="L-get_navi-T",r.L_GET_NAVI_R="L-get_navi-R",r.L_REQUEST_T="L-request-T",r.L_REQUEST_R="L-request-R",r.L_PARSE_NAVI_E="L-parse_navi-E",r.L_ENV_S="L-Env-S",r.L_GET_INDEX_NAVI_S="L-get_index_navi-S",r.A_JOIN_CHATROOM_T="A-join_chatroom-T",r.A_JOIN_CHATROOM_R="A-join_chatroom-R",r.L_JOIN_CHATROOM_T="L-join_chatroom-T",r.L_JOIN_CHATROOM_R="L-join_chatroom-R",r.A_QUIT_CHATROOM_T="A-quit_chatroom-T",r.A_QUIT_CHATROOM_R="A-quit_chatroom-R",r.L_REJOIN_CHATROOM_T="L-rejoin_chatroom-T",r.L_REJOIN_CHATROOM_R="L-rejoin_chatroom-R",r.L_REJOIN_CHATROOM_S="L-rejoin_chatroom-S",r.L_MEDIA_S="L-media-S",r.L_MEDIA_UPLOAD_T="L-media_upload-T",r.L_MEDIA_UPLOAD_R="L-media_upload-R",r.G_UPLOAD_LOG_S="G-upload_log-S",r.G_REPORT_LOG_S="G-report_log-S",r.G_UPLOAD_LOG_E="G-upload_log-E",r.G_GET_REAL_TIMELOG_COMMAND_S="G-get_real_timelog_command-S",r.L_CHECK_ALIVE_IM_T="L-check_alive_im-T",r.L_CHECK_ALIVE_IM_R="L-check_alive_im-R",r.L_CHECK_ALIVE_IM_S="L-check_alive_im-S",r.A_GET_LOCAL_MESSAGE_T="A-get_local_message-T",r.A_GET_LOCAL_MESSAGE_R="A-get_local_message-R",r.A_GET_HISTORY_MSG_T="A-get_history_msg-T",r.A_GET_HISTORY_MSG_R="A-get_history_msg-R",r.L_GET_HISTORY_MSG_T="L-get_history_msg-T",r.L_GET_HISTORY_MSG_R="L-get_history_msg-R",r.A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E="A-get_privage_message_deliver_time-E",r.A_GET_GROUP_MESSAGE_DELIVER_LIST_E="A-get_group_message_deliver_list-E",r.A_CALLBACK_O="A-callback-O",r.A_CALLBACK_E="A-callback-E",r.L_CALLBACK_E="L-callback-E",r.A_SEND_MESSAGE_READ_RECEIPT_V4_T="A-send_message_read_receipt_V4-T",r.A_SEND_MESSAGE_READ_RECEIPT_V4_R="A-send_message_read_receipt_V4-R",r.A_GET_MESSAGE_READ_RECEIPT_V4_T="A-get_message_read_receipt_V4-T",r.A_GET_MESSAGE_READ_RECEIPT_V4_R="A-get_message_read_receipt_V4-R",r.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_T="A-batch_get_message_read_receipt_info_V4-T",r.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_R="A-batch_get_message_read_receipt_info_V4-R",r.A_SYNC_READ_STATUS_T="A-sync_read_status-T",r.A_SYNC_READ_STATUS_R="A-sync_read_status-R",r.A_GET_TOP_CONVERSATION_LIST_E="A-get_top_conversation_list-E",r.L_PB_ENCODE_E="L-pb-encode-E",r.L_PB_DECODE_E="L-pb-decode-E",r.L_NOTIFY_NAVI_CHANGE_E="L-notify_navi_change-E",r.L_REPORT_FULL_LOG_O="L-report_full_log-O",r.L_REPORT_FULL_LOG_T="L-report_full_log-T",r.L_REPORT_FULL_LOG_R="L-report_full_log-R",r.L_REPORT_LOG_POLICY_E="L-parse_navi_logpolicy-E",r.L_UNSUPPORT_INDEXDB_O="L-unsupport_IndexDB-O",r.L_LOGDB_OPEN_FAILED_E="L-logDB_open_failed-E",r.L_LOGDB_CLOSED_S="L-logDB_closed-S",r.L_LOGDB_ERROR_E="L-logDB_error-S",r.L_LOGDB_ABORT_S="L-logDB_abort-S",r.L_REALTIME_LOG_R="L_REALTIME_LOG_R",r.L_REALTIME_LOG_O="L_REALTIME_LOG_O",r.L_REALTIME_LOG_T="L_REALTIME_LOG_T",r.L_STATISTIC_LOG_R="L_STATISTIC_LOG_R",r.L_STATISTIC_LOG_O="L_STATISTIC_LOG_O",r.L_STATISTIC_LOG_T="L_STATISTIC_LOG_T",r.L_UNKNOWN_TOPIC_E="L_UNKNOWN_TOPIC_E",r.L_RECV_RMTP_O="L_RECV_RMTP_O",r.L_RECV_RMTP_E="L_RECV_RMTP_E",r.L_RECV_S_NTF_O="L-recv_s_ntf_O",r.L_VER_REPORT_T="L-VER_REPORT-T",r.L_VER_REPORT_R="L-VER_REPORT-R",r.L_CALL_MAIN_SYNC_O="L_CALL_MAIN_SYNC_O",r.L_UNSUPPORT_NTF_FROM_MAIN_E="L_UNSUPPORT_NTF_FROM_MAIN_E",r.A_SET_MSG_CONTENT_O="A_SET_MSG_CONTENT_O",r.A_REMOVE_PROXY_O="A-remove_proxy-O",r.A_SET_PROXY_O="A-set_proxy-O",r.A_TEST_PROXY_O="A-test_proxy-O",r.L_WEBSOCKET_DISACCORD_E="L-websocket_disaccord-e",r.A_SEARCH_MESSAGE_BY_USER_T="A-search_messages_by_user-T",r.A_SEARCH_MESSAGE_BY_USER_R="A-search_messages_by_user-R",r.L_GET_STATIC_CONF_T="L-get_static_conf-T",r.L_GET_STATIC_CONF_R="L-get_static_conf-R",r.L_GET_STATIC_CONF_E="L-get_static_conf-E",r.L_CLOUD_DISABLED="L-cloud_disabled",r.L_CLOUD_EXPIRE="L-cloud_expire",r.L_CLOUD_OVERCLOCK="L-cloud_overclock",r.L_CLOUD_APPKEY_REGION_E="L-cloud_appkey_region_error",r.L_CLOUD_CONFIG_DATA_E="L-cloud_config_data_error",r.L_CLOUD_SET_CACHE_O="L-cloud_set_cache-O",r.L_CLOUD_GET_CACHE_O="L-cloud_get_cache-O",r.L_CLOUD_MSG_NTF_O="L-cloud_msg_ntf-O",r.L_CLOUD_SET_AREA_CODE_O="L-cloud_set_area_code-O",r.L_CLOUD_SET_MRTR_O="L-cloud_set_mrtr-O",r.L_SYNC_SUBSCRIBED_USER_STATUS_FINISHED_S="L-sync_subscribed_user_status_finished-S",r.L_PULL_SUBSCRIBED_USER_RELATION_T="L-pull_subscribed_user_relation-T",r.L_PULL_SUBSCRIBED_USER_RELATION_R="L-pull_subscribed_user_relation-R",r.L_PULL_SUBSCRIBED_USER_STATUS_T="L-pull_subscribed_user_status-T",r.L_PULL_SUBSCRIBED_USER_STATUS_R="L-pull_subscribed_user_status-R",r.L_OWN_USER_PROFILE_CHANGED_S="L-own_user_profile_changed-S",r.L_QUERY_SUBSCRIBE_DATA_T="L-query_subscribe_data-T",r.L_QUERY_SUBSCRIBE_DATA_R="L-query_subscribe_data-R",r.L_PULL_USER_PROFILE_T="L-pull_user_profile-T",r.L_PULL_USER_PROFILE_R="L-pull_user_profile-R",r.L_PULL_OWN_PROFILE_T="L-pull_own_profile-T",r.L_PULL_OWN_PROFILE_R="L-pull_own_profile-R",r.L_QUERY_FRIEND_LIST_T="L-query_friend_list-T",r.L_QUERY_FRIEND_LIST_R="L-query_friend_list-R",r.L_PULL_USER_PROFILE_REQ_T="L-pull_user_profile_req-T",r.L_PULL_USER_PROFILE_REQ_R="L-pull_user_profile_req-R",r.L_PULL_EVENT_CHANGE_NOTIFY_ULTRA_ONLINE_S="L-pull_event_change_notify_ultra_online-S",r.L_PULL_EVENT_CHANGE_T="L-pull_event_change-T",r.L_PULL_EVENT_CHANGE_R="L-pull_event_change-R",r.L_PARSE_JSON_E="L-parse_json-E",r.L_REQ_STREAM_MSG_CONTENT_T="L-req_stream_msg_content-T",r.L_REQ_STREAM_MSG_CONTENT_R="L-req_stream_msg_content-R",r.L_REQ_STREAM_MSG_CONTENT_O="L-req_stream_msg_content-O",r.L_REQ_STREAM_MSG_CONTENT_E="L-req_stream_msg_content-E",exports.DirectionType=void 0,(o=exports.DirectionType||(exports.DirectionType={}))[o.BOTH=2]="BOTH",exports.QueryFriendsDirectionType=void 0,(i=exports.QueryFriendsDirectionType||(exports.QueryFriendsDirectionType={}))[i.BOTH=2]="BOTH",exports.FriendAddPermission=void 0,(s=exports.FriendAddPermission||(exports.FriendAddPermission={}))[s.FREE=1]="FREE",s[s.NEED_VERIFY=2]="NEED_VERIFY",s[s.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED",exports.FriendRelationType=void 0,(a=exports.FriendRelationType||(exports.FriendRelationType={}))[a.NONE=0]="NONE",a[a.IN_MY_FRIEND_LIST=1]="IN_MY_FRIEND_LIST",a[a.IN_OTHER_FRIEND_LIST=2]="IN_OTHER_FRIEND_LIST",a[a.BOTH_WAY=3]="BOTH_WAY",exports.FriendApplicationType=void 0,(u=exports.FriendApplicationType||(exports.FriendApplicationType={}))[u.SENT=1]="SENT",u[u.RECEIVED=2]="RECEIVED",exports.FriendApplicationStatus=void 0,(c=exports.FriendApplicationStatus||(exports.FriendApplicationStatus={}))[c.UNHANDLED=0]="UNHANDLED",c[c.ACCEPTED=1]="ACCEPTED",c[c.REFUSED=2]="REFUSED",c[c.EXPIRED=3]="EXPIRED",function(e){e[e.FRIEND_APPLICATION=31]="FRIEND_APPLICATION"}(l||(l={})),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"}(d||(d={})),exports.GroupJoinPermission=void 0,(p=exports.GroupJoinPermission||(exports.GroupJoinPermission={}))[p.OWNER_VERIFY=0]="OWNER_VERIFY",p[p.FREE=1]="FREE",p[p.OWNER_OR_MANAGER_VERIFY=2]="OWNER_OR_MANAGER_VERIFY",p[p.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED",exports.GroupOperationPermission=void 0,(h=exports.GroupOperationPermission||(exports.GroupOperationPermission={}))[h.OWNER=0]="OWNER",h[h.OWNER_OR_MANAGER=1]="OWNER_OR_MANAGER",h[h.EVERYONE=2]="EVERYONE",exports.GroupMemberInfoEditPermission=void 0,(_=exports.GroupMemberInfoEditPermission||(exports.GroupMemberInfoEditPermission={}))[_.OWNER_OR_MANAGER_OR_SELF=0]="OWNER_OR_MANAGER_OR_SELF",_[_.OWNER_OR_SELF=1]="OWNER_OR_SELF",_[_.SELF=2]="SELF",exports.GroupInviteHandlePermission=void 0,(f=exports.GroupInviteHandlePermission||(exports.GroupInviteHandlePermission={}))[f.FREE=0]="FREE",f[f.INVITEE_VERIFY=1]="INVITEE_VERIFY",exports.GroupMemberRole=void 0,(E=exports.GroupMemberRole||(exports.GroupMemberRole={}))[E.UNDEF=0]="UNDEF",E[E.NORMAL=1]="NORMAL",E[E.MANAGER=2]="MANAGER",E[E.OWNER=3]="OWNER",exports.GroupOperation=void 0,(I=exports.GroupOperation||(exports.GroupOperation={}))[I.CREATE=0]="CREATE",I[I.JOIN=1]="JOIN",I[I.KICK=2]="KICK",I[I.QUIT=3]="QUIT",I[I.DISMISS=4]="DISMISS",I[I.ADD_MANAGER=5]="ADD_MANAGER",I[I.REMOVE_MANAGER=6]="REMOVE_MANAGER",I[I.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"}(T||(T={})),exports.GroupOperationType=void 0,(v=exports.GroupOperationType||(exports.GroupOperationType={}))[v.ADD=1]="ADD",v[v.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,(R=exports.GroupOperationStatus||(exports.GroupOperationStatus={}))[R.REFUSE=0]="REFUSE",R[R.ACCEPT=1]="ACCEPT",exports.GroupOperationRole=void 0,(y=exports.GroupOperationRole||(exports.GroupOperationRole={}))[y.APPLICANT=0]="APPLICANT",y[y.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"}(m||(m={})),exports.GroupApplicationType=void 0,(S=exports.GroupApplicationType||(exports.GroupApplicationType={}))[S.APPLICATION=0]="APPLICATION",S[S.INVITATION=1]="INVITATION",exports.GroupApplicationDirection=void 0,(A=exports.GroupApplicationDirection||(exports.GroupApplicationDirection={}))[A.APPLICATION_SENT=0]="APPLICATION_SENT",A[A.INVITATION_SENT=1]="INVITATION_SENT",A[A.INVITATION_RECEIVED=2]="INVITATION_RECEIVED",A[A.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,(O=exports.ChrmSyncStatus||(exports.ChrmSyncStatus={}))[O.QUIT=0]="QUIT",O[O.JOIN=1]="JOIN",exports.ChatroomSyncStatusReason=void 0,(M=exports.ChatroomSyncStatusReason||(exports.ChatroomSyncStatusReason={}))[M.LeaveOnMyOwn=0]="LeaveOnMyOwn",M[M.OtherDeviceLogin=1]="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,(b=exports.ChrmMemOperateType||(exports.ChrmMemOperateType={}))[b.Deblock=0]="Deblock",b[b.Blocked=1]="Blocked",exports.ErrorCode=void 0,(P=exports.ErrorCode||(exports.ErrorCode={}))[P.SUCCESS=0]="SUCCESS",P[P.ACTIVE_DISCONNECT=2]="ACTIVE_DISCONNECT",P[P.REJECTED_BY_BLACKLIST=405]="REJECTED_BY_BLACKLIST",P[P.FORBIDDEN_IN_PRIVATE=20106]="FORBIDDEN_IN_PRIVATE",P[P.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE=20109]="SYS_CONVERSATION_NOT_SUPPORT_MESSAGE",P[P.CLOUD_DATA_CENTER_INVALID=20512]="CLOUD_DATA_CENTER_INVALID",P[P.SEND_FREQUENCY_TOO_FAST=20604]="SEND_FREQUENCY_TOO_FAST",P[P.OPERATION_BLOCKED=20605]="OPERATION_BLOCKED",P[P.OPERATION_NOT_SUPPORT=20606]="OPERATION_NOT_SUPPORT",P[P.REQUEST_OVER_FREQUENCY=20607]="REQUEST_OVER_FREQUENCY",P[P.NOT_IN_DISCUSSION=21406]="NOT_IN_DISCUSSION",P[P.SENSITIVE_SHIELD=21501]="SENSITIVE_SHIELD",P[P.SENSITIVE_REPLACE=21502]="SENSITIVE_REPLACE",P[P.MESSAGE_EXPAND_NOT_EXIST=22201]="MESSAGE_EXPAND_NOT_EXIST",P[P.MESSAGE_EXPAND_NOT_SUPPORT=22202]="MESSAGE_EXPAND_NOT_SUPPORT",P[P.MESSAGE_EXPAND_FORMAT_ERROR=22203]="MESSAGE_EXPAND_FORMAT_ERROR",P[P.MESSAGE_EXPAND_NOT_AUTHORIZED=22204]="MESSAGE_EXPAND_NOT_AUTHORIZED",P[P.NOT_IN_GROUP=22406]="NOT_IN_GROUP",P[P.FORBIDDEN_IN_GROUP=22408]="FORBIDDEN_IN_GROUP",P[P.NOT_IN_CHATROOM=23406]="NOT_IN_CHATROOM",P[P.GET_USERINFO_ERROR=23407]="GET_USERINFO_ERROR",P[P.FORBIDDEN_IN_CHATROOM=23408]="FORBIDDEN_IN_CHATROOM",P[P.RC_CHATROOM_USER_KICKED=23409]="RC_CHATROOM_USER_KICKED",P[P.RC_CHATROOM_NOT_EXIST=23410]="RC_CHATROOM_NOT_EXIST",P[P.RC_CHATROOM_IS_FULL=23411]="RC_CHATROOM_IS_FULL",P[P.RC_CHATROOM_PATAMETER_INVALID=23412]="RC_CHATROOM_PATAMETER_INVALID",P[P.CHATROOM_GET_HISTORYMSG_ERROR=23413]="CHATROOM_GET_HISTORYMSG_ERROR",P[P.CHATROOM_NOT_OPEN_HISTORYMSG_STORE=23414]="CHATROOM_NOT_OPEN_HISTORYMSG_STORE",P[P.CHATROOM_KV_EXCEED=23423]="CHATROOM_KV_EXCEED",P[P.CHATROOM_KV_OVERWRITE_INVALID=23424]="CHATROOM_KV_OVERWRITE_INVALID",P[P.CHATROOM_SET_PROPERTY_OVER_FREQUENCY=23425]="CHATROOM_SET_PROPERTY_OVER_FREQUENCY",P[P.CHATROOM_KV_STORE_NOT_OPEN=23426]="CHATROOM_KV_STORE_NOT_OPEN",P[P.CHATROOM_KEY_NOT_EXIST=23427]="CHATROOM_KEY_NOT_EXIST",P[P.CHATROOM_KV_STORE_NOT_ALL_SUCCESS=23428]="CHATROOM_KV_STORE_NOT_ALL_SUCCESS",P[P.CHATROOM_KV_STORE_OUT_LIMIT=23429]="CHATROOM_KV_STORE_OUT_LIMIT",P[P.CHATROOM_KV_SET_ERROR=23431]="CHATROOM_KV_SET_ERROR",P[P.HAVNODEVICEID=24001]="HAVNODEVICEID",P[P.DEVICEIDISHAVE=24002]="DEVICEIDISHAVE",P[P.FEILD=24009]="FEILD",P[P.INTERNALERRROR=24015]="INTERNALERRROR",P[P.RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET=24360]="RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET",P[P.RC_USER_PROFILE_KEY_NOT_EXIST=24361]="RC_USER_PROFILE_KEY_NOT_EXIST",P[P.RC_USER_PROFILE_EXT_KEY_NOT_EXIST=24362]="RC_USER_PROFILE_EXT_KEY_NOT_EXIST",P[P.RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT=24363]="RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT",P[P.RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT=24364]="RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT",P[P.RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT=24365]="RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT",P[P.RC_USER_PROFILE_USER_NOT_EXIST=24366]="RC_USER_PROFILE_USER_NOT_EXIST",P[P.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS=24367]="RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS",P[P.RC_USER_PROFILE_VALUE_EXCEED_RANGE=24368]="RC_USER_PROFILE_VALUE_EXCEED_RANGE",P[P.RC_USER_PROFILE_SERVICE_UNAVAILABLE=24369]="RC_USER_PROFILE_SERVICE_UNAVAILABLE",P[P.ULTRA_GROUP_SERVICE_UNAVAILABLE=24401]="ULTRA_GROUP_SERVICE_UNAVAILABLE",P[P.ULTRA_GROUP_SERVICE_ERROR=24402]="ULTRA_GROUP_SERVICE_ERROR",P[P.ULTRA_GROUP_PARAMETER_ERROR=24403]="ULTRA_GROUP_PARAMETER_ERROR",P[P.ULTRA_GROUP_UNKNOWN_ERROR=24404]="ULTRA_GROUP_UNKNOWN_ERROR",P[P.NOT_IN_ULTRA_GROUP=24406]="NOT_IN_ULTRA_GROUP",P[P.FORBIDDEN_IN_ULTRA_GROUP=24408]="FORBIDDEN_IN_ULTRA_GROUP",P[P.ULTRA_GROUP_NOT_EXIST=24410]="ULTRA_GROUP_NOT_EXIST",P[P.ULTRA_GROUP_MEMBERS_OVERSIZE=24411]="ULTRA_GROUP_MEMBERS_OVERSIZE",P[P.ULTRA_GROUP_JOINED_OVERSIZE=24412]="ULTRA_GROUP_JOINED_OVERSIZE",P[P.ULTRA_GROUP_CHANNELS_OVERSIZE=24413]="ULTRA_GROUP_CHANNELS_OVERSIZE",P[P.ULTRA_GROUP_CHANNEL_ID_NOT_EXIST=24414]="ULTRA_GROUP_CHANNEL_ID_NOT_EXIST",P[P.ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY=24415]="ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY",P[P.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL=24416]="ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL",P[P.RECALL_MESSAGE=25101]="RECALL_MESSAGE",P[P.MESSAGE_STORAGE_SERVICE_UNAVAILABLE=25102]="MESSAGE_STORAGE_SERVICE_UNAVAILABLE",P[P.RC_SERVER_UNKOWN_ERROR=25104]="RC_SERVER_UNKOWN_ERROR",P[P.RECALL_MESSAGE_USER_INVALID=25107]="RECALL_MESSAGE_USER_INVALID",P[P.RC_ENTRUST_SERVER_ERROR=25402]="RC_ENTRUST_SERVER_ERROR",P[P.RC_ENTRUST_SERVER_PARAMETER_ERROR=25403]="RC_ENTRUST_SERVER_PARAMETER_ERROR",P[P.RC_GROUP_ILLEGAL_ERROR=25404]="RC_GROUP_ILLEGAL_ERROR",P[P.RC_GROUP_AUTHORITY_ERROR=25405]="RC_GROUP_AUTHORITY_ERROR",P[P.RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT=25406]="RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT",P[P.RC_GROUP_PARAMETER_FORMAT_ERROR=25407]="RC_GROUP_PARAMETER_FORMAT_ERROR",P[P.RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS=25408]="RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS",P[P.RC_GROUP_ID_ALREADY_EXIST=25409]="RC_GROUP_ID_ALREADY_EXIST",P[P.RC_GROUP_ID_NOT_EXIST=25410]="RC_GROUP_ID_NOT_EXIST",P[P.RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT=25411]="RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT",P[P.RC_GROUP_MEMBERS_ALREADY_IN_GROUP=25412]="RC_GROUP_MEMBERS_ALREADY_IN_GROUP",P[P.RC_GROUP_NOT_ALLOW_SDK_OPERATION=25413]="RC_GROUP_NOT_ALLOW_SDK_OPERATION",P[P.RC_GROUP_NOT_ALLOW_JOIN=25414]="RC_GROUP_NOT_ALLOW_JOIN",P[P.RC_GROUP_EXT_KEY_NOT_EXIST=25415]="RC_GROUP_EXT_KEY_NOT_EXIST",P[P.RC_GROUP_REQUEST_OVERFREQUENCY=25416]="RC_GROUP_REQUEST_OVERFREQUENCY",P[P.RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK=25417]="RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK",P[P.RC_GROUP_USER_NOT_IN_GROUP=25418]="RC_GROUP_USER_NOT_IN_GROUP",P[P.RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT=25419]="RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT",P[P.RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP=25420]="RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP",P[P.RC_GROUP_APPLICATION_NOT_EXIST=25421]="RC_GROUP_APPLICATION_NOT_EXIST",P[P.RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT=25422]="RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT",P[P.RC_GROUP_NAME_INVALID=25423]="RC_GROUP_NAME_INVALID",P[P.RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT=25424]="RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT",P[P.RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER=25425]="RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER",P[P.RC_GROUP_NO_INVITE_PERMISSION=25426]="RC_GROUP_NO_INVITE_PERMISSION",P[P.RC_GROUP_NEED_INVITEE_ACCEPT=25427]="RC_GROUP_NEED_INVITEE_ACCEPT",P[P.RC_GROUP_APPLICATION_ALREADY_HANDLE=25428]="RC_GROUP_APPLICATION_ALREADY_HANDLE",P[P.RC_GROUP_OLD_GROUP_NOT_ENTRUST=25429]="RC_GROUP_OLD_GROUP_NOT_ENTRUST",P[P.RC_GROUP_ID_INVALID=25430]="RC_GROUP_ID_INVALID",P[P.RC_PAGE_TOKEN_PARSING_FAILED=25432]="RC_PAGE_TOKEN_PARSING_FAILED",P[P.RC_FRIEND_ALREADY_FRIEND=25460]="RC_FRIEND_ALREADY_FRIEND",P[P.RC_FRIEND_NEED_ACCEPT=25461]="RC_FRIEND_NEED_ACCEPT",P[P.RC_FRIEND_IN_OTHER_BLACK_LIST=25462]="RC_FRIEND_IN_OTHER_BLACK_LIST",P[P.RC_FRIEND_NOT_IN_OTHER_WHITE_LIST=25463]="RC_FRIEND_NOT_IN_OTHER_WHITE_LIST",P[P.RC_FRIEND_IN_MY_BLACK_LIST=25464]="RC_FRIEND_IN_MY_BLACK_LIST",P[P.RC_FRIEND_NOT_IN_MY_WHITE_LIST=25465]="RC_FRIEND_NOT_IN_MY_WHITE_LIST",P[P.RC_FRIEND_APPLICATION_NOT_EXIST=25466]="RC_FRIEND_APPLICATION_NOT_EXIST",P[P.RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT=25467]="RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT",P[P.RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT=25468]="RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT",P[P.RC_FRIEND_NOT_FRIEND=25469]="RC_FRIEND_NOT_FRIEND",P[P.RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT=25470]="RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT",P[P.RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND=25471]="RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND",P[P.RC_FRIEND_NOT_EXIST=25472]="RC_FRIEND_NOT_EXIST",P[P.RC_FRIEND_NOT_ALLOW_ADD_SELF=25473]="RC_FRIEND_NOT_ALLOW_ADD_SELF",P[P.SERVICE_INFORMATION_AUDIT_FAILED=25480]="SERVICE_INFORMATION_AUDIT_FAILED",P[P.PUSH_PARAMETER_INVALID=26001]="PUSH_PARAMETER_INVALID",P[P.USER_SETTING_SYNCED_ERROR=26002]="USER_SETTING_SYNCED_ERROR",P[P.CONVERSATION_TAG_OVERSIZE=26004]="CONVERSATION_TAG_OVERSIZE",P[P.RC_READ_RECEIPT_V4_INVALID=26005]="RC_READ_RECEIPT_V4_INVALID",P[P.RC_SERVER_DRIVE_UNREAD_COUNT_INVALID=26006]="RC_SERVER_DRIVE_UNREAD_COUNT_INVALID",P[P.RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED=26007]="RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED",P[P.RC_SERVER_PARAMETER_MESSAGEUID_INVALID=26009]="RC_SERVER_PARAMETER_MESSAGEUID_INVALID",P[P.RC_SERVER_PARAMETER_INVALID=26010]="RC_SERVER_PARAMETER_INVALID",P[P.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE=26020]="RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE",P[P.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT=26021]="RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT",P[P.RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT=26022]="RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT",P[P.RC_FILE_SIZE_EXCEED_LIMIT=26106]="RC_FILE_SIZE_EXCEED_LIMIT",P[P.INVALID_PARAMETER_SIZE_NOT_FOUND=26107]="INVALID_PARAMETER_SIZE_NOT_FOUND",P[P.RC_NET_CHANNEL_INVALID=30001]="RC_NET_CHANNEL_INVALID",P[P.RC_NET_UNAVAILABLE=30002]="RC_NET_UNAVAILABLE",P[P.RC_MSG_RESP_TIMEOUT=30003]="RC_MSG_RESP_TIMEOUT",P[P.RC_HTTP_SEND_FAIL=30004]="RC_HTTP_SEND_FAIL",P[P.RC_HTTP_REQ_FAIL=30005]="RC_HTTP_REQ_FAIL",P[P.RC_HTTP_RECV_FAIL=30006]="RC_HTTP_RECV_FAIL",P[P.RC_NAVI_REQ_FAILED=30007]="RC_NAVI_REQ_FAILED",P[P.RC_NODE_NOT_FOUND=30008]="RC_NODE_NOT_FOUND",P[P.RC_DOMAIN_NOT_RESOLVE=30009]="RC_DOMAIN_NOT_RESOLVE",P[P.RC_SOCKET_NOT_CREATED=30010]="RC_SOCKET_NOT_CREATED",P[P.RC_SOCKET_DISCONNECTED=30011]="RC_SOCKET_DISCONNECTED",P[P.RC_PING_EXCEED_LIMIT=30012]="RC_PING_EXCEED_LIMIT",P[P.PONG_RECEIVED_ERROR=30013]="PONG_RECEIVED_ERROR",P[P.RC_MSG_SEND_FAIL=30014]="RC_MSG_SEND_FAIL",P[P.CONNECT_OVER_FREQUENCY=30015]="CONNECT_OVER_FREQUENCY",P[P.RC_MSG_CONTENT_EXCEED_LIMIT=30016]="RC_MSG_CONTENT_EXCEED_LIMIT",P[P.MESSAGE_NOT_SUPPORT_SENDING=30017]="MESSAGE_NOT_SUPPORT_SENDING",P[P.RC_NETWORK_DOWN=30019]="RC_NETWORK_DOWN",P[P.RC_TCP_DISCONNECTED_NO_RMTP=30021]="RC_TCP_DISCONNECTED_NO_RMTP",P[P.RC_CONN_ACK_TIMEOUT=31e3]="RC_CONN_ACK_TIMEOUT",P[P.RC_CONN_PROTO_VERSION_ERROR=31001]="RC_CONN_PROTO_VERSION_ERROR",P[P.RC_CONN_IDENTIFIER_REJECTED=31002]="RC_CONN_IDENTIFIER_REJECTED",P[P.RC_CONN_SERVER_UNAVAILABLE=31003]="RC_CONN_SERVER_UNAVAILABLE",P[P.RC_CONN_TOKEN_INCORRECT=31004]="RC_CONN_TOKEN_INCORRECT",P[P.RC_CONN_NOT_AUTHRORIZED=31005]="RC_CONN_NOT_AUTHRORIZED",P[P.RC_CONN_REDIRECTED=31006]="RC_CONN_REDIRECTED",P[P.RC_CONN_PACKAGE_NAME_INVALID=31007]="RC_CONN_PACKAGE_NAME_INVALID",P[P.RC_CONN_APP_BLOCKED_OR_DELETED=31008]="RC_CONN_APP_BLOCKED_OR_DELETED",P[P.RC_CONN_USER_BLOCKED=31009]="RC_CONN_USER_BLOCKED",P[P.RC_DISCONN_KICK=31010]="RC_DISCONN_KICK",P[P.RC_DISCONN_EXCEPTION=31011]="RC_DISCONN_EXCEPTION",P[P.CONNECTION_ENCRYPT_AUTHORIZED_ERROR=31012]="CONNECTION_ENCRYPT_AUTHORIZED_ERROR",P[P.RC_CONN_TOKEN_EXPIRED=31020]="RC_CONN_TOKEN_EXPIRED",P[P.RC_CONN_DEVICE_ERROR=31021]="RC_CONN_DEVICE_ERROR",P[P.RC_CONN_HOSTNAME_ERROR=31022]="RC_CONN_HOSTNAME_ERROR",P[P.RC_DISCONN_SAME_CLIENT_ON_LINE=31023]="RC_DISCONN_SAME_CLIENT_ON_LINE",P[P.RC_LISCENSE_COUNT_OUT_OF_LIMIT=31024]="RC_LISCENSE_COUNT_OUT_OF_LIMIT",P[P.RC_CONN_WRONG_CLUSTER=31025]="RC_CONN_WRONG_CLUSTER",P[P.RC_APP_AUTH_NOT_PASS=31026]="RC_APP_AUTH_NOT_PASS",P[P.RC_OTP_USED=31027]="RC_OTP_USED",P[P.RC_PLATFORM_ERROR=31028]="RC_PLATFORM_ERROR",P[P.RC_ACCOUNT_CANCELLATION=31029]="RC_ACCOUNT_CANCELLATION",P[P.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",P[P.RC_QUERY_ACK_NO_DATA=32001]="RC_QUERY_ACK_NO_DATA",P[P.RC_MSG_DATA_INCOMPLETE=32002]="RC_MSG_DATA_INCOMPLETE",P[P.RC_UDP_DISCONNECTED=32011]="RC_UDP_DISCONNECTED",P[P.RC_TCP_RESET=32054]="RC_TCP_RESET",P[P.CONNECTION_REFUSED=32061]="CONNECTION_REFUSED",P[P.PROTOCOL_MESSAGE_SAVED_ERROR=33e3]="PROTOCOL_MESSAGE_SAVED_ERROR",P[P.BIZ_ERROR_CLIENT_NOT_INIT=33001]="BIZ_ERROR_CLIENT_NOT_INIT",P[P.BIZ_ERROR_DATABASE_ERROR=33002]="BIZ_ERROR_DATABASE_ERROR",P[P.BIZ_ERROR_INVALID_PARAMETER=33003]="BIZ_ERROR_INVALID_PARAMETER",P[P.BIZ_ERROR_NO_CHANNEL=33004]="BIZ_ERROR_NO_CHANNEL",P[P.BIZ_ERROR_RECONNECT_SUCCESS=33005]="BIZ_ERROR_RECONNECT_SUCCESS",P[P.BIZ_ERROR_CONNECTING=33006]="BIZ_ERROR_CONNECTING",P[P.MSG_ROAMING_SERVICE_UNAVAILABLE=33007]="MSG_ROAMING_SERVICE_UNAVAILABLE",P[P.MSG_INSERT_ERROR=33008]="MSG_INSERT_ERROR",P[P.MSG_DEL_ERROR=33009]="MSG_DEL_ERROR",P[P.TAG_NOT_EXIST=33100]="TAG_NOT_EXIST",P[P.TAG_EXISTS=33101]="TAG_EXISTS",P[P.NO_TAG_IN_CONVER=33102]="NO_TAG_IN_CONVER",P[P.RC_CONNECTION_EXIST=34001]="RC_CONNECTION_EXIST",P[P.PACKAGE_ENVIRONMENT_ERROR=34005]="PACKAGE_ENVIRONMENT_ERROR",P[P.CONNECTION_TIMEOUT=34006]="CONNECTION_TIMEOUT",P[P.MESSAGE_KV_NOT_SUPPORT=34008]="MESSAGE_KV_NOT_SUPPORT",P[P.MESSAGE_EXPANDED_ERROR=34009]="MESSAGE_EXPANDED_ERROR",P[P.EXPANSION_LIMIT_EXCEET=34010]="EXPANSION_LIMIT_EXCEET",P[P.UPLOAD_FAIL=34011]="UPLOAD_FAIL",P[P.CONVER_OUT_LIMIT_ERROR=34013]="CONVER_OUT_LIMIT_ERROR",P[P.READ_RECEIPT_ERROR=34014]="READ_RECEIPT_ERROR",P[P.PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE=34016]="PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE",P[P.MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE=34017]="MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE",P[P.MEDIA_EXCEPTION=34018]="MEDIA_EXCEPTION",P[P.MESSAGE_NOT_REGISTERED=34021]="MESSAGE_NOT_REGISTERED",P[P.METHOD_NOT_SUPPORT=34022]="METHOD_NOT_SUPPORT",P[P.ULTRA_GROUP_CHANNEL_NOT_EXIST=34024]="ULTRA_GROUP_CHANNEL_NOT_EXIST",P[P.INCONSISTENT_CONVERSATION_TYPE=34025]="INCONSISTENT_CONVERSATION_TYPE",P[P.CONVERSATION_TYPE_NOT_SUPPORT=34201]="CONVERSATION_TYPE_NOT_SUPPORT",P[P.INVALID_PARAMETER_TIMESTAMP=34202]="INVALID_PARAMETER_TIMESTAMP",P[P.INVALID_PARAMETER_MESSAGE_UID=34203]="INVALID_PARAMETER_MESSAGE_UID",P[P.INVALID_PARAMETER_MESSAGE_ID=34204]="INVALID_PARAMETER_MESSAGE_ID",P[P.INVALID_PARAMETER_MESSAGE_CONTENT=34205]="INVALID_PARAMETER_MESSAGE_CONTENT",P[P.MSG_LIMIT_ERROR=34206]="MSG_LIMIT_ERROR",P[P.INVALID_PARAMETER_MEDIA_TYPE=34207]="INVALID_PARAMETER_MEDIA_TYPE",P[P.INVALID_PARAMETER_CONVERSATION_TYPE=34209]="INVALID_PARAMETER_CONVERSATION_TYPE",P[P.INVALID_PARAMETER_TARGET_ID=34210]="INVALID_PARAMETER_TARGET_ID",P[P.INVALID_PARAMETER_CHANNEL_ID=34211]="INVALID_PARAMETER_CHANNEL_ID",P[P.INVALID_PARAMETER_TAG_ID=34212]="INVALID_PARAMETER_TAG_ID",P[P.INVALID_PARAMETER_TAG_NAME=34213]="INVALID_PARAMETER_TAG_NAME",P[P.INVALID_PARAMETER_USER_ID=34214]="INVALID_PARAMETER_USER_ID",P[P.INVALID_PARAMETER_USERIDLIST=34215]="INVALID_PARAMETER_USERIDLIST",P[P.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME=34217]="INVALID_PARAMETER_DOWNLOADMEDIAFILENAME",P[P.INVALID_PARAMETER_MESSAGE_EXPANSION=34220]="INVALID_PARAMETER_MESSAGE_EXPANSION",P[P.INVALID_PARAMETER_TIMESTRING=34224]="INVALID_PARAMETER_TIMESTRING",P[P.INVALID_PARAMETER_CONVERSATION=34225]="INVALID_PARAMETER_CONVERSATION",P[P.INVALID_PARAMETER_NOTIFICATION_LEVEL=34228]="INVALID_PARAMETER_NOTIFICATION_LEVEL",P[P.INVALID_PARAMETER_MESSAGE_ARRAY=34229]="INVALID_PARAMETER_MESSAGE_ARRAY",P[P.INVALID_PARAMETER_RECEIVED_STATUS=34230]="INVALID_PARAMETER_RECEIVED_STATUS",P[P.INVALID_PARAMETER_CHANNEL_TYPE=34231]="INVALID_PARAMETER_CHANNEL_TYPE",P[P.INVALID_PARAMETER_COUNT=34232]="INVALID_PARAMETER_COUNT",P[P.INVALID_PARAMETER_MEDIA_URL=34235]="INVALID_PARAMETER_MEDIA_URL",P[P.INVALID_PARAMETER_UNIQUE_ID=34236]="INVALID_PARAMETER_UNIQUE_ID",P[P.INVALID_PARAMETER_PROXY=34238]="INVALID_PARAMETER_PROXY",P[P.INVALID_PARAMETER_TESTHOST=34239]="INVALID_PARAMETER_TESTHOST",P[P.INVALID_CONNECT_TESTHOST_FAILED=34240]="INVALID_CONNECT_TESTHOST_FAILED",P[P.INVALID_PARAMETER_CONVERSATIONS=34242]="INVALID_PARAMETER_CONVERSATIONS",P[P.INVALID_PARAMETER_SENT_STATUS=34244]="INVALID_PARAMETER_SENT_STATUS",P[P.RC_CONN_PROXY_UNAVAILABLE=34245]="RC_CONN_PROXY_UNAVAILABLE",P[P.INVALID_PARAMETER_RTCROOMID=34259]="INVALID_PARAMETER_RTCROOMID",P[P.INVALID_PARAMETER_KEY=34260]="INVALID_PARAMETER_KEY",P[P.INVALID_PARAMETER_KEYS=34261]="INVALID_PARAMETER_KEYS",P[P.INVALID_PARAMETER_VALUE=34262]="INVALID_PARAMETER_VALUE",P[P.INVALID_PARAMETER_ENTRIES=34263]="INVALID_PARAMETER_ENTRIES",P[P.INVALID_PARAMETER_NOTIFICATION_EXTRA=34264]="INVALID_PARAMETER_NOTIFICATION_EXTRA",P[P.INVALID_PARAMETER_MESSAGE_OBJECT_NAME=34271]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME",P[P.INVALID_PARAMETER_BEFORE=34272]="INVALID_PARAMETER_BEFORE",P[P.INVALID_PARAMETER_AFTER=34273]="INVALID_PARAMETER_AFTER",P[P.INVALID_PARAMETER_KEYWORD=34274]="INVALID_PARAMETER_KEYWORD",P[P.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST=34275]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST",P[P.INVALID_PARAMETER_OFFSET=34276]="INVALID_PARAMETER_OFFSET",P[P.INVALID_PARAMETER_START_TIME=34277]="INVALID_PARAMETER_START_TIME",P[P.INVALID_PARAMETER_END_TIME=34278]="INVALID_PARAMETER_END_TIME",P[P.INVALID_PARAMETER_LIMIT=34279]="INVALID_PARAMETER_LIMIT",P[P.INVALID_MESSAGE_DIRECTION=34280]="INVALID_MESSAGE_DIRECTION",P[P.INVALID_MESSAGE_SENT_STATUS=34281]="INVALID_MESSAGE_SENT_STATUS",P[P.INVALID_PARAMETER_TARGETID_LIST=34282]="INVALID_PARAMETER_TARGETID_LIST",P[P.INVALID_PARAMETER_SPAN_MINUTES=34283]="INVALID_PARAMETER_SPAN_MINUTES",P[P.INVALID_PARAMETER_CONVERSATION_TYPE_LIST=34284]="INVALID_PARAMETER_CONVERSATION_TYPE_LIST",P[P.INVALID_PARAMETER_CONVERSATION_LIST=34287]="INVALID_PARAMETER_CONVERSATION_LIST",P[P.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST=34288]="INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST",P[P.INVALID_PARAMETER_START_MESSAGE_UID=34289]="INVALID_PARAMETER_START_MESSAGE_UID",P[P.INVALID_PARAMETER_END_MESSAGE_UID=34290]="INVALID_PARAMETER_END_MESSAGE_UID",P[P.READ_RECEIPT_V4_NOT_SUPPORT=34291]="READ_RECEIPT_V4_NOT_SUPPORT",P[P.READ_RECEIPT_V4_UPDATE_NOT_SUPPORT=34292]="READ_RECEIPT_V4_UPDATE_NOT_SUPPORT",P[P.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE=34296]="RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE",P[P.RC_DB_NOT_INIT=34301]="RC_DB_NOT_INIT",P[P.RC_DB_CORRUPT=34302]="RC_DB_CORRUPT",P[P.RC_DB_SQL_ERROR=34303]="RC_DB_SQL_ERROR",P[P.RC_DB_DATA_NOT_FOUND=34304]="RC_DB_DATA_NOT_FOUND",P[P.RC_NET_DATA_ERROR=34305]="RC_NET_DATA_ERROR",P[P.INVALID_PARAMETER_SUBSCRIBE_TYPE=34306]="INVALID_PARAMETER_SUBSCRIBE_TYPE",P[P.INVALID_PARAMETER_SUBSCRIBE_EXPIRY=34307]="INVALID_PARAMETER_SUBSCRIBE_EXPIRY",P[P.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS=34308]="INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS",P[P.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE=34309]="INVALID_PARAMETER_SUBSCRIBE_PAGESIZE",P[P.SUB_PROCESS_EXIT=34310]="SUB_PROCESS_EXIT",P[P.ADDON_NOT_EXIST=34311]="ADDON_NOT_EXIST",P[P.INVALID_PARAMETER_USER_PROFILE=34312]="INVALID_PARAMETER_USER_PROFILE",P[P.INVALID_PARAMETER_USER_PROFILE_VISIBILITY=34313]="INVALID_PARAMETER_USER_PROFILE_VISIBILITY",P[P.INVALID_PARAMETER_EXTRA=34314]="INVALID_PARAMETER_EXTRA",P[P.DB_UPGRADE_FAILED=34315]="DB_UPGRADE_FAILED",P[P.INVALID_PARAMETER_GROUP_INFO=34318]="INVALID_PARAMETER_GROUP_INFO",P[P.INVALID_PARAMETER_GROUP_ID=34319]="INVALID_PARAMETER_GROUP_ID",P[P.INVALID_PARAMETER_GROUP_NAME=34320]="INVALID_PARAMETER_GROUP_NAME",P[P.INVALID_PARAMETER_GROUP_IDS=34321]="INVALID_PARAMETER_GROUP_IDS",P[P.INVALID_PARAMETER_GROUP_MEMBER_ROLE=34322]="INVALID_PARAMETER_GROUP_MEMBER_ROLE",P[P.INVALID_PARAMETER_GROUP_APPLICATION_STATUS=34323]="INVALID_PARAMETER_GROUP_APPLICATION_STATUS",P[P.INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION=34324]="INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION",P[P.INVALID_PARAMETER_NICK_NAME=34325]="INVALID_PARAMETER_NICK_NAME",P[P.INVALID_PARAMETER_REASON=34326]="INVALID_PARAMETER_REASON",P[P.INVALID_PARAMETER_REMARK=34327]="INVALID_PARAMETER_REMARK",P[P.INVALID_PARAMETER_PAGING_QUERY_OPTION=34328]="INVALID_PARAMETER_PAGING_QUERY_OPTION",P[P.NET_DATA_IS_SYNCHRONIZING=34329]="NET_DATA_IS_SYNCHRONIZING",P[P.INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE=34330]="INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE",P[P.INVALID_PARAMETER_DIRECTION_TYPE=34331]="INVALID_PARAMETER_DIRECTION_TYPE",P[P.INVALID_PARAMETER_FRIEND_APPLICATION_TYPE=34332]="INVALID_PARAMETER_FRIEND_APPLICATION_TYPE",P[P.INVALID_PARAMETER_FRIEND_APPLICATION_STATUS=34333]="INVALID_PARAMETER_FRIEND_APPLICATION_STATUS",P[P.INVALID_PARAMETER_FRIEND_ADD_PERMISSION=34334]="INVALID_PARAMETER_FRIEND_ADD_PERMISSION",P[P.INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS=34335]="INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS",P[P.RC_REAL_TIME_CONVERSATION_UNAVAILABLE=34336]="RC_REAL_TIME_CONVERSATION_UNAVAILABLE",P[P.GROUP_SYNC_ERROR=35001]="GROUP_SYNC_ERROR",P[P.GROUP_MATCH_ERROR=35002]="GROUP_MATCH_ERROR",P[P.NOT_SUPPORT=35004]="NOT_SUPPORT",P[P.MAIN_PROCESS_ERROR=35005]="MAIN_PROCESS_ERROR",P[P.CAN_NOT_RECONNECT=35007]="CAN_NOT_RECONNECT",P[P.SERVER_UNAVAILABLE=35008]="SERVER_UNAVAILABLE",P[P.HOSTNAME_ERROR=35009]="HOSTNAME_ERROR",P[P.HAS_OHTER_SAME_CLIENT_ON_LINE=35010]="HAS_OHTER_SAME_CLIENT_ON_LINE",P[P.METHOD_NOT_AVAILABLE=35011]="METHOD_NOT_AVAILABLE",P[P.METHOD_ONLY_SUPPORT_ULTRA_GROUP=35014]="METHOD_ONLY_SUPPORT_ULTRA_GROUP",P[P.DRAFT_SAVE_ERROR=35015]="DRAFT_SAVE_ERROR",P[P.DRAFT_REMOVE_ERROR=35016]="DRAFT_REMOVE_ERROR",P[P.CONVER_REMOVE_ERROR=35020]="CONVER_REMOVE_ERROR",P[P.CONVER_GET_ERROR=35021]="CONVER_GET_ERROR",P[P.SEARCH_PROPS_LIMIT_ERROR=35022]="SEARCH_PROPS_LIMIT_ERROR",P[P.INVALID_PARAMETER_MESSAGE_TYPE=35024]="INVALID_PARAMETER_MESSAGE_TYPE",P[P.INVALID_PARAMETER_ORDER=35025]="INVALID_PARAMETER_ORDER",P[P.INVALID_PARAMETER_DRAFT=35028]="INVALID_PARAMETER_DRAFT",P[P.INVALID_PARAMETER_MESSAGE=35029]="INVALID_PARAMETER_MESSAGE",P[P.INVALID_PARAMETER_PUSH_CONTENT=35030]="INVALID_PARAMETER_PUSH_CONTENT",P[P.INVALID_PARAMETER_SENDOPTIONS=35031]="INVALID_PARAMETER_SENDOPTIONS",P[P.INVALID_PARAMETER_CONTENT_DISPOSITION=35032]="INVALID_PARAMETER_CONTENT_DISPOSITION",P[P.INVALID_PARAMETER_SAVE_NAME=35033]="INVALID_PARAMETER_SAVE_NAME",P[P.INVALID_PARAMETER_SERVER_TYPE=35034]="INVALID_PARAMETER_SERVER_TYPE",P[P.INVALID_PARAMETER_CLEAN_SPACE=35035]="INVALID_PARAMETER_CLEAN_SPACE",P[P.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION=35036]="INVALID_PARAMETER_CAN_INCLUDE_EXPANSION",P[P.INVALID_PARAMETER_DISABLE_NOTIFICATION=35037]="INVALID_PARAMETER_DISABLE_NOTIFICATION",P[P.INVALID_PARAMETER_CHECK_DUPLICATE=35038]="INVALID_PARAMETER_CHECK_DUPLICATE",P[P.INVALID_PARAMETER_IS_AUTO_DELETE=35039]="INVALID_PARAMETER_IS_AUTO_DELETE",P[P.INVALID_PARAMETER_IS_SEND_NOTIFICATION=35040]="INVALID_PARAMETER_IS_SEND_NOTIFICATION",P[P.INVALID_PARAMETER_IS_FORCE=35041]="INVALID_PARAMETER_IS_FORCE",P[P.INVALID_PARAMETER_IS_TOP=35042]="INVALID_PARAMETER_IS_TOP",P[P.INVALID_PARAMETER_IS_UPDATE_TIME=35043]="INVALID_PARAMETER_IS_UPDATE_TIME",P[P.INVALID_PARAMETER_CONTAIN_MUTED=35044]="INVALID_PARAMETER_CONTAIN_MUTED",P[P.INVALID_PARAMETER_IS_STATUS_MESSAGE=35045]="INVALID_PARAMETER_IS_STATUS_MESSAGE",P[P.INVALID_PARAMETER_IS_MENTIONED=35046]="INVALID_PARAMETER_IS_MENTIONED",P[P.INVALID_PARAMETER_IS_VOIP_PUSH=35047]="INVALID_PARAMETER_IS_VOIP_PUSH",P[P.INVALID_PARAMETER_MENTIONED_TYPE=35048]="INVALID_PARAMETER_MENTIONED_TYPE",P[P.INVALID_PARAMETER_PUSH_CONFIG=35049]="INVALID_PARAMETER_PUSH_CONFIG",P[P.INVALID_PARAMETER_PUSH_DATA=35050]="INVALID_PARAMETER_PUSH_DATA",P[P.DNS_PROXY_TIMEOUT=35051]="DNS_PROXY_TIMEOUT",P[P.DNS_PROXY_ERROR=35052]="DNS_PROXY_ERROR",P[P.DNS_PROXY_DATA_DESTRUCTUR_ERROR=35053]="DNS_PROXY_DATA_DESTRUCTUR_ERROR",P[P.INVALID_DISABLE_UPDATE_LAST_MESSAGE=35054]="INVALID_DISABLE_UPDATE_LAST_MESSAGE",P[P.CHATROOM_ID_ISNULL=36001]="CHATROOM_ID_ISNULL",P[P.CHARTOOM_JOIN_ERROR=36002]="CHARTOOM_JOIN_ERROR",P[P.CHATROOM_HISMESSAGE_ERROR=36003]="CHATROOM_HISMESSAGE_ERROR",P[P.CHATROOM_KV_NOT_FOUND=36004]="CHATROOM_KV_NOT_FOUND",P[P.BLACK_ADD_ERROR=37001]="BLACK_ADD_ERROR",P[P.BLACK_GETSTATUS_ERROR=37002]="BLACK_GETSTATUS_ERROR",P[P.BLACK_REMOVE_ERROR=37003]="BLACK_REMOVE_ERROR",P[P.DRAF_GET_ERROR=38001]="DRAF_GET_ERROR",P[P.STREAM_MESSAGE_DISABLE=39001]="STREAM_MESSAGE_DISABLE",P[P.STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED=39002]="STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED",P[P.STREAM_MESSAGE_EXPANSION_KEY_ERROR=39003]="STREAM_MESSAGE_EXPANSION_KEY_ERROR",P[P.STREAM_MESSAGE_REQUEST_FAIL=39005]="STREAM_MESSAGE_REQUEST_FAIL",P[P.STREAM_MESSAGE_REQUEST_IN_PROCESS=39006]="STREAM_MESSAGE_REQUEST_IN_PROCESS",P[P.STREAM_MESSAGE_SYNCED=39007]="STREAM_MESSAGE_SYNCED",P[P.QNTKN_GET_ERROR=41002]="QNTKN_GET_ERROR",P[P.TIMEOUT=-1]="TIMEOUT",exports.ConversationType=void 0,(w=exports.ConversationType||(exports.ConversationType={}))[w.NONE=0]="NONE",w[w.PRIVATE=1]="PRIVATE",w[w.DISCUSSION=2]="DISCUSSION",w[w.GROUP=3]="GROUP",w[w.CHATROOM=4]="CHATROOM",w[w.CUSTOMER_SERVICE=5]="CUSTOMER_SERVICE",w[w.SYSTEM=6]="SYSTEM",w[w.APP_PUBLIC_SERVICE=7]="APP_PUBLIC_SERVICE",w[w.PUBLIC_SERVICE=8]="PUBLIC_SERVICE",w[w.ULTRA_GROUP=10]="ULTRA_GROUP",w[w.RTC_ROOM=12]="RTC_ROOM",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"}(x||(x={})),exports.FileType=void 0,(D=exports.FileType||(exports.FileType={}))[D.IMAGE=1]="IMAGE",D[D.AUDIO=2]="AUDIO",D[D.VIDEO=3]="VIDEO",D[D.FILE=4]="FILE",D[D.SIGHT=5]="SIGHT",D[D.COMBINE_HTML=6]="COMBINE_HTML",exports.MentionedType=void 0,(V=exports.MentionedType||(exports.MentionedType={}))[V.ALL=1]="ALL",V[V.SINGAL=2]="SINGAL",exports.MessageType=void 0,(G=exports.MessageType||(exports.MessageType={})).TextMessage="RC:TxtMsg",G.VOICE="RC:VcMsg",G.HQ_VOICE="RC:HQVCMsg",G.IMAGE="RC:ImgMsg",G.GIF="RC:GIFMsg",G.RICH_CONTENT="RC:ImgTextMsg",G.LOCATION="RC:LBSMsg",G.FILE="RC:FileMsg",G.SIGHT="RC:SightMsg",G.COMBINE="RC:CombineMsg",G.COMBINE_V2="RC:CombineV2Msg",G.CHRM_KV_NOTIFY="RC:chrmKVNotiMsg",G.LOG_COMMAND="RC:LogCmdMsg",G.EXPANSION_NOTIFY="RC:MsgExMsg",G.REFERENCE="RC:ReferenceMsg",G.RECALL="RC:RcCmd",G.RECALL_NOTIFICATION_MESSAGE="RC:RcNtf",G.READ_RECEIPT="RC:ReadNtf",G.READ_RECEIPT_REQUEST="RC:RRReqMsg",G.READ_RECEIPT_RESPONSE="RC:RRRspMsg",G.SYNC_READ_STATUS="RC:SRSMsg",G.GROUP_READ_RECEIPT_REQUEST="RC:RRMsg",G.READ_STATE="RC:RSMsg",G.DELIVERED="RC:Delivered",G.DELIVERED_MSG="RC:DRMsg",G.CHATROOM_MERGE_CHANGE="RC:ChrmMemChange",G.CHATROOM_SYNC_MSG="RC:ChrmSyncMsg",G.CHATROOM_MERGE_BLOCK="RC:ChrmBlockMsg",G.CHATROOM_MERGE_BAN="RC:ChrmBanMsg",G.TYPING_STATUS="RC:TypSts",G.INTERCEPT="RC:InterceptMsg",G.CLOUD_CONTROL="RC:CCConfigChangeRequestMsg",G.STREAM_MESSAGE="RC:StreamMsg",exports.UltraGroupChannelType=void 0,(k=exports.UltraGroupChannelType||(exports.UltraGroupChannelType={}))[k.PUBLIC=0]="PUBLIC",k[k.PRIVATE=1]="PRIVATE",exports.UltraGroupChannelChangeType=void 0,(F=exports.UltraGroupChannelChangeType||(exports.UltraGroupChannelChangeType={}))[F.PUBLIC_TO_PRIVATE=2]="PUBLIC_TO_PRIVATE",F[F.PRIVATE_TO_PUBLIC=3]="PRIVATE_TO_PUBLIC",F[F.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"}(B||(B={})),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"}(H||(H={})),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"}(q||(q={})),function(e){e[e.NOT_MENTIONED=0]="NOT_MENTIONED",e[e.ALL=1]="ALL",e[e.ME=2]="ME"}(Y||(Y={})),exports.SentStatus=void 0,(K=exports.SentStatus||(exports.SentStatus={}))[K.SENDING=10]="SENDING",K[K.FAILED=20]="FAILED",K[K.SENT=30]="SENT",K[K.RECEIVED=40]="RECEIVED",K[K.READ=50]="READ",K[K.DESTROYED=60]="DESTROYED",exports.OperateStatus=void 0,(Q=exports.OperateStatus||(exports.OperateStatus={}))[Q.typing=0]="typing",exports.OnlineStatus=void 0,(W=exports.OnlineStatus||(exports.OnlineStatus={}))[W.ONLINE=1]="ONLINE",W[W.OFFLINE=0]="OFFLINE",exports.PlatformInfo=void 0,(j=exports.PlatformInfo||(exports.PlatformInfo={}))[j.Other=0]="Other",j[j.iOS=1]="iOS",j[j.Android=2]="Android",j[j.Web=3]="Web",j[j.PC=4]="PC",j[j.Mini=5]="Mini",j[j.HarmonyOS=6]="HarmonyOS",exports.SubscribeType=void 0,(J=exports.SubscribeType||(exports.SubscribeType={}))[J.ONLINE_STATUS=1]="ONLINE_STATUS",J[J.USER_PROFILE=2]="USER_PROFILE",J[J.FRIEND_ONLINE_STATUS=3]="FRIEND_ONLINE_STATUS",J[J.FRIEND_USER_PROFILE=4]="FRIEND_USER_PROFILE",exports.SubscribeOperationType=void 0,(z=exports.SubscribeOperationType||(exports.SubscribeOperationType={}))[z.SUBSCRIBE=0]="SUBSCRIBE",z[z.UNSUBSCRIBE=1]="UNSUBSCRIBE",exports.UserProfileVisibility=void 0,(Z=exports.UserProfileVisibility||(exports.UserProfileVisibility={}))[Z.NOT_SET=0]="NOT_SET",Z[Z.INVISIBLE=1]="INVISIBLE",Z[Z.EVERYONE=2]="EVERYONE",Z[Z.FriendVisible=3]="FriendVisible",exports.RCConnectionStatus=void 0,(X=exports.RCConnectionStatus||(exports.RCConnectionStatus={}))[X.CONNECTED=0]="CONNECTED",X[X.CONNECTING=1]="CONNECTING",X[X.DISCONNECTED=2]="DISCONNECTED",X[X.SUSPENDED=3]="SUSPENDED",exports.MessageBlockType=void 0,($=exports.MessageBlockType||(exports.MessageBlockType={}))[$.GLOBAL=1]="GLOBAL",$[$.CUSTOM=2]="CUSTOM",$[$.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,(te=exports.MessageDirection||(exports.MessageDirection={}))[te.SEND=1]="SEND",te[te.RECEIVE=2]="RECEIVE",exports.PushImportanceHonor=void 0,(ne=exports.PushImportanceHonor||(exports.PushImportanceHonor={})).NORMAL="NORMAL",ne.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"}(re||(re={})),exports.NotificationLevel=void 0,(oe=exports.NotificationLevel||(exports.NotificationLevel={}))[oe.ALL_MESSAGE=-1]="ALL_MESSAGE",oe[oe.NOT_SET=0]="NOT_SET",oe[oe.AT_MESSAGE_NOTIFICATION=1]="AT_MESSAGE_NOTIFICATION",oe[oe.AT_USER_NOTIFICATION=2]="AT_USER_NOTIFICATION",oe[oe.AT_GROUP_ALL_USER_NOTIFICATION=4]="AT_GROUP_ALL_USER_NOTIFICATION",oe[oe.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";var ge,fe,Ee,Ie,Te,ve,Ce,Re,ye,me,Se,Ae=function(e){return e===exports.NotificationStatus.OPEN?exports.NotificationLevel.AT_MESSAGE_NOTIFICATION:exports.NotificationLevel.NOT_SET},Ne=function(e){return e<=exports.NotificationLevel.NOT_SET?exports.NotificationStatus.CLOSE:exports.NotificationStatus.OPEN};exports.ReceivedStatus=void 0,(ge=exports.ReceivedStatus||(exports.ReceivedStatus={}))[ge.READ=1]="READ",ge[ge.LISTENED=2]="LISTENED",ge[ge.DOWNLOADED=4]="DOWNLOADED",ge[ge.RETRIEVED=8]="RETRIEVED",ge[ge.UNREAD=0]="UNREAD",function(e){e[e.PRIVATE=1]="PRIVATE",e[e.OPEN=0]="OPEN"}(fe||(fe={})),function(e){e[e.NAVI=1]="NAVI",e[e.TCP=2]="TCP",e[e.WS=3]="WS"}(Ee||(Ee={})),function(e){e[e.REQUEST=0]="REQUEST",e[e.LOCAL=1]="LOCAL"}(Ie||(Ie={})),function(e){e[e.CURRENT=2]="CURRENT"}(Te||(Te={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT"}(ve||(ve={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT",e[e.REDIRECTED=3]="REDIRECTED",e[e.TIMEOUT=4]="TIMEOUT"}(Ce||(Ce={})),exports.InterruptionLevel=void 0,(Re=exports.InterruptionLevel||(exports.InterruptionLevel={})).PASSIVE="passive",Re.ACTIVE="active",Re.TIME_SENSITIVE="time-sensitive",Re.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",function(e){e.WIFI="wifi",e.FOUR_G="4g",e.THREE_G="3g",e.TWO_G="2g",e.FIVE_G="2g",e.THREE_GENT="3gnet",e.UNKONWN="unknown"}(me||(me={})),exports.HttpMethod=void 0,(Se=exports.HttpMethod||(exports.HttpMethod={})).GET="GET",Se.POST="POST",Se.PUT="PUT";var Oe=72e5,Me=6e4,Le=131072,Ue={"RC:TxtMsg":{isCounted:!0,isPersited:!0},"RC:ImgMsg":{isCounted:!0,isPersited:!0},"RC:VcMsg":{isCounted:!0,isPersited:!0},"RC:ImgTextMsg":{isCounted:!0,isPersited:!0,searchProps:["content","title"]},"RC:FileMsg":{isCounted:!0,isPersited:!0,searchProps:["name"]},"RC:HQVCMsg":{isCounted:!0,isPersited:!0},"RC:LBSMsg":{isCounted:!0,isPersited:!0},"RC:PSImgTxtMsg":{isCounted:!0,isPersited:!0},"RC:PSMultiImgTxtMsg":{isCounted:!0,isPersited:!0},"RCJrmf:RpMsg":{isCounted:!0,isPersited:!0},"RCJrmf:RpOpendMsg":{isCounted:!0,isPersited:!0},"RC:CombineMsg":{isCounted:!0,isPersited:!0},"RC:CombineV2Msg":{isCounted:!0,isPersited:!0},"RC:ReferenceMsg":{isCounted:!0,isPersited:!0,searchProps:["content"]},"RC:SightMsg":{isCounted:!0,isPersited:!0},"RC:GIFMsg":{isCounted:!0,isPersited:!0},"RC:RLStart":{isCounted:!0,isPersited:!0},"RC:RLEnd":{isCounted:!0,isPersited:!0},"RC:StreamMsg":{isCounted:!0,isPersited:!0},"RC:InfoNtf":{isCounted:!1,isPersited:!0},"RC:ContactNtf":{isCounted:!1,isPersited:!0},"RC:ProfileNtf":{isCounted:!1,isPersited:!0},"RC:CmdNtf":{isCounted:!1,isPersited:!0},"RC:GrpNtf":{isCounted:!1,isPersited:!0},"RC:RcNtf":{isCounted:!1,isPersited:!0},"RC:CmdMsg":{isCounted:!1,isPersited:!1},"RC:TypSts":{isCounted:!1,isPersited:!1},"RC:PSCmd":{isCounted:!1,isPersited:!1},"RC:SRSMsg":{isCounted:!1,isPersited:!1},"RC:RcCmd":{isCounted:!1,isPersited:!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},"RC:RLJoin":{isCounted:!1,isPersited:!1},"RC:RLQuit":{isCounted:!1,isPersited:!1},"RC:RL":{isCounted:!1,isPersited:!1},"RC:CCConfigChangeRequestMsg":{isCounted:!1,isPersited:!1}},be="5.20.0-c-unikit.1".replace(/-.+$/,""),Pe="rongcloudsystem",we=864e5,xe=function(e){return"navi_".concat(e)},De=function(e,t){return"RCV4-con-s-".concat(e,"-").concat(t)},Ve=function(e,t){return"RCV4-con-".concat(e,"-").concat(t)},Ge=function(e,t){return"RCV4-CONVER-".concat(e,"-").concat(t)},ke=function(e,t){return"RCV4-ultragroupconversation-".concat(e,"-").concat(t)},Fe=function(e,t){return"outbox_".concat(e,"_").concat(t)},Be=function(e,t){return"inbox_".concat(e,"_").concat(t)},He=function(e,t){return"broadcastbox_".concat(e,"_").concat(t)},qe=function(e,t){return"send_msg_".concat(e,"_").concat(t)},Ye=function(e,t){return"RC-us-".concat(e,"-").concat(t)},Ke=function(e){return"rc-static-config-".concat(e)},Qe=function(e){return"RC-cc-".concat(e)},We=function(e,t){return"RC-RR-".concat(e,"-").concat(t)},je=function(e,t){return"RC-PEC-".concat(e,"-").concat(t)},Je="undefined"!=typeof window&&window?(window.__RCVersionInfo||(window.__RCVersionInfo={}),window.__RCVersionInfo):{};Je.engine="5.20.0-c-unikit.1";var ze=function(){function e(){}return e.add=function(e,t){Je[e]=t},e.validEngine=function(e){var t=e.match(/\d+\.\d+\.\d+/);if(!t)return!1;var n=t[0].split(".").map((function(e){return e.padStart(3,"0")})).join("");return Je.engine.match(/\d+\.\d+\.\d+/)[0].split(".").map((function(e){return e.padStart(3,"0")})).join("")>=n},e.getInfo=function(){return Je},e}();var Ze={gen:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=Math.floor(36*Math.random());return("x"===e?t:3&t|8).toString(36)}))},genWithLen:function(e){void 0===e&&(e=22);var t,n=Date.now(),r=n.toString(36),o=Math.floor(Math.random()*n).toString(36),i=e-r.length-o.length;return[o,r,i>0?(t=i,Array.from({length:t}).map((function(){return Math.floor(36*Math.random()).toString(36)})).join("")):""].join("").slice(0,e)}},Xe=Ze.genWithLen(22),$e=Date.now(),et=function(e){function n(t){var n=e.call(this,t)||this;return n.name="CMSYError",n}return t(n,e),n.InvalidParameters=function(e){return(null==e?void 0:e.length)?new n("Invalid parameter -> ".concat(e)):new n("Invalid parameters.")},n.ParameterTypeError=function(){return new n("Wrong parameter type")},n}(Error),nt=function(){function e(){this._map=new Map,this._piped=new Set}return e.prototype._addItem=function(e,t,n,r,o){void 0===o&&(o=0);var i=Symbol(),s=this._map.get(e)||this._map.set(e,[]).get(e),a={symbol:i,priority:Math.min(o,100),listener:t.bind(r),once:n},u=s.findIndex((function(e){return e.priority>o}));return-1===u?s.push(a):s.splice(u,0,a),i},e.prototype.on=function(e,t,n,r){return void 0===r&&(r=0),this._addItem(e,t,!1,n,r)},e.prototype.once=function(e,t,n,r){return void 0===r&&(r=0),this._addItem(e,t,!0,n,r)},e.prototype.off=function(e){var t,n;try{for(var r=le(this._map),o=r.next();!o.done;o=r.next()){var i=de(o.value,2),s=(i[0],i[1]),a=s.findIndex((function(t){return t.symbol===e}));if(-1!==a)return void s.splice(a,1)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=this._map.get(e);if(r&&r.length>0)for(var o=r.length-1;o>=0;o-=1){var i=r[o],s=i.once,a=i.listener;s&&r.splice(o,1);try{a.apply(void 0,pe([],de(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}pe([],de(this._piped.values()),!1).forEach((function(n){return n.emit.apply(n,pe([e],de(t),!1))}))},e.prototype.removeAll=function(e){this._map.delete(e)},e.prototype.clear=function(){this._piped.clear(),this._map.clear()},e.prototype.pipe=function(e){this._piped.add(e)},e}();!function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t._versionQueue=[],t._isPulling=null,t._dataVersion=0,t._invervalTimer=-1,t._intervalGap=0,t}t(n,e),n.prototype.setInitVersion=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){switch(n.label){case 0:return 0!==this._dataVersion?[2]:(this._dataVersion=e,t?[4,this._execPulling()]:[3,2]);case 1:n.sent(),n.label=2;case 2:return[2]}}))}))},n.prototype.push=function(e){e<this._dataVersion||(this._versionQueue.push(e),0!==this._dataVersion&&this._execPulling())},n.prototype._execPulling=function(){return ue(this,void 0,void 0,(function(){var e,t,n,r,o;return ce(this,(function(i){switch(i.label){case 0:return this._isPulling?[4,this._isPulling]:[3,2];case 1:return i.sent(),[2];case 2:return this._isPulling=this._sendRequest(this._dataVersion),[4,this._isPulling];case 3:if(e=i.sent(),t=e.code,n=e.version,r=e.hasNext,this._isPulling=null,0!==t)return[2];if(void 0===n||n<this._dataVersion)throw new Error("version error, please check: lastVersion: ".concat(this._dataVersion,", newVersion: ").concat(n));return o=this._versionQueue.filter((function(e){return e>n})),this._versionQueue=pe([],de(o),!1),this._dataVersion=n,this._resetIntervalTimer(),r?(this._execPulling(),[2]):(this._versionQueue.length>0&&(this._versionQueue.length=0,this._execPulling()),[2])}}))}))},n.prototype.startInterval=function(e){var t=this;-1===this._invervalTimer&&(this._intervalGap=e,this._invervalTimer=setInterval((function(){return t._execPulling()}),e))},n.prototype._resetIntervalTimer=function(){var e=this;-1!==this._invervalTimer&&(clearInterval(this._invervalTimer),this._invervalTimer=setInterval((function(){return e._execPulling()}),this._intervalGap))},n.prototype.stopInterval=function(){-1!==this._invervalTimer&&clearInterval(this._invervalTimer)},n.prototype.reset=function(){this.stopInterval(),this._versionQueue.length=0,this._dataVersion=0}}(nt);var rt=function(){function e(e,t){var n=this;this._promise=new Promise((function(t){n._resolve=t,e(n._onResolve.bind(n))})),this._onCancel=t}return e.prototype._onResolve=function(e){this._resolve(e)},e.prototype.result=function(){return this._promise},e.prototype.abort=function(){this._onCancel(this._onResolve.bind(this))},e}(),ot=function(){function e(e,t,n){this.code=e,this.msg=t,this.data=n,this.isOk=0===e}return e.prototype.next=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return this.isOk?[2,e(this.data)]:[2,this.wipe()]}))}))},e.prototype.or=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return this.isOk?[2,this]:[2,e(this.code)]}))}))},e.prototype.trans=function(e){return this.isOk?it(e(this.data)):this.wipe()},e.prototype.tryTrans=function(e){return this.isOk?e(this.data):this.wipe()},e.prototype.errmsg=function(){return JSON.stringify({code:this.code,msg:this.msg})},e.prototype.wipe=function(){return this.isOk?it(void 0,this.msg):st(this.code,this.msg)},e}(),it=function(e,t){return new ot(0,t||"success",e)},st=function(e,t,n){return new ot(e,t||"fail: ".concat(e),n)},at=function(){function e(e){this._apiName=e,this._isValid=!0,this._code=0}return e.create=function(t){return new e(t)},e.prototype.fail=function(e,t){return this._isValid||0!==this._code||(this._code=e,this._errmsg=t||this._errmsg),this},e.prototype.result=function(){if(!this._isValid&&0===this._code)throw new Error("Validator: result() should not be called without fail()");return this._isValid?it():st(this._code,this._errmsg)},e.prototype.validate=function(e,t,n,r){if(void 0===r&&(r=!1),!this._isValid)return this;var o=r?n(t):null==t||n(t);return this._isValid=o,o||(this._errmsg="param '".concat(e,"' is invalid")),this},e.prototype.assert=function(e,t,n,r){if(void 0===r&&(r=!1),!this._isValid)return this;if(this.validate(e,t,n,r),!this._isValid)throw et.InvalidParameters("'".concat(e,"' at '").concat(this._apiName,"'"));return this},e.prototype.isString=function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(){return"string"==typeof t}),n)},e.prototype.assertString=function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(){return"string"==typeof t}),n)},e.prototype.isNotEmptyString=function(e,t,n){return void 0===n&&(n=!1),this.isString(e,t,n).validate(e,t,(function(e){return e.trim().length>0}),n)},e.prototype.assertNotEmptyString=function(e,t,n){return void 0===n&&(n=!1),this.assertString(e,t,n),this.assert(e,t,(function(e){return e.trim().length>0}),n)},e.prototype.isLimitedString=function(e,t,n,r,o){return void 0===o&&(o=!1),this.isString(e,t,o).validate(e,t,(function(e){return e.length>=n&&e.length<=r}),o)},e.prototype.assertLimitedString=function(e,t,n,r,o){return void 0===o&&(o=!1),this.assertString(e,t,o),this.assert(e,t,(function(e){return e.length>=n&&e.length<=r}),o)},e.prototype.isBoolean=function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return"boolean"==typeof e}),n)},e.prototype.assertBoolean=function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return"boolean"==typeof e}),n)},e.prototype.isNumber=function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return"number"==typeof e&&!Number.isNaN(e)}),n)},e.prototype.assertNumber=function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return"number"==typeof e&&!Number.isNaN(e)}),n)},e.prototype.isLimitedNumber=function(e,t,n,r,o){return void 0===o&&(o=!1),this.isNumber(e,t,o).validate(e,t,(function(e){return e>=n&&e<=r}),o)},e.prototype.assertLimitedNumber=function(e,t,n,r,o){return void 0===o&&(o=!1),this.assertNumber(e,t,o),this.assert(e,t,(function(e){return e>=n&&e<=r}),o)},e.prototype.isInteger=function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return Number.isInteger(e)}),n)},e.prototype.assertInteger=function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return Number.isInteger(e)}),n)},e.prototype.isLimitedInteger=function(e,t,n,r,o){return void 0===o&&(o=!1),this.isInteger(e,t,o).validate(e,t,(function(e){return e>=n&&e<=r}),o)},e.prototype.assertLimitedInteger=function(e,t,n,r,o){return void 0===o&&(o=!1),this.assertInteger(e,t,o),this.assert(e,t,(function(e){return e>=n&&e<=r}),o)},e.prototype.isArray=function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")}),n)},e.prototype.assertArray=function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")}),n)},e.prototype.isLimitedArray=function(e,t,n,r,o){return void 0===r&&(r=!1),void 0===o&&(o=1),this.isArray(e,t,r).validate(e,t,(function(e){return e.length>=o&&e.length<=n}),r)},e.prototype.assertLimitedArray=function(e,t,n,r,o){return void 0===r&&(r=!1),void 0===o&&(o=1),this.assertArray(e,t,r),this.assert(e,t,(function(e){return e.length>=o&&e.length<=n}),r)},e.prototype.isTypedArray=function(e,t,n,r){return void 0===r&&(r=!1),this.isArray(e,t,r).validate(e,t,(function(e){return e.every(n)}),r)},e.prototype.assertTypedArray=function(e,t,n,r){return void 0===r&&(r=!1),this.assertArray(e,t,r),this.assert(e,t,(function(e){return e.every(n)}),r)},e.prototype.isLimitedTypedArray=function(e,t,n,r,o,i){return void 0===o&&(o=!1),void 0===i&&(i=1),this.isLimitedArray(e,t,n,o,i).validate(e,t,(function(e){return e.every(r)}),o)},e.prototype.assertLimitedTypedArray=function(e,t,n,r,o,i){return void 0===o&&(o=!1),void 0===i&&(i=1),this.assertLimitedArray(e,t,n,o,i),this.assert(e,t,(function(e){return e.every(r)}),o)},e.prototype.isObject=function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return"[object Object]"===Object.prototype.toString.call(e)}),n)},e.prototype.assertObject=function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return"[object Object]"===Object.prototype.toString.call(e)}),n)},e.prototype.isValueOf=function(e,t,n,r){return void 0===r&&(r=!1),this.validate(e,t,(function(){return Object.values(n).includes(t)}),r)},e.prototype.assertValueOf=function(e,t,n,r){return void 0===r&&(r=!1),this.assert(e,t,(function(){return Object.values(n).includes(t)}),r)},e.prototype.isFunction=function(e,t,n){return void 0===n&&(n=!1),this.validate(e,t,(function(e){return"[object Function]"===Object.prototype.toString.call(e)}),n)},e.prototype.assertFunction=function(e,t,n){return void 0===n&&(n=!1),this.assert(e,t,(function(e){return"[object Function]"===Object.prototype.toString.call(e)}),n)},e}(),ut="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function ct(e){var t,n,r,o,i,s,a="",u=0;for(e=e.replace(/[^A-Za-z0-9+/=]/g,"");u<e.length;)t=ut.indexOf(e.charAt(u++))<<2|(o=ut.indexOf(e.charAt(u++)))>>4,n=(15&o)<<4|(i=ut.indexOf(e.charAt(u++)))>>2,r=(3&i)<<6|(s=ut.indexOf(e.charAt(u++))),a+=String.fromCharCode(t),64!==i&&(a+=String.fromCharCode(n)),64!==s&&(a+=String.fromCharCode(r));return a}var lt=function(e){return"string"==typeof e},dt=function(e){return"number"==typeof e&&!Number.isNaN(e)},pt=function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")},ht=function(e){return function(t){return lt(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))}},_t=function(e){return lt(e)&&e.length>0},gt=function(e){return"[object Object]"===Object.prototype.toString.call(e)},ft=function(e){return"[object Function]"===Object.prototype.toString.call(e)},Et=function(e){return void 0===e||"[object Undefined]"===Object.prototype.toString.call(e)},It=function(e){return lt(e)&&/https?:\/\//.test(e)},Tt=function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1},vt=function(e){return dt(e)&&Object.prototype.hasOwnProperty.call(exports.ConversationType,e)},Ct=function(e){var t=!1;return lt(e)&&!/_/g.test(e)&&e.length<=20&&(t=!0),t},Rt=function(e){return ht({minLength:1,maxLength:64})(e)},yt=function(e){var t=!1,n=!1,r=!1;if(gt(e)){var o=Object.keys(e).length;for(var i in t=o>20,e)if(n||(n=lt(i)&&!/^[A-Za-z0-9_=+-]+$/.test(i)),!r){var s=e[i];r=i.length>32||s.length>4096}}return{isExceedLimit:t,isIllgalEx:n,isExKeyOrValLengthExceedLimit:r}},mt=function(e){if(!gt(e)||void 0===e.low||void 0===e.high)return e;var t=e.low;return t<0&&(t+=4294967296),t=t.toString(16),parseInt(e.high.toString(16)+"00000000".replace(new RegExp("0{".concat(t.length,"}$")),t),16)},St=function(e,t,n){var r=null==n?void 0:n.isReverse;gt(e)&&function(){for(var n in e)t(e[n],n,e)}(),(pt(e)||lt(e))&&function(){if(r)for(var n=e.length-1;n>=0;n--)t(e[n],n);else for(var o=0,i=e.length;o<i;o++)t(e[o],o)}()},At=function(e,t){return St(e,(function(n,r){e[r]=t(n,r)})),e},Nt=function(e){return JSON.parse(JSON.stringify(e))},Ot=function(){return"undefined"!=typeof RCCppEngine},Mt=function(e){var t;if("object"==typeof e&&null!==e)if(Array.isArray(e))for(var n in t=[],e)t.push(Mt(e[n]));else for(var n in t={},e)t[n]=Mt(e[n]);else t=e;return t},Lt=function(e){var t;try{t=Mt(e)}catch(n){t=JSON.parse(JSON.stringify(e))}return t},Ut=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}},bt=function(e){return[exports.PlatformInfo.Android,exports.PlatformInfo.iOS,exports.PlatformInfo.Web,exports.PlatformInfo.PC,exports.PlatformInfo.Mini,exports.PlatformInfo.HarmonyOS].map((function(t){var n=e.findIndex((function(e){return e.platform===t}));return-1===n?{platform:t,changeTime:0,eventValue:0}:e[n]}))},Pt=function(e,t,n){var r=t.reduce((function(e,t){return["gender","role","level"].includes(t.key)?e[t.key]=Number(t.value):e[t.key]=t.value,e}),{});return r.userId=e,n.forEach((function(e){r.extraProfile=r.extraProfile||{},r.extraProfile[e.key]=e.value})),r},wt=function(e,t,n){return t?1===n?x.TLS:x.RMTP:"http"===e?x.WS:x.WSS},xt=function(e,t){var n=e.server,r=e.backupServer,o=e.bs,i=e.serverAddr,s=e.protocol,a=e.openTLS;if(i)return pe([],de(i.filter((function(e){return e.addr}))),!1);var u=[],c=[];return n&&c.push(n),(r||o||"").split(",").forEach((function(e){c.indexOf(e)<0&&c.push(e)})),c.forEach((function(e,r){e&&u.push({addr:e,protocol:wt(s,t,a),weight:n.length-r,race:!1})})),pe([],de(u),!1)},Dt=function(e){return void 0===e&&(e=[]),e.map((function(e){var t,n,r,o,i,s,a,u,c,l=Bt(e.settingProfile)||{},d=e.extProfile||[],p=e.targetId,h=e.baseInfo,_=e.userInfo;return{groupId:p,groupName:null!==(t=l.name)&&void 0!==t?t:"",portraitUri:null!==(n=l.portraitUrl)&&void 0!==n?n:"",introduction:null!==(r=l.introduction)&&void 0!==r?r:"",notice:null!==(o=l.announcement)&&void 0!==o?o:"",extProfile:Bt(d),joinPermission:~~l.joinPerm,removeMemberPermission:~~l.removePerm,invitePermission:~~l.memInvitePerm,inviteHandlePermission:~~l.invitePerm,groupInfoEditPermission:~~l.profilePerm,memberInfoEditPermission:~~l.memProfilePerm,creatorId:null!==(i=null==h?void 0:h.creatorId)&&void 0!==i?i:"",ownerId:null!==(s=null==h?void 0:h.ownerId)&&void 0!==s?s:"",createTime:(null==h?void 0:h.createTime)?mt(h.createTime):0,membersCount:null!==(a=null==h?void 0:h.memberCount)&&void 0!==a?a:0,remark:null!==(u=null==_?void 0:_.remarkName)&&void 0!==u?u:"",joinedTime:(null==_?void 0:_.joinTime)?mt(_.joinTime):0,role:null!==(c=null==_?void 0:_.role)&&void 0!==c?c:exports.GroupMemberRole.UNDEF}}))},Vt=function(e){return void 0===e&&(e=[]),e.map((function(e){var t=Bt(e.settingProfile),n=e.extProfile||[],r=e.targetId,o=e.baseInfo,i=e.userInfo;return JSON.parse(JSON.stringify(se(se({groupId:r},kt(t)),{extProfile:n.length>0?Bt(n):void 0,creatorId:null==o?void 0:o.creatorId,ownerId:null==o?void 0:o.ownerId,createTime:(null==o?void 0:o.createTime)?mt(o.createTime):void 0,membersCount:null==o?void 0:o.memberCount,remark:null==i?void 0:i.remarkName})))}))},Gt=function(e){if(void 0!==e){var t=Number(e);return Number.isNaN(t)?void 0:t}},kt=function(e){return JSON.parse(JSON.stringify({groupName:e.name,portraitUri:e.portraitUrl,introduction:e.introduction,notice:e.announcement,joinPermission:Gt(e.joinPerm),removeMemberPermission:Gt(e.removePerm),invitePermission:Gt(e.memInvitePerm),inviteHandlePermission:Gt(e.invitePerm),groupInfoEditPermission:Gt(e.profilePerm),memberInfoEditPermission:Gt(e.memProfilePerm)}))},Ft=function(e){void 0===e&&(e=[]);var t=e.map((function(e){var t=e||{},n=t.ext,r=t.userId,o=t.name,i=t.portraitUrl,s=n||{},a=s.role,u=s.joinTime,c=s.channelNickName,l=s.additional;return{userId:r,name:o||"",portraitUri:i||"",nickname:c||"",role:a||exports.GroupMemberRole.UNDEF,joinedTime:mt(u)||0,extra:l||""}}));return t},Bt=function(e){var t={};return e&&0!==e.length?(e.forEach((function(e){t[e.key]=e.value})),t):t},Ht=function(e){return e.map((function(e){var t=e.targetId,n=e.joinUserInfo,r=e.inviterInfo,o=e.status,i=e.directionType,s=e.detail,a=e.joinType,u=e.processInfo,c=e.processTime;return se(se(se(se({groupId:t},n&&{joinMemberInfo:Ft([n])[0]}),r&&{inviterInfo:Ft([r])[0]}),u&&{operatorInfo:Ft([u])[0]}),{status:o,direction:i,type:a,operationTime:mt(c),reason:s})}))},qt=function(e,t){if(e=e.replace(/\?$/,""),!t)return e;var n=Object.keys(t).map((function(e){return"".concat(e,"=").concat(t[e])})).filter((function(e){return!!e}));return n.length?[e,n.join("&")].join("?"):e};function Yt(e){for(var t=null===window||void 0===window?void 0:window.atob(e),n=new Uint8Array(t.length),r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n.buffer}var Kt,Qt=function(e,t){var n=Math.floor(1e3*Math.random()%1e4),r=Ze.gen(),o=function(e){e=e||"-";var t=new Date,n=t.getFullYear(),r=t.getMonth()+1,o=t.getDate();return"".concat(n).concat(e).concat(r).concat(e).concat(o)}(),i=(new Date).getTime(),s="";if(t){var a=t.split(".");s=".".concat(a[a.length-1])}return"".concat(e,"__RC-").concat(o,"_").concat(n,"_").concat(i).concat(r).concat(s)},Wt=function(e){var t=/^[A-Za-z0-9_=+-]+$/.test(e),n=e.length;return t&&(n<=128&&n>=1)},jt=function(e){var t=e.length;return t<=4096&&t>=1},Jt=(Kt=0,function(){var e=((4294967295&Date.now())>>>0).toString(2),t=Math.floor(Math.random()*(Math.pow(2,8)-1)),n=e+Kt.toString(2).padStart(11,"0")+t.toString(2).padStart(8,"0");return Kt=2047&++Kt,parseInt(n,2)}),zt=function(){var e=ze.getInfo(),t="electron";for(var n in e)"engine"!==n&&(t=["imlib-v2-adapter","imlib-next"].includes(n)?n:"electron");return t},Zt=function(e,t,n){return ue(void 0,void 0,void 0,(function(){var r,o;return ce(this,(function(i){switch(i.label){case 0:return[4,window.crypto.subtle.importKey("raw",(new TextEncoder).encode(t),"AES-CBC",!0,["decrypt"])];case 1:return r=i.sent(),[4,window.crypto.subtle.decrypt({name:"AES-CBC",iv:(new TextEncoder).encode(n)},r,Yt(e))];case 2:return o=i.sent(),[2,(new TextDecoder).decode(o)]}}))}))};function Xt(e,t){var n;if(!e)return"";var r="undefined"!=typeof window&&"https:"===(null===(n=null===window||void 0===window?void 0:window.location)||void 0===n?void 0:n.protocol);return/^https?:\/\//.test(e)?r?e.replace(/^https?:\/\//i,"https://"):e:t!==x.HTTP||r?"https://".concat(e):"http://".concat(e)}var $t,en,tn,nn=function(e,t){if(!e)return"";var n=e.ossConfig,r=void 0===n?"":n,o="";try{var i=JSON.parse(r);if(i.length>0){var s=i.find((function(e){return e.minio}));s&&(o=s.minio)}}catch(e){t.warn(exports.LogTagId.L_PARSE_JSON_E,JSON.stringify({ossConfig:r,error:e}))}return o};function rn(e){var t=e.method||exports.HttpMethod.GET,n=e.timeout||Me,r=e.headers,o=e.query,i=e.body,s=e.onProgress,a=qt(e.url,o),u=new XMLHttpRequest;if(u.open(t,a),r&&u.setRequestHeader)for(var c in r)u.setRequestHeader(c,r[c]);return function(e,t,n,r){return new rt((function(o){e.onreadystatechange=function(){4===e.readyState&&o({data:e.responseText,status:e.status,xhr:e})},e.onerror=function(){o({status:e.status})},r&&(e.upload.onprogress=function(e){return r(e)}),0!==t&&setTimeout((function(){e.abort(),o({status:e.status})}),t),e.send(n)}),(function(t){e.abort(),t({status:-1})}))}(u,n,i,s)}!function(e){e[e.add=1]="add",e[e.update=2]="update",e[e.delete=3]="delete"}($t||($t={})),exports.AreaCode=void 0,(tn=exports.AreaCode||(exports.AreaCode={}))[tn.BJ=1]="BJ",tn[tn.SG=2]="SG",tn[tn.NA=3]="NA",tn[tn.SG_A=4]="SG_A",tn[tn.SG_B=4]="SG_B",tn[tn.SA=5]="SA";var on=((en={})[exports.AreaCode.BJ]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5yb25nLWVkZ2UuY29t","bmF2LWIucm9uZy1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ucm9uZy1lZGdlLmNvbQ==",protocol:x.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnJvbmctZWRnZS5jb20=","d3MtYi5yb25nLWVkZ2UuY29t"],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWMtMS5vc3MtY24tYmVpamluZy5hbGl5dW5jcy5jb20="],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5yb25nLWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIucm9uZy1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5yb25nLWVkZ2UuY29t"]},en[exports.AreaCode.SG]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zZy1saWdodC1lZGdlLmNvbQ==","bmF2LWIuc2ctbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2ctbGlnaHQtZWRnZS5jb20=",protocol:x.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWxpZ2h0LWVkZ2UuY29t","d3MtYi5zZy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWItMi5zMy5hcC1zb3V0aGVhc3QtMS5hbWF6b25hd3MuY29t"],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIuc2ctbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1saWdodC1lZGdlLmNvbQ=="]},en[exports.AreaCode.NA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi51cy1saWdodC1lZGdlLmNvbQ==","bmF2LWIudXMtbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24udXMtbGlnaHQtZWRnZS5jb20=",protocol:x.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnVzLWxpZ2h0LWVkZ2UuY29t","d3MtYi51cy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC51cy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIudXMtbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy51cy1saWdodC1lZGdlLmNvbQ=="]},en[exports.AreaCode.SG_B]={naviUrlBase64:["bmF2LnNnLWItbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zZy1iLWxpZ2h0LWVkZ2UuY29t",protocol:x.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWItbGlnaHQtZWRnZS5jb20=","d3MtYi5zZy1iLWxpZ2h0LWVkZ2UuY29t"],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1iLWxpZ2h0LWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1iLWxpZ2h0LWVkZ2UuY29t"]},en[exports.AreaCode.SA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zYXUtbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2F1LWxpZ2h0LWVkZ2UuY29t",protocol:x.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNhdS1saWdodC1lZGdlLmNvbQ==","d3MtYi5zYXUtbGlnaHQtZWRnZS5jb20="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zYXUtbGlnaHQtZWRnZS5jb20=","Y2xvdWRjb250cm9sLWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zYXUtbGlnaHQtZWRnZS5jb20="]},en);function sn(e){return exports.AreaCode[e]?e:exports.AreaCode.BJ}var an,un=function(){function e(){this.initOption={}}return e.prototype.init=function(e){this.initOption=e},e.prototype.getNaviUrlList=function(e,t){var n,r=this.initOption||{},o=r.areaCode,i=r.navigators,s=(n=o,void 0===n&&(n=exports.AreaCode.BJ),on[sn(n)].naviUrlBase64).map((function(e){return ct(e)})),a=[],u=de(e.split("@"),2)[1];t&&(a=u?u.split(";"):[]);var c=i&&i.length>0?pe(pe([],de(a),!1),de(i),!1):pe(pe([],de(a),!1),de(s),!1);return c.filter((function(e,t){return c.indexOf(e)===t})).map((function(e){return Xt(e)}))},e.prototype.getLogUrlPolicyList=function(e,t){var n,r=e||{},o=r.log,i=r.logPolicy,s=this.initOption||{},a=s.areaCode,u=s.logServerUrl,c=(n=a,void 0===n&&(n=exports.AreaCode.BJ),on[sn(n)].logUrlBase64).map((function(e){return se(se({},e),{addr:ct(e.addr)})})),l=[],d={level:1,itv:6,times:5};if(o)l.push.apply(l,pe([],de(o.addrs),!1)),Object.assign(d,o.policy);else if(i)try{var p=JSON.parse(i);l.push({addr:p.url,protocol:x.HTTPS,weight:1}),d.level=p.level,d.itv=p.itv,d.times=p.times}catch(n){t.warn(exports.LogTagId.L_REPORT_LOG_POLICY_E,JSON.stringify({policy:e.logPolicy}))}var h=u?pe([{addr:u,protocol:x.HTTPS,weight:101}],de(l),!1):pe(pe([],de(l),!1),de(c),!1);return{policy:d,addrs:h.filter((function(e,t){return h.findIndex((function(t){return t.addr===e.addr&&t.protocol===e.protocol}))===t})).map((function(e){return se(se({},e),{addr:Xt(e.addr,e.protocol)})})).sort((function(e,t){return t.weight-e.weight}))}},e.prototype.getMiniCmpUrlList=function(){var e,t,n=(t=null===(e=this.initOption)||void 0===e?void 0:e.areaCode,void 0===t&&(t=exports.AreaCode.BJ),on[sn(t)].miniCmpBase64).map((function(e){return ct(e)})),r=(this.initOption||{}).miniCMPProxy;return r&&r.length>0?r:n},e.prototype.getStaticConfigUrl=function(){var e,t;return(t=null===(e=this.initOption)||void 0===e?void 0:e.areaCode,void 0===t&&(t=exports.AreaCode.BJ),on[sn(t)].staticConfigUrlBase64).map((function(e){return ct(e)}))},e.prototype.getCloudControllerUrl=function(e){var t,n,r=null!=e?e:null===(t=this.initOption)||void 0===t?void 0:t.areaCode;return(n=r,void 0===n&&(n=exports.AreaCode.BJ),on[sn(n)].cloudControllerUrlBase64).map((function(e){return ct(e)}))},e.prototype.getAreaCode=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},e.prototype.setAreaCode=function(e){return!(!e||!exports.AreaCode[e]||e===this.initOption.areaCode)&&(this.initOption.areaCode=e,!0)},e.prototype.getStatsUrlList=function(e){var t,n,r=(e||{}).active,o=(null==r?void 0:r.addrs)||[],i=(n=null===(t=this.initOption)||void 0===t?void 0:t.areaCode,void 0===n&&(n=exports.AreaCode.BJ),on[sn(n)].statsUrlBase64).map((function(e){return ct(e)}));return 0===o.length?i:pe(pe([],de(o.sort((function(e,t){return t.weight-e.weight})).map((function(e){return Xt(e.addr,e.protocol)}))),!1),de(i),!1)},e}(),cn=new un,ln=function(){function e(e,t){this.appkey=e,this.logger=t,this.staticUrls=[]}return e.prototype.getStaticConfig=function(){var e;return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a,u;return ce(this,(function(c){switch(c.label){case 0:if(!(t=this.getCache()))return[3,6];c.label=1;case 1:return c.trys.push([1,4,,5]),n=JSON.parse(t),Date.now()-(null==n?void 0:n.time)<18e5?[4,this.decryptData(n.val)]:[3,3];case 2:return r=c.sent(),(o=r.resources.navi.slice()).sort((function(e,t){return t.weight-e.weight})),[2,{navi:o.map((function(e){return Xt(e.addr,e.protocol)}))||[]}];case 3:return[3,5];case 4:return i=c.sent(),this.logger.error(exports.LogTagId.L_GET_STATIC_CONF_E,JSON.stringify({error:null==i?void 0:i.stack})),[3,5];case 5:this.clearCache(),c.label=6;case 6:return[4,this._requestHandle()];case 7:return(s=c.sent())?[4,this.decryptData(s)]:[2];case 8:return(null==(a=c.sent())?void 0:a.areaCode)!==cn.getAreaCode()?[2]:(this.setCache(JSON.stringify({time:Date.now(),val:s})),this.staticUrls=(null==a?void 0:a.bootstrap)||[],(u=null===(e=null==a?void 0:a.resources)||void 0===e?void 0:e.navi.slice()).sort((function(e,t){return t.weight-e.weight})),[2,{navi:u.map((function(e){return Xt(e.addr,e.protocol)}))||[]}])}}))}))},e.prototype._requestHandle=function(){return ue(this,void 0,void 0,(function(){var e,t,n,r,o,i,s,a,u,c,l;return ce(this,(function(d){switch(d.label){case 0:e=(e=pe(pe([],de(this.staticUrls),!1),de(cn.getStaticConfigUrl()),!1).map((function(e){return Xt(e)}))).filter((function(t,n){return e.indexOf(t)===n})),d.label=1;case 1:d.trys.push([1,6,7,8]),t=le(e),n=t.next(),d.label=2;case 2:return n.done?[3,5]:(r=n.value,this.logger.info(exports.LogTagId.L_GET_STATIC_CONF_T,JSON.stringify({url:r})),o=Date.now(),[4,this.sendRequest("".concat(r,"/").concat(this.appkey))]);case 3:if(i=d.sent(),s=i.code,a=i.data,200===s)return this.logger.info(exports.LogTagId.L_GET_STATIC_CONF_R,JSON.stringify({url:r,code:s,duration:Date.now()-o})),[2,a];this.logger.warn(exports.LogTagId.L_GET_STATIC_CONF_R,JSON.stringify({url:r,code:s,duration:Date.now()-o})),d.label=4;case 4:return n=t.next(),[3,2];case 5:return[3,8];case 6:return u=d.sent(),c={error:u},[3,8];case 7:try{n&&!n.done&&(l=t.return)&&l.call(t)}finally{if(c)throw c.error}return[7];case 8:return[2]}}))}))},e}();exports.LogL=void 0,(an=exports.LogL||(exports.LogL={}))[an.STATISTICS=-2]="STATISTICS",an[an.RECORD=-1]="RECORD",an[an.FATAL=0]="FATAL",an[an.ERROR=1]="ERROR",an[an.WARN=2]="WARN",an[an.INFO=3]="INFO",an[an.DEBUG=4]="DEBUG";var dn,pn=function(){function e(e,t,n){this._appkey=e,this._id=t,this._type=n,this.outputLevel=exports.LogL.WARN,this.debug=this._log.bind(this,exports.LogL.DEBUG),this.info=this._log.bind(this,exports.LogL.INFO),this.warn=this._log.bind(this,exports.LogL.WARN),this.error=this._log.bind(this,exports.LogL.ERROR),this.__statistics=this._log.bind(this,exports.LogL.STATISTICS),this.record=this.__statistics}return e.prototype._write=function(e){var t=e.tag,n=e.level,r=e.content,o=e.traceId;/^[\w-]+$/.test(t)?n!==exports.LogL.DEBUG&&this._handleWrite(e):console.error("".concat((new Date).toISOString(),"[").concat(this._id,"]['ERROR']: ").concat(t," | ").concat(r," | ").concat(o))},e.prototype.createTraceId=function(){return"".concat(++e._traceIdCount)},e.prototype.getSessionId=function(){return Xe},e.prototype._stdout=function(e){var t=e.time,n=e.tag,r=e.content,o=e.traceId,i=e.level,s=e.loggerId;if(console&&!(i<=exports.LogL.FATAL||i>this.outputLevel)){var a=["error","warn","info","debug"][i-1],u="".concat(new Date(t).toISOString(),"[").concat(null!=s?s:this._id,"][").concat((a||"stat").toUpperCase(),"]: ").concat(n," | ").concat(r," | ").concat(o);console[a||"warn"](u)}},e.prototype.setOutputLevel=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)},e.prototype._log=function(e,t,n,r){var o={time:Date.now(),level:e,tag:t,content:n,traceId:r,loggerId:this._id,sessionId:this.getSessionId(),type:this._type};this._stdout(o),this._write(o)},e.prototype.summary=function(e,t,n,r,o,i){var s,a;void 0===r&&(r={}),t.isOk?this.info(e,null!==(s=null==o?void 0:o())&&void 0!==s?s:JSON.stringify(se({isOk:!0},r)),n):this.warn(e,null!==(a=null==i?void 0:i())&&void 0!==a?a:JSON.stringify(se({code:t.code,msg:t.msg},r)),n)},e._traceIdCount=0,e}(),hn=function(){function e(e,t,n,r,o,i){void 0===i&&(i=!1),this.appkey=e,this.deviceId=t,this.deviceInfo=n,this.logDB=r,this.logger=o,this.disableLogReport=i,this.userId="",this.timer=null,this.started=!1,this.reportFailedNumber=0,this.itvByNavi=6,this.timesByNavi=5}return e.prototype.checkStart=function(e,t){return ue(this,void 0,void 0,(function(){var n,r,o;return ce(this,(function(i){return this.started?[2]:(this.userId=e.userId,!e.logSwitch||this.disableLogReport||(n=cn.getLogUrlPolicyList(e,this.logger),r=n.policy,o=n.addrs,this.started=!0,this.itvByNavi=r.itv,this.timesByNavi=r.times,o.length>0&&this.realtimeReport(o[0].addr,r.level,r.itv,t)),[2])}))}))},e.prototype._sendLogs2Realtime=function(e,t,n,r){return ue(this,void 0,void 0,(function(){var o,i,s,a,u,c,l,d,p,h;return ce(this,(function(_){switch(_.label){case 0:return this.logger.debug(exports.LogTagId.L_REALTIME_LOG_O,"compress logs: ".concat(e.length)),[4,this.compressLogs(e)];case 1:return o=_.sent(),i=o.success,s=o.data,i?(this.logger.debug(exports.LogTagId.L_REALTIME_LOG_O,"compress done",t),a=It(n)?n:"https://".concat(n),a+="?version=".concat("5.20.0-c-unikit.1","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.deviceId,"&deviceInfo=").concat(this.deviceInfo,"&platform=Web"),[4,this.send({url:a,body:s,method:"POST"})]):(this.logger.warn(exports.LogTagId.L_REALTIME_LOG_R,"compress failed",t),[2,{isOk:!1,itv:r}]);case 2:if(u=_.sent(),c=u.status,l=u.data,this.logger.debug(exports.LogTagId.L_REALTIME_LOG_R,JSON.stringify({status:c,data:l}),t),200!==c)return this.reportFailedNumber>this.timesByNavi&&this.itvByNavi<60&&(r+=r),this.reportFailedNumber++,[2,{isOk:!1,itv:r}];if(this.reportFailedNumber=0,l)try{(h=JSON.parse(l)).nextTime&&(r=h.nextTime),d=h.level,p=h.logSwitch}catch(e){this.logger.warn(exports.LogTagId.L_PARSE_JSON_E,JSON.stringify({error:null==e?void 0:e.stack}),t)}return[2,{isOk:!0,itv:r,level:d,logSwitch:p}]}}))}))},e.prototype.realtimeReport=function(e,t,n,r){return ue(this,void 0,void 0,(function(){var o,i,s,a,u,c,l,d,p,h,_,g,f=this;return ce(this,(function(E){switch(E.label){case 0:return o=Date.now(),i=this.logDB.getTimestamp4RealtimeLog()||$e,s=Math.max(o-3e4,i+1),a=this.logger.createTraceId(),this.logger.debug(exports.LogTagId.L_REALTIME_LOG_T,JSON.stringify({startTime:i,endTime:s,level:t,itv:n}),a),[4,this.logDB.getLogs(i,s,t,!0,r)];case 1:return u=E.sent(),c=u.dbReady,l=u.logs,c?[3,2]:(this.logger.warn(exports.LogTagId.L_REALTIME_LOG_R,"get logs failed",a),[3,5]);case 2:return 0!==l.length?[3,3]:(this.logger.debug(exports.LogTagId.L_REALTIME_LOG_R,"no logs",a),[3,5]);case 3:return l.length>0?[4,this._sendLogs2Realtime(l,a,e,n)]:[3,5];case 4:d=E.sent(),p=d.itv,h=d.level,_=d.logSwitch,d.isOk&&(g=Math.max.apply(Math,pe([],de(l.map((function(e){return e.time}))),!1)),this.logDB.setTimestamp4RealtimeLog(g+1),0===_&&(this.started=!1),void 0!==h&&(t=h)),n=p,E.label=5;case 5:return this.started&&(n>=60&&this.itvByNavi<60&&(n=60),this.timer=setTimeout((function(){return f.realtimeReport(e,t,n,r)}),1e3*n)),[2]}}))}))},e.prototype.report=function(e,t,n,r,o,i,s){return void 0===s&&(s=!1),ue(this,void 0,void 0,(function(){var a,u,c,l,d,p,h,_,g,f;return ce(this,(function(E){switch(E.label){case 0:return"web"!==n.toLowerCase()||this.disableLogReport?[2]:(a=this.logger.createTraceId(),this.logger.info(exports.LogTagId.L_REPORT_FULL_LOG_T,JSON.stringify({startTime:e,endTime:t,logId:o,messageUId:i,isCloudControl:s}),a),[4,this.logDB.getLogs(e,t,exports.LogL.DEBUG,!1)]);case 1:return u=E.sent(),c=u.dbReady,l=u.logs,this.logger.info(exports.LogTagId.L_REPORT_FULL_LOG_O,JSON.stringify({count:l.length}),a),d=It(r)?r:"https://".concat(r),d+="?version=".concat("5.20.0-c-unikit.1","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.deviceId,"&deviceInfo=").concat(this.deviceInfo,"&platform=Web&logId=").concat(o),c?l.length>0?[4,this.compressLogs(l)]:[3,3]:[3,5];case 2:return h=E.sent(),_=h.success,g=h.data,p=_?g:"compress failed",[3,4];case 3:p="no data",E.label=4;case 4:return[3,6];case 5:p="no database",E.label=6;case 6:return this.logger.debug(exports.LogTagId.L_REPORT_FULL_LOG_O,"compress done",a),s&&(d+="&source=cloud"),[4,this.send({url:d,body:p,method:"POST"})];case 7:return f=E.sent().status,this.logger.info(exports.LogTagId.L_REPORT_FULL_LOG_R,JSON.stringify({status:f}),a),[2]}}))}))},e.prototype.stop=function(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.started=!1},e}(),_n=function(e){var t=e.sessionId,n=e.level,r=e.loggerId,o=e.traceId,i=e.time,s=e.tag,a=e.type,u=e.content;lt(u)||(u=JSON.stringify(u));var c=n<0?u||"":JSON.stringify({content:u,traceId:o,from:r});return c='"'.concat(c.replace(/"/g,'""'),'"'),"".concat(t,",").concat(i,",").concat(a,",").concat(n,",").concat(s,",").concat(c,"\n")};!function(e){e[e.init=1]="init",e[e.newWorkChange=2]="newWorkChange",e[e.other=3]="other"}(dn||(dn={}));var gn=function(){function e(e){this.reporter=e,this.logId="",this.uploadTask=[],this.taskLock=!0}return e.prototype.uploadLogCmdTask=function(e){this.uploadTask.push(e),this.enqueueTask()},e.prototype.reportLogCmdTask=function(e){var t,n,r,o,i=this;this.taskLock=!1;var s=null!==(t=e.startTime)&&void 0!==t?t:0,a=null!==(n=e.endTime)&&void 0!==n?n:0,u=null!==(r=e.platform)&&void 0!==r?r:"",c=null!==(o=e.uri)&&void 0!==o?o:"";e.logId!==this.logId&&""!==c&&(this.logId=e.logId,this.reporter.report(s,a,u,c,e.logId,"",!0).finally((function(){i.taskLock=!0,i.uploadTask.length>0&&i.enqueueTask()})))},e.prototype.enqueueTask=function(){if(this.taskLock){var e=this.uploadTask.shift();e&&this.reportLogCmdTask(e)}},e}();var fn,En,In,Tn,vn=function(){function e(e,t,n){this.logger=e,this.appkey=t,this.reporter=n,this.isEable=!0,this.expire=0,this.interval=0,this.timestamp=0,this.lastRequestTime=0,this.changeAreaCode=0,this._cache=null,this.uploadTaskManage=new gn(n)}return e.prototype.init=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)))},e.prototype.isExire=function(){return(new Date).getTime()-this.timestamp<this.expire},e.prototype.isOverclock=function(){return(new Date).getTime()-this.lastRequestTime<this.interval},e.prototype.logCmdMsgTasks=function(e){var t=this;e.uploadLog&&e.uploadLog.tasks.forEach((function(e){e.objectName===exports.MessageType.LOG_COMMAND&&t.uploadTaskManage.uploadLogCmdTask(e)}))},e.prototype.dataHandle=function(e){var t=this._cache;t.lastRequestTime=this.lastRequestTime,Tt(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)},e.prototype.request=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o,i,s,a,u,c,l,d,p;return ce(this,(function(h){switch(h.label){case 0:return!this.isEable&&t===dn.init&&this.isExire()?(this.logger.info(exports.LogTagId.L_CLOUD_DISABLED,JSON.stringify({msg:"cloud controller is disabled"})),[2,this.timestamp]):!this.isEable&&t===dn.newWorkChange&&this.isOverclock()?(this.logger.info(exports.LogTagId.L_CLOUD_OVERCLOCK,JSON.stringify({msg:"cloud controller is overclock"})),[2,this.timestamp]):(r=Xt(e),this.lastRequestTime=(new Date).getTime(),o="".concat(r,"/v1/config"),i={"Content-Type":"application/json","RC-App-Key":this.appkey},n&&(i["RC-Token"]=n),s={platform:"web",version:"5.20.0-c-unikit.1",timestamp:this.timestamp},this.logger.record(re.L_CLOUD_INFO_FETCH_T,JSON.stringify({appKey:this.appkey,timestamp:this.timestamp,token:!!n,uri:o})),[4,this.httpRequest(o,exports.HttpMethod.POST,i,s)]);case 1:return a=h.sent(),u=a.code,c=a.data,this.logger.record(re.L_CLOUD_INFO_FETCH_R,JSON.stringify({appkey:this.appkey,info:c})),u===exports.ErrorCode.CLOUD_DATA_CENTER_INVALID&&c&&c.targetRegion?(l=c.targetRegion,this.changeAreaCode===l?[2,this.timestamp]:(d=cn.setAreaCode(l),this.logger.info(exports.LogTagId.L_CLOUD_SET_AREA_CODE_O,JSON.stringify({isChangeSuccess:d,originAreaCode:cn.getAreaCode(),newAreaCode:l})),this.changeAreaCode=l,(p=cn.getCloudControllerUrl(l))[0]?[2,this.request(p[0],dn.other)]:(this.logger.info(exports.LogTagId.L_CLOUD_APPKEY_REGION_E,JSON.stringify({appkey:this.appkey,uri:o,msg:"appkey region error"})),[2,this.timestamp]))):(c&&this.dataHandle(c),[2,this.timestamp||this.lastRequestTime])}}))}))},e.prototype._handleMrtrData=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}(),Cn=function(e){return e===exports.ErrorCode.RC_CONN_REDIRECTED},Rn=function(e){function n(t,n,r){var o=e.call(this)||this;return o.appkey=t,o.navi=n,o.logger=r,fn.add(o),o.token="",o.curCmpUrl="",o.retryCount=0,o.uuid="",Tn.set(o,0),o._doConnectReason=0,o._network={status:!0,type:me.UNKONWN},o._checkAliveTimer=null,o._crtConnectionStatus=exports.RCConnectionStatus.DISCONNECTED,o._crtUserId="",o._openCallPlus=!1,o._crtConnectionTask=null,o.reconnectTimer=null,o._failedCount=0,o.ALLOW_FAILED_TIMES=2,o}return t(n,e),n.prototype.getToken=function(){return this.token},Object.defineProperty(n.prototype,"cid",{get:function(){return"".concat(this.uuid,"_").concat(this.retryCount)},enumerable:!1,configurable:!0}),n.prototype.getCurrentUserId=function(){return this._crtUserId},n.prototype.setConnectionStatus=function(e,t){if(this._crtConnectionStatus!==e){if(this._crtConnectionStatus===exports.RCConnectionStatus.DISCONNECTED&&e===exports.RCConnectionStatus.CONNECTING&&(this._doConnectReason=Ce.CONNECT,he(this,fn,"m",In).call(this)),this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTED&&e===exports.RCConnectionStatus.SUSPENDED&&(t===exports.ErrorCode.RC_PING_EXCEED_LIMIT?this._doConnectReason=Ce.TIMEOUT:t===exports.ErrorCode.RC_CONN_REDIRECTED?this._doConnectReason=Ce.REDIRECTED:this._doConnectReason=Ce.RECONNECT),this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTED){var n={bid:zt(),cod:t,net:this.getNetwork().type,dur:Date.now()-he(this,Tn,"f"),cid:this.cid};this.logger.record(re.IM_CONNECTION_DURATION,JSON.stringify(n)),e===exports.RCConnectionStatus.SUSPENDED&&he(this,fn,"m",In).call(this)}switch(this._crtConnectionStatus=e,e){case exports.RCConnectionStatus.CONNECTED:this.logger.info(exports.LogTagId.L_CONNECT_S,"status: ".concat(e)),this.checkAlive(),he(this,fn,"m",En).call(this).emit("onConnected");break;case exports.RCConnectionStatus.CONNECTING:this.logger.warn(exports.LogTagId.L_CONNECT_S,"status: ".concat(e)),he(this,fn,"m",En).call(this).emit("onConnecting");break;case exports.RCConnectionStatus.SUSPENDED:this.logger.warn(exports.LogTagId.L_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),Cn(t)&&this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),he(this,fn,"m",En).call(this).emit("onSuspend",t);break;default:this.logger.warn(exports.LogTagId.L_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),he(this,fn,"m",En).call(this).emit("onDisconnected",t)}}},n.prototype.getConnectionStatus=function(){return this._crtConnectionStatus},n.prototype.setNetwork=function(e,t){if(!t){var n={cid:this.cid,cn:e.type,on:this._network.type};this.logger.record(re.IM_NETWORK_CHANGE,JSON.stringify(n))}this._network=e},n.prototype.getNetwork=function(){return this._network},n.prototype.connect=function(e,t,n,r){return ue(this,void 0,void 0,(function(){var o,i,s;return ce(this,(function(a){switch(a.label){case 0:return this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTED?[2,it(this._crtUserId)]:this._crtConnectionTask?[2,this._crtConnectionTask]:(this._openCallPlus=n,this.token=e,this.setConnectionStatus(exports.RCConnectionStatus.CONNECTING),[4,this.try2Connect(e,t,!1,r,!0)]);case 1:return o=a.sent(),i=o.code,s=o.data,i!==exports.ErrorCode.SUCCESS?(this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,i),[2,st(i)]):(this.setConnectionStatus(exports.RCConnectionStatus.CONNECTED),[2,it(s)])}}))}))},n.prototype.try2Connect=function(e,t,n,r,o){return ue(this,void 0,void 0,(function(){var i;return ce(this,(function(s){switch(s.label){case 0:return this._crtConnectionTask?[2,this._crtConnectionTask]:(this._crtConnectionTask=this.createConnectionTask(e,t,n,r,o),[4,this._crtConnectionTask]);case 1:return i=s.sent(),this._crtConnectionTask=null,[2,i]}}))}))},n.prototype.createConnectionTask=function(e,t,n,r,o){return ue(this,void 0,void 0,(function(){var i,s,a,u,c,l,d,p,h,_;return ce(this,(function(g){switch(g.label){case 0:return i={cid:this.cid,reason:this._doConnectReason,net:this.getNetwork().type,spr:0,sts:Date.now(),timelimit:0},this.logger.record(re.IM_STATS_CS,JSON.stringify(i)),s={retryCount:this.retryCount,uuid:this.uuid,type:this.getNetwork().type,reason:this._doConnectReason},[4,this.navi.request(e,n,!1,r,s)];case 1:return a=g.sent(),u=a.code,c=a.data,u!==exports.ErrorCode.SUCCESS?[2,st(u)]:1===(l=c).type?[2,st(exports.ErrorCode.PACKAGE_ENVIRONMENT_ERROR)]:(this.logger.info(exports.LogTagId.L_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),r),[4,this.connectWithToken(e.replace(/@.+$/,"@"),l,t,r)]);case 2:return d=g.sent(),p=d.code,h=d.data,o||p===exports.ErrorCode.SUCCESS||(this.retryCount+=1),Cn(p)?(this.logger.warn(exports.LogTagId.L_CONNECT_R,"redirect code: ".concat(p),r),this.clearCmpWeightCache(),[2,this.createConnectionTask(e,t,!0,r,o)]):[exports.ErrorCode.RC_TCP_RESET,exports.ErrorCode.RC_CONN_ACK_TIMEOUT,exports.ErrorCode.RC_TCP_DISCONNECTED_NO_RMTP].includes(p)&&this.cmpWeightCache&&this.cmpWeightCache.length>1?(this.updateCmpWeight(this.curCmpUrl,!1),_=this.cmpWeightCache.every((function(e){return e.failed})),o&&_?(this.logger.warn(exports.LogTagId.L_CONNECT_R,"cpp code:".concat(p,",reture code:").concat(exports.ErrorCode.SERVER_UNAVAILABLE),r),[2,st(exports.ErrorCode.SERVER_UNAVAILABLE)]):(this.logger.warn(exports.LogTagId.L_CONNECT_R,"cmp ack timeout, code: ".concat(p),r),this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,p),this.setConnectionStatus(exports.RCConnectionStatus.CONNECTING),[2,this.createConnectionTask(e,t,!1,r,o)])):p!==exports.ErrorCode.SUCCESS?(this.logger.warn(exports.LogTagId.L_CONNECT_R,"code: ".concat(p),r),[2,st(p)]):(this.logger.info(exports.LogTagId.L_CONNECT_R,"userId: ".concat(h),r),_e(this,Tn,Date.now(),"f"),this._crtUserId=h,[2,it(h)])}}))}))},n.prototype.try2Reconnect=function(e,t){return ue(this,void 0,void 0,(function(){var n,r,o=this;return ce(this,(function(i){return n=this.logger.createTraceId(),this.logger.debug(exports.LogTagId.T,"try2Reconnect -> ignoreNaviCache: ".concat(e,", reason: ").concat(t),n),this.stopReconnectTimer(),r=function(){return ue(o,void 0,void 0,(function(){var o;return ce(this,(function(i){switch(i.label){case 0:return this._crtConnectionStatus!==exports.RCConnectionStatus.SUSPENDED?[2]:(this.setConnectionStatus(exports.RCConnectionStatus.CONNECTING,t),[4,this.try2Connect(this.token,!0,e,n,!1)]);case 1:return o=i.sent().code,this.reconnectTimer=null,o===exports.ErrorCode.SUCCESS?(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(r,5e3)),[2]):(this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,o),[2])}}))}))},r(),[2]}))}))},n.prototype.onDisconnectByServer=function(e,t){var n=this;return Cn(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(){n.try2Reconnect(!0,e)}),1e3*(t||0))):void this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,e)},n.prototype.onDisconenctUnusual=function(e){this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,e),this.try2Reconnect(!1,e)},n.prototype.checkAlive=function(){return ue(this,void 0,void 0,(function(){var e,t,n=this;return ce(this,(function(r){switch(r.label){case 0:return this._crtConnectionStatus!==exports.RCConnectionStatus.CONNECTED?(this._failedCount=0,this.logger.debug(exports.LogTagId.L_CHECK_ALIVE_IM_S,"stop ping because of no connection"),[2]):(e=this.logger.createTraceId(),this.logger.debug(exports.LogTagId.L_CHECK_ALIVE_IM_T,null,e),[4,this.sendPing(15e3)]);case 1:return(t=r.sent())===exports.ErrorCode.SUCCESS?(this.logger.debug(exports.LogTagId.L_CHECK_ALIVE_IM_R,t,e),this._failedCount=0,this._checkAliveTimer=setTimeout((function(){return n.checkAlive()}),15e3),[2]):this._crtConnectionStatus!==exports.RCConnectionStatus.CONNECTED?[2]:(this._failedCount+=1,this.logger.debug(exports.LogTagId.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(exports.LogTagId.L_CHECK_ALIVE_IM_S,"ping timeout, close connection to reconnect!"),[4,this.close(!0)]));case 2:return r.sent(),this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,exports.ErrorCode.RC_PING_EXCEED_LIMIT),this.try2Reconnect(!1,exports.ErrorCode.RC_PING_EXCEED_LIMIT),[2]}}))}))},n.prototype.disconnect=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){switch(n.label){case 0:return this.stopReconnectTimer(),this._crtConnectionTask?[4,this._crtConnectionTask]:[3,2];case 1:n.sent(),n.label=2;case 2:return this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,exports.ErrorCode.ACTIVE_DISCONNECT),[2,this.close(!1,e,t)]}}))}))},n.prototype.stopReconnectTimer=function(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)},n.prototype.getCmpList=function(e,t){if(this.cmpWeightCache&&this.cmpWeightCache.length>0)return pe([],de(this.cmpWeightCache),!1);var n=xt(e,t);return this.cmpWeightCache=pe([],de(n),!1),pe([],de(n),!1)},n.prototype.updateCmpWeight=function(e,t,n){if(this.cmpWeightCache){var r=this.cmpWeightCache.find((function(t){return n?t.addr===e&&t.protocol===x.QUIC:t.addr===e}));if(r)if(t){var o=Math.max.apply(Math,pe([],de(this.cmpWeightCache.map((function(e){return e.weight}))),!1));r.weight!==o&&(r.weight=o+1)}else{var i=Math.min.apply(Math,pe([],de(this.cmpWeightCache.map((function(e){return e.weight}))),!1));r.weight!==i&&(r.weight=i-1),r.failed=!0}}},n.prototype.clearCmpWeightCache=function(){this.cmpWeightCache=void 0},n.prototype.reconnect=function(e,t,n,r){this.token=e,this._openCallPlus=n,this.onDisconenctUnusual(r)},n}(nt);Tn=new WeakMap,fn=new WeakSet,En=function(){return this},In=function(){this.uuid=Ze.gen(),this.retryCount=0};var yn,mn,Sn,An=function(e){return e.replace(/@.+$/,"@")},Nn=function(){function e(e,t,n,r,o){void 0===r&&(r=!0),void 0===o&&(o=!0),this.appkey=e,this.logger=t,this.staticConfigManager=n,this.isRequestProfile=r,this.isUseDynamicNaviUrl=o,this.crtRequest=null,this._environment="default"}return e.prototype.getCatchKey=function(e){return e+(this._environment?"-".concat(this._environment):"")},e.prototype.request=function(e,t,n,r,o){return ue(this,void 0,void 0,(function(){var i;return ce(this,(function(s){switch(s.label){case 0:return this.crtRequest?[2,this.crtRequest]:(this.crtRequest=this.sendRequest(e,t,n,r,o),[4,this.crtRequest]);case 1:return i=s.sent(),this.crtRequest=null,[2,i]}}))}))},e.prototype.sendRequest=function(e,t,n,r,o){var i;return ue(this,void 0,void 0,(function(){var s,a,u,c,l,d,p,h,_,g,f,E,I,T,v,C,R;return ce(this,(function(y){switch(y.label){case 0:return s=An(e),a=this.getNaviCache(s),!t&&a&&(u=a.timestamp,c=a.naviInfo,n||Date.now()-u<Oe)?(this.logger.info(exports.LogTagId.L_REQUEST_T,JSON.stringify({fromCache:!0,naviInfo:c}),r),o&&(l=o.uuid,d=o.retryCount,p=o.reason,h={bid:zt(),ptc:Ee.NAVI,cod:exports.ErrorCode.SUCCESS,net:o.type,dur:0,spr:0,pr:null!==(i=c.type)&&void 0!==i?i:0,hos:"",cache:Ie.LOCAL,v:Te.CURRENT,rsn:p,cid:"".concat(l,"_").concat(d),count:d},this.logger.record(re.IM_NAVI,JSON.stringify(h),r)),[2,it(c)]):(_=cn.getNaviUrlList(e,this.isUseDynamicNaviUrl),this.logger.info(exports.LogTagId.L_GET_NAVI_T,JSON.stringify({token:e,uris:_}),r),[4,this.requestHandler(_,e,r,o)]);case 1:return g=y.sent(),f=g.code,E=g.data,f===exports.ErrorCode.RC_NAVI_REQ_FAILED&&this.isRequestProfile?[4,this.staticConfigManager.getStaticConfig()]:[3,4];case 2:return(null==(I=y.sent())?void 0:I.navi)&&(null==I?void 0:I.navi.length)>0?(T=I.navi,[4,this.requestHandler(T,e,r,o)]):[3,4];case 3:v=y.sent(),f=v.code,E=v.data,y.label=4;case 4:return f!==exports.ErrorCode.SUCCESS?(this.logger.warn(exports.LogTagId.L_GET_NAVI_R,f,r),[2,st(f)]):(C=E).code&&200!==C.code?(this.logger.warn(exports.LogTagId.L_GET_NAVI_R,C.code,r),[2,st(this.transHttpCode(C.code))]):xt(C).length>0?(this.logger.info(exports.LogTagId.L_GET_NAVI_R,JSON.stringify({naviInfo:C}),r),this.setNaviCache(s,C),[2,it(C)]):(R={server:C.server,backupServer:C.backupServer,serverAddr:C.serverAddr,bs:C.bs},this.logger.warn(exports.LogTagId.L_GET_NAVI_R,"navi server address invalid: ".concat(JSON.stringify(R)),r),[2,st(exports.ErrorCode.SERVER_UNAVAILABLE)])}}))}))},e.prototype.requestHandler=function(e,t,n,r){return ue(this,void 0,void 0,(function(){var o,i,s,a,u,c,l,d,p;return ce(this,(function(h){switch(h.label){case 0:o=0,i=e.length,h.label=1;case 1:return o<i?(s=o===e.length-1,a=this.useV2Navi()?this.httpRequestV2:this.httpRequest,u=Date.now(),[4,a.call(this,e[o],this.appkey,t,n,s)]):[3,4];case 2:if(c=h.sent(),l=c.code,d=c.data,p={bid:zt(),ptc:Ee.NAVI,cod:l,net:null==r?void 0:r.type,dur:Date.now()-u,spr:0,pr:(null==d?void 0:d.type)||0,hos:e[o],cache:Ie.REQUEST,v:Te.CURRENT,rsn:null==r?void 0:r.reason,cid:"".concat(null==r?void 0:r.uuid,"_").concat(null==r?void 0:r.retryCount),count:null==r?void 0:r.retryCount},this.logger.record(re.IM_NAVI,JSON.stringify(p),n),[exports.ErrorCode.SUCCESS,exports.ErrorCode.RC_CONN_TOKEN_INCORRECT,exports.ErrorCode.RC_LICENSE_EXPIRED].includes(l))return[2,l===exports.ErrorCode.SUCCESS?it(d):st(l)];h.label=3;case 3:return o+=1,[3,1];case 4:return[2,st(exports.ErrorCode.RC_NAVI_REQ_FAILED)]}}))}))},e.prototype.transHttpCode=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}},e.prototype.getNaviInfoFromCache=function(e){var t=this.getNaviCache(An(e));return t?t.naviInfo:null},e.prototype.updateVoipCallInfo=function(e,t){var n=this.getNaviInfoFromCache(e);n&&this.setNaviCache(An(e),se(se({},n),{voipCallInfo:t}))},e.prototype.getNaviV2RequestOption=function(e){var t,n=e.uri,r=e.token,o=e.platform,i=e.protocol,s=e.mac;t="".concat(n,"/v2/navi.json?cloud=").concat(0);var a="token=".concat(encodeURIComponent(r),"&version=").concat("5.20.0-c-unikit.1","&platfrom=").concat(o);return s&&(a+="&m=".concat(s)),{method:"POST",headers:{"RC-Appkey":this.appkey,"Content-Type":"Application/x-www-form-urlencoded","RC-Negotiate":"conn=".concat(i,";rtc=4;log=2;iptype=v4,v6")},body:a,url:t,timeout:1e4}},e.prototype.useV2Navi=function(){return!0},e}(),On=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],n=0,r=t.length;n<r;n++)if(!e[t[n]])return!1;return!0}(uni))},Mn=function(){function e(e){yn.add(this),mn.set(this,void 0),_e(this,mn,e,"f"),this._logger=e.logger}return e.prototype.open=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return e=e.sort((function(e,t){return t.weight-e.weight})),[2,he(this,yn,"m",Sn).call(this,e,he(this,mn,"f"))]}))}))},e}();mn=new WeakMap,yn=new WeakSet,Sn=function e(t,n){return ue(this,void 0,void 0,(function(){var r,o,i,s=this;return ce(this,(function(a){switch(a.label){case 0:return 0===t.length?[2,st(exports.ErrorCode.STREAM_MESSAGE_REQUEST_FAIL,"All addrs failed")]:(r=t.shift(),o=Xt(r.addr,r.protocol),o="".concat(o,"/v3/message/get_stream.json?sdkVersion=").concat("5.20.0-c-unikit.1","&platform=").concat(this._platform,"&messageUID=").concat(n.msgUId),[4,this._openHandler(o,n)]);case 1:return[2,(i=a.sent()).or((function(r){return ue(s,void 0,void 0,(function(){return ce(this,(function(o){return-1===r?[2,he(this,yn,"m",e).call(this,t,n)]:[2,i]}))}))}))]}}))}))};var Ln=On();var Un=null,bn=function(e){return ue(void 0,void 0,void 0,(function(){var t;return ce(this,(function(n){switch(n.label){case 0:return[4,wn.getNetworkType()];case 1:return t=n.sent(),Un({status:"online"===e.type,type:t}),[2]}}))}))};var Pn=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t._platform="Websocket",t}return t(n,e),n.prototype._openHandler=function(e,t){return ue(this,void 0,void 0,(function(){var n=this;return ce(this,(function(r){return[2,new Promise((function(r){n._logger.debug(exports.LogTagId.L_REQ_STREAM_MSG_CONTENT_O,"try open -> ".concat(e));var o=new XMLHttpRequest;o.open("GET",e,!0),o.timeout=t.timeout,o.ontimeout=function(){n._logger.warn(exports.LogTagId.L_REQ_STREAM_MSG_CONTENT_E,"timeout -> ".concat(e)),r(st(-1,"timeout"))},o.onreadystatechange=function(i){if(o.readyState===XMLHttpRequest.HEADERS_RECEIVED){var s=o.getResponseHeader("Content-Type"),a=null==s?void 0:s.startsWith("text/event-stream");if(200===o.status&&a){r(it());var u=0;o.onprogress=function(e){var n=o.response.slice(u);u=o.response.length,t.onRawContent(n)},o.onerror=function(r){n._logger.warn(exports.LogTagId.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);r(st(e.code,e.message))}}},o.onerror=function(t){n._logger.warn(exports.LogTagId.L_REQ_STREAM_MSG_CONTENT_E,"req fail -> ".concat(e)),r(st(-1))},o.setRequestHeader("Content-Type","application/json;charset=UTF-8"),o.setRequestHeader("App-Key",t.appkey),o.setRequestHeader("Authorization","Bearer ".concat(t.token)),o.send()}))]}))}))},n}(Mn),wn={tag:"browser",httpReq:function(e){return rn(e).result()},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:Ln,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",{id:Date.now(),onClose:function(e){n.onclose=function(t){var n=t.code,r=t.reason;e(n,r)}},onError:function(e){n.onerror=e},onMessage:function(e){n.onmessage=function(t){e(t.data)}},onOpen:function(e){n.onopen=e},send:function(e){n.send(e)},close:function(e,t){n.close()}}},getNetworkType:function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection||{effectiveType:me.UNKONWN},t=e.type,n=e.effectiveType,r=t||n||me.UNKONWN;return Promise.resolve(r)},setNetworkStatusListener:function(e){Un=e,"undefined"!=typeof window&&window&&(window.addEventListener("offline",bn),window.addEventListener("online",bn))},removeNetworkStatusListener:function(){"undefined"!=typeof window&&window&&(window.removeEventListener("offline",bn),window.removeEventListener("online",bn)),Un=null},createSSEClient:function(e){return it(new Pn(e))},getApiVer:function(){var e=wn.runtimeInfo,t=e.type,n=e.version;return"|".concat(t,"|").concat(n)},get runtimeInfo(){var e,t,n=navigator.userAgent,r={IE:/rv:([\d.]+)\) like Gecko|MSIE ([\d.]+)/,Edge:/Edge\/([\d.]+)/,Firefox:/Firefox\/([\d.]+)/,Opera:/(?:OPERA|OPR).([\d.]+)/,WeChat:/MicroMessenger\/([\d.]+)/,QQBrowser:/QQBrowser\/([\d.]+)/,Chrome:/Chrome\/([\d.]+)/,Safari:/Version\/([\d.]+).*Safari/,iOSChrome:/Mobile\/([\d.]+).*Safari/};for(var o in r)if(r.hasOwnProperty(o)){var i=n.match(r[o]);if(i){t=o,e=i[1]||i[2];break}}return{type:t||"Unknown",version:e||"Unknown"}}},xn=On(),Dn=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return wx[e].apply(wx,pe([],de(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},Vn={setItem:Dn("setStorageSync"),getItem:Dn("getStorageSync"),removeItem:Dn("removeStorageSync"),clear:Dn("clearStorageSync")},Gn=null,kn=function(e){var t=e.isConnected,n=e.networkType;Gn({status:t,type:n})};var Fn={tag:"wechat",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,n=e.timeout||Me,r=e.headers,o=e.query,i=e.body,s=qt(e.url,o);return new Promise((function(e){wx.request({url:s,method:t,header:r,timeout:n,data:i,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:Vn,sessionStorage:Vn,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:xn,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return{id:Date.now(),onClose:function(e){n.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){e(t.data)}))},onOpen:function(e){n.onOpen(e)},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){wx.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(me.UNKONWN)}})}))},setNetworkStatusListener:function(e){Gn=e,wx.onNetworkStatusChange(kn)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(kn),Gn=null},createSSEClient:function(e){return st(exports.ErrorCode.NOT_SUPPORT)},get runtimeInfo(){return{type:Fn.tag,version:"Unknown"}}},Bn=On(),Hn=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{if("setStorageSync"===e)return my[e]({key:t[0],data:JSON.parse(t[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:t[0]});var r=my[e]({key:t[0]}).data;return r?JSON.stringify(r):r}catch(e){}}},qn={setItem:Hn("setStorageSync"),getItem:Hn("getStorageSync"),removeItem:Hn("removeStorageSync"),clear:Hn("clearStorageSync")},Yn=null,Kn=function(e){var t=e.isConnected,n=e.networkType;Yn({status:t,type:n})};var Qn={tag:"alipay",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,n=e.timeout||Me,r=e.headers,o=e.query,i=e.body,s=qt(e.url,o),a=e.dataType||"json";return new Promise((function(e){my.request({url:s,method:t,headers:r,timeout:n,data:i,dataType:a,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:qn,sessionStorage:qn,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Bn,createWebSocket:function(e){var t=my.connectSocket({url:e,multiple:!0});return{id:Date.now(),onClose:function(e){t.onClose(e)},onError:function(e){t.onError((function(t){e(t.errMsg)}))},onMessage:function(e){t.onMessage((function(t){t.data.isBuffer?e(my.base64ToArrayBuffer(t.data.data)):e(t.data.data)}))},onOpen:function(e){t.onOpen(e)},send:function(e){t.send({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){t.close()}}},getNetworkType:function(){return new Promise((function(e){my.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(me.UNKONWN)}})}))},setNetworkStatusListener:function(e){Yn=e,my.onNetworkStatusChange(Kn)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(Kn),Yn=null},createSSEClient:function(e){return st(exports.ErrorCode.NOT_SUPPORT,"Not supported yet")},get runtimeInfo(){return{type:Qn.tag,version:"Unknown"}}},Wn=On(),jn=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return tt[e].apply(tt,pe([],de(t),!1))}catch(e){}}},Jn={setItem:jn("setStorageSync"),getItem:jn("getStorageSync"),removeItem:jn("removeStorageSync"),clear:jn("clearStorageSync")},zn=null,Zn=function(e){var t=e.isConnected,n=e.networkType;zn({status:t,type:n})};var Xn={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Wn,localStorage:Jn,sessionStorage:Jn,httpReq:function(e){return new Promise((function(t){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},r={data:JSON.stringify(n),status:e.statusCode};t(r)},fail:function(e){t({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=tt.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){tt.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(me.UNKONWN)}})}))},setNetworkStatusListener:function(e){zn=e,tt.onNetworkStatusChange(Zn)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(Zn),zn=null},createSSEClient:function(e){return st(exports.ErrorCode.NOT_SUPPORT)},get runtimeInfo(){return{type:Xn.tag,version:"Unknown"}}},$n=On(),er=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return swan[e].apply(swan,pe([],de(t),!1))}catch(e){}}},tr={setItem:er("setStorageSync"),getItem:er("getStorageSync"),removeItem:er("removeStorageSync"),clear:er("clearStorageSync")},nr=null,rr=function(e){var t=e.isConnected,n=e.networkType;nr({status:t,type:n})};var or={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:$n,localStorage:tr,sessionStorage:tr,httpReq:function(e){return new Promise((function(t){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},r={data:JSON.stringify(n),status:e.statusCode};t(r)},fail:function(e){t({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=swan.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){return[2,new Promise((function(e){swan.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(me.UNKONWN)}})}))]}))}))},setNetworkStatusListener:function(e){nr=e,swan.onNetworkStatusChange(rr)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(rr),nr=null},createSSEClient:function(e){return st(exports.ErrorCode.NOT_SUPPORT)},get runtimeInfo(){return{type:or.tag,version:"Unknown"}}},ir=On(),sr=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return jd[e].apply(jd,pe([],de(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},ar={setItem:sr("setStorageSync"),getItem:sr("getStorageSync"),removeItem:sr("removeStorageSync"),clear:sr("clearStorageSync")},ur=null,cr=function(e){var t=e.isConnected,n=e.networkType;ur({status:t,type:n})};var lr={tag:"jingdong",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,n=e.timeout||Me,r=e.headers,o=e.query,i=e.body,s=qt(e.url,o);return new Promise((function(e){jd.request({url:s,method:t,header:r,timeout:n,data:i,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:ar,sessionStorage:ar,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:ir,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),{id:Date.now(),onClose:function(e){jd.onSocketClose((function(t){e(t.code,t.reason)}))},onError:function(e){jd.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){jd.onSocketMessage((function(t){e(t.data)}))},onOpen:function(e){jd.onSocketOpen(e)},send:function(e){jd.sendSocketMessage({data:e})},close:function(e,t){jd.closeSocket({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){jd.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(me.UNKONWN)}})}))},setNetworkStatusListener:function(e){ur=e,jd.onNetworkStatusChange(cr)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(cr),ur=null},createSSEClient:function(e){return st(exports.ErrorCode.NOT_SUPPORT)},get runtimeInfo(){return{type:lr.tag,version:"Unknown"}}},dr=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return uni[e].apply(uni,pe([],de(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},pr={setItem:dr("setStorageSync"),getItem:dr("getStorageSync"),removeItem:dr("removeStorageSync"),clear:dr("clearStorageSync")},hr=null,_r=function(e){var t=e.isConnected,n=e.networkType;hr({status:t,type:n})};var gr,fr,Er={tag:"uniapp",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,n=e.timeout||Me,r=e.headers,o=e.query,i=e.body,s=qt(e.url,o);return new Promise((function(e){uni.request({url:s,method:t,header:r,timeout:n,data:i,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:pr,sessionStorage:pr,useNavi:!0,get connectPlatform(){var e=uni.getSystemInfoSync(),t=e.uniPlatform,n=e.osName;return["app","app-plus"].includes(t)&&n||""},isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},r=uni.connectSocket(n);return{id:Date.now(),onClose:function(e){r.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){r.onError((function(t){e(t.errMsg)}))},onMessage:function(e){r.onMessage((function(t){e(t.data)}))},onOpen:function(e){r.onOpen(e)},send:function(e){r.send({data:e})},close:function(e,t){r.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){uni.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(me.UNKONWN)}})}))},setNetworkStatusListener:function(e){hr=e,uni.onNetworkStatusChange(_r)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(_r),hr=null},createSSEClient:function(e){return st(exports.ErrorCode.NOT_SUPPORT)},getApiVer:function(){var e=uni.getSystemInfoSync(),t=e.osAndroidAPILevel,n=e.deviceModel,r=e.deviceBrand,o=e.osVersion,i="android"===e.osName?t:o;return"".concat(r||"","|").concat(n||"","|").concat(i||"","|||uniapp").replace(/-/g,"_")},get runtimeInfo(){return{type:Er.tag,version:"Unknown"}}},Ir=function(e){return e&&e.request&&e.getSystemInfo},Tr="undefined"!=typeof uni&&Ir(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":case"app":return Er;case"mp-jd":return lr;case"mp-baidu":return or;case"mp-toutiao":return Xn;case"mp-alipay":return Qn;case"mp-weixin":return Fn;default:return wn}}():"undefined"!=typeof jd&&Ir(jd)?lr:"undefined"!=typeof my&&Ir(my)?Qn:"undefined"!=typeof tt&&Ir(tt)?Xn:"undefined"!=typeof swan&&Ir(swan)?or:"undefined"!=typeof wx&&Ir(wx)?Fn:wn;function vr(e){var t=function(){function e(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function t(e){return!0===(e&&e.__isLong__)}function n(e,t){var n,r,i;return t?(i=(e>>>=0)>=0&&e<256)&&(r=u[e])?r:(n=o(e,(0|e)<0?-1:0,!0),i&&(u[e]=n),n):(i=(e|=0)>=-128&&e<128)&&(r=a[e])?r:(n=o(e,e<0?-1:0,!1),i&&(a[e]=n),n)}function r(e,t){if(isNaN(e)||!isFinite(e))return t?g:_;if(t){if(e<0)return g;if(e>=d)return v}else{if(-p>=e)return C;if(e+1>=p)return T}return e<0?r(-e,t).neg():o(0|e%l,0|e/l,t)}function o(t,n,r){return new e(t,n,r)}function i(e,t,n){var o,s,a,u,l,d,p;if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return _;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||n>36)throw RangeError("radix");if((o=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===o)return i(e.substring(1),t,n).neg();for(s=r(c(n,8)),a=_,u=0;u<e.length;u+=8)l=Math.min(8,e.length-u),d=parseInt(e.substring(u,u+l),n),l<8?(p=r(c(n,l)),a=a.mul(p).add(r(d))):a=(a=a.mul(s)).add(r(d));return a.unsigned=t,a}function s(t){return t instanceof e?t:"number"==typeof t?r(t):"string"==typeof t?i(t):o(t.low,t.high,t.unsigned)}var a,u,c,l,d,p,h,_,g,f,E,I,T,v,C,R;return e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t,a={},u={},e.fromInt=n,e.fromNumber=r,e.fromBits=o,c=Math.pow,e.fromString=i,e.fromValue=s,p=(d=(l=4294967296)*l)/2,h=n(16777216),_=n(0),e.ZERO=_,g=n(0,!0),e.UZERO=g,f=n(1),e.ONE=f,E=n(1,!0),e.UONE=E,I=n(-1),e.NEG_ONE=I,T=o(-1,2147483647,!1),e.MAX_VALUE=T,v=o(-1,-1,!0),e.MAX_UNSIGNED_VALUE=v,C=o(0,-2147483648,!1),e.MIN_VALUE=C,(R=e.prototype).toInt=function(){return this.unsigned?this.low>>>0:this.low},R.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},R.toString=function(e){var t,n,o,i,s,a,u,l;if((e=e||10)<2||e>36)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())return this.eq(C)?(t=r(e),o=(n=this.div(t)).mul(t).sub(this),n.toString(e)+o.toInt().toString(e)):"-"+this.neg().toString(e);for(i=r(c(e,6),this.unsigned),s=this,a="";;){if(u=s.div(i),l=(s.sub(u.mul(i)).toInt()>>>0).toString(e),(s=u).isZero())return l+a;for(;l.length<6;)l="0"+l;a=""+l+a}},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(){var e,t;if(this.isNegative())return this.eq(C)?64:this.neg().getNumBitsAbs();for(e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<<t);t--);return 0!=this.high?t+33:t+1},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=s(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=s(e)),this.eq(e))return 0;var n=this.isNegative(),r=e.isNegative();return n&&!r?-1:!n&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},R.comp=R.compare,R.negate=function(){return!this.unsigned&&this.eq(C)?C:this.not().add(f)},R.neg=R.negate,R.add=function(e){var n,r,i,a,u,c,l,d,p,h,_;return t(e)||(e=s(e)),n=this.high>>>16,r=65535&this.high,i=this.low>>>16,a=65535&this.low,u=e.high>>>16,c=65535&e.high,l=e.low>>>16,d=0,p=0,h=0,_=0,h+=(_+=a+(65535&e.low))>>>16,p+=(h+=i+l)>>>16,d+=(p+=r+c)>>>16,d+=n+u,o((h&=65535)<<16|(_&=65535),(d&=65535)<<16|(p&=65535),this.unsigned)},R.subtract=function(e){return t(e)||(e=s(e)),this.add(e.neg())},R.sub=R.subtract,R.multiply=function(e){var n,i,a,u,c,l,d,p,g,f,E,I;return this.isZero()?_:(t(e)||(e=s(e)),e.isZero()?_:this.eq(C)?e.isOdd()?C:_:e.eq(C)?this.isOdd()?C:_:this.isNegative()?e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg():e.isNegative()?this.mul(e.neg()).neg():this.lt(h)&&e.lt(h)?r(this.toNumber()*e.toNumber(),this.unsigned):(n=this.high>>>16,i=65535&this.high,a=this.low>>>16,u=65535&this.low,c=e.high>>>16,l=65535&e.high,d=e.low>>>16,g=0,f=0,E=0,I=0,E+=(I+=u*(p=65535&e.low))>>>16,f+=(E+=a*p)>>>16,E&=65535,f+=(E+=u*d)>>>16,g+=(f+=i*p)>>>16,f&=65535,g+=(f+=a*d)>>>16,f&=65535,g+=(f+=u*l)>>>16,g+=n*p+i*d+a*l+u*c,o((E&=65535)<<16|(I&=65535),(g&=65535)<<16|(f&=65535),this.unsigned)))},R.mul=R.multiply,R.divide=function(e){var n,o,i,a,u,l,d;if(t(e)||(e=s(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?g:_;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return E;i=g}else{if(this.eq(C))return e.eq(f)||e.eq(I)?C:e.eq(C)?f:(n=this.shr(1).div(e).shl(1)).eq(_)?e.isNegative()?f:I:(o=this.sub(e.mul(n)),i=n.add(o.div(e)));if(e.eq(C))return this.unsigned?g:_;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=_}for(o=this;o.gte(e);){for(n=Math.max(1,Math.floor(o.toNumber()/e.toNumber())),u=(a=Math.ceil(Math.log(n)/Math.LN2))<=48?1:c(2,a-48),d=(l=r(n)).mul(e);d.isNegative()||d.gt(o);)d=(l=r(n-=u,this.unsigned)).mul(e);l.isZero()&&(l=f),i=i.add(l),o=o.sub(d)}return i},R.div=R.divide,R.modulo=function(e){return t(e)||(e=s(e)),this.sub(this.div(e).mul(e))},R.mod=R.modulo,R.not=function(){return o(~this.low,~this.high,this.unsigned)},R.and=function(e){return t(e)||(e=s(e)),o(this.low&e.low,this.high&e.high,this.unsigned)},R.or=function(e){return t(e)||(e=s(e)),o(this.low|e.low,this.high|e.high,this.unsigned)},R.xor=function(e){return t(e)||(e=s(e)),o(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?o(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):o(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?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)},R.shr=R.shiftRight,R.shiftRightUnsigned=function(e){var n;return t(e)&&(e=e.toInt()),0===(e&=63)?this:(n=this.high,e<32?o(this.low>>>e|n<<32-e,n>>>e,this.unsigned):o(32===e?n:n>>>e-32,0,this.unsigned))},R.shru=R.shiftRightUnsigned,R.toSigned=function(){return this.unsigned?o(this.low,this.high,!1):this},R.toUnsigned=function(){return this.unsigned?this:o(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,255&t>>>8,255&t>>>16,255&t>>>24,255&e,255&e>>>8,255&e>>>16,255&e>>>24]},R.toBytesBE=function(){var e=this.high,t=this.low;return[255&e>>>24,255&e>>>16,255&e>>>8,255&e,255&t>>>24,255&t>>>16,255&t>>>8,255&t]},e}(),n=function(e){function t(e){var t=0;return function(){return t<e.length?e.charCodeAt(t++):null}}function n(){var e=[],t=[];return function(){return 0===arguments.length?t.join("")+a.apply(String,e):(e.length+arguments.length>1024&&(t.push(a.apply(String,e)),e.length=0),void Array.prototype.push.apply(e,arguments))}}function r(e,t,n,r,o){var i,s,a=8*o-r-1,u=(1<<a)-1,c=u>>1,l=-7,d=n?o-1:0,p=n?-1:1,h=e[t+d];for(d+=p,i=h&(1<<-l)-1,h>>=-l,l+=a;l>0;i=256*i+e[t+d],d+=p,l-=8);for(s=i&(1<<-l)-1,i>>=-l,l+=r;l>0;s=256*s+e[t+d],d+=p,l-=8);if(0===i)i=1-c;else{if(i===u)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,r),i-=c}return(h?-1:1)*s*Math.pow(2,i-r)}function o(e,t,n,r,o,i){var s,a,u,c=8*i-o-1,l=(1<<c)-1,d=l>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,_=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||1/0===t?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+d>=1?p/u:p*Math.pow(2,1-d))*u>=2&&(s++,u/=2),s+d>=l?(a=0,s=l):s+d>=1?(a=(t*u-1)*Math.pow(2,o),s+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,o),s=0));o>=8;e[n+h]=255&a,h+=_,a/=256,o-=8);for(s=s<<o|a,c+=o;c>0;e[n+h]=255&s,h+=_,s/=256,c-=8);e[n+h-_]|=128*g}var i,s,a,u,c,l=function(e,t,n){if(void 0===e&&(e=l.DEFAULT_CAPACITY),void 0===t&&(t=l.DEFAULT_ENDIAN),void 0===n&&(n=l.DEFAULT_NOASSERT),!n){if((e|=0)<0)throw RangeError("Illegal capacity");t=!!t,n=!!n}this.buffer=0===e?s:new ArrayBuffer(e),this.view=0===e?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=e,this.littleEndian=t,this.noAssert=n};return l.VERSION="5.0.1",l.LITTLE_ENDIAN=!0,l.BIG_ENDIAN=!1,l.DEFAULT_CAPACITY=16,l.DEFAULT_ENDIAN=l.BIG_ENDIAN,l.DEFAULT_NOASSERT=!1,l.Long=e||null,(i=l.prototype).__isByteBuffer__,Object.defineProperty(i,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1}),s=new ArrayBuffer(0),a=String.fromCharCode,l.accessor=function(){return Uint8Array},l.allocate=function(e,t,n){return new l(e,t,n)},l.concat=function(e,t,n,r){var o,i,s,a,u,c;for(("boolean"==typeof t||"string"!=typeof t)&&(r=n,n=t,t=void 0),o=0,s=0,a=e.length;a>s;++s)l.isByteBuffer(e[s])||(e[s]=l.wrap(e[s],t)),(i=e[s].limit-e[s].offset)>0&&(o+=i);if(0===o)return new l(0,n,r);for(c=new l(o,n,r),s=0;a>s;)(i=(u=e[s++]).limit-u.offset)<=0||(c.view.set(u.view.subarray(u.offset,u.limit),c.offset),c.offset+=i);return c.limit=c.offset,c.offset=0,c},l.isByteBuffer=function(e){return!0===(e&&e.__isByteBuffer__)},l.type=function(){return ArrayBuffer},l.wrap=function(e,t,n,r){var o,s;if("string"!=typeof t&&(r=n,n=t,t=void 0),"string"==typeof e)switch(void 0===t&&(t="utf8"),t){case"base64":return l.fromBase64(e,n);case"hex":return l.fromHex(e,n);case"binary":return l.fromBinary(e,n);case"utf8":return l.fromUTF8(e,n);case"debug":return l.fromDebug(e,n);default:throw Error("Unsupported encoding: "+t)}if(null===e||"object"!=typeof e)throw TypeError("Illegal buffer");if(l.isByteBuffer(e))return(o=i.clone.call(e)).markedOffset=-1,o;if(e instanceof Uint8Array)o=new l(0,n,r),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 l(0,n,r),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");for((o=new l(e.length,n,r)).limit=e.length,s=0;s<e.length;++s)o.view[s]=e[s]}return o},i.writeBitSet=function(e,t){var n,r,o,i,s,a,u=void 0===t;if(u&&(t=this.offset),!this.noAssert){if(!(e instanceof Array))throw TypeError("Illegal BitSet: Not an array");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}for(r=t,i=(o=e.length)>>3,s=0,t+=this.writeVarint32(o,t);i--;)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(o>s){for(a=0,n=0;o>s;)n|=(1&!!e[s++])<<a++;this.writeByte(n,t++)}return u?(this.offset=t,this):t-r},i.readBitSet=function(e){var t,n,r,o,i,s,a,u=void 0===e;for(u&&(e=this.offset),o=(r=(n=this.readVarint32(e)).value)>>3,i=0,s=[],e+=n.length;o--;)t=this.readByte(e++),s[i++]=!!(1&t),s[i++]=!!(2&t),s[i++]=!!(4&t),s[i++]=!!(8&t),s[i++]=!!(16&t),s[i++]=!!(32&t),s[i++]=!!(64&t),s[i++]=!!(128&t);if(r>i)for(a=0,t=this.readByte(e++);r>i;)s[i++]=!!(1&t>>a++);return u&&(this.offset=e),s},i.readBytes=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+e+") <= "+this.buffer.byteLength)}return n=this.slice(t,t+e),r&&(this.offset+=e),n},i.writeBytes=i.append,i.writeInt8=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=1)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=1,this.view[t]=e,r&&(this.offset+=1),this},i.writeByte=i.writeInt8,i.readInt8=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return!(128&~(t=this.view[e]))&&(t=-(255-t+1)),n&&(this.offset+=1),t},i.readByte=i.readInt8,i.writeUint8=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=1)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=1,this.view[t]=e,r&&(this.offset+=1),this},i.writeUInt8=i.writeUint8,i.readUint8=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return t=this.view[e],n&&(this.offset+=1),t},i.readUInt8=i.readUint8,i.writeInt16=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=2)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),r&&(this.offset+=2),this},i.writeShort=i.writeInt16,i.readInt16=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e],t|=this.view[e+1]<<8):(t=this.view[e]<<8,t|=this.view[e+1]),!(32768&~t)&&(t=-(65535-t+1)),n&&(this.offset+=2),t},i.readShort=i.readInt16,i.writeUint16=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=2)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),r&&(this.offset+=2),this},i.writeUInt16=i.writeUint16,i.readUint16=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e],t|=this.view[e+1]<<8):(t=this.view[e]<<8,t|=this.view[e+1]),n&&(this.offset+=2),t},i.readUInt16=i.readUint16,i.writeInt32=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=4)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=4,this.littleEndian?(this.view[t+3]=255&e>>>24,this.view[t+2]=255&e>>>16,this.view[t+1]=255&e>>>8,this.view[t]=255&e):(this.view[t]=255&e>>>24,this.view[t+1]=255&e>>>16,this.view[t+2]=255&e>>>8,this.view[t+3]=255&e),r&&(this.offset+=4),this},i.writeInt=i.writeInt32,i.readInt32=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e+2]<<16,t|=this.view[e+1]<<8,t|=this.view[e],t+=this.view[e+3]<<24>>>0):(t=this.view[e+1]<<16,t|=this.view[e+2]<<8,t|=this.view[e+3],t+=this.view[e]<<24>>>0),t|=0,n&&(this.offset+=4),t},i.readInt=i.readInt32,i.writeUint32=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=4)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=4,this.littleEndian?(this.view[t+3]=255&e>>>24,this.view[t+2]=255&e>>>16,this.view[t+1]=255&e>>>8,this.view[t]=255&e):(this.view[t]=255&e>>>24,this.view[t+1]=255&e>>>16,this.view[t+2]=255&e>>>8,this.view[t+3]=255&e),r&&(this.offset+=4),this},i.writeUInt32=i.writeUint32,i.readUint32=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e+2]<<16,t|=this.view[e+1]<<8,t|=this.view[e],t+=this.view[e+3]<<24>>>0):(t=this.view[e+1]<<16,t|=this.view[e+2]<<8,t|=this.view[e+3],t+=this.view[e]<<24>>>0),n&&(this.offset+=4),t},i.readUInt32=i.readUint32,e&&(i.writeInt64=function(t,n){var r,o,i,s=void 0===n;if(s&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),(n+=8)>(r=this.buffer.byteLength)&&this.resize((r*=2)>n?r:n),n-=8,o=t.low,i=t.high,this.littleEndian?(this.view[n+3]=255&o>>>24,this.view[n+2]=255&o>>>16,this.view[n+1]=255&o>>>8,this.view[n]=255&o,n+=4,this.view[n+3]=255&i>>>24,this.view[n+2]=255&i>>>16,this.view[n+1]=255&i>>>8,this.view[n]=255&i):(this.view[n]=255&i>>>24,this.view[n+1]=255&i>>>16,this.view[n+2]=255&i>>>8,this.view[n+3]=255&i,n+=4,this.view[n]=255&o>>>24,this.view[n+1]=255&o>>>16,this.view[n+2]=255&o>>>8,this.view[n+3]=255&o),s&&(this.offset+=8),this},i.writeLong=i.writeInt64,i.readInt64=function(t){var n,r,o,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+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}return n=0,r=0,this.littleEndian?(n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0,t+=4,r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0):(r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0,t+=4,n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0),o=new e(n,r,!1),i&&(this.offset+=8),o},i.readLong=i.readInt64,i.writeUint64=function(t,n){var r,o,i,s=void 0===n;if(s&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),(n+=8)>(r=this.buffer.byteLength)&&this.resize((r*=2)>n?r:n),n-=8,o=t.low,i=t.high,this.littleEndian?(this.view[n+3]=255&o>>>24,this.view[n+2]=255&o>>>16,this.view[n+1]=255&o>>>8,this.view[n]=255&o,n+=4,this.view[n+3]=255&i>>>24,this.view[n+2]=255&i>>>16,this.view[n+1]=255&i>>>8,this.view[n]=255&i):(this.view[n]=255&i>>>24,this.view[n+1]=255&i>>>16,this.view[n+2]=255&i>>>8,this.view[n+3]=255&i,n+=4,this.view[n]=255&o>>>24,this.view[n+1]=255&o>>>16,this.view[n+2]=255&o>>>8,this.view[n+3]=255&o),s&&(this.offset+=8),this},i.writeUInt64=i.writeUint64,i.readUint64=function(t){var n,r,o,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+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}return n=0,r=0,this.littleEndian?(n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0,t+=4,r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0):(r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0,t+=4,n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0),o=new e(n,r,!0),i&&(this.offset+=8),o},i.readUInt64=i.readUint64),i.writeFloat32=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=4)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=4,o(this.view,e,t,this.littleEndian,23,4),r&&(this.offset+=4),this},i.writeFloat=i.writeFloat32,i.readFloat32=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=r(this.view,e,this.littleEndian,23,4),n&&(this.offset+=4),t},i.readFloat=i.readFloat32,i.writeFloat64=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=8)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=8,o(this.view,e,t,this.littleEndian,52,8),r&&(this.offset+=8),this},i.writeDouble=i.writeFloat64,i.readFloat64=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}return t=r(this.view,e,this.littleEndian,52,8),n&&(this.offset+=8),t},i.readDouble=i.readFloat64,l.MAX_VARINT32_BYTES=5,l.calculateVarint32=function(e){return(e>>>=0)<128?1:e<16384?2:1<<21>e?3:1<<28>e?4:5},l.zigZagEncode32=function(e){return((e|=0)<<1^e>>31)>>>0},l.zigZagDecode32=function(e){return e>>>1^-(1&e)},i.writeVarint32=function(e,t){var n,r,o,i=void 0===t;if(i&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}for((t+=r=l.calculateVarint32(e))>(o=this.buffer.byteLength)&&this.resize((o*=2)>t?o:t),t-=r,e>>>=0;e>=128;)n=128|127&e,this.view[t++]=n,e>>>=7;return this.view[t++]=e,i?(this.offset=t,this):r},i.writeVarint32ZigZag=function(e,t){return this.writeVarint32(l.zigZagEncode32(e),t)},i.readVarint32=function(e){var t,n,r,o,i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}n=0,r=0;do{if(!this.noAssert&&e>this.limit)throw(o=Error("Truncated")).truncated=!0,o;t=this.view[e++],n<5&&(r|=(127&t)<<7*n),++n}while(128&t);return r|=0,i?(this.offset=e,r):{value:r,length:n}},i.readVarint32ZigZag=function(e){var t=this.readVarint32(e);return"object"==typeof t?t.value=l.zigZagDecode32(t.value):t=l.zigZagDecode32(t),t},e&&(l.MAX_VARINT64_BYTES=10,l.calculateVarint64=function(t){"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t));var n=t.toInt()>>>0,r=t.shiftRightUnsigned(28).toInt()>>>0,o=t.shiftRightUnsigned(56).toInt()>>>0;return 0==o?0==r?n<16384?n<128?1:2:1<<21>n?3:4:r<16384?r<128?5:6:1<<21>r?7:8:o<128?9:10},l.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()},l.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()},i.writeVarint64=function(t,n){var r,o,i,s,a,u=void 0===n;if(u&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}switch("number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),r=l.calculateVarint64(t),o=t.toInt()>>>0,i=t.shiftRightUnsigned(28).toInt()>>>0,s=t.shiftRightUnsigned(56).toInt()>>>0,(n+=r)>(a=this.buffer.byteLength)&&this.resize((a*=2)>n?a:n),n-=r,r){case 10:this.view[n+9]=1&s>>>7;case 9:this.view[n+8]=9!==r?128|s:127&s;case 8:this.view[n+7]=8!==r?128|i>>>21:127&i>>>21;case 7:this.view[n+6]=7!==r?128|i>>>14:127&i>>>14;case 6:this.view[n+5]=6!==r?128|i>>>7:127&i>>>7;case 5:this.view[n+4]=5!==r?128|i:127&i;case 4:this.view[n+3]=4!==r?128|o>>>21:127&o>>>21;case 3:this.view[n+2]=3!==r?128|o>>>14:127&o>>>14;case 2:this.view[n+1]=2!==r?128|o>>>7:127&o>>>7;case 1:this.view[n]=1!==r?128|o:127&o}return u?(this.offset+=r,this):r},i.writeVarint64ZigZag=function(e,t){return this.writeVarint64(l.zigZagEncode64(e),t)},i.readVarint64=function(t){var n,r,o,i,s,a,u=void 0===t;if(u&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}if(n=t,r=0,o=0,i=0,s=0,r=127&(s=this.view[t++]),128&s&&(r|=(127&(s=this.view[t++]))<<7,(128&s||this.noAssert&&void 0===s)&&(r|=(127&(s=this.view[t++]))<<14,(128&s||this.noAssert&&void 0===s)&&(r|=(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)&&(i=127&(s=this.view[t++]),(128&s||this.noAssert&&void 0===s)&&(i|=(127&(s=this.view[t++]))<<7,128&s||this.noAssert&&void 0===s))))))))))throw Error("Buffer overrun");return a=e.fromBits(r|o<<28,o>>>4|i<<24,!1),u?(this.offset=t,a):{value:a,length:t-n}},i.readVarint64ZigZag=function(t){var n=this.readVarint64(t);return n&&n.value instanceof e?n.value=l.zigZagDecode64(n.value):n=l.zigZagDecode64(n),n}),i.writeCString=function(e,n){var r,o,i,s=void 0===n;if(s&&(n=this.offset),o=e.length,!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");for(r=0;o>r;++r)if(0===e.charCodeAt(r))throw RangeError("Illegal str: Contains NULL-characters");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return o=c.calculateUTF16asUTF8(t(e))[1],n+=o+1,i=this.buffer.byteLength,n>i&&this.resize((i*=2)>n?i:n),n-=o+1,c.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),this.view[n++]=0,s?(this.offset=n,this):o},i.readCString=function(e){var t,r,o,i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return t=e,o=-1,c.decodeUTF8toUTF16(function(){if(0===o)return null;if(e>=this.limit)throw RangeError("Illegal range: Truncated data, "+e+" < "+this.limit);return 0===(o=this.view[e++])?null:o}.bind(this),r=n(),!0),i?(this.offset=e,r()):{string:r(),length:e-t}},i.writeIString=function(e,n){var r,o,i,s=void 0===n;if(s&&(n=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}if(o=n,r=c.calculateUTF16asUTF8(t(e),this.noAssert)[1],n+=4+r,i=this.buffer.byteLength,n>i&&this.resize((i*=2)>n?i:n),n-=4+r,this.littleEndian?(this.view[n+3]=255&r>>>24,this.view[n+2]=255&r>>>16,this.view[n+1]=255&r>>>8,this.view[n]=255&r):(this.view[n]=255&r>>>24,this.view[n+1]=255&r>>>16,this.view[n+2]=255&r>>>8,this.view[n+3]=255&r),n+=4,c.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),n!==o+4+r)throw RangeError("Illegal range: Truncated data, "+n+" == "+(n+4+r));return s?(this.offset=n,this):n-o},i.readIString=function(e){var t,n,r,o=void 0===e;if(o&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=e,n=this.readUint32(e),r=this.readUTF8String(n,l.METRICS_BYTES,e+=4),e+=r.length,o?(this.offset=e,r.string):{string:r.string,length:e-t}},l.METRICS_CHARS="c",l.METRICS_BYTES="b",i.writeUTF8String=function(e,n){var r,o,i,s=void 0===n;if(s&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return o=n,r=c.calculateUTF16asUTF8(t(e))[1],n+=r,i=this.buffer.byteLength,n>i&&this.resize((i*=2)>n?i:n),n-=r,c.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),s?(this.offset=n,this):n-o},i.writeString=i.writeUTF8String,l.calculateUTF8Chars=function(e){return c.calculateUTF16asUTF8(t(e))[0]},l.calculateUTF8Bytes=function(e){return c.calculateUTF16asUTF8(t(e))[1]},l.calculateString=l.calculateUTF8Bytes,i.readUTF8String=function(e,t,r){var o,i,s,a,u;if("number"==typeof t&&(r=t,t=void 0),(o=void 0===r)&&(r=this.offset),void 0===t&&(t=l.METRICS_CHARS),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");if(e|=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}if(s=0,a=r,t===l.METRICS_CHARS){if(i=n(),c.decodeUTF8(function(){return e>s&&r<this.limit?this.view[r++]:null}.bind(this),(function(e){++s,c.UTF8toUTF16(e,i)})),s!==e)throw RangeError("Illegal range: Truncated data, "+s+" == "+e);return o?(this.offset=r,i()):{string:i(),length:r-a}}if(t===l.METRICS_BYTES){if(!this.noAssert){if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+"+e+") <= "+this.buffer.byteLength)}if(u=r+e,c.decodeUTF8toUTF16(function(){return u>r?this.view[r++]:null}.bind(this),i=n(),this.noAssert),r!==u)throw RangeError("Illegal range: Truncated data, "+r+" == "+u);return o?(this.offset=r,i()):{string:i(),length:r-a}}throw TypeError("Unsupported metrics: "+t)},i.readString=i.readUTF8String,i.writeVString=function(e,n){var r,o,i,s,a=void 0===n;if(a&&(n=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}if(i=n,r=c.calculateUTF16asUTF8(t(e),this.noAssert)[1],o=l.calculateVarint32(r),n+=o+r,s=this.buffer.byteLength,n>s&&this.resize((s*=2)>n?s:n),n-=o+r,n+=this.writeVarint32(r,n),c.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),n!==i+r+o)throw RangeError("Illegal range: Truncated data, "+n+" == "+(n+r+o));return a?(this.offset=n,this):n-i},i.readVString=function(e){var t,n,r,o=void 0===e;if(o&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return t=e,n=this.readVarint32(e),r=this.readUTF8String(n.value,l.METRICS_BYTES,e+=n.length),e+=r.length,o?(this.offset=e,r.string):{string:r.string,length:e-t}},i.append=function(e,t,n){var r,o,i;if(("number"==typeof t||"string"!=typeof t)&&(n=t,t=void 0),(r=void 0===n)&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return e instanceof l||(e=l.wrap(e,t)),(o=e.limit-e.offset)<=0||((n+=o)>(i=this.buffer.byteLength)&&this.resize((i*=2)>n?i:n),n-=o,this.view.set(e.view.subarray(e.offset,e.limit),n),e.offset+=o,r&&(this.offset+=o)),this},i.appendTo=function(e,t){return e.append(this,t),this},i.assert=function(e){return this.noAssert=!e,this},i.capacity=function(){return this.buffer.byteLength},i.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},i.clone=function(e){var t=new l(0,this.littleEndian,this.noAssert);return e?(t.buffer=new ArrayBuffer(this.buffer.byteLength),t.view=new Uint8Array(t.buffer)):(t.buffer=this.buffer,t.view=this.view),t.offset=this.offset,t.markedOffset=this.markedOffset,t.limit=this.limit,t},i.compact=function(e,t){var n,r,o;if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}return 0===e&&t===this.buffer.byteLength?this:0===(n=t-e)?(this.buffer=s,this.view=null,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=0,this):(r=new ArrayBuffer(n),(o=new Uint8Array(r)).set(this.view.subarray(e,t)),this.buffer=r,this.view=o,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=n,this)},i.copy=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(e===t)return new l(0,this.littleEndian,this.noAssert);var n=t-e,r=new l(n,this.littleEndian,this.noAssert);return r.offset=0,r.limit=n,r.markedOffset>=0&&(r.markedOffset-=e),this.copyTo(r,0,e,t),r},i.copyTo=function(e,t,n,r){var o,i,s;if(!this.noAssert&&!l.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(t=(i=void 0===t)?e.offset:0|t,n=(o=void 0===n)?this.offset:0|n,r=void 0===r?this.limit:0|r,t<0||t>e.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+t+" <= "+e.buffer.byteLength);if(n<0||r>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+n+" <= "+this.buffer.byteLength);return 0===(s=r-n)?e:(e.ensureCapacity(t+s),e.view.set(this.view.subarray(n,r),t),o&&(this.offset+=s),i&&(e.offset+=s),this)},i.ensureCapacity=function(e){var t=this.buffer.byteLength;return e>t?this.resize((t*=2)>e?t:e):this},i.fill=function(e,t,n){var r=void 0===t;if(r&&(t=this.offset),"string"==typeof e&&e.length>0&&(e=e.charCodeAt(0)),void 0===t&&(t=this.offset),void 0===n&&(n=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal end: Not an integer");if(n>>>=0,t<0||t>n||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+n+" <= "+this.buffer.byteLength)}if(t>=n)return this;for(;n>t;)this.view[t++]=e;return r&&(this.offset=t),this},i.flip=function(){return this.limit=this.offset,this.offset=0,this},i.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},i.order=function(e){if(!this.noAssert&&"boolean"!=typeof e)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!e,this},i.LE=function(e){return this.littleEndian=void 0===e||!!e,this},i.BE=function(e){return this.littleEndian=void 0!==e&&!e,this},i.prepend=function(e,t,n){var r,o,i,s,a;if(("number"==typeof t||"string"!=typeof t)&&(n=t,t=void 0),(r=void 0===n)&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return e instanceof l||(e=l.wrap(e,t)),(o=e.limit-e.offset)<=0||((i=o-n)>0?(s=new ArrayBuffer(this.buffer.byteLength+i),(a=new Uint8Array(s)).set(this.view.subarray(n,this.buffer.byteLength),o),this.buffer=s,this.view=a,this.offset+=i,this.markedOffset>=0&&(this.markedOffset+=i),this.limit+=i,n+=i):new Uint8Array(this.buffer),this.view.set(e.view.subarray(e.offset,e.limit),n-o),e.offset=e.limit,r&&(this.offset-=o)),this},i.prependTo=function(e,t){return e.prepend(this,t),this},i.printDebug=function(e){"function"!=typeof e&&(e=console.log.bind(console)),e(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},i.remaining=function(){return this.limit-this.offset},i.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},i.resize=function(e){var t,n;if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal capacity: "+e+" (not an integer)");if((e|=0)<0)throw RangeError("Illegal capacity: 0 <= "+e)}return this.buffer.byteLength<e&&(t=new ArrayBuffer(e),(n=new Uint8Array(t)).set(this.view),this.buffer=t,this.view=n),this},i.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},i.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},i.slice=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var n=this.clone();return n.offset=e,n.limit=t,n},i.toBuffer=function(e){var t,n=this.offset,r=this.limit;if(!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: Not an integer");if(n>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal limit: Not an integer");if(r>>>=0,n<0||n>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+n+" <= "+r+" <= "+this.buffer.byteLength)}return e||0!==n||r!==this.buffer.byteLength?n===r?s:(t=new ArrayBuffer(r-n),new Uint8Array(t).set(new Uint8Array(this.buffer).subarray(n,r),0),t):this.buffer},i.toArrayBuffer=i.toBuffer,i.toString=function(e,t,n){if(void 0===e)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof e&&(n=t=e="utf8"),e){case"utf8":return this.toUTF8(t,n);case"base64":return this.toBase64(t,n);case"hex":return this.toHex(t,n);case"binary":return this.toBinary(t,n);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+e)}},u=function(){var e,t,n={},r=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],o=[];for(e=0,t=r.length;t>e;++e)o[r[e]]=e;return n.encode=function(e,t){for(var n,o;null!==(n=e());)t(r[63&n>>2]),o=(3&n)<<4,null!==(n=e())?(t(r[63&((o|=15&n>>4)|15&n>>4)]),o=(15&n)<<2,null!==(n=e())?(t(r[63&(o|3&n>>6)]),t(r[63&n])):(t(r[63&o]),t(61))):(t(r[63&o]),t(61),t(61))},n.decode=function(e,t){function n(e){throw Error("Illegal character code: "+e)}for(var r,i,s;null!==(r=e());)if(void 0===(i=o[r])&&n(r),null!==(r=e())&&(void 0===(s=o[r])&&n(r),t(i<<2>>>0|(48&s)>>4),null!==(r=e()))){if(void 0===(i=o[r])){if(61===r)break;n(r)}if(t((15&s)<<4>>>0|(60&i)>>2),null!==(r=e())){if(void 0===(s=o[r])){if(61===r)break;n(r)}t((3&i)<<6>>>0|s)}}},n.test=function(e){return/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)},n}(),i.toBase64=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),t|=0,(e|=0)<0||t>this.capacity||e>t)throw RangeError("begin, end");var r;return u.encode(function(){return t>e?this.view[e++]:null}.bind(this),r=n()),r()},l.fromBase64=function(e,n){if("string"!=typeof e)throw TypeError("str");var r=new l(e.length/4*3,n),o=0;return u.decode(t(e),(function(e){r.view[o++]=e})),r.limit=o,r},l.btoa=function(e){return l.fromBinary(e).toBase64()},l.atob=function(e){return l.fromBase64(e).toBinary()},i.toBinary=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),t|=0,(e|=0)<0||t>this.capacity()||e>t)throw RangeError("begin, end");if(e===t)return"";for(var n=[],r=[];t>e;)n.push(this.view[e++]),n.length>=1024&&(r.push(String.fromCharCode.apply(String,n)),n=[]);return r.join("")+String.fromCharCode.apply(String,n)},l.fromBinary=function(e,t){if("string"!=typeof e)throw TypeError("str");for(var n,r=0,o=e.length,i=new l(o,t);o>r;){if((n=e.charCodeAt(r))>255)throw RangeError("illegal char code: "+n);i.view[r++]=n}return i.limit=o,i},i.toDebug=function(e){for(var t,n=-1,r=this.buffer.byteLength,o="",i="",s="";r>n;){if(-1!==n&&(o+=(t=this.view[n])<16?"0"+t.toString(16).toUpperCase():t.toString(16).toUpperCase(),e&&(i+=t>32&&t<127?String.fromCharCode(t):".")),++n,e&&n>0&&n%16==0&&n!==r){for(;o.length<51;)o+=" ";s+=o+i+"\n",o=i=""}o+=n===this.offset&&n===this.limit?n===this.markedOffset?"!":"|":n===this.offset?n===this.markedOffset?"[":"<":n===this.limit?n===this.markedOffset?"]":">":n===this.markedOffset?"'":e||0!==n&&n!==r?" ":""}if(e&&" "!==o){for(;o.length<51;)o+=" ";s+=o+i+"\n"}return e?s:o},l.fromDebug=function(e,t,n){for(var r,o,i=e.length,s=new l(0|(i+1)/3,t,n),a=0,u=0,c=!1,d=!1,p=!1,h=!1,_=!1;i>a;){switch(r=e.charAt(a++)){case"!":if(!n){if(d||p||h){_=!0;break}d=p=h=!0}s.offset=s.markedOffset=s.limit=u,c=!1;break;case"|":if(!n){if(d||h){_=!0;break}d=h=!0}s.offset=s.limit=u,c=!1;break;case"[":if(!n){if(d||p){_=!0;break}d=p=!0}s.offset=s.markedOffset=u,c=!1;break;case"<":if(!n){if(d){_=!0;break}d=!0}s.offset=u,c=!1;break;case"]":if(!n){if(h||p){_=!0;break}h=p=!0}s.limit=s.markedOffset=u,c=!1;break;case">":if(!n){if(h){_=!0;break}h=!0}s.limit=u,c=!1;break;case"'":if(!n){if(p){_=!0;break}p=!0}s.markedOffset=u,c=!1;break;case" ":c=!1;break;default:if(!n&&c){_=!0;break}if(o=parseInt(r+e.charAt(a++),16),!n&&(isNaN(o)||o<0||o>255))throw TypeError("Illegal str: Not a debug encoded string");s.view[u++]=o,c=!0}if(_)throw TypeError("Illegal str: Invalid symbol at "+a)}if(!n){if(!d||!h)throw TypeError("Illegal str: Missing offset or limit");if(u<s.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+u+" < "+i)}return s},i.toHex=function(e,t){if(e=void 0===e?this.offset:e,t=void 0===t?this.limit:t,!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}for(var n,r=new Array(t-e);t>e;)(n=this.view[e++])<16?r.push("0",n.toString(16)):r.push(n.toString(16));return r.join("")},l.fromHex=function(e,t,n){var r,o,i,s,a;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(o=e.length,i=new l(0|o/2,t),s=0,a=0;o>s;s+=2){if(r=parseInt(e.substring(s,s+2),16),!n&&(!isFinite(r)||r<0||r>255))throw TypeError("Illegal str: Contains non-hex characters");i.view[a++]=r}return i.limit=a,i},c=function(){var e={MAX_CODEPOINT:1114111,encodeUTF8:function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)n<128?t(127&n):n<2048?(t(192|31&n>>6),t(128|63&n)):n<65536?(t(224|15&n>>12),t(128|63&n>>6),t(128|63&n)):(t(240|7&n>>18),t(128|63&n>>12),t(128|63&n>>6),t(128|63&n)),n=null},decodeUTF8:function(e,t){for(var n,r,o,i,s=function(e){e=e.slice(0,e.indexOf(null));var t=Error(e.toString());throw t.name="TruncatedError",t.bytes=e,t};null!==(n=e());)if(128&n)if(192==(224&n))null===(r=e())&&s([n,r]),t((31&n)<<6|63&r);else if(224==(240&n))(null===(r=e())||null===(o=e()))&&s([n,r,o]),t((15&n)<<12|(63&r)<<6|63&o);else{if(240!=(248&n))throw RangeError("Illegal starting byte: "+n);(null===(r=e())||null===(o=e())||null===(i=e()))&&s([n,r,o,i]),t((7&n)<<18|(63&r)<<12|(63&o)<<6|63&i)}else t(n)},UTF16toUTF8:function(e,t){for(var n,r=null;null!==(n=null!==r?r:e());)n>=55296&&n<=57343&&null!==(r=e())&&r>=56320&&r<=57343?(t(1024*(n-55296)+r-56320+65536),r=null):t(n);null!==r&&t(r)},UTF8toUTF16:function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)n<=65535?t(n):(t(55296+((n-=65536)>>10)),t(n%1024+56320)),n=null},encodeUTF16toUTF8:function(t,n){e.UTF16toUTF8(t,(function(t){e.encodeUTF8(t,n)}))},decodeUTF8toUTF16:function(t,n){e.decodeUTF8(t,(function(t){e.UTF8toUTF16(t,n)}))},calculateCodePoint:function(e){return e<128?1:e<2048?2:e<65536?3:4},calculateUTF8:function(e){for(var t,n=0;null!==(t=e());)n+=t<128?1:t<2048?2:t<65536?3:4;return n},calculateUTF16asUTF8:function(t){var n=0,r=0;return e.UTF16toUTF8(t,(function(e){++n,r+=e<128?1:e<2048?2:e<65536?3:4})),[n,r]}};return e}(),i.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 t>e?this.view[e++]:null}.bind(this),r=n())}catch(n){if(e!==t)throw RangeError("Illegal range: Truncated data, "+e+" != "+t)}return r()},l.fromUTF8=function(e,n,r){if(!r&&"string"!=typeof e)throw TypeError("Illegal str: Not a string");var o=new l(c.calculateUTF16asUTF8(t(e),!0)[1],n,r),i=0;return c.encodeUTF16toUTF8(t(e),(function(e){o.view[i++]=e})),o.limit=i,o},l}(t),r=function(t,n){var r,o,i={};return i.ByteBuffer=t,i.c=t,r=t,i.Long=n||null,i.VERSION="5.0.1",i.WIRE_TYPES={},i.WIRE_TYPES.VARINT=0,i.WIRE_TYPES.BITS64=1,i.WIRE_TYPES.LDELIM=2,i.WIRE_TYPES.STARTGROUP=3,i.WIRE_TYPES.ENDGROUP=4,i.WIRE_TYPES.BITS32=5,i.PACKABLE_WIRE_TYPES=[i.WIRE_TYPES.VARINT,i.WIRE_TYPES.BITS64,i.WIRE_TYPES.BITS32],i.TYPES={int32:{name:"int32",wireType:i.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:"uint32",wireType:i.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:"sint32",wireType:i.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:"int64",wireType:i.WIRE_TYPES.VARINT,defaultValue:i.Long?i.Long.ZERO:void 0},uint64:{name:"uint64",wireType:i.WIRE_TYPES.VARINT,defaultValue:i.Long?i.Long.UZERO:void 0},sint64:{name:"sint64",wireType:i.WIRE_TYPES.VARINT,defaultValue:i.Long?i.Long.ZERO:void 0},bool:{name:"bool",wireType:i.WIRE_TYPES.VARINT,defaultValue:!1},double:{name:"double",wireType:i.WIRE_TYPES.BITS64,defaultValue:0},string:{name:"string",wireType:i.WIRE_TYPES.LDELIM,defaultValue:""},bytes:{name:"bytes",wireType:i.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:"fixed32",wireType:i.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:"sfixed32",wireType:i.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:"fixed64",wireType:i.WIRE_TYPES.BITS64,defaultValue:i.Long?i.Long.UZERO:void 0},sfixed64:{name:"sfixed64",wireType:i.WIRE_TYPES.BITS64,defaultValue:i.Long?i.Long.ZERO:void 0},float:{name:"float",wireType:i.WIRE_TYPES.BITS32,defaultValue:0},enum:{name:"enum",wireType:i.WIRE_TYPES.VARINT,defaultValue:0},message:{name:"message",wireType:i.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:"group",wireType:i.WIRE_TYPES.STARTGROUP,defaultValue:null}},i.MAP_KEY_TYPES=[i.TYPES.int32,i.TYPES.sint32,i.TYPES.sfixed32,i.TYPES.uint32,i.TYPES.fixed32,i.TYPES.int64,i.TYPES.sint64,i.TYPES.sfixed64,i.TYPES.uint64,i.TYPES.fixed64,i.TYPES.bool,i.TYPES.string,i.TYPES.bytes],i.ID_MIN=1,i.ID_MAX=536870911,i.convertFieldsToCamelCase=!1,i.populateAccessors=!0,i.populateDefaults=!0,i.Util=function(){var e={};return e.IS_NODE=!("object"!=typeof process||process+""!="[object process]"||process.browser),e.XHR=function(){var e,t=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],n=null;for(e=0;e<t.length;e++){try{n=t[e]()}catch(e){continue}break}if(!n)throw Error("XMLHttpRequest is not supported");return n},e.fetch=function(t,n){if(n&&"function"!=typeof n&&(n=null),e.IS_NODE)if(n)g.readFile(t,(function(e,t){n(e?null:""+t)}));else try{return g.readFileSync(t)}catch(e){return null}else{var r=e.XHR();if(r.open("GET",t,!!n),r.setRequestHeader("Accept","text/plain"),"function"==typeof r.overrideMimeType&&r.overrideMimeType("text/plain"),!n)return r.send(null),200==r.status||0==r.status&&"string"==typeof r.responseText?r.responseText:null;if(r.onreadystatechange=function(){4==r.readyState&&(200==r.status||0==r.status&&"string"==typeof r.responseText?n(r.responseText):n(null))},4==r.readyState)return;r.send(null)}},e.toCamelCase=function(e){return e.replace(/_([a-zA-Z])/g,(function(e,t){return t.toUpperCase()}))},e}(),i.Lang={DELIM:/[\s\{\}=;:\[\],'"\(\)<>]/g,RULE:/^(?:required|optional|repeated|map)$/,TYPE:/^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,NAME:/^[a-zA-Z_][a-zA-Z_0-9]*$/,TYPEDEF:/^[a-zA-Z][a-zA-Z_0-9]*$/,TYPEREF:/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,FQTYPEREF:/^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,NUMBER:/^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,NUMBER_DEC:/^(?:[1-9][0-9]*|0)$/,NUMBER_HEX:/^0[xX][0-9a-fA-F]+$/,NUMBER_OCT:/^0[0-7]+$/,NUMBER_FLT:/^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,BOOL:/^(?:true|false)$/i,ID:/^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,NEGID:/^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,WHITESPACE:/\s/,STRING:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,STRING_DQ:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,STRING_SQ:/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g},i.DotProto=function(e,t){function n(e,n){var r=-1,o=1;if("-"==e.charAt(0)&&(o=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))r=parseInt(e);else if(t.NUMBER_HEX.test(e))r=parseInt(e.substring(2),16);else{if(!t.NUMBER_OCT.test(e))throw Error("illegal id value: "+(o<0?"-":"")+e);r=parseInt(e.substring(1),8)}if(r=0|o*r,!n&&r<0)throw Error("illegal id value: "+(o<0?"-":"")+e);return r}function r(e){var n=1;if("-"==e.charAt(0)&&(n=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))return n*parseInt(e,10);if(t.NUMBER_HEX.test(e))return n*parseInt(e.substring(2),16);if(t.NUMBER_OCT.test(e))return n*parseInt(e.substring(1),8);if("inf"===e)return 1/0*n;if("nan"===e)return NaN;if(t.NUMBER_FLT.test(e))return n*parseFloat(e);throw Error("illegal number value: "+(n<0?"-":"")+e)}function o(e,t,n){void 0===e[t]?e[t]=n:(Array.isArray(e[t])||(e[t]=[e[t]]),e[t].push(n))}var i,s,a={},u=function(e){this.source=e+"",this.index=0,this.line=1,this.stack=[],this._stringOpen=null},c=u.prototype;return c._readString=function(){var e,n='"'===this._stringOpen?t.STRING_DQ:t.STRING_SQ;if(n.lastIndex=this.index-1,!(e=n.exec(this.source)))throw Error("unterminated string");return this.index=n.lastIndex,this.stack.push(this._stringOpen),this._stringOpen=null,e[1]},c.next=function(){var e,n,r,o,i;if(this.stack.length>0)return this.stack.shift();if(this.index>=this.source.length)return null;if(null!==this._stringOpen)return this._readString();do{for(e=!1;t.WHITESPACE.test(r=this.source.charAt(this.index));)if("\n"===r&&++this.line,++this.index===this.source.length)return null;if("/"===this.source.charAt(this.index))if(++this.index,"/"===this.source.charAt(this.index)){for(;"\n"!==this.source.charAt(++this.index);)if(this.index==this.source.length)return null;++this.index,++this.line,e=!0}else{if("*"!==(r=this.source.charAt(this.index)))return"/";do{if("\n"===r&&++this.line,++this.index===this.source.length)return null;n=r,r=this.source.charAt(this.index)}while("*"!==n||"/"!==r);++this.index,e=!0}}while(e);if(this.index===this.source.length)return null;if(o=this.index,t.DELIM.lastIndex=0,!t.DELIM.test(this.source.charAt(o++)))for(;o<this.source.length&&!t.DELIM.test(this.source.charAt(o));)++o;return('"'===(i=this.source.substring(this.index,this.index=o))||"'"===i)&&(this._stringOpen=i),i},c.peek=function(){if(0===this.stack.length){var e=this.next();if(null===e)return null;this.stack.push(e)}return this.stack[0]},c.skip=function(e){var t=this.next();if(t!==e)throw Error("illegal '"+t+"', '"+e+"' expected")},c.omit=function(e){return this.peek()===e&&(this.next(),!0)},c.toString=function(){return"Tokenizer ("+this.index+"/"+this.source.length+" at line "+this.line+")"},a.Tokenizer=u,i=function(e){this.tn=new u(e),this.proto3=!1},(s=i.prototype).parse=function(){var e,n={name:"[ROOT]",package:null,messages:[],enums:[],imports:[],options:{},services:[]},r=!0;try{for(;e=this.tn.next();)switch(e){case"package":if(!r||null!==n.package)throw Error("unexpected 'package'");if(e=this.tn.next(),!t.TYPEREF.test(e))throw Error("illegal package name: "+e);this.tn.skip(";"),n.package=e;break;case"import":if(!r)throw Error("unexpected 'import'");"public"===(e=this.tn.peek())&&this.tn.next(),e=this._readString(),this.tn.skip(";"),n.imports.push(e);break;case"syntax":if(!r)throw Error("unexpected 'syntax'");this.tn.skip("="),"proto3"===(n.syntax=this._readString())&&(this.proto3=!0),this.tn.skip(";");break;case"message":this._parseMessage(n,null),r=!1;break;case"enum":this._parseEnum(n),r=!1;break;case"option":this._parseOption(n);break;case"service":this._parseService(n);break;case"extend":this._parseExtend(n);break;default:throw Error("unexpected '"+e+"'")}}catch(e){throw e.message="Parse error at line "+this.tn.line+": "+e.message,e}return delete n.name,n},i.parse=function(e){return new i(e).parse()},s._readString=function(){var e,t,n="";do{if("'"!==(t=this.tn.next())&&'"'!==t)throw Error("illegal string delimiter: "+t);n+=this.tn.next(),this.tn.skip(t),e=this.tn.peek()}while('"'===e||'"'===e);return n},s._readValue=function(e){var n=this.tn.peek();if('"'===n||"'"===n)return this._readString();if(this.tn.next(),t.NUMBER.test(n))return r(n);if(t.BOOL.test(n))return"true"===n.toLowerCase();if(e&&t.TYPEREF.test(n))return n;throw Error("illegal value: "+n)},s._parseOption=function(e,n){var r,o=this.tn.next(),i=!1;if("("===o&&(i=!0,o=this.tn.next()),!t.TYPEREF.test(o))throw Error("illegal option name: "+o);r=o,i&&(this.tn.skip(")"),r="("+r+")",o=this.tn.peek(),t.FQTYPEREF.test(o)&&(r+=o,this.tn.next())),this.tn.skip("="),this._parseOptionValue(e,r),n||this.tn.skip(";")},s._parseOptionValue=function(e,n){var r=this.tn.peek();if("{"!==r)o(e.options,n,this._readValue(!0));else for(this.tn.skip("{");"}"!==(r=this.tn.next());){if(!t.NAME.test(r))throw Error("illegal option name: "+n+"."+r);this.tn.omit(":")?o(e.options,n+"."+r,this._readValue(!0)):this._parseOptionValue(e,n+"."+r)}},s._parseService=function(e){var n,r=this.tn.next();if(!t.NAME.test(r))throw Error("illegal service name at line "+this.tn.line+": "+r);for(n={name:r,rpc:{},options:{}},this.tn.skip("{");"}"!==(r=this.tn.next());)if("option"===r)this._parseOption(n);else{if("rpc"!==r)throw Error("illegal service token: "+r);this._parseServiceRPC(n)}this.tn.omit(";"),e.services.push(n)},s._parseServiceRPC=function(e){var n,r,o="rpc",i=this.tn.next();if(!t.NAME.test(i))throw Error("illegal rpc service method name: "+i);if(n=i,r={request:null,response:null,request_stream:!1,response_stream:!1,options:{}},this.tn.skip("("),"stream"===(i=this.tn.next()).toLowerCase()&&(r.request_stream=!0,i=this.tn.next()),!t.TYPEREF.test(i))throw Error("illegal rpc service request type: "+i);if(r.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()&&(r.response_stream=!0,i=this.tn.next()),r.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(r)}this.tn.omit(";")}else this.tn.skip(";");void 0===e[o]&&(e[o]={}),e[o][n]=r},s._parseMessage=function(e,r){var o=!!r,i=this.tn.next(),s={name:"",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!t.NAME.test(i))throw Error("illegal "+(o?"group":"message")+" name: "+i);for(s.name=i,o&&(this.tn.skip("="),r.id=n(this.tn.next()),s.isGroup=!0),"["===(i=this.tn.peek())&&r&&this._parseFieldOptions(r),this.tn.skip("{");"}"!==(i=this.tn.next());)if(t.RULE.test(i))this._parseMessageField(s,i);else if("oneof"===i)this._parseMessageOneOf(s);else if("enum"===i)this._parseEnum(s);else if("message"===i)this._parseMessage(s);else if("option"===i)this._parseOption(s);else if("service"===i)this._parseService(s);else if("extensions"===i)s.extensions=this._parseExtensionRanges();else if("reserved"===i)this._parseIgnored();else if("extend"===i)this._parseExtend(s);else{if(!t.TYPEREF.test(i))throw Error("illegal message token: "+i);if(!this.proto3)throw Error("illegal field rule: "+i);this._parseMessageField(s,"optional",i)}return this.tn.omit(";"),e.messages.push(s),s},s._parseIgnored=function(){for(;";"!==this.tn.peek();)this.tn.next();this.tn.skip(";")},s._parseMessageField=function(e,r,o){var i,s,a;if(!t.RULE.test(r))throw Error("illegal message field rule: "+r);if(i={rule:r,type:"",name:"",options:{},id:0},"map"===r){if(o)throw Error("illegal type: "+o);if(this.tn.skip("<"),s=this.tn.next(),!t.TYPE.test(s)&&!t.TYPEREF.test(s))throw Error("illegal message field type: "+s);if(i.keytype=s,this.tn.skip(","),s=this.tn.next(),!t.TYPE.test(s)&&!t.TYPEREF.test(s))throw Error("illegal message field: "+s);if(i.type=s,this.tn.skip(">"),s=this.tn.next(),!t.NAME.test(s))throw Error("illegal message field name: "+s);i.name=s,this.tn.skip("="),i.id=n(this.tn.next()),"["===(s=this.tn.peek())&&this._parseFieldOptions(i),this.tn.skip(";")}else if("group"===(o=void 0!==o?o:this.tn.next())){if(a=this._parseMessage(e,i),!/^[A-Z]/.test(a.name))throw Error("illegal group name: "+a.name);i.type=a.name,i.name=a.name.toLowerCase(),this.tn.omit(";")}else{if(!t.TYPE.test(o)&&!t.TYPEREF.test(o))throw Error("illegal message field type: "+o);if(i.type=o,s=this.tn.next(),!t.NAME.test(s))throw Error("illegal message field name: "+s);i.name=s,this.tn.skip("="),i.id=n(this.tn.next()),"["===(s=this.tn.peek())&&this._parseFieldOptions(i),this.tn.skip(";")}return e.fields.push(i),i},s._parseMessageOneOf=function(e){var n,r,o,i=this.tn.next();if(!t.NAME.test(i))throw Error("illegal oneof name: "+i);for(r=i,o=[],this.tn.skip("{");"}"!==(i=this.tn.next());)(n=this._parseMessageField(e,"optional",i)).oneof=r,o.push(n.id);this.tn.omit(";"),e.oneofs[r]=o},s._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()},s._parseEnum=function(e){var r,o={name:"",values:[],options:{}},i=this.tn.next();if(!t.NAME.test(i))throw Error("illegal name: "+i);for(o.name=i,this.tn.skip("{");"}"!==(i=this.tn.next());)if("option"===i)this._parseOption(o);else{if(!t.NAME.test(i))throw Error("illegal name: "+i);this.tn.skip("="),r={name:i,id:n(this.tn.next(),!0)},"["===(i=this.tn.peek())&&this._parseFieldOptions({options:{}}),this.tn.skip(";"),o.values.push(r)}this.tn.omit(";"),e.enums.push(o)},s._parseExtensionRanges=function(){var t,n,o,i=[];do{for(n=[];;){switch(t=this.tn.next()){case"min":o=e.ID_MIN;break;case"max":o=e.ID_MAX;break;default:o=r(t)}if(n.push(o),2===n.length)break;if("to"!==this.tn.peek()){n.push(o);break}this.tn.next()}i.push(n)}while(this.tn.omit(","));return this.tn.skip(";"),i},s._parseExtend=function(e){var n,r=this.tn.next();if(!t.TYPEREF.test(r))throw Error("illegal extend reference: "+r);for(n={ref:r,fields:[]},this.tn.skip("{");"}"!==(r=this.tn.next());)if(t.RULE.test(r))this._parseMessageField(n,r);else{if(!t.TYPEREF.test(r))throw Error("illegal extend token: "+r);if(!this.proto3)throw Error("illegal field rule: "+r);this._parseMessageField(n,"optional",r)}return this.tn.omit(";"),e.messages.push(n),n},s.toString=function(){return"Parser at line "+this.tn.line},a.Parser=i,a}(i,i.Lang),i.Reflect=function(e){function n(t,n){if(t&&"number"==typeof t.low&&"number"==typeof t.high&&"boolean"==typeof t.unsigned&&t.low==t.low&&t.high==t.high)return new e.Long(t.low,t.high,void 0===n?t.unsigned:n);if("string"==typeof t)return e.Long.fromString(t,n||!1,10);if("number"==typeof t)return e.Long.fromNumber(t,n||!1);throw Error("not convertible to Long")}function o(t,n){var r=n.readVarint32(),i=7&r,s=r>>>3;switch(i){case e.WIRE_TYPES.VARINT:do{r=n.readUint8()}while(!(128&~r));break;case e.WIRE_TYPES.BITS64:n.offset+=8;break;case e.WIRE_TYPES.LDELIM:r=n.readVarint32(),n.offset+=r;break;case e.WIRE_TYPES.STARTGROUP:o(s,n);break;case e.WIRE_TYPES.ENDGROUP:if(s===t)return!1;throw Error("Illegal GROUPEND after unknown group: "+s+" ("+t+" expected)");case e.WIRE_TYPES.BITS32:n.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+t+": "+i)}return!0}var i,s,a,u,c,l,d,p,h,_,g,f,E,I,T,v,C={},R=function(e,t,n){this.builder=e,this.parent=t,this.name=n,this.className},y=R.prototype;return y.fqn=function(){for(var e=this.name,t=this;null!=(t=t.parent);)e=t.name+"."+e;return e},y.toString=function(e){return(e?this.className+" ":"")+this.fqn()},y.build=function(){throw Error(this.toString(!0)+" cannot be built directly")},C.T=R,i=function(e,t,n,r,o){R.call(this,e,t,n),this.className="Namespace",this.children=[],this.options=r||{},this.syntax=o||"proto2"},(s=i.prototype=Object.create(R.prototype)).getChildren=function(e){var t,n,r;if(null==(e=e||null))return this.children.slice();for(t=[],n=0,r=this.children.length;r>n;++n)this.children[n]instanceof e&&t.push(this.children[n]);return t},s.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)},s.getChild=function(e){var t,n,r="number"==typeof e?"id":"name";for(t=0,n=this.children.length;n>t;++t)if(this.children[t][r]===e)return this.children[t];return null},s.resolve=function(e,t){var n,r="string"==typeof e?e.split("."):e,o=this,i=0;if(""===r[i]){for(;null!==o.parent;)o=o.parent;i++}do{do{if(!(o instanceof C.Namespace)){o=null;break}if(!((n=o.getChild(r[i]))&&n instanceof C.T&&(!t||n instanceof C.Namespace))){o=null;break}o=n,i++}while(i<r.length);if(null!=o)break;if(null!==this.parent)return this.parent.resolve(e,t)}while(null!=o);return o},s.qn=function(e){var t,n,r=[],o=e;do{r.unshift(o.name),o=o.parent}while(null!==o);for(t=1;t<=r.length;t++)if(n=r.slice(r.length-t),e===this.resolve(n,e instanceof C.Namespace))return n.join(".");return e.fqn()},s.build=function(){var e,t,n,r={},o=this.children;for(t=0,n=o.length;n>t;++t)(e=o[t])instanceof i&&(r[e.name]=e.build());return Object.defineProperty&&Object.defineProperty(r,"$options",{value:this.buildOpt()}),r},s.buildOpt=function(){var e,t,n,r,o={},i=Object.keys(this.options);for(e=0,t=i.length;t>e;++e)n=i[e],r=this.options[i[e]],o[n]=r;return o},s.getOption=function(e){return void 0===e?this.options:void 0!==this.options[e]?this.options[e]:null},C.Namespace=i,a=function(t,n,r,o){if(this.type=t,this.resolvedType=n,this.isMapKey=r,this.syntax=o,r&&e.MAP_KEY_TYPES.indexOf(t)<0)throw Error("Invalid map key type: "+t.name)},u=a.prototype,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},u.verifyValue=function(r){var o,i,s,a=function(e,t){throw Error("Illegal value for "+this.toString(!0)+" of type "+this.type.name+": "+e+" ("+t+")")}.bind(this);switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:return("number"!=typeof r||r==r&&r%1!=0)&&a(typeof r,"not an integer"),r>4294967295?0|r:r;case e.TYPES.uint32:case e.TYPES.fixed32:return("number"!=typeof r||r==r&&r%1!=0)&&a(typeof r,"not an integer"),r<0?r>>>0:r;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:if(e.Long)try{return n(r,!1)}catch(e){a(typeof r,e.message)}else a(typeof r,"requires Long.js");case e.TYPES.uint64:case e.TYPES.fixed64:if(e.Long)try{return n(r,!0)}catch(e){a(typeof r,e.message)}else a(typeof r,"requires Long.js");case e.TYPES.bool:return"boolean"!=typeof r&&a(typeof r,"not a boolean"),r;case e.TYPES.float:case e.TYPES.double:return"number"!=typeof r&&a(typeof r,"not a number"),r;case e.TYPES.string:return"string"==typeof r||r&&r instanceof String||a(typeof r,"not a string"),""+r;case e.TYPES.bytes:return t.isByteBuffer(r)?r:t.wrap(r);case e.TYPES.enum:for(o=this.resolvedType.getChildren(e.Reflect.Enum.Value),s=0;s<o.length;s++){if(o[s].name==r)return o[s].id;if(o[s].id==r)return o[s].id}if("proto3"===this.syntax)return("number"!=typeof r||r==r&&r%1!=0)&&a(typeof r,"not an integer"),(r>4294967295||r<0)&&a(typeof r,"not in range for uint32"),r;a(r,"not a valid enum value");case e.TYPES.group:case e.TYPES.message:if(r&&"object"==typeof r||a(typeof r,"object expected"),r instanceof this.resolvedType.clazz)return r;if(r instanceof e.Builder.Message){for(s in i={},r)r.hasOwnProperty(s)&&(i[s]=r[s]);r=i}return new this.resolvedType.clazz(r)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+r+" (undefined type "+this.type+")")},u.calculateLength=function(t,n){if(null===n)return 0;var o;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 o=r.calculateUTF8Bytes(n),r.calculateVarint32(o)+o;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 o=this.resolvedType.calculate(n),r.calculateVarint32(o)+o;case e.TYPES.group:return(o=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,o){var i,s;if(null===n)return o;switch(this.type){case e.TYPES.int32:n<0?o.writeVarint64(n):o.writeVarint32(n);break;case e.TYPES.uint32:o.writeVarint32(n);break;case e.TYPES.sint32:o.writeVarint32ZigZag(n);break;case e.TYPES.fixed32:o.writeUint32(n);break;case e.TYPES.sfixed32:o.writeInt32(n);break;case e.TYPES.int64:case e.TYPES.uint64:o.writeVarint64(n);break;case e.TYPES.sint64:o.writeVarint64ZigZag(n);break;case e.TYPES.fixed64:o.writeUint64(n);break;case e.TYPES.sfixed64:o.writeInt64(n);break;case e.TYPES.bool:"string"==typeof n?o.writeVarint32("false"===n.toLowerCase()?0:!!n):o.writeVarint32(n?1:0);break;case e.TYPES.enum:o.writeVarint32(n);break;case e.TYPES.float:o.writeFloat32(n);break;case e.TYPES.double:o.writeFloat64(n);break;case e.TYPES.string:o.writeVString(n);break;case e.TYPES.bytes:if(n.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+n.remaining()+" bytes remaining");i=n.offset,o.writeVarint32(n.remaining()),o.append(n),n.offset=i;break;case e.TYPES.message:s=(new r).LE(),this.resolvedType.encode(n,s),o.writeVarint32(s.offset),o.append(s.flip());break;case e.TYPES.group:this.resolvedType.encode(n,o),o.writeVarint32(t<<3|e.WIRE_TYPES.ENDGROUP);break;default:throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+n+" (unknown type)")}return o},u.decode=function(t,n,r){if(n!=this.type.wireType)throw Error("Unexpected wire type for element");var o,i;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(i=t.readVarint32(),t.remaining()<i)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+i+" required but got only "+t.remaining());return(o=t.clone()).limit=o.offset+i,t.offset+=i,o;case e.TYPES.message:return i=t.readVarint32(),this.resolvedType.decode(t,i);case e.TYPES.group:return this.resolvedType.decode(t,-1,r)}throw Error("[INTERNAL] Illegal decode type")},u.valueFromString=function(t){if(!this.isMapKey)throw Error("valueFromString() called on non-map-key element");switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return this.verifyValue(parseInt(t));case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return this.verifyValue(t);case e.TYPES.bool:return"true"===t;case e.TYPES.string:return this.verifyValue(t);case e.TYPES.bytes:return r.fromBinary(t)}},u.valueToString=function(t){if(!this.isMapKey)throw Error("valueToString() called on non-map-key element");return this.type===e.TYPES.bytes?t.toString("binary"):t.toString()},C.Element=a,c=function(e,t,n,r,o,s){i.call(this,e,t,n,r,s),this.className="Message",this.extensions=void 0,this.clazz=null,this.isGroup=!!o,this._fields=null,this._fieldsById=null,this._fieldsByName=null},(l=c.prototype=Object.create(i.prototype)).build=function(n){var o,i,s,a;if(this.clazz&&!n)return this.clazz;for(o=function(e,n){function o(t,n,i,s){var a,u,c,l,d,p,h;if(null===t||"object"!=typeof t)return s&&s instanceof e.Reflect.Enum&&null!==(a=e.Reflect.Enum.getName(s.object,t))?a:t;if(r.isByteBuffer(t))return n?t.toBase64():t.toBuffer();if(e.Long.isLong(t))return i?t.toString():e.Long.fromValue(t);if(Array.isArray(t))return u=[],t.forEach((function(e,t){u[t]=o(e,n,i,s)})),u;if(u={},t instanceof e.Map){for(l=(c=t.entries()).next();!l.done;l=c.next())u[t.keyElem.valueToString(l.value[0])]=o(l.value[1],n,i,t.valueElem.resolvedType);return u}for(h in d=t.$type,p=void 0,t)t.hasOwnProperty(h)&&(u[h]=d&&(p=d.getChild(h))?o(t[h],n,i,p.resolvedType):o(t[h],n,i));return u}var i,s,a=n.getChildren(e.Reflect.Message.Field),u=n.getChildren(e.Reflect.Message.OneOf),c=function(t){var o,i,s,l;for(e.Builder.Message.call(this),o=0,i=u.length;i>o;++o)this[u[o].name]=null;for(o=0,i=a.length;i>o;++o)this[(s=a[o]).name]=s.repeated?[]:s.map?new e.Map(s):null,!s.required&&"proto3"!==n.syntax||null===s.defaultValue||(this[s.name]=s.defaultValue);if(arguments.length>0)if(1!==arguments.length||null===t||"object"!=typeof t||!("function"!=typeof t.encode||t instanceof c)||Array.isArray(t)||t instanceof e.Map||r.isByteBuffer(t)||t instanceof ArrayBuffer||e.Long&&t instanceof e.Long)for(o=0,i=arguments.length;i>o;++o)void 0!==(l=arguments[o])&&this.$set(a[o].name,l);else this.$set(t)},l=c.prototype=Object.create(e.Builder.Message.prototype);for(l.add=function(t,r,o){var i=n._fieldsByName[t];if(!o){if(!i)throw Error(this+"#"+t+" is undefined");if(!(i instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+i.toString(!0));if(!i.repeated)throw Error(this+"#"+t+" is not a repeated field");r=i.verifyValue(r,!0)}return null===this[t]&&(this[t]=[]),this[t].push(r),this},l.$add=l.add,l.set=function(t,r,o){var i,s,a;if(t&&"object"==typeof t){for(i in o=r,t)t.hasOwnProperty(i)&&void 0!==(r=t[i])&&this.$set(i,r,o);return this}if(s=n._fieldsByName[t],o)this[t]=r;else{if(!s)throw Error(this+"#"+t+" is not a field: undefined");if(!(s instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+s.toString(!0));this[s.name]=r=s.verifyValue(r)}return s&&s.oneof&&(a=this[s.oneof.name],null!==r?(null!==a&&a!==s.name&&(this[a]=null),this[s.oneof.name]=s.name):a===t&&(this[s.oneof.name]=null)),this},l.$set=l.set,l.get=function(t,r){if(r)return this[t];var o=n._fieldsByName[t];if(!(o&&o instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: undefined");if(!(o instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+o.toString(!0));return this[o.name]},l.$get=l.get,i=0;i<a.length;i++)(s=a[i])instanceof e.Reflect.Message.ExtensionField||n.builder.options.populateAccessors&&function(e){var t,r,o,i=e.originalName.replace(/(_[a-zA-Z])/g,(function(e){return e.toUpperCase().replace("_","")}));i=i.substring(0,1).toUpperCase()+i.substring(1),t=e.originalName.replace(/([A-Z])/g,(function(e){return"_"+e})),r=function(t,n){return this[e.name]=n?t:e.verifyValue(t),this},o=function(){return this[e.name]},null===n.getChild("set"+i)&&(l["set"+i]=r),null===n.getChild("set_"+t)&&(l["set_"+t]=r),null===n.getChild("get"+i)&&(l["get"+i]=o),null===n.getChild("get_"+t)&&(l["get_"+t]=o)}(s);return l.encode=function(e,r){var o,i;"boolean"==typeof e&&(r=e,e=void 0),o=!1,e||(e=new t,o=!0),i=e.littleEndian;try{return n.encode(this,e.LE(),r),(o?e.flip():e).LE(i)}catch(t){throw e.LE(i),t}},c.encode=function(e,t,n){return new c(e).encode(t,n)},l.calculate=function(){return n.calculate(this)},l.encodeDelimited=function(e){var t,o=!1;return e||(e=new r,o=!0),t=(new r).LE(),n.encode(this,t).flip(),e.writeVarint32(t.remaining()),e.append(t),o?e.flip():e},l.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toArrayBuffer()),e}},l.toArrayBuffer=l.encodeAB,l.encodeNB=function(){try{return this.encode().toBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBuffer()),e}},l.toBuffer=l.encodeNB,l.encode64=function(){try{return this.encode().toBase64()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBase64()),e}},l.toBase64=l.encode64,l.encodeHex=function(){try{return this.encode().toHex()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toHex()),e}},l.toHex=l.encodeHex,l.toRaw=function(e,t){return o(this,!!e,!!t,this.$type)},l.encodeJSON=function(){return JSON.stringify(o(this,!0,!0,this.$type))},c.decode=function(e,t){var o,i;"string"==typeof e&&(e=r.wrap(e,t||"base64")),o=(e=r.isByteBuffer(e)?e:r.wrap(e)).littleEndian;try{return i=n.decode(e.LE()),e.LE(o),i}catch(t){throw e.LE(o),t}},c.decodeDelimited=function(e,t){var o,i,s;if("string"==typeof e&&(e=r.wrap(e,t||"base64")),(e=r.isByteBuffer(e)?e:r.wrap(e)).remaining()<1)return null;if(o=e.offset,i=e.readVarint32(),e.remaining()<i)return e.offset=o,null;try{return s=n.decode(e.slice(e.offset,e.offset+i).LE()),e.offset+=i,s}catch(t){throw e.offset+=i,t}},c.decode64=function(e){return c.decode(e,"base64")},c.decodeHex=function(e){return c.decode(e,"hex")},c.decodeJSON=function(e){return new c(JSON.parse(e))},l.toString=function(){return n.toString()},Object.defineProperty&&(Object.defineProperty(c,"$options",{value:n.buildOpt()}),Object.defineProperty(l,"$options",{value:c.$options}),Object.defineProperty(c,"$type",{value:n}),Object.defineProperty(l,"$type",{value:n})),c}(e,this),this._fields=[],this._fieldsById={},this._fieldsByName={},s=0,a=this.children.length;a>s;s++)if((i=this.children[s])instanceof g||i instanceof c||i instanceof I){if(o.hasOwnProperty(i.name))throw Error("Illegal reflect child of "+this.toString(!0)+": "+i.toString(!0)+" cannot override static property '"+i.name+"'");o[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||i instanceof E))throw Error("Illegal reflect child of "+this.toString(!0)+": "+this.children[s].toString(!0));return this.clazz=o},l.encode=function(e,t,n){var r,o,i,s,a,u=null;for(i=0,s=this._fields.length;s>i;++i)o=e[(r=this._fields[i]).name],r.required&&null===o?null===u&&(u=r):r.encode(n?o:r.verifyValue(o),t,e);if(null!==u)throw(a=Error("Missing at least one required field for "+this.toString(!0)+": "+u)).encoded=t,a;return t},l.calculate=function(e){for(var t,n,r=0,o=0,i=this._fields.length;i>o;++o){if(n=e[(t=this._fields[o]).name],t.required&&null===n)throw Error("Missing at least one required field for "+this.toString(!0)+": "+t);r+=t.calculate(n,e)}return r},l.decode=function(t,n,r){var i,s,a,u,c,l,d,p,h,_,g,f;for(n="number"==typeof n?n:-1,c=t.offset,l=new this.clazz;t.offset<c+n||-1===n&&t.remaining()>0;){if(a=(i=t.readVarint32())>>>3,(s=7&i)===e.WIRE_TYPES.ENDGROUP){if(a!==r)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+a+" ("+(r?r+" expected":"not a group")+")");break}if(u=this._fieldsById[a])u.repeated&&!u.options.packed?l[u.name].push(u.decode(s,t)):u.map?(p=u.decode(s,t),l[u.name].set(p[0],p[1])):(l[u.name]=u.decode(s,t),u.oneof&&(null!==(h=l[u.oneof.name])&&h!==u.name&&(l[h]=null),l[u.oneof.name]=u.name));else switch(s){case e.WIRE_TYPES.VARINT:t.readVarint32();break;case e.WIRE_TYPES.BITS32:t.offset+=4;break;case e.WIRE_TYPES.BITS64:t.offset+=8;break;case e.WIRE_TYPES.LDELIM:d=t.readVarint32(),t.offset+=d;break;case e.WIRE_TYPES.STARTGROUP:for(;o(a,t););break;default:throw Error("Illegal wire type for unknown field "+a+" in "+this.toString(!0)+"#decode: "+s)}}for(_=0,g=this._fields.length;g>_;++_)if(null===l[(u=this._fields[_]).name])if("proto3"===this.syntax)l[u.name]=u.defaultValue;else{if(u.required)throw(f=Error("Missing at least one required field for "+this.toString(!0)+": "+u.name)).decoded=l,f;e.populateDefaults&&null!==u.defaultValue&&(l[u.name]=u.defaultValue)}return l},C.Message=c,d=function(t,n,r,o,i,s,a,u,l,d){R.call(this,t,n,s),this.className="Message.Field",this.required="required"===r,this.repeated="repeated"===r,this.map="map"===r,this.keyType=o||null,this.type=i,this.resolvedType=null,this.id=a,this.options=u||{},this.defaultValue=null,this.oneof=l||null,this.syntax=d||"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=d.prototype=Object.create(R.prototype)).build=function(){this.element=new a(this.type,this.resolvedType,!1,this.syntax),this.map&&(this.keyElement=new a(this.keyType,void 0,!0,this.syntax)),"proto3"!==this.syntax||this.repeated||this.map?void 0!==this.options.default&&(this.defaultValue=this.verifyValue(this.options.default)):this.defaultValue=a.defaultFieldValue(this.type)},p.verifyValue=function(t,n){var r,o,i;if(n=n||!1,r=function(e,t){throw Error("Illegal value for "+this.toString(!0)+" of type "+this.type.name+": "+e+" ("+t+")")}.bind(this),null===t)return this.required&&r(typeof t,"required"),"proto3"===this.syntax&&this.type!==e.TYPES.message&&r(typeof t,"proto3 field without field presence cannot be null"),null;if(this.repeated&&!n){for(Array.isArray(t)||(t=[t]),i=[],o=0;o<t.length;o++)i.push(this.element.verifyValue(t[o]));return i}return this.map&&!n?t instanceof e.Map?t:(t instanceof Object||r(typeof t,"expected ProtoBuf.Map or raw object for map field"),new e.Map(this,t)):(!this.repeated&&Array.isArray(t)&&r(typeof t,"no array expected"),this.element.verifyValue(t))},p.hasWirePresence=function(t,n){if("proto3"!==this.syntax)return null!==t;if(this.oneof&&n[this.oneof.name]===this.name)return!0;switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return 0!==t;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return 0!==t.low||0!==t.high;case e.TYPES.bool:return t;case e.TYPES.float:case e.TYPES.double:return 0!==t;case e.TYPES.string:return t.length>0;case e.TYPES.bytes:return t.remaining()>0;case e.TYPES.enum:return 0!==t;case e.TYPES.message:return null!==t;default:return!0}},p.encode=function(t,n,o){var i,s,a,u,c;if(null===this.type||"object"!=typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===t||this.repeated&&0==t.length)return n;try{if(this.repeated)if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(n.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),n.ensureCapacity(n.offset+=1),s=n.offset,i=0;i<t.length;i++)this.element.encodeValue(this.id,t[i],n);a=n.offset-s,(u=r.calculateVarint32(a))>1&&(c=n.slice(s,n.offset),s+=u-1,n.offset=s,n.append(c)),n.writeVarint32(a,s-u)}else for(i=0;i<t.length;i++)n.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,t[i],n);else this.map?t.forEach((function(t,o){var i=r.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,o)+r.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,t);n.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),n.writeVarint32(i),n.writeVarint32(8|this.keyType.wireType),this.keyElement.encodeValue(1,o,n),n.writeVarint32(16|this.type.wireType),this.element.encodeValue(2,t,n)}),this):this.hasWirePresence(t,o)&&(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){var o,i,s;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;o=0;try{if(this.repeated)if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(o+=r.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),s=0,i=0;i<t.length;i++)s+=this.element.calculateLength(this.id,t[i]);o+=r.calculateVarint32(s),o+=s}else for(i=0;i<t.length;i++)o+=r.calculateVarint32(this.id<<3|this.type.wireType),o+=this.element.calculateLength(this.id,t[i]);else this.map?t.forEach((function(t,n){var i=r.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,n)+r.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,t);o+=r.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),o+=r.calculateVarint32(i),o+=i}),this):this.hasWirePresence(t,n)&&(o+=r.calculateVarint32(this.id<<3|this.type.wireType),o+=this.element.calculateLength(this.id,t))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+t+" ("+e+")")}return o},p.decode=function(t,n,r){var o,i,s,u,c,l,d;if(!(!this.map&&t==this.type.wireType||!r&&this.repeated&&this.options.packed&&t==e.WIRE_TYPES.LDELIM||this.map&&t==e.WIRE_TYPES.LDELIM))throw Error("Illegal wire type for field "+this.toString(!0)+": "+t+" ("+this.type.wireType+" expected)");if(t==e.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0&&!r){for(i=n.readVarint32(),i=n.offset+i,s=[];n.offset<i;)s.push(this.decode(this.type.wireType,n,!0));return s}if(this.map){if(u=a.defaultFieldValue(this.keyType),o=a.defaultFieldValue(this.type),i=n.readVarint32(),n.remaining()<i)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+i+" required but got only "+n.remaining());for((c=n.clone()).limit=c.offset+i,n.offset+=i;c.remaining()>0;)if(t=7&(l=c.readVarint32()),1===(d=l>>>3))u=this.keyElement.decode(c,t,d);else{if(2!==d)throw Error("Unexpected tag in map field key/value submessage");o=this.element.decode(c,t,d)}return[u,o]}return this.element.decode(n,t,this.id)},C.Message.Field=d,h=function(e,t,n,r,o,i,s){d.call(this,e,t,n,null,r,o,i,s),this.extension},h.prototype=Object.create(d.prototype),C.Message.ExtensionField=h,_=function(e,t,n){R.call(this,e,t,n),this.fields=[]},C.Message.OneOf=_,g=function(e,t,n,r,o){i.call(this,e,t,n,r,o),this.className="Enum",this.object=null},g.getName=function(e,t){var n,r,o=Object.keys(e);for(r=0;r<o.length;++r)if(e[n=o[r]]===t)return n;return null},(g.prototype=Object.create(i.prototype)).build=function(t){var n,r,o,i;if(this.object&&!t)return this.object;for(n=new e.Builder.Enum,o=0,i=(r=this.getChildren(g.Value)).length;i>o;++o)n[r[o].name]=r[o].id;return Object.defineProperty&&Object.defineProperty(n,"$options",{value:this.buildOpt(),enumerable:!1}),this.object=n},C.Enum=g,f=function(e,t,n,r){R.call(this,e,t,n),this.className="Enum.Value",this.id=r},f.prototype=Object.create(R.prototype),C.Enum.Value=f,E=function(e,t,n,r){R.call(this,e,t,n),this.field=r},E.prototype=Object.create(R.prototype),C.Extension=E,I=function(e,t,n,r){i.call(this,e,t,n,r),this.className="Service",this.clazz=null},(I.prototype=Object.create(i.prototype)).build=function(t){return this.clazz&&!t?this.clazz:this.clazz=function(e,t){var n,o=function(t){e.Builder.Service.call(this),this.rpcImpl=t||function(e,t,n){setTimeout(n.bind(this,Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")),0)}},i=o.prototype=Object.create(e.Builder.Service.prototype),s=t.getChildren(e.Reflect.Service.RPCMethod);for(n=0;n<s.length;n++)!function(e){i[e.name]=function(n,o){try{try{n=e.resolvedRequestType.clazz.decode(r.wrap(n))}catch(e){if(!(e instanceof TypeError))throw e}if(null===n||"object"!=typeof n)throw Error("Illegal arguments");n instanceof e.resolvedRequestType.clazz||(n=new e.resolvedRequestType.clazz(n)),this.rpcImpl(e.fqn(),n,(function(n,r){if(!n){try{r=e.resolvedResponseType.clazz.decode(r)}catch(e){}return r&&r instanceof e.resolvedResponseType.clazz?void o(null,r):void o(Error("Illegal response type received in service method "+t.name+"#"+e.name))}o(n)}))}catch(e){setTimeout(o.bind(this,e),0)}},o[e.name]=function(t,n,r){new o(t)[e.name](n,r)},Object.defineProperty&&(Object.defineProperty(o[e.name],"$options",{value:e.buildOpt()}),Object.defineProperty(i[e.name],"$options",{value:o[e.name].$options}))}(s[n]);return Object.defineProperty&&(Object.defineProperty(o,"$options",{value:t.buildOpt()}),Object.defineProperty(i,"$options",{value:o.$options}),Object.defineProperty(o,"$type",{value:t}),Object.defineProperty(i,"$type",{value:t})),o}(e,this)},C.Service=I,T=function(e,t,n,r){R.call(this,e,t,n),this.className="Service.Method",this.options=r||{}},(T.prototype=Object.create(R.prototype)).buildOpt=s.buildOpt,C.Service.Method=T,v=function(e,t,n,r,o,i,s,a){T.call(this,e,t,n,a),this.className="Service.RPCMethod",this.requestName=r,this.responseName=o,this.requestStream=i,this.responseStream=s,this.resolvedRequestType=null,this.resolvedResponseType=null},v.prototype=Object.create(T.prototype),C.Service.RPCMethod=v,C}(i),i.Builder=function(e,t,n){function r(e){e.messages&&e.messages.forEach((function(t){t.syntax=e.syntax,r(t)})),e.enums&&e.enums.forEach((function(t){t.syntax=e.syntax}))}var o=function(e){this.ns=new n.Namespace(this,null,""),this.ptr=this.ns,this.resolved=!1,this.result=null,this.files={},this.importRoot=null,this.options=e||{}},i=o.prototype;return o.isMessage=function(e){return"string"==typeof e.name&&(void 0===e.values&&void 0===e.rpc)},o.isMessageField=function(e){return"string"==typeof e.rule&&"string"==typeof e.name&&"string"==typeof e.type&&void 0!==e.id},o.isEnum=function(e){return"string"==typeof e.name&&!(void 0===e.values||!Array.isArray(e.values)||0===e.values.length)},o.isService=function(e){return!("string"!=typeof e.name||"object"!=typeof e.rpc||!e.rpc)},o.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 n.Namespace(this,this.ptr,e)),this.ptr=t}),this),this},i.create=function(t){var r,i,s,a,u;if(!t)return this;if(Array.isArray(t)){if(0===t.length)return this;t=t.slice()}else t=[t];for(r=[t];r.length>0;){if(t=r.pop(),!Array.isArray(t))throw Error("not a valid namespace: "+JSON.stringify(t));for(;t.length>0;){if(i=t.shift(),o.isMessage(i)){if(s=new n.Message(this,this.ptr,i.name,i.options,i.isGroup,i.syntax),a={},i.oneofs&&Object.keys(i.oneofs).forEach((function(e){s.addChild(a[e]=new n.Message.OneOf(this,s,e))}),this),i.fields&&i.fields.forEach((function(e){if(null!==s.getChild(0|e.id))throw Error("duplicate or invalid field id in "+s.name+": "+e.id);if(e.options&&"object"!=typeof e.options)throw Error("illegal field options in "+s.name+"#"+e.name);var t=null;if("string"==typeof e.oneof&&!(t=a[e.oneof]))throw Error("illegal oneof in "+s.name+"#"+e.name+": "+e.oneof);e=new n.Message.Field(this,s,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,i.syntax),t&&t.fields.push(e),s.addChild(e)}),this),u=[],i.enums&&i.enums.forEach((function(e){u.push(e)})),i.messages&&i.messages.forEach((function(e){u.push(e)})),i.services&&i.services.forEach((function(e){u.push(e)})),i.extensions&&(s.extensions="number"==typeof i.extensions[0]?[i.extensions]:i.extensions),this.ptr.addChild(s),u.length>0){r.push(t),t=u,u=null,this.ptr=s,s=null;continue}u=null}else if(o.isEnum(i))s=new n.Enum(this,this.ptr,i.name,i.options,i.syntax),i.values.forEach((function(e){s.addChild(new n.Enum.Value(this,s,e.name,e.id))}),this),this.ptr.addChild(s);else if(o.isService(i))s=new n.Service(this,this.ptr,i.name,i.options),Object.keys(i.rpc).forEach((function(e){var t=i.rpc[e];s.addChild(new n.Service.RPCMethod(this,s,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))}),this),this.ptr.addChild(s);else{if(!o.isExtend(i))throw Error("not a valid definition: "+JSON.stringify(i));if(s=this.ptr.resolve(i.ref,!0))i.fields.forEach((function(t){var r,o,i,a;if(null!==s.getChild(0|t.id))throw Error("duplicate extended field id in "+s.name+": "+t.id);if(s.extensions&&(r=!1,s.extensions.forEach((function(e){t.id>=e[0]&&t.id<=e[1]&&(r=!0)})),!r))throw Error("illegal extended field id in "+s.name+": "+t.id+" (not within valid ranges)");o=t.name,this.options.convertFieldsToCamelCase&&(o=e.Util.toCamelCase(o)),i=new n.Message.ExtensionField(this,s,t.rule,t.type,this.ptr.fqn()+"."+o,t.id,t.options),a=new n.Extension(this,this.ptr,t.name,i),i.extension=a,this.ptr.addChild(a),s.addChild(i)}),this);else if(!/\.?google\.protobuf\./.test(i.ref))throw Error("extended message "+i.ref+" is not defined")}i=null,s=null}t=null,this.ptr=this.ptr.parent}return this.resolved=!1,this.result=null,this},i.import=function(t,n){var o,i,s,a,u,c,l,d,p="/";if("string"==typeof n){if(e.Util.IS_NODE,!0===this.files[n])return this.reset();this.files[n]=!0}else if("object"==typeof n){if(o=n.root,e.Util.IS_NODE,(o.indexOf("\\")>=0||n.file.indexOf("\\")>=0)&&(p="\\"),i=o+p+n.file,!0===this.files[i])return this.reset();this.files[i]=!0}if(t.imports&&t.imports.length>0){for(a=!1,"object"==typeof n?(this.importRoot=n.root,a=!0,s=this.importRoot,n=n.file,(s.indexOf("\\")>=0||n.indexOf("\\")>=0)&&(p="\\")):"string"==typeof n?this.importRoot?s=this.importRoot:n.indexOf("/")>=0?""===(s=n.replace(/\/[^\/]*$/,""))&&(s="/"):n.indexOf("\\")>=0?(s=n.replace(/\\[^\\]*$/,""),p="\\"):s=".":s=null,u=0;u<t.imports.length;u++)if("string"==typeof t.imports[u]){if(!s)throw Error("cannot determine import root");if("google/protobuf/descriptor.proto"===(c=t.imports[u]))continue;if(c=s+p+c,!0===this.files[c])continue;if(/\.proto$/i.test(c)&&!e.DotProto&&(c=c.replace(/\.proto$/,".json")),null===(l=e.Util.fetch(c)))throw Error("failed to import '"+c+"' in '"+n+"': file not found");/\.json$/i.test(c)?this.import(JSON.parse(l+""),c):this.import(e.DotProto.Parser.parse(l),c)}else n?/\.(\w+)$/.test(n)?this.import(t.imports[u],n.replace(/^(.+)\.(\w+)$/,(function(e,t,n){return t+"_import"+u+"."+n}))):this.import(t.imports[u],n+"_import"+u):this.import(t.imports[u]);a&&(this.importRoot=null)}return t.package&&this.define(t.package),t.syntax&&r(t),d=this.ptr,t.options&&Object.keys(t.options).forEach((function(e){d.options[e]=t.options[e]})),t.messages&&(this.create(t.messages),this.ptr=d),t.enums&&(this.create(t.enums),this.ptr=d),t.services&&(this.create(t.services),this.ptr=d),t.extends&&this.create(t.extends),this.reset()},i.resolveAll=function(){var r;if(null==this.ptr||"object"==typeof this.ptr.type)return this;if(this.ptr instanceof n.Namespace)this.ptr.children.forEach((function(e){this.ptr=e,this.resolveAll()}),this);else if(this.ptr instanceof n.Message.Field){if(t.TYPE.test(this.ptr.type))this.ptr.type=e.TYPES[this.ptr.type];else{if(!t.TYPEREF.test(this.ptr.type))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(!(r=(this.ptr instanceof n.Message.ExtensionField?this.ptr.extension.parent:this.ptr.parent).resolve(this.ptr.type,!0)))throw Error("unresolvable type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(this.ptr.resolvedType=r,r instanceof n.Enum){if(this.ptr.type=e.TYPES.enum,"proto3"===this.ptr.syntax&&"proto3"!==r.syntax)throw Error("proto3 message cannot reference proto2 enum")}else{if(!(r instanceof n.Message))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);this.ptr.type=r.isGroup?e.TYPES.group:e.TYPES.message}}if(this.ptr.map){if(!t.TYPE.test(this.ptr.keyType))throw Error("illegal key type for map field in "+this.ptr.toString(!0)+": "+this.ptr.keyType);this.ptr.keyType=e.TYPES[this.ptr.keyType]}}else if(this.ptr instanceof e.Reflect.Service.Method){if(!(this.ptr instanceof e.Reflect.Service.RPCMethod))throw Error("illegal service type in "+this.ptr.toString(!0));if(!((r=this.ptr.parent.resolve(this.ptr.requestName,!0))&&r instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.requestName);if(this.ptr.resolvedRequestType=r,!((r=this.ptr.parent.resolve(this.ptr.responseName,!0))&&r instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.responseName);this.ptr.resolvedResponseType=r}else if(!(this.ptr instanceof e.Reflect.Message.OneOf||this.ptr instanceof e.Reflect.Extension||this.ptr instanceof e.Reflect.Enum.Value))throw Error("illegal object in namespace: "+typeof this.ptr+": "+this.ptr);return this.reset()},i.build=function(e){var t,n,r;if(this.reset(),this.resolved||(this.resolveAll(),this.resolved=!0,this.result=null),null===this.result&&(this.result=this.ns.build()),!e)return this.result;for(t="string"==typeof e?e.split("."):e,n=this.result,r=0;r<t.length;r++){if(!n[t[r]]){n=null;break}n=n[t[r]]}return n},i.lookup=function(e,t){return e?this.ns.resolve(e,t):this.ns},i.toString=function(){return"Builder"},o.Message=function(){},o.Enum=function(){},o.Service=function(){},o}(i,i.Lang,i.Reflect),i.Map=function(e,t){function n(e){var t=0;return{next:function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}}var r=function(e,n){var r,o,i,s;if(!e.map)throw Error("field is not a map");if(this.field=e,this.keyElem=new t.Element(e.keyType,null,!0,e.syntax),this.valueElem=new t.Element(e.type,e.resolvedType,!1,e.syntax),this.map={},Object.defineProperty(this,"size",{get:function(){return Object.keys(this.map).length}}),n)for(r=Object.keys(n),o=0;o<r.length;o++)i=this.keyElem.valueFromString(r[o]),s=this.valueElem.verifyValue(n[r[o]]),this.map[this.keyElem.valueToString(i)]={key:i,value:s}},o=r.prototype;return o.clear=function(){this.map={}},o.delete=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e)),n=t in this.map;return delete this.map[t],n},o.entries=function(){var e,t,r=[],o=Object.keys(this.map);for(t=0;t<o.length;t++)r.push([(e=this.map[o[t]]).key,e.value]);return n(r)},o.keys=function(){var e,t=[],r=Object.keys(this.map);for(e=0;e<r.length;e++)t.push(this.map[r[e]].key);return n(t)},o.values=function(){var e,t=[],r=Object.keys(this.map);for(e=0;e<r.length;e++)t.push(this.map[r[e]].value);return n(t)},o.forEach=function(e,t){var n,r,o=Object.keys(this.map);for(r=0;r<o.length;r++)e.call(t,(n=this.map[o[r]]).value,n.key,this)},o.set=function(e,t){var n=this.keyElem.verifyValue(e),r=this.valueElem.verifyValue(t);return this.map[this.keyElem.valueToString(n)]={key:n,value:r},this},o.get=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e));return t in this.map?this.map[t].value:void 0},o.has=function(e){return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map},r}(0,i.Reflect),i.loadProto=function(e,t,n){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(n=t,t=void 0),i.loadJson(i.DotProto.Parser.parse(e),t,n)},i.protoFromString=i.loadProto,i.loadProtoFile=function(e,t,n){if(t&&"object"==typeof t?(n=t,t=null):t&&"function"==typeof t||(t=null),t)return i.Util.fetch("string"==typeof e?e:e.root+"/"+e.file,(function(r){if(null!==r)try{t(null,i.loadProto(r,n,e))}catch(e){t(e)}else t(Error("Failed to fetch file"))}));var r=i.Util.fetch("object"==typeof e?e.root+"/"+e.file:e);return null===r?null:i.loadProto(r,n,e)},i.protoFromFile=i.loadProtoFile,i.newBuilder=function(e){return void 0===(e=e||{}).convertFieldsToCamelCase&&(e.convertFieldsToCamelCase=i.convertFieldsToCamelCase),void 0===e.populateAccessors&&(e.populateAccessors=i.populateAccessors),new i.Builder(e)},i.loadJson=function(e,t,n){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(n=t,t=null),t&&"object"==typeof t||(t=i.newBuilder()),"string"==typeof e&&(e=JSON.parse(e)),t.import(e,n),t.resolveAll(),t},i.loadJsonFile=function(e,t,n){if(t&&"object"==typeof t?(n=t,t=null):t&&"function"==typeof t||(t=null),t)return i.Util.fetch("string"==typeof e?e:e.root+"/"+e.file,(function(r){if(null!==r)try{t(null,i.loadJson(JSON.parse(r),n,e))}catch(e){t(e)}else t(Error("Failed to fetch file"))}));var r=i.Util.fetch("object"==typeof e?e.root+"/"+e.file:e);return null===r?null:i.loadJson(JSON.parse(r),n,e)},o=e,i.loadProto(o,void 0,"").build("Modules").probuf}(n,t);return r}var Cr=function(e,t,n){if(void 0===t||void 0===n)return e.toUpperCase();var r=e.slice(t,n);return e=e.replace(r,(function(e){return e.toUpperCase()}))},Rr=function(){function e(e,t){this.nestedMap=t,gr.add(this),this.pbModules=vr(e)}return e.prototype._encode=function(e,t,n){var r=this,o=new this.pbModules[e];if(t)try{Object.keys(t).forEach((function(n){var i=t[n];if(void 0!==i){var s=r.nestedMap.get("".concat(e,"_").concat(n));if(s){var a=i instanceof Array?i.map((function(e){return r._encode(s,e,!0)})):r._encode(s,i,!0);o["set".concat(Cr(n,0,1))](a)}else o["set".concat(Cr(n,0,1))](i)}}))}catch(t){var i="name: ".concat(e,", stack: ").concat(t.stack);null===console||void 0===console||console.error("pb encode error!",i)}return n?o:o.toArrayBuffer()},e.prototype.encode=function(e,t){return this._encode(e,t)},e.prototype.decode=function(e,t){var n=this.pbModules[e].decode(t);return he(this,gr,"m",fr).call(this,n)},e.prototype.getModule=function(e){return new this.pbModules[e]},e}();gr=new WeakSet,fr=function e(t){var n,r=this;if(t instanceof Array)return t.map((function(t){return he(r,gr,"m",e).call(r,t)}));if(n=t,"[object Object]"!==Object.prototype.toString.call(n))return t;if(t.buffer instanceof ArrayBuffer&&"number"==typeof t.offset&&"number"==typeof t.limit){var o=t.buffer,i=t.offset,s=t.limit;return o.slice(i,s)}if(void 0!==t.low&&void 0!==t.high&&Object.prototype.hasOwnProperty.call(t,"unsigned")){var a=t.low;return a<0&&(a+=4294967296),a=a.toString(16),parseInt(t.high.toString(16)+"00000000".replace(new RegExp("0{".concat(a.length,"}$")),a),16)}var u=t;return Object.keys(t).forEach((function(n){u[n]=he(r,gr,"m",e).call(r,t[n])})),u};var yr,mr,Sr,Ar,Nr="NotifyMsg",Or="SyncRequestMsg",Mr="UpStreamMessage",Lr="PushExtra",Ur="DownStreamMessages",br="DownStreamMessage",Pr="GetQNupTokenInput",wr="GetDownloadUrlInput",xr="GetQNupTokenOutput",Dr="GetDownloadUrlOutput",Vr="ChrmInput",Gr="ChrmOutput",kr="ChrmPullMsg",Fr="RelationQryInput",Br="RelationsInput",Hr="RelationsOutput",qr="QryRemindListReq",Yr="QryRemindListResp",Kr="CleanHisMsgInput",Qr="CleanMsgBatchReq",Wr="QueryChatRoomInfoInput",jr="QueryChatRoomInfoOutput",Jr="HistoryMsgInput",zr="HistoryMsgOuput",Zr="SessionsAttQryInput",Xr="SessionsAttOutput",$r="SessionMsgReadInput",eo="DeleteSessionsInput",to="SessionInfo",no="QuerySessionsInput",ro="QuerySessionsOutPut",oo="RelationDelBatchReq",io="RelationOpInput",so="DeleteMsgInput",ao="SetChrmKV",uo="SetChrmKVS",co="ChrmKVOutput",lo="ChrmKVSOutput",po="QueryChrmKV",ho="SetUserSettingOutput",_o="PullUserSettingInput",go="PullUserSettingOutput",fo="SessionReq",Eo="SessionStates",Io="SessionState",To="SessionStateItem",vo="SessionStateModifyReq",Co="GroupUnpushQuery",Ro="GroupUnpushSet",yo="GroupUnpushResult",mo="SessionStateModifyResp",So="TypeUnpushInput",Ao="TypeUnpushOutput",No="GrpReadReceiptMsg",Oo="GrpReadReceiptQryResp",Mo="SessionTagAddInput",Lo="SessionTagItem",Uo="SessionTagDelInput",bo="SessionDisTagReq",Po="UserSettingNotification",wo="ReportSDKInput",xo="UltraGrpPullSes",Do="UltraGrpPullMsg",Vo="MsgChangeReq",Go="QueryMsgChange",ko="EventChangeList",Fo="MsgChangeList",Bo="MsgQuery",Ho="MsgQueryAck",qo="OperateStatus",Yo="OperateStatusNotify",Ko="SetRtcRoomIdInput",Qo="CallInfoUpStream",Wo="CallInfoDownStream",jo="KvInput",Jo="KvOutput",zo="ReadReceiptMsg",Zo="ReceiptQryReq",Xo="QueryReceiptResp",$o="ReceiptCntQryReq",ei="ReceiptCntQryResp",ti="UpdateUserSubReq",ni="UserSubDetail",ri="UpdateUserSubResp",oi="PullUserSubReq",ii="PUllUserSubResp",si="PullSubDataReq",ai="PullSubDataResp",ui="SubDataDetail",ci="QrySubDataReq",li="UserProfile",di="ProfileInfo",pi="SetUserProfileResp",hi="PullUserProfileReq",_i="UserProfiles",gi="UserProfileInput",fi="UserProfilePermission",Ei="SearchUserProfile",Ii="ChannelsInput",Ti="ChannelsOutput",vi="MultiChannels",Ci="ModifyChannelsInput",Ri="QuitChannelsSetting",yi="ChannelsQueryInput",mi="ChannelsPageParam",Si="ChannelsListResult",Ai="ChannelsMemberUpdateInput",Ni="ChannelsMemberResponseInput",Oi="ChannelsMembersInput",Mi="FriendInput",Li="FriendsInput",Ui="FriendsCheckOutput",bi="FriendProfileInput",Pi="FriendProfileOutput",wi="FriendQueryInput",xi="FriendsListInput",Di="FriendLevelSet",Vi="FriendUserInfos",Gi="AddUnpushPeriodInput",ki="DeleteUnpushPeriodInput",Fi="QueryUnpushPeriodInput",Bi="QueryUnpushPeriodOutput",Hi=new Map([["UpStreamMessage_pushExt","PushExtra"],["DownStreamMessages_list","DownStreamMessage"],["DownStreamMessage_pushExt","PushExtra"],["ChannelInfosOutput_channels","ChannelInfoOutput"],["GroupMembersOutput_members","MemberInfo"],["GroupInput_groupInfo","GroupInfo"],["RelationsInput_msg","DownStreamMessage"],["RelationsOutput_info","RelationInfo"],["RelationInfo_msg","DownStreamMessage"],["RelationInfo_msgInfo","UnreadMsgInfo"],["QryRemindListResp_msgInfo","UnreadMsgInfo"],["CleanMsgBatchReq_input","CleanHisMsgInput"],["HistoryMessagesOuput_list","DownStreamMessage"],["QueryChatRoomInfoOutput_userInfos","ChrmMember"],["MPFollowOutput_info","MpInfo"],["MCFollowOutput_info","MpInfo"],["SearchMpOutput_info","MpInfo"],["PullMpOutput_info","MpInfo"],["HistoryMsgOuput_list","DownStreamMessage"],["DeleteSessionsInput_sessions","SessionInfo"],["QuerySessionsInput_sessions","SessionInfo"],["QuerySessionsOutPut_sessions","SessionInfo"],["RelationDelBatchReq_relation","RelationOpInput"],["DeleteMsgInput_msgs","DeleteMsg"],["SetChrmKV_entry","ChrmKVEntity"],["SetChrmKV_notification","UpStreamMessage"],["SetChrmKVS_entry","ChrmKVEntity"],["SetChrmKVS_notification","UpStreamMessage"],["DeleteChrmKVS_entry","ChrmKVEntity"],["DeleteChrmKVS_notification","UpStreamMessage"],["ChrmKVOutput_entries","ChrmKVEntity"],["ChrmKVSOutput_errorKeys","ChrmKVSOutputEntity"],["ChrmKVSOutput_keysVersion","ChrmKVSVersionEntity"],["PullUserSettingOutput_items","UserSettingItem"],["UserSettingItem_tags","SessionTagItem"],["SessionStates_state","SessionState"],["SessionState_stateItem","SessionStateItem"],["SessionStateItem_tags","SessionTagItem"],["SessionStateModifyReq_state","SessionState"],["GrpReadReceiptQryResp_list","GrpMsgReadUser"],["SessionTagAddInput_tags","SessionTagItem"],["SessionTagDelInput_tags","SessionTagItem"],["EventChangeList_list","EventChange"],["MsgChangeList_list","MsgChange"],["MsgQuery_query","MessageQueryInfo"],["MsgQueryAck_list","DownStreamMessage"],["OperateStatusNotify_info","OperateInfo"],["OperateStatusNotify_summary","OperateSummary"],["KvOutput_info","KvInfo"],["QueryReceiptResp_list","ReceiptUser"],["ReceiptCntQryResp_result","MsgReadCnt"],["UpdateUserSubReq_subUsers","UserSubDetail"],["UpdateUserSubResp_subUsers","UserSubDetail"],["PUllUserSubResp_list","UserSubList"],["UserSubList_subUsers","UserSubDetail"],["PullSubDataResp_list","SubDataDetail"],["SubDataDetail_data","SubData"],["QrySubDataReq_subUsers","UserSubDetail"],["UserProfile_userProfile","ProfileInfo"],["UserProfile_userExtProfile","ProfileInfo"],["UserProfiles_UserProfile","UserProfile"],["ChannelsInput_settingProfile","ProfileInfo"],["ChannelsInput_extProfile","ProfileInfo"],["ChannelsInput_baseInfo","ChannelBaseInfo"],["ChannelsOutput_channelInfo","ChannelsJoinedInfo"],["ChannelsOutput_userInfos","ChannelsUserInfo"],["ChannelsOutput_friendInviteInfo","FriendInviteInfo"],["ChannelsOutput_friendUserInfo","FriendUserInfo"],["MultiChannels_list","ChannelsInput"],["ModifyChannelsInput_settingInfo","QuitChannelsSetting"],["ChannelsQueryInput_page","ChannelsPageParam"],["ChannelsListResult_page","ChannelsPageParam"],["ChannelsInviteStatusInfos_list","ChannelsInviteStatusInfo"],["ChannelsUserInfos_list","ChannelsUserInfo"],["ChannelsJoinedInfos_list","ChannelsJoinedInfo"],["ChannelsUserInfo_ext","ChannelsUserExtInfo"],["ChannelsJoinedInfo_settingProfile","ProfileInfo"],["ChannelsJoinedInfo_extProfile","ProfileInfo"],["ChannelsJoinedInfo_baseInfo","ChannelBaseInfo"],["ChannelsJoinedInfo_userInfo","ChannelsUserExtInfo"],["ChannelsInviteStatusInfo_joinUserInfo","ChannelsUserInfo"],["ChannelsInviteStatusInfo_inviterInfo","ChannelsUserInfo"],["ChannelsInviteStatusInfo_processInfo","ChannelsUserInfo"],["FriendsOutput_list","FriendOutput"],["FriendsCheckOutput_list","FriendCheckOutput"],["FriendProfileInput_extProfile","ProfileInfo"],["FriendQueryInput_page","ChannelsPageParam"],["FriendUserInfo_extProfile","ProfileInfo"],["FriendUserInfos_list","FriendUserInfo"],["FriendInviteInfos_list","FriendInviteInfo"],["UpdateChannnelInfo_channelInfo","ChannelsJoinedInfo"],["UpdateChannnelInfo_userInfo","ChannelsUserInfo"],["UpdateUserInfo_updatedUserInfo","ChannelsUserInfo"],["UpdateUserInfo_optUserInfo","ChannelsUserInfo"],["ChannelApplyInfo_statusInfo","ChannelsInviteStatusInfo"],["ChannelEventData_optUserInfo","ChannelsUserInfo"],["ChannelEventData_channelInfo","ChannelsJoinedInfo"],["ChannelEventData_userInfos","ChannelsUserInfo"],["ChannelEventData_channelFullInfo","ChannelsJoinedInfo"],["FriendUpdateEvent_extProfile","ProfileInfo"]]);!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"}(yr||(yr={})),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"}(mr||(mr={})),function(e){e[e.GROUP_SUCCESS=0]="GROUP_SUCCESS",e[e.GROUP_FAILURE=1]="GROUP_FAILURE"}(Sr||(Sr={})),function(e){e[e.IsSilent=1]="IsSilent",e[e.IsTop=2]="IsTop",e[e.Tags=3]="Tags"}(Ar||(Ar={}));var qi,Yi,Ki,Qi,Wi,ji,Ji,zi,Zi,Xi=new Rr("package Modules;\nmessage probuf {\n message SetUserStatusOutput {\n optional int32 nothing=1;\n }\n message GetUserStatusInput {\n optional int32 nothing=1;\n }\n message GetUserStatusOutput {\n optional string status=1;\n optional string subUserId=2;\n }\n message SubUserStatusInput {\n repeated string userid =1;\n }\n message SubUserStatusOutput {\n optional int32 nothing=1;\n }\n message VoipDynamicInput {\n required int32 engineType = 1;\n required string channelName = 2;\n optional string channelExtra = 3;\n }\n message VoipDynamicOutput {\n required string dynamicKey=1;\n }\n message NotifyMsg {\n required int32 type = 1;\n optional int64 time = 2;\n optional string chrmId=3;\n }\n message SyncRequestMsg {\n required int64 syncTime = 1;\n required bool ispolling = 2;\n optional bool isweb=3;\n optional bool isPullSend=4;\n optional bool isKeeping=5;\n optional int64 sendBoxSyncTime=6;\n optional int64 broadcastSyncTime=7;\n optional int64 endTime = 8;\n optional bool compressioEnabled = 9;\n }\n message UpStreamMessage {\n required int32 sessionId = 1;\n required string classname = 2;\n required string content = 3;\n optional string pushText = 4;\n optional string appData = 5;\n repeated string toUserIds = 6;\n optional int64 delMsgTime = 7;\n optional string delMsgId = 8;\n optional int32 configFlag = 9;\n optional int64 clientUniqueId = 10;\n optional string extraContent = 11;\n optional PushExtra pushExt = 12;\n optional string busChannel = 13;\n optional string systemId = 16;\n optional string senderPortrait = 21;\n optional int64 optionBits = 22;\n }\n message PushExtra {\n optional string title = 1;\n optional int32 templateIdNoUse= 2;\n optional string pushId = 3;\n optional string pushConfigs = 4;\n optional string templateId = 5;\n }\n message DownStreamMessages {\n repeated DownStreamMessage list = 1;\n required int64 syncTime = 2;\n optional bool finished = 3;\n optional int64 broadcastSyncTime = 4;\n optional int64 systemTime = 5;\n optional int64 credibleStartTime = 6;\n optional int64 credibleEndTime = 7;\n optional bool compressioEnabled = 8;\n optional bytes compressedData = 9;\n }\n message DownStreamMessage {\n required string fromUserId = 1;\n required ChannelType type = 2;\n optional string groupId = 3;\n required string classname = 4;\n required string content = 5;\n required int64 dataTime = 6;\n required int64 status = 7;\n optional int64 extra = 8;\n optional string msgId = 9;\n optional int32 direction = 10;\n optional int32 plantform =11;\n optional int32 isRemoved = 12;\n optional string source = 13;\n optional int64 clientUniqueId = 14;\n optional string extraContent = 15;\n optional string pushContent = 16;\n optional int32 configFlag = 17;\n optional PushExtra pushExt = 18;\n optional string busChannel = 19;\n optional int64 extStatus = 20;\n repeated string toUserIds = 21;\n optional int32 groupUnpush = 22;\n optional int64 optionBits = 23;\n }\n enum ChannelType {\n PERSON = 1;\n PERSONS = 2;\n GROUP = 3;\n TEMPGROUP = 4;\n CUSTOMERSERVICE = 5;\n NOTIFY = 6;\n MC=7;\n MP=8;\n ULTRAGROUP = 10;\n }\n message CreateDiscussionInput {\n optional string name = 1;\n }\n message CreateDiscussionOutput {\n required string id = 1;\n }\n message ChannelInvitationInput {\n repeated string users = 1;\n }\n message LeaveChannelInput {\n required int32 nothing = 1;\n }\n message ChannelEvictionInput {\n required string user = 1;\n }\n message RenameChannelInput {\n required string name = 1;\n }\n message ChannelInfoInput {\n required int32 nothing = 1;\n }\n message ChannelInfoOutput {\n required ChannelType type = 1;\n required string channelId = 2;\n required string channelName = 3;\n required string adminUserId = 4;\n repeated string firstTenUserIds = 5;\n required int32 openStatus = 6;\n }\n message ChannelInfosInput {\n required int32 page = 1;\n optional int32 number = 2;\n }\n message ChannelInfosOutput {\n repeated ChannelInfoOutput channels = 1;\n required int32 total = 2;\n }\n message MemberInfo {\n required string userId = 1;\n required string userName = 2;\n required string userPortrait = 3;\n required string extension = 4;\n }\n message GroupMembersInput {\n required int32 page = 1;\n optional int32 number = 2;\n }\n message GroupMembersOutput {\n repeated MemberInfo members = 1;\n required int32 total = 2;\n }\n message GetUserInfoInput {\n required int32 nothing = 1;\n }\n message GetUserInfoOutput {\n required string userId = 1;\n required string userName = 2;\n required string userPortrait = 3;\n }\n message GetSessionIdInput {\n required int32 nothing = 1;\n }\n message GetSessionIdOutput {\n required int32 sessionId = 1;\n }\n enum FileType {\n IMAGE = 1;\n AUDIO = 2;\n VIDEO = 3;\n FILE = 4;\n SIGHT = 5;\n COMBINE_HTML = 6;\n }\n message GetQNupTokenInput {\n required FileType type = 1;\n optional string key = 2;\n optional string httpMethod = 3;\n optional string queryString = 4;\n optional string url = 5;\n optional string ext = 6;\n optional int64 size = 7;\n optional int32 ipType = 8;\n }\n message GetQNdownloadUrlInput {\n required FileType type = 1;\n required string key = 2;\n optional string fileName = 3;\n }\n message GetDownloadUrlInput {\n required FileType type = 1;\n required string key = 2;\n optional string fileName = 3;\n optional string ext = 4;\n optional int64 size = 5;\n optional int32 ipType = 6;\n }\n message GetQNupTokenOutput {\n required int64 deadline = 1;\n required string token = 2;\n optional string bosToken = 3;\n optional string bosDate = 4;\n optional string path = 5;\n\n optional string osskeyId = 6;\n optional string ossPolicy = 7;\n optional string ossSign = 8;\n optional string ossBucketName = 9;\n\n optional string s3Credential = 10;\n optional string s3Algorithm = 11;\n optional string s3Date = 12;\n optional string s3Policy = 13;\n optional string s3Signature = 14;\n optional string s3BucketName = 15;\n\n optional string stcAuthorization = 16;\n optional string stcContentSha256 = 17;\n optional string stcDate = 18;\n optional string stcBucketName = 19;\n\n optional string minioAuthorization = 20;\n optional string minioContentSha256 = 21;\n optional string minioDate = 22;\n optional string minioBucketName = 23;\n\n optional string downloadAuthInfo = 24;\n optional string ossConfig = 25;\n }\n message GetQNdownloadUrlOutput {\n required string downloadUrl = 1;\n }\n message GetDownloadUrlOutput {\n required string downloadUrl = 1;\n }\n message Add2BlackListInput {\n required string userId = 1;\n }\n message RemoveFromBlackListInput {\n required string userId = 1;\n }\n message QueryBlackListInput {\n required int32 nothing = 1;\n }\n message QueryBlackListOutput {\n repeated string userIds = 1;\n }\n message BlackListStatusInput {\n required string userId = 1;\n }\n message BlockPushInput {\n required string blockeeId = 1;\n }\n message ModifyPermissionInput {\n required int32 openStatus = 1;\n }\n message GroupInput {\n repeated GroupInfo groupInfo = 1;\n }\n message GroupOutput {\n required int32 nothing = 1;\n }\n message GroupInfo {\n required string id = 1;\n required string name = 2;\n }\n message GroupHashInput {\n required string userId = 1;\n required string groupHashCode = 2;\n }\n message GroupHashOutput {\n required GroupHashType result = 1;\n }\n enum GroupHashType {\n GROUP_SUCCESS = 0x00;\n GROUP_FAILURE = 0x01;\n }\n message ChrmInput {\n required int32 nothing = 1;\n optional string extra = 2;\n }\n message ChrmOutput {\n required int32 nothing = 1;\n optional string sessionId = 2;\n optional int64 joinTime = 3;\n optional int64 createTime = 4;\n optional int32 memberCount = 5;\n optional int32 chatroomBanState = 6;\n optional int32 whiteListState = 7;\n }\n message ChrmPullMsg {\n required int64 syncTime = 1;\n required int32 count = 2;\n optional int32 pullMsgType = 3;\n optional bool compressioEnabled = 4;\n }\n message ChrmPullMsgNew {\n required int32 count = 1;\n required int64 syncTime = 2;\n optional string chrmId=3;\n }\n message RelationQryInput {\n optional ChannelType type = 1;\n optional int32 count = 2;\n optional int64 startTime = 3;\n optional int32 order = 4;\n optional bool isEraseMsgContent = 5;\n optional int64 endTime = 6;\n optional bool compressioEnabled = 7;\n optional int32 qryType = 8;\n }\n message RelationsInput {\n required ChannelType type = 1;\n optional DownStreamMessage msg =2;\n optional int32 count = 3;\n repeated string busChannel = 4;\n optional int64 startTime = 5;\n optional int64 endTime = 6;\n }\n message RelationsOutput {\n repeated RelationInfo info = 1;\n optional bool isFinished = 2;\n optional int64 pullTime = 3;\n optional bool compressioEnabled = 4; \n optional bytes compressedData = 5;\n }\n message RelationInfo {\n required ChannelType type = 1;\n required string userId = 2;\n optional DownStreamMessage msg =3;\n optional int64 readMsgTime= 4;\n optional int64 unreadCount= 5;\n optional string busChannel = 6;\n optional int64 versionTime = 7;\n optional int64 remindCount = 8;\n optional int32 busChannelType = 9;\n optional UnreadMsgInfo msgInfo = 10;\n optional int32 remindMeCount = 11;\n }\n message UnreadMsgInfo {\n required string msgId = 1;\n required int64 msgTime= 2;\n optional int32 remindType= 3;\n optional string className = 4;\n }\n message QryRemindListReq {\n required string groupId = 1;\n optional string busChannel = 2;\n optional int64 msgTime = 3;\n optional int32 size = 4;\n }\n message QryRemindListResp {\n repeated UnreadMsgInfo msgInfo = 1;\n }\n message RelationInfoReadTime {\n required ChannelType type = 1;\n required int64 readMsgTime= 2;\n required string targetId = 3;\n }\n message CleanHisMsgInput {\n required string targetId = 1;\n required int64 dataTime = 2;\n optional int32 conversationType= 3;\n optional string busChannel = 4;\n }\n message CleanMsgBatchReq {\n repeated CleanHisMsgInput input = 1;\n }\n message HistoryMessageInput {\n required string targetId = 1;\n required int64 dataTime =2;\n required int32 size = 3;\n }\n\n message HistoryMessagesOuput {\n repeated DownStreamMessage list = 1;\n required int64 syncTime = 2;\n required int32 hasMsg = 3;\n optional int64 credibleStartTime = 4;\n optional int64 credibleEndTime = 5;\n optional bool compressioEnabled = 6; \n optional bytes compressedData = 7;\n }\n message QueryChatRoomInfoInput {\n required int32 count= 1;\n optional int32 order= 2;\n }\n\n message QueryChatRoomInfoOutput {\n optional int32 userTotalNums = 1;\n repeated ChrmMember userInfos = 2;\n }\n message ChrmMember {\n required int64 time = 1;\n required string id = 2;\n }\n message MPFollowInput {\n required string id = 1;\n }\n\n message MPFollowOutput {\n required int32 nothing = 1;\n optional MpInfo info =2;\n }\n\n message MCFollowOutput {\n required int32 nothing = 1;\n optional MpInfo info =2;\n }\n\n message MpInfo {\n required string mpid=1;\n required string name = 2;\n required string type = 3;\n required int64 time=4;\n optional string portraitUrl=5;\n optional string extra =6;\n }\n\n message SearchMpInput {\n required int32 type=1;\n required string id=2;\n }\n\n message SearchMpOutput {\n required int32 nothing=1;\n repeated MpInfo info = 2;\n }\n\n message PullMpInput {\n required int64 time=1;\n required string mpid=2;\n }\n\n message PullMpOutput {\n required int32 status=1;\n repeated MpInfo info = 2;\n }\n message HistoryMsgInput {\n optional string targetId = 1;\n optional int64 time = 2;\n optional int32 count = 3;\n optional int32 order = 4;\n optional string busChannel = 5;\n optional bool compressioEnabled = 6;\n }\n\n message HistoryMsgOuput {\n repeated DownStreamMessage list=1;\n required int64 syncTime=2;\n required int32 hasMsg=3;\n optional int64 credibleStartTime = 4;\n optional int64 credibleEndTime = 5;\n optional bool compressioEnabled = 6;\n optional bytes compressedData = 7;\n }\n message SessionsAttQryInput {\n required int32 nothing = 1;\n }\n message SessionsAttOutput {\n required int64 inboxTime = 1;\n required int64 sendboxTime = 2;\n required int64 totalUnreadCount = 3;\n }\n message SessionMsgReadInput {\n required ChannelType type = 1;\n required int64 msgTime = 2;\n required string channelId = 3;\n optional string busChannel = 4;\n }\n message SessionMsgReadOutput {\n optional int32 nothing=1;\n }\n message DeleteSessionsInput {\n repeated SessionInfo sessions = 1;\n }\n message SessionInfo {\n required ChannelType type = 1;\n required string channelId = 2;\n optional int64 unreadCount = 3;\n optional string busChannel = 4;\n }\n message QuerySessionsInput {\n repeated SessionInfo sessions = 1;\n }\n message QuerySessionsOutPut {\n repeated SessionInfo sessions = 1;\n }\n message DeleteSessionsOutput {\n optional int32 nothing=1;\n }\n message RelationDelBatchReq {\n repeated RelationOpInput relation = 1;\n }\n message RelationOpInput {\n required string conversationId = 1;\n required ChannelType conversationType = 2;\n optional string busChannel = 3;\n }\n message DeleteMsgInput {\n optional ChannelType type = 1;\n optional string conversationId = 2;\n repeated DeleteMsg msgs = 3;\n optional string busChannel = 4;\n }\n message DeleteMsg {\n optional string msgId = 1;\n optional int64 msgDataTime = 2;\n optional int32 direct = 3;\n }\n message ChrmKVEntity {\n required string key = 1;\n required string value = 2;\n optional int32 status = 3;\n optional int64 timestamp = 4;\n optional string uid = 5;\n optional int64 version = 6;\n }\n message SetChrmKV {\n required ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message SetChrmKVS {\n repeated ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message DeleteChrmKVS {\n repeated ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message ChrmKVOutput {\n repeated ChrmKVEntity entries = 1;\n optional bool bFullUpdate = 2;\n optional int64 syncTime = 3;\n optional bool compressioEnabled = 4; \n optional bytes compressedData = 5;\n }\n message ChrmKVSVersionEntity {\n optional int64 version = 1;\n optional string key = 2;\n }\n\n message ChrmKVSOutput {\n repeated ChrmKVSOutputEntity errorKeys = 1;\n repeated ChrmKVSVersionEntity keysVersion = 2;\n }\n message ChrmKVSOutputEntity {\n optional string key = 1;\n optional int32 errorCode = 2;\n }\n message QueryChrmKV {\n required int64 timestamp = 1;\n optional bool compressioEnabled = 2;\n }\n message SetUserSettingInput {\n required int64 version=1;\n required string value=2;\n }\n message SetUserSettingOutput {\n required int64 version=1;\n required bool reserve=2;\n }\n message PullUserSettingInput {\n required int64 version=1;\n optional bool reserve=2;\n optional int32 ipType = 3;\n }\n message PullUserSettingOutput {\n repeated UserSettingItem items = 1;\n required int64 version=2;\n }\n message UserSettingItem {\n required string targetId= 1;\n required ChannelType type = 2;\n required string key = 4;\n required bytes value = 5;\n required int64 version=6;\n required int32 status=7;\n repeated SessionTagItem tags= 8;\n }\n message SessionReq {\n required int64 time = 1;\n }\n message SessionStates {\n required int64 version=1;\n repeated SessionState state= 2;\n }\n message SessionState {\n required ChannelType type = 1;\n required string channelId = 2;\n optional int64 time = 3;\n repeated SessionStateItem stateItem = 4;\n optional string busChannel = 5;\n }\n message SessionStateItem {\n required SessionStateType sessionStateType = 1;\n required string value = 2;\n repeated SessionTagItem tags = 3;\n }\n enum SessionStateType {\n IsSilent = 1;\n IsTop = 2;\n Tags = 3;\n }\n message SessionStateModifyReq {\n required int64 version=1;\n repeated SessionState state= 2;\n }\n message GroupUnpushQuery {\n optional string busChannel = 1;\n }\n message GroupUnpushSet{\n optional string busChannel = 1;\n required int32 unpushLevel = 2;\n }\n message GroupUnpushResult {\n required string groupId = 1;\n optional string busChannel = 2;\n required int32 unpushLevel = 3;\n }\n message SessionStateModifyResp {\n required int64 version=1;\n }\n message TypeUnpushInput {\n required ChannelType type = 1;\n required int64 version = 2;\n required int32 unpushLevel = 3;\n }\n message TypeUnpushOutput {\n required int64 version = 1;\n }\n message GrpReadReceiptMsg {\n repeated string msgId=1;\n optional string channelId = 2;\n }\n message GrpReadReceiptQryReq {\n repeated string msgId=1;\n optional string channelId = 2;\n }\n message GrpReadReceiptQryResp {\n required int32 totalMemberNum = 1;\n repeated GrpMsgReadUser list = 2;\n }\n message GrpMsgReadUser {\n required int64 readTime = 1;\n required string userId = 2;\n }\n message SessionTagAddInput {\n required int64 version=1;\n repeated SessionTagItem tags=2;\n }\n message SessionTagItem {\n required string tagId=1;\n optional string name=2;\n optional int64 createdTime=3;\n optional bool isTop=4;\n }\n message SessionTagDelInput {\n required int64 version=1;\n repeated SessionTagItem tags=2;\n }\n message SessionDisTagReq {\n repeated string tagId=1;\n }\n message UserSettingNotification {\n required int64 version=1;\n required bool reserve=2;\n }\n message ReportSDKInput {\n required string sdkInfo=1;\n }\n message ReportSDKOutput {\n optional int32 nothing=1;\n }\n message UltraGrpPullSes {\n required int64 syncTime = 1;\n optional bool isEraseMsgContent = 2;\n }\n message UltraGrpPullMsg {\n required int64 syncTime = 1;\n optional bool compressioEnabled = 2;\n }\n message MsgChangeReq {\n required string fromUserId = 1;\n required string targetId = 2;\n required ChannelType type = 3;\n required string msgUID = 4;\n required int64 msgTime = 5;\n optional string busChannel = 6;\n optional string content = 7;\n }\n message QueryMsgChange {\n required int64 syncTime = 1;\n optional int32 needCompress = 2;\n optional int64 onlineTime = 3;\n optional string targetId = 4;\n }\n message EventChangeList {\n repeated EventChange list = 1;\n required int64 syncTime = 2;\n optional bool hasNext = 3 ;\n optional string targetId = 4;\n optional bool isCompress = 5 ;\n }\n message EventChange {\n optional string businessId = 1;\n optional ChannelType channelType = 2;\n optional int64 time = 3;\n optional int32 changeType = 4;\n optional string originalId = 5;\n optional int64 originalTime = 6;\n optional string secondaryId = 7;\n optional bool isAdmin = 8;\n optional bool additionalMark = 9; \n optional string operatorId = 10;\n optional int32 subChangeType = 11;\n optional int32 secondaryType = 12;\n optional bool isRemindMe = 13;\n repeated string extIds = 14;\n optional int32 remindType = 15;\n optional bytes eventData = 16;\n }\n message MsgChangeList {\n repeated MsgChange list = 1;\n required int64 syncTime = 2;\n optional bool hasNext = 3 ;\n }\n message MsgChange {\n required string targetId = 1;\n required ChannelType type = 2;\n required int64 time = 3;\n required int32 changeType = 4;\n required string msgUID = 5;\n required int64 msgTime = 6;\n optional string busChannel = 7;\n optional bool isAdmin = 8;\n optional bool isDel = 9;\n optional string operatorId = 10;\n optional int32 subChangeType = 11;\n optional int32 busChannelType = 12;\n optional bool isRemindMe = 13;\n repeated string userGroupIds = 14;\n optional int32 remindType = 15;\n }\n message MsgQuery {\n required string targetId = 1;\n required ChannelType type = 2;\n repeated MessageQueryInfo query = 3; //\n }\n message MessageQueryInfo {\n required int64 msgTime = 1;\n required string msgUID = 2;\n optional string busChannel = 3;\n }\n message MsgQueryAck {\n repeated DownStreamMessage list = 1;\n }\n message OperateStatus {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional int32 opType = 3;\n optional string busChannel = 4;\n }\n message OperateStatusNotify {\n optional ChannelType type = 1;\n optional int64 notifyType = 2;\n repeated OperateInfo info = 3 ;\n repeated OperateSummary summary = 4 ;\n }\n message OperateInfo {\n optional string targetId = 1;\n optional string busChannel = 2;\n optional string userId = 3;\n optional int32 opType = 4;\n optional int64 optime = 5;\n }\n \n message OperateSummary {\n optional string targetId = 1;\n optional string busChannel = 2;\n optional int32 count = 3;\n optional int32 opType = 4;\n }\n\n message SetRtcRoomIdInput {\n required string rtcRoomId= 1;\n }\n message SetRtcRoomIdOutput {\n required int32 nothing = 1;\n }\n message CallInfoUpStream {\n required string key= 1;\n required string dataContent=2;\n }\n message CallInfoDownStream {\n required string key= 1;\n required string dataContent=2;\n required int64 maxTime=3;\n }\n message KvInput {\n required int64 syncTime = 1;\n }\n message KvOutput {\n required int64 maxTime = 1;\n repeated KvInfo info = 2;\n }\n message KvInfo {\n required string key =1;\n required string value =2;\n }\n message ReadReceiptMsg {\n required string targetId = 1;\n required ChannelType type = 2;\n optional string busChannel = 3;\n optional string startMsgId = 4;\n optional string endMsgId = 5;\n }\n message ReceiptQryReq {\n required string msgId = 1;\n optional string busChannel = 2;\n required string targetId = 3;\n }\n message QueryReceiptResp {\n optional int32 num = 1;\n repeated ReceiptUser list = 2;\n optional int32 readCnt = 3;\n }\n message ReceiptUser {\n required int64 receiptTime = 1;\n required string userId = 2;\n }\n message ReceiptCntQryReq {\n optional ChannelType type = 1;\n optional string channelId = 2;\n optional string busChannel = 3;\n repeated string msgId = 4;\n }\n message ReceiptCntQryResp {\n repeated MsgReadCnt result= 1;\n }\n\n message MsgReadCnt {\n optional string msgId = 1;\n optional int32 cnt = 2;\n optional int32 tmn = 3;\n }\n message UpdateUserSubReq {\n optional int32 subType = 1;\n repeated UserSubDetail subUsers = 2;\n optional int32 opType = 3;\n optional int32 expiry = 4;\n }\n message UserSubDetail {\n optional string subUserId = 1;\n }\n message UpdateUserSubResp {\n repeated UserSubDetail subUsers = 1;\n optional int64 subTime = 2;\n }\n message PullUserSubReq {\n optional int64 version = 1;\n optional string pageToken = 2;\n }\n message PUllUserSubResp {\n repeated UserSubList list = 1;\n optional int64 version = 2;\n optional bool hasNext = 3;\n optional string pageToken = 4;\n optional bool isFull = 5;\n }\n message UserSubList {\n repeated UserSubDetail subUsers = 1;\n optional int32 subType = 2;\n optional int64 subTime = 3;\n optional int32 expiry = 4;\n optional int32 opType = 5;\n }\n message PullSubDataReq {\n optional int64 versionTime = 1;\n optional bool needAllData = 2;\n optional string pageToken = 3;\n }\n message PullSubDataResp {\n repeated SubDataDetail list = 1;\n optional int64 versionTime = 2;\n optional bool hasNext = 3;\n optional string pageToken = 4;\n optional bool isFull = 5;\n }\n message SubDataDetail {\n optional string statusStr = 1;\n optional string subUserId = 2;\n repeated SubData data = 3;\n optional int32 subType = 4;\n }\n\n message SubData {\n optional int32 platformInfo = 1;\n optional int32 value = 2;\n optional int64 versionTime = 3;\n }\n message QrySubDataReq {\n optional int32 subType = 1;\n repeated UserSubDetail subUsers = 2;\n }\n message UserProfile {\n optional int64 version = 1;\n optional string userId = 2;\n repeated ProfileInfo userProfile = 3;\n repeated ProfileInfo userExtProfile = 4;\n }\n message ProfileInfo {\n optional string key = 1;\n optional string value = 2;\n }\n message SetUserProfileResp {\n optional int64 version = 1;\n optional string key = 2;\n repeated string censorFailedFields = 3;\n }\n message PullUserProfileReq {\n repeated string userId = 1;\n }\n message UserProfiles {\n repeated UserProfile UserProfile = 1;\n }\n message UserProfileInput {\n required int32 nothing = 1;\n }\n message UserProfilePermission {\n optional int32 permission = 1;\n }\n message UserProfileOutput {\n required int32 nothing = 1;\n }\n message SearchUserProfile {\n optional string uniqueId = 1;\n }\n message ChannelsInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n repeated ProfileInfo settingProfile = 3;\n repeated ProfileInfo extProfile = 4;\n optional ChannelBaseInfo baseInfo = 5;\n repeated string users = 6;\n }\n\n message ChannelBaseInfo {\n optional string creatorId = 1;\n optional string ownerId = 2;\n optional int64 createTime = 3;\n optional int32 memberCount = 4;\n }\n\n message ChannelsOutput {\n optional int64 operateTime = 1;\n optional int32 flag = 2;\n optional string msg = 3;\n optional int32 processCode = 4;\n optional ChannelsJoinedInfo channelInfo = 5;\n repeated ChannelsUserInfo userInfos = 6;\n optional FriendInviteInfo friendInviteInfo = 7;\n optional FriendUserInfo friendUserInfo = 8;\n repeated string censorFailedFields = 9;\n }\n\n message MultiChannels {\n optional ChannelType type = 1;\n repeated ChannelsInput list = 2;\n }\n\n message ModifyChannelsInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional QuitChannelsSetting settingInfo = 3;\n repeated string users = 4;\n optional int32 operateType = 5;\n }\n\n message QuitChannelsSetting {\n optional bool isQuit = 1;\n optional bool isDelBan = 2;\n optional bool isDelWhite = 3;\n optional bool isDelAttention = 4;\n }\n\n message ChannelsQueryInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional ChannelsPageParam page = 3;\n repeated string ids = 4;\n optional int32 roleType = 5;\n }\n\n message ChannelsPageParam {\n optional int32 size = 1;\n optional string pageToken = 2;\n optional bool hasNext = 3 ;\n optional int32 total = 4 ;\n optional int32 order = 5 ;\n }\n\n message ChannelsListResult {\n optional int32 listType = 1;\n optional bytes result = 2;\n optional ChannelsPageParam page = 3;\n }\n \n message ChannelsInviteStatusInfos {\n repeated ChannelsInviteStatusInfo list = 1;\n }\n \n message ChannelsUserInfos {\n repeated ChannelsUserInfo list = 1;\n }\n \n message ChannelsJoinedInfos {\n repeated ChannelsJoinedInfo list = 1;\n }\n\n message ChannelsUserInfo {\n optional string userId = 1;\n optional ChannelsUserExtInfo ext = 2;\n optional int64 opTime = 3;\n optional string name = 4;\n optional string portraitUrl = 5;\n }\n\n message ChannelsUserExtInfo {\n optional int32 role = 1;\n optional int64 joinTime = 2;\n optional string channelNickName = 3;\n optional string additional = 4;\n optional string remarkName = 5;\n }\n\n message ChannelsMemberUpdateInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional string userId = 3;\n optional string channelNickName = 4;\n optional string additional = 5;\n optional int32 operateType = 6;\n }\n message ChannelsJoinedInfo {\n optional string targetId = 1;\n repeated ProfileInfo settingProfile = 2;\n repeated ProfileInfo extProfile = 3;\n optional ChannelBaseInfo baseInfo = 4;\n optional ChannelsUserExtInfo userInfo = 5;\n }\n message ChannelsInviteStatusInfo {\n optional string targetId = 1;\n optional ChannelsUserInfo joinUserInfo = 2;\n optional ChannelsUserInfo inviterInfo = 3;\n optional int32 status = 4;\n optional int32 directionType = 5;\n optional int32 joinType = 6;\n optional string detail = 7;\n optional int64 applyTime = 8;\n optional ChannelsUserInfo processInfo = 9;\n optional int64 processTime = 10;\n }\n message ChannelsMemberResponseInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional int32 optType = 3;\n optional int32 optResult = 4;\n optional string joinUserId = 5;\n optional string inviterId = 6;\n optional string detail = 7;\n }\n message ChannelsMembersInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n repeated string userIds = 3;\n }\n message FriendInput {\n optional string targetId = 1;\n optional int32 type = 2;\n optional string info = 3;\n }\n message FriendsOutput {\n repeated FriendOutput list = 1;\n }\n message FriendOutput {\n optional string userId = 1;\n optional int64 operateTime = 2;\n optional string flag = 3;\n }\n message FriendsInput {\n repeated string targetId = 1;\n optional int32 type = 2;\n }\n message FriendsCheckOutput {\n repeated FriendCheckOutput list = 1;\n }\n\n message FriendCheckOutput {\n optional string targetId = 1;\n optional int32 status = 2;\n }\n message FriendProfileInput {\n optional string targetId = 1;\n optional string remarkName = 2;\n repeated ProfileInfo extProfile = 3;\n }\n message FriendProfileOutput {\n repeated string censorFailedFields = 1;\n }\n message FriendQueryInput {\n optional int32 queryType = 1;\n optional ChannelsPageParam page = 2;\n optional int32 friendType= 3;\n }\n message FriendUserInfo {\n optional string userId = 1;\n optional int64 relationTime = 2;\n optional int32 friendType = 3;\n optional int32 flag = 4;\n optional string remarkName = 5;\n optional string name = 6;\n optional string portraitUrl = 7;\n repeated ProfileInfo extProfile = 8;\n \n }\n message FriendInviteInfo {\n optional string userId = 1;\n optional string name = 2;\n optional string portraitUrl = 3;\n optional int32 type = 4;\n optional int32 status = 5;\n optional int64 operateTime = 6;\n optional string info = 7;\n optional int32 friendType = 8;\n }\n message FriendsListInput {\n repeated string targetId = 1;\n optional int32 type = 2;\n }\n message FriendLevelSet {\n optional int32 level = 1;\n }\n\n message FriendPageParam {\n optional int32 size = 1;\n optional string pageToken = 2;\n }\n message FriendUserInfos {\n repeated FriendUserInfo list = 1;\n }\n\n message FriendInviteInfos {\n repeated FriendInviteInfo list = 1;\n }\n \n message FriendApplyEvent {\n optional int32 applyType = 1;\n optional int32 friendType = 2;\n optional string info = 3;\n optional string name = 4;\n optional string portraitUrl = 5;\n }\n message UpdateChannnelInfo {\n optional ChannelsJoinedInfo channelInfo = 1;\n optional ChannelsUserInfo userInfo = 2;\n }\n message UpdateUserInfo {\n optional ChannelsUserInfo updatedUserInfo = 1;\n optional ChannelsUserInfo optUserInfo = 2;\n }\n message ChannelApplyInfo {\n repeated ChannelsInviteStatusInfo statusInfo = 1;\n }\n message ChannelEventData {\n optional ChannelsUserInfo optUserInfo = 1;\n optional ChannelsJoinedInfo channelInfo = 2;\n repeated ChannelsUserInfo userInfos = 3;\n optional ChannelsJoinedInfo channelFullInfo = 4;\n }\n message FriendTypeChangeEvent {\n optional string friendId = 1;\n optional int32 friendType = 2;\n }\n message FriendUpdateEvent {\n optional string remarkname = 1;\n repeated ProfileInfo extProfile = 2;\n }\n message AddUnpushPeriodInput {\n required string startTime = 1;\n required int32 spanMinutes = 2;\n optional int32 level = 3;\n optional string timezone = 4;\n }\n message DeleteUnpushPeriodInput {\n required int32 nothing = 1;\n }\n message QueryUnpushPeriodInput {\n required int32 nothing = 1;\n }\n message QueryUnpushPeriodOutput {\n required int32 isUnpush = 1;\n optional string startTime = 2;\n optional int32 spanMinutes = 3;\n optional int32 level = 4;\n optional string timezone = 5;\n }\n}\n",Hi);exports.LogLevel=void 0,(qi=exports.LogLevel||(exports.LogLevel={}))[qi.LOG=0]="LOG",qi[qi.DEBUG=0]="DEBUG",qi[qi.INFO=1]="INFO",qi[qi.WARN=2]="WARN",qi[qi.ERROR=3]="ERROR",qi[qi.FATAL=4]="FATAL",qi[qi.STATISTICS=6]="STATISTICS",qi[qi.NONE=1e3]="NONE",exports.LogSource=void 0,(Yi=exports.LogSource||(exports.LogSource={})).IM="IM",Yi.RTC="RTC",exports.ConnectionStatus=void 0,(Ki=exports.ConnectionStatus||(exports.ConnectionStatus={}))[Ki.CONNECTED=0]="CONNECTED",Ki[Ki.CONNECTING=1]="CONNECTING",Ki[Ki.DISCONNECTED=2]="DISCONNECTED",Ki[Ki.NETWORK_UNAVAILABLE=3]="NETWORK_UNAVAILABLE",Ki[Ki.CONNECTION_CLOSED=4]="CONNECTION_CLOSED",Ki[Ki.KICKED_OFFLINE_BY_OTHER_CLIENT=6]="KICKED_OFFLINE_BY_OTHER_CLIENT",Ki[Ki.WEBSOCKET_UNAVAILABLE=7]="WEBSOCKET_UNAVAILABLE",Ki[Ki.WEBSOCKET_ERROR=8]="WEBSOCKET_ERROR",Ki[Ki.BLOCKED=9]="BLOCKED",Ki[Ki.DOMAIN_INCORRECT=12]="DOMAIN_INCORRECT",Ki[Ki.DISCONNECT_BY_SERVER=13]="DISCONNECT_BY_SERVER",Ki[Ki.REDIRECT=14]="REDIRECT",Ki[Ki.USER_LOGOUT=19]="USER_LOGOUT",Ki[Ki.APPKEY_IS_FAKE=20]="APPKEY_IS_FAKE",Ki[Ki.FORBID_RECONNECT_BY_OTHER_SAME_CLIENT=31023]="FORBID_RECONNECT_BY_OTHER_SAME_CLIENT",Ki[Ki.ULTRALIMIT=1101]="ULTRALIMIT",Ki[Ki.REQUEST_NAVI=201]="REQUEST_NAVI",Ki[Ki.RESPONSE_NAVI=202]="RESPONSE_NAVI",Ki[Ki.RESPONSE_NAVI_ERROR=203]="RESPONSE_NAVI_ERROR",Ki[Ki.RESPONSE_NAVI_TIMEOUT=204]="RESPONSE_NAVI_TIMEOUT",Ki[Ki.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",Ki[Ki.RC_CONN_USER_OR_PASSWD_ERROR=31004]="RC_CONN_USER_OR_PASSWD_ERROR",exports.RTCMode=void 0,(Qi=exports.RTCMode||(exports.RTCMode={}))[Qi.RTC=0]="RTC",Qi[Qi.LIVE=2]="LIVE",Qi[Qi.SIP=4]="SIP",Qi[Qi.CALL=5]="CALL",Qi[Qi.MEETING=6]="MEETING",Qi[Qi.CROSS_MUTI=7]="CROSS_MUTI",Qi[Qi.CROSS_LIVE=8]="CROSS_LIVE",function(e){e[e.AUDIO_AND_VIDEO=0]="AUDIO_AND_VIDEO",e[e.AUDIO=1]="AUDIO"}(Wi||(Wi={})),function(e){e[e.ANCHOR=1]="ANCHOR",e[e.AUDIENCE=2]="AUDIENCE"}(ji||(ji={})),exports.RTCApiType=void 0,(Ji=exports.RTCApiType||(exports.RTCApiType={}))[Ji.ROOM=1]="ROOM",Ji[Ji.PERSON=2]="PERSON",function(e){e[e.AnchorToViewer=1]="AnchorToViewer",e[e.ViewerToAnchor=2]="ViewerToAnchor"}(zi||(zi={})),exports.RTCJoinType=void 0,(Zi=exports.RTCJoinType||(exports.RTCJoinType={}))[Zi.KICK=0]="KICK",Zi[Zi.REFUSE=1]="REFUSE",Zi[Zi.COEXIST=2]="COEXIST";var $i=null;function es(e,t,n,r){void 0===n&&(n={});var o=["error","warn","info","debug"][3-e];if($i&&e<exports.LogLevel.FATAL)try{var i=JSON.stringify(n);$i[o](t,i)}catch(e){console.error(e)}}var ts,ns,rs=es.bind(null,exports.LogLevel.DEBUG),os={init:function(e){$i=e},info:es.bind(null,exports.LogLevel.INFO),debug:rs,warn:es.bind(null,exports.LogLevel.WARN),error:es.bind(null,exports.LogLevel.ERROR),fatal:es.bind(null,exports.LogLevel.FATAL)},is=function(){function e(){this._map={}}return e.prototype.on=function(e,t,n){var r=this._map[e]||(this._map[e]=[]);r.some((function(e){return e.listener===t&&e.target===n}))||r.push({listener:t,target:n})},e.prototype.once=function(e,t,n){var r=this._map[e]||(this._map[e]=[]);r.some((function(e){return e.listener===t&&e.target===n}))||r.push({listener:t,target:n,once:!0})},e.prototype.off=function(e,t,n){var r=this._map[e];r&&((r=r.filter((function(e){return e.listener!==t||e.target!==n}))).length?this._map[e]=r:delete this._map[e])},e.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=this._map[e];if(r)for(var o=r.length-1;o>=0;o-=1){var i=r[o],s=i.target,a=i.once,u=i.listener;a&&r.splice(o,1);try{u.call.apply(u,pe([s],de(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},e.prototype.removeAll=function(e){delete this._map[e]},e.prototype.clear=function(){Object.keys(this._map).forEach(this.removeAll,this)},e}(),ss=function(){function e(e,t,n){this.pbmaps=e,this.logger=n,this.pbModules=vr(t)}return e.prototype.getModule=function(e){return new this.pbModules[e]},e.prototype.encode=function(e,t,n){var r=new this.pbModules[e];if(t)try{this.pbmaps[e].forEach((function(e){var n=t[e];void 0!==n&&r["set".concat(function(e,t,n){if(void 0===t||void 0===n)return e.toUpperCase();var r=e.slice(t,n);return e.replace(r,(function(e){return e.toUpperCase()}))}(e,0,1))](n)}))}catch(t){var o="pbname: ".concat(e,", stack: ").concat(t.stack);this.logger?this.logger.error(exports.LogTagId.L_PB_ENCODE_E,o):null===console||void 0===console||console.error(exports.LogTagId.L_PB_ENCODE_E,o)}return n?r:r.toArrayBuffer()},e.prototype.decode=function(e,t){var n=this.pbModules[e].decode(t);return this.fixInt64Values(n)},e.prototype.fixInt64Values=function(e){var t=this;if(e instanceof Array)return e.map((function(e){return t.fixInt64Values(e)}));if(!gt(e))return e;if(void 0!==e.low&&void 0!==e.high&&Object.prototype.hasOwnProperty.call(e,"unsigned")){var n=e.low;return n<0&&(n+=4294967296),n=n.toString(16),parseInt(e.high.toString(16)+"00000000".replace(new RegExp("0{".concat(n.length,"}$")),n),16)}for(var r in e)e[r]=this.fixInt64Values(e[r]);return e},e}();!function(e){e.RtcInput="RtcInput",e.RtcUserListOutput="RtcUserListOutput",e.SetUserStatusInput="SetUserStatusInput",e.RtcSetDataInput="RtcSetDataInput",e.RtcUserSetDataInput="RtcUserSetDataInput",e.RtcDataInput="RtcDataInput",e.RtcSetOutDataInput="RtcSetOutDataInput",e.MCFollowInput="MCFollowInput",e.RtcTokenOutput="RtcTokenOutput",e.RtcQryOutput="RtcQryOutput",e.RtcQryUserOutDataInput="RtcQryUserOutDataInput",e.RtcUserOutDataOutput="RtcUserOutDataOutput",e.RtcQueryListInput="RtcQueryListInput",e.RtcRoomInfoOutput="RtcRoomInfoOutput",e.RtcValueInfo="RtcValueInfo",e.RtcKeyDeleteInput="RtcKeyDeleteInput",e.RtcNotifyMsg="RtcNotifyMsg",e.RtcPullKV="RtcPullKV",e.RtcKVOutput="RtcKVOutput",e.RtcQueryUserJoinedInput="RtcQueryUserJoinedInput",e.RtcQueryUserJoinedOutput="RtcQueryUserJoinedOutput",e.RtcViewerJoinedOutput="RtcViewerJoinedOutput",e.RtcInviteInput="RtcInviteInput",e.RtcCancelInviteInput="RtcCancelInviteInput",e.RtcInviteAnswerInput="RtcInviteAnswerInput",e.RtcEndInviteInput="RtcEndInviteInput",e.RtcOutput="RtcOutput"}(ns||(ns={}));var as,us=((ts={})[ns.RtcInput]=["roomType","broadcastType","extraInnerData","needSysChatroom","identityChangeType","joinType","innerDatas","outerDatas"],ts[ns.RtcUserListOutput]=["users","token","sessionId","roomInfo"],ts[ns.SetUserStatusInput]=["status"],ts[ns.RtcSetDataInput]=["interior","target","key","value","objectName","content"],ts[ns.RtcUserSetDataInput]=["valueInfo","objectName","content"],ts[ns.RtcDataInput]=["interior","target","key","objectName","content"],ts[ns.RtcSetOutDataInput]=["target","valueInfo","objectName","content"],ts[ns.MCFollowInput]=["state"],ts[ns.RtcTokenOutput]=["rtcToken"],ts[ns.RtcQryOutput]=["outInfo"],ts[ns.RtcQryUserOutDataInput]=["userId"],ts[ns.RtcUserOutDataOutput]=["user"],ts[ns.RtcQueryListInput]=["order"],ts[ns.RtcRoomInfoOutput]=["roomId","roomData","userCount","list"],ts[ns.RtcValueInfo]=["key","value"],ts[ns.RtcKeyDeleteInput]=["key"],ts[ns.RtcNotifyMsg]=["type","time","roomId"],ts[ns.RtcPullKV]=["timestamp","roomId"],ts[ns.RtcKVOutput]=["entries","bFullUpdate","syncTime"],ts[ns.RtcQueryUserJoinedInput]=["userId"],ts[ns.RtcQueryUserJoinedOutput]=["info"],ts[ns.RtcInviteInput]=["invitedUserId","timeoutTime","invitedRoomId","inviteInfo","inviteSessionId"],ts[ns.RtcCancelInviteInput]=["invitedUserId","invitedRoomId","inviteInfo","inviteSessionId"],ts[ns.RtcInviteAnswerInput]=["inviteUserId","answerCode","inviteRoomId","inviteSessionId","content","key","value"],ts[ns.RtcEndInviteInput]=["inviteRoomId","inviteSessionId","inviteContent","inviteRoomKeys"],ts),cs="\npackage Modules;\nmessage probuf {\n enum JoinType {\n KICK = 0; //踢前一个设备\n REFUSE = 1; //当前加入拒绝\n COEXIST = 2; //两个设备共存\n }\n enum targetType {\n ROOM =1 ;\n PERSON = 2;\n }\n message ".concat(ns.SetUserStatusInput,"\n {\n optional int32 status=1;\n }\n message ").concat(ns.MCFollowInput,"\n {\n required string state = 1;\n }\n message ").concat(ns.RtcQueryListInput,"{\n optional int32 order=1;\n }\n message ").concat(ns.RtcKeyDeleteInput,"{\n repeated string key=1;\n }\n message ").concat(ns.RtcValueInfo,"{\n required string key=1;\n required string value=2;\n }\n message RtcUserInfo{\n required string userId=1;\n repeated ").concat(ns.RtcValueInfo," userData=2; //用户资源信息\n }\n message ").concat(ns.RtcUserListOutput,"{\n repeated RtcUserInfo users=1;\n optional string token=2;\n optional string sessionId=3;\n repeated RtcValueInfo roomInfo = 4; //房间key value\n repeated RtcKVEntity entries = 5;//直播KV属性对象集合\n optional int64 syncTime = 6;//所有属性的最大时间戳(下次拉取KV时用)。\n optional int32 offlineKickTime = 7;//server超时踢人时间,默认60s\n }\n message RtcRoomInfoOutput{\n optional string roomId = 1;\n repeated ").concat(ns.RtcValueInfo," roomData = 2;\n optional int32 userCount = 3;\n repeated RtcUserInfo list=4;\n }\n message ").concat(ns.RtcInput,"{\n required int32 roomType=1;\n optional int32 broadcastType=2;\n optional RtcValueInfo extraInnerData = 3;\n optional bool needSysChatroom = 4; //是否需要同步聊天室\n optional IdentityChangeType identityChangeType = 5; //身份变更类型\n optional JoinType joinType = 6; // 加入房间类型\n repeated ").concat(ns.RtcValueInfo," innerDatas = 7; //用户内部inner数据,角色或者连麦信息等\n repeated ").concat(ns.RtcValueInfo," outerDatas = 8; //用户内部outer数据,自定义数据结构RtcInput。\n }\n message ").concat(ns.RtcQryOutput,"{\n repeated ").concat(ns.RtcValueInfo," outInfo=1;\n }\n message ").concat(ns.RtcDataInput,"{\n required bool interior=1;\n required targetType target=2;\n repeated string key=3;\n optional string objectName=4;\n optional string content=5;\n }\n message ").concat(ns.RtcSetDataInput,"{\n required bool interior=1;\n required targetType target=2;\n required string key=3;\n required string value=4;\n optional string objectName=5;\n optional string content=6;\n }\n message ").concat(ns.RtcUserSetDataInput," {\n repeated ").concat(ns.RtcValueInfo," valueInfo = 1;\n required string objectName = 2;\n repeated ").concat(ns.RtcValueInfo," content = 3;\n }\n message RtcQryInput{\n required bool isInterior=1;\n required targetType target=2;\n repeated string key=3;\n }\n message RtcDelDataInput{\n repeated string key=1;\n required bool isInterior=2;\n required targetType target=3;\n }\n message RtcOutput\n {\n optional int32 nothing=1;\n optional int64 version=2;\n }\n message ").concat(ns.RtcTokenOutput,"{\n required string rtcToken=1;\n }\n message ").concat(ns.RtcSetOutDataInput,"{\n required targetType target=1;\n repeated ").concat(ns.RtcValueInfo," valueInfo=2;\n optional string objectName=3;\n optional string content=4;\n }\n message ").concat(ns.RtcQryUserOutDataInput,"{\n repeated string userId = 1;\n }\n message ").concat(ns.RtcUserOutDataOutput,"{\n repeated RtcUserInfo user = 1;\n }\n message ").concat(ns.RtcNotifyMsg," \n {\n required int32 type= 1; //(通知类型 1:rtc房间状态KV变更通知)\n optional int64 time= 2; //消息产生时间\n optional string roomId=3; //主播房间id\n }\n message ").concat(ns.RtcPullKV,"\n {\n required int64 timestamp = 1;\n required string roomId = 2;\n }\n message RtcKVEntity \n {\n required string key = 1;\n required string value = 2;\n optional int32 status = 3;\n optional int64 timestamp = 4;\n optional string uid = 5;\n }\n message ").concat(ns.RtcKVOutput,"\n {\n repeated RtcKVEntity entries = 1;\n optional bool bFullUpdate = 2;\n optional int64 syncTime = 3; \n }\n enum IdentityChangeType \n {\n AnchorToViewer = 1; //1为主播变观众\n ViewerToAnchor = 2; //2为观众变主播\n }\n message ").concat(ns.RtcQueryUserJoinedInput,"\n {\n required string userId = 1;\n }\n message RtcJoinedInfo\n {\n required string deviceId = 1; //设备ID\n required string roomId = 2; //加入的房间ID\n optional int64 joinTime = 3; //加入的时间\n }\n message ").concat(ns.RtcQueryUserJoinedOutput,"\n {\n repeated RtcJoinedInfo info = 1;\n }\n message ").concat(ns.RtcViewerJoinedOutput,"\n {\n required string rtcToken=1;\n repeated RtcKVEntity entries = 2;//KV属性对象集合\n optional int64 syncTime = 3;//所有属性的最大时间戳(下次拉取KV时用)。\n }\n message ").concat(ns.RtcInviteInput,"\n {\n required string invitedUserId=1; //被邀请的人的uid\n optional int32 timeoutTime=2; //邀请超时时间(秒),默认三十秒\n required string invitedRoomId=3; //被邀请的房间\n required string inviteInfo=4; //邀请的信息(包含邀请人,被邀请人,各自userid)客户端定义好.协议栈和server透传\n required string inviteSessionId= 5; //客户端保证唯一性(建议roomid_userid_时间戳_随机数)\n }\n message ").concat(ns.RtcCancelInviteInput,"\n {\n required string invitedUserId=1; //被邀请的人的uid\n required string invitedRoomId=2; //被邀请的房间\n required string inviteInfo=3; //取消邀请的信息(包含邀请人,被邀请人,各自userid)客户端定义好.协议栈和server透传\n required string inviteSessionId=4; //邀请的sessionId,客户端发起邀请时产生\n }\n message ").concat(ns.RtcInviteAnswerInput,"\n {\n required string inviteUserId=1; //邀请的人的uid\n required int32 answerCode=2; //是否接受连麦邀请.0为拒绝,1为接受\n required string inviteRoomId=3; //邀请的房间\n required string inviteSessionId=4; //邀请的sessionId\n required string content=5; //需要转发的content\n optional string key=6; //如果接受的话,需要加这个字段,放在room级别的k和v,新加入房间的能拉取到\n optional string value=7; //如果接受的话,需要加这个字段,放在room级别的k和v,新加入房间的能拉取到\n }\n message ").concat(ns.RtcEndInviteInput,"\n {\n required string inviteRoomId=1; //邀请的房间\n required string inviteSessionId=2; //邀请的sessionId\n required string inviteContent=3; //结束连麦的信息(需要透传给房间内其他人)\n repeated string inviteRoomKeys=4; //需要删除连麦的信息的key\n }\n}\n"),ls=function(e,t,n,r,o,i){var s=o?Object.keys(o).map((function(t){return e.encode(ns.RtcValueInfo,{key:t,value:o[t]},!0)})):void 0,a=i?Object.keys(i).map((function(t){return e.encode(ns.RtcValueInfo,{key:t,value:i[t]},!0)})):void 0;return e.encode(ns.RtcInput,{roomType:t,broadcastType:n,joinType:r,innerDatas:s,outerDatas:a})},ds=function(e,t){var n=e.decode(ns.RtcUserListOutput,t),r=n.users,o=n.token,i=n.sessionId,s=n.roomInfo,a=n.entries,u=n.offlineKickTime,c={};return St(r,(function(e){var t=e.userId,n=e.userData,r={};St(n,(function(e){var t=e.key,n=e.value;r[t]=n})),c[t]=r})),{users:c,token:o,sessionId:i,roomInfo:s,kvEntries:a,offlineKickTime:u}};!function(e){e[e.ppMsgP=1]="ppMsgP",e[e.ppMsgN=2]="ppMsgN",e[e.ppMsgS=3]="ppMsgS",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.pullUS=24]="pullUS",e[e.sendMsgRead=25]="sendMsgRead",e[e.qryMsgRead=26]="qryMsgRead",e[e.qryMsgReadCntBatch=27]="qryMsgReadCntBatch",e[e.updRTime=28]="updRTime",e[e.pgMsgS=29]="pgMsgS",e[e.chatMsgS=30]="chatMsgS",e[e.qrySessionsAtt=31]="qrySessionsAtt",e[e.pullMsg=32]="pullMsg",e[e.qrySessions=33]="qrySessions",e[e.delSessions=34]="delSessions",e[e.delMsg=35]="delMsg",e[e.delUgMsg=36]="delUgMsg",e[e.updRRTime=37]="updRRTime",e[e.qrySessionsUnread=38]="qrySessionsUnread",e[e.setTypeUnpush=39]="setTypeUnpush",e[e.chrmPull=40]="chrmPull",e[e.joinChrm=41]="joinChrm",e[e.joinChrmR=42]="joinChrmR",e[e.exitChrm=43]="exitChrm",e[e.queryChrmI=44]="queryChrmI",e[e.setKV=45]="setKV",e[e.delKV=46]="delKV",e[e.setKVS=47]="setKVS",e[e.delKVS=48]="delKVS",e[e.pullKV=49]="pullKV",e[e.qryRelation=50]="qryRelation",e[e.qryRelationR=51]="qryRelationR",e[e.delRelation=52]="delRelation",e[e.delRelationBatch=53]="delRelationBatch",e[e.pullSeAtts=54]="pullSeAtts",e[e.setSeAtt=55]="setSeAtt",e[e.qnTkn=56]="qnTkn",e[e.qnUrl=57]="qnUrl",e[e.aliUrl=58]="aliUrl",e[e.s3Url=59]="s3Url",e[e.stcUrl=60]="stcUrl",e[e.minioUrl=61]="minioUrl",e[e.cleanPMsg=62]="cleanPMsg",e[e.cleanGMsg=63]="cleanGMsg",e[e.cleanCMsg=64]="cleanCMsg",e[e.cleanSMsg=65]="cleanSMsg",e[e.cleanMCMsg=66]="cleanMCMsg",e[e.cleanMPMsg=67]="cleanMPMsg",e[e.cleanMsgBatch=68]="cleanMsgBatch",e[e.rtcPing=69]="rtcPing",e[e.rtc_ntf=70]="rtc_ntf",e[e.rtcSetOutData=71]="rtcSetOutData",e[e.rtcQryUserOutData=72]="rtcQryUserOutData",e[e.addSeTag=73]="addSeTag",e[e.delSeTag=74]="delSeTag",e[e.addTag=75]="addTag",e[e.delTag=76]="delTag",e[e.disTag=77]="disTag",e[e.reportsdk=78]="reportsdk",e[e.pullUgSes=79]="pullUgSes",e[e.pullUgMsg=80]="pullUgMsg",e[e.ugMsg=81]="ugMsg",e[e.qryUgMsg=82]="qryUgMsg",e[e.updUgRTime=83]="updUgRTime",e[e.upMsgEx=84]="upMsgEx",e[e.modifyMsg=85]="modifyMsg",e[e.qryMsgChange=86]="qryMsgChange",e[e.qryMsg=87]="qryMsg",e[e.operate=88]="operate",e[e.s_opNtf=89]="s_opNtf",e[e.ugUnpushQuery=90]="ugUnpushQuery",e[e.ugUnpushSet=91]="ugUnpushSet",e[e.setRtcRoomId=92]="setRtcRoomId",e[e.qryUgUal=93]="qryUgUal",e[e.updUserSub=94]="updUserSub",e[e.pullUserSub=95]="pullUserSub",e[e.pullSubData=96]="pullSubData",e[e.qrySubData=97]="qrySubData",e[e.pullUserProfile=98]="pullUserProfile",e[e.pullOwnProfile=99]="pullOwnProfile",e[e.updProfilePermiss=100]="updProfilePermiss",e[e.qProfilePermiss=101]="qProfilePermiss",e[e.searchUserProfile=102]="searchUserProfile",e[e.updUserProfile=103]="updUserProfile",e[e.pullEventChange=104]="pullEventChange",e[e.channelCreate=105]="channelCreate",e[e.upChannelInfo=106]="upChannelInfo",e[e.qChannelInfo=107]="qChannelInfo",e[e.channelMemKick=108]="channelMemKick",e[e.channelMemQuit=109]="channelMemQuit",e[e.channelDismiss=110]="channelDismiss",e[e.channelTransfer=111]="channelTransfer",e[e.upChannelManager=112]="upChannelManager",e[e.qChannelMem=113]="qChannelMem",e[e.qChannelSpeMem=114]="qChannelSpeMem",e[e.upChannelMem=115]="upChannelMem",e[e.channelMemJoin=116]="channelMemJoin",e[e.channelMemInvite=117]="channelMemInvite",e[e.channelApplyResp=118]="channelApplyResp",e[e.qChannelApplyList=119]="qChannelApplyList",e[e.qChannelMemJoin=120]="qChannelMemJoin",e[e.qChannelMemSpeJoin=121]="qChannelMemSpeJoin",e[e.upChannelRemark=122]="upChannelRemark",e[e.qChannelRemark=123]="qChannelRemark",e[e.upChannelFollow=124]="upChannelFollow",e[e.qChannelFollow=125]="qChannelFollow",e[e.qSimpleUserProfile=126]="qSimpleUserProfile",e[e.friendAdd=127]="friendAdd",e[e.friendDel=128]="friendDel",e[e.friendHandle=129]="friendHandle",e[e.friendSetPf=130]="friendSetPf",e[e.friendCheck=131]="friendCheck",e[e.friendsQuery=132]="friendsQuery",e[e.friendApplyDel=133]="friendApplyDel",e[e.friendsInfoQry=134]="friendsInfoQry",e[e.friendAuthSet=135]="friendAuthSet",e[e.friendAuthGet=136]="friendAuthGet",e[e.addUnpush=137]="addUnpush",e[e.qryUnpush=138]="qryUnpush",e[e.delUnpush=139]="delUnpush",e[e.s_pubCall=140]="s_pubCall",e[e.reqCall=141]="reqCall",e[e.pullKvMsg=142]="pullKvMsg"}(as||(as={}));var ps,hs,_s,gs=function(e){var t=as[e];return t},fs=function(e){return as[e]};!function(e){e[e.AT_MOST_ONCE=0]="AT_MOST_ONCE",e[e.AT_LEAST_ONCE=1]="AT_LEAST_ONCE",e[e.EXACTLY_ONCE=2]="EXACTLY_ONCE",e[e.DEFAULT=3]="DEFAULT"}(ps||(ps={})),function(e){e[e.SYMMETRIC=0]="SYMMETRIC",e[e.CONNECT=1]="CONNECT",e[e.CONN_ACK=2]="CONN_ACK",e[e.PUBLISH=3]="PUBLISH",e[e.PUB_ACK=4]="PUB_ACK",e[e.QUERY=5]="QUERY",e[e.QUERY_ACK=6]="QUERY_ACK",e[e.QUERY_CONFIRM=7]="QUERY_CONFIRM",e[e.PING=12]="PING",e[e.PONG=13]="PONG",e[e.DISCONNECT=14]="DISCONNECT",e[e.PCONNECT=8]="PCONNECT",e[e.PCONNECT_ACK=9]="PCONNECT_ACK",e[e.RESERVED=10]="RESERVED",e[e.RESERVED_2=11]="RESERVED_2",e[e.RESERVED_3=15]="RESERVED_3"}(hs||(hs={})),function(e){e[e.V4=4]="V4",e[e.V3=3]="V3"}(_s||(_s={}));var Es,Is,Ts,vs,Cs,Rs,ys,ms,Ss,As,Ns,Os="rtcRJoin_data",Ms="rtcRExit",Ls="rtcRInfo",Us="rtcUData",bs="rtcUPut",Ps="rtcUDel",ws="rtcSetData",xs="userSetData",Ds="rtcQryData",Vs="rtcDelData",Gs="rtcToken",ks="rtcUserState",Fs="rtcUList",Bs="viewerJoinR",Hs="viewerExitR",qs="rtcPullKv",Ys="rtcIdentityChange",Ks="rtcInvite",Qs="rtcCancelInvite",Ws="rtcInviteAnswer",js="rtcEndInvite",Js="rtcQueryJoined",zs=0,Zs=1,Xs=2,$s=3,ea=4,ta=5,na=6,ra=7,oa=8,ia=9,sa=10,aa=11,ua=12,ca=13,la=14,da=15,pa=16,ha=17,_a=18,ga=19,fa=20,Ea=1,Ia=2,Ta=4,va=5,Ca=6,Ra=7,ya=8,ma=9,Sa=function(){function e(){}return e.writeUTF=function(e,t){for(var n=this._getBackAndByteSize(e),r=n.back,o=n.byteSize,i=0,s=r.length;i<s;i++)r[i]>255&&(r[i]&=255);return t?r:o<=255?[0,o].concat(r):[o>>8,255&o].concat(r)},e._getBackAndByteSize=function(e){var t=[],n=0;if("string"==typeof e)for(var r=0,o=e.length;r<o;r++){var i=e.charCodeAt(r);i>=0&&i<=127?(n+=1,t.push(i)):i>=128&&i<=2047?(n+=2,t.push(192|31&i>>6),t.push(128|63&i)):i>=2048&&i<=65535&&(n+=3,t.push(224|15&i>>12),t.push(128|63&i>>6),t.push(128|63&i))}return{byteSize:n,back:t}},e.readUTF=function(e){for(var t,n,r=[],o=-1,i=e,s="";++o<i.length;){var a=Number(i[o]);if(a===(127&a)||(240&~a?224&~a?192&~a||(a=(a^=192)<<6|128^i[++o]):a=(a=(a^=224)<<6|128^i[++o])<<6|128^i[++o]:a=(a=(a=(a^=240)<<6|128^i[++o])<<6|128^i[++o])<<6|128^i[++o]),!Number.isFinite(a)||a<0||a>1114111||Math.floor(a)!==a)throw RangeError("Invalid code point: ".concat(a));a<=65535?r.push(a):(t=(a-=65536)>>10|55296,n=a%1024|56320,r.push(t,n)),(o+1===i.length||r.length>16384)&&(s+=String.fromCharCode.apply(null,r),r.length=0)}return s},e}(),Aa=function(){function e(e){this._position=0,this._poolLen=0,this._pool=e,this._poolLen=e.length}return e.prototype.check=function(){return this._position>=this._pool.length},e.prototype.read2Byte=function(){var e=this;if(e.check())return-1;for(var t="",n=0;n<2;n++){var r=e._pool[e._position++].toString(16);1===r.length&&(r="0".concat(r)),t+=r.toString()}return parseInt(t,16)},e.prototype.readInt32=function(){return(this.readByte()<<24)+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},e.prototype.readLong=function(){var e=this;if(e.check())return-1;for(var t="",n=0;n<8;n++){var r=e._pool[e._position++].toString(16);1===r.length&&(r="0".concat(r)),t+=r}return parseInt(t,16)},e.prototype.readByte=function(){if(this.check())return-1;var e=this._pool[this._position++];return e>255&&(e&=255),e},e.prototype.readUTF=function(){if(this.check())return"";var e=this.readByte()<<8|this.readByte(),t=this._position;this._position+=e;var n=this._pool.subarray(t,this._position);return Sa.readUTF(n)},e.prototype.readAll=function(){return this._pool.subarray(this._position,this._poolLen)},e}(),Na=function(){function e(){this._pool=[]}return e.prototype.writeByte=function(e){e>=0&&(e>255&&(e&=255),this._pool.push(e))},e.prototype.writeBuffer=function(e){this._pool=this._pool.concat(pe([],de(new Int8Array(e)),!1))},e.prototype.writeArr=function(e){this._pool=this._pool.concat(e)},e.prototype.writeUTF=function(e){var t=Sa.writeUTF(e);this._pool=this._pool.concat(t)},e.prototype.getBytesArray=function(){return this._pool},e}(),Oa=function(){function e(e,t,n,r,o){void 0===t&&(t=ps.AT_LEAST_ONCE),void 0===n&&(n=!1),void 0===r&&(r=!1),void 0===o&&(o=!1),this.command=e,this.qos=t,this._retain=n,this._dup=r,this.syncMsg=o}return e.parse=function(t){return new e(t>>4&15,(6&t)>>1,(1&t)>0,(8&t)>0,!(8&~t))},e.prototype.encode=function(){var e=this.command<<4;return e|=this._retain?1:0,e|=this.qos<<1,e|=this._dup?8:0},e}(),Ma=function(){function e(e){this.header=e,this.timestamp=0}return e.prototype.read=function(e,t,n){this.readMessage(e,t,n)},e.prototype.readMessage=function(e,t,n){return{stream:e,length:t}},e}(),La=function(){function e(e){this.messageId=0,this._header=new Oa(e,ps.AT_MOST_ONCE)}return e.prototype.write=function(e){var t=this.getHeaderFlag();e.writeByte(t),this.writeMessage(e)},e.prototype.setHeaderQos=function(e){this._header.qos=e},e.prototype.getHeaderFlag=function(){return this._header.encode()},e.prototype.getArrayBuffer=function(){var e=new Na;this.write(e);var t=e.getBytesArray();return new Int8Array(t).buffer},e}(),Ua=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.status=null,t.userId=null,t.timestamp=0,t.messageId=0,t.sessionId="",t}return t(n,e),n.prototype.readMessage=function(e,t,r){if(e.readByte(),this.status=e.readByte(),t<=n.MESSAGE_LENGTH)return{stream:e,length:t};if(r===_s.V4){var o=e.readByte();1&o&&(this.userId=e.readUTF()),2&o&&(this.sessionId=e.readUTF()),4&o&&(this.timestamp=e.readLong()),8&o&&(this.messageId=e.read2Byte())}else this.userId=e.readUTF(),this.sessionId=e.readUTF(),this.timestamp=e.readLong();return{stream:e,length:t}},n.MESSAGE_LENGTH=2,n}(Ma),ba=function(e){function n(t){var n=e.call(this,hs.DISCONNECT)||this;return n.status=t,n}return t(n,e),n.prototype.writeMessage=function(e){e.writeArr([0,this.status])},n}(La),Pa=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.status=0,t}return t(n,e),n.prototype.readMessage=function(e,t){return e.readByte(),this.status=e.readByte(),this.data=e.readAll(),{stream:e,length:t}},n.MESSAGE_LENGTH=2,n}(Ma),wa=function(e){function n(){return e.call(this,hs.PING)||this}return t(n,e),n.prototype.writeMessage=function(e){},n}(La),xa=function(e){function n(t){return e.call(this,t)||this}return t(n,e),n}(Ma),Da=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.messageId=0,t}return t(n,e),n.prototype.readMessage=function(e,t){var n=256*e.readByte()+e.readByte();return this.messageId=parseInt(n.toString(),10),{stream:e,length:t}},n}(Ma),Va=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),n.prototype.writeMessage=function(e){var t=this.messageId,n=255&t,r=(65280&t)>>8;e.writeByte(r),e.writeByte(n)},n}(La),Ga=function(e){function n(t){var n=e.call(this,t)||this;return n.topic="",n.targetId="",n.date=0,n.syncMsg=!1,n.syncMsg=t.syncMsg,n}return t(n,e),n.prototype.readMessage=function(t,n){return this.date=t.readInt32(),this.topic=t.readUTF(),this.targetId=t.readUTF(),e.prototype.readMessage.call(this,t,n),this.pbData=t.readAll(),{stream:t,length:n}},n}(Da),ka=function(e){function n(t,n,r,o){var i=e.call(this,t)||this;return i.targetId=r,i.pbData=o,i.topic="string"==typeof n?n:fs(n),i}return t(n,e),n.prototype.writeMessage=function(t){t.writeUTF(this.topic),t.writeUTF(this.targetId),e.prototype.writeMessage.call(this,t),t.writeBuffer(this.pbData)},n}(Va),Fa=function(e){function n(t,n,r){return e.call(this,hs.QUERY,t,r,n)||this}return t(n,e),n}(ka),Ba=function(e){function n(t,n,r){return e.call(this,hs.PUBLISH,t,r,n)||this}return t(n,e),n}(ka),Ha=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.status=0,t.date=0,t.millisecond=0,t.messageUId="",t.timestamp=0,t}return t(n,e),n.prototype.readMessage=function(t,n){return e.prototype.readMessage.call(this,t,n),this.date=t.readInt32(),this.status=256*t.readByte()+t.readByte(),this.millisecond=256*t.readByte()+t.readByte(),this.timestamp=1e3*this.date+this.millisecond,this.messageUId=t.readUTF(),{stream:t,length:n}},n}(Da),qa=function(e){function n(t){var n=e.call(this,hs.PUB_ACK)||this;return n.messageId=t,n}return t(n,e),n}(Va),Ya=function(e){function n(t){var n=e.call(this,hs.QUERY_CONFIRM)||this;return n.messageId=t,n}return t(n,e),n}(Va),Ka=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.status=0,t.date=0,t}return t(n,e),n.prototype.readMessage=function(t,n){return e.prototype.readMessage.call(this,t,n),this.date=t.readInt32(),this.status=256*t.readByte()+t.readByte(),this.pbData=t.readAll(),{stream:t,length:n}},n}(Da),Qa=function(e,t){var n=new Uint8Array(e),r=new Aa(n),o=r.readByte(),i=function(e){var t,n=e.command;switch(n){case hs.CONN_ACK:t=new Ua(e);break;case hs.PUBLISH:t=new Ga(e);break;case hs.PUB_ACK:t=new Ha(e);break;case hs.QUERY_ACK:t=new Ka(e);break;case hs.PONG:t=new xa(e);break;case hs.DISCONNECT:t=new Pa(e);break;default:console.error("No support for deserializing ".concat(n," messages"))}return t}(Oa.parse(o));return i&&i.read(r,n.length-1,t),i},Wa=function(){function e(e){this._pullQueue=[],this._isPulling=!1,this._pullTime=0,this._engine=e}return e.prototype._startPull=function(){return ue(this,void 0,void 0,(function(){var e,t,n,r,o,i,s;return ce(this,(function(a){switch(a.label){case 0:return this._isPulling||0===this._pullQueue.length?[2]:(this._isPulling=!0,e=this._pullQueue.splice(0,1)[0],t=e.roomId,n=e.timestamp,(r=this._pullTime)>n?(this._isPulling=!1,this._startPull(),[2]):[4,this._engine.pullRTCRoomEntry(t,r)]);case 1:return o=a.sent(),i=o.code,s=o.data,i===exports.ErrorCode.SUCCESS?(this._isPulling=!1,this._pullTime=s||0,this._startPull()):this._startPull(),[2]}}))}))},e.prototype.pullEntry=function(e,t){this._pullQueue.push({roomId:e,timestamp:t}),this._startPull()},e.prototype.reset=function(){this._pullTime=0,this._isPulling=!1},e}(),ja=function(){function e(e,t,n,r){this.rtcCodec=e,this._watcher=t,this._options=n,this.logger=r,this._appkey=this._options.appkey,this._rtcKVManager=new Wa(this)}return e.prototype.registerRTCSignalingListener=function(e){this._rtcSignalingListener=e},e.prototype.getInnerLogger=function(){return this.logger},e.prototype.pullRTCRoomEntry=function(e,t){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return t=this.rtcCodec.encode(ns.RtcPullKV,{timestamp:0,roomId:e}),[4,this.rtcSignaling(e,qs,!0,t)];case 1:return n=u.sent(),r=n.code,o=n.buffer,r!==exports.ErrorCode.SUCCESS?[2,{code:r}]:(i=this.rtcCodec.decode(ns.RtcKVOutput,o),s=i.entries,a=i.syncTime,s=(s||[]).map((function(e){return se(se({},e),{timestamp:mt(e.timestamp)})})),this._watcher.onRTCDataChange(s,e),[2,{code:r,data:a}])}}))}))},e.prototype._receiveRtcKv=function(e){if(this._rtcSignalingListener)this._rtcSignalingListener(e);else{var t=this.rtcCodec.decode(ns.RtcNotifyMsg,e),n=t.time,r=t.type,o=t.roomId;1===r&&this._rtcKVManager.pullEntry(o,mt(n))}},e.prototype.destroy=function(){},e}();exports.StreamMessageResponseEventType=void 0,(Es=exports.StreamMessageResponseEventType||(exports.StreamMessageResponseEventType={})).INIT="INIT",Es.DATA="DATA",Es.END="END";var Ja=function(e){function n(t,n){var r=e.call(this)||this;return Is.add(r),Ts.set(r,void 0),vs.set(r,new Map),Cs.set(r,void 0),_e(r,Ts,t,"f"),_e(r,Cs,n,"f"),r}return t(n,e),n.prototype.requestStreamMessageContent=function(e){return ue(this,void 0,void 0,(function(){var t,n,r=this;return ce(this,(function(o){switch(o.label){case 0:return t=he(this,Is,"a",Rs).createTraceId(),he(this,Is,"a",Rs).info(exports.LogTagId.L_REQ_STREAM_MSG_CONTENT_T,"messageUId: ".concat(e),t),[4,at.create("requestStreamMessageContent").isLimitedString("messageUId",e,1,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID,"messageUId is invalid.").result().tryTrans(he(this,Ts,"f").validatorConnected).tryTrans((function(e){var t,n;return(null===(n=null===(t=null==e?void 0:e.streamServer)||void 0===t?void 0:t.addrs)||void 0===n?void 0:n.length)?it(e.streamServer.addrs):st(exports.ErrorCode.STREAM_MESSAGE_DISABLE)})).next((function(t){return he(r,Is,"m",Ns).call(r,e,t)}))];case 1:return n=o.sent(),he(this,Is,"a",Rs).summary(exports.LogTagId.L_REQ_STREAM_MSG_CONTENT_R,n,t,{messageUId:e}),[2,n.wipe()]}}))}))},n}(nt);Ts=new WeakMap,vs=new WeakMap,Cs=new WeakMap,Is=new WeakSet,Rs=function(){return he(this,Ts,"f").logger},ys=function(e,t,n){var r=he(this,vs,"f").get(e);r&&(he(this,vs,"f").delete(e),he(this,Is,"m",ms).call(this,e,exports.StreamMessageResponseEventType.END,t,r.msg))},ms=function(e,t,n,r,o){this.emit("message",{code:n,messageUId:e,type:t,chunk:o,message:r})},Ss=function(e,t){e.content=se(se({},e.content),t),he(this,Ts,"f").setMessageContent(e.messageId,e.content,e.messageType)},As=function(e,t,n){var r,o,i=he(this,vs,"f").get(t);switch(e){case"init":i.msg&&he(this,Is,"m",Ss).call(this,i.msg,{content:"",stopReason:0,completeReason:0,isSynced:!1}),he(this,Is,"m",ms).call(this,t,exports.StreamMessageResponseEventType.INIT,exports.ErrorCode.SUCCESS,i.msg);break;case"complete":o=(r=n.length?JSON.parse(n):{}).complete||!1,i.msg&&he(this,Is,"m",Ss).call(this,i.msg,{stopReason:r.stopReason||0,completeReason:r.completeReason||0,complete:o,isSynced:o}),he(this,Is,"m",ys).call(this,t,r.stopReason||0,o);break;default:r=JSON.parse(n),i.cached+=r.content,i.msg&&he(this,Is,"m",Ss).call(this,i.msg,{content:i.cached}),he(this,Is,"m",ms).call(this,t,exports.StreamMessageResponseEventType.DATA,exports.ErrorCode.SUCCESS,i.msg,{content:r.content,fullContent:i.cached})}},Ns=function(e,t){return ue(this,void 0,void 0,(function(){var n,r,o,i,s,a,u,c=this;return ce(this,(function(l){switch(l.label){case 0:return he(this,vs,"f").has(e)?[2,st(exports.ErrorCode.STREAM_MESSAGE_REQUEST_IN_PROCESS,"Request in process, msgUId: ".concat(e))]:he(this,vs,"f").size>=3?[2,st(exports.ErrorCode.STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED,"The request queue is full")]:(n=Tr.createSSEClient({logger:he(this,Is,"a",Rs),msgUId:e,appkey:he(this,Ts,"f").appkey,token:he(this,Ts,"f").token,timeout:3e4,onRawContent:function(t){var n=t.split("\n\n");console.log("recv events ->",n),n.forEach((function(t){if(0!==t.length){t.startsWith("data:")&&(t="event:delta\n".concat(t));var n=t.indexOf("\n"),r=t.slice(0,n).replace("event:",""),o=t.slice(n+1+5);he(c,Is,"m",As).call(c,r,e,o.trim())}}))},onNetworkError:function(t){he(c,Is,"m",ys).call(c,e,t,!1)}}),n.isOk?(r=n.data,o={client:r,cached:"",msg:void 0},he(this,vs,"f").set(e,o),he(this,Cs,"f")?[4,he(this,Ts,"f").getLocalMessage(e)]:[3,2]):[2,n.wipe()]);case 1:if(i=l.sent(),s=i.code,!(a=i.data))return he(this,vs,"f").delete(e),[2,st(s,"message not found, msgUId: ".concat(e))];if(a.content.isSynced)return he(this,vs,"f").delete(e),[2,st(exports.ErrorCode.STREAM_MESSAGE_SYNCED,"synced")];o.msg=a,l.label=2;case 2:return[4,r.open(t.slice())];case 3:return(u=l.sent()).isOk||he(this,vs,"f").delete(e),[2,u.wipe()]}}))}))};var za,Za,Xa=function(){function e(e){this._context=e}return e.prototype.__getContext=function(){return this._context},e.prototype.createCodec=function(e,t){return new ss(e,t)},e.prototype.createPBCodec=function(e,t){return new Rr(e,t)},e.prototype.refetchNaviInfo=function(){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){return[2,this._context.refetchNaviInfo()]}))}))},e.prototype.getNaviInfo=function(){return this._context.getNaviInfoFromCache()},e.prototype.getCoreVersion=function(){return"5.20.0-c-unikit.1"},e.prototype.getAPIVersion=function(){return"5.20.0-c-unikit.1"},e.prototype.getAppkey=function(){return this._context.appkey},e.prototype.getCurrentId=function(){return this._context.getCurrentUserId()},e.prototype.getUserToken=function(){return this._context.token},e.prototype.getConnectionStatus=function(){return this._context.getConnectionStatus()},e.prototype.getDeviceId=function(){return this._context.getDeviceId()},e.prototype.setPushConfig=function(e){this._context.setPushConfig(e)},e.prototype.sendMessage=function(e,t,n){return this._context.sendMessage(e,t,n)},e.prototype.registerMessageType=function(e,t,n,r){void 0===r&&(r=[]),this._context.registerMessageType(e,t,n,r)},e.prototype.getServerTime=function(){return this._context.getServerTime()},e.prototype.getOSInfo=function(){return this._context.getOSInfo()},e.prototype.getProcessInfo=function(){return this._context.getProcessInfo()},e.prototype.getMainProcessInfo=function(){return this._context.getMainProcessInfo()},e.prototype.setCallInfo=function(e,t,n){return this._context.setCallInfo(e,t,n)},e.prototype.createLogger=function(e,t){return this._context.createLogger(e,t)},e.prototype.getStatsUrlList=function(){return this._context.getStatsUrlList()},e}(),$a=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),n.prototype.joinRTCRoom=function(e,t,n,r,o,i){return ue(this,void 0,void 0,(function(){var s,a,u,c,l;return ce(this,(function(d){switch(d.label){case 0:return s=ls(this._context.rtcCodec,t,n,r,o,i),[4,this.rtcSignaling(e,Os,!0,s)];case 1:return a=d.sent(),u=a.code,c=a.buffer,u===exports.ErrorCode.SUCCESS&&c&&(l=ds(this._context.rtcCodec,c)),[2,{code:u,data:l}]}}))}))},n.prototype.quitRTCRoom=function(e){return ue(this,void 0,void 0,(function(){var t;return ce(this,(function(n){switch(n.label){case 0:return t=this._context.rtcCodec.encode(ns.SetUserStatusInput,{status:0}),[4,this.rtcSignaling(e,Ms,!0,t)];case 1:return[2,n.sent().code]}}))}))},n.prototype.rtcPing=function(e,t,n){return ue(this,void 0,void 0,(function(){return ce(this,(function(r){switch(r.label){case 0:return[4,this._context.rtcPing(e,t,n)];case 1:return[2,r.sent().code]}}))}))},n.prototype.rtcPingResVersion=function(e,t,n){return this._context.rtcPing(e,t,n)},n.prototype.getRTCRoomInfo=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i;return ce(this,(function(s){switch(s.label){case 0:return t=this._context.rtcCodec.encode(ns.RtcQueryListInput,{order:2}),[4,this.rtcSignaling(e,Ls,!0,t)];case 1:return n=s.sent(),r=n.code,o=n.buffer,r===exports.ErrorCode.SUCCESS&&o&&(i=this._context.rtcCodec.decode(ns.RtcRoomInfoOutput,o)),[2,{code:r,data:i}]}}))}))},n.prototype.getRTCUserInfoList=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s;return ce(this,(function(a){switch(a.label){case 0:return t=this._context.rtcCodec.encode(ns.RtcQueryListInput,{order:2}),[4,this.rtcSignaling(e,Us,!0,t)];case 1:return n=a.sent(),r=n.code,o=n.buffer,r===exports.ErrorCode.SUCCESS&&o&&(s=ds(this._context.rtcCodec,o),i={users:s.users}),[2,{code:r,data:i}]}}))}))},n.prototype.getRTCUserInfo=function(e){throw new Error("Method not implemented.")},n.prototype.setRTCUserInfo=function(e,t,n){return ue(this,void 0,void 0,(function(){var r;return ce(this,(function(o){switch(o.label){case 0:return r=this._context.rtcCodec.encode(ns.RtcValueInfo,{key:t,value:n}),[4,this.rtcSignaling(e,bs,!0,r)];case 1:return[2,o.sent().code]}}))}))},n.prototype.removeRTCUserInfo=function(e,t){return ue(this,void 0,void 0,(function(){var n;return ce(this,(function(r){switch(r.label){case 0:return n=this._context.rtcCodec.encode(ns.RtcKeyDeleteInput,{key:t}),[4,this.rtcSignaling(e,Ps,!1,n)];case 1:return[2,r.sent().code]}}))}))},n.prototype.setRTCData=function(e,t,n,r,o,i){return ue(this,void 0,void 0,(function(){var s;return ce(this,(function(a){switch(a.label){case 0:return s=this._context.rtcCodec.encode(ns.RtcSetDataInput,{interior:r,target:o,key:t,value:n,objectName:null==i?void 0:i.name,content:null==i?void 0:i.content}),[4,this.rtcSignaling(e,ws,!1,s)];case 1:return[2,a.sent().code]}}))}))},n.prototype.setRTCTotalRes=function(e,t,n,r,o){return void 0===o&&(o=""),ue(this,void 0,void 0,(function(){var i,s;return ce(this,(function(a){switch(a.label){case 0:return i={objectName:r,content:this._context.rtcCodec.encode(ns.RtcValueInfo,{key:t.name,value:t.content},!0),valueInfo:[this._context.rtcCodec.encode(ns.RtcValueInfo,{key:"uris",value:n},!0),this._context.rtcCodec.encode(ns.RtcValueInfo,{key:"mcu_uris",value:o},!0)]},s=this._context.rtcCodec.encode(ns.RtcUserSetDataInput,i),[4,this.rtcSignaling(e,xs,!0,s)];case 1:return[2,a.sent().code]}}))}))},n.prototype.setRTCCDNUris=function(e,t,n){return ue(this,void 0,void 0,(function(){var r;return ce(this,(function(o){switch(o.label){case 0:return r=this._context.rtcCodec.encode(ns.RtcUserSetDataInput,{objectName:t,valueInfo:this._context.rtcCodec.encode(ns.RtcValueInfo,{key:"cdn_uris",value:n},!0)}),[4,this.rtcSignaling(e,xs,!0,r)];case 1:return[2,o.sent().code]}}))}))},n.prototype.getRTCData=function(e,t,n,r){return ue(this,void 0,void 0,(function(){var o,i,s,a,u,c;return ce(this,(function(l){switch(l.label){case 0:return o=this._context.rtcCodec.encode(ns.RtcDataInput,{interior:n,target:r,key:t}),[4,this.rtcSignaling(e,Ds,!0,o)];case 1:return i=l.sent(),s=i.code,a=i.buffer,s===exports.ErrorCode.SUCCESS&&a?(u=this._context.rtcCodec.decode(ns.RtcQryOutput,a).outInfo,c={},u.forEach((function(e){c[e.key]=e.value})),[2,{code:s,data:c}]):[2,{code:s}]}}))}))},n.prototype.removeRTCData=function(e,t,n,r,o){return ue(this,void 0,void 0,(function(){var i;return ce(this,(function(s){switch(s.label){case 0:return i=this._context.rtcCodec.encode(ns.RtcDataInput,{interior:n,target:r,key:t,objectName:null==o?void 0:o.name,content:null==o?void 0:o.content}),[4,this.rtcSignaling(e,Vs,!1,i)];case 1:return[2,s.sent().code]}}))}))},n.prototype.setRTCOutData=function(e,t,n,r){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){throw new Error("JSEngine's method not implemented.")}))}))},n.prototype.getRTCOutData=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){throw new Error("JSEngine's method not implemented.")}))}))},n.prototype.getRTCToken=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return r=ls(this._context.rtcCodec,t,n),[4,this.rtcSignaling(e,Gs,!0,r)];case 1:return o=u.sent(),i=o.code,s=o.buffer,i===exports.ErrorCode.SUCCESS&&s?(a=this._context.rtcCodec.decode(ns.RtcTokenOutput,s).rtcToken,[2,{code:i,data:{rtcToken:a}}]):[2,{code:i}]}}))}))},n.prototype.setRTCState=function(e,t){return ue(this,void 0,void 0,(function(){var n;return ce(this,(function(r){switch(r.label){case 0:return n=this._context.rtcCodec.encode(ns.MCFollowInput,{state:t}),[4,this.rtcSignaling(e,ks,!0,n)];case 1:return[2,r.sent().code]}}))}))},n.prototype.getRTCUserList=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i;return ce(this,(function(s){switch(s.label){case 0:return t=this._context.rtcCodec.encode(ns.RtcQueryListInput,{order:2}),[4,this.rtcSignaling(e,Fs,!0,t)];case 1:return n=s.sent(),r=n.code,o=n.buffer,r===exports.ErrorCode.SUCCESS&&o?(i=ds(this._context.rtcCodec,o),[2,{code:r,data:i}]):[2,{code:r}]}}))}))},n.prototype.joinLivingRoomAsAudience=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o,i,s,a,u,c;return ce(this,(function(l){switch(l.label){case 0:return r=ls(this._context.rtcCodec,t,n),[4,this.rtcSignaling(e,Bs,!0,r)];case 1:return o=l.sent(),i=o.code,s=o.buffer,i===exports.ErrorCode.SUCCESS&&s?(a=this._context.rtcCodec.decode(ns.RtcViewerJoinedOutput,s),u=a.rtcToken,c=a.entries,[2,{code:i,data:{token:u,kvEntries:c}}]):[2,{code:i}]}}))}))},n.prototype.quitLivingRoomAsAudience=function(e){return ue(this,void 0,void 0,(function(){var t;return ce(this,(function(n){switch(n.label){case 0:return t=this._context.rtcCodec.encode(ns.SetUserStatusInput,{status:0}),[4,this.rtcSignaling(e,Hs,!0,t)];case 1:return[2,n.sent().code]}}))}))},n.prototype.rtcIdentityChange=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return r=this._context.rtcCodec.encode(ns.RtcInput,{roomType:exports.RTCMode.LIVE,broadcastType:n,identityChangeType:t,needSysChatroom:!1}),[4,this.rtcSignaling(e,Ys,!0,r)];case 1:return o=u.sent(),i=o.code,s=o.buffer,i===exports.ErrorCode.SUCCESS&&s?(a=ds(this._context.rtcCodec,s),[2,{code:i,data:a}]):[2,{code:i}]}}))}))},n.prototype.requestRoomPK=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return t=e.invitedRoomId,n=e.invitedUserId,r=e.inviteSessionId,o=e.inviteTimeout,i=e.inviteInfo,s=e.roomId,a=this._context.rtcCodec.encode(ns.RtcInviteInput,{invitedRoomId:t,invitedUserId:n,inviteSessionId:r,timeoutTime:o,inviteInfo:i}),[4,this.rtcSignaling(s,Ks,!0,a)];case 1:return[2,u.sent().code]}}))}))},n.prototype.cancelRoomPK=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s;return ce(this,(function(a){switch(a.label){case 0:return t=e.invitedRoomId,n=e.invitedUserId,r=e.inviteSessionId,o=e.inviteInfo,i=e.roomId,s=this._context.rtcCodec.encode(ns.RtcCancelInviteInput,{invitedRoomId:t,invitedUserId:n,inviteSessionId:r,inviteInfo:o}),[4,this.rtcSignaling(i,Qs,!0,s)];case 1:return[2,a.sent().code]}}))}))},n.prototype.responseRoomPK=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a,u,c;return ce(this,(function(l){switch(l.label){case 0:return t=e.inviteUserId,n=e.inviteRoomId,r=e.inviteSessionId,o=e.content,i=e.key,s=e.value,a=e.agree,u=e.roomId,c=this._context.rtcCodec.encode(ns.RtcInviteAnswerInput,{inviteUserId:t,inviteRoomId:n,inviteSessionId:r,content:o,key:i,value:s,answerCode:a?1:0}),[4,this.rtcSignaling(u,Ws,!0,c)];case 1:return[2,l.sent().code]}}))}))},n.prototype.endRoomPK=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s;return ce(this,(function(a){switch(a.label){case 0:return t=e.endRoomId,n=e.sessionId,r=e.content,o=e.keys,i=e.roomId,s=this._context.rtcCodec.encode(ns.RtcEndInviteInput,{inviteRoomId:t,inviteSessionId:n,inviteContent:r,inviteRoomKeys:o}),[4,this.rtcSignaling(i,js,!0,s)];case 1:return[2,a.sent().code]}}))}))},n.prototype.registerRTCSignalListener=function(e){this._context.registerRTCSignalingListener(e)},n.prototype.rtcSignaling=function(e,t,n,r){return this._context.rtcSignaling(e,t,n,r)},n.prototype.getRTCJoinedUserInfo=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i;return ce(this,(function(s){switch(s.label){case 0:return t=this._context.rtcCodec.encode(ns.RtcQueryUserJoinedInput,{userId:e}),[4,this.rtcSignaling("",Js,!0,t)];case 1:return n=s.sent(),r=n.code,o=n.buffer,r===exports.ErrorCode.SUCCESS&&o?(i=this._context.rtcCodec.decode(ns.RtcQueryUserJoinedOutput,o).info||[],[2,{code:r,data:i.map((function(e){return{deviceId:e.deviceId,roomId:e.roomId,joinTime:e.joinTime}}))}]):[2,{code:r}]}}))}))},n}(Xa),eu={"set.proxy":exports.ErrorCode.INVALID_PARAMETER_PROXY,"test.proxy":exports.ErrorCode.INVALID_PARAMETER_TESTHOST,"test.proxy.socksHost":exports.ErrorCode.INVALID_PARAMETER_TESTHOST,"test.proxy.socksPort":exports.ErrorCode.INVALID_PARAMETER_TESTHOST,channelId:exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID,count:exports.ErrorCode.INVALID_PARAMETER_COUNT,startTime:exports.ErrorCode.INVALID_PARAMETER_START_TIME,endTime:exports.ErrorCode.INVALID_PARAMETER_END_TIME,offset:exports.ErrorCode.INVALID_PARAMETER_OFFSET,limit:exports.ErrorCode.INVALID_PARAMETER_LIMIT,keyword:exports.ErrorCode.INVALID_PARAMETER_KEYWORD,messageTypes:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE,messageType:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE,typingContentType:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE,conversation:exports.ErrorCode.INVALID_PARAMETER_CONVERSATION,conversationType:exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE,targetId:exports.ErrorCode.INVALID_PARAMETER_TARGET_ID,targetIds:exports.ErrorCode.INVALID_PARAMETER_TARGET_ID,userId:exports.ErrorCode.INVALID_PARAMETER_USER_ID,senderUserId:exports.ErrorCode.INVALID_PARAMETER_USER_ID,timestamp:exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP,order:exports.ErrorCode.INVALID_PARAMETER_ORDER,messageId:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID,receivedStatus:exports.ErrorCode.INVALID_PARAMETER_RECEIVED_STATUS,receivedStatusInfo:exports.ErrorCode.INVALID_PARAMETER_RECEIVED_STATUS,sentStatus:exports.ErrorCode.INVALID_PARAMETER_SENT_STATUS,content:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_CONTENT,messageIds:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ARRAY,cleanSpace:exports.ErrorCode.INVALID_PARAMETER_CLEAN_SPACE,messageDirection:exports.ErrorCode.INVALID_MESSAGE_DIRECTION,canIncludeExpansion:exports.ErrorCode.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION,expansion:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_EXPANSION,disableNotification:exports.ErrorCode.INVALID_PARAMETER_DISABLE_NOTIFICATION,messages:exports.ErrorCode.MSG_LIMIT_ERROR,checkDuplicate:exports.ErrorCode.INVALID_PARAMETER_CHECK_DUPLICATE,messageUId:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID,key:exports.ErrorCode.INVALID_PARAMETER_KEY,keys:exports.ErrorCode.INVALID_PARAMETER_KEYS,value:exports.ErrorCode.INVALID_PARAMETER_VALUE,isAutoDelete:exports.ErrorCode.INVALID_PARAMETER_IS_AUTO_DELETE,isSendNotification:exports.ErrorCode.INVALID_PARAMETER_IS_SEND_NOTIFICATION,notificationExtra:exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_EXTRA,entries:exports.ErrorCode.INVALID_PARAMETER_ENTRIES,isForce:exports.ErrorCode.INVALID_PARAMETER_IS_FORCE,rtcRoomId:exports.ErrorCode.INVALID_PARAMETER_RTCROOMID,token:exports.ErrorCode.RC_CONN_TOKEN_INCORRECT,conversations:exports.ErrorCode.INVALID_PARAMETER_CONVERSATIONS,draft:exports.ErrorCode.INVALID_PARAMETER_DRAFT,conversationTypes:exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST,levels:exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL,notificationLevel:exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL,notificationLevels:exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL,notificationStatus:exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL,isTop:exports.ErrorCode.INVALID_PARAMETER_IS_TOP,isUpdateTime:exports.ErrorCode.INVALID_PARAMETER_IS_UPDATE_TIME,message:exports.ErrorCode.INVALID_PARAMETER_MESSAGE,mentionedUserIdList:exports.ErrorCode.INVALID_PARAMETER_USERIDLIST,directionalUserIdList:exports.ErrorCode.INVALID_PARAMETER_USERIDLIST,directedUserIds:exports.ErrorCode.INVALID_PARAMETER_USERIDLIST,isStatusMessage:exports.ErrorCode.INVALID_PARAMETER_IS_STATUS_MESSAGE,pushContent:exports.ErrorCode.INVALID_PARAMETER_PUSH_CONTENT,pushData:exports.ErrorCode.INVALID_PARAMETER_PUSH_DATA,isMentioned:exports.ErrorCode.INVALID_PARAMETER_IS_MENTIONED,mentionedType:exports.ErrorCode.INVALID_PARAMETER_MENTIONED_TYPE,isVoipPush:exports.ErrorCode.INVALID_PARAMETER_IS_VOIP_PUSH,pushConfig:exports.ErrorCode.INVALID_PARAMETER_PUSH_CONFIG,startMsgUId:exports.ErrorCode.INVALID_PARAMETER_START_MESSAGE_UID,endMsgUId:exports.ErrorCode.INVALID_PARAMETER_END_MESSAGE_UID,sentTime:exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP,clearMessageOption:exports.ErrorCode.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST,searchContent:exports.ErrorCode.SEARCH_PROPS_LIMIT_ERROR,tagId:exports.ErrorCode.INVALID_PARAMETER_TAG_ID,tagIds:exports.ErrorCode.INVALID_PARAMETER_TAG_ID,tagName:exports.ErrorCode.INVALID_PARAMETER_TAG_NAME,containMuted:exports.ErrorCode.INVALID_PARAMETER_CONTAIN_MUTED,channelType:exports.ErrorCode.INVALID_PARAMETER_CHANNEL_TYPE,file:exports.ErrorCode.MEDIA_EXCEPTION,fileType:exports.ErrorCode.INVALID_PARAMETER_MEDIA_TYPE,contentDisposition:exports.ErrorCode.INVALID_PARAMETER_CONTENT_DISPOSITION,mediaUrl:exports.ErrorCode.INVALID_PARAMETER_MEDIA_URL,filename:exports.ErrorCode.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME,saveName:exports.ErrorCode.INVALID_PARAMETER_SAVE_NAME,serverType:exports.ErrorCode.INVALID_PARAMETER_SERVER_TYPE,subscribeType:exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_TYPE,expiry:exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_EXPIRY,subscribeUserIds:exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS,subscribePageSize:exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE,beforeCount:exports.ErrorCode.INVALID_PARAMETER_BEFORE,afterCount:exports.ErrorCode.INVALID_PARAMETER_AFTER,conversationList:exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST,conversationTypeNotSupport:exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT,profile:exports.ErrorCode.INVALID_PARAMETER_USER_PROFILE,userProfileVisibility:exports.ErrorCode.INVALID_PARAMETER_USER_PROFILE_VISIBILITY,uniqueId:exports.ErrorCode.INVALID_PARAMETER_UNIQUE_ID,extra:exports.ErrorCode.INVALID_PARAMETER_EXTRA,disableUpdateLastMessage:exports.ErrorCode.INVALID_DISABLE_UPDATE_LAST_MESSAGE};exports.AssertRules=void 0,(Za=exports.AssertRules||(exports.AssertRules={}))[Za.STRING=0]="STRING",Za[Za.ONLY_STRING=1]="ONLY_STRING",Za[Za.NUMBER=2]="NUMBER",Za[Za.BOOLEAN=3]="BOOLEAN",Za[Za.OBJECT=4]="OBJECT",Za[Za.ARRAY=5]="ARRAY",Za[Za.CALLBACK=6]="CALLBACK",Za[Za.CHANNEL_ID=7]="CHANNEL_ID",Za[Za.CONVERSATION=8]="CONVERSATION",Za[Za.CONVERSATION_TYPE=9]="CONVERSATION_TYPE";var tu,nu=((za={})[exports.AssertRules.STRING]=_t,za[exports.AssertRules.ONLY_STRING]=lt,za[exports.AssertRules.NUMBER]=dt,za[exports.AssertRules.BOOLEAN]=function(e){return"boolean"==typeof e},za[exports.AssertRules.OBJECT]=gt,za[exports.AssertRules.ARRAY]=pt,za[exports.AssertRules.CALLBACK]=function(e){var t=!0;return gt(e)||(t=!1),(e=e||{}).onSuccess&&!ft(e.onSuccess)&&(t=!1),e.onError&&!ft(e.onError)&&(t=!1),t},za[exports.AssertRules.CHANNEL_ID]=Ct,za[exports.AssertRules.CONVERSATION]=function(e){var t=!0;return gt(e)||(t=!1),lt(e.targetId)||(t=!1),vt(e.conversationType)||(t=!1),Et(e.channelId)||Ct(e.channelId)||(t=!1),t},za[exports.AssertRules.CONVERSATION_TYPE]=vt,za),ru=function(e){function n(t){var n=e.call(this,t)||this;return n.name="RCAssertError",n}return t(n,e),n}(Error),ou=function(e,t,n,r){void 0===r&&(r=!1),n=nu[n]||n;var o=r?n(t):Et(t)||null==t||n(t);return o||null===console||void 0===console||console.error("'".concat(e,"' is invalid: ").concat(JSON.stringify(t))),o},iu=function(){function e(e,t){var n,r;this._logTagT=e,this._logTagR=t,this.verificationFaileList=[],this.context=Ch.getContext(),this.logger=null===(n=this.context)||void 0===n?void 0:n.logger,this.option=null===(r=this.context)||void 0===r?void 0:r.getOptions()}return e.prototype.validate=function(e,t,n,r,o){if(void 0===r&&(r=!1),this.verificationFaileList.length>0)return this;n=nu[n]||n;var i=r?n(t):Et(t)||null==t||n(t);if("object"==typeof i){var s=i.valid,a=i.errorKey;return!s&&a&&this.verificationFaileList.push({key:a,value:t,isValid:!1,message:o,code:eu[a]}),this}return i||this.verificationFaileList.push({key:e,value:t,isValid:i,message:o,code:eu[e]}),this},e.prototype.validateParameters=function(e,t,n,r,o,i){if(void 0===o&&(o=!1),this.verificationFaileList.length>0)return this;n=nu[n]||n;var s=o?n(t):Et(t)||null==t||n(t);if("object"==typeof s){var a=s.valid,u=s.errorKey,c=s.errorCode;return!a&&u&&this.verificationFaileList.push({key:u,value:t,code:c||r,message:i,isValid:!1}),this}return s||this.verificationFaileList.push({key:e,value:t,code:r,message:i,isValid:!1}),this},e.prototype._getValidationResult=function(){if(this.verificationFaileList.length>0)return this.verificationFaileList[0]},e.prototype.ifReady=function(e){var t;if(!this.context)return Promise.resolve({code:exports.ErrorCode.BIZ_ERROR_CLIENT_NOT_INIT});var n=this._getValidationResult();if(n){var r=n.code,o=n.value,i=n.message,s=n.key;return null===(t=this.logger)||void 0===t||t.error(this._logTagR,JSON.stringify({code:r})),Promise.resolve({code:r,msg:"'".concat(s,"' is invalid: ").concat(i||JSON.stringify(o))})}var a=this.logger.createTraceId();return e(this.context,this.logger,this.option,a)},e.prototype.try2do=function(e){if(!this.context)throw new Error("Not initialized yet!");return e(this.context,this.logger,this.option)},e.prototype.ifReadySync=function(e){var t;if(!this.context)return{code:exports.ErrorCode.BIZ_ERROR_CLIENT_NOT_INIT};var n=this._getValidationResult();if(!n)return e(this.context,this.logger,this.option);var r=n.code,o=n.value,i=n.message,s=n.key;return null===(t=this.logger)||void 0===t||t.warn(this._logTagR,JSON.stringify({code:r})),{code:r,msg:"'".concat(s,"' is invalid: ").concat(i||o)}},e}(),su=function(){return tu||(tu={set:function(e,t){Tr.localStorage.setItem(e,JSON.stringify(t))},get:function(e){var t;try{t=JSON.parse(Tr.localStorage.getItem(e))}catch(e){t=null}return t},remove:function(e){return Tr.localStorage.removeItem(e)},getKeys:function(){var e=[];for(var t in Tr.localStorage)e.push(t);return e}}),tu},au=function(){function e(e){this._caches={},e&&(this._caches=e)}return e.prototype.set=function(e,t){this._caches[e]=t},e.prototype.remove=function(e){var t=this.get(e);return delete this._caches[e],t},e.prototype.get=function(e){return this._caches[e]},e.prototype.getKeys=function(){var e=[];for(var t in this._caches)e.push(t);return e},e}(),uu=function(){function e(e){var t;this._rootStorage=su();var n=this._rootStorage.get(e)||{};this._cache=new au(((t={})[e]=n,t)),this._storageKey=e}return e.prototype._get=function(){var e=this._storageKey;return this._cache.get(e)||{}},e.prototype._set=function(e){var t=this._storageKey;e=e||{},this._cache.set(t,e),this._rootStorage.set(t,e)},e.prototype.set=function(e,t){var n=this._get();n[e]=t,this._set(n)},e.prototype.remove=function(e){var t=this._get();delete t[e],this._set(t)},e.prototype.clear=function(){var e=this._storageKey;this._rootStorage.remove(e),this._cache.remove(e)},e.prototype.get=function(e){return this._get()[e]},e.prototype.getKeys=function(){var e=this._get(),t=[];for(var n in e)t.push(n);return t},e.prototype.getValues=function(){return this._get()||{}},e.prototype.update=function(e){void 0===e&&(e={});var t=this._storageKey;this._cache.set(t,e),this._rootStorage.set(t,e)},e}(),cu="",lu=function(){var e="";if(cu)return cu;if("browser"===Tr.tag)return Xe;var t="RCDeviceId",n=su(),r=n.get(t);return r?e=r:(e=Ze.genWithLen(22),n.set(t,e)),e},du="",pu=function(){return du};function hu(e){return Boolean(1&((null==e?void 0:e.sessionMode)||0))}var _u=function(){function e(){}return e.enable=function(){return!0},e}(),gu=48,fu=64,Eu=80,Iu=96,Tu="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",vu=function(e){for(var t={},n=0;n<e.length-1;n++){var r=e.charAt(n)+e.charAt(n+1);t.hasOwnProperty(r)?t[r].push(n):t[r]=[n]}for(var o=[],i=[],s=function(){if(i.length>0){var e=i.join("");if(i=[],e.length>26){var t=Ru(e.length),n=String.fromCharCode(Eu|t.length);o.push(n+t)}else{var r=String.fromCharCode(Iu|e.length);o.push(r)}o.push(e)}},a=0;a<e.length;){var u=Cu(t,e,a);if(u.length<2)i.push(e.charAt(a++));else if(u.length<4)i.push(e.substr(a,u.length)),a+=u.length;else{var c=Ru(a-u.offset),l=Ru(u.length);if(c.length+l.length>=u.length)i.push(e.substr(a,u.length)),a+=u.length;else{s();var d=String.fromCharCode(fu|c.length<<2|l.length);o.push(d+c+l),a+=u.length}}}s();var p=Ru(e.length),h=String.fromCharCode(gu|p.length);return o.push(h+p),o.join("")},Cu=function(e,t,n){var r={length:0,offset:-1};if(t.length,n>=t.length-1)return r;var o=e[t.charAt(n)+t.charAt(n+1)];if(o[0]===n)return r;for(var i=t.length-n,s=0,a=o.length;s<a;s++){var u=o[s],c=n-u;if(!(c>238327)){var l=Math.min(i,c);if(l<=r.length)break;if(!(r.length>2&&t.charAt(u+r.length-1)!==t.charAt(n+r.length-1))){for(var d=2,p=d;p<l&&t.charAt(u+p)===t.charAt(n+p);p++)d++;d>=r.length&&(r.length=d,r.offset=u)}}}return r},Ru=function(e){var t=[],n=0;do{n=e%62,t.push(Tu.charAt(n)),e=(e-n)/62}while(e>0);return t.join("")},yu=function(){function e(){this._callerQueue=[],this._isCalling=!1,this._retryCount=0}return e.prototype.pushTask=function(e){var t=this;return new Promise((function(n){t._callerQueue.push({task:e,resolve:n}),t._startCall()}))},e.prototype._startCall=function(){return ue(this,void 0,void 0,(function(){var e,t;return ce(this,(function(n){switch(n.label){case 0:return this._isCalling||0===this._callerQueue.length?[2]:(this._isCalling=!0,e=this._callerQueue.shift(),[4,this._callHandler(e)]);case 1:return t=n.sent(),e.resolve(t),this._isCalling=!1,this._startCall(),[2]}}))}))},e.prototype._callHandler=function(e){return ue(this,void 0,void 0,(function(){var t,n,r;return ce(this,(function(o){switch(o.label){case 0:return t=e.task,n=this.getVersion(),[4,t(n)];case 1:return(r=o.sent()).code===exports.ErrorCode.USER_SETTING_SYNCED_ERROR&&this._retryCount<5?(this._retryCount++,[4,this._triggerPull(n)]):[3,3];case 2:return o.sent(),[2,this._callHandler(e)];case 3:return this._retryCount=0,[2,r]}}))}))},e.prototype.stopAllTask=function(){this._callerQueue.forEach((function(e){e.resolve({code:exports.ErrorCode.RC_NET_UNAVAILABLE})})),this._callerQueue=[]},e}(),mu="converStatusChanged",Su=function(e){function n(t,n,r){var o=e.call(this)||this;return o._eventEmitter=new is,o._pullQueue=[],o._isPulling=!1,o._pullPromise=null,o._storagePullTimeKey="con-s-".concat(n,"-").concat(r),o._oldStorage=su(),o._storage=new uu(De(n,r)),o._engine=t,o.adaptOldStatus(),o}return t(n,e),n.prototype.adaptOldStatus=function(){try{if(this._storage.get(this._storagePullTimeKey)||0)return;var e=this._oldStorage.get(this._storagePullTimeKey)||0;if(!e)return;this._storage.set(this._storagePullTimeKey,e),this._oldStorage.remove(this._storagePullTimeKey)}catch(e){this._engine.getInnerLogger().error(exports.LogTagId.A_CALLBACK_E,"adaptOldStatus error: ".concat(e.message))}},n.prototype._set=function(e){var t=this;if(!Et(e)&&Array.isArray(e)){var n=this._storage.get(this._storagePullTimeKey)||0,r=e.length;e.forEach((function(e,o){var i=e.updatedTime||0;n=i>n?i:n,t._eventEmitter.emit(mu,{statusItem:e,isLastPull:o===r-1})})),this._storage.set(this._storagePullTimeKey,n),this._pullQueue=this._pullQueue.filter((function(e){return e>n}))}},n.prototype._startPull=function(){return ue(this,void 0,void 0,(function(){var e,t,n,r;return ce(this,(function(o){switch(o.label){case 0:return this._isPulling||0===this._pullQueue.length?[2,this._pullPromise]:(this._isPulling=!0,this._pullQueue.shift(),e=this.getVersion(),this._pullPromise=this._engine.pullConversationStatus(e),[4,this._pullPromise]);case 1:return t=o.sent(),n=t.code,r=t.data,this._isPulling=!1,this._pullPromise=null,n===exports.ErrorCode.SUCCESS&&this._set(r),0===this._pullQueue.length?this._startCall():this._startPull(),[2]}}))}))},n.prototype._startCall=function(){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return this._isPulling||e.prototype._startCall.call(this),[2]}))}))},n.prototype.pull=function(e){var t=this.getVersion();(e>t||0===e)&&(this._pullQueue.push(t),this._startPull())},n.prototype._triggerPull=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){switch(t.label){case 0:return this._pullQueue.push(e),[4,this._startPull()];case 1:return t.sent(),[2]}}))}))},n.prototype.watch=function(e){this._eventEmitter.on(mu,(function(t){e(t)}))},n.prototype.setConversationUpdatedTime=function(e){var t=this._storage.get(this._storagePullTimeKey)||0;return e&&e>t?(this._storage.set(this._storagePullTimeKey,e),e):t},n.prototype.getVersion=function(){return this._storage.get(this._storagePullTimeKey)||0},n}(yu),Au={c:{keyName:"unreadMessageCount",defaultVal:0},hm:{keyName:"hasMentioned",defaultVal:!1},m:{keyName:"mentionedInfo",defaultVal:null},t:{keyName:"lastUnreadTime",defaultVal:0},lt:{keyName:"lastReadTime",defaultVal:0},fut:{keyName:"firstUnreadTime",defaultVal:0},fuid:{keyName:"firstUnreadMessageUid",defaultVal:""},nc:{keyName:"notificationStatus",defaultVal:2},nl:{keyName:"notificationLevel",defaultVal:0},to:{keyName:"isTop",defaultVal:!1},tg:{keyName:"tags",defaultVal:{}},mc:{keyName:"unreadMentionedCount",defaultVal:0},st:{keyName:"lastMessageSentTime",defaultVal:0}},Nu={};for(var Ou in Au){var Mu=Au[Ou].keyName;Nu[Mu]=Ou}var Lu=function(){function e(e,t,n){this._currentUserId=t,this.logger=n,this.storage=new uu(Ve(e,t)),this._localStore=new uu(Ge(e,t))}return e.prototype._getStoreKey=function(e,t,n){return"".concat(n||"","_").concat(e,"_").concat(t)},e.prototype._getConOptionByKey=function(e){var t=(e=e||"").split("_");if(t.length>=2){var n=t.shift(),r=t.shift(),o=t.join("_");return{conversationType:Number(r),targetId:o,channelId:n}}return{conversationType:exports.ConversationType.PRIVATE,targetId:"",channelId:""}},e.prototype._updateMentionedUserList=function(e,t,n){var r=this,o=e.conversationType,i=e.messageType,s=e.isMentioned,a=e.senderUserId;s&&o===exports.ConversationType.GROUP&&((n.userIdList||[]).forEach((function(e){e===r._currentUserId&&t.indexOf(a)<0&&t.push(a)})),n.type===exports.MentionedType.ALL&&t.indexOf(a)<0&&t.push(a));if(i===exports.MessageType.RECALL&&o===exports.ConversationType.GROUP){var u=t.indexOf(a);u>=0&&t.splice(u,1)}return t},e.prototype.updateMentionedData=function(e){var t=e.conversationType,n=e.targetId,r=e.content,o=e.channelId,i=e.senderUserId,s=r.mentionedInfo;if(s&&i!==this._currentUserId){var a=this._getStoreKey(t,n,o),u=this._localStore.get(a)||{},c=Nu.mentionedInfo,l=Nu.hasMentioned,d=u[c]||{},p=d.userIdList||[];s={userIdList:p=this._updateMentionedUserList(e,p,s),type:(null==s?void 0:s.type)||d.type},0!==p.length?(u[c]=s,u[l]=!0):(delete u[c],delete u[l]),Tt(u)?this._localStore.set(a,u):this._localStore.remove(a)}},e.prototype._setLocal=function(e,t){if("tags"===e)for(var n in t)t[n].isTop||delete t[n].isTop;return t},e.prototype.set=function(e,t,n,r){var o=this._getStoreKey(e,t,r),i=this._localStore.get(o)||{};for(var s in n){var a=Nu[s],u=n[s];if(!Et(a)&&!Et(u)&&"hasMentioned"!==s&&"MentionedInfo"!==s)u===Au[a].defaultVal||"tags"===s&&!Tt(u)?delete i[a]:i[a]=this._setLocal(s,u),i.c||(delete i.t,delete i.fut,delete i.fuid,delete i.hm,delete i.m,delete i.mc)}var c=Object.keys(i);1===c.length&&c.includes("st")&&delete i.st,Tt(i)?this._localStore.set(o,i):this._localStore.remove(o)},e.prototype.get=function(e,t,n){void 0===n&&(n="");var r=this._getStoreKey(e,t,n),o=this._localStore.get(r)||{},i={};for(var s in Au){var a=Au[s],u=a.keyName,c=a.defaultVal;i[u]=o[s]||Nt(c)}return i},e.prototype.getValue=function(e){var t=this._localStore.getValues()||{},n=[];for(var r in t){var o=this._getConOptionByKey(r),i={conversationType:o.conversationType,targetId:o.targetId,channelId:o.channelId},s=t[r];for(var a in s)if(Au[a]){var u=Au[a],c=u.keyName,l=u.defaultVal;i[c]=s[a]||Nt(l)}i=e?e(i):i,n.push(i)}return n},e.prototype.getValueForTag=function(){var e=this._localStore.getValues()||{},t={};for(var n in e){var r=this._getConOptionByKey(n),o=r.conversationType,i=r.targetId,s={},a=e[n];for(var u in a){var c=Au[u],l=c.keyName,d=c.defaultVal;s[l]=a[u]||Nt(d)}for(var p in s.tags){Et(t[p])&&(t[p]=[]);var h=se(se({},s),{conversationType:o,targetId:i});delete h.tags,t[p].push(h)}}return t},e.prototype.adaptOldStore=function(){try{var e=this.storage.getValues();if(0===Object.keys(e).length)return;for(var t in e){var n="_".concat(t);this._localStore.set(n,e[t])}this.storage.clear()}catch(e){this.logger.error(exports.LogTagId.O,"adaptOldStore error: ".concat(e.message))}},e.prototype.remove=function(e,t,n){var r=this._getStoreKey(e,t,n);this._localStore.remove(r)},e}(),Uu=[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP,exports.ConversationType.SYSTEM,exports.ConversationType.PUBLIC_SERVICE,exports.ConversationType.APP_PUBLIC_SERVICE],bu="conversationChanged",Pu="conTagStatusChanged",wu=function(){function e(e,t,n,r,o,i){var s=this;this.isEnableRealtimeSession=i,this._updatedConversations={},this._conTagStatusChanged=!1,this._eventEmitter=new is,this._draftMap={},this._recallMsgTimeMap={},this._appkey=t,this._loginUserId=n,this._store=new Lu(t,n,e.getInnerLogger()),this._statusManager=new Su(e,t,n),this._statusManager.watch((function(e){var t=e.statusItem,n=e.isLastPull;s.addStatus(t,n)})),this._eventEmitter.on(bu,(function(e){r(e)})),this._eventEmitter.on(Pu,(function(){o()}));var a=this._store.getValue();a.length>1e3&&(a=a.sort((function(e,t){var n=e.lastMessageSentTime,r=void 0===n?0:n,o=t.lastMessageSentTime;return(void 0===o?0:o)-r})),a.splice(1e3,a.length).forEach((function(e){s._store.remove(e.conversationType,e.targetId,e.channelId)})))}return e.prototype._calcMsg=function(e,t,n,r){var o=!this._recallMsgTimeMap[e]||this._recallMsgTimeMap[e]&&!this._recallMsgTimeMap[e].find((function(e){return e===r.sentTime})),i=t>=r.sentTime;return n&&(i=n<r.sentTime),{isNotRead:i,isNotRepeadRecallSendTime:o}},e.prototype._calcUnreadCount=function(e,t){if(this.isEnableRealtimeSession)return{hasChanged:!1,localConversation:t,updateItems:{}};var n=e.content,r=e.messageType,o=e.sentTime,i=e.isCounted,s=e.messageDirection,a=e.senderUserId,u=e.messageUId,c=s===exports.MessageDirection.SEND&&a===this._loginUserId,l=r===exports.MessageType.RECALL,d=gt(n),p=!1,h={},_=t.lastUnreadTime,g=t.lastReadTime,f=t.unreadMessageCount;if(_>o||c)return{hasChanged:p,localConversation:t,updateItems:h};if(i&&(0===t.unreadMessageCount&&(t.firstUnreadMessageUid=u,t.firstUnreadTime=o),t.unreadMessageCount=f+1,t.lastUnreadTime=o,p=!0),l&&d){var E=this._handleRecall2UnreadCount(e,_,g,f,p),I=E.unreadMessageCount,T=E.hasChanged;t.unreadMessageCount=I,p=T,0===t.unreadMessageCount&&(t.firstUnreadMessageUid="",t.firstUnreadTime=0)}return p&&(h.unreadMessageCount={val:t.unreadMessageCount||0,time:o}),{hasChanged:p,localConversation:t,updateItems:h}},e.prototype._handleRecall2UnreadCount=function(e,t,n,r,o){var i="".concat(e.conversationType,"_").concat(e.channelId,"_").concat(e.targetId),s=this._calcMsg(i,t,n,e.content),a=s.isNotRead,u=s.isNotRepeadRecallSendTime;return a&&r&&u?(this._recallMsgTimeMap[i]||(this._recallMsgTimeMap[i]=[]),this._recallMsgTimeMap[i].push(e.content.sentTime),{unreadMessageCount:r-1,hasChanged:!0}):{unreadMessageCount:r,hasChanged:o}},e.prototype._calcMentionedInfo=function(e,t){var n=e.content,r=e.messageDirection,o=e.isMentioned,i=e.sentTime,s=r===exports.MessageDirection.SEND,a=gt(n),u=!1,c={};return!s&&o&&a&&n.mentionedInfo&&(t.hasMentioned=!0,u=!0,c.hasMentioned={val:!0,time:i},c.mentionedInfo={val:n.mentionedInfo,time:i}),{hasChanged:u,localConversation:t,updateItems:c}},e.prototype._calcMentionedCount=function(e,t){var n=e.content,r=e.messageDirection,o=!1;if(e.isMentioned&&r===exports.MessageDirection.RECEIVE&&(null==n?void 0:n.mentionedInfo)){var i=n.mentionedInfo,s=i.type,a=i.userIdList;if(s===exports.MentionedType.ALL||(a||[]).includes(this._loginUserId)){o=!0;var u=t.unreadMentionedCount||0;t.unreadMentionedCount=u+1}}return{hasChanged:o,localConversation:t}},e.prototype._setUpdatedConversation=function(e){if(gt(e)){var t=e.conversationType,n=e.targetId,r=e.channelId,o="".concat(t,"_").concat(n),i=this._store.get(t,n,r)||{};this._updatedConversations[o]=Object.assign(i,e)}},e.prototype._setConTagStatusChanged=function(e,t,n,r){var o=(this._store.get(e,t,r)||{}).tags||{};if(Object.keys(o).length===Object.keys(n).length){for(var i in o)if(!n[i]||!!o[i].isTop!=!!n[i].isTop)return void(this._conTagStatusChanged=!0)}else this._conTagStatusChanged=!0},e.prototype.addStatus=function(e,t){var n=e.conversationType,r=e.targetId,o=e.updatedTime,i=e.notificationStatus,s=e.notificationLevel,a=e.isTop,u=e.tags,c=e.channelId,l={},d={};if(n!==exports.ConversationType.ULTRA_GROUP){Et(s)||(d.notificationLevel={time:o,val:s},d.notificationStatus={time:o,val:Ne(s)}),Et(a)||(d.isTop={time:o,val:a}),Et(u)||(d.tags={time:o,val:u},null==u||u.forEach((function(e){l[e.tagId]={isTop:e.isTop}}))),this._setConTagStatusChanged(n,r,l,c);var p=this._store.get(n,r,c).lastMessageSentTime||(new Date).getTime();this._store.set(n,r,{notificationStatus:i,notificationLevel:s,isTop:a,tags:l,lastMessageSentTime:p},c),r&&(this._setUpdatedConversation({conversationType:n,targetId:r,updatedItems:d,channelId:c}),t&&this._notifyConversationChanged())}},e.prototype._notifyConversationChanged=function(){var e=[];for(var t in this._updatedConversations)e.push(this._updatedConversations[t]);0!==e.length&&(this._eventEmitter.emit(bu,e),this._updatedConversations={},this._conTagStatusChanged&&(this._eventEmitter.emit(Pu),this._conTagStatusChanged=!1))},e.prototype.setConversationCacheByMessage=function(e,t){var n=this,r=e.conversationType,o=e.isPersited,i=e.targetId,s=e.channelId,a=e.sentTime,u=e.disableUpdateLastMessage;if(Uu.indexOf(r)>=0){var c=!1,l=this._store.get(r,i,s),d={};if(l.lastMessageSentTime=a,[this._calcUnreadCount,this._calcMentionedInfo,this._calcMentionedCount].forEach((function(t){var r=t.call(n,e,l),o=r.hasChanged,i=r.localConversation,s=r.updateItems;c=c||o,d=se(se({},d),s),l=Nt(i)})),this._store.set(r,i,l,s),this._store.updateMentionedData(e),o&&!u){var p=this._store.get(r,i,s);p.updatedItems=se({latestMessage:{time:e.sentTime,val:e}},d),p.latestMessage=e;var h=Object.assign(p,{conversationType:r,targetId:i,channelId:s});this._setUpdatedConversation(h)}(c||o&&!u)&&this._notifyConversationChanged()}},e.prototype.get=function(e,t,n){return void 0===n&&(n=""),this._store.get(e,t,n)},e.prototype.getAllUnreadCount=function(e,t,n){var r=this._store.getValue(),o=0;return r.forEach((function(e){var r=e.unreadMessageCount,i=e.notificationStatus,s=e.notificationLevel,a=e.conversationType;r=r||0,(n||void 0!==s&&s<=0||void 0===s&&i!==exports.NotificationStatus.OPEN)&&(t.length>0?t.includes(Number(a))&&(o+=Number(r)):o+=Number(r))})),o},e.prototype.getTotalUnreadCountByLevels=function(e,t,n){var r=this._store.getValue(),o=0;return r.forEach((function(r){var i=r.unreadMessageCount,s=r.notificationLevel,a=void 0===s?0:s,u=r.conversationType,c=r.unreadMentionedCount;e.includes(u)&&(0===t.length||t.includes(a))&&(o+=(n?c:i)||0)})),o},e.prototype.getUnreadCountByTag=function(e,t){var n=this._store.getValueForTag()[e]||[],r=0;return n.forEach((function(e){var n=e.unreadMessageCount,o=e.notificationStatus,i=e.notificationLevel;(t||1!==o||-1===i||0===i)&&(n=n||0,r+=Number(n))})),r},e.prototype.getUnreadCount=function(e,t,n){return this._store.get(e,t,n).unreadMessageCount||0},e.prototype.clearUnreadCount=function(e,t,n,r,o){void 0===o&&(o=!0);var i=this._store.get(e,t,n);i.lastReadTime=i.lastUnreadTime,this._recallMsgTimeMap["".concat(e,"_").concat(n,"_").concat(t)]=[];var s=i.unreadMessageCount,a=i.hasMentioned,u={};if(s&&(i.unreadMessageCount=0,u.unreadMessageCount={val:0,time:r}),a&&(i.hasMentioned=!1,i.unreadMentionedCount=0,i.mentionedInfo=void 0,u.hasMentioned={val:!1,time:r},u.mentionedInfo={val:void 0,time:r}),this._store.set(e,t,i,n),o&&0!==Object.keys(u).length){var c=Object.assign(i,{conversationType:e,targetId:t,channelId:n,updatedItems:u});this._setUpdatedConversation(c),this._notifyConversationChanged()}},e.prototype.clearAllUnreadCount=function(){var e=this;this._store.getValue().forEach((function(t){t.unreadMessageCount&&(t.unreadMessageCount=0,t.lastReadTime=t.lastUnreadTime,e._recallMsgTimeMap={},e._store.set(t.conversationType,t.targetId,t,t.channelId))}))},e.prototype.startPullConversationStatus=function(e){this._statusManager.pull(e)},e.prototype.setDraft=function(e,t,n,r){var o="".concat(e,"_").concat(t,"_").concat(r);this._draftMap[o]=n},e.prototype.getDraft=function(e,t,n){var r="".concat(e,"_").concat(t,"_").concat(n);return this._draftMap[r]},e.prototype.clearDraft=function(e,t,n){var r="".concat(e,"_").concat(t,"_").concat(n);delete this._draftMap[r]},e.prototype.addTagStatus=function(e,t,n,r){void 0===r&&(r="");var o=this._store.get(e,t,r),i=o.tags;i=Object.assign(i,n);var s=o.lastMessageSentTime||(new Date).getTime();this._store.set(e,t,{tags:i,lastMessageSentTime:s},r)},e.prototype.deleteTagStatus=function(e,t,n,r){void 0===r&&(r="");var o=this._store.get(e,t,r).tags;n.forEach((function(e){delete o[e]})),this._store.set(e,t,{tags:o},r)},e.prototype.getConversationListForTag=function(){return this._store.getValueForTag()},e.prototype.getBlockConversationList=function(){return this._store.getValue().filter((function(e){return e.notificationStatus===exports.NotificationStatus.OPEN||e.notificationLevel&&e.notificationLevel>0})).map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,notificationLevel:e.notificationLevel||0,notificationStatus:e.notificationStatus||2}}))},e.prototype.getTopConversationList=function(e,t){var n=this;return(this._store.getValue()||{}).filter((function(n){return e.includes(n.conversationType)&&(Et(t)||t===n.channelId)&&n.isTop})).map((function(e){return n._buildConversation(e)}))},e.prototype.adaptOldStore=function(){this._store.adaptOldStore()},e.prototype.getUnreadMentionedCount=function(e,t,n){return void 0===n&&(n=""),this.get(e,t,n).unreadMentionedCount||0},e.prototype.getAllUnreadMentionedCount=function(){var e=this._store.getValue(),t=0;return e.forEach((function(e){var n=e.unreadMentionedCount;n=n||0,t+=Number(n)})),t},e.prototype.getAllConversationState=function(){return this._store.getValue().filter((function(e){return e.unreadMessageCount||e.unreadMentionedCount})).map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,unreadCount:e.unreadMessageCount||0,unreadMentionedCount:e.unreadMentionedCount||0}}))},e.prototype.getUnreadConversationList=function(e){var t=this;return(this._store.getValue()||{}).filter((function(t){return e.includes(t.conversationType)&&t.unreadMessageCount&&t.unreadMessageCount>0})).map((function(e){return t._buildConversation(e)}))},e.prototype._buildConversation=function(e){var t=this.getDraft(e.conversationType,e.targetId,e.channelId);return{channelId:e.channelId,conversationType:e.conversationType,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount||0,latestMessage:null,hasMentioned:e.hasMentioned||!1,mentionedInfo:e.mentionedInfo,notificationStatus:e.notificationStatus||0,notificationLevel:e.notificationLevel||0,isTop:e.isTop||!1,lastUnreadTime:e.lastUnreadTime||0,unreadMentionedCount:e.unreadMentionedCount||0,draft:t}},e.prototype.setConversationUpdatedTime=function(e){return this._statusManager.setConversationUpdatedTime(e)},e.prototype.getConversationUpdatedTime=function(){return this._statusManager.getVersion()},e.prototype.pushTask=function(e){return this._statusManager.pushTask(e)},e.prototype.stopAllTask=function(){this._statusManager.stopAllTask()},e}(),xu=function(){function e(e,t){this._localStore=new uu(ke(e,t))}return e.prototype.set=function(e,t,n,r){var o=this._getStoreKey(e,t,r),i=this._localStore.get(o)||{};for(var s in n){var a=Vu[s],u=n[s];if(!Et(a)&&!Et(u))u===Du[a].defaultVal?delete i[a]:i[a]=u}Tt(i)?this._localStore.set(o,i):this._localStore.remove(o)},e.prototype.get=function(e,t,n){void 0===n&&(n="");var r=this._getStoreKey(e,t,n),o=this._localStore.get(r)||{},i={};for(var s in Du){var a=Du[s],u=a.keyName,c=a.defaultVal;i[u]=o[s]||Nt(c)}return i},e.prototype._getStoreKey=function(e,t,n){return"".concat(n,"_").concat(e,"_").concat(t)},e}(),Du={nc:{keyName:"notificationStatus",defaultVal:2},nl:{keyName:"notificationLevel",defaultVal:0}},Vu={};for(var Gu in Du){var ku=Du[Gu].keyName;Vu[ku]=Gu}var Fu=function(){function e(e,t){this._store=new xu(e,t)}return e.prototype.addUltraGroupStatus=function(e){var t=e.conversationType,n=e.targetId,r=e.notificationStatus,o=e.notificationLevel,i=e.channelId;t===exports.ConversationType.ULTRA_GROUP&&this._store.set(t,n,{notificationStatus:r,notificationLevel:o},i)},e.prototype.get=function(e,t,n){return void 0===n&&(n=""),this._store.get(e,t,n)},e}(),Bu={_caches:{},set:function(e,t){this._caches[e]=t},get:function(e){return this._caches[e]||0},clear:function(e){this._caches[e]=0}},Hu=function(){function e(e,t,n){this.logger=e,this._kvCaches={},this._chatroomId=t,this._currentUserId=n}return e.prototype._add=function(e){var t=e.key;e.isDeleted=!1,this._kvCaches[t]=e},e.prototype._remove=function(e){var t=e.key,n=this._kvCaches[t];n&&(n.isDeleted=!0,this._kvCaches[t]=n)},e.prototype._setEntry=function(e,t){var n=e.key,r=e.type,o=e.isOverwrite,i=e.userId,s=this._getSetUserId(n),a=r===exports.ChatroomEntryType.DELETE,u=s===i,c=!this._isExisted(n),l=a?this._remove:this._add;(t||o||u||c)&&l.call(this,e)},e.prototype.getValue=function(e){var t=this._kvCaches[e]||{};return t.isDeleted?null:t.value},e.prototype.getVersion=function(e){var t=this._kvCaches[e]||{};return t.isDeleted?null:t.version},e.prototype.getAllValue=function(){var e={};for(var t in this._kvCaches)this._kvCaches[t].isDeleted||(e[t]=this._kvCaches[t].value);return e},e.prototype._getSetUserId=function(e){return(this._kvCaches[e]||{}).userId},e.prototype._isExisted=function(e){var t=this._kvCaches[e]||{},n=t.value,r=t.isDeleted;return n&&!r},e.prototype.setEntries=function(e){var t=this,n=e.kvEntries,r=e.isFullUpdate;n=n||[],(r=r||!1)&&this.clear(),n.forEach((function(e){t._setEntry(e,r)}))},e.prototype.clear=function(){this._kvCaches={}},e}(),qu=function(){function e(e){this._pullQueue=[],this._isPulling=!1,this._storeCaches={},this._engine=e}return e.prototype._startPull=function(){return ue(this,void 0,void 0,(function(){var e,t,n,r,o,i,s;return ce(this,(function(a){switch(a.label){case 0:return this._isPulling||0===this._pullQueue.length?[2]:(this._isPulling=!0,e=this._pullQueue.splice(0,1)[0],t=e.chrmId,n=e.timestamp,(r=Bu.get(t))>n?(this._isPulling=!1,this._startPull(),[2]):[4,this._engine.pullChatroomEntry(t,r)]);case 1:return o=a.sent(),i=o.code,s=o.data,this._isPulling=!1,i===exports.ErrorCode.SUCCESS?(Bu.set(t,s.syncTime||0),this._startPull()):this._startPull(),[2]}}))}))},e.prototype.reset=function(e){Bu.clear(e);var t=this._storeCaches[e];null==t||t.clear()},e.prototype.pullEntry=function(e,t){this._pullQueue.push({chrmId:e,timestamp:t}),this._startPull()},e.prototype.setLocal=function(e,t,n){var r=this._storeCaches[e];Tt(r)||(r=new Hu(this._engine.getInnerLogger(),e,n)),r.setEntries(t),this._storeCaches[e]=r},e.prototype.getValue=function(e,t){var n=this._storeCaches[e];return n?n.getValue(t):null},e.prototype.getVersion=function(e,t){var n=this._storeCaches[e];return n?n.getVersion(t):null},e.prototype.getAll=function(e){var t=this._storeCaches[e],n={};return t&&(n=t.getAllValue()),n},e}(),Yu=function(){function e(e){this._canJoinMulipleChrm=e,this._joinedChrmsInfo={}}return e.prototype.set=function(e,t,n){void 0===t&&(t=10),void 0===n&&(n=""),this._canJoinMulipleChrm||(this._joinedChrmsInfo={}),this._joinedChrmsInfo[e]={count:t,extra:n}},e.prototype.get=function(){return JSON.parse(JSON.stringify(this._joinedChrmsInfo))},e.prototype.remove=function(e){delete this._joinedChrmsInfo[e]},e.prototype.clear=function(){this._joinedChrmsInfo={}},e}(),Ku=function(e){function n(t,n,r,o){var i=e.call(this)||this;return i._tagKey="tags",i._versionKey="version",i._pullQueue=[],i._isPulling=!1,i._pullPromise=null,i._storageKey=Ye(n,r),i._storage=new uu(i._storageKey),i._engine=t,i._tagWatcherFunc=o,i}return t(n,e),n.prototype._updateTag=function(e){var t=e.tags,n={};t.forEach((function(e){n[e.tagId]={tagName:e.tagName,createdTime:e.createdTime}})),this._storage.set(this._tagKey,n),this._tagWatcherFunc()},n.prototype.addTag=function(e,t){var n,r=this._storage.get(this._tagKey)||{};e.forEach((function(e){var t,n=(null===(t=r[e.tagId])||void 0===t?void 0:t.createdTime)||e.createdTime||0;r[e.tagId]={tagName:e.tagName,createdTime:n}})),this._storage.update(((n={})[this._tagKey]=r,n[this._versionKey]=t,n))},n.prototype.deleteTag=function(e,t){var n,r=this._storage.get(this._tagKey)||{};e.forEach((function(e){delete r[e]})),this._storage.update(((n={})[this._tagKey]=r,n[this._versionKey]=t,n))},n.prototype.getTagsInfo=function(){return this._storage.get(this._tagKey)||{}},n.prototype.getTags=function(){var e=this._storage.get(this._tagKey)||{},t=[];for(var n in e)t.push({tagId:n,tagName:e[n].tagName,createdTime:e[n].createdTime,conversationCount:0});return t.sort((function(e,t){return(e.createdTime||0)-(t.createdTime||0)}))},n.prototype.getTagById=function(e){var t=this._storage.get(this._tagKey)||{};return t[e]?{tagId:e,tagName:t[e].tagName,createdTime:t[e].createdTime,conversationCount:0}:null},n.prototype._startPull=function(){return ue(this,void 0,void 0,(function(){var e,t,n,r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return this._isPulling||0===this._pullQueue.length?[2,this._pullPromise]:(this._isPulling=!0,this._pullQueue.shift(),e=this.getVersion(),this._pullPromise=this._engine.pullUserSettings(e),[4,this._pullPromise]);case 1:return t=u.sent(),n=t.code,r=t.data,this._isPulling=!1,this._pullPromise=null,n!==exports.ErrorCode.SUCCESS||Et(r)||(i=(o=r).settings,s=o.version,a=i.Tag,Et(a)||this._updateTag(a),this._storage.set(this._versionKey,s),this._pullQueue=this._pullQueue.filter((function(e){return e>s}))),0===this._pullQueue.length?this._startCall():this._startPull(),[2]}}))}))},n.prototype._startCall=function(){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return this._isPulling||e.prototype._startCall.call(this),[2]}))}))},n.prototype.pullUserSettings=function(e){var t=this.getVersion();(e>t||0===e)&&(this._pullQueue.push(t),this._startPull())},n.prototype._triggerPull=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){switch(t.label){case 0:return this._pullQueue.push(e),[4,this._startPull()];case 1:return t.sent(),[2]}}))}))},n.prototype.getVersion=function(){return this._storage.get(this._versionKey)||0},n.prototype.updateVersion=function(e){this._storage.set(this._versionKey,e)},n}(yu),Qu={};function Wu(){return{code:200,protocol:"https",server:"",voipCallInfo:"",kvStorage:0,openHttpDNS:!1,historyMsg:!1,chatroomMsg:!1,location:"",monitor:0,joinMChrm:!1,openMp:0,openUS:0,grpMsgLimit:0,isFormatted:0,gifSize:2048,logSwitch:0,logPolicy:"",compDays:0,msgAck:"",activeServer:"",qnAddr:"",extkitSwitch:0,alone:!1,voipServer:"",offlinelogserver:"",backupServer:cn.getMiniCmpUrlList().join(",")}}var ju=function(e){function n(t,n,r,o){void 0===o&&(o="default");var i=e.call(this,t,n,r,Tr.useNavi&&"https:"===(null===window||void 0===window?void 0:window.location.protocol),Tr.useNavi)||this;return i._environment=o,i}return t(n,e),n.prototype.httpRequest=function(e,t,n,r,o){return ue(this,void 0,void 0,(function(){var i,s,a,u;return ce(this,(function(c){switch(c.label){case 0:return i="".concat(e,"/navi.js?appId=").concat(t,"&token=").concat(encodeURIComponent(n),"&callBack=x&v=").concat(be,"&r=").concat(Date.now(),"&env=").concat(this._environment),this.logger.debug(exports.LogTagId.L_REQUEST_T,"req navi => ".concat(i),r),[4,Tr.httpReq({url:i,timeout:1e4,dataType:"text"})];case 1:if(200!==(s=c.sent()).status)return this.logger.debug(exports.LogTagId.L_REQUEST_R,"request navi failed: ".concat(s.status),r),!Tr.useNavi&&o?[2,it(Wu())]:[2,st(this.transHttpCode(s.status))];try{return 0===(a=s.data.match(/{[\d\D]+}/)[0]).indexOf('{\\"code\\":')&&(a=JSON.parse('"'.concat(a,'"'))),(u=JSON.parse(a)).protocol=/^https/.test(i)?"https":"http",u.code&&200!==u.code?[2,st(this.transHttpCode(u.code))]:(Tr.useNavi||(u.server="",u.backupServer=cn.getMiniCmpUrlList().join(","),u.logSwitch=0),[2,it(u)])}catch(e){this.logger.error(exports.LogTagId.L_PARSE_NAVI_E,s.data,r)}return[2,st(exports.ErrorCode.RC_NAVI_REQ_FAILED)]}}))}))},n.prototype.httpRequestV2=function(e,t,n,r,o){return ue(this,void 0,void 0,(function(){var i,s,a,u,c;return ce(this,(function(l){switch(l.label){case 0:return i=this.getNaviV2RequestOption({appkey:t,token:n,uri:e,platform:Tr.tag,protocol:(/^https/.test(e)?x.WSS:x.WS).toString()}),this.logger.debug(exports.LogTagId.L_REQUEST_T,"req navi => ".concat(i.url),r),[4,Tr.httpReq(i)];case 1:if(200!==(s=l.sent()).status)return this.logger.debug(exports.LogTagId.L_REQUEST_R,"request navi failed: ".concat(s.status),r),!Tr.useNavi&&o?[2,it(Wu())]:[2,st(this.transHttpCode(s.status))];try{return a=s.data,(u="object"!=typeof a?JSON.parse(a):a).protocol=/^https/.test(i.url)?"https":"http",Tr.useNavi||(u.logSwitch=0,c=cn.getMiniCmpUrlList(),u.serverAddr=c.map((function(e,t){return{addr:e,protocol:/^https/.test(i.url)?x.WSS:x.WS,weight:c.length-t}}))),[2,it(u)]}catch(e){this.logger.error(exports.LogTagId.L_PARSE_NAVI_E,s.data,r)}return[2,st(exports.ErrorCode.RC_NAVI_REQ_FAILED)]}}))}))},n.prototype.getNaviCache=function(e){var t=this,n=this.getCatchKey(e);if(Qu[n])return Qu[n];var r,o=xe(this.appkey),i=Tr.localStorage;try{var s=i.getItem(o);r=s?JSON.parse(s):[]}catch(e){r=[]}if(0===r.length)return null;var a=r.find((function(n){return n.token===e&&n.environment===t._environment}))||null;return Qu[n]=a,a},n.prototype.setNaviCache=function(e,t){var n,r=this,o=xe(this.appkey),i=Tr.localStorage;try{var s=i.getItem(o);n=s?JSON.parse(s):[]}catch(e){n=[]}var a=Date.now();n.length>0&&(n=n.filter((function(t){return a-t.timestamp<Oe&&(e!==t.token||r._environment!==t.environment)})));var u={timestamp:a,naviInfo:t,token:e,environment:this._environment};n.push(u),i.setItem(o,JSON.stringify(n)),Qu[this.getCatchKey(e)]=u},n}(Nn),Ju=function(){function e(e){this._appkey=e,this._users={}}return e.prototype._getMemData=function(e){return this._users[e]=this._users[e]||{inboxTime:0,outboxTime:0,broadcastSyncTime:0},this._users[e]},e.prototype.setInboxTime=function(e,t){var n=this._getMemData(t);if(!(n.inboxTime>e)){n.inboxTime=e;var r=Be(this._appkey,t);Tr.localStorage.setItem(r,e.toString())}},e.prototype.getInboxTime=function(e){var t=this._getMemData(e);if(0===t.inboxTime){var n=Be(this._appkey,e);t.inboxTime=parseInt(Tr.localStorage.getItem(n),10)||0}return t.inboxTime},e.prototype.setBroadcastSyncTime=function(e,t){var n=this._getMemData(t);if(!(n.broadcastSyncTime>=e||Et(e))){n.broadcastSyncTime=e;var r=He(this._appkey,t);Tr.localStorage.setItem(r,e.toString())}},e.prototype.getBroadcastSyncTime=function(e){var t=this._getMemData(e);if(!t||0===t.broadcastSyncTime){var n=He(this._appkey,e);t.broadcastSyncTime=parseInt(Tr.localStorage.getItem(n),10)||1}return t.broadcastSyncTime},e.prototype.setOutboxTime=function(e,t){var n=this._getMemData(t);if(!(n.outboxTime>=e)){n.outboxTime=e;var r=Fe(this._appkey,t);Tr.localStorage.setItem(r,e.toString())}},e.prototype.getOutboxTime=function(e){var t=this._getMemData(e);if(0===t.outboxTime){var n=Fe(this._appkey,e);t.outboxTime=parseInt(Tr.localStorage.getItem(n),10)||0}return t.outboxTime},e}(),zu=function(){function e(e){this._appkey=e,this._sendMessageMap={},this._userId=""}return e.prototype.init=function(e){this._userId=e;var t=qe(this._appkey,e);this._sendMessageMap=this._getLocalInfo(t)},e.prototype._getLocalInfo=function(e){var t=Tr.localStorage.getItem(e);try{return t?JSON.parse(t):{}}catch(e){return{}}},e.prototype.setMessage=function(e,t){this._sendMessageMap[e]=t;var n=qe(this._appkey,this._userId),r=this._getLocalInfo(n);r[e]=t,Tr.localStorage.setItem(n,JSON.stringify(r))},e.prototype.getSendMessageMap=function(){return this._sendMessageMap},e.prototype.removeByUID=function(e){delete this._sendMessageMap[e]},e.prototype.removeByTimestamp=function(e){var t=qe(this._appkey,this._userId),n=this._getLocalInfo(t);Object.keys(n).forEach((function(t){n[t]<e&&delete n[t]})),Tr.localStorage.setItem(t,JSON.stringify(n))},e}(),Zu=function(){function e(e){var t;this._delayTime=e,this.subscribeData=((t={})[exports.SubscribeType.ONLINE_STATUS]={},t[exports.SubscribeType.USER_PROFILE]={},t),this._ownProfile=null}return e.prototype.clearSubscribeRelation=function(){var e;this.subscribeData=((e={})[exports.SubscribeType.ONLINE_STATUS]={},e[exports.SubscribeType.USER_PROFILE]={},e)},e.prototype.clearSubscribeStatusData=function(e){var t=this;e===exports.SubscribeType.ONLINE_STATUS?Object.keys(this.subscribeData[e]).forEach((function(n){t.subscribeData[e][n].statusMap={}})):e===exports.SubscribeType.USER_PROFILE&&Object.keys(this.subscribeData[e]).forEach((function(n){t.subscribeData[e][n].profile=void 0}))},e.prototype.getSubscribeUserData=function(e,t){var n=this.subscribeData[e][t];return n?se({},n):void 0},e.prototype.removeSubscribeUserData=function(e,t){delete this.subscribeData[e][t]},e.prototype.updateSubscribeUserData=function(e,t,n){this.subscribeData[e][t]=n},e.prototype.clearExpiredData=function(e){for(var t in this.subscribeData[e]){var n=this.subscribeData[e][t];n.expiry<(Date.now()+this._delayTime-n.subscribeTime)/1e3&&delete this.subscribeData[e][t]}},e.prototype.getSubscribeUserList=function(e,t,n){return pe([],de(Object.values(this.subscribeData[e])),!1).sort((function(e,t){return e.subscribeTime-t.subscribeTime})).slice(n,n+t)},e.prototype.updateOwnProfile=function(e){this._ownProfile=se(se({},e),{extraProfile:se({},e.extraProfile)})},e.prototype.getOwnProfile=function(){return this._ownProfile?se(se({},this._ownProfile),{extraProfile:se({},this._ownProfile.extraProfile)}):null},e}(),Xu=function(){function e(e){this._delayTime=e,this._relationshipStatusVersion=0,this._subUserStatusVersion=0,this._ownProfileVersion=0,this._subStore=new Zu(e)}return e.prototype.updateRelationshipStatusVersion=function(e){e>this._relationshipStatusVersion&&(this._relationshipStatusVersion=e)},e.prototype.getRelationshipStatusVersion=function(){return this._relationshipStatusVersion},e.prototype.updateSubscribeUserStatusVersion=function(e){e>this._subUserStatusVersion&&(this._subUserStatusVersion=e)},e.prototype.getSubscribeUserStatusVersion=function(){return this._subUserStatusVersion},e.prototype._filterSubscribeRelationData=function(e){return e.reduce((function(e,t){return t.subUsers.forEach((function(n){var r=e.find((function(e){return e.subscribeType===t.subType&&e.userId===n.subUserId}));r?r.subscribeTime<t.subTime&&(r.expiry=t.expiry,r.operationType=t.opType,r.subscribeTime=t.subTime):e.push({userId:n.subUserId,subscribeTime:t.subTime,subscribeType:t.subType,expiry:t.expiry,operationType:t.opType})})),e}),[])},e.prototype.updateSubscribeRelation=function(e,t){var n=this;void 0===t&&(t=!1);var r=[],o=[],i=[];return t&&this._subStore.clearSubscribeRelation(),this._filterSubscribeRelationData(e).forEach((function(e){var t,s,a=e.userId,u=e.subscribeTime,c=e.subscribeType,l=e.expiry;if(e.operationType===exports.SubscribeOperationType.UNSUBSCRIBE)return n._subStore.removeSubscribeUserData(c,a),void i.push(e);var d=n._subStore.getSubscribeUserData(c,a);if(!(d&&d.subscribeTime>=u)){if(c===exports.SubscribeType.ONLINE_STATUS){r.push(a);var p=(null===(t=d)||void 0===t?void 0:t.statusMap)||{};n._subStore.updateSubscribeUserData(c,a,{subscribeTime:u,expiry:l,userId:a,subscribeType:c,statusMap:p})}else{o.push(a);var h=null===(s=d)||void 0===s?void 0:s.profile;n._subStore.updateSubscribeUserData(c,a,{subscribeTime:u,expiry:l,userId:a,subscribeType:c,profile:h,isSubscribed:!0})}i.push(e)}})),{newSubscribeOnlineStatusList:r,newSubscribeUserProfileList:o,subscribeUserChangeList:i}},e.prototype.clearSubscribeStatus=function(){this._subStore.clearSubscribeStatusData(exports.SubscribeType.ONLINE_STATUS),this._subStore.clearSubscribeStatusData(exports.SubscribeType.USER_PROFILE)},e.prototype.updateSubscribeUserOnlineStatus=function(e){var t=this,n=[];return e.forEach((function(e){var r=e.subUserId,o=e.data,i=t._subStore.getSubscribeUserData(exports.SubscribeType.ONLINE_STATUS,r);if(i){var s=[],a=se({},i.statusMap);o.forEach((function(e){var t=a[e.platformInfo];if(!(t&&t.changeTime>e.versionTime)){var n={eventValue:e.value,changeTime:e.versionTime};a[e.platformInfo]=n,s.push(se(se({},n),{platform:e.platformInfo}))}})),t._subStore.updateSubscribeUserData(exports.SubscribeType.ONLINE_STATUS,r,{subscribeTime:i.subscribeTime,expiry:i.expiry,userId:r,subscribeType:exports.SubscribeType.ONLINE_STATUS,statusMap:a}),n.push({userId:r,subscribeType:exports.SubscribeType.ONLINE_STATUS,subscribeTime:i.subscribeTime,expiry:i.expiry,details:s})}})),n},e.prototype.updateSubscribeUserProfile=function(e){var t=this,n=[];return e.forEach((function(e){var r=e.userId,o=e.version,i=e.userProfile,s=e.userExtProfile,a=t._subStore.getSubscribeUserData(exports.SubscribeType.USER_PROFILE,r),u=Pt(r,i,s);a?a.profile&&a.profile.version>=o||(t._subStore.updateSubscribeUserData(exports.SubscribeType.USER_PROFILE,r,{subscribeTime:a.subscribeTime,expiry:a.expiry,userId:r,subscribeType:exports.SubscribeType.USER_PROFILE,profile:{info:u,version:o},isSubscribed:a.isSubscribed}),a.isSubscribed&&n.push({userId:r,subscribeType:exports.SubscribeType.USER_PROFILE,subscribeTime:a.subscribeTime,expiry:a.expiry,userProfile:se({},u)})):t._subStore.updateSubscribeUserData(exports.SubscribeType.USER_PROFILE,r,{subscribeTime:0,expiry:0,userId:r,subscribeType:exports.SubscribeType.USER_PROFILE,profile:{info:u,version:o},isSubscribed:!1})})),n},e.prototype.getSubscribeUserStatus=function(e,t){var n=this,r=[];return t.forEach((function(t){var o=n._subStore.getSubscribeUserData(e,t);if(!o||o.expiry<(Date.now()+n._delayTime-o.subscribeTime)/1e3)n._subStore.removeSubscribeUserData(e,t);else{var i={subscribeTime:o.subscribeTime,expiry:o.expiry,userId:o.userId,subscribeType:o.subscribeType};if(e===exports.SubscribeType.ONLINE_STATUS){var s=o.statusMap,a=Object.keys(s).map((function(e){return se({platform:~~e},s[~~e])}));i.details=bt(a)}else if(e===exports.SubscribeType.USER_PROFILE&&!o.isSubscribed)return;r.push(i)}})),r},e.prototype.getUserProfiles=function(e){var t=this,n=[],r=[];return e.forEach((function(e){var o=t._subStore.getSubscribeUserData(exports.SubscribeType.USER_PROFILE,e);if(o&&o.profile){var i=o.profile,s=i.version,a=i.info;if(o.isSubscribed)return t._delayTime+Date.now()-s>6048e5?void r.push(e):void n.push(se(se({},a),{extraProfile:se({},a.extraProfile)}));t._delayTime+Date.now()-s>6e5?r.push(e):n.push(se(se({},a),{extraProfile:se({},a.extraProfile)}))}else r.push(e)})),{list:n,needQueryUserIds:r}},e.prototype.getSubscribeUserList=function(e,t,n){return this._subStore.clearExpiredData(e),this._subStore.getSubscribeUserList(e,t,n).map((function(t){var n={subscribeTime:t.subscribeTime,expiry:t.expiry,userId:t.userId,subscribeType:t.subscribeType};if(e===exports.SubscribeType.ONLINE_STATUS){var r=Object.keys(t.statusMap).map((function(e){return se({platform:~~e},t.statusMap[~~e])}));n.details=bt(r)}return n}))},e.prototype.updateOwnProfile=function(e,t){this._ownProfileVersion>t||this._subStore.updateOwnProfile(e)},e.prototype.getOwnProfile=function(){return this._subStore.getOwnProfile()},e}(),$u=function(){function e(e,t,n,r,o,i,s){this._connectManager=e,this._event=t,this._currentUserId=n,this._delayTime=r,this._logger=o,this._isOpenUserProfile=i,this._subDriven=s,this._isPullingRelationship=!1,this._pullRelationshipQueue=[],this._pullRelationshipFailTime=0,this._isPullingSubUserStatus=!1,this._pullSubUserStatusQueue=[],this._pullSubUserStatusFailTime=0,this._subscribeService=new Xu(r)}return e.prototype.syncData=function(){return ue(this,void 0,void 0,(function(){return ce(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]}}))}))},e.prototype.startSyncSubscribeRelationship=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return this._pullRelationshipQueue.push(e),this._syncSubscribeRelationship(),[2]}))}))},e.prototype._syncSubscribeRelationship=function(e){return void 0===e&&(e=!0),ue(this,void 0,void 0,(function(){return ce(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]}}))}))},e.prototype._pullSubscribeRelationship=function(e,t){return void 0===t&&(t=""),ue(this,void 0,void 0,(function(){var n,r,o,i,s,a,u,c,l,d,p,h,_,g,f;return ce(this,(function(E){switch(E.label){case 0:return n=this._subscribeService.getRelationshipStatusVersion(),r=this._logger.createTraceId(),this._logger.info(exports.LogTagId.L_PULL_SUBSCRIBED_USER_RELATION_T,JSON.stringify({version:n,_pageToken:t}),r),o=this._connectManager.codec.encodePullUserSubReq({version:n,pageToken:t}),i=new Fa(as.pullUserSub,o,this._currentUserId),[4,this._connectManager.send(i,ii)];case 1:return s=E.sent(),a=s.code,u=s.data,a===exports.ErrorCode.SUCCESS&&u?(this._pullRelationshipFailTime=0,c=u.list,l=u.version,d=u.hasNext,p=u.pageToken,l=mt(l),c.forEach((function(e){e.subTime=mt(e.subTime)})),this._logger.info(exports.LogTagId.L_PULL_SUBSCRIBED_USER_RELATION_R,JSON.stringify({code:a,data:u}),r),e?(h=this._subscribeService.updateSubscribeRelation(c),_=h.newSubscribeOnlineStatusList,g=h.newSubscribeUserProfileList,(f=h.subscribeUserChangeList).length>0&&this._event.subscribeRelationChanged(f),_.length>0&&this._queryAndUpdateUserOnlineStatus(_),g.length>0&&this._queryAndUpdateUserProfile(g)):this._subscribeService.updateSubscribeRelation(c,!t),this._subscribeService.updateRelationshipStatusVersion(l),this._pullRelationshipQueue=this._pullRelationshipQueue.filter((function(e){return e>l})),d?[4,this._pullSubscribeRelationship(e,p)]:[3,3]):(this._logger.error(exports.LogTagId.L_PULL_SUBSCRIBED_USER_RELATION_R,JSON.stringify({code:a,failTime:this._pullRelationshipFailTime}),r),this._pullRelationshipFailTime++,this._pullRelationshipFailTime>5?(this._pullRelationshipFailTime=0,[2]):[2,this._pullSubscribeRelationship(e,t)]);case 2:E.sent(),E.label=3;case 3:return[2]}}))}))},e.prototype.startsyncSubscribeUserStatus=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return this._pullSubUserStatusQueue.push(e),this._syncSubscribeUserStatus(),[2]}))}))},e.prototype._syncSubscribeUserStatus=function(e){return void 0===e&&(e=!1),ue(this,void 0,void 0,(function(){return ce(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]}}))}))},e.prototype._pullSubscribeUserStatus=function(e,t){return void 0===e&&(e=!1),void 0===t&&(t=""),ue(this,void 0,void 0,(function(){var n,r,o,i,s,a,u,c,l,d,p,h,_,g;return ce(this,(function(f){switch(f.label){case 0:return n=this._subscribeService.getSubscribeUserStatusVersion(),r=this._logger.createTraceId(),this._logger.info(exports.LogTagId.L_PULL_SUBSCRIBED_USER_STATUS_T,JSON.stringify({version:n,_pageToken:t,needAllData:e}),r),o=this._connectManager.codec.encodePullSubDataReq({version:n,needAllData:e,pageToken:t}),i=new Fa(as.pullSubData,o,this._currentUserId),[4,this._connectManager.send(i,ai)];case 1:return s=f.sent(),a=s.code,u=s.data,a===exports.ErrorCode.SUCCESS&&u?(this._pullSubUserStatusFailTime=0,c=u.list,l=u.versionTime,d=u.hasNext,p=u.pageToken,h=u.isFull,l=mt(l),this._logger.info(exports.LogTagId.L_PULL_SUBSCRIBED_USER_STATUS_R,JSON.stringify({code:a,data:u}),r),c.forEach((function(e){e.data.forEach((function(e){e.versionTime=mt(e.versionTime)}))})),this._pullSubUserStatusQueue=this._pullSubUserStatusQueue.filter((function(e){return e>l})),this._subscribeService.updateSubscribeUserStatusVersion(l),_=[],g=[],c.forEach((function(e){e.subType===exports.SubscribeType.ONLINE_STATUS?_.push(e):e.subType===exports.SubscribeType.USER_PROFILE&&g.push(e.subUserId)})),h&&""===t&&this._subscribeService.clearSubscribeStatus(),_.length>0&&this._updateUserOnlineStatus(_,!h),g.length>0?[4,this._queryAndUpdateUserProfile(g,!h)]:[3,3]):(this._logger.warn(exports.LogTagId.L_PULL_SUBSCRIBED_USER_STATUS_R,JSON.stringify({code:a,failTime:this._pullSubUserStatusFailTime}),r),this._pullSubUserStatusFailTime++,this._pullSubUserStatusFailTime>5?(this._pullSubUserStatusFailTime=0,[2]):[2,this._pullSubscribeUserStatus(e,t)]);case 2:f.sent(),f.label=3;case 3:return d?[4,this._pullSubscribeUserStatus(e,p)]:[3,5];case 4:f.sent(),f.label=5;case 5:return[2]}}))}))},e.prototype._queryAndUpdateUserOnlineStatus=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s;return ce(this,(function(a){switch(a.label){case 0:return t=this._logger.createTraceId(),this._logger.info(exports.LogTagId.L_QUERY_SUBSCRIBE_DATA_T,JSON.stringify(e),t),n=this._connectManager.codec.encodeQrySubDataReq(exports.SubscribeType.ONLINE_STATUS,e),r=new Fa(as.qrySubData,n,this._currentUserId),[4,this._connectManager.send(r,ai)];case 1:return o=a.sent(),i=o.code,s=o.data,this._logger.info(exports.LogTagId.L_QUERY_SUBSCRIBE_DATA_R,JSON.stringify({code:i,data:s}),t),i===exports.ErrorCode.SUCCESS&&s?(this._updateUserOnlineStatus(s.list),[2]):[2]}}))}))},e.prototype._updateUserOnlineStatus=function(e,t){void 0===t&&(t=!0),e.forEach((function(e){e.data.forEach((function(e){e.versionTime=mt(e.versionTime)}))}));var n=this._subscribeService.updateSubscribeUserOnlineStatus(e);n=n.filter((function(e){return e.details&&e.details.length>0})),t&&n.length>0&&this._event.subscribeUserStatusChanged(n)},e.prototype._queryAndUpdateUserProfile=function(e,t){return void 0===t&&(t=!0),ue(this,void 0,void 0,(function(){var n,r,o,i,s,a,u;return ce(this,(function(c){switch(c.label){case 0:return n=this._logger.createTraceId(),this._logger.info(exports.LogTagId.L_PULL_USER_PROFILE_T,JSON.stringify(e),n),r=this._connectManager.codec.encodePullUserProfileReq(e),o=new Fa(as.pullUserProfile,r,this._currentUserId),[4,this._connectManager.send(o,_i)];case 1:return i=c.sent(),s=i.code,a=i.data,this._logger.info(exports.LogTagId.L_PULL_USER_PROFILE_R,JSON.stringify({code:s,data:a}),n),s===exports.ErrorCode.SUCCESS&&a?(a.UserProfile.forEach((function(e){e.version=mt(e.version)})),u=this._subscribeService.updateSubscribeUserProfile(a.UserProfile),t&&u.length>0&&this._event.subscribeUserStatusChanged(u),[2,{code:s,data:a.UserProfile}]):[2,{code:s}]}}))}))},e.prototype.updateUserStatus=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o;return ce(this,(function(i){switch(i.label){case 0:return(t=this._connectManager.codec.decodeByPBName(e.pbData,ui)).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]:(n=t.data.map((function(e){return{changeTime:mt(e.versionTime),eventValue:e.value,platform:e.platformInfo}})),this._event.subscribeUserStatusChanged([{userId:t.subUserId,subscribeType:t.subType,subscribeTime:0,expiry:0,details:n}]),[3,5]);case 3:return t.subType!==exports.SubscribeType.FRIEND_USER_PROFILE?[3,5]:[4,this._queryAndUpdateUserProfile([t.subUserId])];case 4:r=i.sent(),(o=r.data)&&this._event.subscribeUserStatusChanged([{userId:t.subUserId,subscribeType:t.subType,subscribeTime:0,expiry:0,userProfile:Pt(t.subUserId,o[0].userProfile,o[0].userExtProfile)}]),i.label=5;case 5:return[2]}}))}))},e.prototype.getSubscribeUserStatus=function(e,t){return this._subscribeService.getSubscribeUserStatus(e,t)},e.prototype.getSubscribeUserList=function(e,t,n){return this._subscribeService.getSubscribeUserList(e,t,n)},e.prototype.updateSubscribeRelation=function(e,t,n,r){return void 0===r&&(r=0),ue(this,void 0,void 0,(function(){var o,i,s,a,u,c;return ce(this,(function(l){switch(l.label){case 0:return o=this._connectManager.codec.encodeUpdateUserSubReq(t,e,n,r),i=new Fa(as.updUserSub,o,this._currentUserId),[4,this._connectManager.send(i,ri)];case 1:return s=l.sent(),a=s.code,u=s.data,a===exports.ErrorCode.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT&&u?[2,{code:a,data:u.subUsers.map((function(e){return e.subUserId}))}]:a===exports.ErrorCode.SUCCESS&&u?(c=u.subTime,this._subscribeService.updateSubscribeRelation([{subType:t,subTime:c,expiry:r,opType:n,subUsers:e.map((function(e){return{subUserId:e}}))}]),n===exports.SubscribeOperationType.SUBSCRIBE&&(t===exports.SubscribeType.ONLINE_STATUS?this._queryAndUpdateUserOnlineStatus(e):t===exports.SubscribeType.USER_PROFILE&&this._queryAndUpdateUserProfile(e,!1)),[2,{code:a}]):[2,{code:a}]}}))}))},e.prototype.getUserProfiles=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return t=this._subscribeService.getUserProfiles(e),n=t.needQueryUserIds,r=t.list,0===n.length?[2,Promise.resolve({code:exports.ErrorCode.SUCCESS,data:r})]:[4,this._queryAndUpdateUserProfile(n,!1)];case 1:return o=u.sent(),i=o.code,s=o.data,i===exports.ErrorCode.SUCCESS&&s?(a=s.map((function(e){return Pt(e.userId,e.userProfile,e.userExtProfile)})),[2,{code:i,data:pe(pe([],de(r),!1),de(a),!1)}]):[2,{code:i,data:pe([],de(r),!1)}]}}))}))},e.prototype.syncOwnProfile=function(e){return void 0===e&&(e=!1),ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a,u,c,l,d,p;return ce(this,(function(h){switch(h.label){case 0:return this._isOpenUserProfile?(t=this._logger.createTraceId(),this._logger.info(exports.LogTagId.L_PULL_OWN_PROFILE_T,"",t),n=this._connectManager.codec.encodeUserProfileInput(),r=new Fa(as.pullOwnProfile,n,this._currentUserId),[4,this._connectManager.send(r,li)]):[2,Promise.resolve({code:exports.ErrorCode.RC_USER_PROFILE_SERVICE_UNAVAILABLE})];case 1:return o=h.sent(),i=o.code,s=o.data,this._logger.info(exports.LogTagId.L_PULL_OWN_PROFILE_R,JSON.stringify({code:i,data:s}),t),i===exports.ErrorCode.SUCCESS&&s?(a=s.userExtProfile,u=s.userProfile,c=s.version,l=s.userId,d=mt(c),p=Pt(l,u,a),this._subscribeService.updateOwnProfile(p,d),e&&this._event.ownUserProfileChanged(p),[2,{code:i,data:p}]):[2,{code:i}]}}))}))},e.prototype.getOwnProfile=function(){return ue(this,void 0,void 0,(function(){var e;return ce(this,(function(t){return(e=this._subscribeService.getOwnProfile())?[2,{code:exports.ErrorCode.SUCCESS,data:e}]:[2,this.syncOwnProfile()]}))}))},e.prototype.updateOwnProfile=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){return this._subscribeService.updateOwnProfile(e,t),[2]}))}))},e}(),ec=function(){function e(e,t,n){this._storage=new uu(We(e,t)),this._delayTime=n,this.clear()}return e.prototype._getConversationKey=function(e){return"".concat(e.targetId,"_").concat(e.channelId)},e.prototype._removeExcessData=function(e){var t,n,r=Object.keys(e).map((function(t){return{key:t,value:e[t]}})).sort((function(e,t){return e.value.t-t.value.t})).slice(-30),o={};try{for(var i=le(r),s=i.next();!s.done;s=i.next()){var a=s.value;o[a.key]=a.value}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return o},e.prototype.insert=function(e,t,n,r,o){var i;if(!(r<Date.now()-this._delayTime-we)){var s=this._getConversationKey(e),a=this._storage.get(s)||{};if(!a[t]){var u={t:r,d:n};o&&(u.sId=o);var c=se(se({},a),((i={})[t]=u,i));Object.keys(c).length>30&&(c=this._removeExcessData(c)),this._storage.set(s,c)}}},e.prototype.addReadedUser=function(e,t,n){var r,o=this._getConversationKey(e),i=this._storage.get(o)||{},s=i[t];if(s){if(s.us){if(s.us.includes(n))return}else s.us=[];s.us.push(n),this._storage.set(o,se(se({},i),((r={})[t]=s,r)))}},e.prototype.getReadReceiptInfo=function(e,t){var n=this._getConversationKey(e),r=(this._storage.get(n)||{})[t];return r?{time:r.t,direction:r.d,users:r.us||[],senderId:r.sId}:null},e.prototype.getReceiptMessageDic=function(e){var t=this._getConversationKey(e),n=this._storage.get(t)||{},r={};for(var o in n){var i=n[o];i.d===exports.MessageDirection.RECEIVE&&(r[i.sId]||(r[i.sId]=[]),r[i.sId].push(o))}return r},e.prototype.remove=function(e,t){var n=this._getConversationKey(e),r=this._storage.get(n)||{};r[t]&&(delete r[t],0===Object.keys(r).length?this._storage.remove(n):this._storage.set(n,r))},e.prototype.clear=function(){var e=this._storage.getValues(),t={};for(var n in e){var r=e[n],o={};for(var i in r){var s=r[i];Date.now()-this._delayTime-s.t<we&&(o[i]=s)}Object.keys(o).length&&(t[n]=o)}this._storage.update(t)},e}(),tc=function(e){function n(t,n){var r=e.call(this,t,n)||this;return r.appkey=t,r.logger=n,r._storageKey="",r._storageKey=Ke(t),r}return t(n,e),n.prototype.getCache=function(){return Tr.localStorage.getItem(this._storageKey)},n.prototype.setCache=function(e){Tr.localStorage.setItem(this._storageKey,e)},n.prototype.clearCache=function(){Tr.localStorage.removeItem(this._storageKey)},n.prototype.sendRequest=function(e){return ue(this,void 0,void 0,(function(){var t,n,r;return ce(this,(function(o){switch(o.label){case 0:return[4,Tr.httpReq({url:e})];case 1:return t=o.sent(),n=t.status,r=t.data,[2,{code:n,data:r}]}}))}))},n.prototype.decryptData=function(e){return ue(this,void 0,void 0,(function(){var t,n;return ce(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,Zt(e,"cd4936151214ce45dc1d12673a59d94c","51ad078e5eb17a91")];case 1:return t=r.sent(),[2,JSON.parse(t)];case 2:return n=r.sent(),this.logger.error(exports.LogTagId.L_GET_STATIC_CONF_E,JSON.stringify({error:null==n?void 0:n.stack})),[3,3];case 3:return[2]}}))}))},n}(ln),nc=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t._pullQueue=[],t._isPulling=!1,t}return t(n,e),n.prototype.startPull=function(){return ue(this,void 0,void 0,(function(){var e,t,n,r,o,i,s;return ce(this,(function(a){switch(a.label){case 0:return this._isPulling?[2]:(this._isPulling=!0,[4,this.pullQueueConsumption()]);case 1:return e=a.sent(),t=e.code,n=e.data,this._isPulling=!1,r=n&&n.hasNext||!1,t!==exports.ErrorCode.SUCCESS||Et(n)||(this.pullDataHandler(n),o=this.getVersion(),i=this._pullQueue.filter((function(e){return e>o})),this._pullQueue.length=0,(s=this._pullQueue).push.apply(s,pe([],de(i),!1))),r?(this.startPull(),[2]):(this._pullQueue.length>0&&(this._pullQueue.length=0,this.startPull()),[2])}}))}))},n.prototype._triggerPull=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){switch(t.label){case 0:return this._pullQueue.push(e),[4,this.startPull()];case 1:return t.sent(),[2]}}))}))},n}(yu),rc=function(e){function n(t,n,r,o,i){var s=e.call(this)||this;return s._connectManager=t,s._currentUserId=n,s._logger=r,s._appkey=o,s._callBack=i,s._lastPullingChangeMessageTime=0,s._lastPullingChangeMessageTimeLocal=(new Date).getTime(),s._duration=18e4,s._pullEventChangeIntervalTimer=-1,s._localStorageKey=je(o,n),s._storage=new uu(s._localStorageKey),s._lastPullingChangeMessageTime=s._storage.get(n)||0,s}return t(n,e),Object.defineProperty(n.prototype,"_isConnected",{get:function(){return this._connectManager.getConnectionStatus()===exports.RCConnectionStatus.CONNECTED},enumerable:!1,configurable:!0}),n.prototype._setLastPullingChangeMessageTime=function(e){this._lastPullingChangeMessageTime=e,this._storage.set(this._currentUserId,e)},n.prototype._startPullEventChangeInterval=function(){var e=this,t=function(){e._pullEventChangeIntervalTimer=setTimeout((function(){var n=Date.now();n-e._lastPullingChangeMessageTimeLocal>=e._duration&&(e.startPullEventChange(e._lastPullingChangeMessageTime,!0),e._lastPullingChangeMessageTimeLocal=n),e._stopUltraSyncInterval(),t()}),3e4)};t()},n.prototype._stopUltraSyncInterval=function(){-1!==this._pullEventChangeIntervalTimer&&(clearTimeout(this._pullEventChangeIntervalTimer),this._pullEventChangeIntervalTimer=-1)},n.prototype.startPullEventChange=function(e,t){void 0===t&&(t=!1);var n=this.getVersion();(e>n||0===e||t)&&this._triggerPull(n)},n.prototype.pullQueueConsumption=function(){if(!this._isConnected)return Promise.resolve({code:exports.ErrorCode.CONNECTION_TIMEOUT});this._logger.info(exports.LogTagId.L_PULL_EVENT_CHANGE_T,"PullEventChange time: ".concat(this._lastPullingChangeMessageTime));var e=this._connectManager.codec.encodeQueryMsgChange(this._lastPullingChangeMessageTime),t=new Fa(as.pullEventChange,e,this._currentUserId);return t.setHeaderQos(ps.AT_LEAST_ONCE),this._connectManager.send(t,ko)},n.prototype.pullDataHandler=function(e){this._logger.info(exports.LogTagId.L_PULL_EVENT_CHANGE_R,"PullEventChange data: ".concat(JSON.stringify(e)));var t=e.list,n=(null==e?void 0:e.syncTime)||0;this._callBack(t),this._setLastPullingChangeMessageTime(n)},n.prototype.getVersion=function(){return this._lastPullingChangeMessageTime||0},n.prototype.notificationOnline=function(){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){return this._isConnected?(this.startPullEventChange(this._lastPullingChangeMessageTime,!0),this._startPullEventChangeInterval(),this._logger.info(exports.LogTagId.L_PULL_EVENT_CHANGE_NOTIFY_ULTRA_ONLINE_S,"PullEventChange notify online"),[2]):[2]}))}))},n}(nc);function oc(e){let t=e.length;for(;--t>=0;)e[t]=0}const ic=256,sc=286,ac=30,uc=15,cc=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]),lc=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]),dc=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),pc=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),hc=new Array(576);oc(hc);const _c=new Array(60);oc(_c);const gc=new Array(512);oc(gc);const fc=new Array(256);oc(fc);const Ec=new Array(29);oc(Ec);const Ic=new Array(ac);function Tc(e,t,n,r,o){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=o,this.has_stree=e&&e.length}let vc,Cc,Rc;function yc(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}oc(Ic);const mc=e=>e<256?gc[e]:gc[256+(e>>>7)],Sc=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},Ac=(e,t,n)=>{e.bi_valid>16-n?(e.bi_buf|=t<<e.bi_valid&65535,Sc(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},Nc=(e,t,n)=>{Ac(e,n[2*t],n[2*t+1])},Oc=(e,t)=>{let n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1},Mc=(e,t,n)=>{const r=new Array(16);let o,i,s=0;for(o=1;o<=uc;o++)s=s+n[o-1]<<1,r[o]=s;for(i=0;i<=t;i++){let t=e[2*i+1];0!==t&&(e[2*i]=Oc(r[t]++,t))}},Lc=e=>{let t;for(t=0;t<sc;t++)e.dyn_ltree[2*t]=0;for(t=0;t<ac;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},Uc=e=>{e.bi_valid>8?Sc(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},bc=(e,t,n,r)=>{const o=2*t,i=2*n;return e[o]<e[i]||e[o]===e[i]&&r[t]<=r[n]},Pc=(e,t,n)=>{const r=e.heap[n];let o=n<<1;for(;o<=e.heap_len&&(o<e.heap_len&&bc(t,e.heap[o+1],e.heap[o],e.depth)&&o++,!bc(t,r,e.heap[o],e.depth));)e.heap[n]=e.heap[o],n=o,o<<=1;e.heap[n]=r},wc=(e,t,n)=>{let r,o,i,s,a=0;if(0!==e.sym_next)do{r=255&e.pending_buf[e.sym_buf+a++],r+=(255&e.pending_buf[e.sym_buf+a++])<<8,o=e.pending_buf[e.sym_buf+a++],0===r?Nc(e,o,t):(i=fc[o],Nc(e,i+ic+1,t),s=cc[i],0!==s&&(o-=Ec[i],Ac(e,o,s)),r--,i=mc(r),Nc(e,i,n),s=lc[i],0!==s&&(r-=Ic[i],Ac(e,r,s)))}while(a<e.sym_next);Nc(e,256,t)},xc=(e,t)=>{const n=t.dyn_tree,r=t.stat_desc.static_tree,o=t.stat_desc.has_stree,i=t.stat_desc.elems;let s,a,u,c=-1;for(e.heap_len=0,e.heap_max=573,s=0;s<i;s++)0!==n[2*s]?(e.heap[++e.heap_len]=c=s,e.depth[s]=0):n[2*s+1]=0;for(;e.heap_len<2;)u=e.heap[++e.heap_len]=c<2?++c:0,n[2*u]=1,e.depth[u]=0,e.opt_len--,o&&(e.static_len-=r[2*u+1]);for(t.max_code=c,s=e.heap_len>>1;s>=1;s--)Pc(e,n,s);u=i;do{s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Pc(e,n,1),a=e.heap[1],e.heap[--e.heap_max]=s,e.heap[--e.heap_max]=a,n[2*u]=n[2*s]+n[2*a],e.depth[u]=(e.depth[s]>=e.depth[a]?e.depth[s]:e.depth[a])+1,n[2*s+1]=n[2*a+1]=u,e.heap[1]=u++,Pc(e,n,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const n=t.dyn_tree,r=t.max_code,o=t.stat_desc.static_tree,i=t.stat_desc.has_stree,s=t.stat_desc.extra_bits,a=t.stat_desc.extra_base,u=t.stat_desc.max_length;let c,l,d,p,h,_,g=0;for(p=0;p<=uc;p++)e.bl_count[p]=0;for(n[2*e.heap[e.heap_max]+1]=0,c=e.heap_max+1;c<573;c++)l=e.heap[c],p=n[2*n[2*l+1]+1]+1,p>u&&(p=u,g++),n[2*l+1]=p,l>r||(e.bl_count[p]++,h=0,l>=a&&(h=s[l-a]),_=n[2*l],e.opt_len+=_*(p+h),i&&(e.static_len+=_*(o[2*l+1]+h)));if(0!==g){do{for(p=u-1;0===e.bl_count[p];)p--;e.bl_count[p]--,e.bl_count[p+1]+=2,e.bl_count[u]--,g-=2}while(g>0);for(p=u;0!==p;p--)for(l=e.bl_count[p];0!==l;)d=e.heap[--c],d>r||(n[2*d+1]!==p&&(e.opt_len+=(p-n[2*d+1])*n[2*d],n[2*d+1]=p),l--)}})(e,t),Mc(n,c,e.bl_count)},Dc=(e,t,n)=>{let r,o,i=-1,s=t[1],a=0,u=7,c=4;for(0===s&&(u=138,c=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)o=s,s=t[2*(r+1)+1],++a<u&&o===s||(a<c?e.bl_tree[2*o]+=a:0!==o?(o!==i&&e.bl_tree[2*o]++,e.bl_tree[32]++):a<=10?e.bl_tree[34]++:e.bl_tree[36]++,a=0,i=o,0===s?(u=138,c=3):o===s?(u=6,c=3):(u=7,c=4))},Vc=(e,t,n)=>{let r,o,i=-1,s=t[1],a=0,u=7,c=4;for(0===s&&(u=138,c=3),r=0;r<=n;r++)if(o=s,s=t[2*(r+1)+1],!(++a<u&&o===s)){if(a<c)do{Nc(e,o,e.bl_tree)}while(0!=--a);else 0!==o?(o!==i&&(Nc(e,o,e.bl_tree),a--),Nc(e,16,e.bl_tree),Ac(e,a-3,2)):a<=10?(Nc(e,17,e.bl_tree),Ac(e,a-3,3)):(Nc(e,18,e.bl_tree),Ac(e,a-11,7));a=0,i=o,0===s?(u=138,c=3):o===s?(u=6,c=3):(u=7,c=4)}};let Gc=!1;const kc=(e,t,n,r)=>{Ac(e,0+(r?1:0),3),Uc(e),Sc(e,n),Sc(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n};var Fc=(e,t,n,r)=>{let o,i,s=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<ic;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),xc(e,e.l_desc),xc(e,e.d_desc),s=(e=>{let t;for(Dc(e,e.dyn_ltree,e.l_desc.max_code),Dc(e,e.dyn_dtree,e.d_desc.max_code),xc(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*pc[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),o=e.opt_len+3+7>>>3,i=e.static_len+3+7>>>3,i<=o&&(o=i)):o=i=n+5,n+4<=o&&-1!==t?kc(e,t,n,r):4===e.strategy||i===o?(Ac(e,2+(r?1:0),3),wc(e,hc,_c)):(Ac(e,4+(r?1:0),3),((e,t,n,r)=>{let o;for(Ac(e,t-257,5),Ac(e,n-1,5),Ac(e,r-4,4),o=0;o<r;o++)Ac(e,e.bl_tree[2*pc[o]+1],3);Vc(e,e.dyn_ltree,t-1),Vc(e,e.dyn_dtree,n-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),wc(e,e.dyn_ltree,e.dyn_dtree)),Lc(e),r&&Uc(e)},Bc={_tr_init:e=>{Gc||((()=>{let e,t,n,r,o;const i=new Array(16);for(n=0,r=0;r<28;r++)for(Ec[r]=n,e=0;e<1<<cc[r];e++)fc[n++]=r;for(fc[n-1]=r,o=0,r=0;r<16;r++)for(Ic[r]=o,e=0;e<1<<lc[r];e++)gc[o++]=r;for(o>>=7;r<ac;r++)for(Ic[r]=o<<7,e=0;e<1<<lc[r]-7;e++)gc[256+o++]=r;for(t=0;t<=uc;t++)i[t]=0;for(e=0;e<=143;)hc[2*e+1]=8,e++,i[8]++;for(;e<=255;)hc[2*e+1]=9,e++,i[9]++;for(;e<=279;)hc[2*e+1]=7,e++,i[7]++;for(;e<=287;)hc[2*e+1]=8,e++,i[8]++;for(Mc(hc,287,i),e=0;e<ac;e++)_c[2*e+1]=5,_c[2*e]=Oc(e,5);vc=new Tc(hc,cc,257,sc,uc),Cc=new Tc(_c,lc,0,ac,uc),Rc=new Tc(new Array(0),dc,0,19,7)})(),Gc=!0),e.l_desc=new yc(e.dyn_ltree,vc),e.d_desc=new yc(e.dyn_dtree,Cc),e.bl_desc=new yc(e.bl_tree,Rc),e.bi_buf=0,e.bi_valid=0,Lc(e)},_tr_stored_block:kc,_tr_flush_block:Fc,_tr_tally:(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(fc[n]+ic+1)]++,e.dyn_dtree[2*mc(t)]++),e.sym_next===e.sym_end),_tr_align:e=>{Ac(e,2,3),Nc(e,256,hc),(e=>{16===e.bi_valid?(Sc(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 Hc=(e,t,n,r)=>{let o=65535&e,i=e>>>16&65535,s=0;for(;0!==n;){s=n>2e3?2e3:n,n-=s;do{o=o+t[r++]|0,i=i+o|0}while(--s);o%=65521,i%=65521}return o|i<<16};const qc=new Uint32Array((()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t})());var Yc=(e,t,n,r)=>{const o=qc,i=r+n;e^=-1;for(let n=r;n<i;n++)e=e>>>8^o[255&(e^t[n])];return~e},Kc={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"},Qc={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:Wc,_tr_stored_block:jc,_tr_flush_block:Jc,_tr_tally:zc,_tr_align:Zc}=Bc,{Z_NO_FLUSH:Xc,Z_PARTIAL_FLUSH:$c,Z_FULL_FLUSH:el,Z_FINISH:tl,Z_BLOCK:nl,Z_OK:rl,Z_STREAM_END:ol,Z_STREAM_ERROR:il,Z_DATA_ERROR:sl,Z_BUF_ERROR:al,Z_DEFAULT_COMPRESSION:ul,Z_FILTERED:cl,Z_HUFFMAN_ONLY:ll,Z_RLE:dl,Z_FIXED:pl,Z_DEFAULT_STRATEGY:hl,Z_UNKNOWN:_l,Z_DEFLATED:gl}=Qc,fl=258,El=262,Il=42,Tl=113,vl=666,Cl=(e,t)=>(e.msg=Kc[t],t),Rl=e=>2*e-(e>4?9:0),yl=e=>{let t=e.length;for(;--t>=0;)e[t]=0},ml=e=>{let t,n,r,o=e.w_size;t=e.hash_size,r=t;do{n=e.head[--r],e.head[r]=n>=o?n-o:0}while(--t);t=o,r=t;do{n=e.prev[--r],e.prev[r]=n>=o?n-o:0}while(--t)};let Sl=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask;const Al=e=>{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))},Nl=(e,t)=>{Jc(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Al(e.strm)},Ol=(e,t)=>{e.pending_buf[e.pending++]=t},Ml=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},Ll=(e,t,n,r)=>{let o=e.avail_in;return o>r&&(o=r),0===o?0:(e.avail_in-=o,t.set(e.input.subarray(e.next_in,e.next_in+o),n),1===e.state.wrap?e.adler=Hc(e.adler,t,o,n):2===e.state.wrap&&(e.adler=Yc(e.adler,t,o,n)),e.next_in+=o,e.total_in+=o,o)},Ul=(e,t)=>{let n,r,o=e.max_chain_length,i=e.strstart,s=e.prev_length,a=e.nice_match;const u=e.strstart>e.w_size-El?e.strstart-(e.w_size-El):0,c=e.window,l=e.w_mask,d=e.prev,p=e.strstart+fl;let h=c[i+s-1],_=c[i+s];e.prev_length>=e.good_match&&(o>>=2),a>e.lookahead&&(a=e.lookahead);do{if(n=t,c[n+s]===_&&c[n+s-1]===h&&c[n]===c[i]&&c[++n]===c[i+1]){i+=2,n++;do{}while(c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&i<p);if(r=fl-(p-i),i=p-fl,r>s){if(e.match_start=t,s=r,r>=a)break;h=c[i+s-1],_=c[i+s]}}}while((t=d[t&l])>u&&0!=--o);return s<=e.lookahead?s:e.lookahead},bl=e=>{const t=e.w_size;let n,r,o;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-El)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),ml(e),r+=t),0===e.strm.avail_in)break;if(n=Ll(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=3)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=Sl(e,e.ins_h,e.window[o+1]);e.insert&&(e.ins_h=Sl(e,e.ins_h,e.window[o+3-1]),e.prev[o&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=o,o++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<El&&0!==e.strm.avail_in)},Pl=(e,t)=>{let n,r,o,i=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,s=0,a=e.strm.avail_in;do{if(n=65535,o=e.bi_valid+42>>3,e.strm.avail_out<o)break;if(o=e.strm.avail_out-o,r=e.strstart-e.block_start,n>r+e.strm.avail_in&&(n=r+e.strm.avail_in),n>o&&(n=o),n<i&&(0===n&&t!==tl||t===Xc||n!==r+e.strm.avail_in))break;s=t===tl&&n===r+e.strm.avail_in?1:0,jc(e,0,0,s),e.pending_buf[e.pending-4]=n,e.pending_buf[e.pending-3]=n>>8,e.pending_buf[e.pending-2]=~n,e.pending_buf[e.pending-1]=~n>>8,Al(e.strm),r&&(r>n&&(r=n),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+r),e.strm.next_out),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r,e.block_start+=r,n-=r),n&&(Ll(e.strm,e.strm.output,e.strm.next_out,n),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n)}while(0===s);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),s?4:t!==Xc&&t!==tl&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(o=e.window_size-e.strstart,e.strm.avail_in>o&&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++,o+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),o>e.strm.avail_in&&(o=e.strm.avail_in),o&&(Ll(e.strm,e.window,e.strstart,o),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.high_water<e.strstart&&(e.high_water=e.strstart),o=e.bi_valid+42>>3,o=e.pending_buf_size-o>65535?65535:e.pending_buf_size-o,i=o>e.w_size?e.w_size:o,r=e.strstart-e.block_start,(r>=i||(r||t===tl)&&t!==Xc&&0===e.strm.avail_in&&r<=o)&&(n=r>o?o:r,s=t===tl&&0===e.strm.avail_in&&n===r?1:0,jc(e,e.block_start,n,s),e.block_start+=n,Al(e.strm)),s?3:1)},wl=(e,t)=>{let n,r;for(;;){if(e.lookahead<El){if(bl(e),e.lookahead<El&&t===Xc)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=Sl(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==n&&e.strstart-n<=e.w_size-El&&(e.match_length=Ul(e,n)),e.match_length>=3)if(r=zc(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=Sl(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Sl(e,e.ins_h,e.window[e.strstart+1]);else r=zc(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(Nl(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===tl?(Nl(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Nl(e,!1),0===e.strm.avail_out)?1:2},xl=(e,t)=>{let n,r,o;for(;;){if(e.lookahead<El){if(bl(e),e.lookahead<El&&t===Xc)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=Sl(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==n&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-El&&(e.match_length=Ul(e,n),e.match_length<=5&&(e.strategy===cl||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){o=e.strstart+e.lookahead-3,r=zc(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=o&&(e.ins_h=Sl(e,e.ins_h,e.window[e.strstart+3-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(Nl(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(r=zc(e,0,e.window[e.strstart-1]),r&&Nl(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=zc(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===tl?(Nl(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Nl(e,!1),0===e.strm.avail_out)?1:2};function Dl(e,t,n,r,o){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=o}const Vl=[new Dl(0,0,0,0,Pl),new Dl(4,4,8,4,wl),new Dl(4,5,16,8,wl),new Dl(4,6,32,32,wl),new Dl(4,4,16,16,xl),new Dl(8,16,32,32,xl),new Dl(8,16,128,128,xl),new Dl(8,32,128,256,xl),new Dl(32,128,258,1024,xl),new Dl(32,258,258,4096,xl)];function Gl(){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=gl,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),yl(this.dyn_ltree),yl(this.dyn_dtree),yl(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),yl(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),yl(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 kl=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==Il&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==Tl&&t.status!==vl?1:0},Fl=e=>{if(kl(e))return Cl(e,il);e.total_in=e.total_out=0,e.data_type=_l;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?Il:Tl,e.adler=2===t.wrap?0:1,t.last_flush=-2,Wc(t),rl},Bl=e=>{const t=Fl(e);var n;return t===rl&&((n=e.state).window_size=2*n.w_size,yl(n.head),n.max_lazy_match=Vl[n.level].max_lazy,n.good_match=Vl[n.level].good_length,n.nice_match=Vl[n.level].nice_length,n.max_chain_length=Vl[n.level].max_chain,n.strstart=0,n.block_start=0,n.lookahead=0,n.insert=0,n.match_length=n.prev_length=2,n.match_available=0,n.ins_h=0),t},Hl=(e,t,n,r,o,i)=>{if(!e)return il;let s=1;if(t===ul&&(t=6),r<0?(s=0,r=-r):r>15&&(s=2,r-=16),o<1||o>9||n!==gl||r<8||r>15||t<0||t>9||i<0||i>pl||8===r&&1!==s)return Cl(e,il);8===r&&(r=9);const a=new Gl;return e.state=a,a.strm=e,a.status=Il,a.wrap=s,a.gzhead=null,a.w_bits=r,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=o+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<<o+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=i,a.method=n,Bl(e)};var ql={deflateInit:(e,t)=>Hl(e,t,gl,15,8,hl),deflateInit2:Hl,deflateReset:Bl,deflateResetKeep:Fl,deflateSetHeader:(e,t)=>kl(e)||2!==e.state.wrap?il:(e.state.gzhead=t,rl),deflate:(e,t)=>{if(kl(e)||t>nl||t<0)return e?Cl(e,il):il;const n=e.state;if(!e.output||0!==e.avail_in&&!e.input||n.status===vl&&t!==tl)return Cl(e,0===e.avail_out?al:il);const r=n.last_flush;if(n.last_flush=t,0!==n.pending){if(Al(e),0===e.avail_out)return n.last_flush=-1,rl}else if(0===e.avail_in&&Rl(t)<=Rl(r)&&t!==tl)return Cl(e,al);if(n.status===vl&&0!==e.avail_in)return Cl(e,al);if(n.status===Il&&0===n.wrap&&(n.status=Tl),n.status===Il){let t=gl+(n.w_bits-8<<4)<<8,r=-1;if(r=n.strategy>=ll||n.level<2?0:n.level<6?1:6===n.level?2:3,t|=r<<6,0!==n.strstart&&(t|=32),t+=31-t%31,Ml(n,t),0!==n.strstart&&(Ml(n,e.adler>>>16),Ml(n,65535&e.adler)),e.adler=1,n.status=Tl,Al(e),0!==n.pending)return n.last_flush=-1,rl}if(57===n.status)if(e.adler=0,Ol(n,31),Ol(n,139),Ol(n,8),n.gzhead)Ol(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Ol(n,255&n.gzhead.time),Ol(n,n.gzhead.time>>8&255),Ol(n,n.gzhead.time>>16&255),Ol(n,n.gzhead.time>>24&255),Ol(n,9===n.level?2:n.strategy>=ll||n.level<2?4:0),Ol(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(Ol(n,255&n.gzhead.extra.length),Ol(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Yc(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69;else if(Ol(n,0),Ol(n,0),Ol(n,0),Ol(n,0),Ol(n,0),Ol(n,9===n.level?2:n.strategy>=ll||n.level<2?4:0),Ol(n,3),n.status=Tl,Al(e),0!==n.pending)return n.last_flush=-1,rl;if(69===n.status){if(n.gzhead.extra){let t=n.pending,r=(65535&n.gzhead.extra.length)-n.gzindex;for(;n.pending+r>n.pending_buf_size;){let o=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+o),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>t&&(e.adler=Yc(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex+=o,Al(e),0!==n.pending)return n.last_flush=-1,rl;t=0,r-=o}let o=new Uint8Array(n.gzhead.extra);n.pending_buf.set(o.subarray(n.gzindex,n.gzindex+r),n.pending),n.pending+=r,n.gzhead.hcrc&&n.pending>t&&(e.adler=Yc(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=73}if(73===n.status){if(n.gzhead.name){let t,r=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(e.adler=Yc(e.adler,n.pending_buf,n.pending-r,r)),Al(e),0!==n.pending)return n.last_flush=-1,rl;r=0}t=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,Ol(n,t)}while(0!==t);n.gzhead.hcrc&&n.pending>r&&(e.adler=Yc(e.adler,n.pending_buf,n.pending-r,r)),n.gzindex=0}n.status=91}if(91===n.status){if(n.gzhead.comment){let t,r=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(e.adler=Yc(e.adler,n.pending_buf,n.pending-r,r)),Al(e),0!==n.pending)return n.last_flush=-1,rl;r=0}t=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,Ol(n,t)}while(0!==t);n.gzhead.hcrc&&n.pending>r&&(e.adler=Yc(e.adler,n.pending_buf,n.pending-r,r))}n.status=103}if(103===n.status){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(Al(e),0!==n.pending))return n.last_flush=-1,rl;Ol(n,255&e.adler),Ol(n,e.adler>>8&255),e.adler=0}if(n.status=Tl,Al(e),0!==n.pending)return n.last_flush=-1,rl}if(0!==e.avail_in||0!==n.lookahead||t!==Xc&&n.status!==vl){let r=0===n.level?Pl(n,t):n.strategy===ll?((e,t)=>{let n;for(;;){if(0===e.lookahead&&(bl(e),0===e.lookahead)){if(t===Xc)return 1;break}if(e.match_length=0,n=zc(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(Nl(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===tl?(Nl(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Nl(e,!1),0===e.strm.avail_out)?1:2})(n,t):n.strategy===dl?((e,t)=>{let n,r,o,i;const s=e.window;for(;;){if(e.lookahead<=fl){if(bl(e),e.lookahead<=fl&&t===Xc)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(o=e.strstart-1,r=s[o],r===s[++o]&&r===s[++o]&&r===s[++o])){i=e.strstart+fl;do{}while(r===s[++o]&&r===s[++o]&&r===s[++o]&&r===s[++o]&&r===s[++o]&&r===s[++o]&&r===s[++o]&&r===s[++o]&&o<i);e.match_length=fl-(i-o),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=zc(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=zc(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(Nl(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===tl?(Nl(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Nl(e,!1),0===e.strm.avail_out)?1:2})(n,t):Vl[n.level].func(n,t);if(3!==r&&4!==r||(n.status=vl),1===r||3===r)return 0===e.avail_out&&(n.last_flush=-1),rl;if(2===r&&(t===$c?Zc(n):t!==nl&&(jc(n,0,0,!1),t===el&&(yl(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),Al(e),0===e.avail_out))return n.last_flush=-1,rl}return t!==tl?rl:n.wrap<=0?ol:(2===n.wrap?(Ol(n,255&e.adler),Ol(n,e.adler>>8&255),Ol(n,e.adler>>16&255),Ol(n,e.adler>>24&255),Ol(n,255&e.total_in),Ol(n,e.total_in>>8&255),Ol(n,e.total_in>>16&255),Ol(n,e.total_in>>24&255)):(Ml(n,e.adler>>>16),Ml(n,65535&e.adler)),Al(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?rl:ol)},deflateEnd:e=>{if(kl(e))return il;const t=e.state.status;return e.state=null,t===Tl?Cl(e,sl):rl},deflateSetDictionary:(e,t)=>{let n=t.length;if(kl(e))return il;const r=e.state,o=r.wrap;if(2===o||1===o&&r.status!==Il||r.lookahead)return il;if(1===o&&(e.adler=Hc(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){0===o&&(yl(r.head),r.strstart=0,r.block_start=0,r.insert=0);let e=new Uint8Array(r.w_size);e.set(t.subarray(n-r.w_size,n),0),t=e,n=r.w_size}const i=e.avail_in,s=e.next_in,a=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,bl(r);r.lookahead>=3;){let e=r.strstart,t=r.lookahead-2;do{r.ins_h=Sl(r,r.ins_h,r.window[e+3-1]),r.prev[e&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=e,e++}while(--t);r.strstart=e,r.lookahead=2,bl(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=s,e.input=a,e.avail_in=i,r.wrap=o,rl},deflateInfo:"pako deflate (from Nodeca project)"};const Yl=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var Kl={assign:function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(const t in n)Yl(n,t)&&(e[t]=n[t])}}return e},flattenChunks:e=>{let t=0;for(let n=0,r=e.length;n<r;n++)t+=e[n].length;const n=new Uint8Array(t);for(let t=0,r=0,o=e.length;t<o;t++){let o=e[t];n.set(o,r),r+=o.length}return n}};let Ql=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){Ql=!1}const Wl=new Uint8Array(256);for(let e=0;e<256;e++)Wl[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Wl[254]=Wl[254]=1;var jl={string2buf:e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,n,r,o,i,s=e.length,a=0;for(o=0;o<s;o++)n=e.charCodeAt(o),55296==(64512&n)&&o+1<s&&(r=e.charCodeAt(o+1),56320==(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),o++)),a+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(a),i=0,o=0;i<a;o++)n=e.charCodeAt(o),55296==(64512&n)&&o+1<s&&(r=e.charCodeAt(o+1),56320==(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),o++)),n<128?t[i++]=n:n<2048?(t[i++]=192|n>>>6,t[i++]=128|63&n):n<65536?(t[i++]=224|n>>>12,t[i++]=128|n>>>6&63,t[i++]=128|63&n):(t[i++]=240|n>>>18,t[i++]=128|n>>>12&63,t[i++]=128|n>>>6&63,t[i++]=128|63&n);return t},buf2string:(e,t)=>{const n=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let r,o;const i=new Array(2*n);for(o=0,r=0;r<n;){let t=e[r++];if(t<128){i[o++]=t;continue}let s=Wl[t];if(s>4)i[o++]=65533,r+=s-1;else{for(t&=2===s?31:3===s?15:7;s>1&&r<n;)t=t<<6|63&e[r++],s--;s>1?i[o++]=65533:t<65536?i[o++]=t:(t-=65536,i[o++]=55296|t>>10&1023,i[o++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&Ql)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n})(i,o)},utf8border:(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let n=t-1;for(;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+Wl[e[n]]>t?n:t}};var Jl=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 zl=Object.prototype.toString,{Z_NO_FLUSH:Zl,Z_SYNC_FLUSH:Xl,Z_FULL_FLUSH:$l,Z_FINISH:ed,Z_OK:td,Z_STREAM_END:nd,Z_DEFAULT_COMPRESSION:rd,Z_DEFAULT_STRATEGY:od,Z_DEFLATED:id}=Qc;function sd(e){this.options=Kl.assign({level:rd,method:id,chunkSize:16384,windowBits:15,memLevel:8,strategy:od},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 Jl,this.strm.avail_out=0;let n=ql.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==td)throw new Error(Kc[n]);if(t.header&&ql.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?jl.string2buf(t.dictionary):"[object ArrayBuffer]"===zl.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,n=ql.deflateSetDictionary(this.strm,e),n!==td)throw new Error(Kc[n]);this._dict_set=!0}}sd.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize;let o,i;if(this.ended)return!1;for(i=t===~~t?t:!0===t?ed:Zl,"string"==typeof e?n.input=jl.string2buf(e):"[object ArrayBuffer]"===zl.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;)if(0===n.avail_out&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(i===Xl||i===$l)&&n.avail_out<=6)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else{if(o=ql.deflate(n,i),o===nd)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),o=ql.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===td;if(0!==n.avail_out){if(i>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(0===n.avail_in)break}else this.onData(n.output)}return!0},sd.prototype.onData=function(e){this.chunks.push(e)},sd.prototype.onEnd=function(e){e===td&&(this.result=Kl.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const ad=16209;var ud=function(e,t){let n,r,o,i,s,a,u,c,l,d,p,h,_,g,f,E,I,T,v,C,R,y,m,S;const A=e.state;n=e.next_in,m=e.input,r=n+(e.avail_in-5),o=e.next_out,S=e.output,i=o-(t-e.avail_out),s=o+(e.avail_out-257),a=A.dmax,u=A.wsize,c=A.whave,l=A.wnext,d=A.window,p=A.hold,h=A.bits,_=A.lencode,g=A.distcode,f=(1<<A.lenbits)-1,E=(1<<A.distbits)-1;e:do{h<15&&(p+=m[n++]<<h,h+=8,p+=m[n++]<<h,h+=8),I=_[p&f];t:for(;;){if(T=I>>>24,p>>>=T,h-=T,T=I>>>16&255,0===T)S[o++]=65535&I;else{if(!(16&T)){if(64&T){if(32&T){A.mode=16191;break e}e.msg="invalid literal/length code",A.mode=ad;break e}I=_[(65535&I)+(p&(1<<T)-1)];continue t}for(v=65535&I,T&=15,T&&(h<T&&(p+=m[n++]<<h,h+=8),v+=p&(1<<T)-1,p>>>=T,h-=T),h<15&&(p+=m[n++]<<h,h+=8,p+=m[n++]<<h,h+=8),I=g[p&E];;){if(T=I>>>24,p>>>=T,h-=T,T=I>>>16&255,16&T){if(C=65535&I,T&=15,h<T&&(p+=m[n++]<<h,h+=8,h<T&&(p+=m[n++]<<h,h+=8)),C+=p&(1<<T)-1,C>a){e.msg="invalid distance too far back",A.mode=ad;break e}if(p>>>=T,h-=T,T=o-i,C>T){if(T=C-T,T>c&&A.sane){e.msg="invalid distance too far back",A.mode=ad;break e}if(R=0,y=d,0===l){if(R+=u-T,T<v){v-=T;do{S[o++]=d[R++]}while(--T);R=o-C,y=S}}else if(l<T){if(R+=u+l-T,T-=l,T<v){v-=T;do{S[o++]=d[R++]}while(--T);if(R=0,l<v){T=l,v-=T;do{S[o++]=d[R++]}while(--T);R=o-C,y=S}}}else if(R+=l-T,T<v){v-=T;do{S[o++]=d[R++]}while(--T);R=o-C,y=S}for(;v>2;)S[o++]=y[R++],S[o++]=y[R++],S[o++]=y[R++],v-=3;v&&(S[o++]=y[R++],v>1&&(S[o++]=y[R++]))}else{R=o-C;do{S[o++]=S[R++],S[o++]=S[R++],S[o++]=S[R++],v-=3}while(v>2);v&&(S[o++]=S[R++],v>1&&(S[o++]=S[R++]))}break}if(64&T){e.msg="invalid distance code",A.mode=ad;break e}I=g[(65535&I)+(p&(1<<T)-1)]}}break}}while(n<r&&o<s);v=h>>3,n-=v,h-=v<<3,p&=(1<<h)-1,e.next_in=n,e.next_out=o,e.avail_in=n<r?r-n+5:5-(n-r),e.avail_out=o<s?s-o+257:257-(o-s),A.hold=p,A.bits=h};const cd=15,ld=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]),dd=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]),pd=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]),hd=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 _d=(e,t,n,r,o,i,s,a)=>{const u=a.bits;let c,l,d,p,h,_,g=0,f=0,E=0,I=0,T=0,v=0,C=0,R=0,y=0,m=0,S=null;const A=new Uint16Array(16),N=new Uint16Array(16);let O,M,L,U=null;for(g=0;g<=cd;g++)A[g]=0;for(f=0;f<r;f++)A[t[n+f]]++;for(T=u,I=cd;I>=1&&0===A[I];I--);if(T>I&&(T=I),0===I)return o[i++]=20971520,o[i++]=20971520,a.bits=1,0;for(E=1;E<I&&0===A[E];E++);for(T<E&&(T=E),R=1,g=1;g<=cd;g++)if(R<<=1,R-=A[g],R<0)return-1;if(R>0&&(0===e||1!==I))return-1;for(N[1]=0,g=1;g<cd;g++)N[g+1]=N[g]+A[g];for(f=0;f<r;f++)0!==t[n+f]&&(s[N[t[n+f]]++]=f);if(0===e?(S=U=s,_=20):1===e?(S=ld,U=dd,_=257):(S=pd,U=hd,_=0),m=0,f=0,g=E,h=i,v=T,C=0,d=-1,y=1<<T,p=y-1,1===e&&y>852||2===e&&y>592)return 1;for(;;){O=g-C,s[f]+1<_?(M=0,L=s[f]):s[f]>=_?(M=U[s[f]-_],L=S[s[f]-_]):(M=96,L=0),c=1<<g-C,l=1<<v,E=l;do{l-=c,o[h+(m>>C)+l]=O<<24|M<<16|L}while(0!==l);for(c=1<<g-1;m&c;)c>>=1;if(0!==c?(m&=c-1,m+=c):m=0,f++,0==--A[g]){if(g===I)break;g=t[n+s[f]]}if(g>T&&(m&p)!==d){for(0===C&&(C=T),h+=E,v=g-C,R=1<<v;v+C<I&&(R-=A[v+C],!(R<=0));)v++,R<<=1;if(y+=1<<v,1===e&&y>852||2===e&&y>592)return 1;d=m&p,o[d]=T<<24|v<<16|h-i}}return 0!==m&&(o[h+m]=g-C<<24|64<<16),a.bits=T,0};const{Z_FINISH:gd,Z_BLOCK:fd,Z_TREES:Ed,Z_OK:Id,Z_STREAM_END:Td,Z_NEED_DICT:vd,Z_STREAM_ERROR:Cd,Z_DATA_ERROR:Rd,Z_MEM_ERROR:yd,Z_BUF_ERROR:md,Z_DEFLATED:Sd}=Qc,Ad=16180,Nd=16190,Od=16191,Md=16192,Ld=16194,Ud=16199,bd=16200,Pd=16206,wd=16209,xd=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function Dd(){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 Vd=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<Ad||t.mode>16211?1:0},Gd=e=>{if(Vd(e))return Cd;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=Ad,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,Id},kd=e=>{if(Vd(e))return Cd;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Gd(e)},Fd=(e,t)=>{let n;if(Vd(e))return Cd;const r=e.state;return t<0?(n=0,t=-t):(n=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Cd:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,kd(e))},Bd=(e,t)=>{if(!e)return Cd;const n=new Dd;e.state=n,n.strm=e,n.window=null,n.mode=Ad;const r=Fd(e,t);return r!==Id&&(e.state=null),r};let Hd,qd,Yd=!0;const Kd=e=>{if(Yd){Hd=new Int32Array(512),qd=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(_d(1,e.lens,0,288,Hd,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;_d(2,e.lens,0,32,qd,0,e.work,{bits:5}),Yd=!1}e.lencode=Hd,e.lenbits=9,e.distcode=qd,e.distbits=5},Qd=(e,t,n,r)=>{let o;const i=e.state;return null===i.window&&(i.wsize=1<<i.wbits,i.wnext=0,i.whave=0,i.window=new Uint8Array(i.wsize)),r>=i.wsize?(i.window.set(t.subarray(n-i.wsize,n),0),i.wnext=0,i.whave=i.wsize):(o=i.wsize-i.wnext,o>r&&(o=r),i.window.set(t.subarray(n-r,n-r+o),i.wnext),(r-=o)?(i.window.set(t.subarray(n-r,n),0),i.wnext=r,i.whave=i.wsize):(i.wnext+=o,i.wnext===i.wsize&&(i.wnext=0),i.whave<i.wsize&&(i.whave+=o))),0};var Wd={inflateReset:kd,inflateReset2:Fd,inflateResetKeep:Gd,inflateInit:e=>Bd(e,15),inflateInit2:Bd,inflate:(e,t)=>{let n,r,o,i,s,a,u,c,l,d,p,h,_,g,f,E,I,T,v,C,R,y,m=0;const S=new Uint8Array(4);let A,N;const O=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Vd(e)||!e.output||!e.input&&0!==e.avail_in)return Cd;n=e.state,n.mode===Od&&(n.mode=Md),s=e.next_out,o=e.output,u=e.avail_out,i=e.next_in,r=e.input,a=e.avail_in,c=n.hold,l=n.bits,d=a,p=u,y=Id;e:for(;;)switch(n.mode){case Ad:if(0===n.wrap){n.mode=Md;break}for(;l<16;){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}if(2&n.wrap&&35615===c){0===n.wbits&&(n.wbits=15),n.check=0,S[0]=255&c,S[1]=c>>>8&255,n.check=Yc(n.check,S,2,0),c=0,l=0,n.mode=16181;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&c)<<8)+(c>>8))%31){e.msg="incorrect header check",n.mode=wd;break}if((15&c)!==Sd){e.msg="unknown compression method",n.mode=wd;break}if(c>>>=4,l-=4,R=8+(15&c),0===n.wbits&&(n.wbits=R),R>15||R>n.wbits){e.msg="invalid window size",n.mode=wd;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=512&c?16189:Od,c=0,l=0;break;case 16181:for(;l<16;){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}if(n.flags=c,(255&n.flags)!==Sd){e.msg="unknown compression method",n.mode=wd;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=wd;break}n.head&&(n.head.text=c>>8&1),512&n.flags&&4&n.wrap&&(S[0]=255&c,S[1]=c>>>8&255,n.check=Yc(n.check,S,2,0)),c=0,l=0,n.mode=16182;case 16182:for(;l<32;){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}n.head&&(n.head.time=c),512&n.flags&&4&n.wrap&&(S[0]=255&c,S[1]=c>>>8&255,S[2]=c>>>16&255,S[3]=c>>>24&255,n.check=Yc(n.check,S,4,0)),c=0,l=0,n.mode=16183;case 16183:for(;l<16;){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}n.head&&(n.head.xflags=255&c,n.head.os=c>>8),512&n.flags&&4&n.wrap&&(S[0]=255&c,S[1]=c>>>8&255,n.check=Yc(n.check,S,2,0)),c=0,l=0,n.mode=16184;case 16184:if(1024&n.flags){for(;l<16;){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}n.length=c,n.head&&(n.head.extra_len=c),512&n.flags&&4&n.wrap&&(S[0]=255&c,S[1]=c>>>8&255,n.check=Yc(n.check,S,2,0)),c=0,l=0}else n.head&&(n.head.extra=null);n.mode=16185;case 16185:if(1024&n.flags&&(h=n.length,h>a&&(h=a),h&&(n.head&&(R=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(i,i+h),R)),512&n.flags&&4&n.wrap&&(n.check=Yc(n.check,r,h,i)),a-=h,i+=h,n.length-=h),n.length))break e;n.length=0,n.mode=16186;case 16186:if(2048&n.flags){if(0===a)break e;h=0;do{R=r[i+h++],n.head&&R&&n.length<65536&&(n.head.name+=String.fromCharCode(R))}while(R&&h<a);if(512&n.flags&&4&n.wrap&&(n.check=Yc(n.check,r,h,i)),a-=h,i+=h,R)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=16187;case 16187:if(4096&n.flags){if(0===a)break e;h=0;do{R=r[i+h++],n.head&&R&&n.length<65536&&(n.head.comment+=String.fromCharCode(R))}while(R&&h<a);if(512&n.flags&&4&n.wrap&&(n.check=Yc(n.check,r,h,i)),a-=h,i+=h,R)break e}else n.head&&(n.head.comment=null);n.mode=16188;case 16188:if(512&n.flags){for(;l<16;){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}if(4&n.wrap&&c!==(65535&n.check)){e.msg="header crc mismatch",n.mode=wd;break}c=0,l=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=Od;break;case 16189:for(;l<32;){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}e.adler=n.check=xd(c),c=0,l=0,n.mode=Nd;case Nd:if(0===n.havedict)return e.next_out=s,e.avail_out=u,e.next_in=i,e.avail_in=a,n.hold=c,n.bits=l,vd;e.adler=n.check=1,n.mode=Od;case Od:if(t===fd||t===Ed)break e;case Md:if(n.last){c>>>=7&l,l-=7&l,n.mode=Pd;break}for(;l<3;){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}switch(n.last=1&c,c>>>=1,l-=1,3&c){case 0:n.mode=16193;break;case 1:if(Kd(n),n.mode=Ud,t===Ed){c>>>=2,l-=2;break e}break;case 2:n.mode=16196;break;case 3:e.msg="invalid block type",n.mode=wd}c>>>=2,l-=2;break;case 16193:for(c>>>=7&l,l-=7&l;l<32;){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}if((65535&c)!=(c>>>16^65535)){e.msg="invalid stored block lengths",n.mode=wd;break}if(n.length=65535&c,c=0,l=0,n.mode=Ld,t===Ed)break e;case Ld:n.mode=16195;case 16195:if(h=n.length,h){if(h>a&&(h=a),h>u&&(h=u),0===h)break e;o.set(r.subarray(i,i+h),s),a-=h,i+=h,u-=h,s+=h,n.length-=h;break}n.mode=Od;break;case 16196:for(;l<14;){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}if(n.nlen=257+(31&c),c>>>=5,l-=5,n.ndist=1+(31&c),c>>>=5,l-=5,n.ncode=4+(15&c),c>>>=4,l-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=wd;break}n.have=0,n.mode=16197;case 16197:for(;n.have<n.ncode;){for(;l<3;){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}n.lens[O[n.have++]]=7&c,c>>>=3,l-=3}for(;n.have<19;)n.lens[O[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,A={bits:n.lenbits},y=_d(0,n.lens,0,19,n.lencode,0,n.work,A),n.lenbits=A.bits,y){e.msg="invalid code lengths set",n.mode=wd;break}n.have=0,n.mode=16198;case 16198:for(;n.have<n.nlen+n.ndist;){for(;m=n.lencode[c&(1<<n.lenbits)-1],f=m>>>24,E=m>>>16&255,I=65535&m,!(f<=l);){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}if(I<16)c>>>=f,l-=f,n.lens[n.have++]=I;else{if(16===I){for(N=f+2;l<N;){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}if(c>>>=f,l-=f,0===n.have){e.msg="invalid bit length repeat",n.mode=wd;break}R=n.lens[n.have-1],h=3+(3&c),c>>>=2,l-=2}else if(17===I){for(N=f+3;l<N;){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}c>>>=f,l-=f,R=0,h=3+(7&c),c>>>=3,l-=3}else{for(N=f+7;l<N;){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}c>>>=f,l-=f,R=0,h=11+(127&c),c>>>=7,l-=7}if(n.have+h>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=wd;break}for(;h--;)n.lens[n.have++]=R}}if(n.mode===wd)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=wd;break}if(n.lenbits=9,A={bits:n.lenbits},y=_d(1,n.lens,0,n.nlen,n.lencode,0,n.work,A),n.lenbits=A.bits,y){e.msg="invalid literal/lengths set",n.mode=wd;break}if(n.distbits=6,n.distcode=n.distdyn,A={bits:n.distbits},y=_d(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,A),n.distbits=A.bits,y){e.msg="invalid distances set",n.mode=wd;break}if(n.mode=Ud,t===Ed)break e;case Ud:n.mode=bd;case bd:if(a>=6&&u>=258){e.next_out=s,e.avail_out=u,e.next_in=i,e.avail_in=a,n.hold=c,n.bits=l,ud(e,p),s=e.next_out,o=e.output,u=e.avail_out,i=e.next_in,r=e.input,a=e.avail_in,c=n.hold,l=n.bits,n.mode===Od&&(n.back=-1);break}for(n.back=0;m=n.lencode[c&(1<<n.lenbits)-1],f=m>>>24,E=m>>>16&255,I=65535&m,!(f<=l);){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}if(E&&!(240&E)){for(T=f,v=E,C=I;m=n.lencode[C+((c&(1<<T+v)-1)>>T)],f=m>>>24,E=m>>>16&255,I=65535&m,!(T+f<=l);){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}c>>>=T,l-=T,n.back+=T}if(c>>>=f,l-=f,n.back+=f,n.length=I,0===E){n.mode=16205;break}if(32&E){n.back=-1,n.mode=Od;break}if(64&E){e.msg="invalid literal/length code",n.mode=wd;break}n.extra=15&E,n.mode=16201;case 16201:if(n.extra){for(N=n.extra;l<N;){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}n.length+=c&(1<<n.extra)-1,c>>>=n.extra,l-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=16202;case 16202:for(;m=n.distcode[c&(1<<n.distbits)-1],f=m>>>24,E=m>>>16&255,I=65535&m,!(f<=l);){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}if(!(240&E)){for(T=f,v=E,C=I;m=n.distcode[C+((c&(1<<T+v)-1)>>T)],f=m>>>24,E=m>>>16&255,I=65535&m,!(T+f<=l);){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}c>>>=T,l-=T,n.back+=T}if(c>>>=f,l-=f,n.back+=f,64&E){e.msg="invalid distance code",n.mode=wd;break}n.offset=I,n.extra=15&E,n.mode=16203;case 16203:if(n.extra){for(N=n.extra;l<N;){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}n.offset+=c&(1<<n.extra)-1,c>>>=n.extra,l-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=wd;break}n.mode=16204;case 16204:if(0===u)break e;if(h=p-u,n.offset>h){if(h=n.offset-h,h>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=wd;break}h>n.wnext?(h-=n.wnext,_=n.wsize-h):_=n.wnext-h,h>n.length&&(h=n.length),g=n.window}else g=o,_=s-n.offset,h=n.length;h>u&&(h=u),u-=h,n.length-=h;do{o[s++]=g[_++]}while(--h);0===n.length&&(n.mode=bd);break;case 16205:if(0===u)break e;o[s++]=n.length,u--,n.mode=bd;break;case Pd:if(n.wrap){for(;l<32;){if(0===a)break e;a--,c|=r[i++]<<l,l+=8}if(p-=u,e.total_out+=p,n.total+=p,4&n.wrap&&p&&(e.adler=n.check=n.flags?Yc(n.check,o,p,s-p):Hc(n.check,o,p,s-p)),p=u,4&n.wrap&&(n.flags?c:xd(c))!==n.check){e.msg="incorrect data check",n.mode=wd;break}c=0,l=0}n.mode=16207;case 16207:if(n.wrap&&n.flags){for(;l<32;){if(0===a)break e;a--,c+=r[i++]<<l,l+=8}if(4&n.wrap&&c!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=wd;break}c=0,l=0}n.mode=16208;case 16208:y=Td;break e;case wd:y=Rd;break e;case 16210:return yd;default:return Cd}return e.next_out=s,e.avail_out=u,e.next_in=i,e.avail_in=a,n.hold=c,n.bits=l,(n.wsize||p!==e.avail_out&&n.mode<wd&&(n.mode<Pd||t!==gd))&&Qd(e,e.output,e.next_out,p-e.avail_out),d-=e.avail_in,p-=e.avail_out,e.total_in+=d,e.total_out+=p,n.total+=p,4&n.wrap&&p&&(e.adler=n.check=n.flags?Yc(n.check,o,p,e.next_out-p):Hc(n.check,o,p,e.next_out-p)),e.data_type=n.bits+(n.last?64:0)+(n.mode===Od?128:0)+(n.mode===Ud||n.mode===Ld?256:0),(0===d&&0===p||t===gd)&&y===Id&&(y=md),y},inflateEnd:e=>{if(Vd(e))return Cd;let t=e.state;return t.window&&(t.window=null),e.state=null,Id},inflateGetHeader:(e,t)=>{if(Vd(e))return Cd;const n=e.state;return 2&n.wrap?(n.head=t,t.done=!1,Id):Cd},inflateSetDictionary:(e,t)=>{const n=t.length;let r,o,i;return Vd(e)?Cd:(r=e.state,0!==r.wrap&&r.mode!==Nd?Cd:r.mode===Nd&&(o=1,o=Hc(o,t,n,0),o!==r.check)?Rd:(i=Qd(e,t,n,n),i?(r.mode=16210,yd):(r.havedict=1,Id)))},inflateInfo:"pako inflate (from Nodeca project)"};var Jd=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 zd=Object.prototype.toString,{Z_NO_FLUSH:Zd,Z_FINISH:Xd,Z_OK:$d,Z_STREAM_END:ep,Z_NEED_DICT:tp,Z_STREAM_ERROR:np,Z_DATA_ERROR:rp,Z_MEM_ERROR:op}=Qc;function ip(e){this.options=Kl.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 Jl,this.strm.avail_out=0;let n=Wd.inflateInit2(this.strm,t.windowBits);if(n!==$d)throw new Error(Kc[n]);if(this.header=new Jd,Wd.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=jl.string2buf(t.dictionary):"[object ArrayBuffer]"===zd.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Wd.inflateSetDictionary(this.strm,t.dictionary),n!==$d)))throw new Error(Kc[n])}function sp(e,t){const n=new ip(t);if(n.push(e),n.err)throw n.msg||Kc[n.err];return n.result}ip.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize,o=this.options.dictionary;let i,s,a;if(this.ended)return!1;for(s=t===~~t?t:!0===t?Xd:Zd,"[object ArrayBuffer]"===zd.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(0===n.avail_out&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),i=Wd.inflate(n,s),i===tp&&o&&(i=Wd.inflateSetDictionary(n,o),i===$d?i=Wd.inflate(n,s):i===rp&&(i=tp));n.avail_in>0&&i===ep&&n.state.wrap>0&&0!==e[n.next_in];)Wd.inflateReset(n),i=Wd.inflate(n,s);switch(i){case np:case rp:case tp:case op:return this.onEnd(i),this.ended=!0,!1}if(a=n.avail_out,n.next_out&&(0===n.avail_out||i===ep))if("string"===this.options.to){let e=jl.utf8border(n.output,n.next_out),t=n.next_out-e,o=jl.buf2string(n.output,e);n.next_out=t,n.avail_out=r-t,t&&n.output.set(n.output.subarray(e,e+t),0),this.onData(o)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(i!==$d||0!==a){if(i===ep)return i=Wd.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,!0;if(0===n.avail_in)break}}return!0},ip.prototype.onData=function(e){this.chunks.push(e)},ip.prototype.onEnd=function(e){e===$d&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Kl.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var ap={Inflate:ip,inflate:sp,inflateRaw:function(e,t){return(t=t||{}).raw=!0,sp(e,t)},ungzip:sp,constants:Qc};const{Inflate:up,inflate:cp,inflateRaw:lp,ungzip:dp}=ap;var pp,hp,_p,gp,fp=dp,Ep=((pp={})[Ea]=exports.ErrorCode.RC_DISCONN_KICK,pp[Ia]=exports.ErrorCode.RC_DISCONN_EXCEPTION,pp[va]=exports.ErrorCode.RC_DISCONN_EXCEPTION,pp[Ca]=exports.ErrorCode.RC_CONN_REDIRECTED,pp[Ra]=exports.ErrorCode.RC_CONN_TOKEN_EXPIRED,pp[ya]=exports.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,pp[ma]=exports.ErrorCode.RC_ACCOUNT_CANCELLATION,pp),Ip=((hp={})[zs]=exports.ErrorCode.SUCCESS,hp[Zs]=exports.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,hp[Xs]=exports.ErrorCode.RC_CONN_IDENTIFIER_REJECTED,hp[$s]=exports.ErrorCode.RC_CONN_SERVER_UNAVAILABLE,hp[ea]=exports.ErrorCode.RC_CONN_TOKEN_INCORRECT,hp[ta]=exports.ErrorCode.RC_CONN_NOT_AUTHRORIZED,hp[na]=exports.ErrorCode.RC_CONN_REDIRECTED,hp[ra]=exports.ErrorCode.RC_CONN_PACKAGE_NAME_INVALID,hp[oa]=exports.ErrorCode.RC_CONN_APP_BLOCKED_OR_DELETED,hp[ia]=exports.ErrorCode.RC_CONN_USER_BLOCKED,hp[sa]=exports.ErrorCode.RC_CONN_TOKEN_EXPIRED,hp[aa]=exports.ErrorCode.RC_CONN_DEVICE_ERROR,hp[ua]=exports.ErrorCode.RC_CONN_HOSTNAME_ERROR,hp[ca]=exports.ErrorCode.RC_DISCONN_SAME_CLIENT_ON_LINE,hp[la]=exports.ErrorCode.RC_LISCENSE_COUNT_OUT_OF_LIMIT,hp[da]=exports.ErrorCode.RC_CONN_WRONG_CLUSTER,hp[pa]=exports.ErrorCode.RC_APP_AUTH_NOT_PASS,hp[ha]=exports.ErrorCode.RC_OTP_USED,hp[_a]=exports.ErrorCode.RC_PLATFORM_ERROR,hp[ga]=exports.ErrorCode.RC_ACCOUNT_CANCELLATION,hp[fa]=exports.ErrorCode.RC_LICENSE_EXPIRED,hp),Tp=function(e){return[as.ppMsgS,as.pgMsgS,as.chatMsgS].includes(gs(e))},vp=function(e,t){var n=0;return e.isAutoDelete&&(n|=1),e.isOverwrite&&(n|=2),2===t&&(n|=4),n};function Cp(e){return Object.keys(e).map((function(t){var n=e[t];return"string"!=typeof n&&(n="".concat(n)),{key:t,value:n}}))}function Rp(e,t,n,r){return Xi.encode(Ii,{targetId:e,type:exports.ConversationType.GROUP,users:r,extProfile:n?Cp(n):void 0,settingProfile:Cp(t)})}var yp,mp=((_p={})[fs(as.ppMsgP)]=exports.ConversationType.PRIVATE,_p[fs(as.pgMsgP)]=exports.ConversationType.GROUP,_p[fs(as.chatMsg)]=exports.ConversationType.CHATROOM,_p[fs(as.pcMsgP)]=exports.ConversationType.CUSTOMER_SERVICE,_p[fs(as.pbMsgP)]=exports.ConversationType.SYSTEM,_p),Sp=3,Ap={1:"ChannelsUserInfos",2:"ChannelsInviteStatusInfos",3:"ChannelsJoinedInfos",11:"FriendUserInfos",12:"FriendInviteInfos"},Np=((gp={})[m.GROUP_OPERATION]=function(e){return"ChannelEventData"},gp[m.GROUP_PROFILE_CHANGE]=function(e){return"ChannelEventData"},gp[m.GROUP_APPLICATION_INVITATION]=function(e){return"ChannelApplyInfo"},gp[l.FRIEND_APPLICATION]=function(e){return{0:"FriendApplyEvent",1:"FriendApplyEvent",2:"FriendUserInfo",3:"FriendsInput",5:"FriendTypeChangeEvent",6:"FriendUpdateEvent"}[e]},gp),Op=function(){function e(e){this.logger=e}return e.prototype.decodeByPBName=function(e,t,n){var r,o=this,i=e,s=((r={})[Ur]=o._formatSyncMessages,r[br]=o._formatReceivedMessage,r[Mr]=o._formatSentMessage,r[zr]=o._formatHistoryMessages,r[Hr]=o._formatConversationList,r[jr]=o._formatChatRoomInfos,r[co]=o._formatChatRoomKVList,r[go]=o._formatUserSetting,r[Oo]=o._formatGrpReadReceiptQryResp,r[Xo]=o._formatQueryReceiptResp,r[ho]=o._formatSetUserSettingOutput,r[Po]=o._formatUserSettingNotification,r[ko]=o._formatEventChangeList,r[Fo]=o._formatUltraMsgChangeList,r[Yo]=o._formatUltraOperateStatusNotifyList,r[Ho]=o._formatUltraMsgList,r[Yr]=o._formatUltraGroupUnreadMentionedList,r[Gr]=o._formatChrmKVVersion,r[Jo]=o._formatCallKVInfo,r[Wo]=o._fromatCallInfoDownStream,r[$r]=o._formateSessionMsgReadInput,r[Si]=o._formateChannelsListResult,r)[t];try{i=e.length>0&&Xi.decode(t,e),ft(s)&&(i=s.call(this,i,n))}catch(e){this.logger.error(exports.LogTagId.L_PB_DECODE_E,t)}return i},e.prototype._readBytes=function(e){var t,n=e.offset,r=e.buffer,o=e.limit;if(n)try{var i=(t=r,"[object ArrayBuffer]"===Object.prototype.toString.call(t)?new Uint8Array(r):r);return Sa.readUTF(i.subarray(n,o))}catch(e){this.logger.error(exports.LogTagId.O,null==e?void 0:e.stack)}return e},e.prototype._formatBytes=function(e){if(!e)return e;var t=this._readBytes(e);try{t=t?JSON.parse(t):t}catch(e){this.logger.error(exports.LogTagId.O,null==e?void 0:e.stack)}return t||e},e.prototype._formatSyncMessages=function(e,t){t=t||{};var n=this,r=e.list;e.syncTime;var o=e.finished,i=e.compressioEnabled,s=e.compressedData;if(i){var a=fp(s),u=Xi.decode(Ur,a);return this._formatSyncMessages(u,t)}return(Et(o)||null===o)&&(e.finished=!0),e.list=At(r,(function(e){return n._formatReceivedMessage(e,t)})),e},e.prototype._getUtfContent=function(e){if(e.user){var t=e.user,n=t.portrait,r=t.portraitUri,o=n||r;o&&(e.user.portrait=e.user.portraitUri=o)}return e},e.prototype._setExpansion=function(e){var t;return e&&(t=function(e){var t={},n=JSON.parse(e);return St(n,(function(e,n){t[n]=e.v})),t}(e)),t},e.prototype._setPushConfig=function(e,t){var n=e.pushContent,r=e.pushExt,o=e.configFlag,i={};return r&&(i=function(e,t,n){var r={},o={notificationId:n||""},i={};if(!t)return{iOSConfig:r,androidConfig:o,harmonyOSConfig:i};try{var s=JSON.parse(t);null==s||s.forEach((function(e){var t,n,s,a,u,c,l,d,p,h,_,g,f=Object.keys(e);if(0!==f.length){var E=f[0];switch(E){case"HW":return o.channelIdHW=null===(t=e[E])||void 0===t?void 0:t.channelId,o.importanceHW=null===(n=e[E])||void 0===n?void 0:n.importance,o.imageUrlHW=null===(s=e[E])||void 0===s?void 0:s.image,void(o.categoryHW=null===(a=e[E])||void 0===a?void 0:a.category);case"MI":return void(o.channelIdMi=null===(u=e[E])||void 0===u?void 0:u.channelId);case"OPPO":return void(o.channelIdOPPO=null===(c=e[E])||void 0===c?void 0:c.channelId);case"VIVO":return o.typeVivo=null===(l=e[E])||void 0===l?void 0:l.classification,void(o.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(o.googleConfig={collapseKey:e[E].collapse_key||"",imageUrl:e[E].imageUrl||"",priority:e[E].priority||""});case"HONOR":return o.importanceHonor=null===(p=e[E])||void 0===p?void 0:p.importance,void(o.imageUrlHonor=null===(h=e[E])||void 0===h?void 0:h.image);case"OHOS":i.category=null===(_=e[E])||void 0===_?void 0:_.category,i.image=null===(g=e[E])||void 0===g?void 0:g.image}}}))}catch(n){e.error(exports.LogTagId.O,"Wrong format for pushConfigs field! content: ".concat(t))}return{iOSConfig:r,androidConfig:o,harmonyOSConfig:i}}(t,r.pushConfigs,r.pushId)),se(se({},i),{pushTitle:null==r?void 0:r.title,pushContent:n,pushData:"",disablePushTitle:!!o&&Boolean(4&o),forceShowDetailContent:!!o&&Boolean(8&o),templateId:null==r?void 0:r.templateId})},e.prototype._formatReceivedMessage=function(e,t){var n;if(!e)return e;var r=this,o=t||{},i=o.currentUserId,s=o.connectedTime,a=o.afterDecode,u=o.customMessageTypes,c=void 0===u?{}:u,l=e.content,d=e.fromUserId,p=e.type,h=e.groupId,_=e.status,g=e.dataTime,f=e.extraContent,E=e.extStatus,I=e.clientUniqueId,T=e.busChannel,v=e.msgId,C=e.classname,R=e.toUserIds,y=e.optionBits,m=e.direction||exports.MessageDirection.RECEIVE,S=function(e){var t=exports.ReceivedStatus.READ;return{isPersited:!!(16&e),isCounted:!!(32&e),isMentioned:!!(64&e),disableNotification:!!(512&e),receivedStatus:t=2&e?exports.ReceivedStatus.RETRIEVED:t,canIncludeExpansion:!!(1024&e)}}(_),A=S.isPersited,N=S.isCounted,O=S.isMentioned,M=S.disableNotification,L=S.receivedStatus,U=S.canIncludeExpansion,b=!!(2&(E||0)),P=!!(4&(E||0)),w=!!(8&(E||0))?exports.UltraGroupChannelType.PRIVATE:exports.UltraGroupChannelType.PUBLIC,x=[exports.ConversationType.GROUP,exports.ConversationType.CHATROOM,exports.ConversationType.RTC_ROOM,exports.ConversationType.ULTRA_GROUP].indexOf(p)>-1?h:d,D=d,V=exports.MessageDirection.RECEIVE;m===exports.MessageDirection.SEND&&(D=i,V=exports.MessageDirection.SEND);var G=mt(g),k=G<s,F=p===exports.ConversationType.CHATROOM,B=r._setExpansion(f),H=r._formatBytes(l);H=r._getUtfContent(H);var q=r._setPushConfig(e,this.logger);F&&d===i&&(V=exports.MessageDirection.SEND);var Y={conversationType:p,targetId:x,senderUserId:D,messageType:C,messageUId:v,isPersited:A,isCounted:N,isMentioned:O,sentTime:G,messageDirection:V,receivedTime:Date.now(),disableNotification:M,receivedStatus:L,receivedStatusInfo:Ut(L),canIncludeExpansion:U,content:H,expansion:B,pushConfig:q,channelId:T||"",isInterrupt:b,isModifyMessage:P,messageId:mt(I)||0,sentStatus:exports.SentStatus.SENT,isOffLineMessage:k,channelType:w,isStatusMessage:(null===(n=c[C])||void 0===n?void 0:n.isStatusMessage)||!1,readReceiptInfo:void 0,directedUserIds:R,disableUpdateLastMessage:!!(1&(y||0))};return(null==a?void 0:a(Y))||Y},e.prototype._formatSentMessage=function(e,t){var n=this,r=e.content,o=e.classname,i=e.sessionId,s=e.msgId,a=e.extraContent,u=e.pushExt,c=e.pushContent,l=e.configFlag,d=e.extStatus,p=e.clientUniqueId,h=e.systemId,_=e.toUserIds,g=e.optionBits,f=t.signal,E=t.currentUserId,I=f.date,T=f.topic,v=f.targetId,C=!!(2&(d||0)),R=function(e){return{isPersited:!!(1&e),isCounted:!!(2&e),disableNotification:!!(32&e),canIncludeExpansion:!!(64&e),isMentioned:!!(4&e)}}(i),y=R.isPersited,m=R.isCounted,S=R.disableNotification,A=R.canIncludeExpansion,N=R.isMentioned,O=mp[T]||exports.ConversationType.PRIVATE,M=Tp(T),L=n._formatBytes(r),U=h||v;o===exports.MessageType.RECALL&&(O=L.conversationType||O,U=L.targetId||v);var b=n._setExpansion(a),P=n._setPushConfig(e,this.logger),w=se(se({},P),{pushTitle:null==u?void 0:u.title,pushContent:c,pushData:c,disablePushTitle:!!l&&Boolean(4&l),forceShowDetailContent:!!l&&Boolean(8&l),templateId:null==u?void 0:u.templateId});return{conversationType:O,targetId:U,messageType:o,messageUId:s,isPersited:y,isCounted:m,isStatusMessage:M,senderUserId:E,content:n._formatBytes(r),sentTime:1e3*I,receivedTime:Date.now(),messageDirection:exports.MessageDirection.SEND,isOffLineMessage:!1,disableNotification:S,canIncludeExpansion:A,expansion:b,pushConfig:w,channelId:e.busChannel||"",isInterrupt:C,messageId:mt(p)||0,receivedStatus:exports.ReceivedStatus.UNREAD,receivedStatusInfo:Ut(exports.ReceivedStatus.UNREAD),isMentioned:N,directedUserIds:_,disableUpdateLastMessage:!!(1&(g||0))}},e.prototype._formatHistoryMessages=function(e,t){var n=this,r=e.list,o=e.hasMsg,i=e.compressedData;if(e.compressioEnabled){var s=fp(i),a=Xi.decode(zr,s);return this._formatHistoryMessages(a,t)}var u=t.conversation||{},c=u.targetId,l=mt(e.syncTime),d=[];return St(r,(function(e){var r=n._formatReceivedMessage(e,t);u.conversationType===exports.ConversationType.ULTRA_GROUP?r.targetId=e.groupId||u.targetId:r.targetId=c,d.push(r)}),{isReverse:!0}),{syncTime:l,list:d,hasMore:!!o}},e.prototype._formatUltraMsgChangeList=function(e){var t=e.list,n=e.syncTime,r=e.hasNext;return{syncTime:n,list:t&&t.map((function(e){var t=e.targetId,n=e.type,r=e.time,o=e.changeType,i=e.msgUID,s=e.msgTime,a=e.busChannel,u=e.isAdmin,c=e.isDel,l=e.operatorId,d=e.subChangeType,p=e.userGroupIds,h=e.busChannelType,_=e.remindType;return{targetId:t,conversationType:n,changeType:o,messageUId:i,changeTime:mt(r),sendTime:mt(s),channelId:a||"",isAdmin:u,isDel:c,operatorId:l,subChangeType:d,userGroupIds:p,busChannelType:h,mentionedType:_}})),hasNext:r}},e.prototype._formatEventChangeList=function(e){var t=this,n=e.list,r=e.syncTime,o=e.hasNext;return{syncTime:r,list:n&&n.map((function(e){var n,r=e.businessId,o=e.type,i=e.time,s=e.changeType,a=e.originalId,u=e.originalTime,c=e.secondaryId,l=e.isAdmin,d=e.additionalMark,p=e.operatorId,h=e.subChangeType,_=e.secondaryType,g=e.remindType,f=e.isRemindMe,E=e.extIds,I=e.eventData;return I&&(n=t._formatEventData(I,s,h)),{businessId:r,conversationType:o,changeType:s,originalId:a,time:mt(i),originalTime:mt(u),secondaryId:c||"",isAdmin:l,additionalMark:d,operatorId:p,subChangeType:h,userGroupIds:E,secondaryType:_,remindType:g,isRemindMe:f,eventData:n}})),hasNext:o}},e.prototype._formatEventData=function(e,t,n){var r={};return e&&Np[t]&&Np[t](n)&&(r=Xi.decode(Np[t](n),e)||{}),r},e.prototype._formatUltraOperateStatusNotifyList=function(e){var t=e.type,n=e.notifyType,r=e.info,o=e.summary,i=[],s=[],a=!(2&~n),u=!(1&~n);return u&&Array.isArray(r)&&r.forEach((function(e){var t=e.targetId,n=e.busChannel,r=e.userId,o=e.opType,s=e.optime,a=mt(s);i.push({targetId:t,channelId:n,userId:r,operationType:o,operationTime:a})})),a&&Array.isArray(o)&&o.forEach((function(e){var t=e.targetId,n=e.busChannel,r=e.count,o=e.opType;s.push({targetId:t,channelId:n,count:r,operationType:o})})),{conversationType:t,info:i,summary:s,hasInfo:u,hasSummary:a}},e.prototype._formatUltraMsgList=function(e,t){var n=this,r=e.list;return{list:r&&r.map((function(e){return n._formatReceivedMessage(e,t)}))}},e.prototype._formatUltraGroupUnreadMentionedList=function(e){var t=e.msgInfo;return(void 0===t?[]:t).map((function(e){return{messageUId:e.msgId,sentTime:mt(e.msgTime),mentionedType:e.remindType,messageType:e.className||""}}))},e.prototype._getUltraGroupConversationInfo=function(e,t){var n=t.versionTime,r=t.unreadCount,o=t.remindCount,i=t.busChannelType,s=t.msgInfo,a=t.remindMeCount;return e.versionTime=mt(n)||0,e.unreadMessageCount=this._getUnreadCount(mt(r)||0),e.unreadMentionedCount=this._getUnreadCount(mt(o)||0),e.unreadMentionedMeCount=this._getUnreadCount(mt(a)||0),e.channelType=i||exports.UltraGroupChannelType.PUBLIC,e.lastReadTime=0,s&&(e.firstUnreadMessage={sentTime:mt(s.msgTime)},e.lastReadTime=mt(s.msgTime)-1),e},e.prototype._getUnreadCount=function(e){return e>999?999:e},e.prototype._formatConversationList=function(e,t){var n=this,r=this,o=e.info,i=e.compressedData;if(e.compressioEnabled){var s=fp(i),a=Xi.decode(Hr,s);return this._formatConversationList(a,t)}var u=t.afterDecode,c={list:(o=At(o,(function(e){var o=e.msg,i=e.userId,s=e.type,a=e.unreadCount,c=e.busChannel,l=e.versionTime,d=null;o&&((d=r._formatReceivedMessage(o,t)).targetId=i);var p={targetId:i,conversationType:s,unreadMessageCount:mt(a)||0,latestMessage:d,channelId:c||"",operationTime:mt(l)||0};return s===exports.ConversationType.ULTRA_GROUP&&(p=n._getUltraGroupConversationInfo(p,e)),(null==u?void 0:u(p))||p})))||[]};return((null==t?void 0:t.conversationType)||exports.ConversationType.NONE)===exports.ConversationType.ULTRA_GROUP&&(c.isFinished=e.isFinished),c},e.prototype._formatSetUserSettingOutput=function(e){return e},e.prototype._formatChatRoomInfos=function(e){var t=e.userTotalNums,n=e.userInfos;return{userCount:t,userInfos:At(n,(function(e){var t=e.id,n=e.time;return{id:t,time:mt(n)}}))}},e.prototype._formatChatRoomKVList=function(e){var t=e.entries,n=e.bFullUpdate,r=e.syncTime,o=e.compressedData;if(e.compressioEnabled){var i=fp(o),s=Xi.decode(co,i);return this._formatChatRoomKVList(s)}return t=At(t=t||[],(function(e){var t=e.key,n=e.value,r=e.status,o=e.timestamp,i=e.uid,s=e.version,a=function(e){return{isAutoDelete:!!(1&e),isOverwrite:!!(2&e),type:4&e?exports.ChatroomEntryType.DELETE:exports.ChatroomEntryType.UPDATE}}(r);return{key:t,value:n,isAutoDelete:a.isAutoDelete,isOverwrite:a.isOverwrite,type:a.type,userId:i,timestamp:mt(o),version:mt(s)}})),{kvEntries:t,isFullUpdate:n,syncTime:r}},e.prototype._formatUserSetting=function(e){var t=this,n=e.items,r=e.version,o={};return St(n||[],(function(e){var n=e.key,r=e.version,i=e.value;e.version=mt(r),e.value=t._readBytes(i),"Tag"===n&&e.tags.forEach((function(e){e.createdTime=mt(e.createdTime),e.tagName=e.name})),o[n]=e})),{settings:o,version:r}},e.prototype._formatGrpReadReceiptQryResp=function(e){var t=e.totalMemberNum,n=e.list;return n.forEach((function(e){e.readTime=mt(e.readTime)})),{totalMemberCount:t,list:n}},e.prototype._formatQueryReceiptResp=function(e){var t=e.list,n=void 0===t?[]:t,r=e.num,o=e.readCnt;return{list:n.map((function(e){return{readTime:mt(e.receiptTime),userId:e.userId}})),totalCount:r,readCount:o}},e.prototype._formatUserSettingNotification=function(e){return e},e.prototype._formatChrmKVVersion=function(e){var t=e.joinTime,n=e.createTime,r=e.memberCount,o=e.chatroomBanState;return{joinTime:t,createTime:n||0,memberCount:r||0,isAllChatroomBanned:!!(1&o),isCurrentUserBanned:!!(2&o),isCurrentChatroomBanned:!!(4&o),isCurrentChatroomInWhitelist:!!(1&e.whiteListState)}},e.prototype._formatRTCJoinedUserInfo=function(e){return(e.info||[]).map((function(e){return{deviceId:e.deviceId,roomId:e.roomId,joinTime:mt(e.joinTime)}}))},e.prototype._formatCallKVInfo=function(e){return e},e.prototype._fromatCallInfoDownStream=function(e){return e},e.prototype._formateSessionMsgReadInput=function(e){var t=e.busChannel,n=e.channelId,r=e.msgTime;return{conversationType:e.type,targetId:n,channelId:t||"",timestamp:r}},e.prototype._formateChannelsListResult=function(e){if(!e)return{result:{list:[]}};var t=e.listType,n=e.result,r=e.page;return n?{listType:t,result:Xi.decode(Ap[t],n)||[],page:r}:{listType:t,result:{list:[]},page:r}},e.prototype.encodeSessionAttInput=function(){var e=Xi.getModule(Zr);return e.setNothing(1),e.toArrayBuffer()},e.prototype._calculateFlag=function(e){var t=e.isFilerWhiteBlacklist,n=e.isVoipPush,r=e.pushConfig||{},o=0;return o|=n?1:0,o|=t?2:0,o|=r.disablePushTitle?4:0,o|=r.forceShowDetailContent?8:0},e.prototype._getPushExtraModule=function(e){var t=e.pushTitle,n=e.iOSConfig,r=e.androidConfig,o=e.templateId,i=void 0===o?"":o,s=e.harmonyOSConfig,a=Xi.getModule(Lr);if(t&&a.setTitle(t),n||r||s){var u=function(e,t,n){void 0===e&&(e={}),void 0===t&&(t={}),void 0===n&&(n={});var r=t.channelIdMi,o=t.channelIdHW,i=t.channelIdOPPO,s=t.typeVivo,a=t.importanceHW,u=t.categoryHW,c=t.imageUrlHW,l=t.categoryVivo,d=t.importanceHonor,p=t.imageUrlHonor,h=function(e,t){void 0===e&&(e={}),void 0===t&&(t={});var n=e.threadId,r=e.apnsCollapseId,o=e.category,i=e.richMediaUri,s=e.interruptionLevel,a=t.googleConfig,u={};u["thread-id"]=n||"",u["apns-collapse-id"]=r||"",u.category=o||"",u.richMediaUri=i||"",u["interruption-level"]=s||"active";var c={};c.collapse_key=null==a?void 0:a.collapseKey,c.imageUrl=null==a?void 0:a.imageUrl;var l=null==a?void 0:a.priority;return l&&!["high","normal"].includes(l)&&(l="normal"),c.priority=l,{APNS:u,FCM:c}}(e,t),_=[{HW:{channelId:o||"",importance:a||"NORMAL",image:c||"",category:u||""}},{MI:{channelId:r||""}},{OPPO:{channelId:i||""}},{VIVO:{classification:s||"",category:l||""}},{APNS:h.APNS},{FCM:h.FCM},{HONOR:{importance:d||exports.PushImportanceHonor.NORMAL,image:p||""}},{OHOS:{category:n.category||null,image:n.image||""}}];return JSON.stringify(_)}(n,r,s);a.setPushConfigs(u)}return(null==r?void 0:r.notificationId)&&a.setPushId(null==r?void 0:r.notificationId),a.setTemplateId(i),a},e.prototype._getUpMsgModule=function(e,t){var n=t.messageType,r=t.content,o=t.directionalUserIdList,i=t.canIncludeExpansion,s=t.expansion,a=t.pushConfig,u=t.channelId,c=t.pushData,l=void 0===c?"":c,d=t.pushContent,p=void 0===d?"":d,h=t.messageId,_=void 0===h?0:h,g=t.disableUpdateLastMessage,f=void 0!==g&&g,E=t.isPersited,I=e.conversationType,T=e.targetId,v=Xi.getModule(Mr),C=function(e){var t=e.isStatusMessage,n=e.isPersited,r=e.isCounted;t&&(n=r=!1);var o=0;return n&&(o|=1),r&&(o|=2),e.isMentioned&&(o|=4),e.disableNotification&&(o|=32),e.canIncludeExpansion&&(o|=64),o}(t),R=a||{},y=R.pushContent,m=void 0===y?p:y,S=R.pushData,A=void 0===S?l:S;v.setSessionId(C),m&&v.setPushText(m),A&&v.setAppData(A),o&&v.setToUserIds(o);var N=this._calculateFlag(t);if(v.setConfigFlag(N),v.setClassname(n),r.user&&r.user.portraitUri&&(r.user.portrait=r.user.portraitUri),v.setContent(JSON.stringify(r)),i&&s){var O={};St(s,(function(e,t){O[t]={v:e}})),v.setExtraContent(JSON.stringify(O))}if(a){var M=this._getPushExtraModule(a);v.setPushExt(M)}v.setClientUniqueId(_),Et(u)||v.setBusChannel(u),I===exports.ConversationType.SYSTEM&&v.setSystemId(T);var L=0;return E&&f&&(L|=1),v.setOptionBits(L),v},e.prototype.encodeUpMsg=function(e,t){return this._getUpMsgModule(e,t).toArrayBuffer()},e.prototype.encodeGetHistoryMsg=function(e,t){var n=t.count,r=t.order,o=t.timestamp,i=t.channelId,s=Xi.getModule(Jr);return s.setTargetId(e),s.setTime(o),s.setCount(n),s.setOrder(r),s.setBusChannel(i||""),s.setCompressioEnabled(_u.enable()),s.toArrayBuffer()},e.prototype.encodeSuperSyncMsg=function(e){return Xi.encode(Do,{syncTime:e,compressioEnabled:_u.enable()})},e.prototype.encodeOldConversationList=function(e){var t=(e=e||{}).count,n=e.type,r=e.startTime,o=e.order;t=t||0,r=r||0,o=o||0;var i=Xi.getModule(Fr);return i.setType(n),i.setCount(t),i.setStartTime(r),i.setOrder(o),i.setCompressioEnabled(_u.enable()),i.toArrayBuffer()},e.prototype.encodeRemoveOldConversationList=function(e){var t=(e=e||{}).conversationType,n=e.channelId,r=Xi.getModule(Br);return r.setType(t),n&&r.setBusChannel([n]),r.toArrayBuffer()},e.prototype.encodeBatchDeleteConversation=function(e){var t=Xi.getModule(oo),n=[];return e.forEach((function(e){var t=e.conversationType,r=e.targetId,o=e.channelId,i=Xi.getModule(io);i.setConversationType(t),i.setConversationId(r),i.setBusChannel(o||""),n.push(i)})),t.setRelation(n),t.toArrayBuffer()},e.prototype._encodeSessions=function(e){return e.map((function(e){var t=e.conversationType,n=e.targetId,r=Xi.getModule(to);return r.setType(t),r.setChannelId(n),r}))},e.prototype.encodeRemoveConversationList=function(e){var t=Xi.getModule(eo);return t.setSessions(this._encodeSessions(e)),t.toArrayBuffer()},e.prototype.encodeDeleteMessages=function(e,t,n,r){var o=Xi.getModule(so),i=[];return St(n,(function(e){i.push({msgId:e.messageUId,msgDataTime:e.sentTime,direct:e.messageDirection})})),o.setType(e),o.setConversationId(t),o.setMsgs(i),o.setBusChannel(r),o.toArrayBuffer()},e.prototype.encodeClearMessages=function(e,t,n,r){var o=Xi.getModule(Kr);return t=t||(new Date).getTime(),o.setDataTime(t),o.setTargetId(e),o.setBusChannel(n),o.setConversationType(r),o.toArrayBuffer()},e.prototype.encodeBatchClearRemoteMessages=function(e){var t=Xi.getModule(Qr),n=e.map((function(e){var t=Xi.getModule(Kr);return t.setTargetId(e.targetId),t.setConversationType(e.conversationType),t.setBusChannel(e.channelId),t.setDataTime(e.timestamp),t}));return t.setInput(n),t.toArrayBuffer()},e.prototype.encodeClearUnreadCount=function(e,t){var n=e.conversationType,r=e.targetId,o=e.channelId,i=t.timestamp,s=Xi.getModule($r);return i=i||+new Date,s.setType(n),s.setChannelId(r),s.setMsgTime(i),s.setBusChannel(o),s.toArrayBuffer()},e.prototype.encodeExpandUltraMessage=function(e,t){var n=e.targetId,r=e.conversationType,o=e.channelId,i=e.messageUId,s=e.sendTime,a=e.keys,u={mid:i,put:e.expansion,del:a,clear:e.removeAll?1:0},c=Xi.getModule(Vo);return c.setFromUserId(t),c.setTargetId(n),c.setType(r),c.setBusChannel(o||""),c.setMsgUID(i),c.setMsgTime(s),c.setContent(JSON.stringify(u)),c.toArrayBuffer()},e.prototype.encodemodifyMessage=function(e,t){var n=e.targetId,r=e.conversationType,o=e.channelId,i=e.messageUId,s=e.sendTime,a=e.content,u=Xi.getModule(Vo);return u.setFromUserId(t),u.setTargetId(n),u.setType(r),u.setBusChannel(o||""),u.setMsgUID(i),u.setMsgTime(s),u.setContent(JSON.stringify(a)),u.toArrayBuffer()},e.prototype.encodeQueryMsgChange=function(e){var t=Xi.getModule(Go);return t.setSyncTime(e),t.toArrayBuffer()},e.prototype.encodeMsgQuery=function(e){var t=e.targetId,n=e.conversationType,r=e.messages,o=Xi.getModule(Bo),i=r.map((function(e){return{msgTime:e.sendTime,msgUID:e.messageUId,busChannel:e.channelId}}));return o.setTargetId(t),o.setType(n),o.setQuery(i),o.toArrayBuffer()},e.prototype.encodeUnreadMentionedMsgQuery=function(e){var t=e.targetId,n=e.channelId,r=e.sentTime,o=e.count,i=Xi.getModule(qr);return i.setGroupId(t),i.setBusChannel(n),i.setMsgTime(r),i.setSize(o),i.toArrayBuffer()},e.prototype.encodeOperateStatus=function(e,t,n,r){var o=Xi.getModule(qo);return o.setTargetId(e),o.setType(t),o.setBusChannel(n),o.setOpType(r),o.toArrayBuffer()},e.prototype.encodeGetChatRoomInfo=function(e,t){var n=Xi.getModule(Wr);return n.setCount(e),n.setOrder(t),n.toArrayBuffer()},e.prototype.encodeSetUltraGroupDefaultNotificationLevel=function(e,t){var n=Xi.getModule(Ro);return n.setUnpushLevel(e),n.setBusChannel(t),n.toArrayBuffer()},e.prototype.encodeGetUltraGroupDefaultNotificationLevel=function(e){var t=Xi.getModule(Co);return t.setBusChannel(e),t.toArrayBuffer()},e.prototype.encodeModifyChatRoomKV=function(e,t,n){var r=Xi.getModule(ao),o=t.key,i=t.value,s=t.notificationExtra,a=t.isSendNotification,u=t.type,c=t.timestamp,l=u||exports.ChatroomEntryType.UPDATE,d=vp(t,l),p={key:o,value:i||"",uid:n,version:c};if(Et(d)||(p.status=d),r.setEntry(p),a){var h={conversationType:exports.ConversationType.CHATROOM,targetId:e},_={key:o,value:i,extra:s,type:l},g=this._getUpMsgModule(h,{messageType:exports.MessageType.CHRM_KV_NOTIFY,content:_,isPersited:!1,isCounted:!1});r.setNotification(g),r.setBNotify(!0),r.setType(exports.ConversationType.CHATROOM)}return r.toArrayBuffer()},e.prototype.encodeModifyChatRoomKVS=function(e,t,n){var r=Xi.getModule(uo),o=t.entries,i=t.type||exports.ChatroomEntryType.UPDATE,s=vp(t,i),a=[];return o.forEach((function(e){var t={key:e.key,value:e.value||"",uid:n,version:e.timestamp};Et(s)||(t.status=s),a.push(t)})),r.setEntry(a),r.toArrayBuffer()},e.prototype.encodePullChatRoomKV=function(e){return Xi.encode(po,{timestamp:e,compressioEnabled:_u.enable()})},e.prototype.encodeSetConversationStatus=function(e,t){var n=Date.now();return Xi.encode(vo,{version:t,state:e.map((function(e){var t={type:e.conversationType,channelId:e.targetId,busChannel:e.channelId,time:n,stateItem:[]};return void 0!==e.notificationLevel&&(t.stateItem=[{sessionStateType:Ar.IsSilent,value:e.notificationLevel.toString()}]),void 0!==e.isTop&&(t.stateItem=[{sessionStateType:Ar.IsTop,value:e.isTop?"1":"0"}]),t}))})},e.prototype.encodeSetConversationTypeLevel=function(e,t,n){var r=Xi.getModule(So);return r.setType(e),r.setVersion(t),r.setUnpushLevel(n),r.toArrayBuffer()},e.prototype.encodeReadReceipt=function(e,t){var n=Xi.getModule(No);return n.setMsgId(e),t&&n.setChannelId(t),n.toArrayBuffer()},e.prototype.encodeCreateTag=function(e,t){var n=Xi.getModule(Mo),r=[];return e.forEach((function(e){var t=Xi.getModule(Lo);t.setTagId(e.tagId),t.setName(e.tagName),r.push(t)})),n.setTags(r),n.setVersion(t),n.toArrayBuffer()},e.prototype.encodeMessageReader=function(e,t){var n=Xi.getModule(No);return n.setMsgId(e),t&&n.setChannelId(t),n.toArrayBuffer()},e.prototype.encodeReadReceiptMsg=function(e,t,n){var r=Xi.getModule(zo),o=e.conversationType,i=e.targetId,s=e.channelId,a=void 0===s?"":s;return r.setType(o),r.setTargetId(i),r.setBusChannel(a),r.setStartMsgId(t),r.setEndMsgId(n),r.toArrayBuffer()},e.prototype.encodeReceiptQryReq=function(e,t){var n=Xi.getModule(Zo),r=e.targetId,o=e.channelId,i=void 0===o?"":o;return n.setTargetId(r),n.setBusChannel(i),n.setMsgId(t),n.toArrayBuffer()},e.prototype.encodeReceiptCntQryReq=function(e,t){var n=Xi.getModule($o),r=e.targetId,o=e.conversationType,i=e.channelId,s=void 0===i?"":i;return n.setChannelId(r),n.setBusChannel(s),n.setType(o),n.setMsgId(t),n.toArrayBuffer()},e.prototype.encodeSessionMsgReadInput=function(e,t){var n=Xi.getModule($r),r=e.conversationType,o=e.targetId,i=e.channelId,s=void 0===i?"":i;return n.setType(r),n.setChannelId(o),n.setBusChannel(s),n.setMsgTime(t),n.toArrayBuffer()},e.prototype.encodeRemoveTag=function(e,t){var n=Xi.getModule(Uo),r=[];return e.forEach((function(e){var t=Xi.getModule(Lo);t.setTagId(e),r.push(t)})),n.setTags(r),n.setVersion(t),n.toArrayBuffer()},e.prototype.encodeDisConversationTag=function(e){var t=Xi.getModule(bo);return t.setTagId(e),t.toArrayBuffer()},e.prototype.encodeUpdateConversationTag=function(e,t,n){var r=Xi.getModule(vo),o=[];return t.forEach((function(t){var n=Xi.getModule(Io),r=Xi.getModule(To),i=[];e.forEach((function(e){var t=Xi.getModule(Lo);t.setTagId(e.tagId),Et(e.isTop)||t.setIsTop(e.isTop),i.push(t)})),r.setSessionStateType(Sp),r.setValue(JSON.stringify(i)),r.setTags(i),n.setType(t.conversationType),n.setChannelId(t.targetId),n.setTime(Date.now()),n.setStateItem([r]),o.push(n)})),r.setState(o),r.setVersion(n),r.toArrayBuffer()},e.prototype.encodeReportSDKInfo=function(e){var t=Xi.getModule(wo);return t.setSdkInfo(e),t.toArrayBuffer()},e.prototype.encodeUltraGroup=function(e,t){var n=Xi.getModule(xo);return n.setSyncTime(e),n.setIsEraseMsgContent(t),n.toArrayBuffer()},e.prototype.encodebindRTCRoomForChatroom=function(e){var t=Xi.getModule(Ko);return t.setRtcRoomId(e.rtcRoomId),t.toArrayBuffer()},e.prototype.encodeSetCallInfo=function(e,t){var n=Xi.getModule(Qo);return n.setKey(e),n.setDataContent(t),n.toArrayBuffer()},e.prototype.encodePullKVMsg=function(e){var t=Xi.getModule(jo);return t.setSyncTime(e),t.toArrayBuffer()},e.prototype.encodeUpdateUserSubReq=function(e,t,n,r){var o=Xi.getModule(ti);o.setSubType(e),o.setOpType(n),o.setExpiry(r);var i=[];return t.forEach((function(e){var t=Xi.getModule(ni);t.setSubUserId(e),i.push(t)})),o.setSubUsers(i),o.toArrayBuffer()},e.prototype.encodePullUserSubReq=function(e){var t=e.version,n=e.pageToken,r=Xi.getModule(oi);return r.setVersion(t),r.setPageToken(n),r.toArrayBuffer()},e.prototype.encodePullSubDataReq=function(e){var t=e.version,n=e.needAllData,r=e.pageToken,o=Xi.getModule(si);return o.setVersionTime(t),o.setNeedAllData(n),o.setPageToken(r),o.toArrayBuffer()},e.prototype.encodeQrySubDataReq=function(e,t){var n=Xi.getModule(ci);n.setSubType(e);var r=[];return t.forEach((function(e){var t=Xi.getModule(ni);t.setSubUserId(e),r.push(t)})),n.setSubUsers(r),n.toArrayBuffer()},e.prototype.encodePullUserProfileReq=function(e){var t=Xi.getModule(hi);return t.setUserId(e),t.toArrayBuffer()},e.prototype.encodeUserProfileInput=function(){var e=Xi.getModule(gi);return e.setNothing(1),e.toArrayBuffer()},e.prototype.encodeUserProfilePermission=function(e){var t=Xi.getModule(fi);return t.setPermission(e),t.toArrayBuffer()},e.prototype.encodeSearchUserProfile=function(e){var t=Xi.getModule(Ei);return t.setUniqueId(e),t.toArrayBuffer()},e.prototype.encodeUserProfile=function(e){var t=Xi.getModule(li),n=[],r=[];return Object.keys(e).forEach((function(t){if("extraProfile"!==t){var o=e[t],i=Xi.getModule(di);i.setKey(t),i.setValue((null==o?void 0:o.toString())||""),n.push(i)}else if(e.extraProfile){var s=e.extraProfile;Object.keys(s).forEach((function(e){var t=s[e],n=Xi.getModule(di);n.setKey(e),n.setValue(t.toString()||""),r.push(n)}))}})),t.setUserProfile(n),t.setUserExtProfile(r),t.toArrayBuffer()},e.prototype.encodeMultiChannels=function(e){var t=Xi.getModule(vi),n=[];return e.forEach((function(e){var t=Xi.getModule(Ii);t.setTargetId(e),n.push(t)})),t.setType(exports.ConversationType.GROUP),t.setList(n),t.toArrayBuffer()},e.prototype.encodeQuitGroup=function(e,t,n,r,o){void 0===n&&(n=[]),void 0===r&&(r=!0);var i=Xi.getModule(Ci);if(i.setTargetId(t),i.setType(exports.ConversationType.GROUP),"dismiss"!==e&&o){var s=this.encodeQuitChannelsSetting(o,r);i.setSettingInfo(s)}return"quit"!==e&&"dismiss"!==e&&i.setUsers(n),i.toArrayBuffer()},e.prototype.encodeQuitChannelsSetting=function(e,t){var n=Xi.getModule(Ri);return n.setIsQuit(t),n.setIsDelBan(!!(null==e?void 0:e.removeMuteStatus)),n.setIsDelWhite(!!(null==e?void 0:e.removeWhiteList)),n.setIsDelAttention(!!(null==e?void 0:e.removeFollow)),n},e.prototype.encodeModifyChannelsInput=function(e,t,n){var r=Xi.getModule(Ci);return r.setTargetId(t),r.setType(exports.ConversationType.GROUP),r.setUsers(n),r.setOperateType(e),r.toArrayBuffer()},e.prototype.encodeChannelsQueryInput=function(e){var t=e.type,n=e.groupId,r=e.option,o=e.ids,i=Xi.getModule(yi);if(n&&i.setTargetId(n),i.setType(exports.ConversationType.GROUP),["getGroupMembersByRole","getGroupApplications","getJoinedGroupsByRole"].includes(t)&&r){var s=this.encodePagingQuery(r);i.setPage(s)}return["getGroupMembers","getJoinedGroups"].includes(t)&&i.setIds(null!=o?o:[]),e.roleType&&i.setRoleType(e.roleType),i.toArrayBuffer()},e.prototype.encodePagingQuery=function(e){var t=Xi.getModule(mi),n=e.count,r=e.order,o=e.pageToken;return t.setSize(n),t.setOrder(r?0:1),t.setPageToken(o),t},e.prototype.encodeJoinGroup=function(e,t,n){void 0===n&&(n=[]);var r=Xi.getModule(Oi);return r.setTargetId(t),r.setType(exports.ConversationType.GROUP),"invite"===e&&r.setUserIds(n),r.toArrayBuffer()},e.prototype.encodeMemberResponseInput=function(e){var t=e.groupId,n=e.inviterId,r=e.optType,o=e.optResult,i=e.joinUserId,s=e.reason,a=Xi.getModule(Ni);return a.setTargetId(t),a.setType(exports.ConversationType.GROUP),a.setOptType(r),a.setOptResult(o),a.setInviterId(n),r===exports.GroupOperationRole.MANAGER&&a.setJoinUserId(i),o||a.setDetail(null!=s?s:""),a.toArrayBuffer()},e.prototype.encodeSetGroupRemark=function(e,t){var n=Xi.getModule(Ai),r=exports.GroupOperationType.ADD;return n.setTargetId(e),n.setType(exports.ConversationType.GROUP),t||(r=exports.GroupOperationType.REMOVE),n.setOperateType(r),n.setChannelNickName(t),n.toArrayBuffer()},e.prototype.encodeSetGroupFollows=function(e,t,n){var r=Xi.getModule(Ci);return r.setTargetId(t),r.setType(exports.ConversationType.GROUP),r.setUsers(n),r.setOperateType(e),r.toArrayBuffer()},e.prototype.encodeFriendInput=function(e){var t=Xi.getModule(Mi);return t.setTargetId(e.targetId),e.type&&t.setType(e.type),e.info&&t.setInfo(e.info),t.toArrayBuffer()},e.prototype.encodeFriendsInput=function(e,t){return Xi.encode(Li,{targetId:e,type:t})},e.prototype.encodeFriendQueryInput=function(e,t,n){var r=null!=t?t:{},o=r.count,i=void 0===o?200:o,s=r.pageToken,a=void 0===s?"":s,u=r.order,c=void 0!==u&&u,l=Xi.getModule(wi);l.setQueryType(e),11===e&&l.setFriendType(n);var d=Xi.getModule(mi);return d.setSize(i),d.setOrder(c?0:1),d.setPageToken(a),l.setPage(d),l.toArrayBuffer()},e.prototype.encodeFriendsListInput=function(e,t){return Xi.encode(xi,{targetId:e,type:t})},e.prototype.encodeFriendLevelSet=function(e){return Xi.encode(Di,{level:e})},e.prototype.encodeQuerySessionsInput=function(e){var t=Xi.getModule(no);return t.setSessions(this._encodeSessions(e)),t.toArrayBuffer()},e}(),Mp=function(e){function n(t,n,r){var o=e.call(this,t,n,r)||this;return o._socket=null,o._connectedTime=0,o._socketIndex=0,o._serverSessionId="",o._localConnectedTime=0,o._idCount=0,o._generateMessageId=function(){return o._idCount>=65535&&(o._idCount=0),++o._idCount},o._messageIds={},o._syncMessageIds={},o.codec=new Op(o.logger),o}return t(n,e),n.prototype.getConnectedTime=function(){return this._connectedTime},n.prototype.getLocalConnectedTime=function(){return this._localConnectedTime},n.prototype.getCrtServerTime=function(){return Date.now()-this._localConnectedTime+this._connectedTime},n.prototype.getDelayTime=function(){return this._localConnectedTime-this._connectedTime},n.prototype.connectWithToken=function(e,t,n,r){return ue(this,void 0,void 0,(function(){var n,o,i,s,a,u,c,l,d,p;return ce(this,(function(h){switch(h.label){case 0:if(n=t.openAnti,o=t.type,i=t.baggageEnabled,s=this.getCmpList(t),this.logger.debug(exports.LogTagId.L_NAVI_CMP_R,JSON.stringify(s),r),0===(a=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(exports.LogTagId.L_NAVI_CONF_E,"no service available",r),[2,st(exports.ErrorCode.SERVER_UNAVAILABLE)];u=1===n?_s.V4:_s.V3,c=function(t){var n,s,c,d,p,h,_,g,f,E,I;return ce(this,(function(T){switch(T.label){case 0:return n=a[t],s=n.protocol,c=n.addr,d=n.weight,p=function(e,t,n,r,o,i,s,a){var u,c=s?"&protocolVer=".concat(s):"",l=lu(),d=pu();return"".concat(e,"://").concat(t,"/websocket?appId=").concat(n,"&token=").concat(encodeURIComponent(r),"&sdkVer=").concat(be,"&pid=").concat(i,"&deviceId=").concat(encodeURIComponent(l)).concat(1===a?"&baggage=".concat(encodeURIComponent("cid=".concat(o))):"","&apiVer=").concat(encodeURIComponent((null===(u=Tr.getApiVer)||void 0===u?void 0:u.call(Tr))||"||")).concat(Tr.connectPlatform?"&platform=".concat(Tr.connectPlatform):"").concat(c).concat(Tr.isFromUniapp?"&appIdentifier=".concat(encodeURIComponent(d)):"")}(s===x.WS?"ws":"wss",c,l.appkey,e,l.cid,"",u,i),h=Date.now(),[4,l.connectWebSocket(p,u,r)];case 1:return _=T.sent(),g=_.code,f=_.data,E=l.cmpWeightCache.findIndex((function(e){return e.addr===c})),I={bid:zt(),ptc:Ee.WS,cod:g,net:l.getNetwork().type,dur:Date.now()-h,spr:0,pr:o||0,hos:c,idx:E,rct:l.retryCount?ve.RECONNECT:ve.CONNECT,cid:l.cid,v:Te.CURRENT,rsn:l._doConnectReason,count:l.retryCount,weight:d,ssid:l._serverSessionId},l.logger.record(re.IM_WEBSOCKET,JSON.stringify(I),r),g===exports.ErrorCode.RC_SOCKET_DISCONNECTED||g===exports.ErrorCode.TIMEOUT?[2,"continue"]:g!==exports.ErrorCode.SUCCESS?[2,{value:st(g)}]:(l._localConnectedTime=Math.floor((Date.now()+h)/2),l._socket=f.socket,l.updateCmpWeight(a[t].addr,!0),l.curCmpUrl=a[t].addr,[2,{value:it(f.userId)}])}}))},l=this,d=0,h.label=1;case 1:return d<a.length?[5,c(d)]:[3,4];case 2:if("object"==typeof(p=h.sent()))return[2,p.value];h.label=3;case 3:return d+=1,[3,1];case 4:return[2,st(exports.ErrorCode.SERVER_UNAVAILABLE)]}}))}))},n.prototype.connectWebSocket=function(e,t,n){return ue(this,void 0,void 0,(function(){var r=this;return ce(this,(function(o){return this.logger.info(exports.LogTagId.T,"connect start: ".concat(e),n),[2,new Promise((function(o){var i=Tr.createWebSocket(e);r._socketIndex=i.id;var s=setTimeout((function(){r.logger.info(exports.LogTagId.T,"connect timeout: ".concat(e),n),o(st(exports.ErrorCode.TIMEOUT)),i&&i.close()}),5e3);i.onOpen((function(){clearTimeout(s),r.logger.info(exports.LogTagId.T,"socket open",n)})),i.onMessage((function(e){if(r._socketIndex===i.id){if("[object ArrayBuffer]"===Object.prototype.toString.call(e)){var s=Qa(e,t);if(s){if(s instanceof Ua){var a=s.status;if(a!==zs)return r.logger.info(exports.LogTagId.T,"connect failed: ".concat(a),n),void o(st((p=a,Ip[p])));r.logger.info(exports.LogTagId.T,"connect success",n);var u=s.timestamp,c=s.userId,l=s.messageId,d=s.sessionId;return r._serverSessionId=d,r._connectedTime=u,r._idCount=l,void o(it({userId:c,socket:i}))}var p;if(s instanceof Pa){var h=s.status;return r.logger.info(exports.LogTagId.T,"recv disconnect signal -> status: ".concat(h)),void r.onRecvDisconnect(h,i)}r._onReceiveSignal(s)}}}else r.logger.warn(exports.LogTagId.L_WEBSOCKET_DISACCORD_E,JSON.stringify({msg:"WebSocket id disaccord",_socketIndex:r._socketIndex,curSocketId:i.id}))})),i.onClose((function(){r.logger.info(exports.LogTagId.T,"socket close",n);var e=exports.ErrorCode.RC_SOCKET_DISCONNECTED;o(st(e)),r.onSocketEnd(i,e)})),i.onError((function(e){r.logger.info(exports.LogTagId.T,"socket error",n);var t=exports.ErrorCode.RC_SOCKET_DISCONNECTED;o(st(t)),r.onSocketEnd(i,t)}))}))]}))}))},n.prototype._qosNeedAck=function(e){e.header.qos!==ps.AT_MOST_ONCE&&(e instanceof Ga&&!e.syncMsg&&(this.logger.debug(exports.LogTagId.O,"send pubAck -> ".concat(e.messageId," ").concat(e.topic)),this.sendOnly(new qa(e.messageId))),e instanceof Ka&&(this.logger.debug(exports.LogTagId.O,"send queryCon -> ".concat(e.messageId)),this.sendOnly(new Ya(e.messageId))))},n.prototype._publishReader=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i=this;return ce(this,(function(s){switch(s.label){case 0:return t=e.syncMsg,n=e.topic,r=e.messageId,this.logger.debug(exports.LogTagId.O,"recv PublishReader -> messageId: ".concat(r," ").concat(n)),n===xs?[2]:!t||Tp(n)?(this.emit("signal",e),[2]):[4,new Promise((function(e){i._syncMessageIds[r]=e}))];case 1:return o=s.sent(),delete this._syncMessageIds[r],this.emit("signal",e,o),[2]}}))}))},n.prototype._onReceiveSignal=function(e){return ue(this,void 0,void 0,(function(){var t,n,r;return ce(this,(function(o){switch(o.label){case 0:return e instanceof xa&&this._pingResolve?(this._pingResolve(exports.ErrorCode.SUCCESS),this._pingResolve=void 0,[2]):(this._qosNeedAck(e),(e instanceof Ha||e instanceof Ka)&&(t=e.messageId,this.logger.debug(exports.LogTagId.O,"recv ack -> messageId: ".concat(t)),(n=this._messageIds[t])&&(n(e),delete this._messageIds[t]),(r=this._syncMessageIds[t])&&(delete this._syncMessageIds[t],r(e))),e instanceof Ga?[4,this._publishReader(e)]:[3,2]);case 1:o.sent(),o.label=2;case 2:return[2]}}))}))},n.prototype.onRecvDisconnect=function(e,t){this._socket&&this._socket===t&&(this._socket=null,this.clearResolves(),this.onDisconnectByServer(function(e){return Ep[e]}(e)))},n.prototype.onSocketEnd=function(e,t){this._socket&&this._socket===e&&(this._socket=null,this.clearResolves(),this.onDisconenctUnusual(t),this._pingResolve&&(this._pingResolve(t),this._pingResolve=void 0))},n.prototype.clearResolves=function(){for(var e in this._messageIds){var t=this._messageIds[e];delete this._messageIds[e],t(exports.ErrorCode.RC_SOCKET_DISCONNECTED)}},n.prototype.sendPing=function(e){var t=this;return new Promise((function(n){t._pingResolve=n,setTimeout((function(){return n(exports.ErrorCode.TIMEOUT)}),e),t.sendOnly(new wa)}))},n.prototype.sendOnly=function(e){this._socket&&((e instanceof Ba||e instanceof Fa)&&(e.messageId=this._generateMessageId()),this._socket.send(e.getArrayBuffer()))},n.prototype._sendHandler=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o=this;return ce(this,(function(i){switch(i.label){case 0:return this._socket?(t=this._generateMessageId(),e.messageId=t,this._socket.send(e.getArrayBuffer()),[4,new Promise((function(e){o._messageIds[t]=e,setTimeout((function(){o._messageIds[t]&&delete o._messageIds[t],e(exports.ErrorCode.TIMEOUT)}),3e4)}))]):[2,st(exports.ErrorCode.RC_NET_CHANNEL_INVALID)];case 1:return n=i.sent(),(r="number"==typeof n?n:n.status)!==exports.ErrorCode.SUCCESS&&this.logger.warn(exports.LogTagId.O,"send rmtp fail -> messageId: ".concat(t,", code: ").concat(r,", topic: ").concat(e.topic)),"number"==typeof n?[2,st(n)]:[2,r===exports.ErrorCode.SUCCESS?it(n):st(r,"",n)]}}))}))},n.prototype.query=function(e,t,n,r,o){return ue(this,void 0,void 0,(function(){var i,s,a,u,c,l,d,p;return ce(this,(function(h){switch(h.label){case 0:return i=this.logger.createTraceId(),this.logger.debug(exports.LogTagId.O,"send query -> topic: ".concat(fs(e),", targetId: ").concat(t),i),s=new Fa(e,n,t),o&&s.setHeaderQos(o),[4,this._sendHandler(s)];case 1:return a=h.sent(),u=a.code,c=a.data,l=a.isOk,d=a.msg,p=c&&r?Xi.decode(r,c.pbData):void 0,l?(this.logger.info(exports.LogTagId.O,"send query success",i),[2,it(p)]):(this.logger.warn(exports.LogTagId.O,"send query fail -> ".concat(u),i),[2,st(u,d,p)])}}))}))},n.prototype.send=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o,i,s;return ce(this,(function(a){switch(a.label){case 0:return[4,this._sendHandler(e)];case 1:return(r=a.sent()).data?r.data instanceof Ha?[2,r]:(o=r.data,i=t&&o.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(o.status)>=0,s=i?this.codec.decodeByPBName(o.pbData,t,n):o,0!==o.status?(this.logger.warn(exports.LogTagId.O,"send failed -> messageId: ".concat(o.messageId,", respPBName: ").concat(t,", status: ").concat(o.status)),[2,st(o.status,void 0,t&&o.pbData?s:null)]):[2,it(s)]):[2,r.wipe()]}}))}))},n.prototype.close=function(e,t,n){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){switch(e.label){case 0:return n?[4,this.sendOnly(new ba(Ta))]:[3,2];case 1:e.sent(),e.label=2;case 2:return this._socket&&(this._socket.close(),this._socket=null),this.clearResolves(),[2]}}))}))},n}(Rn),Lp=function(e){this.conn=e},Up=function(e){function n(t,n,r){var o=e.call(this,n,t,r)||this;o._mrtr={chatroom:0,group:0,private:0,ultraGroup:0,temporary:!1};var i=Tr.runtimeInfo,s=i.type,a=i.version;return o.deviceId=lu(),o.model="Web|".concat(s,"|").concat(a),o.init(),o}return t(n,e),n.prototype.httpRequest=function(e,t,n,r){return ue(this,void 0,void 0,(function(){var o,i,s,a,u,c,l,d;return ce(this,(function(p){switch(p.label){case 0:return(o=r).deviceId=this.deviceId,o.model=this.model,i={url:e,method:t,headers:n,body:JSON.stringify(o)},this.logger.info(exports.LogTagId.L_REQUEST_T,JSON.stringify(i)),[4,Tr.httpReq(i)];case 1:s=p.sent(),a=s.status,u=s.data,c=void 0===u?"":u,this.logger.info(exports.LogTagId.L_REQUEST_R,JSON.stringify({status:a,data:c}));try{return l=JSON.parse(c),d=l.data,[2,{code:parseInt(l.code,10),data:d}]}catch(e){return this.logger.warn(exports.LogTagId.L_CLOUD_CONFIG_DATA_E,JSON.stringify({status:a,data:c,error:e})),[2,{code:a,msg:e}]}return[2]}}))}))},n.prototype.setCloudControllerCache=function(e){var t=Qe(this.appkey);Tr.localStorage.setItem(t,JSON.stringify(e)),this.logger.info(exports.LogTagId.L_CLOUD_SET_CACHE_O,JSON.stringify(e))},n.prototype.getLocalCloudControllerCache=function(){var e=Qe(this.appkey),t=Tr.localStorage.getItem(e);return this.logger.info(exports.LogTagId.L_CLOUD_SET_CACHE_O,JSON.stringify({appkey:this.appkey,key:e,data:t})),t},n.prototype.setMRTRConfig=function(e){this.logger.info(exports.LogTagId.L_CLOUD_SET_MRTR_O,JSON.stringify(e)),this._mrtr=e},n.prototype.getMRTRConfig=function(){return this._mrtr},n}(vn),bp=null,Pp="RC_LOGS",wp="RC_STATISTICS",xp="RC_CONF",Dp=((yp={})[Pp]=["level","time"],yp[xp]=["key"],yp[wp]=["level","time"],yp),Vp=function(e,t,n){return new Promise((function(r){var o=e.transaction(t,"readwrite").objectStore(t).index("time"),i=IDBKeyRange.upperBound(Date.now()-n),s=o.openCursor(i);s.onsuccess=function(e){var t=e.target.result;t?(t.delete(),t.continue()):r()},s.onerror=function(){r()}}))},Gp=null,kp=function(e){return ue(void 0,void 0,void 0,(function(){var t,n;return ce(this,(function(r){switch(r.label){case 0:return[4,bp];case 1:return(t=r.sent())?(n=t.db,[4,Vp(n,Pp,e)]):[2];case 2:return r.sent(),[4,Vp(n,wp,e)];case 3:return r.sent(),Gp=setTimeout((function(){return kp(e)}),6e5),[2]}}))}))},Fp=function(e,t,n){void 0===n&&(n=168),bp||("undefined"!=typeof window&&window&&window.indexedDB&&"IE"!==Tr.runtimeInfo.type?bp=new Promise((function(r){var o=window.indexedDB;!function(e){var t=window.indexedDB;t.databases&&t.databases().then((function(n){n.forEach((function(n){n.name&&e.includes(n.name)&&t.deleteDatabase(n.name)}))}))}(["RC_ENGINE_DB","RC_STATISTIC_".concat(e)]);var i="RC_LOGS_".concat(e),s=o.open(i,2);s.onerror=function(e){t.error(exports.LogTagId.L_LOGDB_OPEN_FAILED_E,e.target.error),r(null)},s.onsuccess=function(o){var i=o.target.result;i?(i.onclose=function(e){bp=null,t.warn(exports.LogTagId.L_LOGDB_CLOSED_S)},i.onerror=function(e){bp=null,t.error(exports.LogTagId.L_LOGDB_ERROR_E,e.target.error)},i.onabort=function(e){t.info(exports.LogTagId.L_LOGDB_ABORT_S,e.target.error)},kp(3600*Math.max(24,Math.min(168,n))*1e3),r({appkey:e,db:i})):r(null)},s.onupgradeneeded=function(e){var t=e.target.result;Object.keys(Dp).forEach((function(e){t.objectStoreNames.contains(e)&&t.deleteObjectStore(e);var n=e===xp?{keyPath:"key"}:{autoIncrement:!0},r=t.createObjectStore(e,n);Dp[e].forEach((function(e){return r.createIndex(e,e,{unique:!1})}))}))}})):t.warn(exports.LogTagId.L_UNSUPPORT_INDEXDB_O))},Bp=[],Hp=function(e,t,n){return new Promise((function(r){var o=e.transaction(t,"readwrite");o.oncomplete=r,o.onabort=r;var i=o.objectStore(t);n.forEach((function(e){try{i.add(e)}catch(t){null===console||void 0===console||console.error("write failed ->",e,t)}}))}))},qp=[],Yp=!1,Kp=function(e){return ue(void 0,void 0,void 0,(function(){var t,n;return ce(this,(function(r){switch(r.label){case 0:return Yp||0===qp.length?[2]:(Yp=!0,t=qp.filter((function(e){return e.level<exports.LogL.FATAL})),n=qp.filter((function(e){return e.level>=exports.LogL.FATAL})),qp.length=0,[4,Hp(e,Pp,n)]);case 1:return r.sent(),[4,Hp(e,wp,t)];case 2:return r.sent(),Yp=!1,0===qp.length&&Bp.length>0&&(Bp.forEach((function(e){return e.close()})),Bp.length=0),setTimeout((function(){return Kp(e)})),[2]}}))}))};function Qp(e){return ue(this,void 0,void 0,(function(){var t;return ce(this,(function(n){switch(n.label){case 0:return[4,bp];case 1:return(t=n.sent())?[2,new Promise((function(n){var r=t.db.transaction(xp,"readonly").objectStore(xp).get(e);r.onsuccess=function(e){var t;n({value:null===(t=r.result)||void 0===t?void 0:t.value,success:!0})},r.onerror=function(e){n({success:!1})}}))]:[2,{success:!1}]}}))}))}var Wp=$e,jp=function(){return{setTimestamp4RealtimeLog:function(e){Wp=e},getTimestamp4RealtimeLog:function(){return Wp},getLogs:function(e,t,n,r,o){return void 0===o&&(o=Pp),ue(this,void 0,void 0,(function(){var i;return ce(this,(function(s){switch(s.label){case 0:return[4,bp];case 1:return(i=s.sent())?[2,new Promise((function(s){var a=i.db.transaction(o,"readonly").objectStore(o),u=[],c=IDBKeyRange.bound(e,t),l=a.index("time").openCursor(c);l.onsuccess=function(e){var t=e.target.result;if(t){var o=t.value;o.level<=n&&(r?o.sessionId===Xe:o.level>=0)&&u.push(o),t.continue()}else s({dbReady:!0,logs:u})},l.onerror=function(e){s({dbReady:!1,logs:[]})}}))]:[2,{dbReady:!1,logs:[]}]}}))}))}}},Jp="REPORT_SESSION",zp=function(e,t){return ue(void 0,void 0,void 0,(function(){var n,r,o,i;return ce(this,(function(s){switch(s.label){case 0:return n="".concat(Jp,"_").concat(e),[4,Qp("".concat(Jp,"_").concat(e))];case 1:return r=s.sent(),o=r.success,i=r.value,o?(t===(null==i?void 0:i.sessionId)||function(e,t){ue(this,void 0,void 0,(function(){var n,r;return ce(this,(function(o){switch(o.label){case 0:return[4,bp];case 1:return(n=o.sent())?(r=n.db,r.transaction(xp,"readwrite").objectStore(xp).put({key:e,value:t}),[2,!0]):[2,!1]}}))}))}(n,{sessionId:t}),[2]):[2]}}))}))},Zp=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),n.prototype._handleWrite=function(e){!function(e){ue(void 0,void 0,void 0,(function(){var t;return ce(this,(function(n){switch(n.label){case 0:return[4,bp];case 1:if(!(t=n.sent()))return[2];if(e.content&<(e.content))try{e.content=JSON.parse(e.content)}catch(e){}return qp.push(e),Kp(t.db),[2]}}))}))}(e)},n}(pn),Xp=144e5;if("undefined"!=typeof window){window.__rongcloud_devtools__={logger:{get:function(e,t,n){return void 0===t&&(t=Date.now()-Xp),void 0===n&&(n=Date.now()),ue(this,void 0,void 0,(function(){var r,o;return ce(this,(function(i){switch(i.label){case 0:return t=t<0?Date.now()+t:t,(n=n<=0?Date.now():n)-t>Xp&&(t=n-Xp),(r=new Zp(e,"RC-IM","IM")).debug(exports.LogTagId.T,"get logs: startTime ".concat(t," endTime ").concat(n)),Fp(e,r),[4,jp().getLogs(t,n,exports.LogL.DEBUG,!1)];case 1:return o=i.sent().logs,r.debug(exports.LogTagId.T,"get logs ".concat(o.length)),function(e,t){var n=t.map((function(e){var t=e.sessionId,n=e.time,r=e.type,o=e.level,i=e.tag,s=e.traceId,a=e.loggerId,u=e.content;return"".concat(t,",").concat(n,",").concat(r,",").concat(o,",").concat(i,",").concat(s,",").concat(a,',"').concat(u,'"\n')})),r=new Blob(n,{type:"text/csv"}),o=URL.createObjectURL(r),i=document.createElement("a");i.href=o,i.download="".concat(e,".csv"),document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(o)}("".concat(e,"-").concat(t,"-").concat(n),o),[2]}}))}))}}}}var $p,eh,th=function(e){function n(t,n,r){var o=this,i=lu(),s=Tr.runtimeInfo,a=s.type,u=s.version,c="".concat(a,"|").concat(u,"|").concat(n.getSessionId());return(o=e.call(this,t,i,c,jp(),n)||this).tableName=r,o}return t(n,e),n.prototype.send=function(e){return Tr.httpReq(e)},n.prototype.checkStart=function(t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){switch(n.label){case 0:return[4,zp(t.userId,this.logger.getSessionId())];case 1:return n.sent(),[2,e.prototype.checkStart.call(this,t,this.tableName)]}}))}))},n.prototype.compressLogs=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return[2,{success:!0,data:vu(e.map(_n).join(""))}]}))}))},n.prototype.realtimeReport=function(t,n,r){return ue(this,void 0,void 0,(function(){return ce(this,(function(o){return[2,e.prototype.realtimeReport.call(this,t,n,r,this.tableName)]}))}))},n}(hn),nh=function(e){function n(t,n){return e.call(this,t,n,Pp)||this}return t(n,e),n.prototype.isReporter=function(){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){switch(e.label){case 0:return[4,(t=this.userId,n=this.logger.getSessionId(),ue(void 0,void 0,void 0,(function(){var e,r,o;return ce(this,(function(i){switch(i.label){case 0:return[4,Qp("".concat(Jp,"_").concat(t))];case 1:return e=i.sent(),r=e.success,o=e.value,[2,r&&(null==o?void 0:o.sessionId)===n]}}))})))];case 1:return[2,e.sent()]}var t,n}))}))},n.prototype.report=function(t,n,r,o,i,s,a){return void 0===a&&(a=!1),ue(this,void 0,void 0,(function(){var u;return ce(this,(function(c){switch(c.label){case 0:return[4,this.isReporter()];case 1:return u=c.sent(),this.userId&&!u?[2]:[2,e.prototype.report.call(this,t,n,r,o,i,s,a)]}}))}))},n}(th),rh=function(e){function n(t,n){return e.call(this,t,n,wp)||this}return t(n,e),n}(th),oh=function(e){this.conn=e},ih=function(e){this.conn=e},sh=(($p={})[exports.ConversationType.PRIVATE]=as.qryPMsg,$p[exports.ConversationType.GROUP]=as.qryGMsg,$p[exports.ConversationType.CHATROOM]=as.qryCHMsg,$p[exports.ConversationType.CUSTOMER_SERVICE]=as.qryCMsg,$p[exports.ConversationType.SYSTEM]=as.qrySMsg,$p[exports.ConversationType.APP_PUBLIC_SERVICE]=as.qryMCMsg,$p[exports.ConversationType.PUBLIC_SERVICE]=as.qryMPMsg,$p),ah=((eh={})[exports.ConversationType.PRIVATE]=as.cleanPMsg,eh[exports.ConversationType.GROUP]=as.cleanGMsg,eh[exports.ConversationType.ULTRA_GROUP]=as.cleanGMsg,eh[exports.ConversationType.CUSTOMER_SERVICE]=as.cleanCMsg,eh[exports.ConversationType.SYSTEM]=as.cleanSMsg,eh[exports.ConversationType.APP_PUBLIC_SERVICE]=as.cleanMCMsg,eh[exports.ConversationType.PUBLIC_SERVICE]=as.cleanMPMsg,eh),uh=function(e,t,n,r,o,i,s){return{conversationType:e,targetId:t,senderUserId:i,messageDirection:exports.MessageDirection.SEND,isCounted:!!n.isCounted,isMentioned:!!n.isMentioned,content:n.content,messageType:n.messageType,isOffLineMessage:!1,isPersited:!!n.isPersited,messageUId:r,sentTime:o,receivedTime:0,disableNotification:!!n.disableNotification,isStatusMessage:!!n.isStatusMessage,canIncludeExpansion:!!n.canIncludeExpansion,expansion:n.canIncludeExpansion?n.expansion:null,receivedStatus:exports.ReceivedStatus.UNREAD,receivedStatusInfo:Ut(exports.ReceivedStatus.UNREAD),pushConfig:n.pushConfig,channelId:n.channelId,isInterrupt:n.isInterrupt,messageId:s||0,sentStatus:exports.SentStatus.SENT,directedUserIds:n.directionalUserIdList,disableUpdateLastMessage:n.disableUpdateLastMessage}},ch=function(e){return e.sort((function(e,t){var n,r,o=(null===(n=e.latestMessage)||void 0===n?void 0:n.sentTime)||0;return((null===(r=t.latestMessage)||void 0===r?void 0:r.sentTime)||0)-o})),e},lh=[m.GROUP_OPERATION,m.GROUP_PROFILE_CHANGE,m.GROUP_APPLICATION_INVITATION,m.GROUP_FOLLOW_USER_CHANGE],dh=[l.FRIEND_APPLICATION],ph=["RC:TypSts","RC:InterceptMsg","RC:RL"];function hh(){return function(e,t,n){var r=n.value;return n.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return this._isConnected?[2,r.apply(this,e)]:[2,Promise.resolve({code:exports.ErrorCode.RC_NET_UNAVAILABLE})]}))}))},n}}function _h(){return function(e,t,n){var r=n.value;return n.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return this._isConnected?[2,r.apply(this,e)]:[2,Promise.resolve(st(exports.ErrorCode.RC_NET_UNAVAILABLE))]}))}))},n}}function gh(e){return e?e.map((function(e){var t;return{userId:e.userId,name:e.name,portraitUri:e.portraitUrl,remark:null!==(t=e.remarkName)&&void 0!==t?t:"",directionType:e.friendType,extProfile:e.extProfile,addTime:mt(e.relationTime),inBlackList:!!e.flag}})):[]}function fh(e){return e&&e.list?e.list.map((function(e){return{userId:e.userId,name:e.name||"",portraitUri:e.portraitUrl||"",applicationType:e.type,applicationStatus:e.status,operationTime:mt(e.operateTime),extra:e.info||"",friendType:e.friendType}})):[]}var Eh=function(e){function n(t,n,o){var i=e.call(this,t,n,o,new Zp(o.appkey,"IMLib","IM"))||this;r.add(i),i._customMessageType={},i._reconnectTimer=-1,i._pullOfflineFinished=!1,i.currentUserId="",i._openCallPlus=!1,i.cloudControllerUri="",i._pullingMsg=!1,i._pullQueue=[],i._chrmsQueue={},i._latestSyncTimestamp=0,i._intervalTimer=-1,i._latestPullKVMsgTimestamp=0,i._intervalTimerForChrmPull=-1,i._handleInnerMsgOptions=function(e,t,n){var r,o=n.messageType;if(o===exports.MessageType.SYNC_READ_STATUS&&function(e){return[exports.ConversationType.GROUP,exports.ConversationType.DISCUSSION,exports.ConversationType.ULTRA_GROUP,exports.ConversationType.PUBLIC_SERVICE,exports.ConversationType.APP_PUBLIC_SERVICE].includes(e)}(e)&&Object.assign(n,{directionalUserIdList:[i.currentUserId]}),o===exports.MessageType.READ_RECEIPT_RESPONSE){if(!n.content.receiptMessageDic||0===Object.keys(n.content.receiptMessageDic).length){var s=null===(r=i._readReceiptManager)||void 0===r?void 0:r.getReceiptMessageDic({conversationType:e,targetId:t,channelId:n.channelId});n.content.receiptMessageDic=s||{}}for(var a in n.directionalUserIdList=[],n.content.receiptMessageDic)n.directionalUserIdList.push(a)}return n},i._lastSyncUltraMsgTimeStamp=0,i._lastSyncUltraMsgLocalTimeStamp=0,i._ultraGroupTimer=-1,i._isUltraPulling=!1,i._ultraGroupTimeQue=[],i._isUltraGroupListExist=!1,i._ultraGroupMap={},i._ultraMsgMap={},i._pullUltraChangeMessageQue=[],i._isPullingUltraChangeMessage=!1,i._lastPullingUltraChangeMessageTime=0;var s=o.appkey,a=o.logOutputLevel,u=o.logExpireTime,c=o.navigators,l=o.areaCode,d=o.logServerUrl,p=o.miniCMPProxy,h=o.environment;i._environment=h||"default",i.logger.setOutputLevel(a),cn.init({areaCode:l,navigators:c,logServerUrl:d,miniCMPProxy:p}),Fp(s,i.logger,u),i.reporter=new nh(s,i.logger),i.navi=new ju(s,i.logger,new tc(s,i.logger),i._environment),i.reporterStatistic=new rh(s,i.logger),i._letterbox=new Ju(s),i._sendMessageStore=new zu(s),i._chrmEntryHandler=new qu(i);var _=i._connMgr=new Mp(s,i.navi,i.logger);return"browser"===Tr.tag&&i._initCloudController(),i._chatroom=new Lp(_),i._chat=new oh(_),i._dataHosting=new ih(_),_.on("signal",i._signalHandler,i),_.on("onConnected",i.onConnected,i),_.on("onDisconnected",i.onDisconnected,i),_.on("onConnecting",i._watcher.onConnecting,i._watcher),_.on("onSuspend",i.onSuspend,i),i}var r,o;return t(n,e),Object.defineProperty(n.prototype,"chatroom",{get:function(){return this._chatroom},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"chat",{get:function(){return this._chat},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dataHosting",{get:function(){return this._dataHosting},enumerable:!1,configurable:!0}),n.prototype._initCloudController=function(){var e;e=de(cn.getCloudControllerUrl(),1),this.cloudControllerUri=e[0],this.cloudController=new Up(this._appkey,this.logger,this.reporter),this.cloudControllerUri&&this.cloudController.request(this.cloudControllerUri,dn.init)},n.prototype.onConnected=function(){var e,t=this.navi.getNaviInfoFromCache(this._connMgr.getToken()),n=this._connMgr.getCurrentUserId();this.currentUserId=n,this._pullOfflineFinished=!1,this._EventChangeManager||(this._EventChangeManager=new rc(this._connMgr,this.currentUserId,this.logger,this._appkey,this._handleEventChangeList.bind(this))),this._joinedChrmManager||(this._joinedChrmManager=new Yu(t.joinMChrm)),this._conversationManager||(this._conversationManager=new wu(this,this._appkey,this.currentUserId,this._watcher.conversation,this._watcher.conversationTag,hu(t))),this._ultraGroupManager||(this._ultraGroupManager=new Fu(this._appkey,this.currentUserId)),this._userSettingManager||(this._userSettingManager=new Ku(this,this._appkey,this.currentUserId,this._watcher.tag)),this._readReceiptManager||(this._readReceiptManager=new ec(this._appkey,this.currentUserId,this._connMgr.getDelayTime())),this._initSubscribeManager(t),this._conversationManager.startPullConversationStatus(0),this._conversationManager.adaptOldStore(),this._userSettingManager.pullUserSettings(0),this._sendMessageStore.init(this.currentUserId),this._rejoinChrm(),this._startSyncInterval(),this._openCallPlus&&this._syncCallPullKVMsg(),1===t.ugMsg&&this._notificationOnline(),1&~(t.eventDriven||0)||null===(e=this._EventChangeManager)||void 0===e||e.notificationOnline(),this._watcher.onConnected(),this.reporter.checkStart(t),this.reporterStatistic.checkStart(t)},n.prototype.onDisconnected=function(e){var t,n,r;this._resetMemoryState(),null===(t=this._userSettingManager)||void 0===t||t.stopAllTask(),null===(n=this._conversationManager)||void 0===n||n.stopAllTask(),null===(r=this._EventChangeManager)||void 0===r||r.stopAllTask(),this._watcher.onDisconnected(e)},n.prototype.onSuspend=function(e){var t,n,r;null===(t=this._userSettingManager)||void 0===t||t.stopAllTask(),null===(n=this._conversationManager)||void 0===n||n.stopAllTask(),null===(r=this._EventChangeManager)||void 0===r||r.stopAllTask(),this._watcher.onSuspend(e)},n.prototype._initSubscribeManager=function(e){var t=this;(e.subDriven||e.userProfile)&&(this._subscribeManager||(this._subscribeManager=new $u(this._connMgr,{syncSubscribeUserStatusFinished:function(e){var n,r;null===(r=(n=t._watcher).syncSubscribedUserStatusFinished)||void 0===r||r.call(n,e)},subscribeUserStatusChanged:function(e){var n,r;null===(r=(n=t._watcher).subscribedUserStatusChange)||void 0===r||r.call(n,e)},subscribeRelationChanged:function(e){var n,r;null===(r=(n=t._watcher).subscribedRelationChange)||void 0===r||r.call(n,e)},ownUserProfileChanged:function(e){var n,r;null===(r=(n=t._watcher).ownUserProfileChanged)||void 0===r||r.call(n,e)}},this.currentUserId,this._connMgr.getDelayTime(),this.logger,!!e.userProfile,e.subDriven||0)),this._subscribeManager.syncData())},n.prototype.createLogger=function(e,t){return new Zp(this._appkey,e,t)},n.prototype.refetchNaviInfo=function(){return this.navi.request(this._connMgr.getToken(),!0,!0,this.logger.createTraceId())},n.prototype.getNaviInfoFromCache=function(){return this.navi.getNaviInfoFromCache(this._connMgr.getToken())},n.prototype.getConnectedTime=function(){return this._connMgr.getConnectedTime()},n.prototype.getConnectionStatus=function(){return this._connMgr.getConnectionStatus()},n.prototype.connect=function(e,t,n,r){return ue(this,void 0,void 0,(function(){return ce(this,(function(o){return this._openCallPlus=n,[2,this._connMgr.connect(e,t,n,r)]}))}))},n.prototype._signalHandler=function(e,t){var n,r=e.syncMsg,o=e.topic;if(r)this._receiveSyncMsg(e,t);else{var i=this.logger.createTraceId();this.logger.debug(exports.LogTagId.L_RECV_RMTP_O,o,i);var s=gs(o);if(s)switch(s){case as.s_ntf:this._pullMsg(e);break;case as.s_msg:this._receiveMsg(e);break;case as.s_cmd:this._receiveStateNotify(e);break;case as.s_us:this._receiveSettingNotify(e);break;case as.rtc_ntf:this._receiveRtcKv(e.pbData);break;case as.s_opNtf:this._pullOperateStatusNotify(e);break;case as.s_pubCall:this._pubCallInfo(e);break;case as.s_stat:null===(n=this._subscribeManager)||void 0===n||n.updateUserStatus(e)}else this.logger.error(exports.LogTagId.L_RECV_RMTP_E,o,i)}},n.prototype._receiveStateNotify=function(e){var t,n,r,o=this._connMgr.codec.decodeByPBName(e.pbData,Nr),i=o.time,s=o.type,a=o.chrmId;switch(s){case 2:if(!this._chrmsQueue[a])return;this._chrmEntryHandler.pullEntry(a,i);break;case 3:this._conversationManager.startPullConversationStatus(i);break;case 4:this._chrmEntryHandler.reset(a),this._watcher.chatroom({chatroomDestroyed:e.targetId});break;case 6:this._ultraGroupTimeQue.push(i),this._syncUltraMsg(this._lastSyncUltraMsgTimeStamp);break;case 7:this._pullUltraChangeMessageQue.push(i),this._pullUltraChangeMessageList(this._lastPullingUltraChangeMessageTime);break;case 8:null===(t=this._subscribeManager)||void 0===t||t.startsyncSubscribeUserStatus(i);break;case 9:null===(n=this._subscribeManager)||void 0===n||n.startSyncSubscribeRelationship(i);break;case 10:null===(r=this._subscribeManager)||void 0===r||r.syncOwnProfile(!0);break;case 11:this._EventChangeManager.startPullEventChange(i)}},n.prototype._receiveSettingNotify=function(e){var t=this._connMgr.codec.decodeByPBName(e.pbData,Po).version;this._userSettingManager.pullUserSettings(t)},n.prototype._receiveMessageExpansion=function(e){var t=e.content,n=e.channelId,r=void 0===n?"":n,o=e.conversationType,i=e.targetId,s=t.put,a=t.del,u=t.mid;s&&this._watcher.expansion({updatedExpansion:{messageUId:u,expansion:s,channelId:r,conversationType:o,targetId:i}}),a&&this._watcher.expansion({deletedExpansion:{messageUId:u,deletedKeys:a,channelId:r,conversationType:o,targetId:i}})},n.prototype._clearUltraGroupUnreadCount=function(e,t){var n=this._connMgr.codec.decodeByPBName(e.pbData,$r),r=n.targetId,o=n.channelId,i=n.timestamp,s=this._ultraGroupMap["".concat(o,"_").concat(r)];s&&(s.unreadMessageCount=0,s.unreadMentionedCount=0,s.unreadMentionedMeCount=0,s.firstUnreadMessage&&(s.firstUnreadMessage=null),s.lastReadTime=i,this._watcher.conversation(Lt([s]))),t&&(this._ultraMsgMap[t.messageUId]=t.timestamp)},n.prototype._receiveSyncMsg=function(e,t){var n,r=this,o=gs(e.topic),i=((n={})[as.ugMsg]=function(){r._ultraGroupTimeQue.push(t.timestamp),r._syncUltraMsg(r._lastSyncUltraMsgTimeStamp)},n[as.updRTime]=function(){r._receivesyncReadStatus(e)},n[as.updUgRTime]=function(){r._clearUltraGroupUnreadCount(e,t)},n[as.updUserSub]=function(){var e;null===(e=r._subscribeManager)||void 0===e||e.startSyncSubscribeRelationship(t.timestamp)},n);if(i[o])i[o]();else if([as.recallMsg,as.ppMsgS,as.pgMsgS,as.ppMsgP,as.pgMsgP,as.chatMsg,as.pcMsgP,as.prMsgS,as.pbMsgP].includes(o)){var s=this._connMgr.codec.decodeByPBName(e.pbData,Mr,{currentUserId:this.currentUserId,signal:e});((s=this._handleMsgProperties(s)).conversationType!==exports.ConversationType.CHATROOM||this._chrmsQueue[s.targetId])&&(this._pullingMsg?this._pullQueue.push((null==t?void 0:t.timestamp)||s.sentTime):(t&&(s.sentTime=t.timestamp,s.messageUId=t.messageUId,this._sendMessageStore.setMessage(t.messageUId,t.timestamp)),this.logger.info(exports.LogTagId.L_RECV_MULTI_SYNC_MSG_O,JSON.stringify({messageUId:s.messageUId,messgeId:s.messageId,sentTime:s.sentTime})),s.messageType!==exports.MessageType.EXPANSION_NOTIFY?((s.messageType===exports.MessageType.SYNC_READ_STATUS||s.messageType===exports.MessageType.READ_RECEIPT&&s.senderUserId===this.currentUserId)&&this._conversationManager.clearUnreadCount(s.conversationType,s.targetId,s.channelId,s.sentTime),s.messageType===exports.MessageType.READ_RECEIPT_REQUEST&&this._processRRReqMsg(s),s.messageType===exports.MessageType.READ_RECEIPT_RESPONSE&&this._processRRRspMsg(s),this._conversationManager.setConversationCacheByMessage(s,!0),this._batchMessage([s])):this._receiveMessageExpansion(s)))}},n.prototype._batchMessage=function(e){for(var t=this,n=[],r=[],o=[],i=e.length-1;i>=0;i-=1){var s=e[i];s.messageType===exports.MessageType.LOG_COMMAND&&s.senderUserId===Pe?r.unshift(s):s.messageType===exports.MessageType.CLOUD_CONTROL&&s.senderUserId===Pe?o.push(s):n.unshift(s)}this._watcher.batchMessage(n),r.forEach((function(e){var n=e.content,r=n.startTime,o=n.endTime,i=n.platform,s=n.logId,a=n.uri;t.reporter.report(parseInt(r,10),parseInt(o,10),i,a,s,e.messageUId)})),o.length>0&&this._ccMsgHandler(o)},n.prototype._ccMsgHandler=function(e){var t;return ue(this,void 0,void 0,(function(){var n,r,o;return ce(this,(function(i){switch(i.label){case 0:return e.shift()?(n=this._connMgr.getToken(),[4,null===(t=this.cloudController)||void 0===t?void 0:t.request(this.cloudControllerUri,dn.other,n)]):[3,2];case 1:r=i.sent()||0,(o=e.filter((function(e){return e.sentTime>r}))).length>0&&this._ccMsgHandler(o),i.label=2;case 2:return[2]}}))}))},n.prototype._pubCallInfo=function(e){var t=this._connMgr.codec.decodeByPBName(e.pbData,Wo),n=t.key,r=t.dataContent,o=t.maxTime;this._latestPullKVMsgTimestamp=o,this._watcher.callInfo(JSON.stringify({list:[{key:n,value:r}]}))},n.prototype._pullMsg=function(e){var t=this._connMgr.codec.decodeByPBName(e.pbData,Nr),n=t.type,r=t.chrmId,o=t.time;if(this.logger.info(exports.LogTagId.L_RECV_S_NTF_O,"type: ".concat(n,", chrmId: ").concat(n,", time: ").concat(o)),2===n){var i=this._chrmsQueue[r];if(!i)return;i.queue.push(o),this._pullChrmMsg(r)}else this._pullQueue.push(o),this._syncMsg()},n.prototype._receivesyncReadStatus=function(e){var t=this._connMgr.codec.decodeByPBName(e.pbData,$r),n=t.conversationType,r=t.targetId,o=t.channelId,i=t.timestamp,s=t.sentTime;this._conversationManager.clearUnreadCount(n,r,o,s),this._watcher.syncReadStatus({conversationType:n,targetId:r,channelId:o,timestamp:i})},n.prototype._startSyncInterval=function(){var e=this;this._stopSyncInterval();this._intervalTimer=setInterval((function(){Date.now()-e._latestSyncTimestamp>=18e4&&e._syncMsg()}),3e4),this._latestSyncTimestamp=Date.now(),this._syncMsg()},n.prototype._stopSyncInterval=function(){-1!==this._intervalTimer&&(clearInterval(this._intervalTimer),this._intervalTimer=-1)},n.prototype._syncCallPullKVMsg=function(){return ue(this,void 0,void 0,(function(){var e,t,n,r,o;return ce(this,(function(i){switch(i.label){case 0:return this._isConnected?(e=this._connMgr.codec.encodePullKVMsg(this._latestPullKVMsgTimestamp),t=new Fa(as.pullKvMsg,e,this.currentUserId),[4,this._connMgr.send(t,Jo)]):[2];case 1:return n=i.sent(),r=n.code,o=n.data,r===exports.ErrorCode.SUCCESS&&o?(this._latestPullKVMsgTimestamp=o.maxTime,this._watcher.callInfo(JSON.stringify({list:o.info})),[2]):[2]}}))}))},Object.defineProperty(n.prototype,"_isConnected",{get:function(){return this._connMgr.getConnectionStatus()===exports.RCConnectionStatus.CONNECTED},enumerable:!1,configurable:!0}),n.prototype._filterMessage=function(e){var t=e.messageType;return t===exports.MessageType.DELIVERED||t===exports.MessageType.DELIVERED_MSG||t===exports.MessageType.SYNC_READ_STATUS&&!this._processSRSMsg(e)},n.prototype._messageProcessor=function(e){var t=this,n=0,r=[],o=[],i=[],s=[],a=[];return e.forEach((function(e){var u=e.conversationType,c=e.targetId,l=e.channelId,d=e.messageDirection,p=e.messageUId,h=e.messageType,_=e.sentTime,g=e.senderUserId,f=e.content;if(r.push(p),d===exports.MessageDirection.SEND){n=Math.max(_,n);var E=t._sendMessageStore.getSendMessageMap(),I=h===exports.MessageType.RECALL?"Cmd:".concat(f.messageUId):p;if(E[I])return void t._sendMessageStore.removeByUID(I)}if(!t._filterMessage(e))if(h!==exports.MessageType.EXPANSION_NOTIFY)if(_>=t._connMgr.getConnectedTime()&&t._writeMessagesLog(u,p)&&a.push(p),h===exports.MessageType.READ_RECEIPT&&g===t.currentUserId&&t._conversationManager.clearUnreadCount(u,c,l,_),h!==exports.MessageType.READ_STATE){h===exports.MessageType.READ_RECEIPT_REQUEST&&t._processRRReqMsg(e),h===exports.MessageType.READ_RECEIPT_RESPONSE&&t._processRRRspMsg(e);var T=t._handleMsgProperties(e);t._conversationManager.setConversationCacheByMessage(T,!0),o.push(T)}else s.push(e);else i.push(e)})),{newOutboxTime:n,messageUIds:r,messages:o,messageExpansionList:i,RSMsgList:s,msgUIds2Statistic:a}},n.prototype._processSRSMsg=function(e){var t=e.conversationType,n=e.targetId,r=e.channelId,o=e.content,i=e.senderUserId,s=e.sentTime;if(i!==this.currentUserId)return!1;var a=this.getNaviInfoFromCache();return this._conversationManager.clearUnreadCount(t,n,r,s),1!==a.sesDriven||(s>this.getConnectedTime()||this._watcher.syncReadStatus({conversationType:t,targetId:n,channelId:r,timestamp:o.lastMessageSendTime}),!1)},n.prototype._processRSMsg=function(e){var t=e.conversationType,n=e.targetId,r=e.channelId,o=e.content,i={conversationType:t,targetId:n,channelId:r};this._watcher.messageReadReceipt(t===exports.ConversationType.PRIVATE?{privateReadReceipt:se(se({},i),{endMsgTime:o.endMsgTime})}:{groupReadReceipt:se(se({},i),{totalCount:o.tmn,readedCount:o.rrn,messageUId:o.msgId})})},n.prototype._processRRReqMsg=function(e){var t,n=e.conversationType,r=e.channelId,o=e.targetId,i=e.content,s=e.sentTime,a=e.messageDirection,u=e.senderUserId;null===(t=this._readReceiptManager)||void 0===t||t.insert({conversationType:n,channelId:r,targetId:o},i.messageUId,a,s,u)},n.prototype._processRRRspMsg=function(e){var t,n,r,o=this,i=e.conversationType,s=e.channelId,a=e.targetId,u=e.content,c=e.senderUserId,l=u.receiptMessageDic,d=void 0===l?{}:l;if(c===this.currentUserId)for(var p in d){var h=d[p];try{for(var _=(t=void 0,le(h)),g=_.next();!g.done;g=_.next()){var f=g.value;null===(r=this._readReceiptManager)||void 0===r||r.remove({conversationType:i,channelId:s,targetId:a},f)}}catch(e){t={error:e}}finally{try{g&&!g.done&&(n=_.return)&&n.call(_)}finally{if(t)throw t.error}}}else(d[this.currentUserId]||[]).forEach((function(e){var t;null===(t=o._readReceiptManager)||void 0===t||t.addReadedUser({conversationType:i,channelId:s,targetId:a},e,c)}))},n.prototype._syncMsg=function(){return ue(this,void 0,void 0,(function(){var e,t,n,r,o,i,s,a,u,c,l,d,p,h,_,g,f,E,I,T,v,C,R,y=this;return ce(this,(function(m){switch(m.label){case 0:return this._pullingMsg?[2]:this._isConnected?(this._pullingMsg=!0,e=this._letterbox.getOutboxTime(this.currentUserId),t=this._letterbox.getInboxTime(this.currentUserId),n=this._letterbox.getBroadcastSyncTime(this.currentUserId),r=Xi.encode(Or,{ispolling:!1,isPullSend:!0,sendBoxSyncTime:e,syncTime:t,broadcastSyncTime:n,compressioEnabled:_u.enable()}),o=new Fa(as.pullMsg,r,this.currentUserId),i=this.logger.createTraceId(),this.logger.info(exports.LogTagId.L_PULL_MSG_T,JSON.stringify({outboxTime:e,inboxTime:t,broadcastSyncTime:n}),i),[4,this._connMgr.send(o,Ur,{connectedTime:this._connMgr.getConnectedTime(),currentUserId:this.currentUserId,customMessageTypes:this._customMessageType})]):(this._pullingMsg=!1,[2]);case 1:if(s=m.sent(),a=s.code,u=s.data,this._latestSyncTimestamp=Date.now(),this._pullingMsg=!1,a!==exports.ErrorCode.SUCCESS||!u||Et(u.finished)||Et(u.list)||Et(u.syncTime))return this.logger.warn(exports.LogTagId.L_PULL_MSG_R,JSON.stringify({code:a,timestamp:this._latestSyncTimestamp}),i),[2];c=u.list,l=u.finished,d=u.syncTime,p=u.broadcastSyncTime,h=void 0===p?1:p,this.logger.info(exports.LogTagId.L_PULL_MSG_R,JSON.stringify({syncTime:d,finished:l,messages:c.map((function(e){return{messageUId:e.messageUId,messageId:e.messageId,sentTime:e.sentTime}}))}),i);try{if(_=this._messageProcessor(c),g=_.newOutboxTime,f=_.messageUIds,E=_.messages,I=_.messageExpansionList,T=_.RSMsgList,(v=_.msgUIds2Statistic).length>0&&this.logger.record(re.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:v.join(",")})),this._batchMessage(E),I.forEach((function(e){y._receiveMessageExpansion(e)})),T.forEach((function(e){y._processRSMsg(e)})),this._letterbox.setInboxTime(d,this.currentUserId),this._letterbox.setOutboxTime(g,this.currentUserId),this._letterbox.setBroadcastSyncTime(h,this.currentUserId),this._sendMessageStore.removeByTimestamp(g),C=this._pullQueue.filter((function(e){return e>d})),this._pullQueue.length=0,(R=this._pullQueue).push.apply(R,pe([],de(C),!1)),l&&!this._pullOfflineFinished&&(this._pullOfflineFinished=!0,this._watcher.pullFinished()),this.logger.info(exports.LogTagId.L_PULL_MSG_R,JSON.stringify({code:a,messageUIds:f.join(","),timestamp:this._latestSyncTimestamp,hasmore:!l,tmpPullQueue:C}),i),!l)return this._syncMsg(),[2];this._pullQueue.length>0&&(this._pullQueue.length=0,this._syncMsg())}catch(e){this.logger.error(exports.LogTagId.L_PULL_MSG_E,null==e?void 0:e.stack,i)}return[2]}}))}))},n.prototype._receiveMsg=function(e){if(this._isConnected){var t=this._connMgr.codec.decodeByPBName(e.pbData,br,{currentUserId:this.currentUserId,connectedTime:this._connMgr.getConnectedTime()}),n=(t=this._handleMsgProperties(t)).conversationType,r=t.messageType,o=t.senderUserId,i=t.messageUId,s=t.sentTime,a=t.isStatusMessage;if(this.logger.info(exports.LogTagId.L_RECV_S_MSG_O,JSON.stringify({messageUId:t.messageUId,messgeId:t.messageId,sentTime:t.sentTime})),this._writeMessagesLog(n,i)&&this.logger.record(re.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:i})),n!==exports.ConversationType.RTC_ROOM&&r!==exports.MessageType.INTERCEPT){if(this._pullingMsg)return;if(this._pullQueue.length>0)return void this._syncMsg()}o===this.currentUserId&&this._sendMessageStore.setMessage(i,s),a||o===this.currentUserId||this._letterbox.setInboxTime(s,this.currentUserId),this._handleNotNotifyMsg(t)||(r===exports.MessageType.READ_RECEIPT_REQUEST&&this._processRRReqMsg(t),r===exports.MessageType.READ_RECEIPT_RESPONSE&&this._processRRRspMsg(t),this._conversationManager.setConversationCacheByMessage(t,!0),this._batchMessage([t]))}},n.prototype._handleNotNotifyMsg=function(e){var t=e.messageType,n=e.senderUserId;return t===exports.MessageType.DELIVERED||(t===exports.MessageType.DELIVERED_MSG||(t===exports.MessageType.EXPANSION_NOTIFY?(this._receiveMessageExpansion(e),!0):t===exports.MessageType.SYNC_READ_STATUS&&n!==this.currentUserId||t===exports.MessageType.READ_STATE&&(this._processRSMsg(e),!0)))},n.prototype._handleMsgProperties=function(e,t){void 0===t&&(t=!1);var n,r=e.messageType,o=e.isStatusMessage,i=e.isCounted,s=void 0!==i&&i,a=e.isPersited,u=void 0!==a&&a,c=r in Ue,l=r in this._customMessageType;if(n=c?se(se({},Ue[r]),{isStatusMessage:ph.includes(r)}):l?this._customMessageType[r]:{isCounted:s,isPersited:u,isStatusMessage:!1},Object.assign(e,n),t&&!Et(o)&&(e.isStatusMessage=o),!t){var d=e.content.user;if(d){var p=d.portrait,h=d.portraitUri,_=p||h;_&&(d.portrait=d.portraitUri=_)}}return e},n.prototype._fixDownstreamData=function(e,t,n){return e&&2===t.list.length&&(t.hasMore=!0,0===n?t.list.shift():t.list.pop()),t},n.prototype.getHistoryMessage=function(e,t,n,r,o,i,s,a){var u;return void 0===i&&(i=""),ue(this,void 0,void 0,(function(){var s,c,l,d,p,h,_,g,f,E,I,T=this;return ce(this,(function(v){switch(v.label){case 0:return c=(s=this).currentUserId,l=s._connMgr,d=sh[e]||as.qryPMsg,p=1===r&&0===n,l?(h=l.codec.encodeGetHistoryMsg(t,{timestamp:n,count:p?2:r,order:o,channelId:i}),this.logger.info(exports.LogTagId.L_GET_HISTORY_MSG_T,JSON.stringify({targetId:t,conversationType:e,channelId:i,timestamp:n,count:r,order:o}),a),[4,l.send(new Fa(d,h,c),zr,{currentUserId:c,connectedTime:l.getConnectedTime(),conversation:{targetId:t},afterDecode:function(n){var r,o=null===(r=T._readReceiptManager)||void 0===r?void 0:r.getReadReceiptInfo({conversationType:e,channelId:i,targetId:t},n.messageUId);if(o){var s=o.users;n.readReceiptInfo={isReceiptRequestMessage:!0,readerList:s}}return n}})]):[3,2];case 1:return _=v.sent(),g=_.code,f=_.data,g===exports.ErrorCode.SUCCESS&&f?(E=this._fixDownstreamData(p,f,o),I=[],null===(u=E.list)||void 0===u||u.forEach((function(e){e&&I.push(e.messageUId)})),this.logger.info(exports.LogTagId.L_GET_HISTORY_MSG_R,JSON.stringify({code:g,messageUIds:I.join(",")}),a),[2,{code:g,data:{list:E.list,hasMore:E.hasMore}}]):(this.logger.warn(exports.LogTagId.L_GET_HISTORY_MSG_R,JSON.stringify({code:g,messageUIds:""}),a),[2,{code:g}]);case 2:return[2,{code:exports.ErrorCode.RC_NET_CHANNEL_INVALID}]}}))}))},n.prototype.getMessages=function(e,t,n,r,o,i,s){return this.getHistoryMessage(e,t,n,r,o,i,s)},n.prototype.reportSDKInfo=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a,u;return ce(this,(function(c){switch(c.label){case 0:return this._isConnected?(n=(t=this).currentUserId,r=t._connMgr,o=this.logger.createTraceId(),i=JSON.stringify(e),this.logger.debug(exports.LogTagId.L_VER_REPORT_T,i,o),s=r.codec.encodeReportSDKInfo(i),a=new Fa(as[as.reportsdk],s,n),[4,r.send(a)]):[2];case 1:return(u=c.sent().code)!==exports.ErrorCode.SUCCESS&&this.logger.warn(exports.LogTagId.L_VER_REPORT_R,u,o),[2]}}))}))},n.prototype.deleteRemoteMessage=function(e,t,n,r){return ue(this,void 0,void 0,(function(){var o,i,s,a,u,c,l;return ce(this,(function(d){switch(d.label){case 0:return this._isConnected?(i=(o=this).currentUserId,s=o._connMgr,a=s.codec.encodeDeleteMessages(e,t,n,r),u=as.delMsg,e===exports.ConversationType.ULTRA_GROUP&&(u=as.delUgMsg),c=new Fa(u,a,i),[4,s.send(c)]):[2,exports.ErrorCode.RC_NET_UNAVAILABLE];case 1:return l=d.sent(),[2,l.code]}}))}))},n.prototype.deleteRemoteMessageByTimestamp=function(e,t,n,r){return ue(this,void 0,void 0,(function(){var o,i,s,a,u,c,l;return ce(this,(function(d){switch(d.label){case 0:return this._isConnected?(i=(o=this).currentUserId,s=o._connMgr,a=s.codec.encodeClearMessages(t,n,r,e),u=ah[e],c=new Fa(u,a,i),[4,s.send(c)]):[2,exports.ErrorCode.RC_NET_UNAVAILABLE];case 1:return l=d.sent(),[2,l.code]}}))}))},n.prototype.batchClearRemoteHistoryMessages=function(e,t){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s;return ce(this,(function(a){switch(a.label){case 0:return this._isConnected?(n=(t=this).currentUserId,r=t._connMgr,o=r.codec.encodeBatchClearRemoteMessages(e),i=new Fa(as.cleanMsgBatch,o,n),[4,r.send(i)]):[2,exports.ErrorCode.RC_NET_UNAVAILABLE];case 1:return s=a.sent(),[2,s.code]}}))}))},n.prototype.getConversationList=function(e,t,n,r,o){return void 0===e&&(e=300),ue(this,void 0,void 0,(function(){var o,i,s,a,u,c,l,d,p=this;return ce(this,(function(h){switch(h.label){case 0:return this._isConnected?(i=(o=this).currentUserId,s=o._connMgr,t=t||exports.ConversationType.PRIVATE,a=s.codec.encodeOldConversationList({count:e,type:t,startTime:n,order:r}),u=new Fa(as.qryRelationR,a,i),[4,s.send(u,Hr,{currentUserId:i,connectedTime:s.getConnectedTime(),afterDecode:function(e){var t=e.conversationType,n=e.targetId,r=e.channelId,o=p._conversationManager.get(t,n,r);Object.assign(e,o);var i=p._conversationManager.getDraft(t,n,r);return e.draft=i,e}})]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return c=h.sent(),l=c.code,d=c.data,l!==exports.ErrorCode.SUCCESS?[2,{code:l}]:[2,{code:l,data:null==d?void 0:d.list}]}}))}))},n.prototype.removeConversation=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o,i;return ce(this,(function(s){switch(s.label){case 0:return this._isConnected?(r=this._connMgr,o=r.codec.encodeRemoveOldConversationList({conversationType:e,channelId:n,targetId:t}),i=new Fa(as.delRelation,o,t),[4,r.send(i)]):[2,exports.ErrorCode.RC_NET_UNAVAILABLE];case 1:return[2,s.sent().code]}}))}))},n.prototype.batchRemoveConversation=function(e){return ue(this,void 0,void 0,(function(){var t,n,r;return ce(this,(function(o){switch(o.label){case 0:return this._isConnected?(t=this._connMgr,n=t.codec.encodeBatchDeleteConversation(e),r=new Fa(as.delRelationBatch,n,this.getCurrentUserId()),[4,t.send(r)]):[2,exports.ErrorCode.RC_NET_UNAVAILABLE];case 1:return[2,o.sent().code]}}))}))},n.prototype.getConversation=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o,i,s,a,u,c;return ce(this,(function(l){switch(l.label){case 0:return e!==exports.ConversationType.ULTRA_GROUP?[3,1]:(r=this._ultraGroupMap["".concat(n,"_").concat(t)])?[3,3]:[2,{code:exports.ErrorCode.CONVER_GET_ERROR}];case 1:return(o=this._conversationManager.get(e,t,n))?[4,this.getHistoryMessage(e,t,0,1,0)]:[2,{code:exports.ErrorCode.CONVER_GET_ERROR}];case 2:if(i=l.sent(),s=i.code,a=i.data,s!==exports.ErrorCode.SUCCESS)return[2,{code:exports.ErrorCode.CONVER_GET_ERROR}];u=this._conversationManager.getDraft(e,t,n),c=(null==a?void 0:a.list[0])||null,r={conversationType:e,targetId:t,channelId:n,unreadMessageCount:o.unreadMessageCount||0,latestMessage:c,notificationStatus:o.notificationStatus||exports.NotificationStatus.CLOSE,notificationLevel:o.notificationLevel||exports.NotificationLevel.NOT_SET,isTop:o.isTop||!1,lastUnreadTime:o.lastUnreadTime||0,unreadMentionedCount:o.unreadMentionedCount||0,draft:u},l.label=3;case 3:return[2,{code:exports.ErrorCode.SUCCESS,data:r}]}}))}))},n.prototype.getAllConversationUnreadCount=function(e,t,n){var r=this._conversationManager.getAllUnreadCount(e,t,n);return Promise.resolve({code:exports.ErrorCode.SUCCESS,data:r})},n.prototype.getTotalUnreadCountByLevels=function(e,t,n){void 0===n&&(n=!1);var r=0;if(e.includes(exports.ConversationType.ULTRA_GROUP)){if(!this._isUltraGroupListExist)return Promise.resolve({code:exports.ErrorCode.METHOD_NOT_AVAILABLE});for(var o in this._ultraGroupMap){var i=this._ultraGroupMap[o];(0===t.length||t.includes(i.notificationLevel))&&(r+=n?i.unreadMentionedCount:i.unreadMessageCount)}}return r+=this._conversationManager.getTotalUnreadCountByLevels(e,t,n),Promise.resolve({code:exports.ErrorCode.SUCCESS,data:r})},n.prototype.getConversationUnreadCount=function(e,t,n){var r,o;return e===exports.ConversationType.ULTRA_GROUP?(o=(null===(r=this._ultraGroupMap["".concat(n,"_").concat(t)])||void 0===r?void 0:r.unreadMessageCount)||0,o=this._getUnreadCount(o)):o=this._conversationManager.getUnreadCount(e,t,n),Promise.resolve({code:exports.ErrorCode.SUCCESS,data:o})},n.prototype.clearConversationUnreadCount=function(e,t,n){return this._conversationManager.clearUnreadCount(e,t,n,this.getServerTime(),!1),Promise.resolve(exports.ErrorCode.SUCCESS)},n.prototype.clearAllUnreadCount=function(){return this._conversationManager.clearAllUnreadCount(),Promise.resolve(exports.ErrorCode.SUCCESS)},n.prototype.getFirstUnreadMessage=function(e,t){throw new Error("Method not implemented.")},n.prototype.getFirstUnreadMessageInfo=function(e,t,n){var r=this._conversationManager.get(e,t,n),o=r.firstUnreadMessageUid,i=r.firstUnreadTime;return Promise.resolve({code:exports.ErrorCode.SUCCESS,data:i&&o?{messageUId:o,sentTime:i}:null})},n.prototype.saveConversationMessageDraft=function(e,t,n,r){return this._conversationManager.setDraft(e,t,n,r),Promise.resolve(exports.ErrorCode.SUCCESS)},n.prototype.getConversationMessageDraft=function(e,t,n){var r=this._conversationManager.getDraft(e,t,n);return Promise.resolve({code:exports.ErrorCode.SUCCESS,data:r})},n.prototype.clearConversationMessageDraft=function(e,t,n){return this._conversationManager.clearDraft(e,t,n),Promise.resolve(exports.ErrorCode.SUCCESS)},n.prototype.pullConversationStatus=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s=this;return ce(this,(function(a){switch(a.label){case 0:return this._isConnected?(n=(t=this)._connMgr,r=t.currentUserId,o=Xi.encode(fo,{time:e}),[4,n.query(as.pullSeAtts,r,o,Eo)]):[2,st(exports.ErrorCode.RC_NET_UNAVAILABLE)];case 1:return i=a.sent(),this.logger.info(exports.LogTagId.L_PULL_CONVERSATION_S,JSON.stringify({timestamp:e,userId:r,resp:i})),[2,i.trans((function(e){var t=e.state;e.version;var n=[];return t.forEach((function(e){var t=e.stateItem,r=e.channelId,o=e.type,i=e.busChannel,a=e.time,u={conversationType:o,targetId:r,channelId:i,updatedTime:a};null==t||t.forEach((function(e){var t=e.sessionStateType,n=e.value,r=e.tags;switch(t){case Ar.IsSilent:u.notificationLevel=Number(n)||exports.NotificationLevel.NOT_SET,u.notificationStatus=u.notificationLevel?exports.NotificationStatus.OPEN:exports.NotificationStatus.CLOSE;break;case Ar.IsTop:u.isTop="1"===n;break;case Ar.Tags:u.tags=r}u.updatedTime=a})),a&&s._conversationManager.setConversationUpdatedTime(a),o===exports.ConversationType.ULTRA_GROUP?s._setUltraConversationStatus(u):n.push(u)})),n}))]}}))}))},n.prototype._setUltraConversationStatus=function(e){var t=e.targetId,n=e.notificationLevel,r=e.channelId,o=e.isTop,i=e.conversationType;if(""!==t||void 0===n){var s=this._ultraGroupMap["".concat(r,"_").concat(t)];return s&&void 0!==n&&(s.notificationLevel=n,s.notificationStatus=Ae(n),this._ultraGroupManager.addUltraGroupStatus(s)),s&&void 0!==o&&(s.isTop=o),s}this._ultraGroupManager.addUltraGroupStatus({conversationType:i,targetId:"",channelId:"",notificationLevel:n,notificationStatus:Ae(n)})},n.prototype.batchSetConversationStatus=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o=this;return ce(this,(function(i){switch(i.label){case 0:return this._isConnected?(n=(t=this).currentUserId,r=t._connMgr,[4,this._conversationManager.pushTask((function(t){return ue(o,void 0,void 0,(function(){var o,i,s,a,u,c,l,d,p=this;return ce(this,(function(h){switch(h.label){case 0:return o=r.codec.encodeSetConversationStatus(e,t),i=new Fa(as.setSeAtt,o,n),[4,r.send(i,mo)];case 1:return s=h.sent(),a=s.code,u=s.data,a!==exports.ErrorCode.SUCCESS?[2,{code:a}]:(c=u,this._conversationManager.setConversationUpdatedTime(c.version),l=[],e.forEach((function(e){if(e.conversationType!==exports.ConversationType.ULTRA_GROUP)p._conversationManager.addStatus(se(se({},e),{updatedTime:c.version}),!0);else{var t=p._setUltraConversationStatus(e);t&&l.push(t)}})),l.length>0&&(d=Lt(l),d=ch(d),this._watcher.conversation(d)),[2,{code:a}])}}))}))}))]):[2,exports.ErrorCode.RC_NET_UNAVAILABLE];case 1:return[2,i.sent().code]}}))}))},n.prototype.setConversationToTop=function(e,t,n,r,o){return ue(this,void 0,void 0,(function(){return ce(this,(function(o){return[2,this.batchSetConversationStatus([{conversationType:e,targetId:t,isTop:n,channelId:r}])]}))}))},n.prototype.batchSetConversationToTop=function(e,t,n){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){return[2,this.batchSetConversationStatus(e.map((function(e){return se(se({},e),{isTop:t})})))]}))}))},n.prototype.setConversationNotificationLevel=function(e,t,n,r){return void 0===r&&(r=""),ue(this,void 0,void 0,(function(){return ce(this,(function(o){return[2,this.batchSetConversationStatus([{conversationType:e,targetId:t,notificationLevel:n,channelId:r}])]}))}))},n.prototype.batchSetConversationNotificationLevel=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){return[2,this.batchSetConversationStatus(e.map((function(e){return se(se({},e),{notificationLevel:t})})))]}))}))},n.prototype._joinChrm=function(e,t,n,r,o){return ue(this,void 0,void 0,(function(){var i,s,a,u,c,l,d,p,h,_,g,f,E,I,T,v;return ce(this,(function(C){switch(C.label){case 0:return this._isConnected?(i=this._connMgr,s=Xi.encode(Vr,{nothing:1,extra:r}),a=n?as.joinChrmR:as.joinChrm,u=new Fa(a,s,e),this.logger.info(exports.LogTagId.L_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t,topic:as[a]}),o),[4,i.send(u,Gr)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return c=C.sent(),l=c.code,d=c.data,p=l===exports.ErrorCode.SUCCESS?"info":"warn",this.logger[p](exports.LogTagId.L_JOIN_CHATROOM_R,JSON.stringify({code:l,timestamp:(new Date).getTime()}),o),l===exports.ErrorCode.SUCCESS?(_=(h=d).joinTime,g=h.createTime,f=h.memberCount,E=h.isAllChatroomBanned,I=h.isCurrentUserBanned,T=h.isCurrentChatroomBanned,v=h.isCurrentChatroomInWhitelist,this._chrmsQueue[e]||(this._chrmsQueue[e]={pulling:!1,queue:[],timestamp:0}),this._pullChrmMsg(e,t,_),this.getNaviInfoFromCache().kvStorage&&this._chrmEntryHandler.pullEntry(e,0),this._joinedChrmManager.set(e,t,r),this._startSyncIntervalForChrmPull(),[2,{code:l,data:{joinTime:_,createTime:g,memberCount:f,isAllChatroomBanned:E,isCurrentUserBanned:I,isCurrentChatroomBanned:T,isCurrentChatroomInWhitelist:v}}]):[2,{code:l}]}}))}))},n.prototype._rejoinChrm=function(){return ue(this,void 0,void 0,(function(){var e,t,n,r,o,i,s,a,u,c,l,d,p,h;return ce(this,(function(_){switch(_.label){case 0:for(n in e=this._joinedChrmManager.get(),t=[],e)t.push(n);r=0,_.label=1;case 1:return r<t.length?(o=t[r],i=e[o],s=i.count,a=void 0===s?10:s,u=i.extra,this.logger.info(exports.LogTagId.L_REJOIN_CHATROOM_T,JSON.stringify({chatroomId:o,count:a,extra:u})),c=this.logger.createTraceId(),[4,this._joinChrm(o,a,!0,u,c)]):[3,4];case 2:if(l=_.sent(),d=l.code,p=l.data,h=d===exports.ErrorCode.SUCCESS?"info":"warn",this.logger[h](exports.LogTagId.L_REJOIN_CHATROOM_R,JSON.stringify({code:d,timestamp:(new Date).getTime()}),c),d===exports.ErrorCode.SUCCESS)return this._watcher.chatroom({rejoinedRoom:se({chatroomId:o,count:a},p)}),[2];d===exports.ErrorCode.RC_CHATROOM_USER_KICKED&&(this._joinedChrmManager.remove(o),delete this._chrmsQueue[o]),this._watcher.chatroom({rejoinedRoom:{chatroomId:o,errorCode:d}}),_.label=3;case 3:return r++,[3,1];case 4:return[2]}}))}))},n.prototype._pullChrmMsg=function(e,t,n){return void 0===t&&(t=10),void 0===n&&(n=0),ue(this,void 0,void 0,(function(){var r,o,i,s,a,u,c,l,d,p,h,_,g,f,E,I=this;return ce(this,(function(T){switch(T.label){case 0:return this._isConnected?(r=this._chrmsQueue[e],o=r.pulling,i=r.timestamp,o?[2]:(r.pulling=!0,s=n?0:i,a=Xi.encode(kr,{count:t,syncTime:s,compressioEnabled:_u.enable()}),this.logger.info(exports.LogTagId.L_PULL_CHATROOM_MSG_T,JSON.stringify({chatroomId:e,syncTime:s})),u=new Fa(as[as.chrmPull],a,e),[4,this._connMgr.send(u,Ur,{connectedTime:this._connMgr.getConnectedTime(),currentUserId:this.currentUserId})])):[2];case 1:return c=T.sent(),l=c.code,d=c.data,r.pulling=!1,l===exports.ErrorCode.SUCCESS&&d?(p=d.list,h=d.syncTime,_=d.finished,r.timestamp=n?Math.max(h,n):h,r.queue=r.queue.filter((function(e){return e>h})),g=[],f=[],E=[],p.forEach((function(e){e.sentTime<i||(e.sentTime>=I._connMgr.getConnectedTime()&&I._writeMessagesLog(exports.ConversationType.CHATROOM,e.messageUId)&&f.push(e.messageUId),g.push(e.messageUId),E.push(e))})),this._batchMessage(E),this.logger.info(exports.LogTagId.L_PULL_CHATROOM_MSG_R,JSON.stringify({code:l,timestamp:i,messageUIds:g.join(",")})),f.length>0&&this.logger.record(re.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:f.join(",")})),_?(r.queue.length>0&&(r.queue.length=0,this._pullChrmMsg(e)),[2]):(this._pullChrmMsg(e),[2])):(this.logger.warn(exports.LogTagId.L_PULL_CHATROOM_MSG_R,JSON.stringify({code:l,timestamp:i,messageUIds:""})),[2])}}))}))},n.prototype.joinChatroom=function(e,t,n,r){return ue(this,void 0,void 0,(function(){return ce(this,(function(o){switch(o.label){case 0:return[4,this._joinChrm(e,t,!1,n,r)];case 1:return[2,o.sent().code]}}))}))},n.prototype.joinExistChatroom=function(e,t,n,r){return ue(this,void 0,void 0,(function(){return ce(this,(function(o){return[2,this._joinChrm(e,t,!0,n,r)]}))}))},n.prototype.quitChatroom=function(e){return ue(this,void 0,void 0,(function(){var t,n;return ce(this,(function(r){switch(r.label){case 0:return this._isConnected?(t=this._connMgr,delete this._chrmsQueue[e],this._chrmEntryHandler.reset(e),this._joinedChrmManager.remove(e),n=Xi.encode(Vr,{nothing:1}),[4,t.query(as.exitChrm,e,n)]):[2,exports.ErrorCode.RC_NET_UNAVAILABLE];case 1:return[2,r.sent().code]}}))}))},n.prototype.getChatroomInfo=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o,i,s,a,u;return ce(this,(function(c){switch(c.label){case 0:return this._isConnected?(r=this._connMgr,o=r.codec.encodeGetChatRoomInfo(t,n),i=new Fa(as[as.queryChrmI],o,e),[4,r.send(i,jr)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return s=c.sent(),a=s.code,u=s.data,a!==exports.ErrorCode.SUCCESS?[2,{code:a}]:[2,{code:a,data:u}]}}))}))},n.prototype.getChatroomHistoryMessages=function(e,t,n,r){return ue(this,void 0,void 0,(function(){var o,i,s,a,u,c;return ce(this,(function(l){switch(l.label){case 0:return this._isConnected?(o=this._connMgr,i=o.codec.encodeGetHistoryMsg(e,{timestamp:t,count:n,order:r}),s=new Fa(as.qryCHMsg,i,e),[4,o.send(s,zr,{conversation:{targetId:e}})]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return a=l.sent(),u=a.code,c=a.data,u!==exports.ErrorCode.SUCCESS?[2,{code:u}]:[2,{code:u,data:{list:c.list,hasMore:c.hasMore}}]}}))}))},n.prototype._modifyChatroomKV=function(e,t){return ue(this,void 0,void 0,(function(){var n,r,o,i,s,a,u,c,l;return ce(this,(function(d){switch(d.label){case 0:return this._isConnected?(r=(n=this)._connMgr,o=n.currentUserId,i=this._chrmEntryHandler.getVersion(e,t.key),t.version=null==i?this.getServerTime():i,s=r.codec.encodeModifyChatRoomKV(e,t,o),a=t.type===exports.ChatroomEntryType.UPDATE?as.setKV:as.delKV,u=new Fa(a,s,e),[4,r.send(u,Gr)]):[2,exports.ErrorCode.RC_NET_UNAVAILABLE];case 1:return c=d.sent(),(l=c.code)===exports.ErrorCode.SUCCESS?(this._chrmEntryHandler.setLocal(e,{kvEntries:[t],syncTime:this.getServerTime()},o),[2,l]):[2,l]}}))}))},n.prototype._chatroomKVStoreNotAllSuccess=function(e,t){var n=t.data,r=e;return n&&Array.isArray(n.errorKeys)&&n.errorKeys.forEach((function(e){var t=r.findIndex((function(t){return e.key===t.key}));-1!==t&&r.splice(t,1)})),r},n.prototype._modifyChatroomKVS=function(e,t){return ue(this,void 0,void 0,(function(){var n,r,o,i,s,a,u,c,l,d,p,h,_=this;return ce(this,(function(g){switch(g.label){case 0:return this._isConnected?(r=(n=this)._connMgr,o=n.currentUserId,t.entries.forEach((function(t){var n=_._chrmEntryHandler.getVersion(e,t.key);t.version=null==n?_.getServerTime():n})),i=r.codec.encodeModifyChatRoomKVS(e,t,o),s=t.type===exports.ChatroomEntryType.UPDATE?as.setKVS:as.delKVS,a=new Fa(s,i,e),[4,r.send(a,lo)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return u=g.sent(),c=u.code,-1!==[exports.ErrorCode.SUCCESS,exports.ErrorCode.CHATROOM_KV_STORE_NOT_ALL_SUCCESS].indexOf(c)&&(d=[],delete(p=se({},t)).entries,t.entries.forEach((function(e){d.push(se(se({},e),p))})),c===exports.ErrorCode.CHATROOM_KV_STORE_NOT_ALL_SUCCESS&&(h=u.data,l=h.errorKeys,d=this._chatroomKVStoreNotAllSuccess(d,u)),this._chrmEntryHandler.setLocal(e,{kvEntries:d,syncTime:(new Date).getTime()},o)),[2,{code:c,data:l}]}}))}))},n.prototype.setChatroomEntry=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){return t.type=exports.ChatroomEntryType.UPDATE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))},n.prototype.setChatroomEntries=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){return t.type=exports.ChatroomEntryType.UPDATE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKVS(e,t)]}))}))},n.prototype.forceSetChatroomEntry=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){return t.type=exports.ChatroomEntryType.UPDATE,t.isOverwrite=!0,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))},n.prototype.removeChatroomEntry=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){return t.type=exports.ChatroomEntryType.DELETE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))},n.prototype.removeChatroomEntries=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){return t.type=exports.ChatroomEntryType.DELETE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKVS(e,t)]}))}))},n.prototype.forceRemoveChatroomEntry=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){return t.type=exports.ChatroomEntryType.DELETE,t.isOverwrite=!0,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))},n.prototype.getChatroomEntry=function(e,t){return ue(this,void 0,void 0,(function(){var n,r,o,i,s,a,u;return ce(this,(function(c){switch(c.label){case 0:return(n=this._chrmEntryHandler.getValue(e,t))?[2,{code:exports.ErrorCode.SUCCESS,data:n}]:this._isConnected?(r=this._connMgr,o=r.codec.encodePullChatRoomKV(0),i=new Fa(as[as.pullKV],o,e),[4,r.send(i,co)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return s=c.sent(),(a=s.data)&&a.kvEntries&&a.kvEntries.length&&(u=a.kvEntries.find((function(e){return e.key===t})),void 0!==u)?[2,{code:exports.ErrorCode.SUCCESS,data:null==u?void 0:u.value}]:[2,{code:exports.ErrorCode.CHATROOM_KEY_NOT_EXIST}]}}))}))},n.prototype.getAllChatroomEntry=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s;return ce(this,(function(a){switch(a.label){case 0:return(t=this._chrmEntryHandler.getAll(e))&&Object.keys(t).length?[2,{code:exports.ErrorCode.SUCCESS,data:t}]:this._isConnected?(n=this._connMgr,t={},r=n.codec.encodePullChatRoomKV(0),o=new Fa(as[as.pullKV],r,e),[4,n.send(o,co)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return i=a.sent(),(s=i.data)&&s.kvEntries&&s.kvEntries.length&&s.kvEntries.forEach((function(e){e.key&&(t[e.key]=e.value||"")})),[2,{code:exports.ErrorCode.SUCCESS,data:t}]}}))}))},n.prototype.pullChatroomEntry=function(e,t){return ue(this,void 0,void 0,(function(){var n,r,o,i,s,a,u,c,l,d,p,h=this;return ce(this,(function(_){switch(_.label){case 0:return this._isConnected?(r=(n=this)._connMgr,o=n.currentUserId,this._chrmsQueue[e]?(i=r.codec.encodePullChatRoomKV(t),s=new Fa(as[as.pullKV],i,e),this.logger.info(exports.LogTagId.L_PULL_CHATROOM_KV_T,JSON.stringify({chatroomId:e,timestamp:t})),[4,r.send(s,co)]):[2,{code:exports.ErrorCode.RC_CHATROOM_NOT_EXIST}]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return a=_.sent(),u=a.code,c=a.data,this._chrmsQueue[e]?(l=u===exports.ErrorCode.SUCCESS?"info":"warn",this.logger[l](exports.LogTagId.L_PULL_CHATROOM_KV_R,JSON.stringify({code:u,timestamp:t})),u===exports.ErrorCode.SUCCESS&&c?(d=c.kvEntries,p=[],d.length>0&&(d.forEach((function(t){var n=t.key,r=t.value,o=t.type,i=t.timestamp,s=t.userId;h._chrmEntryHandler.getValue(e,n)===r&&s===h.getCurrentUserId()||p.push({key:n,value:r,type:o,timestamp:i,chatroomId:e})})),this._chrmEntryHandler.setLocal(e,c,o),p.length>0&&this._watcher.chatroom({updatedEntries:p})),[2,{code:u,data:c}]):[2,{code:u}]):[2,{code:exports.ErrorCode.RC_CHATROOM_NOT_EXIST}]}}))}))},n.prototype._startSyncIntervalForChrmPull=function(){var e=this;this._stopSyncIntervalForChrmPull(),this._intervalTimerForChrmPull=setInterval((function(){var t=Object.keys(e._chrmsQueue);0!==t.length&&e._isConnected?t.forEach((function(t){e._pullChrmMsg(t),e.getNaviInfoFromCache().kvStorage&&e._chrmEntryHandler.pullEntry(t,0)})):e._stopSyncIntervalForChrmPull()}),18e4)},n.prototype._stopSyncIntervalForChrmPull=function(){"number"!=typeof this._intervalTimerForChrmPull&&(clearInterval(this._intervalTimerForChrmPull),this._intervalTimerForChrmPull=-1)},n.prototype.removeChatroomFromCatch=function(e){var t;null===(t=this._joinedChrmManager)||void 0===t||t.remove(e)},n.prototype._writeMessagesLog=function(e,t){var n,r=null===(n=this.cloudController)||void 0===n?void 0:n.getMRTRConfig();if(!r)return!1;var o=function(e){if(!e)return Math.floor(4294967296*Math.random());var t=0;if(0===e.length)return t;for(var n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t)}(t),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&&o%(1/i)==0},n.prototype.sendMessage=function(e,t,n,r,o){var i;return ue(this,void 0,void 0,(function(){var s,a,u,c,l,d,p,h,_,g,f,E;return ce(this,(function(I){switch(I.label){case 0:return n=this._handleInnerMsgOptions(e,t,n),n=this._handleMsgProperties(n,!0),s=!1,[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP].includes(e)&&(n.isStatusMessage||(null===(i=this._customMessageType[n.messageType])||void 0===i?void 0:i.isStatusMessage))&&(s=!0),a=s?function(e){var t;return(t={},t[exports.ConversationType.PRIVATE]=as.ppMsgS,t[exports.ConversationType.GROUP]=as.pgMsgS,t)[e]}(e):function(e){var t;return(t={},t[exports.ConversationType.PRIVATE]=as.ppMsgP,t[exports.ConversationType.GROUP]=as.pgMsgP,t[exports.ConversationType.CHATROOM]=as.chatMsg,t[exports.ConversationType.CUSTOMER_SERVICE]=as.pcMsgP,t[exports.ConversationType.RTC_ROOM]=as.prMsgS,t[exports.ConversationType.SYSTEM]=as.pbMsgP,t)[e]}(e)||as.ppMsgP,s&&(n.isPersited=!1,n.isCounted=!1),u=n.messageId?n.messageId:Jt(),n.messageId=u,c=this._connMgr.codec.encodeUpMsg({conversationType:e,targetId:t},n),(l=new Ba(as[a],c,e===exports.ConversationType.SYSTEM?this.currentUserId:t)).setHeaderQos(ps.AT_LEAST_ONCE),s?(this._connMgr.sendOnly(l),[2,{code:exports.ErrorCode.SUCCESS,data:uh(e,t,se({},n),"",0,this.currentUserId,u)}]):(d=this._connMgr.getCrtServerTime(),p=uh(e,t,se(se({},n),{isStatusMessage:s}),"",d,this.currentUserId,u),null==r||r(u),this.logger.info(exports.LogTagId.L_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:e,targetId:t,channelId:n.channelId}),o),h=Date.now(),[4,this._connMgr.send(l)]);case 1:return _=I.sent(),g=_.code,f=_.data,g!==exports.ErrorCode.SUCCESS?(this.logger.warn(exports.LogTagId.L_SEND_MSG_R,JSON.stringify({code:g,messageUId:p.messageUId,messageId:p.messageId}),o),this._writeMessagesLog(e)&&this.logger.record(re.IM_MSG_SEND,JSON.stringify({channel:e,start_ts:h,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:g})),p.sentStatus=exports.SentStatus.FAILED,[2,{code:g,data:p}]):(this.logger.info(exports.LogTagId.L_SEND_MSG_R,JSON.stringify({code:g,messageUId:null==f?void 0:f.messageUId,messageId:null==f?void 0:f.messageId}),o),E=f,this._sendMessageSuccessHandle(p,E),this._writeMessagesLog(e,E.messageUId)&&this.logger.record(re.IM_MSG_SEND,JSON.stringify({msg_id:E.messageUId,channel:e,start_ts:h,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:g})),[2,{code:exports.ErrorCode.SUCCESS,data:p}])}}))}))},n.prototype._sendMessageSuccessHandle=function(e,t){var n,r=this;this._sendMessageStore.setMessage(t.messageUId,t.timestamp),e.sentTime=t.timestamp,e.messageUId=t.messageUId,this._conversationManager.setConversationCacheByMessage(e,!0);var o=e.messageType,i=e.conversationType,s=e.targetId,a=e.channelId,u=e.sentTime,c=e.content,l=e.messageDirection;if(o===exports.MessageType.READ_RECEIPT_REQUEST){var d=c.messageUId;null===(n=this._readReceiptManager)||void 0===n||n.insert({conversationType:i,targetId:s,channelId:a},d,l,u)}if(o===exports.MessageType.READ_RECEIPT_RESPONSE){var p=c.receiptMessageDic;if(!p)return;for(var h in p)p[h].forEach((function(e){var t;null===(t=r._readReceiptManager)||void 0===t||t.remove({conversationType:i,targetId:s,channelId:a},e)}))}},n.prototype.recallMsg=function(e,t){var n;return ue(this,void 0,void 0,(function(){var r,o,i,s,a,u,c,l,d,p,h,_,g,f,E,I,T,v;return ce(this,(function(C){switch(C.label){case 0:return r=e.targetId,o=e.conversationType,i=e.channelId||"",s=t.user,a=t.extra,u=t.isDelete,c=t.directionalUserIdList,l=t.disableUpdateLastMessage,d=t.messageUId,p=t.sentTime,h={conversationType:o,targetId:r,messageUId:d,sentTime:p,channelId:i,isDelete:u||!1,isAdmin:t.isAdmin},s&&(h.user=s),a&&(h.extra=a),_={content:h,messageType:"RC:RcCmd",disableNotification:null==t?void 0:t.disableNotification,pushConfig:null==t?void 0:t.pushConfig,pushContent:(null===(n=t.pushConfig)||void 0===n?void 0:n.pushContent)||t.pushContent||"",channelId:i,disableUpdateLastMessage:l},[exports.ConversationType.GROUP,exports.ConversationType.ULTRA_GROUP].includes(o)&&c&&(_.directionalUserIdList=c),g=this._connMgr.codec.encodeUpMsg({conversationType:o,targetId:r},_),(f=new Ba(as.recallMsg,g,this.currentUserId)).setHeaderQos(ps.AT_LEAST_ONCE),[4,this._connMgr.send(f)];case 1:return(E=C.sent()).isOk?(I=E.data,o!==exports.ConversationType.ULTRA_GROUP&&(T="Cmd:".concat(d),I.messageUId=T),v=uh(o,r,se(se({},_),{isPersited:!0}),I.messageUId,I.timestamp,this.currentUserId),o===exports.ConversationType.ULTRA_GROUP?(this._ultraMsgMap[I.messageUId]=I.timestamp,this._updateUltraGroupWhenRecallMsg(r,i,d)):(this._sendMessageStore.setMessage(I.messageUId,I.timestamp),this._conversationManager.setConversationCacheByMessage(v,!0)),[2,it(v)]):[2,E.wipe()]}}))}))},n.prototype.sendReadReceiptMessage=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o;return ce(this,(function(i){return this._isConnected?(r=this._connMgr.codec.encodeReadReceipt(t,n),o=new Fa(as[as.rrMsg],r,e),[2,this._connMgr.send(o)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))},n.prototype.getMessageReader=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o;return ce(this,(function(i){return this._isConnected?(r=this._connMgr.codec.encodeMessageReader(t,n),o=new Fa(as[as.rrList],r,e),[2,this._connMgr.send(o,Oo)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))},n.prototype.sendReadReceiptMessageV4=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o;return ce(this,(function(i){return r=this._connMgr.codec.encodeReadReceiptMsg(e,t,n),o=new Ba(as[as.sendMsgRead],r,e.targetId),[2,this._connMgr.send(o)]}))}))},n.prototype.getMessageReadReceiptV4=function(e,t){return ue(this,void 0,void 0,(function(){var n,r;return ce(this,(function(o){return n=this._connMgr.codec.encodeReceiptQryReq(e,t),r=new Fa(as[as.qryMsgRead],n,e.targetId),[2,this._connMgr.send(r,Xo)]}))}))},n.prototype.batchGetMessageReadReceiptInfoV4=function(e,t){return ue(this,void 0,void 0,(function(){var n,r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return n=this._connMgr.codec.encodeReceiptCntQryReq(e,t),r=new Fa(as[as.qryMsgReadCntBatch],n,e.targetId),[4,this._connMgr.send(r,ei)];case 1:return o=u.sent(),i=o.code,s=o.data,a=(s||{result:[]}).result,i===exports.ErrorCode.SUCCESS&&a?[2,{code:i,data:a.map((function(t){return se({messageUId:t.msgId,readedCount:t.cnt,totalCount:t.tmn},e)}))}]:[2,{code:i}]}}))}))},n.prototype.updateConversationReadTime=function(e,t){return ue(this,void 0,void 0,(function(){var n,r;return ce(this,(function(o){return n=this._connMgr.codec.encodeSessionMsgReadInput(e,t),r=new Ba(as[as.updRTime],n,this.currentUserId),[2,this._connMgr.send(r)]}))}))},n.prototype.pullUserSettings=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s;return ce(this,(function(a){switch(a.label){case 0:return this._isConnected?(t=this.getNaviInfoFromCache(),n=Xi.encode(_o,{version:e,ipType:t.ipType||0}),r=new Fa(as.pullUS,n,this.currentUserId),[4,this._connMgr.send(r,go)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return o=a.sent(),i=o.code,s=o.data,i===exports.ErrorCode.SUCCESS&&this._naviChangeHandler(s),[2,{code:i,data:s}]}}))}))},n.prototype._naviChangeHandler=function(e){var t;if(e){var n=e.settings,r=null===(t=null==n?void 0:n.VoipInfo)||void 0===t?void 0:t.value;if(r){var o=this._connMgr.getToken();this.navi.updateVoipCallInfo(o,r);var i=this.navi.getNaviInfoFromCache(o);this._watcher.onNaviDataChange(se({},i))}}else this.logger.warn(exports.LogTagId.L_NOTIFY_NAVI_CHANGE_E,JSON.stringify({data:e}))},n.prototype.getFileToken=function(e,t,n,r,o,i){return ue(this,void 0,void 0,(function(){var s,a,u,c,l;return ce(this,(function(d){switch(d.label){case 0:return this._isConnected?(s=r&&"uploads"!==r?t||"":Qt(e,t),a=this.getNaviInfoFromCache(),u=nn(a,this.logger),c="",u||(c=JSON.stringify({uploadDomain:u})),l=Xi.encode(Pr,{type:e,key:s,httpMethod:n||"",queryString:r||"",url:o||"",ext:c,size:i?Math.ceil(i):0,ipType:a.ipType||0}),[4,this._connMgr.query(as.qnTkn,this.currentUserId,l,xr)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return[2,d.sent().trans((function(e){return se(se({},e),{fileName:s,downloadAuthInfo:e.downloadAuthInfo?JSON.parse(e.downloadAuthInfo):null})}))]}}))}))},n.prototype.getFileUrl=function(e,t,n,r){return ue(this,void 0,void 0,(function(){var o,i,s,a,u;return ce(this,(function(c){switch(c.label){case 0:return this._isConnected?(o=this.getNaviInfoFromCache(),s="",a="",t===exports.UploadMethod.QINIU?i=as.qnUrl:t===exports.UploadMethod.AWS?i=as.s3Url:t===exports.UploadMethod.STC?i=as.stcUrl:t===exports.UploadMethod.MINIO?(i=as.minioUrl,s=nn(o,this.logger),a=JSON.stringify({url:s})):i=as.aliUrl,u=Xi.encode(wr,{type:e,key:n,fileName:r,ext:a,size:-1,ipType:o.ipType||0}),[4,this._connMgr.query(i,this.currentUserId,u,Dr)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return[2,c.sent().trans((function(e){return{downloadUrl:e.downloadUrl}}))]}}))}))},n.prototype.disconnect=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){switch(n.label){case 0:return this.reporter.stop(),this.reporterStatistic.stop(),[4,this._connMgr.disconnect(e,t)];case 1:return n.sent(),this._resetMemoryState(),[2]}}))}))},n.prototype._resetMemoryState=function(){-1!==this._reconnectTimer&&(clearTimeout(this._reconnectTimer),this._reconnectTimer=-1),this._pullQueue.length=0,this._stopSyncInterval(),this.resetUltraGroupData(),this._joinedChrmManager&&(this._joinedChrmManager.clear(),delete this._joinedChrmManager),this._conversationManager&&delete this._conversationManager,this._ultraGroupManager&&delete this._ultraGroupManager,this._userSettingManager&&delete this._userSettingManager,this._readReceiptManager&&delete this._readReceiptManager,this._subscribeManager&&delete this._subscribeManager,this._chrmsQueue={}},n.prototype.resetUltraGroupData=function(){this._stopUltraSyncInterval(),this._lastSyncUltraMsgTimeStamp=0,this._lastSyncUltraMsgLocalTimeStamp=0,this._isUltraPulling=!1,this._ultraGroupTimeQue=[],this._isUltraGroupListExist=!1,this._ultraGroupMap={}},n.prototype.registerMessageType=function(e,t,n,r,o){this._customMessageType[e]={isPersited:t,isCounted:n,isStatusMessage:o}},n.prototype.getServerTime=function(){return this._connMgr.getCrtServerTime()},n.prototype.getCurrentUserId=function(){return this.currentUserId},n.prototype.createTag=function(e){return ue(this,void 0,void 0,(function(){var t=this;return ce(this,(function(n){return this._isConnected?[2,this._userSettingManager.pushTask((function(n){return ue(t,void 0,void 0,(function(){var t,r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return t=this._connMgr.codec.encodeCreateTag([e],n),r=new Fa(as[as.addSeTag],t,this.currentUserId),[4,this._connMgr.send(r,ho)];case 1:return o=u.sent(),i=o.code,s=o.data,i===exports.ErrorCode.SUCCESS&&s&&(a=s.version,this._userSettingManager.addTag([se(se({},e),{createdTime:a})],a)),[2,{code:i}]}}))}))}))]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))},n.prototype.removeTag=function(e){return ue(this,void 0,void 0,(function(){var t=this;return ce(this,(function(n){return this._isConnected?[2,this._userSettingManager.pushTask((function(n){return ue(t,void 0,void 0,(function(){var t,r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return t=this._connMgr.codec.encodeRemoveTag([e],n),r=new Fa(as[as.delSeTag],t,this.currentUserId),[4,this._connMgr.send(r,ho)];case 1:return o=u.sent(),i=o.code,s=o.data,i===exports.ErrorCode.SUCCESS&&s&&(a=s.version,this._userSettingManager.deleteTag([e],a)),[2,{code:i}]}}))}))}))]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))},n.prototype.updateTag=function(e){return ue(this,void 0,void 0,(function(){var t=this;return ce(this,(function(n){return this._isConnected?[2,this._userSettingManager.pushTask((function(n){return ue(t,void 0,void 0,(function(){var t,r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return t=this._connMgr.codec.encodeCreateTag([e],n),r=new Fa(as[as.addSeTag],t,this.currentUserId),[4,this._connMgr.send(r,ho)];case 1:return o=u.sent(),i=o.code,s=o.data,i===exports.ErrorCode.SUCCESS&&(a=s.version,this._userSettingManager.addTag([e],a)),[2,{code:i}]}}))}))}))]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))},n.prototype.getTagList=function(){return ue(this,void 0,void 0,(function(){var e,t;return ce(this,(function(n){return e=this._userSettingManager.getTags(),t=this._conversationManager.getConversationListForTag(),e.forEach((function(e){e.conversationCount=t[e.tagId]?t[e.tagId].length:0})),[2,{code:exports.ErrorCode.SUCCESS,data:e}]}))}))},n.prototype.addTagForConversations=function(e,t){return ue(this,void 0,void 0,(function(){var n=this;return ce(this,(function(r){return this._isConnected?[2,this._conversationManager.pushTask((function(r){return ue(n,void 0,void 0,(function(){var n,o,i,s,a,u,c=this;return ce(this,(function(l){switch(l.label){case 0:return this._userSettingManager.getTagById(e)?(n=this._connMgr.codec.encodeUpdateConversationTag([{tagId:e}],t,r),o=new Fa(as[as.addTag],n,this.currentUserId),[4,this._connMgr.send(o,mo)]):[2,{code:exports.ErrorCode.TAG_NOT_EXIST}];case 1:return i=l.sent(),s=i.code,a=i.data,s===exports.ErrorCode.SUCCESS&&a&&((u={})[e]={},t.forEach((function(e){c._conversationManager.addTagStatus(e.conversationType,e.targetId,u,e.channelId)})),this._conversationManager.setConversationUpdatedTime(a.version)),[2,{code:s}]}}))}))}))]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))},n.prototype.removeTagForConversations=function(e,t){return ue(this,void 0,void 0,(function(){var n=this;return ce(this,(function(r){return this._isConnected?[2,this._conversationManager.pushTask((function(r){return ue(n,void 0,void 0,(function(){var n,o,i,s,a,u=this;return ce(this,(function(c){switch(c.label){case 0:return n=this._connMgr.codec.encodeUpdateConversationTag([{tagId:e}],t,r),o=new Fa(as[as.delTag],n,this.currentUserId),[4,this._connMgr.send(o,mo)];case 1:return i=c.sent(),s=i.code,a=i.data,s===exports.ErrorCode.SUCCESS&&a&&(t.forEach((function(t){u._conversationManager.deleteTagStatus(t.conversationType,t.targetId,[e],t.channelId)})),this._conversationManager.setConversationUpdatedTime(a.version)),[2,{code:s}]}}))}))}))]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))},n.prototype.removeTagsForConversation=function(e,t){return ue(this,void 0,void 0,(function(){var n=this;return ce(this,(function(r){return this._isConnected?[2,this._conversationManager.pushTask((function(r){return ue(n,void 0,void 0,(function(){var n,o,i,s,a,u,c,l,d;return ce(this,(function(p){switch(p.label){case 0:return n=e.conversationType,o=e.targetId,i=e.channelId,s=t.map((function(e){return{tagId:e}})),a=this._connMgr.codec.encodeUpdateConversationTag(s,[e],r),u=new Fa(as[as.delTag],a,this.currentUserId),[4,this._connMgr.send(u,mo)];case 1:return c=p.sent(),l=c.code,d=c.data,l===exports.ErrorCode.SUCCESS&&d&&(this._conversationManager.deleteTagStatus(n,o,t,i),this._conversationManager.setConversationUpdatedTime(d.version)),[2,{code:l}]}}))}))}))]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))},n.prototype.getConversationListByTag=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o,i,s,a,u,c,l,d;return ce(this,(function(p){switch(p.label){case 0:return this._isConnected?(o=(r=this).currentUserId,i=r._connMgr,s=i.codec.encodeOldConversationList({count:n,type:exports.ConversationType.PRIVATE,startTime:t}),a=new Fa(as.qryRelationR,s,o),[4,i.send(a,Hr,{currentUserId:o,connectedTime:i.getConnectedTime()})]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return u=p.sent(),c=u.code,l=u.data,c!==exports.ErrorCode.SUCCESS?[2,{code:c}]:(d=this._conversationHasTagFilter(e,null==l?void 0:l.list),[2,{code:c,data:d}])}}))}))},n.prototype._conversationHasTagFilter=function(e,t){var n=this,r=[],o=[];function i(e,t){return e.latestMessage&&t.latestMessage?e.latestMessage.sentTime-t.latestMessage.sentTime:0}return t.forEach((function(t){var i=t.conversationType,s=t.targetId,a=t.channelId,u=n._conversationManager.get(i,s,a),c=u.hasMentioned,l=u.mentionedInfo,d=u.lastUnreadTime,p=u.notificationStatus,h=u.isTop,_=u.tags,g=u.unreadMessageCount,f=_&&_[e];if(f){var E=se(se({},t),{hasMentioned:c,mentionedInfo:l,lastUnreadTime:d,notificationStatus:p,isTop:h,unreadMessageCount:g});f.isTop?r.push(se(se({},E),{isTopInTag:!0})):o.push(se(se({},E),{isTopInTag:!1}))}})),r.sort(i),o.sort(i),pe(pe([],de(r),!1),de(o),!1)},n.prototype.getUnreadCountByTag=function(e,t){return ue(this,void 0,void 0,(function(){var n;return ce(this,(function(r){return this._isConnected?(n=this._conversationManager.getUnreadCountByTag(e,t),[2,{code:exports.ErrorCode.SUCCESS,data:n}]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))},n.prototype.setConversationStatusInTag=function(e,t,n){return ue(this,void 0,void 0,(function(){var r=this;return ce(this,(function(o){return this._isConnected?[2,this._conversationManager.pushTask((function(o){return ue(r,void 0,void 0,(function(){var r,i,s,a,u,c,l,d,p,h,_,g;return ce(this,(function(f){switch(f.label){case 0:return r=t.targetId,i=t.conversationType,s=t.channelId,a=n.isTop,u=[{tagId:e,isTop:a}],(c=this._conversationManager.get(i,r,s)).tags&&Object.hasOwnProperty.call(c.tags,e)?(l=this._connMgr.codec.encodeUpdateConversationTag(u,[t],o),d=new Fa(as[as.addTag],l,this.currentUserId),[4,this._connMgr.send(d,mo)]):[2,{code:exports.ErrorCode.NO_TAG_IN_CONVER}];case 1:return p=f.sent(),h=p.code,_=p.data,h===exports.ErrorCode.SUCCESS&&_&&((g={})[e]={},a&&(g[e].isTop=!0),this._conversationManager.addTagStatus(i,r,g,s),this._conversationManager.setConversationUpdatedTime(_.version)),[2,{code:h}]}}))}))}))]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))},n.prototype.getTagsForConversation=function(e){var t;return ue(this,void 0,void 0,(function(){var n,r,o,i;return ce(this,(function(s){if(!this._isConnected)return[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];if(n=this._conversationManager.get(e.conversationType,e.targetId,e.channelId),r=this._userSettingManager.getTagsInfo(),o=[],n.tags)for(i in n.tags)o.push({tagId:i,tagName:null===(t=r[i])||void 0===t?void 0:t.tagName});return[2,{code:exports.ErrorCode.SUCCESS,data:o}]}))}))},n.prototype.getBlockConversationList=function(){var e=this._conversationManager.getBlockConversationList();return Promise.resolve({code:exports.ErrorCode.SUCCESS,data:e})},n.prototype.getTopConversationList=function(e,t){var n=this._conversationManager.getTopConversationList(e,t);return Promise.resolve({code:exports.ErrorCode.SUCCESS,data:n})},n.prototype.getUnreadConversationList=function(e){return ue(this,void 0,void 0,(function(){var t;return ce(this,(function(n){return t=this._conversationManager.getUnreadConversationList(e),[2,Promise.resolve({code:exports.ErrorCode.SUCCESS,data:t})]}))}))},n.prototype.getUnreadMentionedCount=function(e){var t,n;return n=e.conversationType===exports.ConversationType.ULTRA_GROUP?(null===(t=this._ultraGroupMap["".concat(e.channelId,"_").concat(e.targetId)])||void 0===t?void 0:t.unreadMentionedCount)||0:this._conversationManager.getUnreadMentionedCount(e.conversationType,e.targetId,e.channelId),n=this._getUnreadCount(n),Promise.resolve({code:exports.ErrorCode.SUCCESS,data:n})},n.prototype.getAllUnreadMentionedCount=function(){var e=this._conversationManager.getAllUnreadMentionedCount();return Promise.resolve({code:exports.ErrorCode.SUCCESS,data:e})},n.prototype.getConversationNotificationLevel=function(e,t,n){if(!this._isUltraGroupListExist&&e===exports.ConversationType.ULTRA_GROUP)return Promise.resolve({code:exports.ErrorCode.METHOD_NOT_AVAILABLE});var r;if(!(r=e===exports.ConversationType.ULTRA_GROUP?this._ultraGroupManager.get(exports.ConversationType.ULTRA_GROUP,t,n):this._conversationManager.get(e,t,n)))return Promise.resolve({code:exports.ErrorCode.SUCCESS,data:exports.NotificationLevel.NOT_SET});var o=r.notificationLevel;return Et(r.notificationLevel)&&!Et(r.notificationStatus)&&(o=exports.NotificationStatus.OPEN===r.notificationStatus?1:0),Promise.resolve({code:exports.ErrorCode.SUCCESS,data:o})},n.prototype.getConversationNotificationStatus=function(e,t,n){var r;return(r=e===exports.ConversationType.ULTRA_GROUP?this._ultraGroupManager.get(exports.ConversationType.ULTRA_GROUP,t,n):this._conversationManager.get(e,t,n))?Promise.resolve({code:exports.ErrorCode.SUCCESS,data:Ne(r.notificationLevel||exports.NotificationLevel.NOT_SET)}):Promise.resolve({code:exports.ErrorCode.SUCCESS,data:exports.NotificationStatus.CLOSE})},n.prototype.setConversationTypeNotificationLevel=function(e,t){return ue(this,void 0,void 0,(function(){var n,r,o,i,s=this;return ce(this,(function(a){switch(a.label){case 0:return this._isConnected?(r=(n=this).currentUserId,o=n._connMgr,i=this._conversationManager.getConversationUpdatedTime(),[4,o.query(as.setTypeUnpush,r,Xi.encode(So,{type:e,unpushLevel:t,version:i}),Ao)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return[2,a.sent().trans((function(n){var r,o=n.version;s._conversationManager.setConversationUpdatedTime(o),e===exports.ConversationType.ULTRA_GROUP?null===(r=s._ultraGroupManager)||void 0===r||r.addUltraGroupStatus({conversationType:e,targetId:"",notificationLevel:t,channelId:""}):s._conversationManager.addStatus({conversationType:e,targetId:"",channelId:"",updatedTime:o,notificationLevel:t},!0)}))]}}))}))},n.prototype.getConversationTypeNotificationLevel=function(e){if(e===exports.ConversationType.ULTRA_GROUP){var t=this._ultraGroupManager.get(e,"","");return Promise.resolve({code:exports.ErrorCode.SUCCESS,data:t.notificationLevel||0})}var n=this._conversationManager.get(e,"","");return Promise.resolve({code:exports.ErrorCode.SUCCESS,data:n.notificationLevel||0})},n.prototype.getRemoteHistoryMessages=function(e,t,n,r,o,i){return this.getHistoryMessage(e,t,n,r,o,i)},n.prototype.getUltraGroupList=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i=this;return ce(this,(function(s){return t=e.targetId,n=e.channelType,this._isUltraGroupListExist?(r=(r=Object.values(this._ultraGroupMap).filter((function(e){return!(e.targetId!==t&&t||e.channelType!==n&&dt(n))}))).map((function(e){var t=e.unreadMessageCount,n=e.unreadMentionedCount,r=e.unreadMentionedMeCount;return t=i._getUnreadCount(t),n=i._getUnreadCount(n),r=i._getUnreadCount(r),se(se({},e),{unreadMessageCount:t,unreadMentionedCount:n,unreadMentionedMeCount:r})})),r=ch(r),o=Lt(r),[2,{code:exports.ErrorCode.SUCCESS,data:o}]):[2,{code:exports.ErrorCode.METHOD_NOT_AVAILABLE}]}))}))},n.prototype._getUnreadCount=function(e){return e>999?999:e},n.prototype.getBlockUltraGroupList=function(){if(!this._isUltraGroupListExist)return Promise.resolve({code:exports.ErrorCode.METHOD_NOT_AVAILABLE});var e=Object.values(this._ultraGroupMap),t=[];return e.forEach((function(e){(e.notificationStatus===exports.NotificationStatus.OPEN||e.notificationLevel>0)&&t.push({conversationType:exports.ConversationType.ULTRA_GROUP,targetId:e.targetId,channelId:e.channelId})})),Promise.resolve({code:exports.ErrorCode.SUCCESS,data:t})},n.prototype.getTopUltraGroupList=function(){if(!this._isUltraGroupListExist)return Promise.resolve({code:exports.ErrorCode.METHOD_NOT_AVAILABLE});var e=Object.values(this._ultraGroupMap),t=[];return e.forEach((function(e){!0===e.isTop&&t.push({conversationType:exports.ConversationType.ULTRA_GROUP,targetId:e.targetId,channelId:e.channelId})})),Promise.resolve({code:exports.ErrorCode.SUCCESS,data:t})},n.prototype.getUltraGroupUnreadMentionedCountByTargetId=function(e,t){if(!this._isUltraGroupListExist)return Promise.resolve({code:exports.ErrorCode.METHOD_NOT_AVAILABLE});var n=0;for(var r in this._ultraGroupMap){r.match(/_.*/g)[0].substring(1)!==e||t&&0!==t.length&&!t.includes(this._ultraGroupMap[r].notificationLevel)||(n+=this._ultraGroupMap[r].unreadMentionedCount)}return n=this._getUnreadCount(n),Promise.resolve({code:exports.ErrorCode.SUCCESS,data:n})},n.prototype.getUltraGroupUnreadCountByTargetId=function(e,t){var n=0;for(var r in this._ultraGroupMap){var o=this._ultraGroupMap[r];o.targetId!==e||t&&0!==t.length&&!t.includes(this._ultraGroupMap[r].notificationLevel)||(n+=o.unreadMessageCount||0)}return n=this._getUnreadCount(n),Promise.resolve({code:exports.ErrorCode.SUCCESS,data:n})},n.prototype.getUltraGroupUnreadInfoList=function(e){var t=this;if(!this._isUltraGroupListExist)return Promise.resolve({code:exports.ErrorCode.METHOD_NOT_AVAILABLE});var n=[];return Object.keys(this._ultraGroupMap).forEach((function(r){var o=t._ultraGroupMap[r];e.includes(o.targetId)&&n.push({type:o.conversationType,targetId:o.targetId,channelId:o.channelId,unreadMessageCount:t._getUnreadCount(o.unreadMessageCount),mentionedCount:t._getUnreadCount(o.unreadMentionedCount),mentionedMeCount:t._getUnreadCount(o.unreadMentionedMeCount),notificationLevel:o.notificationLevel})})),Promise.resolve({code:exports.ErrorCode.SUCCESS,data:n})},n.prototype.getAllUltraGroupUnreadCount=function(e){if(void 0===e&&(e=!1),!this._isUltraGroupListExist)return Promise.resolve({code:exports.ErrorCode.METHOD_NOT_AVAILABLE});var t=0;for(var n in this._ultraGroupMap)t+=e?this._ultraGroupMap[n].unreadMentionedCount||0:this._ultraGroupMap[n].unreadMessageCount||0;return t=this._getUnreadCount(t),Promise.resolve({code:exports.ErrorCode.SUCCESS,data:t})},n.prototype.clearUltraUnreadcount=function(e,t){return void 0===t&&(t=""),ue(this,void 0,void 0,(function(){var n,r,o,i,s;return ce(this,(function(a){switch(a.label){case 0:return this._isUltraGroupListExist?this._isConnected?(n=this.getServerTime(),r=this._connMgr.codec.encodeClearUnreadCount({conversationType:exports.ConversationType.ULTRA_GROUP,targetId:e,channelId:t},{timestamp:n}),(o=new Ba(as[as.updUgRTime],r,this.currentUserId)).setHeaderQos(ps.AT_LEAST_ONCE),[4,this._connMgr.send(o)]):[2,exports.ErrorCode.RC_NET_UNAVAILABLE]:[2,Promise.resolve(exports.ErrorCode.METHOD_NOT_AVAILABLE)];case 1:return(i=a.sent().code)===exports.ErrorCode.SUCCESS&&((s=this._ultraGroupMap["".concat(t,"_").concat(e)])&&(s.unreadMessageCount=0,s.unreadMentionedCount=0,s.unreadMentionedMeCount=0,s.lastReadTime=n),s&&s.firstUnreadMessage&&(s.firstUnreadMessage=null)),[2,i]}}))}))},n.prototype._getUltraGroupList=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a,u,c,l,d,p,h,_=this;return ce(this,(function(g){switch(g.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodeUltraGroup(e,false),n=new Fa(as[as.pullUgSes],t,this.currentUserId),[4,this._connMgr.send(n,Hr,{currentUserId:this.currentUserId,conversationType:exports.ConversationType.ULTRA_GROUP})]):[2];case 1:return r=g.sent(),o=r.code,i=r.data,o===exports.ErrorCode.SUCCESS&&i?(a=i.list,u=i.isFinished,a.forEach((function(e){e.notificationStatus=exports.NotificationStatus.CLOSE,e.notificationLevel=exports.NotificationLevel.NOT_SET,e.isTop=!1,_._ultraGroupMap["".concat(e.channelId,"_").concat(e.targetId)]=e,_._ultraGroupManager.addUltraGroupStatus(e)})),!1!==u?[3,2]:(c=a.length>0&&a[a.length-1].versionTime||0,this._getUltraGroupList(c),[3,4])):(this.logger.warn(exports.LogTagId.L_ULTRA_SYNC_DONE_S,"Pull ultra group conversation failured, code: ".concat(o,", try again")),s=setTimeout((function(){_._getUltraGroupList(e),clearTimeout(s)}),3e3),[2]);case 2:return this.logger.info(exports.LogTagId.L_ULTRA_SYNC_DONE_S,"Pull ultra group conversation success"),[4,this.pullConversationStatus(0)];case 3:l=g.sent(),d=l.code,p=l.data,d!==exports.ErrorCode.SUCCESS&&this.logger.warn(exports.LogTagId.O,"pullConversationStatus fail code: ".concat(d,", data: ").concat(p)),h=Object.values(this._ultraGroupMap),h=ch(h),this._isUltraGroupListExist=!0,this._watcher.ultraGroupEnable(Lt(h)),this._syncUltraMsg(this._lastSyncUltraMsgTimeStamp),g.label=4;case 4:return[2]}}))}))},n.prototype._startUltraSyncInterval=function(){var e=this,t=function(){e._ultraGroupTimer=setTimeout((function(){Date.now()-e._lastSyncUltraMsgLocalTimeStamp>=18e4&&e._syncUltraMsg(e._lastSyncUltraMsgTimeStamp),e._stopUltraSyncInterval(),t()}),3e4)};this._lastSyncUltraMsgLocalTimeStamp=Date.now(),t()},n.prototype._stopUltraSyncInterval=function(){-1!==this._ultraGroupTimer&&(clearTimeout(this._ultraGroupTimer),this._ultraGroupTimer=-1)},n.prototype._notificationOnline=function(){return ue(this,void 0,void 0,(function(){var e,t,n,r=this;return ce(this,(function(o){switch(o.label){case 0:return this._isConnected?[4,this._fetchUltraMsg(0)]:[2];case 1:return e=o.sent(),t=e.code,n=e.data,t===exports.ErrorCode.SUCCESS&&n?(this.logger.info(exports.LogTagId.L_NOTIFY_ULTRA_ONLINE_S,"Notify ultra group online success."),this._getUltraGroupList(0),-1===this._ultraGroupTimer&&this._startUltraSyncInterval(),[2]):(this.logger.warn(exports.LogTagId.L_NOTIFY_ULTRA_ONLINE_S,"Notify ultra group online failured, try again."),setTimeout((function(){r._notificationOnline()}),3e3),[2])}}))}))},n.prototype._fetchUltraMsg=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a,u,c;return ce(this,(function(l){switch(l.label){case 0:return t=this._connMgr.codec.encodeSuperSyncMsg(e),n=new Fa(as[as.pullUgMsg],t,this.currentUserId),r=this.logger.createTraceId(),this.logger.info(exports.LogTagId.L_PULL_ULTRA_MSG_T,JSON.stringify({timestamp:e}),r),[4,this._connMgr.send(n,Ur,{currentUserId:this.currentUserId,conversation:{conversationType:exports.ConversationType.ULTRA_GROUP}})];case 1:return o=l.sent(),i=o.code,s=o.data,i===exports.ErrorCode.SUCCESS&&s?(a=s.list,u=s.syncTime,c=a.map((function(e){return e.messageUId})).join(","),this.logger.info(exports.LogTagId.L_PULL_ULTRA_MSG_R,JSON.stringify({code:i,messageUIds:c,timestamp:e,syncTime:u}),r)):this.logger.warn(exports.LogTagId.L_PULL_ULTRA_MSG_R,JSON.stringify({code:i,timestamp:e}),r),[2,{code:i,data:s}]}}))}))},n.prototype._getUltraGroup=function(e,t,n){var r,o,i,s=e.targetId,a=e.messageType,u=e.channelId,c=e.isCounted,l=e.channelType,d=e.sentTime,p=e.senderUserId,h=e.content,_=e.isMentioned,g=this._ultraGroupMap["".concat(u,"_").concat(s)],f=g||{conversationType:exports.ConversationType.ULTRA_GROUP,targetId:s,channelId:u,unreadMessageCount:0,unreadMentionedCount:0,unreadMentionedMeCount:0,notificationStatus:exports.NotificationStatus.CLOSE,notificationLevel:exports.NotificationLevel.NOT_SET,isTop:!1};return c&&p!==this.currentUserId&&a!==exports.MessageType.RECALL&&(f.unreadMessageCount+=1,f.unreadMentionedCount+=t,f.firstUnreadMessage||(f.firstUnreadMessage={sentTime:d}),_&&(null===(r=null==h?void 0:h.mentionedInfo)||void 0===r?void 0:r.type)!==exports.MentionedType.ALL&&(null===(i=null===(o=null==h?void 0:h.mentionedInfo)||void 0===o?void 0:o.userIdList)||void 0===i?void 0:i.includes(this.currentUserId))&&(f.unreadMentionedMeCount+=1)),f.versionTime=n,f.latestMessage=e,f.channelType=l,g||(this._ultraGroupMap["".concat(u,"_").concat(s)]=f),f},n.prototype._syncUltraMsg=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a,u,c,l=this;return ce(this,(function(d){switch(d.label){case 0:return!this._isConnected||this._isUltraPulling?[2]:(this._isUltraPulling=!0,[4,this._fetchUltraMsg(e)]);case 1:return t=d.sent(),n=t.code,r=t.data,this._lastSyncUltraMsgLocalTimeStamp=Date.now(),this._isUltraPulling=!1,n===exports.ErrorCode.SUCCESS&&r?(o=r.list,i=r.syncTime,s=r.finished,a={},u=[],o.forEach((function(e){var t,n,r,o=e.targetId,s=e.content,c=e.messageUId,d=e.channelId,p=e.isMentioned;if(l._ultraMsgMap[c])delete l._ultraMsgMap[c];else{var h=0;p&&((null===(t=null==s?void 0:s.mentionedInfo)||void 0===t?void 0:t.type)===exports.MentionedType.ALL||(null===(r=null===(n=null==s?void 0:s.mentionedInfo)||void 0===n?void 0:n.userIdList)||void 0===r?void 0:r.includes(l.currentUserId)))&&(h=1);var _=l._getUltraGroup(e,h,i);a["".concat(d,"_").concat(o)]=_,l._ultraGroupManager.addUltraGroupStatus(_),u.push(e)}})),Object.keys(a).length>0&&(this.logger.debug(exports.LogTagId.O,"notice ultragroups"),c=Object.values(a),c=ch(c),this._watcher.conversation(Lt(c))),this.logger.debug(exports.LogTagId.O,"notice ultragroup message"),this._batchMessage(u),this._ultraGroupTimeQue=this._ultraGroupTimeQue.filter((function(e){return e>i})),this._lastSyncUltraMsgTimeStamp=i,s?(this._ultraGroupTimeQue.length>0&&(this._ultraGroupTimeQue.length=0,this._syncUltraMsg(i)),[2]):(this._syncUltraMsg(i),[2])):[2]}}))}))},n.prototype.sendUltraMessage=function(e,t,n,r){return ue(this,void 0,void 0,(function(){var o,i,s,a,u,c,l,d,p,h,_,g;return ce(this,(function(f){switch(f.label){case 0:return this._isConnected?("RC:SRSMsg"===t.messageType&&this.logger.warn(exports.LogTagId.O,"ultra group -> direction message convert to message"),t=this._handleMsgProperties(t,!0),o=t.messageId?t.messageId:Jt(),t.messageId=o,i=this._connMgr.codec.encodeUpMsg({conversationType:exports.ConversationType.ULTRA_GROUP,targetId:e},t),(s=new Ba(as[as.ugMsg],i,e)).setHeaderQos(ps.AT_LEAST_ONCE),a=this._connMgr.getCrtServerTime(),u=uh(exports.ConversationType.ULTRA_GROUP,e,se({},t),"",a,this.currentUserId,o),n&&n(o),this.logger.info(exports.LogTagId.L_SEND_MSG_T,JSON.stringify({messageType:t.messageType,conversationType:exports.ConversationType.ULTRA_GROUP,targetId:e,channelId:t.channelId}),r),c=Date.now(),[4,this._connMgr.send(s)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return l=f.sent(),d=l.code,p=l.data,d!==exports.ErrorCode.SUCCESS?(this.logger.warn(exports.LogTagId.L_SEND_MSG_R,JSON.stringify({code:d,messageUId:u.messageUId,messageId:u.messageId}),r),this._writeMessagesLog(exports.ConversationType.ULTRA_GROUP)&&this.logger.record(re.IM_MSG_SEND,JSON.stringify({channel:exports.ConversationType.ULTRA_GROUP,start_ts:c,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:d})),u.sentStatus=exports.SentStatus.FAILED,[2,{code:d,data:u}]):(this.logger.info(exports.LogTagId.L_SEND_MSG_R,JSON.stringify({code:d,messageUId:null==p?void 0:p.messageUId,messageId:null==p?void 0:p.messageId}),r),h=p,this._writeMessagesLog(exports.ConversationType.ULTRA_GROUP,h.messageUId)&&this.logger.record(re.IM_MSG_SEND,JSON.stringify({msg_id:h.messageUId,channel:exports.ConversationType.ULTRA_GROUP,start_ts:c,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:d})),u.sentTime=h.timestamp,u.messageUId=h.messageUId,this._ultraMsgMap[h.messageUId]=h.timestamp,_=t.channelId||"",(g=this._ultraGroupMap["".concat(_,"_").concat(e)])?(g.latestMessage=u,dt(g.channelType)&&(u.channelType=g.channelType)):(g={conversationType:exports.ConversationType.ULTRA_GROUP,targetId:e,channelId:_,unreadMessageCount:0,unreadMentionedCount:0,versionTime:u.sentTime,latestMessage:u,notificationStatus:exports.NotificationStatus.CLOSE,notificationLevel:exports.NotificationLevel.NOT_SET,isTop:!1},this._ultraGroupMap["".concat(_,"_").concat(e)]=g,this._ultraGroupManager.addUltraGroupStatus(g)),this._watcher.conversation(Lt([g])),[2,{code:d,data:u}])}}))}))},n.prototype.sendUltraGroupTypingStatus=function(e,t){return ue(this,void 0,void 0,(function(){var n,r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return this._isConnected?(n=e.conversationType,r=e.channelId,o=e.targetId,i=this._connMgr.codec.encodeOperateStatus(o,n,r||"",t||0),(s=new Ba(as[as.operate],i,o)).setHeaderQos(ps.AT_LEAST_ONCE),[4,this._connMgr.send(s)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return(a=u.sent().code)!==exports.ErrorCode.SUCCESS?[2,{code:a,msg:exports.ErrorCode[a]}]:[2,{code:a}]}}))}))},n.prototype.getUltraGroupMessageListByMessageUId=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return this._isConnected?e.messages&&e.messages.length<1||e.messages&&e.messages.length>20?[2,{code:exports.ErrorCode.MSG_LIMIT_ERROR}]:(t={},e.messages.forEach((function(e){t[e.messageUId]=void 0})),n=this._connMgr.codec.encodeMsgQuery(e),(r=new Fa(as[as.qryMsg],n,this.currentUserId)).setHeaderQos(ps.AT_LEAST_ONCE),[4,this._connMgr.send(r,Ho,{connectedTime:this._connMgr.getConnectedTime(),currentUserId:this.currentUserId})]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return o=u.sent(),i=o.code,s=o.data,i!==exports.ErrorCode.SUCCESS?[2,{code:i,msg:exports.ErrorCode[i]}]:(a=(s||{}).list,Array.isArray(a)&&a.forEach((function(e){var n=e.messageUId;t[n]=e})),[2,{code:0,data:t}])}}))}))},n.prototype._pullOperateStatusNotify=function(e){if(this._isConnected){var t=this._connMgr.codec.decodeByPBName(e.pbData,Yo),n=t.conversationType,r=t.info,o=t.summary;this.logger.debug(exports.LogTagId.O,"s_opNtf -> type: ".concat(n,", info: ").concat(r,", summary: ").concat(o)),this._watcher.operateStatus(t)}},n.prototype.expandUltraMessage=function(e){return ue(this,void 0,void 0,(function(){var t,n,r;return ce(this,(function(o){switch(o.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodeExpandUltraMessage(e,this.currentUserId),(n=new Fa(as[as.upMsgEx],t,e.targetId)).setHeaderQos(ps.AT_LEAST_ONCE),[4,this._connMgr.send(n)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return(r=o.sent().code)!==exports.ErrorCode.SUCCESS?[2,{code:r,msg:exports.ErrorCode[r]}]:[2,{code:r}]}}))}))},n.prototype.modifyMessage=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s;return ce(this,(function(a){switch(a.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodemodifyMessage(e,this.currentUserId),(n=new Fa(as[as.modifyMsg],t,e.targetId)).setHeaderQos(ps.AT_LEAST_ONCE),[4,this._connMgr.send(n)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return r=a.sent(),o=r.code,i=r.data,o!==exports.ErrorCode.SUCCESS?[2,{code:o,msg:exports.ErrorCode[o]}]:(s=i,this._ultraMsgMap[s.messageUId]=s.timestamp,[2,{code:o}])}}))}))},n.prototype._handleEventChangeList=function(e){var t={Group:{map:{},types:lh},Friend:{map:{},types:dh}},n=function(e,t,n){e[t]||(e[t]=[]),e[t].push(n)};e.forEach((function(e){var r=e.changeType;for(var o in t)if(t[o].types.includes(r)){n(t[o].map,r,e);break}}));var r={Group:this._processChangeMapGroup.bind(this),Friend:this._processChangeMapFriend.bind(this)};for(var o in t)Object.keys(t[o].map).length>0&&r[o](t[o].map)},n.prototype._pullUltraChangeMessageList=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a,u,c,l;return ce(this,(function(d){switch(d.label){case 0:return this._isConnected?this._isPullingUltraChangeMessage?[2]:(this._isPullingUltraChangeMessage=!0,t=this._connMgr.codec.encodeQueryMsgChange(e),(n=new Fa(as[as.qryMsgChange],t,this.currentUserId)).setHeaderQos(ps.AT_LEAST_ONCE),[4,this._connMgr.send(n,Fo)]):[2];case 1:return r=d.sent(),o=r.code,i=r.data,this._isPullingUltraChangeMessage=!1,o===exports.ErrorCode.SUCCESS&&i?(s=i.hasNext,a=i.list,u=(null==i?void 0:i.syncTime)||0,this._handleUltraChangeList(a),c=this._pullUltraChangeMessageQue.filter((function(e){return e>u})),this._pullUltraChangeMessageQue.length=0,(l=this._pullUltraChangeMessageQue).push.apply(l,pe([],de(c),!1)),s?this._pullUltraChangeMessageList(u):this._lastPullingUltraChangeMessageTime=u,[2]):[2]}}))}))},n.prototype._handleUltraChangeList=function(e){var t={};e.forEach((function(e){var n=e.changeType;t[n]||(t[n]=[]),t[n].push(e)}));var n=B.CHANNEL_CHANGE,r=B.MSG_RECALL,o=B.MSG_EXPANSION,i=B.MSG_MODIFY,s=B.USER_GROUP_CHANGE;t[n]&&this._handleUltraChannelChange(t[n]),t[r]&&this._handleMsgRecall(t[r]),t[o]&&this._handleMsgUpdate(t[o]),t[i]&&this._handleMsgUpdate(t[i]),t[s]&&this._handleUserGroupStatus(t[s])},n.prototype._processChangeMapGroup=function(e){var t=m.GROUP_OPERATION,n=m.GROUP_PROFILE_CHANGE,r=m.GROUP_APPLICATION_INVITATION,o=m.GROUP_FOLLOW_USER_CHANGE;e[t]&&this._handleGroupOperation(e[t]),e[n]&&this._handleGroupProfileChange(e[n]),e[r]&&this._handleApplication(e[r]),e[o]&&this._handleFollowUserChange(e[o])},n.prototype._processChangeMapFriend=function(e){var t=this;(e[l.FRIEND_APPLICATION]||[]).forEach((function(e){var n,r,o,i,s,a,u,c,l,p,h=e.subChangeType,_=e.businessId,g=e.time,f=e.eventData,E=d.FRIEND_APPLY,I=d.FRIEND_REFUSE,T=d.FRIEND_USER_INFO,v=d.FRIENDS_INPUT,C=d.FRIEND_CLEAR,R=d.FRIEND_INFO_CHANGE,y=d.FRIEND_INFO_CHANGE_SYNC;switch(h){case E:case I:var m=h===E?exports.FriendApplicationStatus.UNHANDLED:exports.FriendApplicationStatus.REFUSED;null===(r=(n=t._watcher).friendApplicationStatusChanged)||void 0===r||r.call(n,{userId:_,applicationType:f.applyType,applicationStatus:m,directionType:f.friendType,operationTime:g,extra:f.info||""});break;case T:null===(i=(o=t._watcher).friendAdd)||void 0===i||i.call(o,{userId:_,name:f.name,portraitUri:f.portraitUrl,directionType:f.friendType,operationTime:g});break;case v:null===(a=(s=t._watcher).friendDelete)||void 0===a||a.call(s,{userIds:f.targetId,directionType:f.type,operationTime:g});break;case C:null===(c=(u=t._watcher).friendCleared)||void 0===c||c.call(u,g);break;case R:break;case y:null===(p=(l=t._watcher).friendInfoChangedSync)||void 0===p||p.call(l,{userId:_,remark:f.remarkname,extProfile:f.extProfile,operationTime:g})}}))},n.prototype._handleGroupOperation=function(e){var t=this;e.forEach((function(e){var n,r,o,i,s=e.subChangeType,a=e.businessId,u=e.time,c=e.eventData,l=c.optUserInfo,d=c.channelInfo,p=c.userInfos,h={groupId:a,operation:s,operationTime:u};l&&(n=de(Ft([l]),1),h.operatorInfo=n[0]),s===exports.GroupOperation.CREATE&&(r=de(Dt([d]),1),h.groupInfo=r[0]),[exports.GroupOperation.CREATE,exports.GroupOperation.DISMISS].includes(s)||(h.memberInfos=Ft(p)),null===(i=(o=t._watcher).groupOperation)||void 0===i||i.call(o,h)}))},n.prototype._handleGroupProfileChange=function(e){var t=this;e.forEach((function(e){var n,r,o,i,s,a,u=e.businessId,c=e.time,l=e.eventData,d=e.subChangeType,p=e.secondaryId;switch(d){case T.GROUP_INFO_CHANGE:var h=de(Ft([l.optUserInfo]),1)[0],_=de(Vt([l.channelInfo]),1)[0],g=de(l.channelFullInfo?Vt([l.channelFullInfo]):[void 0],1)[0];null===(r=(n=t._watcher).groupInfoChanged)||void 0===r||r.call(n,{operatorInfo:h,groupInfo:_,changedGroupInfo:_,operationTime:c,fullGroupInfo:g});break;case T.MEMBER_PROFILE_CHANGE:h=de(Ft([l.optUserInfo]),1)[0];var f=Ft(l.userInfos)[0];null===(i=(o=t._watcher).groupMemberInfoChanged)||void 0===i||i.call(o,{groupId:u,operatorInfo:h,memberInfo:f,operationTime:c});break;case T.GROUP_REMARK_DELETE:case T.GROUP_REMARK_SET:var E=d===T.GROUP_REMARK_SET?exports.GroupOperationType.ADD:exports.GroupOperationType.REMOVE;null===(a=(s=t._watcher).groupRemarkChangedSync)||void 0===a||a.call(s,{groupId:u,operationType:E,operationTime:c,groupRemark:p})}}))},n.prototype._handleApplication=function(e){var t=this;e.forEach((function(e){var n=e.eventData.statusInfo;Ht(n).forEach((function(e){var n,r;null===(r=(n=t._watcher).groupApplicationEvent)||void 0===r||r.call(n,e)}))}))},n.prototype._handleFollowUserChange=function(e){var t=this;e.forEach((function(e){var n,r,o=e.subChangeType,i=e.businessId,s=e.time,a=e.userGroupIds,u=1===o?exports.GroupOperationType.ADD:exports.GroupOperationType.REMOVE;null===(r=(n=t._watcher).groupFollowsChangedSync)||void 0===r||r.call(n,{groupId:i,operationType:u,operationTime:s,userIds:a})}))},n.prototype._handleUltraChannelChange=function(e){var t=this,n=[],r=[],o=[];e.forEach((function(e){var i=e.subChangeType,s=e.targetId,a=e.channelId,u=e.sendTime,c=e.operatorId,l="".concat(a,"_").concat(s),d=t._ultraGroupMap[l];if(d){var p=H.PUBLIC_TO_PRIVATE,h=H.PRIVATE_TO_PUBLIC,_=H.PUBLIC_TO_PRIVATE_USER_NOT_IN,g=H.CHANNEL_DELETE,f=H.CHANNEL_USER_KICKED;switch(i){case h:d.channelType=exports.UltraGroupChannelType.PUBLIC,n.push({targetId:s,channelId:a,changeType:exports.UltraGroupChannelChangeType.PRIVATE_TO_PUBLIC,channelType:d.channelType});break;case p:d.channelType=exports.UltraGroupChannelType.PRIVATE,n.push({targetId:s,channelId:a,changeType:exports.UltraGroupChannelChangeType.PUBLIC_TO_PRIVATE,channelType:d.channelType});break;case _:n.push({targetId:s,channelId:a,changeType:exports.UltraGroupChannelChangeType.PUBLIC_TO_PRIVATE_USER_NOT_IN,channelType:d.channelType}),delete t._ultraGroupMap[l];break;case g:r.push({targetId:s,channelId:a,channelType:d.channelType,deleteTime:u}),delete t._ultraGroupMap[l];break;case f:o.push({targetId:s,channelId:a,userId:c,channelType:exports.UltraGroupChannelType.PRIVATE}),c===t.currentUserId&&delete t._ultraGroupMap[l]}}})),n.length>0&&this._watcher.ultraGroupChannelChangeType(n),r.length>0&&this._watcher.ultraGroupChannelDelete(r),o.length>0&&this._watcher.ultraGroupChannelUserKicked(o)},n.prototype._handleMsgRecall=function(e){var t=this,n=[];e.forEach((function(e){var r=e.targetId,o=e.channelId,i=e.messageUId,s=e.sendTime,a=e.conversationType,u=e.operatorId,c=e.mentionedType;t._updateUltraGroupWhenRecallMsg(r,o,i,s,c),n.push({targetId:r,conversationType:a,sentTime:s,messageUId:i,senderUserId:u,channelId:o,content:{conversationType:a,targetId:r,messageUId:i,channelId:o},messageDirection:1,messageType:exports.MessageType.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:Ut(exports.ReceivedStatus.UNREAD)})})),this._watcher.ultraGroupMessageRecalled(n)},n.prototype._handleMsgUpdate=function(e){var t={};for(var n in e.forEach((function(e){var n=e.targetId,r=e.conversationType,o=e.sendTime,i=e.messageUId,s=e.channelId,a="".concat(r,"_").concat(n);t[a]||(t[a]=[]),t[a].push({messageUId:i,channelId:s,sendTime:o})})),t){var r=n.split("_"),o=r.shift(),i=r.join("_");this._pullUltraMessageList(e[0].changeType,{targetId:i,conversationType:Number(o),messages:pe([],de(t[n]),!1)})}},n.prototype._pullUltraMessageList=function(e,t){return ue(this,void 0,void 0,(function(){var n,r,o,i,s,a,u,c=this;return ce(this,(function(l){switch(l.label){case 0:return this._isConnected?(n=this._connMgr.codec.encodeMsgQuery(t),(r=new Fa(as[as.qryMsg],n,this.currentUserId)).setHeaderQos(ps.AT_LEAST_ONCE),[4,this._connMgr.send(r,Ho,{connectedTime:this._connMgr.getConnectedTime(),currentUserId:this.currentUserId})]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return o=l.sent(),i=o.code,s=o.data,i!==exports.ErrorCode.SUCCESS?[2,{code:i,msg:exports.ErrorCode[i]}]:(a=(s||{}).list,u=[],Array.isArray(a)&&a.forEach((function(e){var t=e.targetId,n=e.channelId,r=e.messageUId,o=c._ultraGroupMap["".concat(n,"_").concat(t)];o&&o.latestMessage.messageUId===r&&(o.latestMessage=e),u.push(e)})),e===B.MSG_EXPANSION&&this._watcher.ultraGroupMessageExpansionUpdated(u),e===B.MSG_MODIFY&&this._watcher.ultraGroupMessageModified(u),[2])}}))}))},n.prototype._handleUserGroupStatus=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a,u,c,l,d;return ce(this,(function(p){return t=q.REMOVE_USER_GROUP,n=q.JOIN_USER_GROUP,r=q.EXIT_USER_GROUP,o=q.CHANNEL_BIND_USER_GROUP,i=q.CHANNEL_UNBIND_USER_GROUP,s=[],a=[],u=[],c=[],l=[],e.forEach((function(e){var d=e.conversationType,p=e.targetId,h=e.userGroupIds,_=e.busChannelType,g=e.channelId;switch(e.subChangeType){case t:s.push({conversation:{conversationType:d,targetId:p},userGroupIds:h});break;case n:a.push({conversation:{conversationType:d,targetId:p},userGroupIds:h});break;case r:u.push({conversation:{conversationType:d,targetId:p},userGroupIds:h});break;case o:c.push({conversation:{conversationType:d,targetId:p,channelId:g},channelType:_,userGroupIds:h});break;case i:l.push({conversation:{conversationType:d,targetId:p,channelId:g},channelType:_,userGroupIds:h})}})),d={},s.length>0&&(d.userGroupDisband=s),a.length>0&&(d.userAdded=a),u.length>0&&(d.userRemoved=u),c.length>0&&(d.userGroupBindChannel=c),l.length>0&&(d.userGroupUnBindChannel=l),this._watcher.userGroupStatus(d),[2]}))}))},n.prototype.getUltraHistoryMsg=function(e,t,n){var r;return ue(this,void 0,void 0,(function(){var o,i,s,a,u,c;return ce(this,(function(l){switch(l.label){case 0:return this._isConnected?(o=this._connMgr.codec.encodeGetHistoryMsg(e,t),i=new Fa(as[as.qryUgMsg],o,this.currentUserId),this.logger.info(exports.LogTagId.L_GET_HISTORY_MSG_T,JSON.stringify({targetId:e,conversationType:exports.ConversationType.ULTRA_GROUP,channelId:t.channelId,timestamp:null==t?void 0:t.timestamp,count:null==t?void 0:t.count}),n),[4,this._connMgr.send(i,zr,{currentUserId:this.currentUserId,conversation:{conversationType:exports.ConversationType.ULTRA_GROUP,targetId:e}})]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return s=l.sent(),a=s.code,u=s.data,a===exports.ErrorCode.SUCCESS&&u?(c=[],null===(r=u.list)||void 0===r||r.forEach((function(e){e&&c.push(e.messageUId)})),this.logger.info(exports.LogTagId.L_GET_HISTORY_MSG_R,JSON.stringify({code:a,messageUIds:c.join(",")}),n),[2,{code:a,data:u}]):(this.logger.warn(exports.LogTagId.L_GET_HISTORY_MSG_R,JSON.stringify({code:a,messageUIds:""}),n),[2,{code:a}])}}))}))},n.prototype.setUltraGroupDefaultNotificationLevel=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o,i,s;return ce(this,(function(a){switch(a.label){case 0:return this._isUltraGroupListExist?this._isConnected?(r=this._connMgr.codec.encodeSetUltraGroupDefaultNotificationLevel(t,n),o=new Fa(as[as.ugUnpushSet],r,e),[4,this._connMgr.send(o)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]:[2,Promise.resolve({code:exports.ErrorCode.METHOD_NOT_AVAILABLE})];case 1:return i=a.sent(),s=i.code,exports.ErrorCode.SUCCESS,[2,{code:s}]}}))}))},n.prototype.getUltraGroupDefaultNotificationLevel=function(e,t){return ue(this,void 0,void 0,(function(){var n,r,o,i,s,a,u;return ce(this,(function(c){switch(c.label){case 0:return this._isUltraGroupListExist?this._isConnected?(n=this._connMgr,r=n.codec.encodeGetUltraGroupDefaultNotificationLevel(t),o=new Fa(as[as.ugUnpushQuery],r,e),[4,n.send(o,yo)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]:[2,Promise.resolve({code:exports.ErrorCode.METHOD_NOT_AVAILABLE})];case 1:return i=c.sent(),s=i.code,a=i.data,s===exports.ErrorCode.SUCCESS&&a?(u=a.unpushLevel,[2,{code:s,data:u}]):[2,{code:s}]}}))}))},n.prototype._updateUltraGroupWhenRecallMsg=function(e,t,n,r,o){var i="".concat(t,"_").concat(e);if(this._ultraGroupMap[i]){var s=this._ultraGroupMap[i],a=s.latestMessage,u=s.lastReadTime;a&&a.messageUId===n&&(s.latestMessage=null),r&&u<r&&s.unreadMessageCount>0&&(--s.unreadMessageCount,(o===Y.ALL||o===Y.ME)&&s.unreadMentionedCount>0&&--s.unreadMentionedCount,o===Y.ME&&s.unreadMentionedCount>0&&--s.unreadMentionedMeCount,this._watcher.conversation(Lt([s])))}},n.prototype.getAllConversationState=function(){return Promise.resolve({code:exports.ErrorCode.SUCCESS,data:this._conversationManager.getAllConversationState()})},n.prototype.getUltraGroupUnreadMentionedMessages=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i;return ce(this,(function(s){switch(s.label){case 0:return this._isConnected?this._isUltraGroupListExist?(t=this._connMgr.codec.encodeUnreadMentionedMsgQuery(e),n=new Fa(as[as.qryUgUal],t,this.currentUserId),[4,this._connMgr.send(n,Yr)]):[2,Promise.resolve({code:exports.ErrorCode.METHOD_NOT_AVAILABLE})]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return r=s.sent(),o=r.code,i=r.data,o===exports.ErrorCode.SUCCESS&&i?[2,{code:o,data:i}]:[2,{code:o}]}}))}))},n.prototype.getUltraGroupFirstUnreadMessageTimestamp=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o;return ce(this,(function(i){return this._isConnected?this._isUltraGroupListExist?(t=e.targetId,n=e.channelId,r=this._ultraGroupMap["".concat(n,"_").concat(t)]||{},o=r.firstUnreadMessage||null,[2,{code:exports.ErrorCode.SUCCESS,data:o}]):[2,Promise.resolve({code:exports.ErrorCode.METHOD_NOT_AVAILABLE})]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))},n.prototype.subscribeUser=function(e,t,n){return ue(this,void 0,void 0,(function(){return ce(this,(function(r){return this._isConnected?[2,this._subscribeManager.updateSubscribeRelation(e,t,exports.SubscribeOperationType.SUBSCRIBE,n)]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))},n.prototype.unSubscribeUser=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){switch(n.label){case 0:return this._isConnected?[4,this._subscribeManager.updateSubscribeRelation(e,t,exports.SubscribeOperationType.UNSUBSCRIBE)]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return[2,{code:n.sent().code}]}}))}))},n.prototype.getSubscribeUserList=function(e,t,n){var r;return ue(this,void 0,void 0,(function(){var o;return ce(this,(function(i){return this._isConnected?(o=null===(r=this._subscribeManager)||void 0===r?void 0:r.getSubscribeUserList(e,t,n),[2,Promise.resolve({code:exports.ErrorCode.SUCCESS,data:o})]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))},n.prototype.getSubscribeUserStatus=function(e,t){var n;return ue(this,void 0,void 0,(function(){var r;return ce(this,(function(o){return this._isConnected?(r=null===(n=this._subscribeManager)||void 0===n?void 0:n.getSubscribeUserStatus(e,t),[2,Promise.resolve({code:exports.ErrorCode.SUCCESS,data:r})]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))},n.prototype.updateMyUserProfile=function(e){var t;return ue(this,void 0,void 0,(function(){var n,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return this._isConnected?(n=Xi.encode(li,he(this,r,"m",o).call(this,e)),[4,this._connMgr.query(as.updUserProfile,this.currentUserId,n,pi)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return(i=u.sent()).isOk?(s=i.data.version,null===(t=this._subscribeManager)||void 0===t||t.updateOwnProfile(e,s),[2,i.wipe()]):(a=i.data.censorFailedFields,[2,st(i.code,"",a&&0!==a.length?{errorKeys:a,errorKey:a[0]}:void 0)])}}))}))},n.prototype.getMyUserProfile=function(){return this._isConnected?this._subscribeManager.getOwnProfile():Promise.resolve({code:exports.ErrorCode.RC_NET_UNAVAILABLE})},n.prototype.getUserProfiles=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return this._isConnected?[2,this._subscribeManager.getUserProfiles(e)]:[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}]}))}))},n.prototype.updateMyUserProfileVisibility=function(e){return ue(this,void 0,void 0,(function(){var t,n;return ce(this,(function(r){switch(r.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodeUserProfilePermission(e),n=new Fa(as[as.updProfilePermiss],t,this.currentUserId),[4,this._connMgr.send(n)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return[2,{code:r.sent().code}]}}))}))},n.prototype.getMyUserProfileVisibility=function(){return ue(this,void 0,void 0,(function(){var e,t,n,r,o;return ce(this,(function(i){switch(i.label){case 0:return this._isConnected?(e=this._connMgr.codec.encodeUserProfileInput(),t=new Fa(as[as.qProfilePermiss],e,this.currentUserId),[4,this._connMgr.send(t,fi)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return n=i.sent(),r=n.code,o=n.data,r!==exports.ErrorCode.SUCCESS?[2,{code:r}]:[2,{code:r,data:null==o?void 0:o.permission}]}}))}))},n.prototype.searchUserProfileByUniqueId=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s;return ce(this,(function(a){switch(a.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodeSearchUserProfile(e),n=new Fa(as[as.searchUserProfile],t,this.currentUserId),[4,this._connMgr.send(n,li)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return r=a.sent(),o=r.code,i=r.data,o===exports.ErrorCode.SUCCESS&&i?(s=Pt(i.userId,i.userProfile,i.userExtProfile),[2,{code:o,data:s}]):[2,{code:o}]}}))}))},n.prototype.bindRTCRoomForChatroom=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o;return ce(this,(function(i){switch(i.label){case 0:return this._isConnected?(t=e.chatRoomId,n=this._connMgr.codec.encodebindRTCRoomForChatroom(e),r=new Fa(as[as.setRtcRoomId],n,t),[4,this._connMgr.send(r)]):[2,exports.ErrorCode.RC_NET_UNAVAILABLE];case 1:return o=i.sent(),[2,o.code]}}))}))},n.prototype.rtcSignaling=function(e,t,n,r){return ue(this,void 0,void 0,(function(){var o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return this._isConnected?(o=n?new Fa(t,r,e):new Ba(t,r,e),[4,this._connMgr.send(o)]):[2,{code:exports.ErrorCode.RC_NET_UNAVAILABLE}];case 1:return i=u.sent(),s=i.code,a=i.data,[2,{code:s,buffer:a instanceof Ha||null==a?void 0:a.pbData}]}}))}))},n.prototype.rtcPing=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return r=ls(this.rtcCodec,t,n),[4,this.rtcSignaling(e,as[as.rtcPing],!0,r)];case 1:return o=u.sent(),i=o.code,s=o.buffer,i!==exports.ErrorCode.SUCCESS?[2,{code:i}]:((a=this.rtcCodec.decode(ns.RtcOutput,s)).version=mt(a.version),[2,{code:i,data:a}])}}))}))},n.prototype.getDeviceId=function(){return lu()},n.prototype.setPushConfig=function(e){var t,n;(t=e.deviceId)&&(cu=t),n=e.packageName,du=n},n.prototype.getOSInfo=function(){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){return[2,{code:exports.ErrorCode.NOT_SUPPORT}]}))}))},n.prototype.getProcessInfo=function(){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){return[2,{code:exports.ErrorCode.NOT_SUPPORT}]}))}))},n.prototype.getMainProcessInfo=function(){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){return[2,{code:exports.ErrorCode.NOT_SUPPORT}]}))}))},n.prototype.destroy=function(){ue(void 0,void 0,void 0,(function(){var e,t;return ce(this,(function(n){switch(n.label){case 0:return bp?(Gp&&(clearTimeout(Gp),Gp=null),[4,bp]):[2];case 1:return(e=n.sent())&&(t=e.db,Bp.push(t)),bp=null,[2]}}))}))},n.prototype.callExtra=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return Promise.resolve({code:exports.ErrorCode.NOT_SUPPORT})},n.prototype.setProxy=function(e){return Promise.resolve({code:exports.ErrorCode.NOT_SUPPORT})},n.prototype.getProxy=function(){return Promise.resolve({code:exports.ErrorCode.NOT_SUPPORT})},n.prototype.testProxy=function(e,t){return Promise.resolve({status:exports.ErrorCode.NOT_SUPPORT})},n.prototype.setNetwork=function(e,t){var n;if(this._connMgr.setNetwork(e,t),e.status&&this.cloudControllerUri){var r=this._connMgr.getToken();null===(n=this.cloudController)||void 0===n||n.request(this.cloudControllerUri,dn.newWorkChange,r)}},n.prototype.createGroup=function(e,t,n,r){return ue(this,void 0,void 0,(function(){var o,i,s;return ce(this,(function(a){switch(a.label){case 0:return o=Rp(e,t,n,r),[4,this._connMgr.query(as.channelCreate,e,o,Ti)];case 1:return(i=a.sent()).data?(s={errorKeys:i.data.censorFailedFields,processCode:i.data.processCode||0},[2,i.isOk?it():st(i.code,i.msg,s)]):[2,i.wipe()]}}))}))},n.prototype.updateGroupInfo=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o;return ce(this,(function(i){switch(i.label){case 0:return r=Rp(e,t,n),[4,this._connMgr.query(as.upChannelInfo,e,r,Ti)];case 1:return(o=i.sent()).data?[2,o.isOk?it():st(o.code,o.msg,{errorKeys:o.data.censorFailedFields})]:[2,o.wipe()]}}))}))},n.prototype.getGroupsInfo=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return t=this._connMgr.codec.encodeMultiChannels(e),n=new Fa(as[as.qChannelInfo],t,e[0]),[4,this._connMgr.send(n,Si)];case 1:return r=u.sent(),o=r.code,i=r.data,o===exports.ErrorCode.SUCCESS&&i?(s=i.result.list,a=Dt(void 0===s?[]:s),[2,{code:o,data:a}]):[2,{code:o}]}}))}))},n.prototype.kickGroupMembers=function(e,t,n){var r;return ue(this,void 0,void 0,(function(){var o,i,s,a,u;return ce(this,(function(c){switch(c.label){case 0:return o=this._connMgr.codec.encodeQuitGroup("kick",e,t,!0,n),i=new Fa(as[as.channelMemKick],o,e),[4,this._connMgr.send(i,Ti)];case 1:return s=c.sent(),a=s.code,u=s.data,a!==exports.ErrorCode.SUCCESS?[2,{code:a,msg:null!==(r=null==u?void 0:u.msg)&&void 0!==r?r:""}]:[2,{code:a}]}}))}))},n.prototype.quitGroup=function(e,t){var n;return ue(this,void 0,void 0,(function(){var r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return r=this._connMgr.codec.encodeQuitGroup("quit",e,[],!0,t),o=new Fa(as[as.channelMemQuit],r,e),[4,this._connMgr.send(o,Ti)];case 1:return i=u.sent(),s=i.code,a=i.data,s!==exports.ErrorCode.SUCCESS?[2,{code:s,msg:null!==(n=null==a?void 0:a.msg)&&void 0!==n?n:""}]:[2,{code:s}]}}))}))},n.prototype.dismissGroup=function(e){var t;return ue(this,void 0,void 0,(function(){var n,r,o,i,s;return ce(this,(function(a){switch(a.label){case 0:return n=this._connMgr.codec.encodeQuitGroup("dismiss",e),r=new Fa(as[as.channelDismiss],n,e),[4,this._connMgr.send(r,Ti)];case 1:return o=a.sent(),i=o.code,s=o.data,i!==exports.ErrorCode.SUCCESS?[2,{code:i,msg:null!==(t=null==s?void 0:s.msg)&&void 0!==t?t:""}]:[2,{code:i}]}}))}))},n.prototype.transferGroupOwner=function(e,t,n,r){var o;return ue(this,void 0,void 0,(function(){var i,s,a,u,c;return ce(this,(function(l){switch(l.label){case 0:return i=this._connMgr.codec.encodeQuitGroup("transfer",e,[t],n,r),s=new Fa(as[as.channelTransfer],i,e),[4,this._connMgr.send(s,Ti)];case 1:return a=l.sent(),u=a.code,c=a.data,u!==exports.ErrorCode.SUCCESS?[2,{code:u,msg:null!==(o=null==c?void 0:c.msg)&&void 0!==o?o:""}]:[2,{code:u}]}}))}))},n.prototype.setGroupManagers=function(e,t,n){var r;return ue(this,void 0,void 0,(function(){var o,i,s,a,u;return ce(this,(function(c){switch(c.label){case 0:return o=this._connMgr.codec.encodeModifyChannelsInput(e,t,n),i=new Fa(as[as.upChannelManager],o,t),[4,this._connMgr.send(i,Ti)];case 1:return s=c.sent(),a=s.code,u=s.data,a!==exports.ErrorCode.SUCCESS?[2,{code:a,msg:null!==(r=null==u?void 0:u.msg)&&void 0!==r?r:""}]:[2,{code:a}]}}))}))},n.prototype.getGroupMembersByRole=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o,i,s,a,u,c,l,d,p,h;return ce(this,(function(_){switch(_.label){case 0:return r=this._connMgr.codec.encodeChannelsQueryInput({type:"getGroupMembersByRole",groupId:e,option:n,roleType:t}),o=new Fa(as[as.qChannelMem],r,e),[4,this._connMgr.send(o,Si)];case 1:return i=_.sent(),s=i.code,a=i.data,s===exports.ErrorCode.SUCCESS&&a?(u=a.result,c=a.page,d=(l=c||{}).pageToken,p=l.hasNext,[],h=Ft(u.list),[2,{code:s,data:{data:h,pageToken:p&&d?d:""}}]):[2,{code:s}]}}))}))},n.prototype.getGroupMembers=function(e,t){return ue(this,void 0,void 0,(function(){var n,r,o,i,s,a,u;return ce(this,(function(c){switch(c.label){case 0:return n=this._connMgr.codec.encodeChannelsQueryInput({type:"getGroupMembers",groupId:e,ids:t}),r=new Fa(as[as.qChannelSpeMem],n,e),[4,this._connMgr.send(r,Si)];case 1:return o=c.sent(),i=o.code,s=o.data,i!==exports.ErrorCode.SUCCESS?[2,{code:i}]:s?(a=s.result,[],u=Ft(a.list),[2,{code:i,data:u}]):[2,{code:i,data:[]}]}}))}))},n.prototype.setGroupMemberInfo=function(e,t,n,r){return ue(this,void 0,void 0,(function(){var o,i;return ce(this,(function(s){switch(s.label){case 0:return o=Xi.encode(Ai,{targetId:e,type:exports.ConversationType.GROUP,userId:t,channelNickName:n,additional:r}),[4,this._connMgr.query(as.upChannelMem,e,o,Ti)];case 1:return(i=s.sent()).data?[2,i.isOk?it():st(i.code,i.msg,{errorKeys:i.data.censorFailedFields})]:[2,i.wipe()]}}))}))},n.prototype.searchGroupMembers=function(e,t,n){return Promise.resolve({code:exports.ErrorCode.NOT_SUPPORT})},n.prototype.joinGroup=function(e){var t;return ue(this,void 0,void 0,(function(){var n,r,o,i,s;return ce(this,(function(a){switch(a.label){case 0:return n=this._connMgr.codec.encodeJoinGroup("join",e),r=new Fa(as[as.channelMemJoin],n,e),[4,this._connMgr.send(r,Ti)];case 1:return o=a.sent(),i=o.code,s=o.data,[2,{code:i,data:{processCode:null!==(t=null==s?void 0:s.processCode)&&void 0!==t?t:0}}]}}))}))},n.prototype.inviteUsersToGroup=function(e,t){var n,r;return ue(this,void 0,void 0,(function(){var o,i,s,a,u;return ce(this,(function(c){switch(c.label){case 0:return o=this._connMgr.codec.encodeJoinGroup("invite",e,t),i=new Fa(as[as.channelMemInvite],o,e),[4,this._connMgr.send(i,Ti)];case 1:return s=c.sent(),a=s.code,u=s.data,a!==exports.ErrorCode.SUCCESS?[2,{code:a,msg:null!==(n=null==u?void 0:u.msg)&&void 0!==n?n:""}]:[2,{code:a,data:{processCode:null!==(r=null==u?void 0:u.processCode)&&void 0!==r?r:0}}]}}))}))},n.prototype.memberInviteResponse=function(e){var t,n;return ue(this,void 0,void 0,(function(){var r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return r=this._connMgr.codec.encodeMemberResponseInput(e),o=new Fa(as[as.channelApplyResp],r,e.groupId),[4,this._connMgr.send(o,Ti)];case 1:return i=u.sent(),s=i.code,a=i.data,s!==exports.ErrorCode.SUCCESS?[2,{code:s,msg:null!==(t=null==a?void 0:a.msg)&&void 0!==t?t:""}]:[2,{code:s,data:{processCode:null!==(n=null==a?void 0:a.processCode)&&void 0!==n?n:0}}]}}))}))},n.prototype.getGroupApplications=function(e,t,n){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a,u,c,l,d;return ce(this,(function(p){switch(p.label){case 0:return t=this._connMgr.codec.encodeChannelsQueryInput({type:"getGroupApplications",option:e}),n=new Fa(as[as.qChannelApplyList],t,this.currentUserId),[4,this._connMgr.send(n,Si)];case 1:return r=p.sent(),o=r.code,i=r.data,o===exports.ErrorCode.SUCCESS&&i?(s=i.result,a=i.page,c=(u=a||{}).pageToken,l=u.hasNext,d=Ht(null==s?void 0:s.list)||[],[2,{code:o,data:{data:d,pageToken:l&&c?c:""}}]):[2,{code:o}]}}))}))},n.prototype.getJoinedGroupsByRole=function(e,t){return ue(this,void 0,void 0,(function(){var n,r,o,i,s,a,u,c,l,d,p;return ce(this,(function(h){switch(h.label){case 0:return n=this._connMgr.codec.encodeChannelsQueryInput({type:"getJoinedGroupsByRole",option:t,roleType:e}),r=new Fa(as[as.qChannelMemJoin],n,this.currentUserId),[4,this._connMgr.send(r,Si)];case 1:return o=h.sent(),i=o.code,s=o.data,i===exports.ErrorCode.SUCCESS&&s?(a=s.result,u=s.page,l=(c=u||{}).pageToken,d=c.hasNext,p=Dt(a.list),[2,{code:i,data:{data:p,pageToken:d&&l?l:""}}]):[2,{code:i}]}}))}))},n.prototype.searchJoinedGroups=function(e,t){return Promise.resolve({code:exports.ErrorCode.NOT_SUPPORT})},n.prototype.getJoinedGroups=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return t=this._connMgr.codec.encodeChannelsQueryInput({type:"getJoinedGroups",ids:e}),n=new Fa(as[as.qChannelMemSpeJoin],t,this.currentUserId),[4,this._connMgr.send(n,Si)];case 1:return r=u.sent(),o=r.code,i=r.data,o===exports.ErrorCode.SUCCESS&&i?(s=i.result.list,a=Dt(s),[2,{code:o,data:a}]):[2,{code:o}]}}))}))},n.prototype.setGroupRemark=function(e,t){return ue(this,void 0,void 0,(function(){var n,r;return ce(this,(function(o){switch(o.label){case 0:return n=this._connMgr.codec.encodeSetGroupRemark(e,t),r=new Fa(as[as.upChannelRemark],n,e),[4,this._connMgr.send(r)];case 1:return[2,{code:o.sent().code}]}}))}))},n.prototype.setGroupFollows=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o;return ce(this,(function(i){switch(i.label){case 0:return r=this._connMgr.codec.encodeSetGroupFollows(e,t,n),o=new Fa(as[as.upChannelFollow],r,t),[4,this._connMgr.send(o)];case 1:return[2,{code:i.sent().code}]}}))}))},n.prototype.getGroupFollows=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return t=this._connMgr.codec.encodeChannelsQueryInput({type:"getGroupFollows",groupId:e}),n=new Fa(as[as.qChannelFollow],t,this.currentUserId),[4,this._connMgr.send(n,Si)];case 1:return r=u.sent(),o=r.code,i=r.data,o===exports.ErrorCode.SUCCESS&&i?(s=i.result,c=s.list,a=c.map((function(e){var t=e.userId,n=e.opTime;return{userId:t,time:mt(n)}})),[2,{code:o,data:a}]):[2,{code:o}]}var c}))}))},n.prototype.addFriend=function(e,t,n){var r;return ue(this,void 0,void 0,(function(){var o,i,s,a,u;return ce(this,(function(c){switch(c.label){case 0:return o=this._connMgr.codec.encodeFriendInput({targetId:e,type:t,info:n}),i=new Fa(as[as.friendAdd],o,this.currentUserId),[4,this._connMgr.send(i,Ti)];case 1:return s=c.sent(),a=s.code,u=s.data,a===exports.ErrorCode.SUCCESS&&u?[2,{code:a,data:{processCode:null!==(r=null==u?void 0:u.processCode)&&void 0!==r?r:0}}]:[2,{code:a}]}}))}))},n.prototype.deleteFriends=function(e,t){return ue(this,void 0,void 0,(function(){var n,r;return ce(this,(function(o){switch(o.label){case 0:return n=this._connMgr.codec.encodeFriendsInput(e,t),r=new Fa(as[as.friendDel],n,this.currentUserId),[4,this._connMgr.send(r)];case 1:return[2,{code:o.sent().code}]}}))}))},n.prototype.acceptFriendApplication=function(e){return ue(this,void 0,void 0,(function(){var t,n;return ce(this,(function(r){switch(r.label){case 0:return t=this._connMgr.codec.encodeFriendInput({targetId:e,type:1}),n=new Fa(as[as.friendHandle],t,this.currentUserId),[4,this._connMgr.send(n)];case 1:return[2,{code:r.sent().code}]}}))}))},n.prototype.refuseFriendApplication=function(e,t){return ue(this,void 0,void 0,(function(){var n,r;return ce(this,(function(o){switch(o.label){case 0:return n=this._connMgr.codec.encodeFriendInput({targetId:e,type:2,info:t}),r=new Fa(as[as.friendHandle],n,this.currentUserId),[4,this._connMgr.send(r)];case 1:return[2,{code:o.sent().code}]}}))}))},n.prototype.setFriendInfo=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o;return ce(this,(function(i){switch(i.label){case 0:return r=Xi.encode(bi,{targetId:e,remarkName:t,extProfile:Cp(n)}),[4,this._connMgr.query(as.friendSetPf,this.currentUserId,r,Pi)];case 1:return(o=i.sent()).isOk?[2,o.wipe()]:[2,st(o.code,"",{errorKeys:o.data.censorFailedFields})]}}))}))},n.prototype.checkFriends=function(e,t){return ue(this,void 0,void 0,(function(){var n,r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return n=this._connMgr.codec.encodeFriendsInput(e,t),r=new Fa(as[as.friendCheck],n,this.currentUserId),[4,this._connMgr.send(r,Ui)];case 1:return o=u.sent(),i=o.code,s=o.data,i!==exports.ErrorCode.SUCCESS?[2,{code:i}]:s?(a=s.list.map((function(e){return{userId:e.targetId,relationType:e.status}})),[2,{code:i,data:a}]):[2,{code:i,data:[]}]}}))}))},n.prototype.getFriends=function(e,t){return ue(this,void 0,void 0,(function(){var n,r,o,i,s,a,u,c,l,d;return ce(this,(function(p){switch(p.label){case 0:return n=this._connMgr.codec.encodeFriendQueryInput(11,t,e),r=new Fa(as[as.friendsQuery],n,this.currentUserId),[4,this._connMgr.send(r,Si)];case 1:return o=p.sent(),i=o.code,s=o.data,i===exports.ErrorCode.SUCCESS&&s?(a=s.result,u=s.page,l=(c=u||{}).pageToken,d=c.hasNext,a&&a.list?[2,{code:i,data:{data:gh(a.list),pageToken:d&&l?l:""}}]:[2,{code:i,data:{data:[],pageToken:d&&l?l:""}}]):[2,{code:i}]}}))}))},n.prototype.getFriendApplications=function(e,t,n){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a,u,c,l;return ce(this,(function(d){switch(d.label){case 0:return t=this._connMgr.codec.encodeFriendQueryInput(12,e),n=new Fa(as[as.friendsQuery],t,this.currentUserId),[4,this._connMgr.send(n,Si)];case 1:return r=d.sent(),o=r.code,i=r.data,o!==exports.ErrorCode.SUCCESS?[2,{code:o}]:i?(s=i.result,a=i.page,c=(u=a||{}).pageToken,l=u.hasNext,[2,{code:o,data:{data:fh(s),pageToken:l&&c?c:""}}]):[2,{code:o,data:{data:[],pageToken:""}}]}}))}))},n.prototype.deleteFriendApplication=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){return[2,{code:exports.ErrorCode.NOT_SUPPORT}]}))}))},n.prototype.getFriendsInfo=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i;return ce(this,(function(s){switch(s.label){case 0:return t=this._connMgr.codec.encodeFriendsListInput(e),n=new Fa(as[as.friendsInfoQry],t,this.currentUserId),[4,this._connMgr.send(n,Vi)];case 1:return r=s.sent(),o=r.code,i=r.data,o!==exports.ErrorCode.SUCCESS?[2,{code:o}]:i?[2,{code:o,data:gh(i.list)}]:[2,{code:o,data:[]}]}}))}))},n.prototype.searchFriendsInfo=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){return[2,Promise.resolve({code:exports.ErrorCode.NOT_SUPPORT})]}))}))},n.prototype.setFriendAddPermission=function(e){return ue(this,void 0,void 0,(function(){var t,n;return ce(this,(function(r){switch(r.label){case 0:return t=this._connMgr.codec.encodeFriendLevelSet(e),n=new Fa(as[as.friendAuthSet],t,this.currentUserId),[4,this._connMgr.send(n)];case 1:return[2,{code:r.sent().code}]}}))}))},n.prototype.getFriendAddPermission=function(){return ue(this,void 0,void 0,(function(){var e,t,n,r,o;return ce(this,(function(i){switch(i.label){case 0:return e=this._connMgr.codec.encodeFriendInput({targetId:this.currentUserId}),t=new Fa(as.friendAuthGet,e,this.currentUserId),[4,this._connMgr.send(t,Di)];case 1:return n=i.sent(),r=n.code,o=n.data,r===exports.ErrorCode.SUCCESS&&o?[2,{code:r,data:o}]:[2,{code:r}]}}))}))},n.prototype.getConversationListWithAllChannel=function(){throw new Error("Method not implemented.")},n.prototype.getConversationListWithAllChannelByPage=function(e,t){throw new Error("Method not implemented.")},n.prototype.getConversationsByPage=function(e,t,n,r,o){throw new Error("Method not implemented.")},n.prototype.getContinuousMessages=function(e,t,n,r,o,i){throw new Error("Method not implemented.")},n.prototype.getHistoryMessagesByObjectNames=function(e,t,n,r,o,i,s){throw new Error("Method not implemented.")},n.prototype.clearConversations=function(){throw new Error("Method not implemented.")},n.prototype.setUserStatusListener=function(e,t){throw new Error("Method not implemented.")},n.prototype.setUserStatus=function(e){throw new Error("Method not implemented.")},n.prototype.subscribeUserStatus=function(e){throw new Error("Method not implemented.")},n.prototype.getUserStatus=function(e){throw new Error("Method not implemented.")},n.prototype.addToBlacklist=function(e){return Promise.resolve(exports.ErrorCode.NOT_SUPPORT)},n.prototype.removeFromBlacklist=function(e){return Promise.resolve(exports.ErrorCode.NOT_SUPPORT)},n.prototype.getBlacklist=function(){return Promise.resolve({code:exports.ErrorCode.NOT_SUPPORT})},n.prototype.getBlacklistStatus=function(e){return Promise.resolve({code:exports.ErrorCode.NOT_SUPPORT})},n.prototype.insertMessage=function(e,t,n){throw new Error("Method not implemented.")},n.prototype.batchInsertMessage=function(e,t){throw new Error("Method not implemented.")},n.prototype.getMessageCount=function(e,t,n){throw new Error("Method not implemented.")},n.prototype.deleteMessages=function(e){throw new Error("Method not implemented.")},n.prototype.deleteMessagesByTimestamp=function(e,t,n,r,o){throw new Error("Method not implemented.")},n.prototype.batchClearMessagesByTimestamp=function(e){throw new Error("Method not implemented.")},n.prototype.clearMessages=function(e,t,n){throw new Error("Method not implemented.")},n.prototype.getMessage=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){return[2,st(exports.ErrorCode.NOT_SUPPORT,"Not support")]}))}))},n.prototype.setMessageContent=function(e,t,n){throw new Error("Method not implemented.")},n.prototype.setMessageSearchField=function(e,t,n){throw new Error("Method not implemented.")},n.prototype.searchConversationByContent=function(e,t,n,r){throw new Error("Method not implemented.")},n.prototype.searchConversationByContentWithAllChannel=function(e,t,n){throw new Error("Method not implemented.")},n.prototype.searchMessageByContent=function(e,t,n,r,o,i){throw new Error("Method not implemented.")},n.prototype.searchMessageByContentAndMessageType=function(e,t,n,r,o,i,s){throw new Error("Method not implemented.")},n.prototype.searchMessagesByUser=function(e,t,n,r,o,i){throw new Error("Method not implemented.")},n.prototype.getMessagesByTimestamp=function(e,t,n,r){throw new Error("Method not implemented.")},n.prototype.searchMessageByContentWithAllChannel=function(e,t,n,r,o){throw new Error("Method not implemented.")},n.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(e,t,n,r,o,i,s){throw new Error("Method not implemented.")},n.prototype.getUnreadMentionedMessages=function(e,t){throw new Error("Method not implemented.")},n.prototype.setMessageSentStatus=function(e,t){throw new Error("Method not implemented.")},n.prototype.updateMessageReceiptStatus=function(e,t,n,r){throw new Error("Method not implemented.")},n.prototype.setMessageReceivedStatus=function(e,t){throw new Error("Method not implemented.")},n.prototype.clearData=function(){throw new Error("Method not implemented.")},n.prototype.clearUnreadCountByTimestamp=function(e,t,n,r){throw new Error("Method not implemented.")},n.prototype.setCallInfo=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return(r=this._connMgr)?(o=r.codec.encodeSetCallInfo(t,n),[4,r.send(new Fa(as.reqCall,o,e),Qo)]):[3,2];case 1:return i=u.sent(),s=i.code,a=i.data,s===exports.ErrorCode.SUCCESS&&a?[2,Promise.resolve({code:s,data:{key:a.key,value:a.dataContent}})]:[2,Promise.resolve({code:s})];case 2:return[2,Promise.resolve({code:exports.ErrorCode.RC_NET_CHANNEL_INVALID})]}}))}))},n.prototype.getGroupMessageDeliverList=function(e,t,n){throw new Error("Method not implemented.")},n.prototype.getPrivateMessageDeliverTime=function(e,t){throw new Error("Method not implemented.")},n.prototype.setCheckDuplicateMessage=function(e){throw new Error("Method not implemented.")},n.prototype.setCheckChatRoomDuplicateMessage=function(e){throw new Error("Method not implemented.")},n.prototype.getConversations=function(e){throw new Error("Method not implemented.")},n.prototype.getRealtimeConversations=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o,i,s,a,u,c,l,d,p=this;return ce(this,(function(h){switch(h.label){case 0:return o=(r=this).currentUserId,i=r._connMgr,s=exports.ConversationType.PRIVATE,a=i.codec.encodeOldConversationList({count:e,type:s,startTime:t,order:n}),u=new Fa(as.qrySessions,a,o),[4,i.send(u,Hr,{currentUserId:o,connectedTime:i.getConnectedTime(),afterDecode:function(e){var t=e.conversationType,n=e.targetId,r=e.channelId,o=e.unreadMessageCount,i=p._conversationManager.get(t,n,r);Object.assign(e,i,{unreadMessageCount:o});var s=p._conversationManager.getDraft(t,n,r);return e.draft=s,e}})];case 1:return c=h.sent(),l=c.code,d=c.data,l!==exports.ErrorCode.SUCCESS?[2,{code:l}]:[2,{code:l,data:null==d?void 0:d.list.sort((function(e,t){var r,o,i=(null===(r=e.latestMessage)||void 0===r?void 0:r.sentTime)||0,s=(null===(o=t.latestMessage)||void 0===o?void 0:o.sentTime)||0;return 0===n?s-i:i-s}))}]}}))}))},n.prototype.getRealtimeConTotalUnreadCount=function(){return ue(this,void 0,void 0,(function(){var e,t,n,r,o;return ce(this,(function(i){switch(i.label){case 0:return e=this._connMgr.codec.encodeSessionAttInput(),t=new Fa(as.qrySessionsAtt,e,this.getCurrentUserId()),[4,this._connMgr.send(t,Xr)];case 1:return n=i.sent(),r=n.code,o=n.data,[2,{code:r,data:(null==o?void 0:o.totalUnreadCount)||0}]}}))}))},n.prototype.clearRealtimeConUnreadCount=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o;return ce(this,(function(i){switch(i.label){case 0:return t=e.conversationType,n=e.targetId,this._conversationManager.clearUnreadCount(t,n,"",this.getServerTime(),!1),r=this._connMgr.codec.encodeSessionMsgReadInput(e,this.getServerTime()),o=new Ba(as[as.updRRTime],r,this.currentUserId),[4,this._connMgr.send(o)];case 1:return[2,{code:i.sent().code}]}}))}))},n.prototype.removeRealtimeConversations=function(e){return ue(this,void 0,void 0,(function(){var t,n;return ce(this,(function(r){switch(r.label){case 0:return t=this._connMgr,n=new Fa(as.delSessions,t.codec.encodeRemoveConversationList(e),this.getCurrentUserId()),[4,t.send(n)];case 1:return[2,{code:r.sent().code}]}}))}))},n.prototype.getRealtimeConUnreadCounts=function(e){var t,n;return ue(this,void 0,void 0,(function(){var r,o,i;return ce(this,(function(s){switch(s.label){case 0:return r=this._connMgr.codec.encodeQuerySessionsInput(e),o=new Fa(as[as.qrySessionsUnread],r,this.currentUserId),[4,this._connMgr.send(o,ro)];case 1:return(i=s.sent()).code===exports.ErrorCode.SUCCESS&&i.data?[2,{code:i.code,data:null===(n=null===(t=i.data)||void 0===t?void 0:t.sessions)||void 0===n?void 0:n.map((function(e){return{conversationType:e.type,targetId:e.channelId,channelId:e.busChannel||"",unreadCount:mt(e.unreadCount)}}))}]:[2,{code:i.code}]}}))}))},n.prototype.setNotificationQuietHoursWithSetting=function(e){return ue(this,void 0,void 0,(function(){var t;return ce(this,(function(n){switch(n.label){case 0:return t=Xi.encode(Gi,e),[4,this._connMgr.query(as.addUnpush,this.currentUserId,t)];case 1:return[2,n.sent().wipe()]}}))}))},n.prototype.removeNotificationQuietHoursSetting=function(){return ue(this,void 0,void 0,(function(){var e;return ce(this,(function(t){switch(t.label){case 0:return e=Xi.encode(ki,{nothing:0}),[4,this._connMgr.query(as.delUnpush,this.currentUserId,e)];case 1:return[2,t.sent().wipe()]}}))}))},n.prototype.getNotificationQuietHoursSetting=function(){return ue(this,void 0,void 0,(function(){var e;return ce(this,(function(t){switch(t.label){case 0:return e=Xi.encode(Fi,{nothing:0}),[4,this._connMgr.query(as.qryUnpush,this.currentUserId,e,Bi)];case 1:return[2,t.sent().trans((function(e){var t=e.isUnpush,n=e.spanMinutes,r=e.startTime,o=e.level,i=e.timezone;return t?{spanMinutes:n,startTime:r,level:o,timezone:i}:{spanMinutes:0,startTime:"",level:exports.PushNotificationQuietHoursLevel.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT}}))]}}))}))},n.prototype.getStatsUrlList=function(){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){return[2,it(cn.getStatsUrlList(this.getNaviInfoFromCache()))]}))}))},r=new WeakSet,o=function(e){var t={},n=e.extraProfile;return n&&(delete e.extraProfile,t.userExtProfile=Cp(n)),t.userProfile=Cp(e),t},ae([hh()],n.prototype,"createGroup",null),ae([hh()],n.prototype,"updateGroupInfo",null),ae([hh()],n.prototype,"getGroupsInfo",null),ae([hh()],n.prototype,"kickGroupMembers",null),ae([hh()],n.prototype,"quitGroup",null),ae([hh()],n.prototype,"dismissGroup",null),ae([hh()],n.prototype,"transferGroupOwner",null),ae([hh()],n.prototype,"setGroupManagers",null),ae([hh()],n.prototype,"getGroupMembersByRole",null),ae([hh()],n.prototype,"getGroupMembers",null),ae([hh()],n.prototype,"setGroupMemberInfo",null),ae([hh()],n.prototype,"joinGroup",null),ae([hh()],n.prototype,"inviteUsersToGroup",null),ae([hh()],n.prototype,"memberInviteResponse",null),ae([hh()],n.prototype,"getGroupApplications",null),ae([hh()],n.prototype,"getJoinedGroupsByRole",null),ae([hh()],n.prototype,"getJoinedGroups",null),ae([hh()],n.prototype,"setGroupRemark",null),ae([hh()],n.prototype,"setGroupFollows",null),ae([hh()],n.prototype,"getGroupFollows",null),ae([hh()],n.prototype,"addFriend",null),ae([hh()],n.prototype,"deleteFriends",null),ae([hh()],n.prototype,"acceptFriendApplication",null),ae([hh()],n.prototype,"refuseFriendApplication",null),ae([hh()],n.prototype,"setFriendInfo",null),ae([hh()],n.prototype,"checkFriends",null),ae([hh()],n.prototype,"getFriends",null),ae([hh()],n.prototype,"getFriendApplications",null),ae([hh()],n.prototype,"deleteFriendApplication",null),ae([hh()],n.prototype,"getFriendsInfo",null),ae([hh()],n.prototype,"searchFriendsInfo",null),ae([hh()],n.prototype,"setFriendAddPermission",null),ae([hh()],n.prototype,"getFriendAddPermission",null),ae([hh()],n.prototype,"getRealtimeConversations",null),ae([hh()],n.prototype,"getRealtimeConTotalUnreadCount",null),ae([hh()],n.prototype,"clearRealtimeConUnreadCount",null),ae([hh()],n.prototype,"removeRealtimeConversations",null),ae([hh()],n.prototype,"getRealtimeConUnreadCounts",null),ae([_h()],n.prototype,"setNotificationQuietHoursWithSetting",null),ae([_h()],n.prototype,"removeNotificationQuietHoursSetting",null),ae([_h()],n.prototype,"getNotificationQuietHoursSetting",null),n}(ja);function Ih(e){return se({},e)}function Th(e,t,n){var r=n.value;n.value=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 1!==(null===(e=this.getNaviInfoFromCache())||void 0===e?void 0:e.userProfile)?Promise.resolve({code:exports.ErrorCode.RC_USER_PROFILE_SERVICE_UNAVAILABLE}):r.call.apply(r,pe([this],de(t),!1))}}function vh(e,t,n){var r=n.value;n.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return hu(this.getNaviInfoFromCache())?r.call.apply(r,pe([this],de(e),!1)):Promise.resolve({code:exports.ErrorCode.RC_REAL_TIME_CONVERSATION_UNAVAILABLE})}}var Ch=function(){function e(e){var t,n;this._token="",this._pluginContextQueue=[],this._pluginInstanseMap={},this._versionInfo={},this._typingInfo={},this._compatibleMessageProccessor=((t={})[exports.MessageType.CHATROOM_MERGE_CHANGE]=this._processChrmMemChangeMessage.bind(this),t[exports.MessageType.TYPING_STATUS]=this._processTypingStatusMessage.bind(this),t[exports.MessageType.INTERCEPT]=this._processInterceptMessage.bind(this),t[exports.MessageType.CHATROOM_SYNC_MSG]=this._processChrmSyncMessage.bind(this),t[exports.MessageType.CHATROOM_MERGE_BLOCK]=this._processChrmMemBlockMessage.bind(this),t[exports.MessageType.CHATROOM_MERGE_BAN]=this._processChrmMemBanMessage.bind(this),t),this._messageProccessor=((n={})[exports.MessageType.READ_RECEIPT]=this._processReadReceiptMessage.bind(this),n[exports.MessageType.READ_RECEIPT_REQUEST]=this._processReadReceiptRequestMessage.bind(this),n[exports.MessageType.READ_RECEIPT_RESPONSE]=this._processReadReceiptResponseMessage.bind(this),n),this._watcher={message:void 0,batchMessage:void 0,conversationState:void 0,chatroomState:void 0,connection:void 0,expansion:void 0,tag: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,operateStatus:void 0,ultraGroupMessageExpansionUpdated:void 0,ultraGroupMessageModified:void 0,ultraGroupMessageRecalled:void 0,messageDelivered:void 0,groupMessageDeliveredStatus:void 0,ultraGroupChannelChangeType:void 0,ultraGroupChannelUserKicked:void 0,ultraGroupChannelDelete:void 0,userGroupStatus:void 0,messageReadReceipt:void 0,syncReadStatus:void 0,subscribedUserStatusChange:void 0,subscribedRelationChange:void 0,syncSubscribedUserStatusFinished:void 0,ownUserProfileChanged:void 0,groupOperation:void 0,groupInfoChanged:void 0,groupMemberInfoChanged:void 0,groupApplicationEvent:void 0,groupRemarkChangedSync:void 0,groupFollowsChangedSync:void 0,friendAdd:void 0,friendDelete:void 0,friendApplicationStatusChanged:void 0,friendCleared:void 0,friendInfoChangedSync:void 0,databaseUpgradeWillStart:void 0,databaseUpgrading:void 0,databaseUpgradeDidComplete:void 0},this._typingInternalTimer=-1,this._typingExpireTime=2e3,this._typingChangedList=[],this._registerMessageSearchPropsMapping={},this.getChatRoomHistoryMessages=this.getChatroomHistoryMessages,this._options=se({},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 r={onConnected:this._onConnectionStatusChange.bind(this,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),expansion:this._expansionInfoListener.bind(this),tag:this._tagListener.bind(this),conversationTag:this._conversationTagListener.bind(this),onRTCDataChange:this._rtcDataChange.bind(this),pullFinished:this._pullFinishedListener.bind(this),ultraGroupEnable:this._ultraGroupEnableListener.bind(this),operateStatus:this._operateStatusListener.bind(this),ultraGroupMessageExpansionUpdated:this._ultraGroupMessageExpansionUpdatedListener.bind(this),ultraGroupMessageModified:this._ultraGroupMessageModifiedListener.bind(this),ultraGroupMessageRecalled:this._ultraGroupMessageRecalledListener.bind(this),messageDelivered:this._messageDeliveredListerer.bind(this),groupMessageDeliveredStatus:this._groupMessageDeliveredStatusListerer.bind(this),callInfo:this._callInfoListener.bind(this),ultraGroupChannelChangeType:this._ultraGroupChannelChangeTypeListener.bind(this),ultraGroupChannelUserKicked:this._ultraGroupChannelUserKickedListener.bind(this),ultraGroupChannelDelete:this._ultraGroupChannelDeleteListener.bind(this),onNaviDataChange:this._naviDataChange.bind(this),userGroupStatus:this._userGroupStatusListener.bind(this),messageReadReceipt:this._messageReadReceipt.bind(this),syncReadStatus:this._syncReadStatus.bind(this),subscribedUserStatusChange:this._subscribedUserStatusChange.bind(this),subscribedRelationChange:this._subscribedRelationChange.bind(this),syncSubscribedUserStatusFinished:this._syncSubscribedUserStatusFinished.bind(this),ownUserProfileChanged:this._ownUserProfileChanged.bind(this),groupOperation:this._groupOperation.bind(this),groupInfoChanged:this._groupInfoChanged.bind(this),groupMemberInfoChanged:this._groupMemberInfoChanged.bind(this),groupApplicationEvent:this._groupApplicationEvent.bind(this),groupRemarkChangedSync:this._groupRemarkChangedSync.bind(this),groupFollowsChangedSync:this._groupFollowsChangedSync.bind(this),friendAdd:this._friendAdd.bind(this),friendDelete:this._friendDelete.bind(this),friendApplicationStatusChanged:this._friendApplicationStatusChanged.bind(this),friendCleared:this._friendCleared.bind(this),friendInfoChangedSync:this._friendInfoChangedSync.bind(this),databaseUpgradeWillStart:this._databaseUpgradeWillStart.bind(this),databaseUpgrading:this._databaseUpgrading.bind(this),databaseUpgradeDidComplete:this._databaseUpgradeDidComplete.bind(this)};this.rtcCodec=new ss(us,cs);var o=Ot();this._engine=o?new RCCppEngine(this.rtcCodec,r,this._options):new Eh(this.rtcCodec,r,this._options),this.logger=this._engine.getInnerLogger(),this.sse=new Ja(this,o)}return e.init=function(t){if(this._context)return this._context.logger.warn(exports.LogTagId.A_INIT_REPEAT_O),this._context;this._context=new e(t),this._context.logger.info(exports.LogTagId.L_INIT_O,JSON.stringify({appkey:t.appkey,navigators:t.navigators,typingExpireTime:t.typingExpireTime})),this._context.logger.warn(exports.LogTagId.L_IMSDK_VER_O,JSON.stringify({commitId:"84bac54b241256653eda029c588a914ff4013c86",version:"5.20.0-c-unikit.1"}));var n=this._context._engine;return Tr.setNetworkStatusListener(n.setNetwork.bind(n)),this._context},e.getContext=function(){return this._context},e.prototype.getOptions=function(){return this._options},e.destroy=function(){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){switch(e.label){case 0:return this._context?(this._context.logger.info(exports.LogTagId.L_DESTROY_O),[4,this._context._destroy()]):[2];case 1:return e.sent(),this._context=void 0,[2]}}))}))},Object.defineProperty(e.prototype,"chatroom",{get:function(){return this._engine.chatroom},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"chat",{get:function(){return this._engine.chat},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataHosting",{get:function(){return this._engine.dataHosting},enumerable:!1,configurable:!0}),e.prototype.install=function(e,t){var n=this.logger.createTraceId();if(this.logger.info(exports.LogTagId.L_INSTALL_PLUGIN_T,JSON.stringify({tag:e.tag}),n),this._pluginInstanseMap[e.tag])return this.logger.warn(exports.LogTagId.L_INSTALL_PLUGIN_R,"repeat install",n),this._pluginInstanseMap[e.tag];var r="RCRTC"===e.tag?new $a(this):new Xa(this),o=null;try{if(!e.verify(Tr))return null;o=e.setup(r,Tr,t)}catch(e){this.logger.error(exports.LogTagId.L_INSTALL_PLUGIN_R,null==e?void 0:e.stack,n)}return["RCRTC","RCCall"].includes(e.tag)&&e.version&&e.name&&(this._versionInfo[e.name]=e.version),o&&(this._pluginContextQueue.push(r),this._pluginInstanseMap[e.tag]=o),o},e.prototype._onConnectionStatusChange=function(e,t){var n,r;this.logger.warn(exports.LogTagId.A_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),null===(r=(n=this._watcher).connection)||void 0===r||r.call(n,e,t),this._pluginContextQueue.forEach((function(n){var r;null===(r=n.onconnectionstatechange)||void 0===r||r.call(n,e,t)}))},e.prototype._processChrmMemChangeMessage=function(e){if("function"==typeof this._watcher.chatroomState){var t={},n=[],r=e.content.memberCount,o=void 0===r?0:r;Array.isArray(e.content.userList)&&e.content.userList.forEach((function(e){t[e.userId]=e.status,n.push({userId:e.userId,action:e.status,extra:e.extra})})),this._watcher.chatroomState({userChange:{users:t,chatroomId:e.targetId,memberCount:o,userList:n}})}return!0},e.prototype._processTypingStatusMessage=function(e){if(this._addTypingInfo(Ih(e)),this._watcher.typingState)return!0},e.prototype._processInterceptMessage=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 n=e.content.sourceType;if(t.sourceType=n,(n===exports.MessageBlockSourceType.MSG_EXPANSION||n===exports.MessageBlockSourceType.MSG_MODIFY)&&e.content.sourceContent)try{t.sourceContent=JSON.parse(e.content.sourceContent)}catch(e){this.logger.warn(exports.LogTagId.L_CALLBACK_E,JSON.stringify({source:"message.content.sourceContent",msg:e.message}))}}return this._MessageBlockedListener(t),!0},e.prototype._processChrmSyncMessage=function(e){return"function"==typeof this._watcher.chatroomState&&this._watcher.chatroomState({chatroomNotifyMultiLoginSync:{chatroomId:e.content.chatroomId,status:e.content.status,reason:e.content.reason,time:e.content.time,extra:e.content.extra||null}}),!0},e.prototype._processChrmMemBlockMessage=function(e){var t,n=e.content;return n.operateType===exports.ChrmMemOperateType.Blocked&&(null===(t=n.userList)||void 0===t?void 0:t.includes(this.getCurrentUserId()))&&this._engine.removeChatroomFromCatch(n.chatroomId),"function"==typeof this._watcher.chatroomState&&this._watcher.chatroomState({chatroomNotifyBlock:{chatroomId:n.chatroomId,operateType:n.operateType,durationTime:n.durationTime,operateTime:n.operateTime,userIdList:n.userList,extra:n.extra||null}}),!0},e.prototype._processChrmMemBanMessage=function(e){return"function"==typeof this._watcher.chatroomState&&this._watcher.chatroomState({chatroomNotifyBan:{chatroomId:e.content.chatroomId,banType:e.content.operateType,durationTime:e.content.durationTime,operateTime:e.content.operateTime,userIdList:e.content.userList,extra:e.content.extra||null}}),!0},e.prototype._processReadReceiptMessage=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)},e.prototype._processReadReceiptRequestMessage=function(e){"function"==typeof this._watcher.messageReceiptRequest&&this._watcher.messageReceiptRequest({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.content.messageUId,e.senderUserId)},e.prototype._processReadReceiptResponseMessage=function(e){var t,n=null===(t=e.content)||void 0===t?void 0:t.receiptMessageDic,r=this._engine.getCurrentUserId();n&&Array.isArray(n[r])&&"function"==typeof this._watcher.messageReceiptResponse&&this._watcher.messageReceiptResponse({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.senderUserId,n[r])},e.prototype._messageReceiver=function(e,t,n){var r,o,i,s,a=this;if(!(null===(o=(r=this._compatibleMessageProccessor)[e.messageType])||void 0===o?void 0:o.call(r,e))&&!this._pluginContextQueue.some((function(t){if(!t.onmessage)return!1;try{return t.onmessage(Ih(e))}catch(e){return a.logger.error(exports.LogTagId.A_MSG_LISTENER_E,null==e?void 0:e.stack),!1}})))return null===(s=(i=this._watcher).message)||void 0===s||s.call(i,Ih(e),t,n),e},e.prototype._batchMessageReceiver=function(e,t,n){var r=this,o=[],i=[],s=[exports.MessageType.READ_RECEIPT,exports.MessageType.READ_RECEIPT_REQUEST,exports.MessageType.READ_RECEIPT_RESPONSE];e.forEach((function(e){var a=r._messageReceiver(e,t,n);a&&s.includes(a.messageType)?i.push(a):a&&o.push(a)})),o.length&&this._watcher.batchMessage&&(this.logger.debug(exports.LogTagId.L_BATCH_MESSAGE_O,o.map((function(e){return e.messageUId})).join(",")),this._watcher.batchMessage(o)),i.length&&i.forEach((function(e){r._messageProccessor[e.messageType]&&r._messageProccessor[e.messageType](e)}))},e.prototype._chatroomInfoListener=function(e){var t,n;null===(n=(t=this._watcher).chatroomState)||void 0===n||n.call(t,e)},e.prototype._conversationInfoListener=function(e){var t,n;null===(n=(t=this._watcher).conversationState)||void 0===n||n.call(t,e)},e.prototype._expansionInfoListener=function(e){var t,n;null===(n=(t=this._watcher).expansion)||void 0===n||n.call(t,e)},e.prototype._tagListener=function(){var e,t;null===(t=(e=this._watcher).tag)||void 0===t||t.call(e)},e.prototype._conversationTagListener=function(){var e,t;null===(t=(e=this._watcher).conversationTagChanged)||void 0===t||t.call(e)},e.prototype._typingStatusListener=function(e){var t,n;null===(n=(t=this._watcher).typingState)||void 0===n||n.call(t,e)},e.prototype._pullFinishedListener=function(){var e,t;null===(t=(e=this._watcher).pullFinished)||void 0===t||t.call(e)},e.prototype._MessageBlockedListener=function(e){var t,n;null===(n=(t=this._watcher).messageBlocked)||void 0===n||n.call(t,e)},e.prototype._messageDeliveredListerer=function(e){var t,n;null===(n=(t=this._watcher).messageDelivered)||void 0===n||n.call(t,e)},e.prototype._groupMessageDeliveredStatusListerer=function(e){var t,n;null===(n=(t=this._watcher).groupMessageDeliveredStatus)||void 0===n||n.call(t,e)},e.prototype._callInfoListener=function(e){var t=this;this._pluginContextQueue.forEach((function(n){try{n.onCallInfo&&n.onCallInfo(e)}catch(e){t.logger.warn(exports.LogTagId.L_CALLBACK_E,null==e?void 0:e.stack)}}))},e.prototype._ultraGroupEnableListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupEnable)||void 0===n||n.call(t,e)},e.prototype._operateStatusListener=function(e){var t,n;null===(n=(t=this._watcher).operateStatus)||void 0===n||n.call(t,e)},e.prototype._ultraGroupMessageExpansionUpdatedListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupMessageExpansionUpdated)||void 0===n||n.call(t,e)},e.prototype._ultraGroupMessageModifiedListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupMessageModified)||void 0===n||n.call(t,e)},e.prototype._ultraGroupMessageRecalledListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupMessageRecalled)||void 0===n||n.call(t,e)},e.prototype._ultraGroupChannelChangeTypeListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupChannelChangeType)||void 0===n||n.call(t,e)},e.prototype._ultraGroupChannelUserKickedListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupChannelUserKicked)||void 0===n||n.call(t,e)},e.prototype._ultraGroupChannelDeleteListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupChannelDelete)||void 0===n||n.call(t,e)},e.prototype._userGroupStatusListener=function(e){var t,n;null===(n=(t=this._watcher).userGroupStatus)||void 0===n||n.call(t,e)},e.prototype._messageReadReceipt=function(e){var t,n;null===(n=(t=this._watcher).messageReadReceipt)||void 0===n||n.call(t,e)},e.prototype._syncReadStatus=function(e){var t,n;null===(n=(t=this._watcher).syncReadStatus)||void 0===n||n.call(t,e)},e.prototype._subscribedUserStatusChange=function(e){var t,n;null===(n=(t=this._watcher).subscribedUserStatusChange)||void 0===n||n.call(t,e)},e.prototype._subscribedRelationChange=function(e){var t,n;null===(n=(t=this._watcher).subscribedRelationChange)||void 0===n||n.call(t,e)},e.prototype._syncSubscribedUserStatusFinished=function(e){var t,n;this.logger.info(exports.LogTagId.L_SYNC_SUBSCRIBED_USER_STATUS_FINISHED_S),null===(n=(t=this._watcher).syncSubscribedUserStatusFinished)||void 0===n||n.call(t,e)},e.prototype._ownUserProfileChanged=function(e){var t,n;this.logger.info(exports.LogTagId.L_OWN_USER_PROFILE_CHANGED_S),null===(n=(t=this._watcher).ownUserProfileChanged)||void 0===n||n.call(t,e)},e.prototype._groupOperation=function(e){var t,n;null===(n=(t=this._watcher).groupOperation)||void 0===n||n.call(t,e)},e.prototype._groupInfoChanged=function(e){var t,n;null===(n=(t=this._watcher).groupInfoChanged)||void 0===n||n.call(t,e)},e.prototype._groupMemberInfoChanged=function(e){var t,n;null===(n=(t=this._watcher).groupMemberInfoChanged)||void 0===n||n.call(t,e)},e.prototype._groupApplicationEvent=function(e){var t,n;null===(n=(t=this._watcher).groupApplicationEvent)||void 0===n||n.call(t,e)},e.prototype._groupRemarkChangedSync=function(e){var t,n;null===(n=(t=this._watcher).groupRemarkChangedSync)||void 0===n||n.call(t,e)},e.prototype._groupFollowsChangedSync=function(e){var t,n;null===(n=(t=this._watcher).groupFollowsChangedSync)||void 0===n||n.call(t,e)},e.prototype._friendAdd=function(e){var t,n;null===(n=(t=this._watcher).friendAdd)||void 0===n||n.call(t,e)},e.prototype._friendDelete=function(e){var t,n;null===(n=(t=this._watcher).friendDelete)||void 0===n||n.call(t,e)},e.prototype._friendApplicationStatusChanged=function(e){var t,n;null===(n=(t=this._watcher).friendApplicationStatusChanged)||void 0===n||n.call(t,e)},e.prototype._friendCleared=function(e){var t,n;null===(n=(t=this._watcher).friendCleared)||void 0===n||n.call(t,e)},e.prototype._friendInfoChangedSync=function(e){var t,n;null===(n=(t=this._watcher).friendInfoChangedSync)||void 0===n||n.call(t,e)},e.prototype._rtcDataChange=function(e,t){this._pluginContextQueue.forEach((function(n){var r;null===(r=n.onrtcdatachange)||void 0===r||r.call(n,e,t)}))},e.prototype._naviDataChange=function(e){this._pluginContextQueue.forEach((function(t){var n;null===(n=t.onnavidatachange)||void 0===n||n.call(t,e)}))},e.prototype._databaseUpgradeWillStart=function(){var e,t;this.logger.info(exports.LogTagId.L_DB_UPGRATE_START_S),null===(t=(e=this._watcher).databaseUpgradeWillStart)||void 0===t||t.call(e)},e.prototype._databaseUpgrading=function(e){var t,n;this.logger.info(exports.LogTagId.L_DB_UPGRATING_S,e),null===(n=(t=this._watcher).databaseUpgrading)||void 0===n||n.call(t,e)},e.prototype._databaseUpgradeDidComplete=function(e){var t,n;this.logger.info(exports.LogTagId.L_DB_UPGRATE_COMPLETE_S),null===(n=(t=this._watcher).databaseUpgradeDidComplete)||void 0===n||n.call(t,e)},e.prototype.assignWatcher=function(e){var t=this;Object.keys(this._watcher).forEach((function(n){if(Object.prototype.hasOwnProperty.call(e,n)){var r=e[n];t._watcher[n]=ft(r)||gt(r)?r:void 0}}))},e.prototype._resetWatcher=function(){var e=this;Object.keys(this._watcher).forEach((function(t){e._watcher[t]=void 0}))},e.prototype._addTypingInfo=function(e){var t=e.senderUserId,n=e.conversationType,r=e.targetId,o=e.content,i=e.channelId,s=o.typingContentType,a=i||"",u="".concat(n,"#").concat(r,"#").concat(a);this._typingInfo[u]||(this._typingInfo[u]=[]);var c=this._typingInfo[u].findIndex((function(e){return e.userId===t}));c>=0&&this._typingInfo[u][c].messageType===s?this._typingInfo[u][c].timestamp=Date.now():(c>=0&&this._typingInfo[u].splice(c,1),this._typingInfo[u].push({userId:t,messageType:s,timestamp:Date.now()}),this._typingChangedList.includes(u)||this._typingChangedList.push(u),this._startCheckTypingInfo())},e.prototype._startCheckTypingInfo=function(){var e=this;-1===this._typingInternalTimer&&0!==Object.keys(this._typingInfo).length&&(this._typingInternalTimer=setInterval((function(){for(var t in e._typingInfo){var n=e._typingInfo[t].length;e._typingInfo[t]=e._typingInfo[t].filter((function(t){return Date.now()-t.timestamp<e._typingExpireTime})),e._typingInfo[t].length===n||e._typingChangedList.includes(t)||e._typingChangedList.push(t),0===e._typingInfo[t].length&&delete e._typingInfo[t]}e._notifyTypingChanged()}),500))},e.prototype._notifyTypingChanged=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)},e.prototype.getConnectedTime=function(){return this._engine.getConnectedTime()},e.prototype.getServerTime=function(){return this._engine.getServerTime()},e.prototype.getDeviceId=function(){return this._engine.getDeviceId()},e.prototype.setPushConfig=function(e){return this._engine.setPushConfig(e)},e.prototype.getCurrentUserId=function(){return this._engine.getCurrentUserId()},e.prototype.getConnectionStatus=function(){return this._engine.getConnectionStatus()},Object.defineProperty(e.prototype,"validatorConnected",{get:function(){var e=this;return function(){return e._engine.getConnectionStatus()===exports.RCConnectionStatus.CONNECTED?it(e._engine.getNaviInfoFromCache()):st(exports.ErrorCode.RC_NET_UNAVAILABLE)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"token",{get:function(){return this._token},enumerable:!1,configurable:!0}),e.prototype.refetchNaviInfo=function(){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){return[2,this._engine.refetchNaviInfo()]}))}))},e.prototype.connect=function(e,t,n){var r,o;return ue(this,void 0,void 0,(function(){var i,s,a,u,c,l;return ce(this,(function(d){switch(d.label){case 0:return this._token=e,[4,Tr.getNetworkType()];case 1:return i=d.sent(),this._engine.setNetwork({status:!0,type:i},!0),s=!!this._pluginInstanseMap.RCCallPlus,[4,this._engine.connect(e,t,s,n)];case 2:return a=d.sent(),u=a.code,c=a.data,u!==exports.ErrorCode.SUCCESS?[2,{code:u}]:(1!==this._engine.getNaviInfoFromCache().type&&(l=ze.getInfo(),null===(o=(r=this._engine).reportSDKInfo)||void 0===o||o.call(r,l)),[2,{code:u,userId:c}])}}))}))},e.prototype.disconnect=function(e,t){return ue(this,void 0,void 0,(function(){var n=this;return ce(this,(function(r){switch(r.label){case 0:return clearInterval(this._typingInternalTimer),this._typingInternalTimer=-1,this._typingInfo={},[4,this._engine.disconnect(e,t)];case 1:return r.sent(),this._pluginContextQueue.forEach((function(e){if(e.ondisconnect)try{e.ondisconnect()}catch(e){n.logger.error(exports.LogTagId.L_CALLBACK_E,null==e?void 0:e.stack)}})),[2,Promise.resolve()]}}))}))},e.prototype.reconnect=function(e){return this.connect(this.token,!!e,this.logger.createTraceId())},e.prototype._getTokenWithoutNavi=function(){return this._token.replace(/@.+$/,"@")},e.prototype._channelIdConvert=function(e,t){if(e!==exports.ConversationType.ULTRA_GROUP)return t;var n=this.getNaviInfoFromCache();return!!(2&((null==n?void 0:n.ugDriven)||0))&&!t?"RCDefault":t},e.prototype.getNaviInfoFromCache=function(){return this._engine.getNaviInfoFromCache()},e.prototype.registerMessageType=function(e,t,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=!1),pt(r)&&r.length>0&&(this._registerMessageSearchPropsMapping[e]=r),this._engine.registerMessageType(e,t,n,r,o)},e.prototype.registerRTCSignalingListener=function(e){this._engine.registerRTCSignalingListener(e)},e.prototype.checkSearchPropsMsg=function(e,t){var n=this._registerMessageSearchPropsMapping[e],r={};return n&>(t)&&Object.keys(t).forEach((function(e){if(n.includes(e)){var o=t[e];dt(o)&&(o>-Math.pow(2,64)&&o<Math.pow(2,64)&&Number.isInteger(o)||(r[e]=o))}})),Object.keys(r).length>0?{msg:JSON.stringify(r),code:exports.ErrorCode.SEARCH_PROPS_LIMIT_ERROR}:{code:exports.ErrorCode.SUCCESS}},e.prototype._handleExpansioResult=function(e,t){if(t){var n=yt(e),r=n.isIllgalEx,o=n.isExKeyOrValLengthExceedLimit;return n.isExceedLimit||o?exports.ErrorCode.EXPANSION_LIMIT_EXCEET:r?exports.ErrorCode.INVALID_PARAMETER_MESSAGE_EXPANSION:void 0}},e.prototype.sendMessage=function(e,t,n,r,o){var i=this.checkSearchPropsMsg(n.messageType,n.content),s=i.code,a=i.msg;if(s!==exports.ErrorCode.SUCCESS)return Promise.resolve({code:s,msg:a});if(e===exports.ConversationType.SYSTEM&&n.messageType!==exports.MessageType.SYNC_READ_STATUS)return Promise.resolve({code:exports.ErrorCode.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE});if(n.messageType===exports.MessageType.STREAM_MESSAGE)return Promise.resolve({code:exports.ErrorCode.MESSAGE_NOT_SUPPORT_SENDING});var u=n.canIncludeExpansion,c=void 0!==u&&u,l=n.expansion,d=this._handleExpansioResult(l,c);if(d)return Promise.resolve({code:d});var p=n.isMentioned,h=n.mentionedUserIdList,_=n.mentionedType;p&&[exports.ConversationType.GROUP,exports.ConversationType.ULTRA_GROUP].includes(e)?n.content.mentionedInfo=function(e,t,n){var r,o,i;return{userIdList:(null===(r=e.mentionedInfo)||void 0===r?void 0:r.userIdList)||t,type:(null===(o=e.mentionedInfo)||void 0===o?void 0:o.type)||n||exports.MentionedType.ALL,mentionedContent:(null===(i=e.mentionedInfo)||void 0===i?void 0:i.mentionedContent)||""}}(n.content,h,_):delete n.content.mentionedInfo;var g=JSON.stringify(n.content);if(function(e){for(var t,n=0,r=0,o=e.length;r<o;r++)n+=(t=e.charCodeAt(r))<127?1:t<=2047?2:t<=65535?3:4;return n}(g)>Le)return Promise.resolve({code:exports.ErrorCode.RC_MSG_CONTENT_EXCEED_LIMIT});if(e===exports.ConversationType.ULTRA_GROUP)return n.channelId=this._channelIdConvert(e,n.channelId),this._engine.sendUltraMessage(t,n,r,o);var f=this.getNaviInfoFromCache();return(null==f?void 0:f.grpRRVer)&&n.messageType===exports.MessageType.READ_RECEIPT_RESPONSE?Promise.resolve({code:exports.ErrorCode.READ_RECEIPT_ERROR}):this._engine.sendMessage(e,t,n,r,o)},e.prototype.sendExpansionMessage=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a,u,c,l,d,p;return ce(this,(function(h){switch(h.label){case 0:return t=e.channelId,n=e.conversationType,r=e.targetId,o=e.messageUId,i=e.keys,s=e.expansion,a=e.removeAll,u=e.canIncludeExpansion,e.messageType===exports.MessageType.STREAM_MESSAGE&&((null==i?void 0:i.includes("RC_Ext_StreamMsgSummary"))||(null==s?void 0:s.RC_Ext_StreamMsgSummary))?[2,{code:exports.ErrorCode.STREAM_MESSAGE_EXPANSION_KEY_ERROR}]:u?(c=yt(s),l=c.isIllgalEx,d=c.isExKeyOrValLengthExceedLimit,c.isExceedLimit||d?[2,Promise.resolve({code:exports.ErrorCode.EXPANSION_LIMIT_EXCEET})]:l?[2,Promise.resolve({code:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_EXPANSION})]:(p={mid:o},s&&(p.put=s),i&&(p.del=i),a&&(p.removeAll=1),[4,this._engine.sendMessage(n,r,{content:p,messageType:exports.MessageType.EXPANSION_NOTIFY,channelId:t})])):[2,{code:exports.ErrorCode.MESSAGE_KV_NOT_SUPPORT}];case 1:return[2,{code:h.sent().code}]}}))}))},e.prototype.sendReadReceiptMessage=function(e,t,n){return ue(this,void 0,void 0,(function(){var r;return ce(this,(function(o){return r=this.getNaviInfoFromCache(),1!==((null==r?void 0:r.grpRRVer)||0)?[2,{code:exports.ErrorCode.READ_RECEIPT_ERROR,msg:"The read receipt switch is not on, please call the sendMessage method!"}]:[2,this._engine.sendReadReceiptMessage(e,t,n)]}))}))},e.prototype.getMessageReader=function(e,t,n){return ue(this,void 0,void 0,(function(){var r;return ce(this,(function(o){return r=this.getNaviInfoFromCache(),1!==((null==r?void 0:r.grpRRVer)||0)?[2,{code:exports.ErrorCode.READ_RECEIPT_ERROR}]:[2,this._engine.getMessageReader(e,t,n||"")]}))}))},e.prototype.sendReadReceiptMessageV4=function(e,t,n){return ue(this,void 0,void 0,(function(){return ce(this,(function(r){return[2,this._engine.sendReadReceiptMessageV4(e,t,n)]}))}))},e.prototype.getMessageReadReceiptV4=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){return[2,this._engine.getMessageReadReceiptV4(e,t)]}))}))},e.prototype.batchGetMessageReadReceiptInfoV4=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){return[2,this._engine.batchGetMessageReadReceiptInfoV4(e,t)]}))}))},e.prototype.updateConversationReadTime=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){return[2,this._engine.updateConversationReadTime(e,t)]}))}))},e.prototype._destroy=function(){return ue(this,void 0,void 0,(function(){var e=this;return ce(this,(function(t){switch(t.label){case 0:return this._resetWatcher(),this._engine.destroy(),Tr.removeNetworkStatusListener(),[4,this.disconnect()];case 1:return t.sent(),this._pluginContextQueue.forEach((function(t){if(t.ondestroy)try{t.ondestroy()}catch(t){e.logger.error(exports.LogTagId.L_CALLBACK_E,null==t?void 0:t.stack)}})),this._pluginContextQueue.length=0,this._pluginInstanseMap={},[2]}}))}))},e.prototype.getHistoryMessage=function(e,t,n,r,o,i,s,a){var u={timestamp:n||0,count:r||20,order:o||0,channelId:i||""};if(e===exports.ConversationType.ULTRA_GROUP){var c=this._channelIdConvert(e,u.channelId);return u.channelId=c,this._engine.getUltraHistoryMsg(t,u,a)}return this._engine.getHistoryMessage(e,t,u.timestamp,u.count,u.order,u.channelId,s||"",a)},e.prototype.getMessages=function(e,t,n,r,o,i,s){var a={timestamp:n||0,count:r||20,order:o||0,channelId:i||""};if(e===exports.ConversationType.ULTRA_GROUP){var u=this._channelIdConvert(e,a.channelId);return a.channelId=u,this._engine.getUltraHistoryMsg(t,a,s)}return this._engine.getMessages(e,t,a.timestamp,a.count,a.order,a.channelId,s)},e.prototype.getContinuousMessages=function(e,t,n,r,o,i){return void 0===n&&(n=0),void 0===r&&(r=20),void 0===o&&(o=0),void 0===i&&(i=""),this._engine.getContinuousMessages(e,t,n,r,o,i)},e.prototype.getHistoryMessagesByObjectNames=function(e,t,n,r,o,i,s){return this._engine.getHistoryMessagesByObjectNames(e,t,n,r,o,i,s)},e.prototype.getConversationList=function(e,t,n,r,o){if(t===exports.ConversationType.ULTRA_GROUP){var i=exports.ErrorCode.METHOD_NOT_SUPPORT;return Promise.resolve({code:i,msg:exports.ErrorCode[i]})}return this._engine.getConversationList(e||300,t,n,r,o||"")},e.prototype.getConversationsByPage=function(e,t,n,r,o){return this._engine.getConversationsByPage(e,t,n,r,o)},e.prototype.getConversation=function(e,t,n){var r=this._channelIdConvert(e,n);return this._engine.getConversation(e,t,r||"")},e.prototype.removeConversation=function(e,t,n){return e===exports.ConversationType.ULTRA_GROUP?Promise.resolve(exports.ErrorCode.METHOD_NOT_SUPPORT):this._engine.removeConversation(e,t,n||"")},e.prototype.batchRemoveConversation=function(e){return this._engine.batchRemoveConversation(e)},e.prototype.getUltraGroupList=function(e){return this._engine.getUltraGroupList(e)},e.prototype.getBlockUltraGroupList=function(){return this._engine.getBlockUltraGroupList()},e.prototype.getTopUltraGroupList=function(){return this._engine.getTopUltraGroupList()},e.prototype.clearUnreadCount=function(e,t,n){if(e===exports.ConversationType.ULTRA_GROUP){var r=this._channelIdConvert(e,n);return this._engine.clearUltraUnreadcount(t,r||"")}return this._engine.clearConversationUnreadCount(e,t,n||"")},e.prototype.clearAllUnreadCount=function(){return this._engine.clearAllUnreadCount()},e.prototype.getUnreadCount=function(e,t,n){var r=this._channelIdConvert(e,n);return this._engine.getConversationUnreadCount(e,t,r||"")},e.prototype.getTotalUnreadCount=function(e,t,n){if(t&&t.includes(exports.ConversationType.ULTRA_GROUP)){var r=exports.ErrorCode.METHOD_NOT_SUPPORT;return Promise.resolve({code:r,msg:exports.ErrorCode[r]})}return this._engine.getAllConversationUnreadCount(e,t&&t.length>0?t:[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP,exports.ConversationType.SYSTEM,exports.ConversationType.PUBLIC_SERVICE],!!n)},e.prototype.getTotalUnreadCountByLevels=function(e,t,n){return this._engine.getTotalUnreadCountByLevels(e,t,n)},e.prototype.getFirstUnreadMessage=function(e,t,n){return this._engine.getFirstUnreadMessage(e,t,n||"")},e.prototype.getFirstUnreadMessageInfo=function(e,t,n){return this._engine.getFirstUnreadMessageInfo(e,t,n)},e.prototype.setConversationNotificationLevel=function(e,t,n,r){return ue(this,void 0,void 0,(function(){var o;return ce(this,(function(i){return o=this._channelIdConvert(e,r),[2,this._engine.setConversationNotificationLevel(e,t,n,o||"")]}))}))},e.prototype.batchSetConversationNotificationLevel=function(e,t){return this._engine.batchSetConversationNotificationLevel(e,t)},e.prototype.setConversationStatus=function(e,t,n,r,o,i){if(void 0===i&&(i=!0),e===exports.ConversationType.ULTRA_GROUP&&void 0!==n)return Promise.resolve(exports.ErrorCode.METHOD_NOT_SUPPORT);var s=this._channelIdConvert(e,o),a=[{conversationType:e,targetId:t,isTop:n,notificationLevel:r?Ae(r):void 0,channelId:s||"",isUpdateTime:i}];return this._engine.batchSetConversationStatus(a)},e.prototype.setConversationToTop=function(e,t,n,r,o){return this._engine.setConversationToTop(e,t,n,r,o)},e.prototype.batchSetConversationToTop=function(e,t,n){return this._engine.batchSetConversationToTop(e,t,!!n)},e.prototype.saveConversationMessageDraft=function(e,t,n,r){var o=this._channelIdConvert(e,r);return this._engine.saveConversationMessageDraft(e,t,n,o||"")},e.prototype.getConversationMessageDraft=function(e,t,n){var r=this._channelIdConvert(e,n);return this._engine.getConversationMessageDraft(e,t,r||"")},e.prototype.clearConversationMessageDraft=function(e,t,n){var r=this._channelIdConvert(e,n);return this._engine.clearConversationMessageDraft(e,t,r||"")},e.prototype.recallMessage=function(e,t){return ue(this,void 0,void 0,(function(){var n,r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return n=function(e,t){return at.create(e).isObject("conversatino",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION).isValueOf("conversationType",t.conversationType,exports.ConversationType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE).validate("targetId",t.targetId,Rt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("channelId",t.channelId,Ct).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID)}("recallMessage",e).isString("messageUId",t.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isInteger("sentTime",t.sentTime,!1).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,Rt,!1,1).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validatorConnected),n.isOk?(r=t.messageUId,o=this.logger.createTraceId(),this.logger.info(exports.LogTagId.A_RECALL_MESSAGE_T,JSON.stringify({messageUId:r}),o),i=e.conversationType,s=e.channelId,e.channelId=this._channelIdConvert(i,s)||"",[4,this._engine.recallMsg(e,t)]):(this.logger.warn(exports.LogTagId.A_RECALL_MESSAGE_E,n.errmsg()),[2,n.wipe()]);case 1:return a=u.sent(),this.logger.summary(exports.LogTagId.A_RECALL_MESSAGE_R,a,o,{messageUId:r}),[2,a]}}))}))},e.prototype.deleteRemoteMessage=function(e,t,n,r){if(e===exports.ConversationType.ULTRA_GROUP&&Ot())return Promise.resolve(exports.ErrorCode.METHOD_NOT_SUPPORT);var o=this._channelIdConvert(e,r);return this._engine.deleteRemoteMessage(e,t,n,o||"")},e.prototype.deleteRemoteMessageByTimestamp=function(e,t,n,r){var o=this._channelIdConvert(e,r);return this._engine.deleteRemoteMessageByTimestamp(e,t,n,o||"")},e.prototype.joinChatroom=function(e,t,n,r){return void 0===t&&(t=10),this._engine.joinChatroom(e,t,r,n)},e.prototype.joinExistChatroom=function(e,t,n,r){return void 0===t&&(t=10),this._engine.joinExistChatroom(e,t,r,n)},e.prototype.quitChatroom=function(e){return this._engine.quitChatroom(e)},e.prototype.getChatroomInfo=function(e,t,n){return this._engine.getChatroomInfo(e,t||0,n||0)},e.prototype.setChatroomEntry=function(e,t){var n=t.key,r=t.value;return Wt(n)?jt(r)?this._engine.setChatroomEntry(e,t):Promise.resolve(exports.ErrorCode.INVALID_PARAMETER_VALUE):Promise.resolve(exports.ErrorCode.INVALID_PARAMETER_KEY)},e.prototype.setChatroomEntries=function(e,t){for(var n=0;n<t.entries.length;n++){var r=t.entries[n],o=r.key,i=r.value;if(!Wt(o))return Promise.resolve({code:exports.ErrorCode.INVALID_PARAMETER_KEY});if(!jt(i))return Promise.resolve({code:exports.ErrorCode.INVALID_PARAMETER_VALUE})}var s=se(se({},t),{isOverwrite:t.isForce});return this._engine.setChatroomEntries(e,s)},e.prototype.forceSetChatroomEntry=function(e,t){var n=t.key,r=t.value;return Wt(n)?jt(r)?this._engine.forceSetChatroomEntry(e,t):Promise.resolve(exports.ErrorCode.INVALID_PARAMETER_VALUE):Promise.resolve(exports.ErrorCode.INVALID_PARAMETER_KEY)},e.prototype.removeChatroomEntry=function(e,t){var n=t.key;return Wt(n)?this._engine.removeChatroomEntry(e,t):Promise.resolve(exports.ErrorCode.INVALID_PARAMETER_KEY)},e.prototype.removeChatroomEntries=function(e,t){for(var n=0;n<t.entries.length;n++){var r=t.entries[n].key;if(!Wt(r))return Promise.resolve({code:exports.ErrorCode.INVALID_PARAMETER_KEY})}return this._engine.removeChatroomEntries(e,t)},e.prototype.forceRemoveChatroomEntry=function(e,t){var n=t.key;return Wt(n)?this._engine.forceRemoveChatroomEntry(e,t):Promise.resolve(exports.ErrorCode.INVALID_PARAMETER_KEY)},e.prototype.getChatroomEntry=function(e,t){return this._engine.getChatroomEntry(e,t)},e.prototype.getAllChatroomEntries=function(e){return this._engine.getAllChatroomEntry(e)},e.prototype.getChatroomHistoryMessages=function(e,t,n,r){return this._engine.getChatroomHistoryMessages(e,r||0,t||20,n||0)},e.prototype.getFileToken=function(e,t,n,r,o,i){return ue(this,void 0,void 0,(function(){var s,a,u,c,l,d;return ce(this,(function(p){switch(p.label){case 0:return s=this.getNaviInfoFromCache(),a=(null==s?void 0:s.uploadServer)||"",u=(null==s?void 0:s.ossConfig)||"",[4,this._engine.getFileToken(e,t,n,r,o,i)];case 1:return c=p.sent(),l=c.code,d=c.data,l===exports.ErrorCode.SUCCESS&&d?[2,Promise.resolve(Object.assign(d,{qiniu:a,ossConfig:d.ossConfig||u}))]:[2,Promise.reject(l)]}}))}))},e.prototype.getFileUrl=function(e,t,n,r){return ue(this,void 0,void 0,(function(){var o,i,s;return ce(this,(function(a){switch(a.label){case 0:return[4,this._engine.getFileUrl(e,n,t,r)];case 1:return o=a.sent(),i=o.code,s=o.data,i===exports.ErrorCode.SUCCESS?[2,Promise.resolve(s)]:[2,Promise.reject(i)]}}))}))},e.prototype.createTag=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return[2,this._engine.createTag(e)]}))}))},e.prototype.removeTag=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return[2,this._engine.removeTag(e)]}))}))},e.prototype.updateTag=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return[2,this._engine.updateTag(e)]}))}))},e.prototype.getTagList=function(){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){return[2,this._engine.getTagList()]}))}))},e.prototype.addTagForConversations=function(e,t){return ue(this,void 0,void 0,(function(){var n,r=this;return ce(this,(function(o){return t.length>1e3?[2,Promise.resolve({code:exports.ErrorCode.CONVER_OUT_LIMIT_ERROR})]:(n=t.map((function(e){var t=e.conversationType,n=e.targetId,o=e.channelId;return{conversationType:t,targetId:n,channelId:r._channelIdConvert(t,o)}})),[2,this._engine.addTagForConversations(e,n)])}))}))},e.prototype.removeTagForConversations=function(e,t){return ue(this,void 0,void 0,(function(){var n,r=this;return ce(this,(function(o){return n=t.map((function(e){var t=e.conversationType,n=e.targetId,o=e.channelId;return{conversationType:t,targetId:n,channelId:r._channelIdConvert(t,o)}})),[2,this._engine.removeTagForConversations(e,n)]}))}))},e.prototype.removeTagsForConversation=function(e,t){return ue(this,void 0,void 0,(function(){var n;return ce(this,(function(r){return n=this._channelIdConvert(e.conversationType,e.channelId),e.channelId=n,[2,this._engine.removeTagsForConversation(e,t)]}))}))},e.prototype.getConversationListByTag=function(e,t,n,r){return ue(this,void 0,void 0,(function(){return ce(this,(function(o){return[2,this._engine.getConversationListByTag(e,t,n,r)]}))}))},e.prototype.getUnreadCountByTag=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){return[2,this._engine.getUnreadCountByTag(e,t)]}))}))},e.prototype.setConversationStatusInTag=function(e,t,n){return ue(this,void 0,void 0,(function(){var r;return ce(this,(function(o){return r=this._channelIdConvert(t.conversationType,t.channelId),t.channelId=r,[2,this._engine.setConversationStatusInTag(e,t,n)]}))}))},e.prototype.getTagsForConversation=function(e){return ue(this,void 0,void 0,(function(){var t;return ce(this,(function(n){return t=this._channelIdConvert(e.conversationType,e.channelId),e.channelId=t,[2,this._engine.getTagsForConversation(e)]}))}))},e.prototype.getBlockConversationList=function(){return this._engine.getBlockConversationList()},e.prototype.getTopConversationList=function(e,t){return e&&0!==e.length||(e=[exports.ConversationType.PRIVATE,exports.ConversationType.CHATROOM,exports.ConversationType.GROUP,exports.ConversationType.SYSTEM,exports.ConversationType.APP_PUBLIC_SERVICE,exports.ConversationType.PUBLIC_SERVICE]),this._engine.getTopConversationList(e,t||"")},e.prototype.getUnreadConversationList=function(e){return e&&0!==e.length||(e=[exports.ConversationType.PRIVATE,exports.ConversationType.CHATROOM,exports.ConversationType.GROUP,exports.ConversationType.SYSTEM,exports.ConversationType.APP_PUBLIC_SERVICE,exports.ConversationType.PUBLIC_SERVICE]),this._engine.getUnreadConversationList(e)},e.prototype.getUnreadMentionedCount=function(e){var t=this._channelIdConvert(e.conversationType,e.channelId);return e.channelId=t,this._engine.getUnreadMentionedCount(e)},e.prototype.getAllUnreadMentionedCount=function(){return this._engine.getAllUnreadMentionedCount()},e.prototype.sendUltraGroupTypingStatus=function(e){if(e.conversationType!==exports.ConversationType.ULTRA_GROUP){var t=exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT;return Promise.resolve({code:t,msg:exports.ErrorCode[t]})}var n=this._channelIdConvert(e.conversationType,e.channelId);return e.channelId=n,this._engine.sendUltraGroupTypingStatus(e)},e.prototype.getUltraGroupMessageListByMessageUId=function(e){var t=this,n=e.messages.map((function(n){var r=n.sendTime,o=n.messageUId,i=n.channelId;return{sendTime:r,messageUId:o,channelId:t._channelIdConvert(e.conversationType,i)}}));return e.messages=n,this._engine.getUltraGroupMessageListByMessageUId(e)},e.prototype.expandUltraMessage=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o,i,s,a;return ce(this,(function(u){switch(u.label){case 0:return t=e.conversationType,n=e.expansion,r=e.canIncludeExpansion,t!==exports.ConversationType.ULTRA_GROUP?[2,{code:o=exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT,msg:exports.ErrorCode[o]}]:r?(i=yt(n),s=i.isIllgalEx,a=i.isExKeyOrValLengthExceedLimit,i.isExceedLimit||a?[2,{code:exports.ErrorCode.EXPANSION_LIMIT_EXCEET}]:s?[2,{code:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_EXPANSION}]:[4,this._engine.expandUltraMessage(e)]):[2,{code:exports.ErrorCode.MESSAGE_KV_NOT_SUPPORT}];case 1:return[2,{code:u.sent().code}]}}))}))},e.prototype.modifyMessage=function(e){return ue(this,void 0,void 0,(function(){var t;return ce(this,(function(n){switch(n.label){case 0:return e.conversationType!==exports.ConversationType.ULTRA_GROUP?[2,{code:t=exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT,msg:exports.ErrorCode[t]}]:[4,this._engine.modifyMessage(e)];case 1:return[2,{code:n.sent().code}]}}))}))},e.prototype.getUltraGroupUnreadMentionedCountByTargetId=function(e,t){return this._engine.getUltraGroupUnreadMentionedCountByTargetId(e,t)},e.prototype.getUltraGroupUnreadCountByTargetId=function(e,t){return this._engine.getUltraGroupUnreadCountByTargetId(e,t)},e.prototype.getAllUltraGroupUnreadCount=function(e){return void 0===e&&(e=!1),this._engine.getAllUltraGroupUnreadCount(e)},e.prototype.getAllConversationState=function(){return this._engine.getAllConversationState()},e.prototype.getUltraGroupUnreadMentionedMessages=function(e){var t=this._channelIdConvert(exports.ConversationType.ULTRA_GROUP,e.channelId);return e.channelId=t,this._engine.getUltraGroupUnreadMentionedMessages(e)},e.prototype.getUltraGroupFirstUnreadMessageTimestamp=function(e){var t=this._channelIdConvert(exports.ConversationType.ULTRA_GROUP,e.channelId);return e.channelId=t,this._engine.getUltraGroupFirstUnreadMessageTimestamp(e)},e.prototype.getUltraGroupUnreadInfoList=function(e){return this._engine.getUltraGroupUnreadInfoList(e)},e.prototype.callExtra=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return(t=this._engine).callExtra.apply(t,pe([e],de(n),!1))},e.prototype.getOSInfo=function(){return this._engine.getOSInfo()},e.prototype.getProcessInfo=function(){return this._engine.getProcessInfo()},e.prototype.getMainProcessInfo=function(){return this._engine.getMainProcessInfo()},e.prototype.setCallInfo=function(e,t,n){return this._engine.setCallInfo(e,t,n)},e.prototype.getGroupMessageDeliverList=function(e,t,n){return void 0===n&&(n=""),this._engine.getGroupMessageDeliverList(e,t,n)},e.prototype.getPrivateMessageDeliverTime=function(e,t){return void 0===t&&(t=""),this._engine.getPrivateMessageDeliverTime(e,t)},e.prototype._isEnableSubDriven=function(e){var t=(this.getNaviInfoFromCache()||{}).subDriven,n=void 0===t?0:t;switch(e){case exports.SubscribeType.ONLINE_STATUS:return 1&n;case exports.SubscribeType.USER_PROFILE:return 2&n;default:return!1}},e.prototype.subscribeUser=function(e,t,n){return this._isEnableSubDriven(t)?this._engine.subscribeUser(e,t,n):Promise.resolve({code:exports.ErrorCode.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})},e.prototype.unSubscribeUser=function(e,t){return this._isEnableSubDriven(t)?this._engine.unSubscribeUser(e,t):Promise.resolve({code:exports.ErrorCode.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})},e.prototype.getSubscribeUserList=function(e,t,n){return this._isEnableSubDriven(e)?this._engine.getSubscribeUserList(e,t,n):Promise.resolve({code:exports.ErrorCode.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})},e.prototype.getSubscribeUserStatus=function(e,t){return this._isEnableSubDriven(e)?this._engine.getSubscribeUserStatus(e,t):Promise.resolve({code:exports.ErrorCode.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE})},e.prototype.updateMyUserProfile=function(e){return this._engine.updateMyUserProfile(e)},e.prototype.getUserProfiles=function(e){return this._engine.getUserProfiles(e)},e.prototype.getMyUserProfile=function(){return this._engine.getMyUserProfile()},e.prototype.updateMyUserProfileVisibility=function(e){return this._engine.updateMyUserProfileVisibility(e)},e.prototype.getMyUserProfileVisibility=function(){return this._engine.getMyUserProfileVisibility()},e.prototype.searchUserProfileByUniqueId=function(e){return this._engine.searchUserProfileByUniqueId(e)},e.prototype.clearConversations=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){return[2,this._engine.clearConversations(e,t)]}))}))},e.prototype.setUserStatusListener=function(e,t){var n=this;return this._engine.setUserStatusListener(e,(function(e){try{t(e)}catch(e){n.logger.error(exports.LogTagId.L_CALLBACK_E,null==e?void 0:e.stack)}}))},e.prototype.addToBlacklist=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return[2,this._engine.addToBlacklist(e)]}))}))},e.prototype.removeFromBlacklist=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return[2,this._engine.removeFromBlacklist(e)]}))}))},e.prototype.getBlacklist=function(){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){return[2,this._engine.getBlacklist()]}))}))},e.prototype.getBlacklistStatus=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return[2,this._engine.getBlacklistStatus(e)]}))}))},e.prototype.insertMessage=function(e,t,n){return ue(this,void 0,void 0,(function(){var r,o,i;return ce(this,(function(s){return r=this.checkSearchPropsMsg(n.messageType,n.content),o=r.code,i=r.msg,o!==exports.ErrorCode.SUCCESS?[2,Promise.resolve({code:o,msg:i})]:[2,this._engine.insertMessage(e,t,n)]}))}))},e.prototype.batchInsertMessage=function(e,t){return this._engine.batchInsertMessage(e,t)},e.prototype.getMessageCount=function(e,t,n){return void 0===n&&(n=""),ue(this,void 0,void 0,(function(){return ce(this,(function(r){return[2,this._engine.getMessageCount(e,t,n)]}))}))},e.prototype.deleteMessages=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return[2,this._engine.deleteMessages(e)]}))}))},e.prototype.deleteMessagesByTimestamp=function(e,t,n,r,o){return void 0===o&&(o=""),ue(this,void 0,void 0,(function(){return ce(this,(function(i){return[2,this._engine.deleteMessagesByTimestamp(e,t,n,!!r,o)]}))}))},e.prototype.batchClearMessagesByTimestamp=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return[2,this._engine.batchClearMessagesByTimestamp(e)]}))}))},e.prototype.batchClearRemoteHistoryMessages=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){return[2,this._engine.batchClearRemoteHistoryMessages(e,t)]}))}))},e.prototype.clearMessages=function(e,t,n){return void 0===n&&(n=""),ue(this,void 0,void 0,(function(){return ce(this,(function(r){return[2,this._engine.clearMessages(e,t,n)]}))}))},e.prototype.getLocalMessage=function(e){return ue(this,void 0,void 0,(function(){var t,n,r,o=this;return ce(this,(function(i){switch(i.label){case 0:return t=at.create("getLocalMessage").validate("messageId",e,(function(){return lt(e)||dt(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).result(),n=this.logger.createTraceId(),this.logger.info(exports.LogTagId.A_GET_LOCAL_MESSAGE_T,JSON.stringify({messageId:e}),n),[4,t.next((function(){return o._engine.getMessage(e)}))];case 1:return r=i.sent(),this.logger.summary(exports.LogTagId.A_GET_LOCAL_MESSAGE_R,r,n,{messageId:e}),[2,r]}}))}))},e.prototype.setMessageContent=function(e,t,n){return ue(this,void 0,void 0,(function(){return ce(this,(function(r){return[2,this._engine.setMessageContent(e,t,n)]}))}))},e.prototype.setMessageSearchField=function(e,t,n){return ue(this,void 0,void 0,(function(){return ce(this,(function(r){return[2,this._engine.setMessageSearchField(e,t,n)]}))}))},e.prototype.setMessageSentStatus=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){return[2,this._engine.setMessageSentStatus(e,t)]}))}))},e.prototype.setMessageReceivedStatus=function(e,t){return ue(this,void 0,void 0,(function(){return ce(this,(function(n){return[2,this._engine.setMessageReceivedStatus(e,t)]}))}))},e.prototype.setMessageStatusToRead=function(e,t,n,r){return ue(this,void 0,void 0,(function(){return ce(this,(function(o){return[2,this._engine.updateMessageReceiptStatus(e,t,n,r)]}))}))},e.prototype.setUserStatus=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return[2,this._engine.setUserStatus(e)]}))}))},e.prototype.subscribeUserStatus=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return[2,this._engine.subscribeUserStatus(e)]}))}))},e.prototype.getUserStatus=function(e){return ue(this,void 0,void 0,(function(){return ce(this,(function(t){return[2,this._engine.getUserStatus(e)]}))}))},e.prototype.searchConversationByContent=function(e,t,n,r){return void 0===t&&(t=[]),ue(this,void 0,void 0,(function(){return ce(this,(function(o){return[2,this._engine.searchConversationByContent(e,t,n||"",r)]}))}))},e.prototype.searchConversationByContentWithAllChannel=function(e,t,n){return void 0===t&&(t=[]),ue(this,void 0,void 0,(function(){return ce(this,(function(r){return[2,this._engine.searchConversationByContentWithAllChannel(e,t,n)]}))}))},e.prototype.searchMessageByContent=function(e,t,n,r,o,i,s){return void 0===s&&(s=""),ue(this,void 0,void 0,(function(){return ce(this,(function(a){return[2,this._engine.searchMessageByContent(e,t,n,r,o,i,s)]}))}))},e.prototype.searchMessageByContentAndMessageType=function(e,t,n,r,o,i,s){return ue(this,void 0,void 0,(function(){return ce(this,(function(a){return[2,this._engine.searchMessageByContentAndMessageType(e,t,n,r,o,i,s)]}))}))},e.prototype.searchMessagesByUser=function(e,t,n,r,o,i){return void 0===o&&(o=5),void 0===i&&(i=""),ue(this,void 0,void 0,(function(){return ce(this,(function(s){return[2,this._engine.searchMessagesByUser(e,t,n,r,o,i)]}))}))},e.prototype.getMessagesByTimestamp=function(e,t,n,r){return ue(this,void 0,void 0,(function(){return ce(this,(function(o){return[2,this._engine.getMessagesByTimestamp(e,t,n,r)]}))}))},e.prototype.searchMessageByContentWithAllChannel=function(e,t,n,r,o){return ue(this,void 0,void 0,(function(){return ce(this,(function(i){return[2,this._engine.searchMessageByContentWithAllChannel(e,t,n,r,o)]}))}))},e.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(e,t,n,r,o,i,s){return ue(this,void 0,void 0,(function(){return ce(this,(function(a){return[2,this._engine.searchMessageByContentInTimeRangeWithAllChannel(e,t,n,r,o,i,s)]}))}))},e.prototype.getUnreadMentionedMessages=function(e,t,n){return void 0===n&&(n=""),this._engine.getUnreadMentionedMessages(e,t,n)},e.prototype.clearUnreadCountByTimestamp=function(e,t,n,r){return void 0===r&&(r=""),this._engine.clearUnreadCountByTimestamp(e,t,n,r)},e.prototype.getUltraGroupDefaultNotificationLevel=function(e,t){var n=this._channelIdConvert(exports.ConversationType.ULTRA_GROUP,t);return this._engine.getUltraGroupDefaultNotificationLevel(e,n||"")},e.prototype.setUltraGroupDefaultNotificationLevel=function(e,t,n){var r=this._channelIdConvert(exports.ConversationType.ULTRA_GROUP,n);return this._engine.setUltraGroupDefaultNotificationLevel(e,t,r||"")},e.prototype.getConversationNotificationLevel=function(e,t,n){var r=this._channelIdConvert(e,n);return this._engine.getConversationNotificationLevel(e,t,r||"")},e.prototype.setConversationTypeNotificationLevel=function(e,t){return this._engine.setConversationTypeNotificationLevel(e,t)},e.prototype.getConversationTypeNotificationLevel=function(e){return this._engine.getConversationTypeNotificationLevel(e)},e.prototype.getConversationNotificationStatus=function(e,t,n){var r=this._channelIdConvert(e,n);return this._engine.getConversationNotificationStatus(e,t,r||"")},e.prototype.getRemoteHistoryMessages=function(e,t,n,r,o,i){return this._engine.getRemoteHistoryMessages(e,t,n,r,o,i)},e.prototype.getConversationListWithAllChannel=function(){return this._engine.getConversationListWithAllChannel()},e.prototype.getConversationListWithAllChannelByPage=function(e,t){return this._engine.getConversationListWithAllChannelByPage(e,t)},e.prototype.clearData=function(){return ue(this,void 0,void 0,(function(){return ce(this,(function(e){return[2,this._engine.clearData()]}))}))},e.prototype.createLogger=function(e,t){return this._engine.createLogger(e,t)},e.prototype.getConversations=function(e){return this._engine.getConversations(e)},e.prototype.setCheckDuplicateMessage=function(e){return this._engine.setCheckDuplicateMessage(e)},e.prototype.setCheckChatRoomDuplicateMessage=function(e){return this._engine.setCheckChatRoomDuplicateMessage(e)},e.prototype.rtcSignaling=function(e,t,n,r){return this._engine.rtcSignaling(e,t,n,r)},e.prototype.rtcPing=function(e,t,n){return this._engine.rtcPing(e,t,n)},e.prototype.bindRTCRoomForChatroom=function(e){return this._engine.bindRTCRoomForChatroom(e)},e.prototype.setProxy=function(e){return this._engine.setProxy(e)},e.prototype.getProxy=function(){return this._engine.getProxy()},e.prototype.testProxy=function(e,t){return this._engine.testProxy(e,t)},e.prototype.createGroup=function(e,t,n,r){return void 0===r&&(r=[]),this._engine.createGroup(e,t,n,r)},e.prototype.updateGroupInfo=function(e,t,n){return this._engine.updateGroupInfo(e,t,n)},e.prototype.getGroupsInfo=function(e){return this._engine.getGroupsInfo(e)},e.prototype.kickGroupMembers=function(e,t,n){return this._engine.kickGroupMembers(e,t,n)},e.prototype.quitGroup=function(e,t){return this._engine.quitGroup(e,t)},e.prototype.dismissGroup=function(e){return this._engine.dismissGroup(e)},e.prototype.transferGroupOwner=function(e,t,n,r){return void 0===r&&(r=!1),this._engine.transferGroupOwner(e,t,r,n)},e.prototype.setGroupManagers=function(e,t,n){return this._engine.setGroupManagers(e,t,n)},e.prototype.getGroupMembersByRole=function(e,t,n){return this._engine.getGroupMembersByRole(e,t,n)},e.prototype.getGroupMembers=function(e,t){return this._engine.getGroupMembers(e,t)},e.prototype.setGroupMemberInfo=function(e,t,n,r){return this._engine.setGroupMemberInfo(e,t,n,r)},e.prototype.searchGroupMembers=function(e,t,n){return this._engine.searchGroupMembers(e,t,n)},e.prototype.joinGroup=function(e){return this._engine.joinGroup(e)},e.prototype.inviteUsersToGroup=function(e,t){return this._engine.inviteUsersToGroup(e,t)},e.prototype.acceptGroupInvite=function(e,t){return this._engine.memberInviteResponse({groupId:e,inviterId:t,optType:0,optResult:exports.GroupOperationStatus.ACCEPT})},e.prototype.refuseGroupInvite=function(e,t,n){return this._engine.memberInviteResponse({groupId:e,inviterId:t,optType:0,optResult:exports.GroupOperationStatus.REFUSE,reason:n})},e.prototype.acceptGroupApplication=function(e,t,n){return this._engine.memberInviteResponse({groupId:e,joinUserId:t,inviterId:n,optType:1,optResult:exports.GroupOperationStatus.ACCEPT})},e.prototype.refuseGroupApplication=function(e,t,n,r){return this._engine.memberInviteResponse({groupId:e,joinUserId:t,inviterId:n,optType:1,optResult:exports.GroupOperationStatus.REFUSE,reason:r})},e.prototype.getGroupApplications=function(e,t,n){return this._engine.getGroupApplications(e,t,n)},e.prototype.getJoinedGroupsByRole=function(e,t){return this._engine.getJoinedGroupsByRole(e,t)},e.prototype.searchJoinedGroups=function(e,t){return this._engine.searchJoinedGroups(e,t)},e.prototype.getJoinedGroups=function(e){return this._engine.getJoinedGroups(e)},e.prototype.setGroupRemark=function(e,t){return this._engine.setGroupRemark(e,t)},e.prototype.addGroupFollows=function(e,t){return this._engine.setGroupFollows(exports.GroupOperationType.ADD,e,t)},e.prototype.removeGroupFollows=function(e,t){return this._engine.setGroupFollows(exports.GroupOperationType.REMOVE,e,t)},e.prototype.getGroupFollows=function(e){return this._engine.getGroupFollows(e)},e.prototype.addFriend=function(e,t,n){return this._engine.addFriend(e,t,n)},e.prototype.deleteFriends=function(e,t){return this._engine.deleteFriends(e,t)},e.prototype.acceptFriendApplication=function(e){return this._engine.acceptFriendApplication(e)},e.prototype.refuseFriendApplication=function(e,t){return this._engine.refuseFriendApplication(e,t)},e.prototype.setFriendInfo=function(e,t,n){return this._engine.setFriendInfo(e,t,n)},e.prototype.checkFriends=function(e,t){return this._engine.checkFriends(e,t)},e.prototype.getFriends=function(e,t){return this._engine.getFriends(e,t)},e.prototype.getFriendApplications=function(e,t,n){return this._engine.getFriendApplications(e,t,n)},e.prototype.getFriendsInfo=function(e){return this._engine.getFriendsInfo(e)},e.prototype.searchFriendsInfo=function(e){return this._engine.searchFriendsInfo(e)},e.prototype.setFriendAddPermission=function(e){return this._engine.setFriendAddPermission(e)},e.prototype.getFriendAddPermission=function(){return this._engine.getFriendAddPermission()},e.prototype.getRealtimeConversations=function(e,t,n){return this._engine.getRealtimeConversations(e,t,n)},e.prototype.getRealtimeConTotalUnreadCount=function(){return this._engine.getRealtimeConTotalUnreadCount()},e.prototype.clearRealtimeConUnreadCount=function(e){return this._engine.clearRealtimeConUnreadCount(e)},e.prototype.removeRealtimeConversations=function(e){return this._engine.removeRealtimeConversations(e)},e.prototype.getRealtimeConUnreadCounts=function(e){return this._engine.getRealtimeConUnreadCounts(e)},e.prototype.setNotificationQuietHoursWithSetting=function(e){var t=this;return at.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).isValueOf("level",e.level,exports.PushNotificationQuietHoursLevel,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().next((function(){return t._engine.setNotificationQuietHoursWithSetting(e)}))},e.prototype.removeNotificationQuietHoursSetting=function(){return this._engine.removeNotificationQuietHoursSetting()},e.prototype.getNotificationQuietHoursSetting=function(){return this._engine.getNotificationQuietHoursSetting()},e.prototype.getStatsUrlList=function(){return this._engine.getStatsUrlList()},ae([Th],e.prototype,"updateMyUserProfile",null),ae([Th],e.prototype,"getUserProfiles",null),ae([Th],e.prototype,"getMyUserProfile",null),ae([Th],e.prototype,"updateMyUserProfileVisibility",null),ae([Th],e.prototype,"getMyUserProfileVisibility",null),ae([Th],e.prototype,"searchUserProfileByUniqueId",null),ae([Th],e.prototype,"createGroup",null),ae([Th],e.prototype,"updateGroupInfo",null),ae([Th],e.prototype,"getGroupsInfo",null),ae([Th],e.prototype,"kickGroupMembers",null),ae([Th],e.prototype,"quitGroup",null),ae([Th],e.prototype,"dismissGroup",null),ae([Th],e.prototype,"transferGroupOwner",null),ae([Th],e.prototype,"setGroupManagers",null),ae([Th],e.prototype,"getGroupMembersByRole",null),ae([Th],e.prototype,"getGroupMembers",null),ae([Th],e.prototype,"setGroupMemberInfo",null),ae([Th],e.prototype,"searchGroupMembers",null),ae([Th],e.prototype,"joinGroup",null),ae([Th],e.prototype,"inviteUsersToGroup",null),ae([Th],e.prototype,"acceptGroupInvite",null),ae([Th],e.prototype,"refuseGroupInvite",null),ae([Th],e.prototype,"acceptGroupApplication",null),ae([Th],e.prototype,"refuseGroupApplication",null),ae([Th],e.prototype,"getGroupApplications",null),ae([Th],e.prototype,"getJoinedGroupsByRole",null),ae([Th],e.prototype,"searchJoinedGroups",null),ae([Th],e.prototype,"getJoinedGroups",null),ae([Th],e.prototype,"setGroupRemark",null),ae([Th],e.prototype,"addGroupFollows",null),ae([Th],e.prototype,"removeGroupFollows",null),ae([Th],e.prototype,"getGroupFollows",null),ae([Th],e.prototype,"addFriend",null),ae([Th],e.prototype,"deleteFriends",null),ae([Th],e.prototype,"acceptFriendApplication",null),ae([Th],e.prototype,"refuseFriendApplication",null),ae([Th],e.prototype,"setFriendInfo",null),ae([Th],e.prototype,"checkFriends",null),ae([Th],e.prototype,"getFriends",null),ae([Th],e.prototype,"getFriendApplications",null),ae([Th],e.prototype,"getFriendsInfo",null),ae([Th],e.prototype,"searchFriendsInfo",null),ae([Th],e.prototype,"setFriendAddPermission",null),ae([Th],e.prototype,"getFriendAddPermission",null),ae([vh],e.prototype,"getRealtimeConversations",null),ae([vh],e.prototype,"getRealtimeConTotalUnreadCount",null),ae([vh],e.prototype,"clearRealtimeConUnreadCount",null),ae([vh],e.prototype,"removeRealtimeConversations",null),ae([vh],e.prototype,"getRealtimeConUnreadCounts",null),e}();exports.APIContext=Ch,exports.AppStorage=uu,exports.BasicEngine=ja,exports.BasicLogger=pn,exports.Codec=ss,exports.EventEmitter=is,exports.MAX_MESSAGE_CONTENT_BYTES=Le,exports.MAX_UPLOAD_FILE_SIZE=5368709120,exports.PBCodec=Rr,exports.PluginContext=Xa,exports.RCResult=ot,exports.RTCPluginContext=$a,exports.SEND_MESSAGE_TYPE_OPTION=Ue,exports.SuspendablePromise=rt,exports.UPLOAD_FILE_CHUNK_SIZE=10485760,exports.UUId=Ze,exports.Validator=at,exports.ValidatorManage=iu,exports.VersionManage=ze,exports.assert=function(e,t,n,r){if(void 0===r&&(r=!1),!ou(e,t,n,r))throw new ru("'".concat(e,"' is invalid: ").concat(JSON.stringify(t)))},exports.fail=st,exports.fixUrlProtocol=Xt,exports.forEach=St,exports.getUUID=function(){return Ze.gen()},exports.getUUID22=function(){return Ze.genWithLen(22)},exports.httpRequest=rn,exports.isArray=pt,exports.isBoolean=function(e){return"boolean"==typeof e},exports.isFunction=ft,exports.isHttpUrl=It,exports.isInteger=function(e){return function(t){return Number.isInteger(t)&&(void 0===e.min||t>=e.min)&&(void 0===e.max||t<=e.max)}},exports.isLimitedArray=function(e){return function(t){if(!pt(t)||void 0!==e.minLength&&t.length<e.minLength||void 0!==e.maxLength&&t.length>e.maxLength)return!1;if(!e.itemValidator)return!0;var n=!0;return t.every((function(t){var r=e.itemValidator&&e.itemValidator(t);return"object"==typeof r?r.errorKey?(n={errorKey:r.errorKey,valid:r.valid},!1):(n=r.valid,r.valid):(n=!!r,r)})),n}},exports.isLimitedString=ht,exports.isNull=function(e){return"[object Null]"===Object.prototype.toString.call(e)},exports.isNumber=dt,exports.isObject=gt,exports.isString=lt,exports.isUndefined=Et,exports.isValidConversation=function(e,t){var n;return gt(e)?(t&&!t.includes(e.conversationType)&&(n="conversationTypeNotSupport"),Rt(e.targetId)||(n="targetId"),vt(e.conversationType)||(n="conversationType"),Et(e.channelId)||Ct(e.channelId)||(n="channelId"),Et(n)?{valid:!0}:{valid:Et(n),errorKey:n}):{valid:!1,errorKey:"conversation"}},exports.isValidConversationType=vt,exports.isValidEnum=function(e){return Object.values(e.type).includes(e.value)},exports.isValidFileType=function(e){return dt(e)&&Object.prototype.hasOwnProperty.call(exports.FileType,e)},exports.isValidGroupId=function(e){return ht({minLength:1,maxLength:64})(e)&&/^[a-zA-Z0-9+=\-_|:]*$/.test(e)},exports.isValidNotificationLevel=function(e){return dt(e)&&Object.prototype.hasOwnProperty.call(exports.NotificationLevel,e)},exports.isValidTargetId=Rt,exports.logger=os,exports.map=At,exports.notEmptyArray=function(e){return pt(e)&&e.length>0},exports.notEmptyObject=Tt,exports.notEmptyString=_t,exports.ok=it,exports.runtime=Tr,exports.transformNotificationLevel=Ne,exports.transformNotificationStatus=Ae,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.transformReceivedStatusInfo=Ut,exports.usingCppEngine=Ot,exports.validate=ou;
|