tim-wx-sdk
Version:
Tencent Cloud Chat SDK for Wechat Mini Program
1 lines • 564 kB
JavaScript
'use strict';const e={SDK_READY:"sdkStateReady",SDK_NOT_READY:"sdkStateNotReady",SDK_DESTROY:"sdkDestroy",MESSAGE_RECEIVED:"onMessageReceived",MESSAGE_MODIFIED:"onMessageModified",MESSAGE_REVOKED:"onMessageRevoked",MESSAGE_READ_BY_PEER:"onMessageReadByPeer",MESSAGE_READ_RECEIPT_RECEIVED:"onMessageReadReceiptReceived",MESSAGE_EXTENSIONS_UPDATED:"onMessageExtensionsUpdated",MESSAGE_EXTENSIONS_DELETED:"onMessageExtensionsDeleted",CONVERSATION_LIST_UPDATED:"onConversationListUpdated",TOTAL_UNREAD_MESSAGE_COUNT_UPDATED:"onTotalUnreadMessageCountUpdated",CONVERSATION_GROUP_LIST_UPDATED:"onConversationGroupListUpdated",CONVERSATION_IN_GROUP_UPDATED:"onConversationInGroupUpdated",GROUP_LIST_UPDATED:"onGroupListUpdated",GROUP_SYSTEM_NOTICE_RECEIVED:"receiveGroupSystemNotice",GROUP_ATTRIBUTES_UPDATED:"groupAttributesUpdated",GROUP_COUNTER_UPDATED:"onGroupCounterUpdated",TOPIC_CREATED:"onTopicCreated",TOPIC_DELETED:"onTopicDeleted",TOPIC_UPDATED:"onTopicUpdated",PROFILE_UPDATED:"onProfileUpdated",USER_STATUS_UPDATED:"onUserStatusUpdated",BLACKLIST_UPDATED:"blacklistUpdated",FRIEND_LIST_UPDATED:"onFriendListUpdated",FRIEND_GROUP_LIST_UPDATED:"onFriendGroupListUpdated",FRIEND_APPLICATION_LIST_UPDATED:"onFriendApplicationListUpdated",KICKED_OUT:"kickedOut",ERROR:"error",NET_STATE_CHANGE:"netStateChange",SDK_RELOAD:"sdkReload"},t={MSG_TEXT:"TIMTextElem",MSG_IMAGE:"TIMImageElem",MSG_SOUND:"TIMSoundElem",MSG_AUDIO:"TIMSoundElem",MSG_FILE:"TIMFileElem",MSG_FACE:"TIMFaceElem",MSG_VIDEO:"TIMVideoFileElem",MSG_GEO:"TIMLocationElem",MSG_LOCATION:"TIMLocationElem",MSG_GRP_TIP:"TIMGroupTipElem",MSG_GRP_SYS_NOTICE:"TIMGroupSystemNoticeElem",MSG_CUSTOM:"TIMCustomElem",MSG_MERGER:"TIMRelayElem",MSG_PRIORITY_HIGH:"High",MSG_PRIORITY_NORMAL:"Normal",MSG_PRIORITY_LOW:"Low",MSG_PRIORITY_LOWEST:"Lowest",CONV_C2C:"C2C",CONV_GROUP:"GROUP",CONV_TOPIC:"TOPIC",CONV_SYSTEM:"@TIM#SYSTEM",CONV_AT_ME:1,CONV_AT_ALL:2,CONV_AT_ALL_AT_ME:3,CONV_MARK_TYPE_STAR:1,CONV_MARK_TYPE_UNREAD:2,CONV_MARK_TYPE_FOLD:4,CONV_MARK_TYPE_HIDE:8,GRP_PRIVATE:"Private",GRP_WORK:"Private",GRP_PUBLIC:"Public",GRP_CHATROOM:"ChatRoom",GRP_MEETING:"ChatRoom",GRP_AVCHATROOM:"AVChatRoom",GRP_COMMUNITY:"Community",GRP_MBR_ROLE_OWNER:"Owner",GRP_MBR_ROLE_ADMIN:"Admin",GRP_MBR_ROLE_MEMBER:"Member",GRP_MBR_ROLE_CUSTOM:"Custom",GRP_TIP_MBR_JOIN:1,GRP_TIP_MBR_QUIT:2,GRP_TIP_MBR_KICKED_OUT:3,GRP_TIP_MBR_SET_ADMIN:4,GRP_TIP_MBR_CANCELED_ADMIN:5,GRP_TIP_GRP_PROFILE_UPDATED:6,GRP_TIP_MBR_PROFILE_UPDATED:7,GRP_TIP_BAN_AVCHATROOM_MEMBER:10,GRP_TIP_UNBAN_AVCHATROOM_MEMBER:11,MSG_REMIND_ACPT_AND_NOTE:"AcceptAndNotify",MSG_REMIND_ACPT_NOT_NOTE:"AcceptNotNotify",MSG_REMIND_DISCARD:"Discard",GENDER_UNKNOWN:"Gender_Type_Unknown",GENDER_FEMALE:"Gender_Type_Female",GENDER_MALE:"Gender_Type_Male",KICKED_OUT_MULT_ACCOUNT:"multipleAccount",KICKED_OUT_MULT_DEVICE:"multipleDevice",KICKED_OUT_USERSIG_EXPIRED:"userSigExpired",KICKED_OUT_REST_API:"REST_API_Kick",ALLOW_TYPE_ALLOW_ANY:"AllowType_Type_AllowAny",ALLOW_TYPE_NEED_CONFIRM:"AllowType_Type_NeedConfirm",ALLOW_TYPE_DENY_ANY:"AllowType_Type_DenyAny",FORBID_TYPE_NONE:"AdminForbid_Type_None",FORBID_TYPE_SEND_OUT:"AdminForbid_Type_SendOut",JOIN_OPTIONS_FREE_ACCESS:"FreeAccess",JOIN_OPTIONS_NEED_PERMISSION:"NeedPermission",JOIN_OPTIONS_DISABLE_APPLY:"DisableApply",JOIN_STATUS_SUCCESS:"JoinedSuccess",JOIN_STATUS_ALREADY_IN_GROUP:"AlreadyInGroup",JOIN_STATUS_WAIT_APPROVAL:"WaitAdminApproval",INVITE_OPTIONS_DISABLE_INVITE:"DisableInvite",INVITE_OPTIONS_NEED_PERMISSION:"NeedPermission",INVITE_OPTIONS_FREE_ACCESS:"FreeAccess",GRP_PROFILE_OWNER_ID:"ownerID",GRP_PROFILE_CREATE_TIME:"createTime",GRP_PROFILE_LAST_INFO_TIME:"lastInfoTime",GRP_PROFILE_MEMBER_NUM:"memberNum",GRP_PROFILE_MAX_MEMBER_NUM:"maxMemberNum",GRP_PROFILE_JOIN_OPTION:"joinOption",GRP_PROFILE_INVITE_OPTION:"inviteOption",GRP_PROFILE_INTRODUCTION:"introduction",GRP_PROFILE_NOTIFICATION:"notification",GRP_PROFILE_MUTE_ALL_MBRS:"muteAllMembers",SNS_ADD_TYPE_SINGLE:"Add_Type_Single",SNS_ADD_TYPE_BOTH:"Add_Type_Both",SNS_DELETE_TYPE_SINGLE:"Delete_Type_Single",SNS_DELETE_TYPE_BOTH:"Delete_Type_Both",SNS_APPLICATION_TYPE_BOTH:"Pendency_Type_Both",SNS_APPLICATION_SENT_TO_ME:"Pendency_Type_ComeIn",SNS_APPLICATION_SENT_BY_ME:"Pendency_Type_SendOut",SNS_APPLICATION_AGREE:"Response_Action_Agree",SNS_APPLICATION_AGREE_AND_ADD:"Response_Action_AgreeAndAdd",SNS_CHECK_TYPE_BOTH:"CheckResult_Type_Both",SNS_CHECK_TYPE_SINGLE:"CheckResult_Type_Single",SNS_TYPE_NO_RELATION:"CheckResult_Type_NoRelation",SNS_TYPE_A_WITH_B:"CheckResult_Type_AWithB",SNS_TYPE_B_WITH_A:"CheckResult_Type_BWithA",SNS_TYPE_BOTH_WAY:"CheckResult_Type_BothWay",NET_STATE_CONNECTED:"connected",NET_STATE_CONNECTING:"connecting",NET_STATE_DISCONNECTED:"disconnected",MSG_AT_ALL:"__kImSDK_MesssageAtALL__",READ_ALL_C2C_MSG:"readAllC2CMessage",READ_ALL_GROUP_MSG:"readAllGroupMessage",READ_ALL_MSG:"readAllMessage",USER_STATUS_UNKNOWN:0,USER_STATUS_ONLINE:1,USER_STATUS_OFFLINE:2,USER_STATUS_UNLOGINED:3};class s{constructor(){this.cache=[],this.options=null}use(e){if("function"!=typeof e)throw"middleware must be a function";return this.cache.push(e),this}next(e){if(this.middlewares&&this.middlewares.length>0){return this.middlewares.shift().call(this,this.options,this.next.bind(this))}}run(e){return this.middlewares=this.cache.map((function(e){return e})),this.options=e,this.next()}}class o{constructor(e=0,t=0){this.high=e,this.low=t}equal(e){return null!==e&&(this.low===e.low&&this.high===e.high)}toString(){const e=Number(this.high).toString(16);let t=Number(this.low).toString(16);if(t.length<8){let e=8-t.length;for(;e;)t="0"+t,e--}return e+t}}const i={TEST:{CHINA:{DEFAULT:"wss://wss-dev.tim.qq.com"},OVERSEA:{DEFAULT:"wss://wss-dev.tim.qq.com"},SINGAPORE:{DEFAULT:"wss://wsssgp-dev.im.qcloud.com"},KOREA:{DEFAULT:"wss://wsskr-dev.im.qcloud.com"},GERMANY:{DEFAULT:"wss://wssger-dev.im.qcloud.com"},IND:{DEFAULT:"wss://wssind-dev.im.qcloud.com"},JPN:{DEFAULT:"wss://wssjpn-dev.im.qcloud.com"},USA:{DEFAULT:"wss://wssusa-dev.im.qcloud.com"}},PRODUCTION:{CHINA:{DEFAULT:"wss://wss.im.qcloud.com",BACKUP:"wss://wss.tim.qq.com",STAT:"https://events.im.qcloud.com",ANYCAST:"wss://162.14.13.203"},OVERSEA:{DEFAULT:"wss://wss.im.qcloud.com",BACKUP:"wss://wss.my-imcloud.com",STAT:"https://api.my-imcloud.com"},SINGAPORE:{DEFAULT:"wss://wsssgp.im.qcloud.com",BACKUP:"wss://wsssgp.my-imcloud.com",STAT:"https://apisgp.my-imcloud.com"},KOREA:{DEFAULT:"wss://wsskr.im.qcloud.com",BACKUP:"wss://wsskr.my-imcloud.com",STAT:"https://apikr.my-imcloud.com"},GERMANY:{DEFAULT:"wss://wssger.im.qcloud.com",BACKUP:"wss://wssger.my-imcloud.com",STAT:"https://apiger.my-imcloud.com"},IND:{DEFAULT:"wss://wssind.my-imcloud.com",BACKUP:"wss://wssind.im.qcloud.com",STAT:"https://apiind.my-imcloud.com"},JPN:{DEFAULT:"wss://wssjpn.im.qcloud.com",BACKUP:"wss://wssjpn.my-imcloud.com",STAT:"https://apijpn.my-imcloud.com"},USA:{DEFAULT:"wss://wssusa.im.qcloud.com",BACKUP:"wss://wssusa.my-imcloud.com",STAT:"https://apiusa.my-imcloud.com"}}},n={ANDROID:2,IOS:3,MAC:4,WEB:7,WX_MP:8,QQ_MP:9,TT_MP:10,BAIDU_MP:11,ALI_MP:12,IPAD:13,UNI_NATIVE_APP:15},r="1.7.3",a=537048168,u="CHINA",c="OVERSEA",l="SINGAPORE",d="KOREA",p="GERMANY",h="IND",g="JPN",_="USA",m={HOST:{CURRENT:{DEFAULT:"wss://wss.im.qcloud.com",STAT:"https://events.im.qcloud.com"},setCurrent(e=u){this.CURRENT=i.PRODUCTION[e]}},NAME:{OPEN_IM:"openim",OPEN_IM_MSG_EXT:"openim_msg_ext_http_svc",GROUP:"group_open_http_svc",GROUP_AVCHATROOM:"group_open_avchatroom_http_svc",GROUP_COMMUNITY:"million_group_open_http_svc",GROUP_ATTR:"group_open_attr_http_svc",FRIEND:"sns",PROFILE:"profile",RECENT_CONTACT:"recentcontact",PIC:"openpic",BIG_GROUP_NO_AUTH:"group_open_http_noauth_svc",BIG_GROUP_LONG_POLLING:"group_open_long_polling_http_svc",BIG_GROUP_LONG_POLLING_NO_AUTH:"group_open_long_polling_http_noauth_svc",IM_OPEN_STAT:"imopenstat",WEB_IM:"webim",IM_COS_SIGN:"im_cos_sign_svr",CUSTOM_UPLOAD:"im_cos_msg",HEARTBEAT:"heartbeat",IM_OPEN_PUSH:"im_open_push",IM_OPEN_STATUS:"im_open_status",IM_LONG_MESSAGE:"im_long_msg",IM_CONFIG_MANAGER:"im_sdk_config_mgr",STAT_SERVICE:"StatSvc",OVERLOAD_PUSH:"OverLoadPush",IM_MSG_AUDIT_MGR:"im_msg_audit_mgr",TUIROOM_SVR:"tui_room_svr",IM_OPEN_TRANSLATE:"im_open_translate"},CMD:{LOGIN:"wslogin",LOGOUT_LONG_POLL:"longpollinglogout",LOGOUT:"wslogout",HELLO:"wshello",STAT_BACKGROUND:"ws_stat_background",STAT_FOREGROUND:"ws_stat_foreground",SET_TOKEN:"ws_stat_settoken",PORTRAIT_GET:"portrait_get_all",PORTRAIT_SET:"portrait_set",GET_LONG_POLL_ID:"getlongpollingid",LONG_POLL:"longpolling",AVCHATROOM_LONG_POLL:"get_msg",ADD_FRIEND:"friend_add",UPDATE_FRIEND:"friend_update",GET_FRIEND_LIST:"friend_get",GET_FRIEND_PROFILE:"friend_get_specified",DELETE_FRIEND:"friend_delete",CHECK_FRIEND:"friend_check",GET_FRIEND_GROUP_LIST:"group_get",RESPOND_FRIEND_APPLICATION:"friend_response",GET_FRIEND_APPLICATION_LIST:"pendency_get",DELETE_FRIEND_APPLICATION:"pendency_delete",REPORT_FRIEND_APPLICATION:"pendency_report",GET_GROUP_APPLICATION:"get_pendency",CREATE_FRIEND_GROUP:"group_add",DELETE_FRIEND_GROUP:"group_delete",UPDATE_FRIEND_GROUP:"group_update",GET_BLACKLIST:"black_list_get",ADD_BLACKLIST:"black_list_add",DELETE_BLACKLIST:"black_list_delete",CREATE_GROUP:"create_group",GET_JOINED_GROUPS:"get_joined_group_list",SET_GROUP_ATTRIBUTES:"set_group_attr",MODIFY_GROUP_ATTRIBUTES:"modify_group_attr",DELETE_GROUP_ATTRIBUTES:"delete_group_attr",CLEAR_GROUP_ATTRIBUTES:"clear_group_attr",GET_GROUP_ATTRIBUTES:"get_group_attr",SEND_MESSAGE:"sendmsg",REVOKE_C2C_MESSAGE:"msgwithdraw",DELETE_C2C_MESSAGE:"delete_c2c_msg_ramble",MODIFY_C2C_MESSAGE:"modify_c2c_msg",MODIFY_C2C_MESSAGE_EXTENSIONS:"set_key_values",GET_C2C_MESSAGE_EXTENSIONS:"get_key_values",SEND_GROUP_MESSAGE:"send_group_msg",REVOKE_GROUP_MESSAGE:"group_msg_recall",DELETE_GROUP_MESSAGE:"delete_group_ramble_msg_by_seq",MODIFY_GROUP_MESSAGE:"modify_group_msg",MODIFY_GROUP_MESSAGE_EXTENSIONS:"group_set_key_values",GET_GROUP_MESSAGE_EXTENSIONS:"group_get_key_values",GET_GROUP_INFO:"get_group_self_member_info",GET_GROUP_MEMBER_INFO:"get_specified_group_member_info",GET_GROUP_MEMBER_LIST:"get_group_member_info",GET_AVCHATROOM_MEMBER_LIST:"get_members",MARK_AVCHATROOM_MEMBER_INFO:"modify_user_info",QUIT_GROUP:"quit_group",CHANGE_GROUP_OWNER:"change_group_owner",DESTROY_GROUP:"destroy_group",ADD_GROUP_MEMBER:"add_group_member",DELETE_GROUP_MEMBER:"delete_group_member",BAN_AVCHATROOM_MEMBER:"ban_group_member",SEARCH_GROUP_BY_ID:"get_group_public_info",APPLY_JOIN_GROUP:"apply_join_group",HANDLE_APPLY_JOIN_GROUP:"handle_apply_join_group",HANDLE_INVITE_JOIN_GROUP:"handle_invite_join_permission_group",HANDLE_GROUP_INVITATION:"handle_invite_join_group",MODIFY_GROUP_INFO:"modify_group_base_info",MODIFY_GROUP_MEMBER_INFO:"modify_group_member_info",DELETE_GROUP_SYSTEM_MESSAGE:"deletemsg",DELETE_GROUP_AT_TIPS:"deletemsg",GET_GROUP_NOTIFY:"get_group_notify",GET_CONVERSATION_LIST:"get",PAGING_GET_CONVERSATION_LIST:"page_get",DELETE_CONVERSATION:"batch_delete",CLEAR_HISTORY_MESSAGE:"clear_msg",PIN_CONVERSATION:"top",SET_CONVERSATION_CUSTOM_DATA:"mark_contact",MARK_CONVERSATION:"mark_contact",CREATE_CONVERSATION_GROUP:"create_contact_group",DELETE_CONVERSATION_GROUP:"del_contact_group",UPDATE_CONVERSATION_GROUP:"update_contact_group",GET_CONVERSATION_GROUP_LIST:"get_contact_group",GET_MESSAGES:"getmsg",GET_C2C_ROAM_MESSAGES:"getroammsg",SET_C2C_PEER_MUTE_NOTIFICATIONS:"set_c2c_peer_mute_notifications",GET_C2C_PEER_MUTE_NOTIFICATIONS:"get_c2c_peer_mute_notifications",GET_GROUP_ROAM_MESSAGES:"group_msg_get",GET_READ_RECEIPT:"get_group_msg_receipt",GET_READ_RECEIPT_DETAIL:"get_group_msg_receipt_detail",SEND_READ_RECEIPT:"group_msg_receipt",SEND_C2C_READ_RECEIPT:"c2c_msg_read_receipt",SET_C2C_MESSAGE_READ:"msgreaded",GET_PEER_READ_TIME:"get_peer_read_time",SET_GROUP_MESSAGE_READ:"msg_read_report",FILE_READ_AND_WRITE_AUTHKEY:"authkey",FILE_UPLOAD:"pic_up",COS_SIGN:"cos",COS_PRE_SIG:"pre_sig",VIDEO_COVER:"video_cover",TIM_WEB_REPORT_V2:"tim_web_report_v2",BIG_DATA_HALLWAY_AUTH_KEY:"authkey",GET_ONLINE_MEMBER_NUM:"get_online_member_num",ALIVE:"alive",MESSAGE_PUSH:"msg_push",MULTI_MESSAGE_PUSH:"multi_msg_push_ws",MESSAGE_PUSH_ACK:"ws_msg_push_ack",STATUS_FORCE_OFFLINE:"stat_forceoffline",DOWNLOAD_MERGER_MESSAGE:"get_relay_json_msg",UPLOAD_MERGER_MESSAGE:"save_relay_json_msg",FETCH_CLOUD_CONTROL_CONFIG:"fetch_config",PUSHED_CLOUD_CONTROL_CONFIG:"push_configv2",FETCH_COMMERCIAL_CONFIG:"fetch_imsdk_purchase_bitsv2",PUSHED_COMMERCIAL_CONFIG:"push_imsdk_purchase_bitsv2",KICK_OTHER:"KickOther",OVERLOAD_NOTIFY:"notify2",SET_ALL_MESSAGE_READ:"read_all_unread_msg",CREATE_TOPIC:"create_topic",DELETE_TOPIC:"destroy_topic",UPDATE_TOPIC_PROFILE:"modify_topic",GET_TOPIC_LIST:"get_topic",SET_SELF_STATUS:"ws_set_custom_status",GET_USER_STATUS:"ws_get_user_status",SUBSCRIBE_USER_STATUS:"ws_status_subscribe",UNSUBSCRIBE_USER_STATUS:"ws_status_unsubscribe",GET_RPOFANITY_LIST:"get_local_words",TRANSLATE_TEXT:"ws_batch_trans_text",UPDATE_GROUP_COUNTER:"update_group_counter",GET_GROUP_COUNTER:"get_group_counter"},CHANNEL:{SOCKET:1,XHR:2,AUTO:0},NAME_VERSION:{openim:"v4",group_open_http_svc:"v4",sns:"v4",profile:"v4",recentcontact:"v4",openpic:"v4",group_open_http_noauth_svc:"v4",group_open_long_polling_http_svc:"v4",group_open_long_polling_http_noauth_svc:"v4",imopenstat:"v4",im_cos_sign_svr:"v4",im_cos_msg:"v4",webim:"v4",im_open_push:"v4",im_open_status:"v4"}},M={SEARCH_MSG:new o(0,Math.pow(2,0)).toString(),SEARCH_GRP_SNS:new o(0,Math.pow(2,1)).toString(),AVCHATROOM_HISTORY_MSG:new o(0,Math.pow(2,2)).toString(),GRP_COMMUNITY:new o(0,Math.pow(2,3)).toString(),MSG_TO_SPECIFIED_GRP_MBR:new o(0,Math.pow(2,4)).toString(),AVCHATROOM_MBR_LIST:new o(0,Math.pow(2,6)).toString(),USER_STATUS:new o(0,Math.pow(2,7)).toString(),CONV_MARK:new o(0,Math.pow(2,9)).toString(),CONV_GROUP:new o(0,Math.pow(2,10)).toString(),AVCHATROOM_BAN_MBR:new o(0,Math.pow(2,11)).toString(),MSG_EXT:new o(0,Math.pow(2,13)).toString(),GRP_COUNTER:new o(0,Math.pow(2,15)).toString()},f="c2c_text_message",I="c2c_custom_message",C="group_text_message",T="group_custom_message",y="user_profile",D="sns",E="group_profile",S="group_member_profile";m.HOST.setCurrent(u);const L="undefined"!=typeof wx&&"function"==typeof wx.getSystemInfoSync&&Boolean(wx.getSystemInfoSync().fontSizeSetting),A=L&&"function"==typeof wx.createGamePortal,v="undefined"!=typeof qq&&"function"==typeof qq.getSystemInfoSync&&Boolean(qq.getSystemInfoSync().fontSizeSetting),N="undefined"!=typeof tt&&"function"==typeof tt.getSystemInfoSync&&Boolean(tt.getSystemInfoSync().fontSizeSetting),R="undefined"!=typeof swan&&"function"==typeof swan.getSystemInfoSync&&Boolean(swan.getSystemInfoSync().fontSizeSetting),O="undefined"!=typeof my&&"function"==typeof my.getSystemInfoSync&&Boolean(my.getSystemInfoSync().fontSizeSetting),G="undefined"!=typeof jd&&"function"==typeof jd.getSystemInfoSync,U="undefined"!=typeof uni&&"undefined"==typeof window&&"function"==typeof uni.requireNativePlugin,k="undefined"!=typeof uni,P=L||v||N||R||O||U||G,b=("undefined"!=typeof uni||"undefined"!=typeof window)&&!P,w=v?qq:N?tt:R?swan:O?my:L?wx:U?uni:G?jd:{},F=b&&window&&window.navigator&&window.navigator.userAgent||"",$=/(micromessenger|webbrowser)/i.test(F),q=/AppleWebKit\/([\d.]+)/i.exec(F);q&&parseFloat(q.pop());const x=function(){let e="WEB";return $?e="WEB":v?e="QQ_MP":N?e="TT_MP":R?e="BAIDU_MP":O?e="ALI_MP":L?e="WX_MP":U&&(e="UNI_NATIVE_APP"),n[e]}(),V=/iPad/i.test(F),B=/iPhone/i.test(F)&&!V,H=/iPod/i.test(F),K=B||V||H,W=function(){const e=F.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),Y=/Android/i.test(F),j=function(){const e=F.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;const t=e[1]&&parseFloat(e[1]),s=e[2]&&parseFloat(e[2]);return t&&s?parseFloat(e[1]+"."+e[2]):t||null}();!function(){const e=F.match(/Chrome\/(\d+)/);e&&e[1]&&parseFloat(e[1])}();const z=/MSIE/.test(F)||F.indexOf("Trident")>-1&&F.indexOf("rv:11.0")>-1,J=function(){const e=/MSIE\s(\d+)\.\d/.exec(F);let t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(F)&&/rv:11.0/.test(F)&&(t=11),t}();!function(){const e=F.match(/TBS\/(\d+)/i);if(e&&e[1])e[1]}();const X=/Windows/i.test(F),Z=/MAC OS X/i.test(F),Q=b&&"undefined"!=typeof Worker&&!z,ee=Y||K,te=b&&void 0!==window.tencent_cloud_im_csig_flutter_for_web_25F_cy;let se,oe;se="undefined"!=typeof console?console:"undefined"!=typeof global&&global.console?global.console:"undefined"!=typeof window&&window.console?window.console:{};const ie=function(){},ne=["assert","clear","count","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"];let re=ne.length;for(;re--;)oe=ne[re],console[oe]||(se[oe]=ie);var ae=se;let ue=0;const ce=function(){return(new Date).getTime()+ue},le=function(){ue=0},de=function(){return Math.floor(ce()/1e3)};let pe=0;function he(){return yt()?"%c TIM %c":"TIM"}function ge(){const e=function(){const e=new Date;return e.setTime(ce()),e}();return e.toLocaleTimeString("en-US",{hour12:!1})+"."+function(e){let t;switch(e.toString().length){case 1:t="00"+e;break;case 2:t="0"+e;break;default:t=e}return t}(e.getMilliseconds())}const _e={arguments2String(e){let t="";if(1===e.length)t=e[0];else for(let s=0,o=e.length;s<o;s++)Fe(e[s])?qe(e[s])?t+=He(e[s]):t+=JSON.stringify(e[s]):t+=e[s],t+=" ";return t},_exec(e,t){yt()?ae[e](he(),"background:#0abf5b; padding:1px; border-radius:3px; color: #fff","background:transparent",ge(),t):ae[e](`${he()} ${ge()} ${t}`)},d:function(){if(pe<=-1){const e=this.arguments2String(arguments);this._exec("debug",e)}},l:function(){if(pe<=0){const e=this.arguments2String(arguments);this._exec("log",e)}},log:function(){if(pe<=0){const e=this.arguments2String(arguments);this._exec("log",e)}},i:function(){if(pe<=1){const e=this.arguments2String(arguments);this._exec("info",e)}},w:function(){if(pe<=2){const e=this.arguments2String(arguments);this._exec("warn",e)}},e:function(){if(pe<=3){const e=this.arguments2String(arguments);this._exec("error",e)}},setLevel:function(e){e<4&&this._exec("log","set level from "+pe+" to "+e),pe=e},getLevel:function(){return pe}},me={JPG:1,JPEG:1,GIF:2,PNG:3,BMP:4,UNKNOWN:255},Me={NICK:"Tag_Profile_IM_Nick",GENDER:"Tag_Profile_IM_Gender",BIRTHDAY:"Tag_Profile_IM_BirthDay",LOCATION:"Tag_Profile_IM_Location",SELFSIGNATURE:"Tag_Profile_IM_SelfSignature",ALLOWTYPE:"Tag_Profile_IM_AllowType",LANGUAGE:"Tag_Profile_IM_Language",AVATAR:"Tag_Profile_IM_Image",MESSAGESETTINGS:"Tag_Profile_IM_MsgSettings",ADMINFORBIDTYPE:"Tag_Profile_IM_AdminForbidType",LEVEL:"Tag_Profile_IM_Level",ROLE:"Tag_Profile_IM_Role"},fe="Tag_SNS_IM_Group",Ie="Tag_SNS_IM_Remark",Ce="Tag_SNS_IM_AddSource",Te="Tag_SNS_IM_AddWording",ye="Tag_SNS_IM_AddTime",De={UNKNOWN:"Gender_Type_Unknown",FEMALE:"Gender_Type_Female",MALE:"Gender_Type_Male"},Ee={NONE:"AdminForbid_Type_None",SEND_OUT:"AdminForbid_Type_SendOut"},Se={NEED_CONFIRM:"AllowType_Type_NeedConfirm",ALLOW_ANY:"AllowType_Type_AllowAny",DENY_ANY:"AllowType_Type_DenyAny"},Le="JoinedSuccess",Ae="WaitAdminApproval",ve="@TGS#_",Ne="@TOPIC#_",Re=function(e){return"map"===xe(e)},Oe=function(e){return"file"===xe(e)},Ge=function(e){return null!==e&&("number"==typeof e&&!isNaN(e-0)||"object"==typeof e&&e.constructor===Number)},Ue=function(e){return"string"==typeof e},ke=function(e){return null!==e&&"object"==typeof e},Pe=function(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);if(null===t)return!0;let s=t;for(;null!==Object.getPrototypeOf(s);)s=Object.getPrototypeOf(s);return t===s},be=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"array"===xe(e)},we=function(e){return void 0===e},Fe=function(e){return be(e)||ke(e)},$e=function(e){return"function"==typeof e},qe=function(e){return e instanceof Error},xe=function(e){return Object.prototype.toString.call(e).match(/^\[object (.*)\]$/)[1].toLowerCase()},Ve=function(e){if("string"!=typeof e)return!1;const t=e[0];return!/[^a-zA-Z0-9]/.test(t)};Date.now||(Date.now=function(){return(new Date).getTime()});const Be=function(e,t,s,o){if(!Fe(e)||!Fe(t))return 0;let i=0;const n=Object.keys(t);let r;for(let a=0,u=n.length;a<u;a++)if(r=n[a],!(we(t[r])||s&&s.includes(r)))if(Fe(e[r])&&Fe(t[r]))i+=Be(e[r],t[r],s,o);else{if(o&&o.includes(t[r]))continue;e[r]!==t[r]&&(e[r]=t[r],i+=1)}return i},He=function(e){return JSON.stringify(e,["message","code"])},Ke=function(e){if(0===e.length)return 0;let t=0,s="",o=0,i=1;const n="undefined"!=typeof document&&void 0!==document.characterSet?document.characterSet:"UTF-8";for(;void 0!==e[t];)s=e[t++],i=s.charCodeAt[t]<=255?1:!1===n?3:2,o+=i;return o},We=function(e){const t=e||99999999;return Math.round(Math.random()*t)},Ye="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",je=Ye.length,ze=function(e,t){for(const s in e)if(e[s]===t)return!0;return!1},Je={},Xe=function(e){return-1===e.indexOf("http://")||-1===e.indexOf("https://")?"https://"+e:e.replace(/https|http/,"https")},Ze=function(e){if(0===Object.getOwnPropertyNames(e).length)return Object.create(null);const t=Array.isArray(e)?[]:Object.create(null);let s="";for(const o in e)null!==e[o]?void 0!==e[o]?(s=typeof e[o],["string","number","function","boolean"].indexOf(s)>=0?t[o]=e[o]:t[o]=Ze(e[o])):t[o]=void 0:t[o]=null;return t};function Qe(e,t){if(!be(e)||!be(t))return!1;let s=!1;return t.forEach(({key:t,value:o})=>{const i=e.find(e=>e.key===t);i?i.value!==o&&(i.value=o,s=!0):(e.push({key:t,value:o}),s=!0)}),s}const et=e=>e===t.GRP_AVCHATROOM,st=({type:e,groupID:s})=>e===t.GRP_COMMUNITY||(""+s).startsWith(ve)&&!(""+s).includes(Ne),ot=e=>(""+e).startsWith(ve)&&(""+e).includes(Ne),it=e=>Ue(e)&&e.slice(0,3)===t.CONV_C2C,nt=e=>Ue(e)&&e.slice(0,5)===t.CONV_GROUP,rt=e=>Ue(e)&&e===t.CONV_SYSTEM;function at(e,t){const s={};return Object.keys(e).forEach(o=>{s[o]=t(e[o],o)}),s}function ut(e){return P?new Promise((t,s)=>{w.getImageInfo({src:e,success(e){t({width:e.width,height:e.height})},fail(){t({width:0,height:0})}})}):z&&9===J?Promise.resolve({width:0,height:0}):new Promise((t,s)=>{let o=new Image;o.onload=function(){t({width:this.width,height:this.height}),o=null},o.onerror=function(){t({width:0,height:0}),o=null},o.src=e})}function ct(){function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return`${e()+e()}${e()}${e()}${e()}${e()}${e()}${e()}`}function lt(){let e="unknown";if(Z&&(e="mac"),X&&(e="windows"),K&&(e="ios"),Y&&(e="android"),P)try{const t=w.getSystemInfoSync().platform;void 0!==t&&(e=t)}catch(t){}return e}function dt(e,t){e=e.split("."),t=t.split(".");const s=Math.max(e.length,t.length);for(;e.length<s;)e.push("0");for(;t.length<s;)t.push("0");for(let o=0;o<s;o++){const s=parseInt(e[o]),i=parseInt(t[o]);if(s>i)return 1;if(s<i)return-1}return 0}function pt(e){const{originUrl:t,originWidth:s,originHeight:o,min:i=198}=e,n=parseInt(s),r=parseInt(o),a={url:void 0,width:0,height:0};if((n<=r?n:r)<=i)a.url=t,a.width=n,a.height=r;else{r<=n?(a.width=Math.ceil(n*i/r),a.height=i):(a.width=i,a.height=Math.ceil(r*i/n));const e=t&&t.indexOf("?")>-1?t+"&":t+"?";a.url=198===i?e+"imageView2/3/w/198/h/198":e+"imageView2/3/w/720/h/720"}if(we(t)){const{url:e,...t}=a;return t}return a}function ht(e){const t=e[2];e[2]=e[1],e[1]=t;for(let s=0;s<e.length;s++)e[s].setType(s)}function gt(e){const{servcmd:t}=e;return t.slice(t.indexOf(".")+1)}function _t(e,t){return Math.round(Number(e)*Math.pow(10,t))/Math.pow(10,t)}function mt(e,t){return e.includes(t)}function Mt(e,t){return e.includes(t)}function ft(e){return e.split(Ne)[0]}const It=function(e,s,o){if(we(s))return"";switch(e){case t.MSG_TEXT:return s.text;case t.MSG_IMAGE:return o?"[Image]":"[图片]";case t.MSG_LOCATION:return o?"[Location]":"[位置]";case t.MSG_AUDIO:return o?"[Voice]":"[语音]";case t.MSG_VIDEO:return o?"[Video]":"[视频]";case t.MSG_FILE:return o?"[File]":"[文件]";case t.MSG_CUSTOM:return o?"[Custom Messages]":"[自定义消息]";case t.MSG_GRP_TIP:return o?"[Group Notification]":"[群提示消息]";case t.MSG_GRP_SYS_NOTICE:return o?"[Group System Message]":"[群系统通知]";case t.MSG_FACE:return o?"[Animated Sticker]":"[动画表情]";case t.MSG_MERGER:return o?"[Chat Record]":"[聊天记录]";default:return""}};function Ct(e){return e===t.MSG_TEXT||e===t.MSG_CUSTOM||e===t.MSG_LOCATION||e===t.MSG_FACE}function Tt(e){const t=[];if(!Ue(e))return t;const s=e.length;if(0===s)return t;for(let o=s-1;o>=0;o--)"1"===e[o]&&t.push(Math.pow(2,s-o-1));return t}function yt(){return!z&&!P}function Dt(e){return"the length of userIDList cannot exceed "+e}function Et(e,t){if(!e)return;let s=e;return t&&(e.startsWith("http://")?s=e.replace(/^http:\/\/[^/]+/,t):e.startsWith("https://")&&(s=e.replace(/^https:\/\/[^/]+/,t))),s}const St=Object.prototype.hasOwnProperty;function Lt(e){if(null==e)return!0;if("boolean"==typeof e)return!1;if("number"==typeof e)return 0===e;if("string"==typeof e)return 0===e.length;if("function"==typeof e)return 0===e.length;if(Array.isArray(e))return 0===e.length;if(e instanceof Error)return""===e.message;if(Pe(e)){for(const t in e)if(St.call(e,t))return!1;return!0}return!(!Re(e)&&(t=e,"set"!==xe(t))&&!Oe(e))&&0===e.size;var t}function At(e,t,s){if(void 0===t)return!0;let o=!0;if(Pe(t))Object.keys(t).forEach(i=>{const n=1===e.length?e[0][i]:void 0;o=!!vt(n,t[i],s,i)&&o});else if(be(t))for(let i=0;i<t.length;i++)o=!!vt(e[i],t[i],s,t[i].name)&&o;if(o)return o;throw new Error("Params validate failed.")}function vt(e,t,s,o){if(void 0===t)return!0;let i=!0;if(t.required&&Lt(e)&&(_e.e(`[${s}] Missing required params: "${o}".`),i=!1),!Lt(e)){const n=xe(e),r=t.type.toLowerCase();n!==r&&("asyncfunction"===n&&"function"===r||(_e.e(`[${s}] Invalid params: type check failed for "${o}".Expected ${t.type}.`),i=!1))}return t.validator&&!t.validator(e)&&(_e.e(`[${s}] Invalid params: custom validator check failed for params.`),i=!1),i}const Nt={UNSEND:"unSend",SUCCESS:"success",FAIL:"fail"},Rt={NOT_START:"notStart",PENDING:"pending",RESOLVED:"resolved",REJECTED:"rejected"},Ot=function(e){if(!e)return!1;if(it(e)||nt(e)||rt(e))return!0;const t=os("InvalidConversationID",e);return t&&_e.w(t),!1},Gt=function(e){""!==e.desc&&""!==os("API_REFER")&&_e.w(`[${e.api}] | ${e.param} | ${e.desc}, ${os("API_REFER")}${e.api}`)},Ut=function(){return os("StringRequiredLog")},kt=function(e){return os("NonEmptyStringRequiredLog",e)},Pt=function(){return os("NumberRequiredLog")},bt=function(){return os("UndefinedNotAllowedLog")},wt=function(){return os("FileRequiredLog")},Ft=function(){return os("FunctionRequiredLog")},$t=function(){return os("ArrayRequiredLog")},qt=function(){return os("NonEmptyArrayLog")},xt=function(){return os("CallbackMissingLog")},Vt=function(){return os("PositiveIntegerRequiredLog")},Bt=function(e,t){return os("StringNotLongerThanLog",e,t)},Ht=function(e,t){return os("NumberLessThanLog",e,t)},Kt=function(e){return os("KeyValueStringRequiredLog",e)},Wt=function(){return os("PlainObjectRequiredLog")},Yt=function(){return os("NonEmptyContentRequiredLog")},jt=function(){return os("FileNotSelectedLog")},zt=function(){return os("MessageInstanceRequiredLog")},Jt=function(){return os("NonAnonymousFunctionLog")},Xt=function(){return os("MessageExtensionNotAvailableLog")},Zt={type:"String",required:!0},Qt={type:"Array",required:!0},es={type:"Object",required:!0},ts={type:"Boolean",required:!0},ss={type:"number",required:!0};let os=null;const is={hookGetAPITips:function(e){os=e},login:{userID:Zt,userSig:Zt},addToBlacklist:{userIDList:Qt},removeFromBlacklist:{userIDList:Qt},on:[{name:"eventName",type:"String",validator:e=>"string"==typeof e&&0!==e.length||(Gt({api:"on",param:"eventName",desc:kt("eventName")}),!1)},{name:"handler",type:"Function",validator:e=>"function"!=typeof e?(Gt({api:"on",param:"handler",desc:Ft()}),!1):(""===e.name&&Gt({api:"on",param:"handler",desc:Jt()}),!0)}],once:[{name:"eventName",type:"String",validator:e=>"string"==typeof e&&0!==e.length||(Gt({api:"once",param:"eventName",desc:kt("eventName")}),!1)},{name:"handler",type:"Function",validator:e=>"function"!=typeof e?(Gt({api:"once",param:"handler",desc:Ft()}),!1):(""===e.name&&Gt({api:"once",param:"handler",desc:Jt()}),!0)}],off:[{name:"eventName",type:"String",validator:e=>"string"==typeof e&&0!==e.length||(Gt({api:"off",param:"eventName",desc:kt("eventName")}),!1)},{name:"handler",type:"Function",validator:e=>"function"!=typeof e?(Gt({api:"off",param:"handler",desc:Ft()}),!1):(""===e.name&&Gt({api:"off",param:"handler",desc:Jt()}),!0)}],sendMessage:[{name:"message",...es}],setMessageExtensions:[{name:"message",...es,validator:e=>e.status===Nt.SUCCESS&&!0===e.isSupportExtension||(Gt({api:"setMessageExtensions",param:"message",desc:Xt()}),!1)},{name:"extensions",...Qt}],getMessageExtensions:[{name:"message",...es,validator:e=>e.status===Nt.SUCCESS&&!0===e.isSupportExtension||(Gt({api:"getMessageExtensions",param:"message",desc:Xt()}),!1)}],deleteMessageExtensions:[{name:"message",...es,validator:e=>e.status===Nt.SUCCESS&&!0===e.isSupportExtension||(Gt({api:"deleteMessageExtensions",param:"message",desc:Xt()}),!1)}],getMessageList:{conversationID:{...Zt,validator:e=>Ot(e)},nextReqMessageID:{type:"String"},count:{type:"Number",validator:e=>!(!we(e)&&!/^[1-9][0-9]*$/.test(e))||(Gt({api:"getMessageList",param:"count",desc:Vt()}),!1)}},getMessageListHopping:{conversationID:{...Zt,validator:e=>Ot(e)},sequence:{type:"Number"},time:{type:"Number"},direction:{type:"Number",validator:e=>!(!we(e)&&0!==e&&1!==e)||(Gt({api:"getMessageListHopping",param:"direction",desc:os("0Or1RequiredLog")}),!1)},count:{type:"Number",validator:e=>!(!we(e)&&!/^[1-9][0-9]*$/.test(e))||(Gt({api:"getMessageListHopping",param:"count",desc:Vt}),!1)}},setMessageRead:{conversationID:{...Zt,validator:e=>Ot(e)}},setAllMessageRead:{scope:{type:"String",required:!1,validator:e=>!e||-1!==[t.READ_ALL_C2C_MSG,t.READ_ALL_GROUP_MSG,t.READ_ALL_MSG].indexOf(e)||(Gt({api:"setAllMessageRead",param:"scope",desc:"TIM.TYPES.READ_ALL_C2C_MSG or TIM.TYPES.READ_ALL_GROUP_MSG or TIM.TYPES.READ_ALL_MSG required"}),!1)}},getConversationProfile:[{name:"conversationID",...Zt,validator:e=>Ot(e)}],clearHistoryMessage:[{name:"conversationID",...Zt,validator:e=>Ot(e)}],pinConversation:{conversationID:{...Zt,validator:e=>Ot(e)},isPinned:{...ts}},setConversationCustomData:{conversationIDList:{...Qt},customData:{type:"String",validator:e=>Ue(e)?!(e.length>256)||(Gt({api:"setConversationCustomData",param:"customData",desc:Bt("customData",256)}),!1):(Gt({api:"setConversationCustomData",param:"customData",desc:Ut()}),!1)}},markConversation:{conversationIDList:{...Qt},markType:{type:"number",validator:e=>{return Ge(e)?e<=0?(Gt({api:"markConversation",param:"markType",desc:(t="markType",s=0,os("NumberGreaterThanLog",t,s))}),!1):!(e>=Math.pow(2,64))||(Gt({api:"markConversation",param:"markType",desc:Ht("markType","Math.pow(2,64)")}),!1):(Gt({api:"markConversation",param:"markType",desc:Pt()}),!1);var t,s}},enableMark:{...ts}},createConversationGroup:{conversationIDList:{...Qt},groupName:{...Zt,validator:e=>!!e&&(!(e.length>32)||(Gt({api:"createConversationGroup",param:"groupName",desc:Bt("groupName",32)}),!1))}},deleteConversationGroup:[{name:"groupName",...Zt}],renameConversationGroup:{oldName:{...Zt},newName:{...Zt,validator:e=>!!e&&(!(e.length>32)||(Gt({api:"renameConversationGroup",param:"newName",desc:Bt("newName",32)}),!1))}},addConversationsToGroup:{conversationIDList:{...Qt},groupName:{...Zt}},deleteConversationsFromGroup:{conversationIDList:{...Qt},groupName:{...Zt}},getGroupList:{groupProfileFilter:{type:"Array"}},getGroupProfile:{groupID:Zt,groupCustomFieldFilter:{type:"Array"},memberCustomFieldFilter:{type:"Array"}},getGroupProfileAdvance:{groupIDList:Qt},createGroup:{name:Zt},joinGroup:{groupID:Zt,type:{type:"String"},applyMessage:{type:"String"}},quitGroup:[{name:"groupID",...Zt}],handleApplication:{message:es,handleAction:Zt,handleMessage:{type:"String"}},changeGroupOwner:{groupID:Zt,newOwnerID:Zt},updateGroupProfile:{groupID:Zt,muteAllMembers:{type:"Boolean"}},dismissGroup:[{name:"groupID",...Zt}],searchGroupByID:[{name:"groupID",...Zt}],initGroupAttributes:{groupID:Zt,groupAttributes:{...es,validator:e=>{let t=!0;return Object.keys(e).forEach(s=>{if(!Ue(e[s]))return Gt({api:"initGroupAttributes",param:"groupAttributes",desc:Kt("value")}),t=!1,t}),t}}},setGroupAttributes:{groupID:Zt,groupAttributes:{...es,validator:e=>{let t=!0;return Object.keys(e).forEach(s=>{if(!Ue(e[s]))return Gt({api:"setGroupAttributes",param:"groupAttributes",desc:Kt("value")}),t=!1,t}),t}}},deleteGroupAttributes:{groupID:Zt,keyList:{type:"Array",validator:e=>{if(we(e)||!be(e))return Gt({api:"deleteGroupAttributes",param:"keyList",desc:$t()}),!1;if(!Lt(e)){let t=!0;return e.forEach(e=>{if(!Ue(e))return Gt({api:"deleteGroupAttributes",param:"keyList",desc:os("StringArrayRequiredLog")}),t=!1,t}),t}return!0}}},getGroupAttributes:{groupID:Zt,keyList:{type:"Array",validator:e=>{if(we(e)||!be(e))return Gt({api:"getGroupAttributes",param:"keyList",desc:$t()}),!1;if(!Lt(e)){let t=!0;return e.forEach(e=>{if(!Ue(e))return Gt({api:"getGroupAttributes",param:"keyList",desc:Kt("key")}),t=!1,t}),t}return!0}}},setGroupCounters:{groupID:Zt,counters:es},increaseGroupCounter:{groupID:Zt,key:Zt,value:ss},decreaseGroupCounter:{groupID:Zt,key:Zt,value:ss},getGroupCounters:{groupID:Zt},getGroupMemberList:{groupID:Zt,count:{type:"Number"}},getGroupMemberProfile:{groupID:Zt,userIDList:Qt,memberCustomFieldFilter:{type:"Array"}},addGroupMember:{groupID:Zt,userIDList:Qt},setGroupMemberRole:{groupID:Zt,userID:Zt,role:Zt},setGroupMemberMuteTime:{groupID:Zt,userID:Zt,muteTime:{type:"Number",validator:e=>e>=0}},setGroupMemberNameCard:{groupID:Zt,userID:{type:"String"},nameCard:{type:"String",validator:e=>Ue(e)?(e.length,!0):(Gt({api:"setGroupMemberNameCard",param:"nameCard",desc:Ut()}),!1)}},setGroupMemberCustomField:{groupID:Zt,userID:{type:"String"},memberCustomField:Qt},deleteGroupMember:{groupID:Zt},markGroupMemberList:{groupID:Zt,markType:{type:"number",validator:e=>{return Ge(e)?!(e<1e3)||(Gt({api:"markGroupMemberList",param:"markType",desc:(t="markType",s=1e3,os("NumberGreaterOrEqualLog",t,s))}),!1):(Gt({api:"markGroupMemberList",param:"markType",desc:Pt()}),!1);var t,s}},userIDList:{...Qt},enableMark:{...ts}},createTextMessage:{to:Zt,conversationType:Zt,payload:{...es,validator:e=>Pe(e)?Ue(e.text)?0!==e.text.length||(Gt({api:"createTextMessage",param:"payload.text",desc:Yt()}),!1):(Gt({api:"createTextMessage",param:"payload.text",desc:Ut()}),!1):(Gt({api:"createTextMessage",param:"payload",desc:Wt()}),!1)}},createTextAtMessage:{to:Zt,conversationType:Zt,payload:{...es,validator:e=>Pe(e)?Ue(e.text)?0===e.text.length?(Gt({api:"createTextAtMessage",param:"payload.text",desc:Yt()}),!1):!(e.atUserList&&!be(e.atUserList))||(Gt({api:"createTextAtMessage",param:"payload.atUserList",desc:$t()}),!1):(Gt({api:"createTextAtMessage",param:"payload.text",desc:Ut()}),!1):(Gt({api:"createTextAtMessage",param:"payload",desc:Wt()}),!1)}},createCustomMessage:{to:Zt,conversationType:Zt,payload:{...es,validator:e=>Pe(e)?e.data&&!Ue(e.data)?(Gt({api:"createCustomMessage",param:"payload.data",desc:Ut()}),!1):e.description&&!Ue(e.description)?(Gt({api:"createCustomMessage",param:"payload.description",desc:Ut()}),!1):!(e.extension&&!Ue(e.extension))||(Gt({api:"createCustomMessage",param:"payload.extension",desc:Ut()}),!1):(Gt({api:"createCustomMessage",param:"payload",desc:Wt()}),!1)}},createImageMessage:{to:Zt,conversationType:Zt,payload:{...es,validator:e=>{if(!Pe(e))return Gt({api:"createImageMessage",param:"payload",desc:Wt()}),!1;if(we(e.file))return Gt({api:"createImageMessage",param:"payload.file",desc:bt()}),!1;if(b){if(!(e.file instanceof HTMLInputElement||Oe(e.file)))return Pe(e.file)&&"undefined"!=typeof uni?0!==e.file.tempFilePaths.length&&0!==e.file.tempFiles.length||(Gt({api:"createImageMessage",param:"payload.file",desc:jt()}),!1):(Gt({api:"createImageMessage",param:"payload.file",desc:wt()}),!1);if(e.file instanceof HTMLInputElement&&0===e.file.files.length)return Gt({api:"createImageMessage",param:"payload.file",desc:jt()}),!1}return!0},onProgress:{type:"Function",required:!1,validator:e=>(we(e)&&Gt({api:"createImageMessage",param:"onProgress",desc:xt()}),!0)}}},createAudioMessage:{to:Zt,conversationType:Zt,payload:{...es,validator:e=>!!Pe(e)||(Gt({api:"createAudioMessage",param:"payload",desc:Wt()}),!1)},onProgress:{type:"Function",required:!1,validator:e=>(we(e)&&Gt({api:"createAudioMessage",param:"onProgress",desc:xt()}),!0)}},createVideoMessage:{to:Zt,conversationType:Zt,payload:{...es,validator:e=>{if(!Pe(e))return Gt({api:"createVideoMessage",param:"payload",desc:Wt()}),!1;if(we(e.file))return Gt({api:"createVideoMessage",param:"payload.file",desc:bt()}),!1;if(b){if(!(e.file instanceof HTMLInputElement||Oe(e.file)))return Pe(e.file)&&"undefined"!=typeof uni?!!Oe(e.file.tempFile)||(Gt({api:"createVideoMessage",param:"payload.file",desc:jt()}),!1):(Gt({api:"createVideoMessage",param:"payload.file",desc:wt()}),!1);if(e.file instanceof HTMLInputElement&&0===e.file.files.length)return Gt({api:"createVideoMessage",param:"payload.file",desc:jt()}),!1}return!0}},onProgress:{type:"Function",required:!1,validator:e=>(we(e)&&Gt({api:"createVideoMessage",param:"onProgress",desc:xt()}),!0)}},createFaceMessage:{to:Zt,conversationType:Zt,payload:{...es,validator:e=>Pe(e)?Ge(e.index)?!!Ue(e.data)||(Gt({api:"createFaceMessage",param:"payload.data",desc:Ut()}),!1):(Gt({api:"createFaceMessage",param:"payload.index",desc:Pt()}),!1):(Gt({api:"createFaceMessage",param:"payload",desc:Wt()}),!1)}},createFileMessage:{to:Zt,conversationType:Zt,payload:{...es,validator:e=>{if(!Pe(e))return Gt({api:"createFileMessage",param:"payload",desc:Wt()}),!1;if(we(e.file))return Gt({api:"createFileMessage",param:"payload.file",desc:bt()}),!1;if(b){if(!(e.file instanceof HTMLInputElement||Oe(e.file)))return Pe(e.file)&&"undefined"!=typeof uni?0!==e.file.tempFilePaths.length&&0!==e.file.tempFiles.length||(Gt({api:"createFileMessage",param:"payload.file",desc:jt()}),!1):(Gt({api:"createFileMessage",param:"payload.file",desc:wt()}),!1);if(e.file instanceof HTMLInputElement&&0===e.file.files.length)return Gt({api:"createFileMessage",param:"payload.file",desc:jt()}),!1}return!0}},onProgress:{type:"Function",required:!1,validator:e=>(we(e)&&Gt({api:"createFileMessage",param:"onProgress",desc:xt()}),!0)}},createLocationMessage:{to:Zt,conversationType:Zt,payload:{...es,validator:e=>Pe(e)?Ue(e.description)?Ge(e.longitude)?!!Ge(e.latitude)||(Gt({api:"createLocationMessage",param:"payload.latitude",desc:Pt()}),!1):(Gt({api:"createLocationMessage",param:"payload.longitude",desc:Pt()}),!1):(Gt({api:"createLocationMessage",param:"payload.description",desc:Ut()}),!1):(Gt({api:"createLocationMessage",param:"payload",desc:Wt()}),!1)}},createMergerMessage:{to:Zt,conversationType:Zt,payload:{...es,validator:e=>{if(Lt(e.messageList))return Gt({api:"createMergerMessage",param:"payload.messageList",desc:qt()}),!1;if(Lt(e.compatibleText))return Gt({api:"createMergerMessage",param:"payload.compatibleText",desc:kt("compatibleText")}),!1;let t=!1;return e.messageList.forEach(e=>{e.status===Nt.FAIL&&(t=!0)}),!t||(Gt({api:"createMergerMessage",param:"payload.messageList",desc:os("MergeFailedMessageLog")}),!1)}}},revokeMessage:[{name:"message",...es,validator:e=>Lt(e)?(Gt({api:"revokeMessage",param:"message",desc:zt()}),!1):e.conversationType===t.CONV_SYSTEM?(Gt({api:"revokeMessage",param:"message",desc:os("MessageCanBeRevokedDesc")}),!1):!0!==e.isRevoked||(Gt({api:"revokeMessage",param:"message",desc:os("MessageRevokedLog")}),!1)}],deleteMessage:[{name:"messageList",...Qt,validator:e=>!Lt(e)||(Gt({api:"deleteMessage",param:"messageList",desc:qt()}),!1)}],translateText:{sourceTextList:Qt,sourceLanguage:Zt,targetLanguage:Zt},modifyMessage:[{name:"message",...es,validator:e=>Lt(e)?(Gt({api:"modifyMessage",param:"message",desc:zt()}),!1):e.conversationType===t.CONV_SYSTEM?(Gt({api:"modifyMessage",param:"message",desc:os("MessageCanBeModifiedLog")}),!1):!0!==e._onlineOnlyFlag||(Gt({api:"modifyMessage",param:"message",desc:os("OnlineMessageNotSupportLog")}),!1)}],getUserProfile:{userIDList:{type:"Array",validator:e=>be(e)?(0===e.length&&Gt({api:"getUserProfile",param:"userIDList",desc:qt()}),!0):(Gt({api:"getUserProfile",param:"userIDList",desc:$t()}),!1)}},updateMyProfile:{profileCustomField:{type:"Array",validator:e=>!!we(e)||(!!be(e)||(Gt({api:"updateMyProfile",param:"profileCustomField",desc:$t()}),!1))}},setSelfStatus:{customStatus:{type:"String",validator:e=>!!Ue(e)||(Gt({api:"setSelfStatus",param:"customStatus",desc:Ut()}),!1)}},getUserStatus:{userIDList:{type:"Array",validator:e=>be(e)?0!==e.length||(Gt({api:"getUserStatus",param:"userIDList",desc:qt()}),!1):(Gt({api:"getUserStatus",param:"userIDList",desc:$t()}),!1)}},subscribeUserStatus:{userIDList:{type:"Array",validator:e=>be(e)?0!==e.length||(Gt({api:"subscribeUserStatus",param:"userIDList",desc:qt()}),!1):(Gt({api:"subscribeUserStatus",param:"userIDList",desc:$t()}),!1)}},unsubscribeUserStatus:{userIDList:{type:"Array",validator:e=>!e||(!!be(e)||(Gt({api:"subscribeUserStatus",param:"userIDList",desc:$t()}),!1))}},addFriend:{to:Zt,source:{type:"String",required:!0,validator:e=>{if(!e)return!1;if(!e.startsWith("AddSource_Type_"))return Gt({api:"addFriend",param:"source",desc:os("SourcePrefixLog")}),!1;return!(e.replace("AddSource_Type_","").length>8)||(Gt({api:"addFriend",param:"source",desc:Bt("keyword",8)}),!1)}},remark:{type:"String",required:!1,validator:e=>!(Ue(e)&&e.length>96)||(Gt({api:"addFriend",param:"remark",desc:Bt("remark",96)}),!1)}},deleteFriend:{userIDList:Qt},checkFriend:{userIDList:Qt},getFriendProfile:{userIDList:Qt},updateFriend:{userID:Zt,remark:{type:"String",required:!1,validator:e=>!(Ue(e)&&e.length>96)||(Gt({api:"updateFriend",param:"remark",desc:Bt("remark",96)}),!1)},friendCustomField:{type:"Array",required:!1,validator:e=>{if(e){if(!be(e))return Gt({api:"updateFriend",param:"friendCustomField",desc:$t()}),!1;let t=!0;return e.forEach(e=>{if(!Ue(e.key)||-1===e.key.indexOf("Tag_SNS_Custom"))return Gt({api:"updateFriend",param:"friendCustomField",desc:os("FriendCustomFieldPrefixLog")}),t=!1,t;if(!Ue(e.value))return Gt({api:"updateFriend",param:"friendCustomField",desc:Kt("value")}),t=!1,t;return e.key.replace("Tag_SNS_Custom_","").length>8?(Gt({api:"updateFriend",param:"friendCustomField",desc:Bt("keyword",8)}),t=!1,t):void 0}),t}return!0}}},acceptFriendApplication:{userID:Zt},refuseFriendApplication:{userID:Zt},deleteFriendApplication:{userID:Zt},createFriendGroup:{name:Zt},deleteFriendGroup:{name:Zt},addToFriendGroup:{name:Zt,userIDList:Qt},removeFromFriendGroup:{name:Zt,userIDList:Qt},renameFriendGroup:{oldName:Zt,newName:Zt},sendMessageReadReceipt:[{name:"messageList",type:"Array",validator:e=>be(e)?0!==e.length||(Gt({api:"sendMessageReadReceipt",param:"messageList",desc:qt()}),!1):(Gt({api:"sendMessageReadReceipt",param:"messageList",desc:$t()}),!1)}],getMessageReadReceiptList:[{name:"messageList",type:"Array",validator:e=>be(e)?0!==e.length||(Gt({api:"getMessageReadReceiptList",param:"messageList",desc:qt()}),!1):(Gt({api:"getMessageReadReceiptList",param:"messageList",desc:$t()}),!1)}],createTopicInCommunity:{groupID:Zt,topicName:Zt},deleteTopicFromCommunity:{groupID:Zt,topicIDList:{type:"Array",validator:e=>!e||(!!be(e)||(Gt({api:"deleteTopicFromCommunity",param:"topicIDList",desc:$t()}),!1))}},updateTopicProfile:{groupID:Zt,topicID:Zt},getTopicList:{groupID:Zt,topicIDList:{type:"Array",validator:e=>!e||(!!be(e)||(Gt({api:"getTopicList",param:"topicIDList",desc:$t()}),!1))}}},ns={login:1,logout:1,on:1,once:1,off:1,setLogLevel:1,registerPlugin:1,destroy:1,createTextMessage:1,createTextAtMessage:1,createImageMessage:1,createAudioMessage:1,createVideoMessage:1,createCustomMessage:1,createFaceMessage:1,createFileMessage:1,createLocationMessage:1,createMergerMessage:1,downloadMergerMessage:1,createForwardMessage:1,sendMessage:1,resendMessage:1,revokeMessage:1,deleteMessage:1,translateText:1,modifyMessage:1,sendMessageReadReceipt:1,getGroupMessageReadMemberList:1,getMessageReadReceiptList:1,setMessageExtensions:1,getMessageExtensions:1,deleteMessageExtensions:1,getMessageList:1,findMessage:1,getMessageListHopping:1,setMessageRead:1,setAllMessageRead:1,getConversationList:1,getConversationProfile:1,deleteConversation:1,pinConversation:1,getTotalUnreadMessageCount:1,setConversationCustomData:1,markConversation:1,createConversationGroup:1,getConversationGroupList:1,deleteConversationGroup:1,renameConversationGroup:1,addConversationsToGroup:1,deleteConversationsFromGroup:1,clearHistoryMessage:1,getGroupList:1,getGroupProfile:1,createGroup:1,joinGroup:1,updateGroupProfile:1,quitGroup:1,dismissGroup:1,changeGroupOwner:1,searchGroupByID:1,setMessageRemindType:1,getGroupApplicationList:1,handleGroupApplication:1,initGroupAttributes:1,setGroupAttributes:1,deleteGroupAttributes:1,getGroupAttributes:1,setGroupCounters:1,increaseGroupCounter:1,decreaseGroupCounter:1,getGroupCounters:1,getJoinedCommunityList:1,createTopicInCommunity:1,deleteTopicFromCommunity:1,updateTopicProfile:1,getTopicList:1,getGroupMemberProfile:1,getGroupMemberList:1,addGroupMember:1,deleteGroupMember:1,setGroupMemberNameCard:1,setGroupMemberMuteTime:1,setGroupMemberRole:1,setGroupMemberCustomField:1,getGroupOnlineMemberCount:1,markGroupMemberList:1,getMyProfile:1,getUserProfile:1,updateMyProfile:1,setSelfStatus:1,getUserStatus:1,subscribeUserStatus:1,unsubscribeUserStatus:1,getBlacklist:1,addToBlacklist:1,removeFromBlacklist:1,getFriendList:1,addFriend:1,deleteFriend:1,checkFriend:1,updateFriend:1,getFriendProfile:1,getFriendApplicationList:1,refuseFriendApplication:1,deleteFriendApplication:1,acceptFriendApplication:1,setFriendApplicationRead:1,getFriendGroupList:1,createFriendGroup:1,renameFriendGroup:1,deleteFriendGroup:1,addToFriendGroup:1,removeFromFriendGroup:1,callExperimentalAPI:1},rs=1,as=2,us=3,cs=4,ls=6,ds=7,ps=8,hs=9,gs=10,_s=11,ms=12,Ms=13,fs=14,Is=15,Cs=16,Ts=17,ys=18,Ds=19,Es=20,Ss=21,Ls=22,As=23,vs=24,Ns=25,Rs=26,Os=27,Gs=28,Us=29,ks=30,Ps=31,bs=32,ws=37;class Fs{constructor(e){this._m=e,this._n=""}isLoggedIn(){return this._m.getModule(ms).isLoggedIn()}isOversea(){return this._m.getModule(ms).isOversea()}isPrivateNetWork(){return this._m.getModule(ms).isPrivateNetWork()}getFileDownloadProxy(){return this._m.getModule(ms).getFileDownloadProxy()}getMyUserID(){return this._m.getModule(ms).getUserID()}getMyTinyID(){return this._m.getModule(ms).getTinyID()}getSDKAppID(){return this._m.getModule(ms).getSDKAppID()}isIntl(){return this._m.getModule(ms).isIntl()}isDevMode(){return this._m.getModule(ms).isDevMode()}getModule(e){return this._m.getModule(e)}getPlatform(){return x}getNetworkType(){return this._m.getModule(Is).getNetworkType()}probeNetwork(e){return this._m.getModule(Is).probe(e)}getCloudConfig(e){return this._m.getModule(As).getCloudConfig(e)}emitOuterEvent(e,t){this._m.getOuterEmitterInstance().emit(e,t)}emitInnerEvent(e,t){this._m.getInnerEmitterInstance().emit(e,t)}getInnerEmitterInstance(){return this._m.getInnerEmitterInstance()}generateTjgID(e){return this._m.getModule(ms).getTinyID()+"-"+e.random}filterModifiedMessage(t){if(Lt(t))return;const s=t.filter(e=>!0===e.isModified);s.length>0&&this.emitOuterEvent(e.MESSAGE_MODIFIED,s)}filterUnmodifiedMessage(e){if(Lt(e))return[];return e.filter(e=>!1===e.isModified)}request(e){return this._m.getModule(Es).request(e)}canIUse(e){return this._m.getModule(Os).canIUse(e)}getErrorMessage(e,t,s){return this._m.getErrorMessage(e,t,s)}outputWarning(e,t,s){const o=this.getErrorMessage(e,t,s);o&&_e.w(o)}}const $s="wslogin",qs="wslogout",xs="wshello",Vs="KickOther",Bs="getmsg",Hs="authkey",Ks="sendmsg",Ws="send_group_msg",Ys="portrait_get_all",js="portrait_set",zs="black_list_get",Js="black_list_add",Xs="black_list_delete",Zs="friend_get",Qs="friend_get_specified",eo="friend_check",to="friend_delete",so="friend_add",oo="friend_update",io="friend_response",no="pendency_get",ro="pendency_delete",ao="pendency_report",uo="group_get",co="group_add",lo="group_delete",po="group_update",ho="msgwithdraw",go="msgreaded",_o="set_c2c_peer_mute_notifications",mo="get_c2c_peer_mute_notifications",Mo="getroammsg",fo="get_peer_read_time",Io="delete_c2c_msg_ramble",Co="modify_c2c_msg",To="set_key_values",yo="get_key_values",Do="page_get",Eo="get",So="batch_delete",Lo="clear_msg",Ao="top",vo="deletemsg",No="set_conv_custom_data",Ro="mark_contact",Oo="create_contact_group",Go="del_contact_group",Uo="update_contact_group",ko="add_conv_to_group",Po="del_conv_from_group",bo="get_contact_group",wo="get_joined_group_list",Fo="get_group_self_member_info",$o="create_group",qo="destroy_group",xo="modify_group_base_info",Vo="apply_join_group",Bo="apply_join_group_noauth",Ho="quit_group",Ko="get_group_public_info",Wo="change_group_owner",Yo="handle_apply_join_group",jo="handle_invite_join_permission_group",zo="handle_invite_join_group",Jo="group_msg_recall",Xo="msg_read_report",Zo="read_all_unread_msg",Qo="group_msg_get",ei="get_group_msg_receipt",ti="group_msg_receipt",si="c2c_msg_read_receipt",oi="get_group_msg_receipt_detail",ii="get_pendency",ni="deletemsg",ri="get_msg",ai="get_msg_noauth",ui="get_online_member_num",ci="delete_group_ramble_msg_by_seq",li="modify_group_msg",di="set_group_attr",pi="modify_group_attr",hi="delete_group_attr",gi="clear_group_attr",_i="get_group_attr",mi="group_set_key_values",Mi="group_get_key_values",fi="get_group_notify",Ii="update_group_counter",Ci="get_group_counter",Ti="get_group_member_info",yi="get_members",Di="get_specified_group_member_info",Ei="add_group_member",Si="delete_group_member",Li="ban_group_member",Ai="modify_group_member_info",vi="modify_user_info",Ni="cos",Ri="pre_sig",Oi="video_cover",Gi="tim_web_report_v2",Ui="alive",ki="msg_push",Pi="multi_msg_push_ws",bi="ws_msg_push_ack",wi="stat_forceoffline",Fi="save_relay_json_msg",$i="get_relay_json_msg",qi="fetch_config",xi="push_configv2",Vi="fetch_imsdk_purchase_bitsv2",Bi="push_imsdk_purchase_bitsv2",Hi="notify2",