UNPKG

@tencentcloud/chat

Version:

Tencent Cloud Chat SDK for Web/Mini Program/uni-app/React Native/Donut

1 lines 466 kB
let e={SDK_READY:"sdkStateReady",SDK_NOT_READY:"sdkStateNotReady",SDK_DESTROY:"sdkDestroy",MESSAGE_RECEIVED:"onMessageReceived",ROOM_CUSTOM_DATA_RECEIVED:"onRoomCustomDataReceived",MESSAGE_MODIFIED:"onMessageModified",MESSAGE_REVOKED:"onMessageRevoked",MESSAGE_READ_BY_PEER:"onMessageReadByPeer",MESSAGE_READ_RECEIPT_RECEIVED:"onMessageReadReceiptReceived",MESSAGE_EXTENSIONS_UPDATED:"onMessageExtensionsUpdated",MESSAGE_EXTENSIONS_DELETED:"onMessageExtensionsDeleted",MESSAGE_REACTIONS_UPDATED:"onMessageReactionsUpdated",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_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",MY_FOLLOWERS_LIST_UPDATED:"onMyFollowersListUpdated",MY_FOLLOWING_LIST_UPDATED:"onMyFollowingListUpdated",MUTUAL_FOLLOWERS_LIST_UPDATED:"onMutualFollowersListUpdated",KICKED_OUT:"kickedOut",ERROR:"error",NET_STATE_CHANGE:"netStateChange",ALL_RECEIVE_MESSAGE_OPT_UPDATED:"onAllReceiveMessageOptUpdated",SERVER_CONFIG_UPDATED:"onServerConfigUpdated"},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_ROOM:"Room",GRP_LIVE:"Live",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",RECEIVE_WITH_OFFLINE_PUSH_EXCEPT_AT:"AcceptNotNotifyExceptAt",NOT_RECEIVE_OFFLINE_PUSH_EXCEPT_AT:"AcceptNotNotifyExceptAt",NOT_RECEIVE_MSG_EXCEPT_AT:"NotReceiveMsgExceptAt",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,IOS_OFFLINE_PUSH_NO_SOUND:"push.no_sound",IOS_OFFLINE_PUSH_DEFAULT_SOUND:"default"};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&&0<this.middlewares.length)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 i{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(){var 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}}let n={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"},INDONESIA:{DEFAULT:"wss://wssidn-dev.im.qcloud.com"}},PRODUCTION:{CHINA:{DEFAULT0:"wss://*w4c.my-imcloud.com",DEFAULT:"wss://wss.im.qcloud.com",IPV6:"wss://wssv6.im.qcloud.com",BACKUP:"wss://wss.tim.qq.com",BACKUP_WEB:"wss://*w4c.my-cpaas.com",STAT:"https://events.im.qcloud.com",ANYCAST:"wss://162.14.13.203"},OVERSEA:{DEFAULT0:"wss://*w4c.my-imcloud.com",DEFAULT:"wss://wss.im.qcloud.com",IPV6:"wss://wssv6.im.qcloud.com",BACKUP:"wss://wss.my-imcloud.com",BACKUP_WEB:"wss://*w4c.my-cpaas.com",STAT:"https://api.my-imcloud.com"},SINGAPORE:{DEFAULT0:"wss://*w4s.my-imcloud.com",DEFAULT:"wss://wsssgp.im.qcloud.com",IPV6:"wss://wsssgpv6.im.qcloud.com",BACKUP:"wss://wsssgp.my-imcloud.com",BACKUP_WEB:"wss://*w4s.my-cpaas.com",STAT:"https://apisgp.my-imcloud.com",ANYCAST:"wss://162.14.19.159"},KOREA:{DEFAULT0:"wss://*w4k.my-imcloud.com",DEFAULT:"wss://wsskr.im.qcloud.com",IPV6:"wss://wsskrv6.im.qcloud.com",BACKUP:"wss://wsskr.my-imcloud.com",BACKUP_WEB:"wss://*w4k.my-cpaas.com",STAT:"https://apikr.my-imcloud.com",ANYCAST:"wss://162.14.13.104"},GERMANY:{DEFAULT0:"wss://*w4g.my-imcloud.com",DEFAULT:"wss://wssger.im.qcloud.com",IPV6:"wss://wssgerv6.im.qcloud.com",BACKUP:"wss://wssger.my-imcloud.com",BACKUP_WEB:"wss://*w4g.my-cpaas.com",STAT:"https://apiger.my-imcloud.com",ANYCAST:"wss://162.14.3.17"},IND:{DEFAULT0:"wss://*w4i.my-imcloud.com",DEFAULT:"wss://wssind.my-imcloud.com",IPV6:"wss://wssindv6.im.qcloud.com",BACKUP:"wss://wssind.im.qcloud.com",BACKUP_WEB:"wss://*w4i.my-cpaas.com",STAT:"https://apiind.my-imcloud.com",ANYCAST:"wss://162.14.19.46"},JPN:{DEFAULT0:"wss://*w4j.my-imcloud.com",DEFAULT:"wss://wssjpn.im.qcloud.com",IPV6:"wss://wssjpnv6.im.qcloud.com",BACKUP:"wss://wssjpn.my-imcloud.com",BACKUP_WEB:"wss://*w4j.my-cpaas.com",STAT:"https://apijpn.my-imcloud.com"},USA:{DEFAULT0:"wss://*w4u.my-imcloud.com",DEFAULT:"wss://wssusa.im.qcloud.com",IPV6:"wss://wssusav6.im.qcloud.com",BACKUP:"wss://wssusa.my-imcloud.com",BACKUP_WEB:"wss://*w4u.my-cpaas.com",STAT:"https://apiusa.my-imcloud.com",ANYCAST:"wss://162.14.10.42"},INDONESIA:{DEFAULT0:"wss://*w4y.my-imcloud.com",DEFAULT:"wss://wssidn.im.qcloud.com",IPV6:"wss://wssidnv6.im.qcloud.com",BACKUP:"wss://wssidn.my-imcloud.com",BACKUP_WEB:"wss://*w4y.my-cpaas.com",STAT:"https://apiidn.my-imcloud.com",ANYCAST:"wss://43.129.34.169"}}},o={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,DONUT_NATIVE_APP:19,NS_NATIVE_APP:20,RN_NATIVE_APP:21},r="1.7.3",a=537048168,c="CHINA",l="OVERSEA",u="SINGAPORE",d="KOREA",_="GERMANY",h="IND",p="JPN",g="USA",m="INDONESIA",f={HOST:{CURRENT:{DEFAULT:"wss://wss.im.qcloud.com",STAT:"https://events.im.qcloud.com"},setCurrent(e=c){this.CURRENT=n.PRODUCTION[e]}},NAME:{OPEN_IM:"openim",OPEN_IM_MSG_EXT:"openim_msg_ext_http_svc",GRP:"group_open_http_svc",GRP_AV:"group_open_avchatroom_http_svc",GRP_COMMUNITY:"million_group_open_http_svc",GRP_ATTR:"group_open_attr_http_svc",FD:"sns",PROFILE:"profile",RECENT_CONTACT:"recentcontact",PIC:"openpic",BIG_GRP_NO_AUTH:"group_open_http_noauth_svc",BIG_GRP_POLLING:"group_open_long_polling_http_svc",BIG_GRP_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_MSG:"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",IM_OPEN_SPEECH:"im_open_speech",MSG_SEARCH:"message_search",GRP_SEARCH:"group_search",GRP_MEMBER_SEARCH:"group_member_search",USER_SEARCH:"user_search",FOLLOW:"follow",OFFLINE_PUSH_REPORT:"offline_push_report",IM_MSG_LOGIC:"im_msg_db_logic"}},M={SEARCH_GRP_SNS:new i(0,Math.pow(2,1)).toString(),AV_HISTORY_MSG:new i(0,Math.pow(2,2)).toString(),GRP_COMMUNITY:new i(0,Math.pow(2,3)).toString(),MSG_TO_SPECIFIED_GRP_MBR:new i(0,Math.pow(2,4)).toString(),AV_MBR_LIST:new i(0,Math.pow(2,6)).toString(),USER_STATUS:new i(0,Math.pow(2,7)).toString(),CONV_MARK:new i(0,Math.pow(2,9)).toString(),CONV_GROUP:new i(0,Math.pow(2,10)).toString(),AV_BAN_MBR:new i(0,Math.pow(2,11)).toString(),MSG_EXT:new i(0,Math.pow(2,13)).toString(),GRP_COUNTER:new i(0,Math.pow(2,15)).toString(),PLUGIN_TRANSLATE:new i(Math.pow(2,6)).toString(),PLUGIN_VOICE_TO_TEXT:new i(Math.pow(2,7)).toString(),PLUGIN_CS:new i(Math.pow(2,8)).toString(),PLUGIN_PUSH:new i(Math.pow(2,9)).toString(),PLUGIN_BOT:new i(Math.pow(2,10)).toString(),MSG_REACTION:new i(Math.pow(2,16)).toString(),FOLLOW:new i(Math.pow(2,20)).toString()},I="c2c_text_message",C="c2c_custom_message",T="group_text_message",y="group_custom_message",v="user_profile",E="group_profile",S="web.sdk.qcloud.com",D="web.sdk.cloud.tencent.cn",R="web.sdk.tencent.cn",L=(f.HOST.setCurrent(c),"undefined"!=typeof wx&&"function"==typeof wx.getSystemInfoSync&&Boolean(wx.getSystemInfoSync().fontSizeSetting)),A=L&&"function"==typeof wx.createGamePortal,O="undefined"!=typeof qq&&"function"==typeof qq.getSystemInfoSync&&Boolean(qq.getSystemInfoSync().fontSizeSetting),N="undefined"!=typeof tt&&"function"==typeof tt.getSystemInfoSync&&Boolean(tt.getSystemInfoSync().fontSizeSetting),P="undefined"!=typeof swan&&"function"==typeof swan.getSystemInfoSync&&Boolean(swan.getSystemInfoSync().fontSizeSetting),U="undefined"!=typeof my&&"function"==typeof my.getSystemInfoSync&&Boolean(my.getSystemInfoSync().fontSizeSetting),G="undefined"!=typeof jd&&"function"==typeof jd.getSystemInfoSync,k="undefined"!=typeof uni&&"undefined"==typeof window&&"function"==typeof uni.requireNativePlugin,w=L&&"object"==typeof wx.miniapp,b="undefined"!=typeof uni,F=L||O||N||P||U||k||G,$="undefined"==typeof window&&!F&&"undefined"!=typeof global&&void 0!==global.NativeScriptGlobals,q="undefined"!=typeof global&&(void 0!==global.nativeModuleProxy||void 0!==global.ReactNative),x="undefined"!=typeof uni?!F:"undefined"!=typeof window&&!F&&!q,V=O?qq:N?tt:P?swan:U?my:L?wx:k?uni:G?jd:{},B=x&&window&&window.navigator&&window.navigator.userAgent||"",K=/(micromessenger|webbrowser)/i.test(B),H=function(){let e="WEB";return K?e="WEB":O?e="QQ_MP":N?e="TT_MP":P?e="BAIDU_MP":U?e="ALI_MP":L?e=w?"DONUT_NATIVE_APP":"WX_MP":k?e="UNI_NATIVE_APP":$?e="NS_NATIVE_APP":q&&(e="RN_NATIVE_APP"),o[e]}(),W=/iPad/i.test(B),Y=/iPhone/i.test(B)&&!W,z=/iPod/i.test(B),j=Y||W||z,J=function(){var e=B.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),X=/Android/i.test(B),Z=function(){var e,t,s=B.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);return s?(e=s[1]&&parseFloat(s[1]),t=s[2]&&parseFloat(s[2]),e&&t?parseFloat(s[1]+"."+s[2]):e||null):null}(),Q=/Edge/i.test(B),ee=!Q&&/Chrome/i.test(B),te=/MSIE/.test(B)||-1<B.indexOf("Trident")&&-1<B.indexOf("rv:11.0"),se=function(){var e=/MSIE\s(\d+)\.\d/.exec(B);let t=e&&parseFloat(e[1]);return t=!t&&/Trident\/7.0/i.test(B)&&/rv:11.0/.test(B)?11:t}(),ie=/Safari/i.test(B)&&!ee&&!X&&!Q,ne=/Windows/i.test(B),oe=/MAC OS X/i.test(B),re=x&&"undefined"!=typeof Worker&&!te,ae=X||j,ce=x&&void 0!==window.tencent_cloud_im_csig_flutter_for_web_25F_cy,le=function(){var e;return"undefined"!=typeof window&&void 0!==window.navigator&&(e=window.navigator.standalone,!(!j||e||ie))}(),ue,de,_e=(ue="undefined"!=typeof console?console:"undefined"!=typeof global&&global.console?global.console:"undefined"!=typeof window&&window.console?window.console:{},function(){}),he=["assert","clear","count","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"],pe=he.length;for(;pe--;)de=he[pe],console[de]||(ue[de]=_e);var ge=ue;let me=0,fe=function(){return(new Date).getTime()+me},Me=function(){me=0},Ie=function(){return Math.floor(fe()/1e3)},Ce=0;function Te(){return Rt()?"%c Chat %c":"Chat"}function ye(){(e=new Date).setTime(fe());var 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())}let ve={arguments2String(s){let i="";if(1===s.length)i=s[0];else for(let e=0,t=s.length;e<t;e++){if(Be(s[e]))try{i+=He(s[e])?JSON.stringify(s[e],["message","code"]):JSON.stringify(s[e])}catch(e){i+=e?e.message:"";break}else i+=s[e];i+=" "}return i},_exec(e,t){Rt()?ge[e](Te(),"background:#0abf5b; padding:1px; border-radius:3px; color: #fff","background:transparent",ye(),t):ge[e](`${Te()} ${ye()} `+t)},d:function(){var e;Ce<=-1&&(e=this.arguments2String(arguments),this._exec("debug",e))},l:function(){var e;Ce<=0&&(e=this.arguments2String(arguments),this._exec("log",e))},log:function(){var e;Ce<=0&&(e=this.arguments2String(arguments),this._exec("log",e))},i:function(){var e;Ce<=1&&(e=this.arguments2String(arguments),this._exec("info",e))},w:function(){var e;Ce<=2&&(e=this.arguments2String(arguments),this._exec("warn",e))},e:function(){var e;Ce<=3&&(e=this.arguments2String(arguments),this._exec("error",e))},setLevel:function(e){e<4&&this._exec("log","set level from "+Ce+" to "+e),Ce=e},getLevel:function(){return Ce}},Ee={JPG:1,JPEG:1,GIF:2,PNG:3,BMP:4,UNKNOWN:255},Se={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"},De="Gender_Type_",Re={UNKNOWN:De+"Unknown",FEMALE:De+"Female",MALE:De+"Male"},Le={NONE:"AdminForbid_Type_None",SEND_OUT:"AdminForbid_Type_SendOut"},Ae={NEED_CONFIRM:"AllowType_Type_NeedConfirm",ALLOW_ANY:"AllowType_Type_AllowAny",DENY_ANY:"AllowType_Type_DenyAny"},Oe="@TGS#_",Ne="@TOPIC#_",Pe=Object.prototype.hasOwnProperty;function Ue(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(qe(e)){for(var t in e)if(Pe.call(e,t))return!1;return!0}return!!(Ge(e)||ke(e)||we(e))&&0===e.size}let Ge=function(e){return"map"===Ye(e)},ke=function(e){return"set"===Ye(e)},we=function(e){return"file"===Ye(e)},be=function(e){return null!==e&&("number"==typeof e&&!isNaN(+e)||"object"==typeof e&&e.constructor===Number)},Fe=function(e){return"string"==typeof e},$e=function(e){return null!==e&&"object"==typeof e},qe=function(e){if("object"!=typeof e||null===e)return!1;e=Object.getPrototypeOf(e);if(null===e)return!0;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return e===t},xe=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"array"===Ye(e)},Ve=function(e){return void 0===e},Be=function(e){return xe(e)||$e(e)},Ke=function(e){return"function"==typeof e},He=function(e){return e instanceof Error},We=function(e){return"filelist"===Ye(e)},Ye=function(e){return Object.prototype.toString.call(e).match(/^\[object (.*)\]$/)[1].toLowerCase()},ze=function(e){return"string"==typeof e&&(e=e[0],!/[^a-zA-Z0-9]/.test(e))},je=(Date.now||(Date.now=function(){return(new Date).getTime()}),function(s,i,o,r){if(!Be(s)||!Be(i))return 0;let n=0;var a,l=Object.keys(i);for(let e=0,t=l.length;e<t;e++)if(a=l[e],!(Ve(i[a])||o&&o.includes(a)))if(Be(s[a])&&Be(i[a]))n+=je(s[a],i[a],o,r);else{if(r&&r.includes(i[a]))continue;s[a]!==i[a]&&(s[a]=i[a],n+=1)}return n}),Je=function(e,t){var s,i,o=new Map;for([s,i]of e.entries())i&&o.set(s,t?JSON.stringify(i):JSON.parse(JSON.stringify(i)));return o},Xe=function(e){if(0===e.length)return 0;let t=0,s=0,i;for(var o="undefined"!=typeof document&&void 0!==document.characterSet?document.characterSet:"UTF-8";void 0!==e[t];)i=e[t++].charCodeAt[t]<=255?1:!1===o?3:2,s+=i;return s},Ze=function(e){e=e||99999999;return Math.round(Math.random()*e)},Qe="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",et=Qe.length,st=function(e,t){for(var s in e)if(e[s]===t)return!0;return!1},it={},nt=function(e){return-1===e.indexOf("http://")||-1===e.indexOf("https://")?"https://"+e:e.replace(/https|http/,"https")};function ot(i,e){if(!xe(i)||!xe(e))return!1;let o=!1;return e.forEach(({key:t,value:e})=>{var s=i.find(e=>e.key===t);s?s.value!==e&&(s.value=e,o=!0):(i.push({key:t,value:e}),o=!0)}),o}function rt(e){var t;if(qe(e)&&qe(e.webhookInfo))return t=[],e.webhookInfo.disableCloudMessagePreHook&&t.push("ForbidBeforeSendMsgCallback"),e.webhookInfo.disableCloudMessagePostHook&&t.push("ForbidAfterSendMsgCallback"),0!==t.length?t:void 0}let at=e=>e===t.GRP_AVCHATROOM,ct=({type:e,groupID:s})=>e===t.GRP_COMMUNITY||(""+s).startsWith(Oe)&&!(""+s).includes(Ne),lt=e=>(""+e).startsWith(Oe)&&(""+e).includes(Ne),ut=e=>Fe(e)&&e.slice(0,3)===t.CONV_C2C,dt=e=>Fe(e)&&e.slice(0,5)===t.CONV_GROUP,_t=e=>Fe(e)&&e===t.CONV_SYSTEM;function ht(t,s){let i={};return Object.keys(t).forEach(e=>{i[e]=s(t[e],e)}),i}function pt(i){return q?Promise.resolve({width:0,height:0}):F?new Promise((t,e)=>{V.getImageInfo({src:i,success(e){t({width:e.width,height:e.height})},fail(){t({width:0,height:0})}})}):te&&9===se?Promise.resolve({width:0,height:0}):new Promise((e,t)=>{let s=new Image;s.onload=function(){e({width:this.width,height:this.height}),s=null},s.onerror=function(){e({width:0,height:0}),s=null},s.src=i})}function gt(){function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return""+(e()+e())+e()+e()+e()+e()+e()+e()}function mt(){let e="unknown";if(oe&&(e="mac"),ne&&(e="windows"),j&&(e="ios"),X&&(e="android"),F)try{var t=V.getSystemInfoSync().platform;void 0!==t&&(e=t)}catch(e){}return e}function ft(i,o){i=i.split("."),o=o.split(".");let e=Math.max(i.length,o.length);for(;i.length<e;)i.push("0");for(;o.length<e;)o.push("0");for(let s=0;s<e;s++){let e=parseInt(i[s]),t=parseInt(o[s]);if(e>t)return 1;if(e<t)return-1}return 0}function Mt(e){let{originUrl:t,originWidth:s,originHeight:i,min:o=198}=e,r=parseInt(s),n=parseInt(i),a={url:void 0,width:0,height:0};if((r<=n?r:n)<=o)a.url=t,a.width=r,a.height=n;else{n<=r?(a.width=Math.ceil(r*o/n),a.height=o):(a.width=o,a.height=Math.ceil(n*o/r));let e=t&&-1<t.indexOf("?")?t+"&":t+"?";a.url=198===o?e+"imageView2/3/w/198/h/198":e+"imageView2/3/w/720/h/720"}if(Ve(t)){let{url:e,...t}=a;return t}return a}function It(t){var e=t[2];t[2]=t[1],t[1]=e;for(let e=0;e<t.length;e++)t[e].setType(e)}function Ct(e){e=e.servcmd;return e.slice(e.indexOf(".")+1)}function Tt(e,t){return Math.round(Number(e)*Math.pow(10,t))/Math.pow(10,t)}function yt(e,t){return e.includes(t)}function vt(e,t){return e.includes(t)}function Et(e){return e.split(Ne)[0]}let St=function(e,s,i){if(Ve(s))return"";switch(e){case t.MSG_TEXT:return s.text;case t.MSG_IMAGE:return i?"[Image]":"[图片]";case t.MSG_LOCATION:return i?"[Location]":"[位置]";case t.MSG_AUDIO:return i?"[Voice]":"[语音]";case t.MSG_VIDEO:return i?"[Video]":"[视频]";case t.MSG_FILE:return i?"[File]":"[文件]";case t.MSG_CUSTOM:return i?"[Custom Messages]":"[自定义消息]";case t.MSG_GRP_TIP:return i?"[Group Notification]":"[群提示消息]";case t.MSG_GRP_SYS_NOTICE:return i?"[Group System Message]":"[群系统通知]";case t.MSG_FACE:return i?"[Animated Sticker]":"[动画表情]";case t.MSG_MERGER:return i?"[Chat Record]":"[聊天记录]";default:return""}};function Dt(t){var s=[];if(Fe(t)){var i=t.length;if(0!==i)for(let e=i-1;0<=e;e--)"1"===t[e]&&s.push(Math.pow(2,i-e-1))}return s}function Rt(){return!te&&!F}function Lt(e){return"the length of userIDList cannot exceed "+e}function At(e,t=!0,s=!0){var i=Date.now();return t?s?i-e+" ms":Math.round((i-e)/1e3)+" s":s?i-e:Math.round((i-e)/1e3)}function Ot(e){let t=e&&1<e?!0:!1;return t}function Nt(s,i,o){if(void 0===i)return!0;let r=!0;if(qe(i))Object.keys(i).forEach(e=>{var t=1===s.length?s[0][e]:void 0;r=!!Pt(t,i[e],o,e)&&r});else if(xe(i))for(let e=0;e<i.length;e++)r=!!Pt(s[e],i[e],o,i[e].name)&&r;if(r)return r;throw new Error("Params validate failed.")}function Pt(e,t,s,i){if(void 0===t)return!0;let o=!0;var r,n;return t.required&&Ue(e)&&(ve.e(`[${s}] Missing required params: "${i}".`),o=!1),Ue(e)||(r=Ye(e))===(n=t.type.toLowerCase())||"asyncfunction"===r&&"function"===n||(ve.e(`[${s}] Invalid params: type check failed for "${i}". Expected ${t.type}.`),o=!1),t.validator&&!t.validator(e,s,i)&&(ve.e(`[${s}] Invalid params: custom validator check failed for "${i}".`),o=!1),o}let Ut="unSend",Gt="success",kt="fail",wt="notStart",bt="pending",Ft="resolved",$t="rejected",qt=function(e){return!(!e||!(ut(e)||dt(e)||_t(e))&&((e=Ms("InvalidConversationID",e))&&ve.w(e),1))},xt=function(e){""!==e.desc&&""!==Ms("API_REFER")&&ve.w(`[${e.api}] | ${e.paramName} | ${e.desc}, `+Ms("API_REFER")+e.api)},Vt=function(){return Ms("StringRequiredLog")},Bt=function(e){return Ms("NonEmptyStringRequiredLog",e)},Kt=function(){return Ms("NumberRequiredLog")},Ht=function(){return Ms("UndefinedNotAllowedLog")},Wt=function(){return Ms("FileRequiredLog")},Yt=function(){return Ms("FunctionRequiredLog")},zt=function(){return Ms("ArrayRequiredLog")},jt=function(){return Ms("NonEmptyArrayLog")},Jt=function(){return Ms("CallbackMissingLog")},Xt=function(){return Ms("PositiveIntegerRequiredLog")},Zt=function(e,t){return Ms("StringNotLongerThanLog",e,t)},Qt=function(e,t){return Ms("NumberGreaterThanLog",e,t)},es=function(e,t){return Ms("NumberGreaterOrEqualLog",e,t)},ts=function(e){return Ms("KeyValueStringRequiredLog",e)},ss=function(){return Ms("PlainObjectRequiredLog")},is=function(){return Ms("NonEmptyContentRequiredLog")},ns=function(){return Ms("FileNotSelectedLog")},os=function(){return Ms("MessageInstanceRequiredLog")},rs=function(){return Ms("NonAnonymousFunctionLog")},as=function(){return Ms("MessageExtensionNotAvailableLog")},cs=function(){return Ms("MessageReactionRequiredLog")},ls=function(e,t){return Ms("ContainsUnsupportedTypeLog",e,t)},us={type:"String",required:!0},ds={type:"Array",required:!0},_s={type:"Object",required:!0},hs={type:"Boolean",required:!0},ps={type:"number",required:!0},gs=function(e,t,s,{allowUndefined:i,allowEmpty:o,maxLength:r}){return Ve(e)?!!i||(xt({api:t,paramName:s,desc:Ht()}),!1):xe(e)?!(0===e.length&&(xt({api:t,paramName:s,desc:jt()}),!o)||r&&e.length>r&&(xt({api:t,paramName:s,desc:(i=s,o=r,Ms("MaximumArrayLengthLog",i,o))}),1)):(xt({api:t,paramName:s,desc:zt()}),!1)},ms=function(e,t,s,{allowUndefined:i,min:o,max:r}){return Ve(e)?!!i||(xt({api:t,paramName:s,desc:Ht()}),!1):be(e)?be(o)&&e<o?(xt({api:t,paramName:s,desc:0===o?es(s,o):Qt(s,o-1)}),!1):!(be(r)&&r<e&&(xt({api:t,paramName:s,desc:(i=s,o=r,Ms("MaximumNumberLog",i,o))}),1)):(xt({api:t,paramName:s,desc:Kt()}),!1)},fs={keywordListForMsg:{type:"Array",required:!1,validator:(e,t,s)=>gs(e,t,s,{allowUndefined:!0,allowEmpty:!0,maxLength:5})},keywordListExceptMsg:{type:"Array",required:!0,validator:(e,t,s)=>gs(e,t,s,{allowUndefined:!1,allowEmpty:!1,maxLength:5})},keywordListMatchType:{type:"String",required:!1,validator:(e,t,s)=>!e||"or"===e||"and"===e||xt({api:t,paramName:s,desc:e+" is invalid match type"})},cursor:{type:"String",required:!1},count:{type:"Number",required:!1,validator:(e,t,s)=>ms(e,t,s,{allowUndefined:!0,min:1,max:100})},groupTypeList:{type:"Array",required:!1,validator:(e,s,i)=>{if(!e)return!0;if(!gs(e,s,i,{allowUndefined:!0,allowEmpty:!0}))return!1;let o=[t.GRP_PUBLIC,t.GRP_COMMUNITY,t.GRP_WORK,t.GRP_MEETING];return!(0<e.filter(e=>-1===o.indexOf(e)).length&&(xt({api:s,paramName:i,desc:ls(i,"group")}),1))}}},Ms=null,Is={hookGetAPITips:function(e){Ms=e},login:{userID:us,userSig:us},addToBlacklist:{userIDList:ds},removeFromBlacklist:{userIDList:ds},on:[{name:"eventName",type:"String",validator:(e,t,s)=>"string"==typeof e&&0!==e.length||(xt({api:t,paramName:s,desc:Bt(s)}),!1)},{name:"handler",type:"Function",validator:(e,t,s)=>"function"!=typeof e?(xt({api:t,paramName:s,desc:Yt()}),!1):(""===e.name&&xt({api:t,paramName:s,desc:rs()}),!0)}],once:[{name:"eventName",type:"String",validator:(e,t,s)=>"string"==typeof e&&0!==e.length||(xt({api:t,paramName:s,desc:Bt(s)}),!1)},{name:"handler",type:"Function",validator:(e,t,s)=>"function"!=typeof e?(xt({api:t,paramName:s,desc:Yt()}),!1):(""===e.name&&xt({api:t,paramName:s,desc:rs()}),!0)}],off:[{name:"eventName",type:"String",validator:(e,t,s)=>"string"==typeof e&&0!==e.length||(xt({api:t,paramName:s,desc:Bt(s)}),!1)},{name:"handler",type:"Function",validator:(e,t,s)=>"function"!=typeof e?(xt({api:t,paramName:s,desc:Yt()}),!1):(""===e.name&&xt({api:t,paramName:s,desc:rs()}),!0)}],sendMessage:[{name:"message",..._s}],setMessageExtensions:[{name:"message",..._s,validator:(e,t,s)=>e.status===Gt&&!0===e.isSupportExtension||(xt({api:t,paramName:s,desc:as()}),!1)},{name:"extensions",...ds}],getMessageExtensions:[{name:"message",..._s,validator:(e,t,s)=>e.status===Gt&&!0===e.isSupportExtension||(xt({api:t,paramName:s,desc:as()}),!1)}],deleteMessageExtensions:[{name:"message",..._s,validator:(e,t,s)=>e.status===Gt&&!0===e.isSupportExtension||(xt({api:t,paramName:s,desc:as()}),!1)}],addMessageReaction:[{name:"message",..._s,validator:(e,t,s)=>e.status===Gt||(xt({api:t,paramName:s,desc:cs()}),!1)},{name:"reactionID",...us}],removeMessageReaction:[{name:"message",..._s,validator:(e,t,s)=>e.status===Gt||(xt({api:t,paramName:s,desc:cs()}),!1)},{name:"reactionID",...us}],getMessageReactions:{messageList:{...ds}},getAllUserListOfMessageReaction:{message:{..._s,validator:(e,t,s)=>e.status===Gt||(xt({api:t,paramName:s,desc:cs()}),!1)},reactionID:{...us},nextSeq:{type:"Number"},count:{type:"Number"}},getMessageList:{conversationID:{...us,validator:e=>qt(e)},nextReqMessageID:{type:"String"},count:{type:"Number",validator:(e,t,s)=>!(!Ve(e)&&!/^[1-9][0-9]*$/.test(e)&&(xt({api:t,paramName:s,desc:Xt()}),1))}},getMessageListHopping:{conversationID:{...us,validator:e=>qt(e)},sequence:{type:"Number"},time:{type:"Number"},direction:{type:"Number",validator:(e,t,s)=>!(!Ve(e)&&0!==e&&1!==e&&(xt({api:t,paramName:s,desc:Ms("0Or1RequiredLog")}),1))},count:{type:"Number",validator:(e,t,s)=>!(!Ve(e)&&!/^[1-9][0-9]*$/.test(e)&&(xt({api:t,paramName:s,desc:Xt}),1))}},setMessageRead:{conversationID:{...us,validator:e=>qt(e)}},setAllMessageRead:{scope:{type:"String",required:!1,validator:(e,s,i)=>!e||-1!==[t.READ_ALL_C2C_MSG,t.READ_ALL_GROUP_MSG,t.READ_ALL_MSG].indexOf(e)||(xt({api:s,paramName:i,desc:Ms("ValidScopeRequired")}),!1)}},getConversationProfile:[{name:"conversationID",...us,validator:e=>qt(e)}],clearHistoryMessage:[{name:"conversationID",...us,validator:e=>qt(e)}],pinConversation:{conversationID:{...us,validator:e=>qt(e)},isPinned:{...hs}},setConversationDraft:{conversationID:{...us,validator:e=>qt(e)},draftText:{type:"String",validator:(e,t,s)=>!!Fe(e)||(xt({api:t,paramName:s,desc:Vt()}),!1)}},setConversationCustomData:{conversationIDList:{...ds},customData:{type:"String",validator:(e,t,s)=>Fe(e)?!(256<e.length&&(xt({api:t,paramName:s,desc:Zt(s,256)}),1)):(xt({api:t,paramName:s,desc:Vt()}),!1)}},markConversation:{conversationIDList:{...ds},markType:{type:"number",validator:(e,t,s)=>{return be(e)?e<=0?(xt({api:t,paramName:s,desc:Qt(s,0)}),!1):!(e>=Math.pow(2,64)&&(xt({api:t,paramName:s,desc:(e=s,Ms("NumberLessThanLog",e,"Math.pow(2,64)"))}),1)):(xt({api:t,paramName:s,desc:Kt()}),!1)}},enableMark:{...hs}},createConversationGroup:{conversationIDList:{...ds},groupName:{...us,validator:(e,t,s)=>!(!e||32<e.length&&(xt({api:t,paramName:s,desc:Zt(s,32)}),1))}},deleteConversationGroup:[{name:"groupName",...us}],renameConversationGroup:{oldName:{...us},newName:{...us,validator:(e,t,s)=>!(!e||32<e.length&&(xt({api:t,paramName:s,desc:Zt(s,32)}),1))}},addConversationsToGroup:{conversationIDList:{...ds},groupName:{...us}},deleteConversationsFromGroup:{conversationIDList:{...ds},groupName:{...us}},getGroupList:{groupProfileFilter:{type:"Array"}},getGroupProfile:{groupID:us,groupCustomFieldFilter:{type:"Array"},memberCustomFieldFilter:{type:"Array"}},getGroupProfileAdvance:{groupIDList:ds},createGroup:{name:us},joinGroup:{groupID:us,type:{type:"String"},applyMessage:{type:"String"}},quitGroup:[{name:"groupID",...us}],handleApplication:{message:_s,handleAction:us,handleMessage:{type:"String"}},changeGroupOwner:{groupID:us,newOwnerID:us},updateGroupProfile:{groupID:us,muteAllMembers:{type:"Boolean"}},dismissGroup:[{name:"groupID",...us}],searchGroupByID:[{name:"groupID",...us}],getGroupOnlineMemberCount:[{name:"groupID",...us}],initGroupAttributes:{groupID:us,groupAttributes:{..._s,validator:(t,s,i)=>{let o=!0;return Object.keys(t).forEach(e=>{if(!Fe(t[e]))return xt({api:s,paramName:i,desc:ts("value")}),o=!1}),o}}},setGroupAttributes:{groupID:us,groupAttributes:{..._s,validator:(t,s,i)=>{let o=!0;return Object.keys(t).forEach(e=>{if(!Fe(t[e]))return xt({api:s,paramName:i,desc:ts("value")}),o=!1}),o}}},deleteGroupAttributes:{groupID:us,keyList:{type:"Array",validator:(e,s,i)=>{if(Ve(e)||!xe(e))return xt({api:s,paramName:i,desc:zt()}),!1;if(Ue(e))return!0;{let t=!0;return e.forEach(e=>{if(!Fe(e))return xt({api:s,paramName:i,desc:Ms("StringArrayRequiredLog")}),t=!1}),t}}}},getGroupAttributes:{groupID:us,keyList:{type:"Array",validator:(e,s,i)=>{if(Ve(e)||!xe(e))return xt({api:s,paramName:i,desc:zt()}),!1;if(Ue(e))return!0;{let t=!0;return e.forEach(e=>{if(!Fe(e))return xt({api:s,paramName:i,desc:ts("key")}),t=!1}),t}}}},setGroupCounters:{groupID:us,counters:_s},increaseGroupCounter:{groupID:us,key:us,value:ps},decreaseGroupCounter:{groupID:us,key:us,value:ps},getGroupCounters:{groupID:us},getGroupMemberList:{groupID:us,count:{type:"Number"}},getGroupMemberProfile:{groupID:us,userIDList:ds,memberCustomFieldFilter:{type:"Array"}},addGroupMember:{groupID:us,userIDList:ds},setGroupMemberRole:{groupID:us,userID:us,role:us},setGroupMemberMuteTime:{groupID:us,userID:us,muteTime:{type:"Number",validator:e=>0<=e}},setGroupMemberNameCard:{groupID:us,userID:{type:"String"},nameCard:{type:"String",validator:(e,t,s)=>Fe(e)?(e.length,!0):(xt({api:t,paramName:s,desc:Vt()}),!1)}},setGroupMemberCustomField:{groupID:us,userID:{type:"String"},memberCustomField:ds},deleteGroupMember:{groupID:us},markGroupMemberList:{groupID:us,markType:{type:"number",validator:(e,t,s)=>be(e)?!(e<1e3&&(xt({api:t,paramName:s,desc:es(s,1e3)}),1)):(xt({api:t,paramName:s,desc:Kt()}),!1)},userIDList:{...ds},enableMark:{...hs}},createTextMessage:{to:us,conversationType:us,payload:{..._s,validator:(e,t,s)=>qe(e)?Fe(e.text)?0!==e.text.length||(xt({api:t,paramName:"payload.text",desc:is()}),!1):(xt({api:t,paramName:"payload.text",desc:Vt()}),!1):(xt({api:t,paramName:s,desc:ss()}),!1)}},createTextAtMessage:{to:us,conversationType:us,payload:{..._s,validator:(e,t,s)=>qe(e)?Fe(e.text)?0===e.text.length?(xt({api:t,paramName:"payload.text",desc:is()}),!1):!(e.atUserList&&!xe(e.atUserList)&&(xt({api:t,paramName:"payload.atUserList",desc:zt()}),1)):(xt({api:t,paramName:"payload.text",desc:Vt()}),!1):(xt({api:t,paramName:s,desc:ss()}),!1)}},createCustomMessage:{to:us,conversationType:us,payload:{..._s,validator:(e,t,s)=>qe(e)?e.data&&!Fe(e.data)?(xt({api:t,paramName:"payload.data",desc:Vt()}),!1):e.description&&!Fe(e.description)?(xt({api:t,paramName:"payload.description",desc:Vt()}),!1):!(e.extension&&!Fe(e.extension)&&(xt({api:t,paramName:"payload.extension",desc:Vt()}),1)):(xt({api:t,paramName:"payload",desc:ss()}),!1)}},createImageMessage:{to:us,conversationType:us,payload:{..._s,validator:(e,t,s)=>{if(!qe(e))return xt({api:t,paramName:s,desc:ss()}),!1;if(Ve(e.file))return xt({api:t,paramName:"payload.file",desc:Ht()}),!1;if(x){if(!(e.file instanceof HTMLInputElement||we(e.file)))return qe(e.file)&&"undefined"!=typeof uni?0!==e.file.tempFilePaths.length&&0!==e.file.tempFiles.length||(xt({api:t,paramName:"payload.file",desc:ns()}),!1):(xt({api:t,paramName:"payload.file",desc:Wt()}),!1);if(e.file instanceof HTMLInputElement&&0===e.file.files.length)return xt({api:t,paramName:"payload.file",desc:ns()}),!1}return!0},onProgress:{type:"Function",required:!1,validator:(e,t,s)=>(Ve(e)&&xt({api:t,paramName:s,desc:Jt()}),!0)}}},createAudioMessage:{to:us,conversationType:us,payload:{..._s,validator:(e,t,s)=>!!qe(e)||(xt({api:t,paramName:s,desc:ss()}),!1)},onProgress:{type:"Function",required:!1,validator:(e,t,s)=>(Ve(e)&&xt({api:t,paramName:s,desc:Jt()}),!0)}},createVideoMessage:{to:us,conversationType:us,payload:{..._s,validator:(e,t,s)=>{if(!qe(e))return xt({api:t,paramName:s,desc:ss()}),!1;if(Ve(e.file))return xt({api:t,paramName:"payload.file",desc:Ht()}),!1;if(x){if(!(e.file instanceof HTMLInputElement||we(e.file)))return qe(e.file)&&"undefined"!=typeof uni?!!we(e.file.tempFile)||(xt({api:t,paramName:"payload.file",desc:ns()}),!1):(xt({api:t,paramName:"payload.file",desc:Wt()}),!1);if(e.file instanceof HTMLInputElement&&0===e.file.files.length)return xt({api:t,paramName:"payload.file",desc:ns()}),!1}return!0}},onProgress:{type:"Function",required:!1,validator:(e,t,s)=>(Ve(e)&&xt({api:t,paramName:s,desc:Jt()}),!0)}},createFaceMessage:{to:us,conversationType:us,payload:{..._s,validator:(e,t,s)=>qe(e)?be(e.index)?!!Fe(e.data)||(xt({api:t,paramName:"payload.data",desc:Vt()}),!1):(xt({api:t,paramName:"payload.index",desc:Kt()}),!1):(xt({api:t,paramName:s,desc:ss()}),!1)}},createFileMessage:{to:us,conversationType:us,payload:{..._s,validator:(e,t,s)=>{if(!qe(e))return xt({api:t,paramName:s,desc:ss()}),!1;if(Ve(e.file))return xt({api:t,paramName:"payload.file",desc:Ht()}),!1;if(x){if(!(e.file instanceof HTMLInputElement||we(e.file)))return qe(e.file)&&"undefined"!=typeof uni?0!==e.file.tempFilePaths.length&&0!==e.file.tempFiles.length||(xt({api:t,paramName:"payload.file",desc:ns()}),!1):(xt({api:t,paramName:"payload.file",desc:Wt()}),!1);if(e.file instanceof HTMLInputElement&&0===e.file.files.length)return xt({api:t,paramName:"payload.file",desc:ns()}),!1}return!0}},onProgress:{type:"Function",required:!1,validator:(e,t,s)=>(Ve(e)&&xt({api:t,paramName:s,desc:Jt()}),!0)}},createLocationMessage:{to:us,conversationType:us,payload:{..._s,validator:(e,t,s)=>qe(e)?Fe(e.description)?be(e.longitude)?!!be(e.latitude)||(xt({api:t,paramName:"payload.latitude",desc:Kt()}),!1):(xt({api:t,paramName:"payload.longitude",desc:Kt()}),!1):(xt({api:t,paramName:"payload.description",desc:Vt()}),!1):(xt({api:t,paramName:s,desc:ss()}),!1)}},createMergerMessage:{to:us,conversationType:us,payload:{..._s,validator:(e,t,s)=>{if(Ue(e.messageList))return xt({api:t,paramName:"payload.messageList",desc:jt()}),!1;if(Ue(e.compatibleText))return xt({api:t,paramName:"payload.compatibleText",desc:Bt("compatibleText")}),!1;let i=!1;return e.messageList.forEach(e=>{e.status===kt&&(i=!0)}),!i||(xt({api:t,paramName:"payload.messageList",desc:Ms("MergeFailedMessageLog")}),!1)}}},revokeMessage:[{name:"message",..._s,validator:(e,s,i)=>Ue(e)?(xt({api:s,paramName:i,desc:os()}),!1):e.conversationType===t.CONV_SYSTEM?(xt({api:s,paramName:i,desc:Ms("MessageCanBeRevokedDesc")}),!1):!0!==e.isRevoked||(xt({api:s,paramName:i,desc:Ms("MessageRevokedLog")}),!1)}],deleteMessage:[{name:"messageList",...ds,validator:(e,t,s)=>!Ue(e)||(xt({api:t,paramName:s,desc:jt()}),!1)}],translateText:{sourceTextList:ds,sourceLanguage:us,targetLanguage:us},convertVoiceToText:{message:{..._s,validator:(e,s,i)=>Ue(e)?(xt({api:s,paramName:i,desc:os()}),!1):e.type===t.MSG_AUDIO&&e.status===Gt||(xt({api:s,paramName:i,desc:Ms("AudioMessageRequiredLog")}),!1)}},modifyMessage:[{name:"message",..._s,validator:(e,s,i)=>Ue(e)?(xt({api:s,paramName:i,desc:os()}),!1):e.conversationType===t.CONV_SYSTEM?(xt({api:s,paramName:i,desc:Ms("MessageCanBeModifiedLog")}),!1):!0!==e._onlineOnlyFlag||(xt({api:s,paramName:i,desc:Ms("OnlineMessageNotSupportLog")}),!1)}],searchCloudMessages:{keywordList:fs.keywordListForMsg,keywordListMatchType:fs.keywordListMatchType,cursor:fs.cursor,senderUserIDList:{type:"Array",required:!1,validator:(e,t,s)=>gs(e,t,s,{allowUndefined:!0,allowEmpty:!0,maxLength:5})},messageTypeList:{type:"Array",required:!1,validator:(e,s,i)=>{if(!e)return!0;if(!gs(e,s,i,{allowUndefined:!0,allowEmpty:!0}))return!1;let o=[t.MSG_TEXT,t.MSG_IMAGE,t.MSG_AUDIO,t.MSG_FILE,t.MSG_VIDEO,t.MSG_LOCATION,t.MSG_CUSTOM,t.MSG_MERGER];return!(0<e.filter(e=>-1===o.indexOf(e)).length&&(xt({api:s,paramName:i,desc:ls(i,"message")}),1))}},conversationID:{type:"String",required:!1,validator:e=>!e||qt(e)},timePosition:{type:"number",required:!1,validator:(e,t,s)=>ms(e,t,s,{allowUndefined:!0,min:0})},timePeriod:{type:"number",required:!1,validator:(e,t,s)=>ms(e,t,s,{allowUndefined:!0,min:0})}},searchCloudUsers:{keywordList:fs.keywordListExceptMsg,keywordListMatchType:fs.keywordListMatchType,cursor:fs.cursor,count:fs.count,miniBirthday:{type:"Number",required:!1,validator:(e,t,s)=>ms(e,t,s,{allowUndefined:!0,min:0})},maxBirthday:{type:"Number",required:!1,validator:(e,t,s)=>ms(e,t,s,{allowUndefined:!0,min:0})},gender:{type:"String",required:!1,validator:(e,s,i)=>!e||e===t.GENDER_FEMALE||e===t.GENDER_MALE||xt({api:s,paramName:i,desc:e+" is invalid match type"})}},searchCloudGroups:{keywordList:fs.keywordListExceptMsg,keywordListMatchType:fs.keywordListMatchType,cursor:fs.cursor,count:fs.count,groupTypeList:fs.groupTypeList},searchCloudGroupMembers:{keywordList:fs.keywordListExceptMsg,keywordListMatchType:fs.keywordListMatchType,cursor:fs.cursor,count:fs.count,groupTypeList:fs.groupTypeList,groupIDList:{type:"Array",required:!1,validator:(e,t,s)=>gs(e,t,s,{allowUndefined:!0,allowEmpty:!0})}},getUserProfile:{userIDList:{type:"Array",validator:(e,t,s)=>xe(e)?(0===e.length&&xt({api:t,paramName:s,desc:jt()}),!0):(xt({api:t,paramName:s,desc:zt()}),!1)}},updateMyProfile:{profileCustomField:{type:"Array",validator:(e,t,s)=>!!Ve(e)||!!xe(e)||(xt({api:t,paramName:s,desc:zt()}),!1)}},setSelfStatus:{customStatus:{type:"String",validator:(e,t,s)=>!!Fe(e)||(xt({api:t,paramName:s,desc:Vt()}),!1)}},getUserStatus:{userIDList:{type:"Array",validator:(e,t,s)=>xe(e)?0!==e.length||(xt({api:t,paramName:s,desc:jt()}),!1):(xt({api:t,paramName:s,desc:zt()}),!1)}},subscribeUserStatus:{userIDList:{type:"Array",validator:(e,t,s)=>xe(e)?0!==e.length||(xt({api:t,paramName:s,desc:jt()}),!1):(xt({api:t,paramName:s,desc:zt()}),!1)}},unsubscribeUserStatus:{userIDList:{type:"Array",validator:(e,t,s)=>!e||!!xe(e)||(xt({api:t,paramName:s,desc:zt()}),!1)}},addFriend:{to:us,source:{type:"String",required:!0,validator:(e,t,s)=>!(!e||(e.startsWith("AddSource_Type_")?8<e.replace("AddSource_Type_","").length&&(xt({api:t,paramName:s,desc:Zt("keyword",8)}),1):(xt({api:t,paramName:s,desc:Ms("SourcePrefixLog")}),1)))},remark:{type:"String",required:!1,validator:(e,t,s)=>!(Fe(e)&&96<e.length&&(xt({api:t,paramName:s,desc:Zt(s,96)}),1))}},deleteFriend:{userIDList:ds},checkFriend:{userIDList:ds},getFriendProfile:{userIDList:ds},updateFriend:{userID:us,remark:{type:"String",required:!1,validator:(e,t,s)=>!(Fe(e)&&96<e.length&&(xt({api:t,paramName:s,desc:Zt(s,96)}),1))},friendCustomField:{type:"Array",required:!1,validator:(e,s,i)=>{if(e){if(!xe(e))return xt({api:s,paramName:i,desc:zt()}),!1;let t=!0;return e.forEach(e=>Fe(e.key)&&-1!==e.key.indexOf("Tag_SNS_Custom")?Fe(e.value)?8<e.key.replace("Tag_SNS_Custom_","").length?(xt({api:s,paramName:i,desc:Zt("keyword",8)}),t=!1):void 0:(xt({api:s,paramName:i,desc:ts("value")}),t=!1):(xt({api:s,paramName:i,desc:Ms("FriendCustomFieldPrefixLog")}),t=!1)),t}return!0}}},acceptFriendApplication:{userID:us},refuseFriendApplication:{userID:us},deleteFriendApplication:{userID:us},createFriendGroup:{name:us},deleteFriendGroup:{name:us},addToFriendGroup:{name:us,userIDList:ds},removeFromFriendGroup:{name:us,userIDList:ds},renameFriendGroup:{oldName:us,newName:us},sendMessageReadReceipt:[{name:"messageList",type:"Array",validator:(e,t,s)=>xe(e)?0!==e.length||(xt({api:t,paramName:s,desc:jt()}),!1):(xt({api:t,paramName:s,desc:zt()}),!1)}],getMessageReadReceiptList:[{name:"messageList",type:"Array",validator:(e,t,s)=>xe(e)?0!==e.length||(xt({api:t,paramName:s,desc:jt()}),!1):(xt({api:t,paramName:s,desc:zt()}),!1)}],createTopicInCommunity:{groupID:us,topicName:us},deleteTopicFromCommunity:{groupID:us,topicIDList:{type:"Array",validator:(e,t,s)=>!e||!!xe(e)||(xt({api:t,paramName:s,desc:zt()}),!1)}},updateTopicProfile:{groupID:us,topicID:us},getTopicList:{groupID:us,topicIDList:{type:"Array",validator:(e,t,s)=>!e||!!xe(e)||(xt({api:t,paramName:s,desc:zt()}),!1)}},followUser:[{name:"userIDList",...ds}],unfollowUser:[{name:"userIDList",...ds}],getMyFollowingList:[{name:"startIndex",...us,required:!1}],getMyFollowersList:[{name:"startIndex",...us,required:!1}],getMutualFollowersList:[{name:"startIndex",...us,required:!1}],getUserFollowInfo:[{name:"userIDList",...ds,required:!1}],checkFollowType:[{name:"userIDList",...ds}],addSignalingListener:[{name:"eventName",type:"String",validator:(e,t,s)=>"string"==typeof e&&0!==e.length||(xt({api:t,paramName:s,desc:Bt(s)}),!1)},{name:"handler",type:"Function",validator:(e,t,s)=>"function"!=typeof e?(xt({api:t,paramName:s,desc:Yt()}),!1):(""===e.name&&xt({api:t,paramName:s,desc:rs()}),!0)}],removeSignalingListener:[{name:"eventName",type:"String",validator:(e,t,s)=>"string"==typeof e&&0!==e.length||(xt({api:t,paramName:s,desc:Bt(s)}),!1)},{name:"handler",type:"Function",validator:(e,t,s)=>"function"!=typeof e?(xt({api:t,paramName:s,desc:Yt()}),!1):(""===e.name&&xt({api:t,paramName:s,desc:rs()}),!0)}],invite:{userID:us},inviteSync:[{..._s,validator:(e,t,s)=>qe(e)?!!Fe(e.userID)||(xt({api:t,paramName:"options.userID",desc:Vt()}),!1):(xt({api:t,paramName:"options",desc:ss()}),!1)},{name:"successCb",type:"Function",required:!1,validator:(e,t,s)=>(Ve(e)&&xt({api:t,paramName:s,desc:Yt()}),!0)},{name:"errorCb",type:"Function",required:!1,validator:(e,t,s)=>(Ve(e)&&xt({api:t,paramName:s,desc:Yt()}),!0)}],inviteInGroup:{groupID:us,inviteeList:ds},inviteInGroupSync:[{..._s,validator:(e,t,s)=>qe(e)?Fe(e.groupID)?!!xe(e.inviteeList)||(xt({api:t,paramName:"options.inviteeList",desc:zt()}),!1):(xt({api:t,paramName:"options.groupID",desc:Vt()}),!1):(xt({api:t,paramName:"options",desc:ss()}),!1)},{name:"successCb",type:"Function",required:!1,validator:(e,t,s)=>(Ve(e)&&xt({api:t,paramName:s,desc:Yt()}),!0)},{name:"errorCb",type:"Function",required:!1,validator:(e,t,s)=>(Ve(e)&&xt({api:t,paramName:s,desc:Yt()}),!0)}],accept:{inviteID:us},reject:{inviteID:us},getSignalingInfo:[{name:"message",..._s,validator:(e,t,s)=>!Ue(e)||(xt({api:t,paramName:s,desc:os()}),!1)}],modifyInvitation:{inviteID:us,data:us}},Cs={login:1,logout:1,getLoginUser:1,getServerTime:1,on:1,once:1,off:1,setLogLevel:1,registerPlugin:1,destroy:1,isReady: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,convertVoiceToText:1,modifyMessage:1,sendMessageReadReceipt:1,getGroupMessageReadMemberList:1,getMessageReadReceiptList:1,setMessageExtensions:1,getMessageExtensions:1,deleteMessageExtensions:1,addMessageReaction:1,removeMessageReaction:1,getMessageReactions:1,getAllUserListOfMessageReaction:1,getMessageList:1,findMessage:1,getMessageListHopping:1,setMessageRead:1,setAllMessageRead:1,getConversationList:1,getConversationProfile:1,deleteConversation:1,setConversationDraft:1,pinConversation:1,getTotalUnreadMessageCount:1,setConversationCustomData:1,markConversation:1,createConversationGroup:1,getConversationGroupList:1,deleteConversationGroup:1,renameConversationGroup:1,addConversationsToGroup:1,deleteConversationsFromGroup:1,clearHistoryMessage:1,setMessageRemindType:1,setAllReceiveMessageOpt:1,getAllReceiveMessageOpt:1,getGroupList:1,getGroupProfile:1,createGroup:1,joinGroup:1,updateGroupProfile:1,quitGroup:1,dismissGroup:1,changeGroupOwner:1,searchGroupByID: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,searchCloudMessages:1,searchCloudUsers:1,searchCloudGroups:1,searchCloudGroupMembers: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,followUser:1,unfollowUser:1,getMyFollowingList:1,getMyFollowersList:1,getMutualFollowersList:1,getUserFollowInfo:1,checkFollowType:1,callExperimentalAPI:1,addSignalingListener:1,removeSignalingListener:1,invite:1,inviteSync:1,inviteInGroup:1,inviteInGroupSync:1,cancel:1,accept:1,reject:1,getSignalingInfo:1,modifyInvitation:1},Ts=1,ys=2,vs=3,Es=4,Ss=6,Ds=7,Rs=8,Ls=10,As=11,Os=12,Ns=13,Ps=14,Us=15,Gs=17,ks=18,ws=19,bs=20,Fs=21,$s=23,qs=24,xs=25,Vs=26,Bs=27,Ks=28,Hs=29,Ws=30,Ys=31,zs=32,js=33,Js=34,Xs=35,Zs=36,Qs=37,ei=38,ti=function(e){return{code:0,data:e||{}}};class si extends Error{constructor(e){super();var{code:e,message:t,data:s}=e;this.code=e,t?this.message=t:this._getErrMsg&&(this.message=this._getErrMsg(this.code)),this.data=s||{}}}let ii={NO_SDKAPPID:2e3,NO_ACCOUNT_TYPE:2001,NO_IDENTIFIER:2002,NO_USERSIG:2003,NO_TINYID:2022,NO_A2KEY:2023,USER_NOT_LOGGED_IN:2024,REPEAT_LOGIN:2025,COS_UNDETECTED:2040,COS_GET_SIG_FAIL:2041,MSG_SEND_FAIL:2100,MSG_SEND_FAIL_NOT_IN_AV:2101,MSG_INSTANCE_REQUIRED:2105,MSG_INVALID_CONV_TYPE:2106,MSG_F_IS_EMPTY:2108,MSG_ONPROGRESS_ERR:2109,MSG_REVOKE_FAIL:2110,MSG_DELETE_FAIL:2111,MSG_UNREAD_ALL_FAIL:2112,READ_RECEIPT_MSG_LIST_EMPTY:2114,MSG_SEND_GRP_WITH_TOPIC_FAIL:2115,CANNOT_DELETE_GRP_SYSTEM_NOTICE:2116,TRANSLATE_TEXT_FAIL:2117,VOICE_TO_TEXT_FAIL:2118,UNSUPPORTED_VOICE_FORMAT:2119,MSG_I_SELECT_F_FIRST:2251,MSG_I_TYPES_LIMIT:2252,MSG_I_SIZE_LIMIT:2253,MSG_A_UPLOAD_FAIL:2300,MSG_A_SIZE_LIMIT:2301,MSG_V_UPLOAD_FAIL:2350,MSG_V_SIZE_LIMIT:2351,MSG_V_TYPES_LIMIT:2352,MSG_F_UPLOAD_FAIL:2400,MSG_F_SELECT_F_FIRST:2401,MSG_F_SIZE_LIMIT:2402,MSG_F_URL_IS_EMPTY:2403,MSG_MERGER_TYPE_INVALID:2450,MSG_MERGER_KEY_INVALID:2451,MSG_MERGER_DOWNLOAD_FAIL:2452,MSG_FORWARD_TYPE_INVALID:2453,MSG_FORWARD_INVALID_ELEMENTS:2454,MSG_MODIFY_CONFLICT:2480,MSG_MODIFY_DISABLED_IN_AV:2481,CONV_NOT_FOUND:2500,USER_OR_GRP_NOT_FOUND:2501,CONV_UN_RECORDED_TYPE:2502,INVALID_CONV_ID:2503,ILLEGAL_GRP_TYPE:2600,ILLEGAL_GRP_ID:2602,CANNOT_FIND_GRP:2603,CANNOT_CHANGE_OWNER_IN_AV:2620,CANNOT_CHANGE_OWNER_TO_SELF:2621,MEMBER_NOT_IN_GRP:2623,JOIN_GRP_FAIL:2660,CANNOT_ADD_MEMBER_IN_AV:2661,CANNOT_JOIN_NON_AV_WITHOUT_LOGIN:2662,NOT_OWNER:2681,INVALID_MEMBER_ROLE:2683,CANNOT_SET_SELF_MEMBER_ROLE:2684,CANNOT_MUTE_SELF:2685,BAN_DURATION_INVALID:2686,OPERATION_NOT_SUPPORTED_IN_AV:2687,NOT_MY_FRIEND:2700,ALREADY_MY_FRIEND:2701,FRIEND_GRP_EXISTED:2710,FRIEND_GRP_N