UNPKG

tim-wx-sdk

Version:
1 lines 531 kB
'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="group_profile",E="group_member_profile";m.HOST.setCurrent(u);const S="undefined"!=typeof wx&&"function"==typeof wx.getSystemInfoSync&&Boolean(wx.getSystemInfoSync().fontSizeSetting),v=S&&"function"==typeof wx.createGamePortal,L="undefined"!=typeof qq&&"function"==typeof qq.getSystemInfoSync&&Boolean(qq.getSystemInfoSync().fontSizeSetting),A="undefined"!=typeof tt&&"function"==typeof tt.getSystemInfoSync&&Boolean(tt.getSystemInfoSync().fontSizeSetting),R="undefined"!=typeof swan&&"function"==typeof swan.getSystemInfoSync&&Boolean(swan.getSystemInfoSync().fontSizeSetting),N="undefined"!=typeof my&&"function"==typeof my.getSystemInfoSync&&Boolean(my.getSystemInfoSync().fontSizeSetting),O="undefined"!=typeof jd&&"function"==typeof jd.getSystemInfoSync,G="undefined"!=typeof uni&&"undefined"==typeof window&&"function"==typeof uni.requireNativePlugin,U="undefined"!=typeof uni,P=S||L||A||R||N||G||O,k=("undefined"!=typeof uni||"undefined"!=typeof window)&&!P,b=L?qq:A?tt:R?swan:N?my:S?wx:G?uni:O?jd:{},w=k&&window&&window.navigator&&window.navigator.userAgent||"",$=/(micromessenger|webbrowser)/i.test(w),F=/AppleWebKit\/([\d.]+)/i.exec(w);F&&parseFloat(F.pop());const q=function(){let e="WEB";return $?e="WEB":L?e="QQ_MP":A?e="TT_MP":R?e="BAIDU_MP":N?e="ALI_MP":S?e="WX_MP":G&&(e="UNI_NATIVE_APP"),n[e]}(),x=/iPad/i.test(w),V=/iPhone/i.test(w)&&!x,B=/iPod/i.test(w),H=V||x||B,K=function(){const e=w.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),W=/Android/i.test(w),Y=function(){const e=w.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=w.match(/Chrome\/(\d+)/);e&&e[1]&&parseFloat(e[1])}();const j=/MSIE/.test(w)||w.indexOf("Trident")>-1&&w.indexOf("rv:11.0")>-1,z=function(){const e=/MSIE\s(\d+)\.\d/.exec(w);let t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(w)&&/rv:11.0/.test(w)&&(t=11),t}();!function(){const e=w.match(/TBS\/(\d+)/i);if(e&&e[1])e[1]}();const J=/Windows/i.test(w),X=/MAC OS X/i.test(w),Z=k&&"undefined"!=typeof Worker&&!j,Q=W||H,ee=k&&void 0!==window.tencent_cloud_im_csig_flutter_for_web_25F_cy;let te,se;te="undefined"!=typeof console?console:"undefined"!=typeof global&&global.console?global.console:"undefined"!=typeof window&&window.console?window.console:{};const oe=function(){},ie=["assert","clear","count","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"];let ne=ie.length;for(;ne--;)se=ie[ne],console[se]||(te[se]=oe);var re=te;let ae=0;const ue=function(){return(new Date).getTime()+ae},ce=function(){ae=0},le=function(){return Math.floor(ue()/1e3)};let de=0;function pe(){return mt()?"%c TIM %c":"TIM"}function he(){const e=function(){const e=new Date;return e.setTime(ue()),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 ge={arguments2String(e){let t="";if(1===e.length)t=e[0];else for(let s=0,o=e.length;s<o;s++)Ge(e[s])?Pe(e[s])?t+=$e(e[s]):t+=JSON.stringify(e[s]):t+=e[s],t+=" ";return t},_exec(e,t){mt()?re[e](pe(),"background:#0abf5b; padding:1px; border-radius:3px; color: #fff","background:transparent",he(),t):re[e](`${pe()} ${he()} ${t}`)},d:function(){if(de<=-1){const e=this.arguments2String(arguments);this._exec("debug",e)}},l:function(){if(de<=0){const e=this.arguments2String(arguments);this._exec("log",e)}},log:function(){if(de<=0){const e=this.arguments2String(arguments);this._exec("log",e)}},i:function(){if(de<=1){const e=this.arguments2String(arguments);this._exec("info",e)}},w:function(){if(de<=2){const e=this.arguments2String(arguments);this._exec("warn",e)}},e:function(){if(de<=3){const e=this.arguments2String(arguments);this._exec("error",e)}},setLevel:function(e){e<4&&this._exec("log","set level from "+de+" to "+e),de=e},getLevel:function(){return de}},_e={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"},Me={UNKNOWN:"Gender_Type_Unknown",FEMALE:"Gender_Type_Female",MALE:"Gender_Type_Male"},fe={NONE:"AdminForbid_Type_None",SEND_OUT:"AdminForbid_Type_SendOut"},Ie={NEED_CONFIRM:"AllowType_Type_NeedConfirm",ALLOW_ANY:"AllowType_Type_AllowAny",DENY_ANY:"AllowType_Type_DenyAny"},Ce="JoinedSuccess",Te="WaitAdminApproval",ye="@TGS#_",De="@TOPIC#_",Ee=function(e){return"map"===ke(e)},Se=function(e){return"file"===ke(e)},ve=function(e){return null!==e&&("number"==typeof e&&!isNaN(e-0)||"object"==typeof e&&e.constructor===Number)},Le=function(e){return"string"==typeof e},Ae=function(e){return null!==e&&"object"==typeof e},Re=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},Ne=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"array"===ke(e)},Oe=function(e){return void 0===e},Ge=function(e){return Ne(e)||Ae(e)},Ue=function(e){return"function"==typeof e},Pe=function(e){return e instanceof Error},ke=function(e){return Object.prototype.toString.call(e).match(/^\[object (.*)\]$/)[1].toLowerCase()},be=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 we=function(e,t,s,o){if(!Ge(e)||!Ge(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],!(Oe(t[r])||s&&s.includes(r)))if(Ge(e[r])&&Ge(t[r]))i+=we(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},$e=function(e){return JSON.stringify(e,["message","code"])},Fe=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},qe=function(e){const t=e||99999999;return Math.round(Math.random()*t)},xe="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",Ve=xe.length,Be=function(e,t){for(const s in e)if(e[s]===t)return!0;return!1},He={},Ke=function(e){return-1===e.indexOf("http://")||-1===e.indexOf("https://")?"https://"+e:e.replace(/https|http/,"https")},We=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]=We(e[o])):t[o]=void 0:t[o]=null;return t};function Ye(e,t){if(!Ne(e)||!Ne(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 je=e=>e===t.GRP_AVCHATROOM,ze=({type:e,groupID:s})=>e===t.GRP_COMMUNITY||(""+s).startsWith(ye)&&!(""+s).includes(De),Je=e=>(""+e).startsWith(ye)&&(""+e).includes(De),Xe=e=>Le(e)&&e.slice(0,3)===t.CONV_C2C,Ze=e=>Le(e)&&e.slice(0,5)===t.CONV_GROUP,Qe=e=>Le(e)&&e===t.CONV_SYSTEM;function et(e,t){const s={};return Object.keys(e).forEach(o=>{s[o]=t(e[o],o)}),s}function st(e){return P?new Promise((t,s)=>{b.getImageInfo({src:e,success(e){t({width:e.width,height:e.height})},fail(){t({width:0,height:0})}})}):j&&9===z?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 ot(){function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return`${e()+e()}${e()}${e()}${e()}${e()}${e()}${e()}`}function it(){let e="unknown";if(X&&(e="mac"),J&&(e="windows"),H&&(e="ios"),W&&(e="android"),P)try{const t=b.getSystemInfoSync().platform;void 0!==t&&(e=t)}catch(t){}return e}function nt(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 rt(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(Oe(t)){const{url:e,...t}=a;return t}return a}function at(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 ut(e){const{servcmd:t}=e;return t.slice(t.indexOf(".")+1)}function ct(e,t){return Math.round(Number(e)*Math.pow(10,t))/Math.pow(10,t)}function lt(e,t){return e.includes(t)}function dt(e,t){return e.includes(t)}function pt(e){return e.split(De)[0]}const ht=function(e,s,o){if(Oe(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 gt(e){return e===t.MSG_TEXT||e===t.MSG_CUSTOM||e===t.MSG_LOCATION||e===t.MSG_FACE}function _t(e){const t=[];if(!Le(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 mt(){return!j&&!P}function Mt(e){return"the length of userIDList cannot exceed "+e}function ft(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 It=Object.prototype.hasOwnProperty;function Ct(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(Re(e)){for(const t in e)if(It.call(e,t))return!1;return!0}return!(!Ee(e)&&(t=e,"set"!==ke(t))&&!Se(e))&&0===e.size;var t}function Tt(e,t,s){if(void 0===t)return!0;let o=!0;if(Re(t))Object.keys(t).forEach(i=>{const n=1===e.length?e[0][i]:void 0;o=!!yt(n,t[i],s,i)&&o});else if(Ne(t))for(let i=0;i<t.length;i++)o=!!yt(e[i],t[i],s,t[i].name)&&o;if(o)return o;throw new Error("Params validate failed.")}function yt(e,t,s,o){if(void 0===t)return!0;let i=!0;if(t.required&&Ct(e)&&(ge.e(`[${s}] Missing required params: "${o}".`),i=!1),!Ct(e)){const n=ke(e),r=t.type.toLowerCase();n!==r&&("asyncfunction"===n&&"function"===r||(ge.e(`[${s}] Invalid params: type check failed for "${o}".Expected ${t.type}.`),i=!1))}return t.validator&&!t.validator(e)&&(ge.e(`[${s}] Invalid params: custom validator check failed for params.`),i=!1),i}const Dt={UNSEND:"unSend",SUCCESS:"success",FAIL:"fail"},Et={NOT_START:"notStart",PENDING:"pending",RESOLVED:"resolved",REJECTED:"rejected"},St=function(e){if(!e)return!1;if(Xe(e)||Ze(e)||Qe(e))return!0;const t=Xt("InvalidConversationID",e);return t&&ge.w(t),!1},vt=function(e){""!==e.desc&&""!==Xt("API_REFER")&&ge.w(`[${e.api}] | ${e.param} | ${e.desc}, ${Xt("API_REFER")}${e.api}`)},Lt=function(){return Xt("StringRequiredLog")},At=function(e){return Xt("NonEmptyStringRequiredLog",e)},Rt=function(){return Xt("NumberRequiredLog")},Nt=function(){return Xt("UndefinedNotAllowedLog")},Ot=function(){return Xt("FileRequiredLog")},Gt=function(){return Xt("FunctionRequiredLog")},Ut=function(){return Xt("ArrayRequiredLog")},Pt=function(){return Xt("NonEmptyArrayLog")},kt=function(){return Xt("CallbackMissingLog")},bt=function(){return Xt("PositiveIntegerRequiredLog")},wt=function(e,t){return Xt("StringNotLongerThanLog",e,t)},$t=function(e,t){return Xt("NumberLessThanLog",e,t)},Ft=function(e){return Xt("KeyValueStringRequiredLog",e)},qt=function(){return Xt("PlainObjectRequiredLog")},xt=function(){return Xt("NonEmptyContentRequiredLog")},Vt=function(){return Xt("FileNotSelectedLog")},Bt=function(){return Xt("MessageInstanceRequiredLog")},Ht=function(){return Xt("NonAnonymousFunctionLog")},Kt=function(){return Xt("MessageExtensionNotAvailableLog")},Wt={type:"String",required:!0},Yt={type:"Array",required:!0},jt={type:"Object",required:!0},zt={type:"Boolean",required:!0},Jt={type:"number",required:!0};let Xt=null;const Zt={hookGetAPITips:function(e){Xt=e},login:{userID:Wt,userSig:Wt},addToBlacklist:{userIDList:Yt},removeFromBlacklist:{userIDList:Yt},on:[{name:"eventName",type:"String",validator:e=>"string"==typeof e&&0!==e.length||(vt({api:"on",param:"eventName",desc:At("eventName")}),!1)},{name:"handler",type:"Function",validator:e=>"function"!=typeof e?(vt({api:"on",param:"handler",desc:Gt()}),!1):(""===e.name&&vt({api:"on",param:"handler",desc:Ht()}),!0)}],once:[{name:"eventName",type:"String",validator:e=>"string"==typeof e&&0!==e.length||(vt({api:"once",param:"eventName",desc:At("eventName")}),!1)},{name:"handler",type:"Function",validator:e=>"function"!=typeof e?(vt({api:"once",param:"handler",desc:Gt()}),!1):(""===e.name&&vt({api:"once",param:"handler",desc:Ht()}),!0)}],off:[{name:"eventName",type:"String",validator:e=>"string"==typeof e&&0!==e.length||(vt({api:"off",param:"eventName",desc:At("eventName")}),!1)},{name:"handler",type:"Function",validator:e=>"function"!=typeof e?(vt({api:"off",param:"handler",desc:Gt()}),!1):(""===e.name&&vt({api:"off",param:"handler",desc:Ht()}),!0)}],sendMessage:[{name:"message",...jt}],setMessageExtensions:[{name:"message",...jt,validator:e=>e.status===Dt.SUCCESS&&!0===e.isSupportExtension||(vt({api:"setMessageExtensions",param:"message",desc:Kt()}),!1)},{name:"extensions",...Yt}],getMessageExtensions:[{name:"message",...jt,validator:e=>e.status===Dt.SUCCESS&&!0===e.isSupportExtension||(vt({api:"getMessageExtensions",param:"message",desc:Kt()}),!1)}],deleteMessageExtensions:[{name:"message",...jt,validator:e=>e.status===Dt.SUCCESS&&!0===e.isSupportExtension||(vt({api:"deleteMessageExtensions",param:"message",desc:Kt()}),!1)}],getMessageList:{conversationID:{...Wt,validator:e=>St(e)},nextReqMessageID:{type:"String"},count:{type:"Number",validator:e=>!(!Oe(e)&&!/^[1-9][0-9]*$/.test(e))||(vt({api:"getMessageList",param:"count",desc:bt()}),!1)}},getMessageListHopping:{conversationID:{...Wt,validator:e=>St(e)},sequence:{type:"Number"},time:{type:"Number"},direction:{type:"Number",validator:e=>!(!Oe(e)&&0!==e&&1!==e)||(vt({api:"getMessageListHopping",param:"direction",desc:Xt("0Or1RequiredLog")}),!1)},count:{type:"Number",validator:e=>!(!Oe(e)&&!/^[1-9][0-9]*$/.test(e))||(vt({api:"getMessageListHopping",param:"count",desc:bt}),!1)}},setMessageRead:{conversationID:{...Wt,validator:e=>St(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)||(vt({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",...Wt,validator:e=>St(e)}],clearHistoryMessage:[{name:"conversationID",...Wt,validator:e=>St(e)}],pinConversation:{conversationID:{...Wt,validator:e=>St(e)},isPinned:{...zt}},setConversationCustomData:{conversationIDList:{...Yt},customData:{type:"String",validator:e=>Le(e)?!(e.length>256)||(vt({api:"setConversationCustomData",param:"customData",desc:wt("customData",256)}),!1):(vt({api:"setConversationCustomData",param:"customData",desc:Lt()}),!1)}},markConversation:{conversationIDList:{...Yt},markType:{type:"number",validator:e=>{return ve(e)?e<=0?(vt({api:"markConversation",param:"markType",desc:(t="markType",s=0,Xt("NumberGreaterThanLog",t,s))}),!1):!(e>=Math.pow(2,64))||(vt({api:"markConversation",param:"markType",desc:$t("markType","Math.pow(2,64)")}),!1):(vt({api:"markConversation",param:"markType",desc:Rt()}),!1);var t,s}},enableMark:{...zt}},createConversationGroup:{conversationIDList:{...Yt},groupName:{...Wt,validator:e=>!!e&&(!(e.length>32)||(vt({api:"createConversationGroup",param:"groupName",desc:wt("groupName",32)}),!1))}},deleteConversationGroup:[{name:"groupName",...Wt}],renameConversationGroup:{oldName:{...Wt},newName:{...Wt,validator:e=>!!e&&(!(e.length>32)||(vt({api:"renameConversationGroup",param:"newName",desc:wt("newName",32)}),!1))}},addConversationsToGroup:{conversationIDList:{...Yt},groupName:{...Wt}},deleteConversationsFromGroup:{conversationIDList:{...Yt},groupName:{...Wt}},getGroupList:{groupProfileFilter:{type:"Array"}},getGroupProfile:{groupID:Wt,groupCustomFieldFilter:{type:"Array"},memberCustomFieldFilter:{type:"Array"}},getGroupProfileAdvance:{groupIDList:Yt},createGroup:{name:Wt},joinGroup:{groupID:Wt,type:{type:"String"},applyMessage:{type:"String"}},quitGroup:[{name:"groupID",...Wt}],handleApplication:{message:jt,handleAction:Wt,handleMessage:{type:"String"}},changeGroupOwner:{groupID:Wt,newOwnerID:Wt},updateGroupProfile:{groupID:Wt,muteAllMembers:{type:"Boolean"}},dismissGroup:[{name:"groupID",...Wt}],searchGroupByID:[{name:"groupID",...Wt}],initGroupAttributes:{groupID:Wt,groupAttributes:{...jt,validator:e=>{let t=!0;return Object.keys(e).forEach(s=>{if(!Le(e[s]))return vt({api:"initGroupAttributes",param:"groupAttributes",desc:Ft("value")}),t=!1,t}),t}}},setGroupAttributes:{groupID:Wt,groupAttributes:{...jt,validator:e=>{let t=!0;return Object.keys(e).forEach(s=>{if(!Le(e[s]))return vt({api:"setGroupAttributes",param:"groupAttributes",desc:Ft("value")}),t=!1,t}),t}}},deleteGroupAttributes:{groupID:Wt,keyList:{type:"Array",validator:e=>{if(Oe(e)||!Ne(e))return vt({api:"deleteGroupAttributes",param:"keyList",desc:Ut()}),!1;if(!Ct(e)){let t=!0;return e.forEach(e=>{if(!Le(e))return vt({api:"deleteGroupAttributes",param:"keyList",desc:Xt("StringArrayRequiredLog")}),t=!1,t}),t}return!0}}},getGroupAttributes:{groupID:Wt,keyList:{type:"Array",validator:e=>{if(Oe(e)||!Ne(e))return vt({api:"getGroupAttributes",param:"keyList",desc:Ut()}),!1;if(!Ct(e)){let t=!0;return e.forEach(e=>{if(!Le(e))return vt({api:"getGroupAttributes",param:"keyList",desc:Ft("key")}),t=!1,t}),t}return!0}}},setGroupCounters:{groupID:Wt,counters:jt},increaseGroupCounter:{groupID:Wt,key:Wt,value:Jt},decreaseGroupCounter:{groupID:Wt,key:Wt,value:Jt},getGroupCounters:{groupID:Wt},getGroupMemberList:{groupID:Wt,count:{type:"Number"}},getGroupMemberProfile:{groupID:Wt,userIDList:Yt,memberCustomFieldFilter:{type:"Array"}},addGroupMember:{groupID:Wt,userIDList:Yt},setGroupMemberRole:{groupID:Wt,userID:Wt,role:Wt},setGroupMemberMuteTime:{groupID:Wt,userID:Wt,muteTime:{type:"Number",validator:e=>e>=0}},setGroupMemberNameCard:{groupID:Wt,userID:{type:"String"},nameCard:{type:"String",validator:e=>Le(e)?(e.length,!0):(vt({api:"setGroupMemberNameCard",param:"nameCard",desc:Lt()}),!1)}},setGroupMemberCustomField:{groupID:Wt,userID:{type:"String"},memberCustomField:Yt},deleteGroupMember:{groupID:Wt},markGroupMemberList:{groupID:Wt,markType:{type:"number",validator:e=>{return ve(e)?!(e<1e3)||(vt({api:"markGroupMemberList",param:"markType",desc:(t="markType",s=1e3,Xt("NumberGreaterOrEqualLog",t,s))}),!1):(vt({api:"markGroupMemberList",param:"markType",desc:Rt()}),!1);var t,s}},userIDList:{...Yt},enableMark:{...zt}},createTextMessage:{to:Wt,conversationType:Wt,payload:{...jt,validator:e=>Re(e)?Le(e.text)?0!==e.text.length||(vt({api:"createTextMessage",param:"payload.text",desc:xt()}),!1):(vt({api:"createTextMessage",param:"payload.text",desc:Lt()}),!1):(vt({api:"createTextMessage",param:"payload",desc:qt()}),!1)}},createTextAtMessage:{to:Wt,conversationType:Wt,payload:{...jt,validator:e=>Re(e)?Le(e.text)?0===e.text.length?(vt({api:"createTextAtMessage",param:"payload.text",desc:xt()}),!1):!(e.atUserList&&!Ne(e.atUserList))||(vt({api:"createTextAtMessage",param:"payload.atUserList",desc:Ut()}),!1):(vt({api:"createTextAtMessage",param:"payload.text",desc:Lt()}),!1):(vt({api:"createTextAtMessage",param:"payload",desc:qt()}),!1)}},createCustomMessage:{to:Wt,conversationType:Wt,payload:{...jt,validator:e=>Re(e)?e.data&&!Le(e.data)?(vt({api:"createCustomMessage",param:"payload.data",desc:Lt()}),!1):e.description&&!Le(e.description)?(vt({api:"createCustomMessage",param:"payload.description",desc:Lt()}),!1):!(e.extension&&!Le(e.extension))||(vt({api:"createCustomMessage",param:"payload.extension",desc:Lt()}),!1):(vt({api:"createCustomMessage",param:"payload",desc:qt()}),!1)}},createImageMessage:{to:Wt,conversationType:Wt,payload:{...jt,validator:e=>{if(!Re(e))return vt({api:"createImageMessage",param:"payload",desc:qt()}),!1;if(Oe(e.file))return vt({api:"createImageMessage",param:"payload.file",desc:Nt()}),!1;if(k){if(!(e.file instanceof HTMLInputElement||Se(e.file)))return Re(e.file)&&"undefined"!=typeof uni?0!==e.file.tempFilePaths.length&&0!==e.file.tempFiles.length||(vt({api:"createImageMessage",param:"payload.file",desc:Vt()}),!1):(vt({api:"createImageMessage",param:"payload.file",desc:Ot()}),!1);if(e.file instanceof HTMLInputElement&&0===e.file.files.length)return vt({api:"createImageMessage",param:"payload.file",desc:Vt()}),!1}return!0},onProgress:{type:"Function",required:!1,validator:e=>(Oe(e)&&vt({api:"createImageMessage",param:"onProgress",desc:kt()}),!0)}}},createAudioMessage:{to:Wt,conversationType:Wt,payload:{...jt,validator:e=>!!Re(e)||(vt({api:"createAudioMessage",param:"payload",desc:qt()}),!1)},onProgress:{type:"Function",required:!1,validator:e=>(Oe(e)&&vt({api:"createAudioMessage",param:"onProgress",desc:kt()}),!0)}},createVideoMessage:{to:Wt,conversationType:Wt,payload:{...jt,validator:e=>{if(!Re(e))return vt({api:"createVideoMessage",param:"payload",desc:qt()}),!1;if(Oe(e.file))return vt({api:"createVideoMessage",param:"payload.file",desc:Nt()}),!1;if(k){if(!(e.file instanceof HTMLInputElement||Se(e.file)))return Re(e.file)&&"undefined"!=typeof uni?!!Se(e.file.tempFile)||(vt({api:"createVideoMessage",param:"payload.file",desc:Vt()}),!1):(vt({api:"createVideoMessage",param:"payload.file",desc:Ot()}),!1);if(e.file instanceof HTMLInputElement&&0===e.file.files.length)return vt({api:"createVideoMessage",param:"payload.file",desc:Vt()}),!1}return!0}},onProgress:{type:"Function",required:!1,validator:e=>(Oe(e)&&vt({api:"createVideoMessage",param:"onProgress",desc:kt()}),!0)}},createFaceMessage:{to:Wt,conversationType:Wt,payload:{...jt,validator:e=>Re(e)?ve(e.index)?!!Le(e.data)||(vt({api:"createFaceMessage",param:"payload.data",desc:Lt()}),!1):(vt({api:"createFaceMessage",param:"payload.index",desc:Rt()}),!1):(vt({api:"createFaceMessage",param:"payload",desc:qt()}),!1)}},createFileMessage:{to:Wt,conversationType:Wt,payload:{...jt,validator:e=>{if(!Re(e))return vt({api:"createFileMessage",param:"payload",desc:qt()}),!1;if(Oe(e.file))return vt({api:"createFileMessage",param:"payload.file",desc:Nt()}),!1;if(k){if(!(e.file instanceof HTMLInputElement||Se(e.file)))return Re(e.file)&&"undefined"!=typeof uni?0!==e.file.tempFilePaths.length&&0!==e.file.tempFiles.length||(vt({api:"createFileMessage",param:"payload.file",desc:Vt()}),!1):(vt({api:"createFileMessage",param:"payload.file",desc:Ot()}),!1);if(e.file instanceof HTMLInputElement&&0===e.file.files.length)return vt({api:"createFileMessage",param:"payload.file",desc:Vt()}),!1}return!0}},onProgress:{type:"Function",required:!1,validator:e=>(Oe(e)&&vt({api:"createFileMessage",param:"onProgress",desc:kt()}),!0)}},createLocationMessage:{to:Wt,conversationType:Wt,payload:{...jt,validator:e=>Re(e)?Le(e.description)?ve(e.longitude)?!!ve(e.latitude)||(vt({api:"createLocationMessage",param:"payload.latitude",desc:Rt()}),!1):(vt({api:"createLocationMessage",param:"payload.longitude",desc:Rt()}),!1):(vt({api:"createLocationMessage",param:"payload.description",desc:Lt()}),!1):(vt({api:"createLocationMessage",param:"payload",desc:qt()}),!1)}},createMergerMessage:{to:Wt,conversationType:Wt,payload:{...jt,validator:e=>{if(Ct(e.messageList))return vt({api:"createMergerMessage",param:"payload.messageList",desc:Pt()}),!1;if(Ct(e.compatibleText))return vt({api:"createMergerMessage",param:"payload.compatibleText",desc:At("compatibleText")}),!1;let t=!1;return e.messageList.forEach(e=>{e.status===Dt.FAIL&&(t=!0)}),!t||(vt({api:"createMergerMessage",param:"payload.messageList",desc:Xt("MergeFailedMessageLog")}),!1)}}},revokeMessage:[{name:"message",...jt,validator:e=>Ct(e)?(vt({api:"revokeMessage",param:"message",desc:Bt()}),!1):e.conversationType===t.CONV_SYSTEM?(vt({api:"revokeMessage",param:"message",desc:Xt("MessageCanBeRevokedDesc")}),!1):!0!==e.isRevoked||(vt({api:"revokeMessage",param:"message",desc:Xt("MessageRevokedLog")}),!1)}],deleteMessage:[{name:"messageList",...Yt,validator:e=>!Ct(e)||(vt({api:"deleteMessage",param:"messageList",desc:Pt()}),!1)}],translateText:{sourceTextList:Yt,sourceLanguage:Wt,targetLanguage:Wt},modifyMessage:[{name:"message",...jt,validator:e=>Ct(e)?(vt({api:"modifyMessage",param:"message",desc:Bt()}),!1):e.conversationType===t.CONV_SYSTEM?(vt({api:"modifyMessage",param:"message",desc:Xt("MessageCanBeModifiedLog")}),!1):!0!==e._onlineOnlyFlag||(vt({api:"modifyMessage",param:"message",desc:Xt("OnlineMessageNotSupportLog")}),!1)}],getUserProfile:{userIDList:{type:"Array",validator:e=>Ne(e)?(0===e.length&&vt({api:"getUserProfile",param:"userIDList",desc:Pt()}),!0):(vt({api:"getUserProfile",param:"userIDList",desc:Ut()}),!1)}},updateMyProfile:{profileCustomField:{type:"Array",validator:e=>!!Oe(e)||(!!Ne(e)||(vt({api:"updateMyProfile",param:"profileCustomField",desc:Ut()}),!1))}},setSelfStatus:{customStatus:{type:"String",validator:e=>!!Le(e)||(vt({api:"setSelfStatus",param:"customStatus",desc:Lt()}),!1)}},getUserStatus:{userIDList:{type:"Array",validator:e=>Ne(e)?0!==e.length||(vt({api:"getUserStatus",param:"userIDList",desc:Pt()}),!1):(vt({api:"getUserStatus",param:"userIDList",desc:Ut()}),!1)}},subscribeUserStatus:{userIDList:{type:"Array",validator:e=>Ne(e)?0!==e.length||(vt({api:"subscribeUserStatus",param:"userIDList",desc:Pt()}),!1):(vt({api:"subscribeUserStatus",param:"userIDList",desc:Ut()}),!1)}},unsubscribeUserStatus:{userIDList:{type:"Array",validator:e=>!e||(!!Ne(e)||(vt({api:"subscribeUserStatus",param:"userIDList",desc:Ut()}),!1))}},addFriend:{to:Wt,source:{type:"String",required:!0,validator:e=>{if(!e)return!1;if(!e.startsWith("AddSource_Type_"))return vt({api:"addFriend",param:"source",desc:Xt("SourcePrefixLog")}),!1;return!(e.replace("AddSource_Type_","").length>8)||(vt({api:"addFriend",param:"source",desc:wt("keyword",8)}),!1)}},remark:{type:"String",required:!1,validator:e=>!(Le(e)&&e.length>96)||(vt({api:"addFriend",param:"remark",desc:wt("remark",96)}),!1)}},deleteFriend:{userIDList:Yt},checkFriend:{userIDList:Yt},getFriendProfile:{userIDList:Yt},updateFriend:{userID:Wt,remark:{type:"String",required:!1,validator:e=>!(Le(e)&&e.length>96)||(vt({api:"updateFriend",param:"remark",desc:wt("remark",96)}),!1)},friendCustomField:{type:"Array",required:!1,validator:e=>{if(e){if(!Ne(e))return vt({api:"updateFriend",param:"friendCustomField",desc:Ut()}),!1;let t=!0;return e.forEach(e=>{if(!Le(e.key)||-1===e.key.indexOf("Tag_SNS_Custom"))return vt({api:"updateFriend",param:"friendCustomField",desc:Xt("FriendCustomFieldPrefixLog")}),t=!1,t;if(!Le(e.value))return vt({api:"updateFriend",param:"friendCustomField",desc:Ft("value")}),t=!1,t;return e.key.replace("Tag_SNS_Custom_","").length>8?(vt({api:"updateFriend",param:"friendCustomField",desc:wt("keyword",8)}),t=!1,t):void 0}),t}return!0}}},acceptFriendApplication:{userID:Wt},refuseFriendApplication:{userID:Wt},deleteFriendApplication:{userID:Wt},createFriendGroup:{name:Wt},deleteFriendGroup:{name:Wt},addToFriendGroup:{name:Wt,userIDList:Yt},removeFromFriendGroup:{name:Wt,userIDList:Yt},renameFriendGroup:{oldName:Wt,newName:Wt},sendMessageReadReceipt:[{name:"messageList",type:"Array",validator:e=>Ne(e)?0!==e.length||(vt({api:"sendMessageReadReceipt",param:"messageList",desc:Pt()}),!1):(vt({api:"sendMessageReadReceipt",param:"messageList",desc:Ut()}),!1)}],getMessageReadReceiptList:[{name:"messageList",type:"Array",validator:e=>Ne(e)?0!==e.length||(vt({api:"getMessageReadReceiptList",param:"messageList",desc:Pt()}),!1):(vt({api:"getMessageReadReceiptList",param:"messageList",desc:Ut()}),!1)}],createTopicInCommunity:{groupID:Wt,topicName:Wt},deleteTopicFromCommunity:{groupID:Wt,topicIDList:{type:"Array",validator:e=>!e||(!!Ne(e)||(vt({api:"deleteTopicFromCommunity",param:"topicIDList",desc:Ut()}),!1))}},updateTopicProfile:{groupID:Wt,topicID:Wt},getTopicList:{groupID:Wt,topicIDList:{type:"Array",validator:e=>!e||(!!Ne(e)||(vt({api:"getTopicList",param:"topicIDList",desc:Ut()}),!1))}}},Qt={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},es=1,ts=2,ss=3,os=4,is=6,ns=7,rs=8,as=9,us=10,cs=11,ls=12,ds=13,ps=14,hs=15,gs=16,_s=17,ms=18,Ms=19,fs=20,Is=21,Cs=22,Ts=23,ys=24,Ds=25,Es=26,Ss=27,vs=28,Ls=29,As=30,Rs=31,Ns=32,Os=37;class Gs{constructor(e){this._m=e,this._n=""}isLoggedIn(){return this._m.getModule(ls).isLoggedIn()}isOversea(){return this._m.getModule(ls).isOversea()}isPrivateNetWork(){return this._m.getModule(ls).isPrivateNetWork()}getFileDownloadProxy(){return this._m.getModule(ls).getFileDownloadProxy()}getMyUserID(){return this._m.getModule(ls).getUserID()}getMyTinyID(){return this._m.getModule(ls).getTinyID()}getSDKAppID(){return this._m.getModule(ls).getSDKAppID()}isIntl(){return this._m.getModule(ls).isIntl()}isDevMode(){return this._m.getModule(ls).isDevMode()}getModule(e){return this._m.getModule(e)}getPlatform(){return q}getNetworkType(){return this._m.getModule(hs).getNetworkType()}probeNetwork(e){return this._m.getModule(hs).probe(e)}getCloudConfig(e){return this._m.getModule(Ts).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(ls).getTinyID()+"-"+e.random}filterModifiedMessage(t){if(Ct(t))return;const s=t.filter(e=>!0===e.isModified);s.length>0&&this.emitOuterEvent(e.MESSAGE_MODIFIED,s)}filterUnmodifiedMessage(e){if(Ct(e))return[];return e.filter(e=>!1===e.isModified)}request(e){return this._m.getModule(fs).request(e)}canIUse(e){return this._m.getModule(Ss).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&&ge.w(o)}}const Us="wslogin",Ps="wslogout",ks="wshello",bs="KickOther",ws="getmsg",$s="authkey",Fs="sendmsg",qs="send_group_msg",xs="portrait_get_all",Vs="portrait_set",Bs="black_list_get",Hs="black_list_add",Ks="black_list_delete",Ws="msgwithdraw",Ys="msgreaded",js="set_c2c_peer_mute_notifications",zs="get_c2c_peer_mute_notifications",Js="getroammsg",Xs="get_peer_read_time",Zs="delete_c2c_msg_ramble",Qs="modify_c2c_msg",eo="set_key_values",to="get_key_values",so="page_get",oo="get",io="batch_delete",no="clear_msg",ro="top",ao="deletemsg",uo="set_conv_custom_data",co="mark_contact",lo="create_contact_group",po="del_contact_group",ho="update_contact_group",go="add_conv_to_group",_o="del_conv_from_group",mo="get_contact_group",Mo="get_joined_group_list",fo="get_group_self_member_info",Io="create_group",Co="destroy_group",To="modify_group_base_info",yo="apply_join_group",Do="apply_join_group_noauth",Eo="quit_group",So="get_group_public_info",vo="change_group_owner",Lo="handle_apply_join_group",Ao="handle_invite_join_permission_group",Ro="handle_invite_join_group",No="group_msg_recall",Oo="msg_read_report",Go="read_all_unread_msg",Uo="group_msg_get",Po="get_group_msg_receipt",ko="group_msg_receipt",bo="c2c_msg_read_receipt",wo="get_group_msg_receipt_detail",$o="get_pendency",Fo="deletemsg",qo="get_msg",xo="get_msg_noauth",Vo="get_online_member_num",Bo="delete_group_ramble_msg_by_seq",Ho="modify_group_msg",Ko="set_group_attr",Wo="modify_group_attr",Yo="delete_group_attr",jo="clear_group_attr",zo="get_group_attr",Jo="group_set_key_values",Xo="group_get_key_values",Zo="get_group_notify",Qo="update_group_counter",ei="get_group_counter",ti="get_group_member_info",si="get_members",oi="get_specified_group_member_info",ii="add_group_member",ni="delete_group_member",ri="ban_group_member",ai="modify_group_member_info",ui="modify_user_info",ci="cos",li="pre_sig",di="video_cover",pi="tim_web_report_v2",hi="alive",gi="msg_push",_i="multi_msg_push_ws",mi="ws_msg_push_ack",Mi="stat_forceoffline",fi="save_relay_json_msg",Ii="get_relay_json_msg",Ci="fetch_config",Ti="push_configv2",yi="fetch_imsdk_purchase_bitsv2",Di="push_imsdk_purchase_bitsv2",Ei="notify2",Si="create_topic",vi="destroy_topic",Li="modify_topic",Ai="get_topic",Ri="ws_set_custom_status",Ni="ws_get_user_status",Oi="ws_status_subscribe",Gi="ws_status_unsubscribe",Ui="ws_stat_background",Pi="ws_stat_foreground",ki="ws_stat_settoken",bi="get_local_words",wi="ws_batch_trans_text",$i={NO_SDKAPPID:2e3,NO_ACCOUNT_TYPE:2001,NO_IDENTIFIER:2002,NO_USERSIG:2003,NO_TINYID:2022,NO_A2KEY:2023