module.exports = (function () {
    var __MODS__ = {};
    var __DEFINE__ = function (modId, func, req) {
        var m = {
            exports: {},
            _tempexports: {}
        };
        __MODS__[modId] = {
            status: 0,
            func: func,
            req: req,
            m: m
        };
    };
    var __REQUIRE__ = function (modId, source) {
        if (!__MODS__[modId]) {
            return require(source);
        }
        if (!__MODS__[modId].status) {
            var m = __MODS__[modId].m;
            m._exports = m._tempexports;
            var desp = Object.getOwnPropertyDescriptor(m, 'exports');
            if (desp && desp.configurable) {
                Object.defineProperty(m, 'exports', {
                    set: function (val) {
                        if (typeof val === 'object' && val !== m._exports) {
                            m._exports.__proto__ = val.__proto__;
                            Object.keys(val).forEach(function (k) {
                                m._exports[k] = val[k];
                            });
                        }
                        m._tempexports = val;
                    },
                    get: function () {
                        return m._tempexports;
                    }
                });
            }
            __MODS__[modId].status = 1;
            __MODS__[modId].func(__MODS__[modId].req, m, m.exports);
        }
        return __MODS__[modId].m.exports;
    };
    __DEFINE__(
        1775630722878,
        function (require, module, exports) {
            !(function (e, t) {
                if ('object' == typeof exports && 'undefined' != typeof module) {
                    module.exports = t();
                } else {
                    if ('function' == typeof define && define.amd) {
                        define(t);
                    } else {
                        (e = e || self).TIM = t();
                    }
                }
            })(this, function () {
                var e = {
                    SDK_READY: 'sdkStateReady',
                    SDK_NOT_READY: 'sdkStateNotReady',
                    SDK_DESTROY: 'sdkDestroy',
                    MESSAGE_RECEIVED: 'onMessageReceived',
                    MESSAGE_REVOKED: 'onMessageRevoked',
                    CONVERSATION_LIST_UPDATED: 'onConversationListUpdated',
                    GROUP_LIST_UPDATED: 'onGroupListUpdated',
                    GROUP_SYSTEM_NOTICE_RECEIVED: 'receiveGroupSystemNotice',
                    PROFILE_UPDATED: 'onProfileUpdated',
                    BLACKLIST_UPDATED: 'blacklistUpdated',
                    KICKED_OUT: 'kickedOut',
                    ERROR: 'error',
                    NET_STATE_CHANGE: 'netStateChange'
                };
                var 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_GRP_TIP: 'TIMGroupTipElem',
                    MSG_GRP_SYS_NOTICE: 'TIMGroupSystemNoticeElem',
                    MSG_CUSTOM: 'TIMCustomElem',
                    MSG_PRIORITY_HIGH: 'High',
                    MSG_PRIORITY_NORMAL: 'Normal',
                    MSG_PRIORITY_LOW: 'Low',
                    MSG_PRIORITY_LOWEST: 'Lowest',
                    CONV_C2C: 'C2C',
                    CONV_GROUP: 'GROUP',
                    CONV_SYSTEM: '@TIM#SYSTEM',
                    GRP_PRIVATE: 'Private',
                    GRP_PUBLIC: 'Public',
                    GRP_CHATROOM: 'ChatRoom',
                    GRP_AVCHATROOM: 'AVChatRoom',
                    GRP_MBR_ROLE_OWNER: 'Owner',
                    GRP_MBR_ROLE_ADMIN: 'Admin',
                    GRP_MBR_ROLE_MEMBER: 'Member',
                    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,
                    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',
                    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',
                    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_INTRODUCTION: 'introduction',
                    GRP_PROFILE_NOTIFICATION: 'notification',
                    GRP_PROFILE_MUTE_ALL_MBRS: 'muteAllMembers',
                    NET_STATE_CONNECTED: 'connected',
                    NET_STATE_CONNECTING: 'connecting',
                    NET_STATE_DISCONNECTED: 'disconnected'
                };
                function n(e) {
                    return (n =
                        'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator
                            ? function (e) {
                                  return typeof e;
                              }
                            : function (e) {
                                  return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e;
                              })(e);
                }
                function r(e, t) {
                    if (!(e instanceof t)) {
                        throw new TypeError('Cannot call a class as a function');
                    }
                }
                function o(e, t) {
                    for (var n = 0; n < t.length; n++) {
                        var r = t[n];
                        r.enumerable = r.enumerable || false;
                        r.configurable = true;
                        if ('value' in r) {
                            r.writable = true;
                        }
                        Object.defineProperty(e, r.key, r);
                    }
                }
                function i(e, t, n) {
                    if (t) {
                        o(e.prototype, t);
                    }
                    if (n) {
                        o(e, n);
                    }
                    return e;
                }
                function s(e, t, n) {
                    t in e
                        ? Object.defineProperty(e, t, {
                              value: n,
                              enumerable: true,
                              configurable: true,
                              writable: true
                          })
                        : (e[t] = n);
                    return e;
                }
                function a(e, t) {
                    var n = Object.keys(e);
                    if (Object.getOwnPropertySymbols) {
                        var r = Object.getOwnPropertySymbols(e);
                        if (t) {
                            r = r.filter(function (t) {
                                return Object.getOwnPropertyDescriptor(e, t).enumerable;
                            });
                        }
                        n.push.apply(n, r);
                    }
                    return n;
                }
                function u(e) {
                    for (var t = 1; t < arguments.length; t++) {
                        var n = null != arguments[t] ? arguments[t] : {};
                        t % 2
                            ? a(Object(n), true).forEach(function (t) {
                                  s(e, t, n[t]);
                              })
                            : Object.getOwnPropertyDescriptors
                            ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n))
                            : a(Object(n)).forEach(function (t) {
                                  Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
                              });
                    }
                    return e;
                }
                function l(e, t) {
                    if ('function' != typeof t && null !== t) {
                        throw new TypeError('Super expression must either be null or a function');
                    }
                    e.prototype = Object.create(t && t.prototype, {
                        constructor: {
                            value: e,
                            writable: true,
                            configurable: true
                        }
                    });
                    if (t) {
                        p(e, t);
                    }
                }
                function c(e) {
                    return (c = Object.setPrototypeOf
                        ? Object.getPrototypeOf
                        : function (e) {
                              return e.__proto__ || Object.getPrototypeOf(e);
                          })(e);
                }
                function p(e, t) {
                    return (p =
                        Object.setPrototypeOf ||
                        function (e, t) {
                            e.__proto__ = t;
                            return e;
                        })(e, t);
                }
                function h() {
                    if ('undefined' == typeof Reflect || !Reflect.construct) {
                        return false;
                    }
                    if (Reflect.construct.sham) {
                        return false;
                    }
                    if ('function' == typeof Proxy) {
                        return true;
                    }
                    try {
                        Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
                        return true;
                    } catch (e) {
                        console.log('CatchClause', e);
                        console.log('CatchClause', e);
                        return false;
                    }
                }
                function f(e, t, n) {
                    return (f = h()
                        ? Reflect.construct
                        : function (e, t, n) {
                              var r = [null];
                              r.push.apply(r, t);
                              var o = new (Function.bind.apply(e, r))();
                              if (n) {
                                  p(o, n.prototype);
                              }
                              return o;
                          }).apply(null, arguments);
                }
                function d(e) {
                    var t = 'function' == typeof Map ? new Map() : void 0;
                    return (d = function (e) {
                        if (null === e || ((n = e), -1 === Function.toString.call(n).indexOf('[native code]'))) {
                            return e;
                        }
                        var n;
                        if ('function' != typeof e) {
                            throw new TypeError('Super expression must either be null or a function');
                        }
                        if (void 0 !== t) {
                            if (t.has(e)) {
                                return t.get(e);
                            }
                            t.set(e, r);
                        }
                        function r() {
                            return f(e, arguments, c(this).constructor);
                        }
                        r.prototype = Object.create(e.prototype, {
                            constructor: {
                                value: r,
                                enumerable: false,
                                writable: true,
                                configurable: true
                            }
                        });
                        return p(r, e);
                    })(e);
                }
                function g(e) {
                    if (void 0 === e) {
                        throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
                    }
                    return e;
                }
                function m(e, t) {
                    return !t || ('object' != typeof t && 'function' != typeof t) ? g(e) : t;
                }
                function y(e) {
                    return function () {
                        var t;
                        var n = c(e);
                        if (h()) {
                            var r = c(this).constructor;
                            t = Reflect.construct(n, arguments, r);
                        } else {
                            t = n.apply(this, arguments);
                        }
                        return m(this, t);
                    };
                }
                function v(e, t) {
                    return (
                        (function (e) {
                            if (Array.isArray(e)) {
                                return e;
                            }
                        })(e) ||
                        (function (e, t) {
                            if ('undefined' == typeof Symbol || !(Symbol.iterator in Object(e))) {
                                return;
                            }
                            var n = [];
                            var r = true;
                            var o = false;
                            var i = void 0;
                            try {
                                for (var s, a = e[Symbol.iterator](); !(r = (s = a.next()).done) && (n.push(s.value), !t || n.length !== t); r = true) {}
                            } catch (u) {
                                console.log('CatchClause', u);
                                console.log('CatchClause', u);
                                o = true;
                                i = u;
                            } finally {
                                try {
                                    r || null == a.return || a.return();
                                } finally {
                                    if (o) {
                                        throw i;
                                    }
                                }
                            }
                            return n;
                        })(e, t) ||
                        C(e, t) ||
                        (function () {
                            throw new TypeError(
                                'Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'
                            );
                        })()
                    );
                }
                function _(e) {
                    return (
                        (function (e) {
                            if (Array.isArray(e)) {
                                return M(e);
                            }
                        })(e) ||
                        (function (e) {
                            if ('undefined' != typeof Symbol && Symbol.iterator in Object(e)) {
                                return Array.from(e);
                            }
                        })(e) ||
                        C(e) ||
                        (function () {
                            throw new TypeError(
                                'Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'
                            );
                        })()
                    );
                }
                function C(e, t) {
                    if (e) {
                        if ('string' == typeof e) {
                            return M(e, t);
                        }
                        var n = Object.prototype.toString.call(e).slice(8, -1);
                        if ('Object' === n && e.constructor) {
                            n = e.constructor.name;
                        }
                        return 'Map' === n || 'Set' === n ? Array.from(n) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? M(e, t) : void 0;
                    }
                }
                function M(e, t) {
                    if (null == t || t > e.length) {
                        t = e.length;
                    }
                    for (var n = 0, r = new Array(t); n < t; n++) {
                        r[n] = e[n];
                    }
                    return r;
                }
                function I(e) {
                    if ('undefined' == typeof Symbol || null == e[Symbol.iterator]) {
                        if (Array.isArray(e) || (e = C(e))) {
                            var t = 0;
                            var n = function () {};
                            return {
                                s: n,
                                n: function () {
                                    return t >= e.length
                                        ? {
                                              done: true
                                          }
                                        : {
                                              done: false,
                                              value: e[t++]
                                          };
                                },
                                e: function (e) {
                                    throw e;
                                },
                                f: n
                            };
                        }
                        throw new TypeError(
                            'Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'
                        );
                    }
                    var r;
                    var o;
                    var i = true;
                    var s = false;
                    return {
                        s: function () {
                            r = e[Symbol.iterator]();
                        },
                        n: function () {
                            var e = r.next();
                            i = e.done;
                            return e;
                        },
                        e: function (e) {
                            s = true;
                            o = e;
                        },
                        f: function () {
                            try {
                                i || null == r.return || r.return();
                            } finally {
                                if (s) {
                                    throw o;
                                }
                            }
                        }
                    };
                }
                var S = (function () {
                    function e() {
                        r(this, e);
                        this.cache = [];
                        this.options = null;
                    }
                    i(e, [
                        {
                            key: 'use',
                            value: function (e) {
                                if ('function' != typeof e) {
                                    throw 'middleware must be a function';
                                }
                                this.cache.push(e);
                                return this;
                            }
                        },
                        {
                            key: 'next',
                            value: function (e) {
                                if (this.middlewares && this.middlewares.length > 0) {
                                    return this.middlewares.shift().call(this, this.options, this.next.bind(this));
                                }
                            }
                        },
                        {
                            key: 'run',
                            value: function (e) {
                                this.middlewares = this.cache.map(function (e) {
                                    return e;
                                });
                                this.options = e;
                                return this.next();
                            }
                        }
                    ]);
                    return e;
                })();
                var D =
                    'undefined' != typeof globalThis
                        ? globalThis
                        : 'undefined' != typeof window
                        ? window
                        : 'undefined' != typeof global
                        ? global
                        : 'undefined' != typeof self
                        ? self
                        : {};
                function T(e, t) {
                    e(
                        (t = {
                            exports: {}
                        }),
                        t.exports
                    );
                    return t.exports;
                }
                var E;
                var k;
                var A;
                var w = T(function (e, t) {
                    var n;
                    var r;
                    var o;
                    var i;
                    var s;
                    var a;
                    var u;
                    var l;
                    var c;
                    var p;
                    var h;
                    var f;
                    var d;
                    var g;
                    var m;
                    var y;
                    var v;
                    var _;
                    e.exports =
                        ((n = 'function' == typeof Promise),
                        (r = 'object' == typeof self ? self : D),
                        (o = 'undefined' != typeof Symbol),
                        (i = 'undefined' != typeof Map),
                        (s = 'undefined' != typeof Set),
                        (a = 'undefined' != typeof WeakMap),
                        (u = 'undefined' != typeof WeakSet),
                        (l = 'undefined' != typeof DataView),
                        (c = o && void 0 !== Symbol.iterator),
                        (p = o && void 0 !== Symbol.toStringTag),
                        (h = s && 'function' == typeof Set.prototype.entries),
                        (f = i && 'function' == typeof Map.prototype.entries),
                        (d = h && Object.getPrototypeOf(new Set().entries())),
                        (g = f && Object.getPrototypeOf(new Map().entries())),
                        (m = c && 'function' == typeof Array.prototype[Symbol.iterator]),
                        (y = m && Object.getPrototypeOf([][Symbol.iterator]())),
                        (v = c && 'function' == typeof String.prototype[Symbol.iterator]),
                        (_ = v && Object.getPrototypeOf(''[Symbol.iterator]())),
                        function (e) {
                            var t = typeof e;
                            if ('object' !== t) {
                                return t;
                            }
                            if (null === e) {
                                return 'null';
                            }
                            if (e === r) {
                                return 'global';
                            }
                            if (Array.isArray(e) && (false === p || !(Symbol.toStringTag in e))) {
                                return 'Array';
                            }
                            if ('object' == typeof window && null !== window) {
                                if ('object' == typeof window.location && e === window.location) {
                                    return 'Location';
                                }
                                if ('object' == typeof window.document && e === window.document) {
                                    return 'Document';
                                }
                                if ('object' == typeof window.navigator) {
                                    if ('object' == typeof window.navigator.mimeTypes && e === window.navigator.mimeTypes) {
                                        return 'MimeTypeArray';
                                    }
                                    if ('object' == typeof window.navigator.plugins && e === window.navigator.plugins) {
                                        return 'PluginArray';
                                    }
                                }
                                if (('function' == typeof window.HTMLElement || 'object' == typeof window.HTMLElement) && e instanceof window.HTMLElement) {
                                    if ('BLOCKQUOTE' === e.tagName) {
                                        return 'HTMLQuoteElement';
                                    }
                                    if ('TD' === e.tagName) {
                                        return 'HTMLTableDataCellElement';
                                    }
                                    if ('TH' === e.tagName) {
                                        return 'HTMLTableHeaderCellElement';
                                    }
                                }
                            }
                            var o = p && e[Symbol.toStringTag];
                            if ('string' == typeof o) {
                                return o;
                            }
                            var c = Object.getPrototypeOf(e);
                            return c === RegExp.prototype
                                ? 'RegExp'
                                : c === Date.prototype
                                ? 'Date'
                                : n && c === Promise.prototype
                                ? 'Promise'
                                : s && c === Set.prototype
                                ? 'Set'
                                : i && c === Map.prototype
                                ? 'Map'
                                : u && c === WeakSet.prototype
                                ? 'WeakSet'
                                : a && c === WeakMap.prototype
                                ? 'WeakMap'
                                : l && c === DataView.prototype
                                ? 'DataView'
                                : i && c === g
                                ? 'Map Iterator'
                                : s && c === d
                                ? 'Set Iterator'
                                : m && c === y
                                ? 'Array Iterator'
                                : v && c === _
                                ? 'String Iterator'
                                : null === c
                                ? 'Object'
                                : Object.prototype.toString.call(e).slice(8, -1);
                        });
                });
                var R = 'undefined' != typeof window;
                var O = 'undefined' != typeof wx && 'function' == typeof uni.getSystemInfoSync;
                var L = (R && window.navigator && window.navigator.userAgent) || '';
                var N = /AppleWebKit\/([\d.]+)/i.exec(L);
                var b = (N && parseFloat(N.pop()), /iPad/i.test(L));
                var P = (/iPhone/i.test(L), /iPod/i.test(L), (E = L.match(/OS (\d+)_/i)) && E[1] && E[1], /Android/i.test(L));
                var G = (function () {
                    var e = L.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);
                    if (!e) {
                        return null;
                    }
                    var t = e[1] && parseFloat(e[1]);
                    var n = e[2] && parseFloat(e[2]);
                    return t && n ? parseFloat(e[1] + '.' + e[2]) : t || null;
                })();
                var U = (P && /webkit/i.test(L), /Firefox/i.test(L), /Edge/i.test(L));
                var q = !U && /Chrome/i.test(L);
                var x =
                    ((function () {
                        var e = L.match(/Chrome\/(\d+)/);
                        if (e && e[1]) {
                            parseFloat(e[1]);
                        }
                    })(),
                    /MSIE/.test(L));
                var F =
                    (/MSIE\s8\.0/.test(L),
                    (function () {
                        var e = /MSIE\s(\d+)\.\d/.exec(L);
                        var t = e && parseFloat(e[1]);
                        if (!t && /Trident\/7.0/i.test(L) && /rv:11.0/.test(L)) {
                            t = 11;
                        }
                        return t;
                    })());
                var H = (/Safari/i.test(L), /TBS\/\d+/i.test(L));
                var B =
                    ((function () {
                        var e = L.match(/TBS\/(\d+)/i);
                        if (e && e[1]) {
                            e[1];
                        }
                    })(),
                    !H && /MQQBrowser\/\d+/i.test(L),
                    !H && / QQBrowser\/\d+/i.test(L),
                    /(micromessenger|webbrowser)/i.test(L));
                var V =
                    (/Windows/i.test(L),
                    /MAC OS X/i.test(L),
                    /MicroMessenger/i.test(L),
                    'undefined' != typeof global ? global : 'undefined' != typeof self ? self : 'undefined' != typeof window ? window : {});
                k = 'undefined' != typeof console ? console : void 0 !== V && V.console ? V.console : 'undefined' != typeof window && window.console ? window.console : {};
                for (
                    var K = function () {},
                        j = [
                            'assert',
                            'clear',
                            'count',
                            'debug',
                            'dir',
                            'dirxml',
                            'error',
                            'exception',
                            'group',
                            'groupCollapsed',
                            'groupEnd',
                            'info',
                            'log',
                            'markTimeline',
                            'profile',
                            'profileEnd',
                            'table',
                            'time',
                            'timeEnd',
                            'timeStamp',
                            'trace',
                            'warn'
                        ],
                        $ = j.length;
                    $--;

                ) {
                    A = j[$];
                    console[A] || (k[A] = K);
                }
                k.methods = j;
                var Y = k;
                var z = 0;
                var W = new Map();
                function X() {
                    var e = new Date();
                    return (
                        'TIM ' +
                        e.toLocaleTimeString('en-US', {
                            hour12: false
                        }) +
                        '.' +
                        (function (e) {
                            var t;
                            switch (e.toString().length) {
                                case 1:
                                    t = '00' + e;
                                    break;
                                case 2:
                                    t = '0' + e;
                                    break;
                                default:
                                    t = e;
                            }
                            return t;
                        })(e.getMilliseconds()) +
                        ':'
                    );
                }
                var J = {
                    _data: [],
                    _length: 0,
                    _visible: false,
                    arguments2String: function (e) {
                        var t;
                        if (1 === e.length) {
                            t = X() + e[0];
                        } else {
                            t = X();
                            for (var n = 0, r = e.length; n < r; n++) {
                                ie(e[n]) ? (ae(e[n]) ? (t += fe(e[n])) : (t += JSON.stringify(e[n]))) : (t += e[n]);
                                t += ' ';
                            }
                        }
                        return t;
                    },
                    debug: function () {
                        if (z <= -1) {
                            var e = this.arguments2String(arguments);
                            J.record(e, 'debug');
                            Y.debug(e);
                        }
                    },
                    log: function () {
                        if (z <= 0) {
                            var e = this.arguments2String(arguments);
                            J.record(e, 'log');
                            Y.log(e);
                        }
                    },
                    info: function () {
                        if (z <= 1) {
                            var e = this.arguments2String(arguments);
                            J.record(e, 'info');
                            Y.info(e);
                        }
                    },
                    warn: function () {
                        if (z <= 2) {
                            var e = this.arguments2String(arguments);
                            J.record(e, 'warn');
                            Y.warn(e);
                        }
                    },
                    error: function () {
                        if (z <= 3) {
                            var e = this.arguments2String(arguments);
                            J.record(e, 'error');
                            Y.error(e);
                        }
                    },
                    time: function (e) {
                        W.set(e, pe.now());
                    },
                    timeEnd: function (e) {
                        if (W.has(e)) {
                            var t = pe.now() - W.get(e);
                            W.delete(e);
                            return t;
                        }
                        Y.warn('未找到对应label: '.concat(e, ', 请在调用 logger.timeEnd 前，调用 logger.time'));
                        return 0;
                    },
                    setLevel: function (e) {
                        if (e < 4) {
                            Y.log(X() + 'set level from ' + z + ' to ' + e);
                        }
                        z = e;
                    },
                    record: function (e, t) {
                        if (1100 === J._length) {
                            J._data.splice(0, 100);
                            J._length = 1000;
                        }
                        J._length++;
                        J._data.push(''.concat(e, ' [').concat(t, '] \n'));
                    },
                    getLog: function () {
                        return J._data;
                    }
                };
                var Q = function (e) {
                    return 'file' === ue(e);
                };
                var Z = function (e) {
                    return null !== e && (('number' == typeof e && !isNaN(e - 0)) || ('object' === n(e) && e.constructor === Number));
                };
                var ee = function (e) {
                    return 'string' == typeof e;
                };
                var te = function (e) {
                    return null !== e && 'object' === n(e);
                };
                var ne = function (e) {
                    if ('object' !== n(e) || null === e) {
                        return false;
                    }
                    var t = Object.getPrototypeOf(e);
                    if (null === t) {
                        return true;
                    }
                    for (var r = t; null !== Object.getPrototypeOf(r); ) {
                        r = Object.getPrototypeOf(r);
                    }
                    return t === r;
                };
                var re = function (e) {
                    return 'function' == typeof Array.isArray ? Array.isArray(e) : 'array' === ue(e);
                };
                var oe = function (e) {
                    return void 0 === e;
                };
                var ie = function (e) {
                    return re(e) || te(e);
                };
                var se = function (e) {
                    return 'function' == typeof e;
                };
                var ae = function (e) {
                    return e instanceof Error;
                };
                var ue = function (e) {
                    return Object.prototype.toString
                        .call(e)
                        .match(/^\[object (.*)\]$/)[1]
                        .toLowerCase();
                };
                var le = function (e) {
                    if ('string' != typeof e) {
                        return false;
                    }
                    var t = e[0];
                    return !/[^a-zA-Z0-9]/.test(t);
                };
                var ce = 0;
                Date.now ||
                    (Date.now = function () {
                        return new Date().getTime();
                    });
                var pe = {
                    now: function () {
                        if (0 === ce) {
                            ce = Date.now() - 1;
                        }
                        var e = Date.now() - ce;
                        return e > 4294967295 ? ((ce += 4294967295), Date.now() - ce) : e;
                    },
                    utc: function () {
                        return Math.round(Date.now() / 1000);
                    }
                };
                var he = function e(t, n, r, o) {
                    if (!ie(t) || !ie(n)) {
                        return 0;
                    }
                    for (var i, s = 0, a = Object.keys(n), u = 0, l = a.length; u < l; u++) {
                        i = a[u];
                        if (!(oe(n[i]) || (r && r.includes(i)))) {
                            if (ie(t[i]) && ie(n[i])) {
                                s += e(t[i], n[i], r, o);
                            } else {
                                if (o && o.includes(n[i])) {
                                    continue;
                                }
                                if (t[i] !== n[i]) {
                                    t[i] = n[i];
                                    s += 1;
                                }
                            }
                        }
                    }
                    return s;
                };
                var fe = function (e) {
                    return JSON.stringify(e, ['message', 'code']);
                };
                var de = function () {
                    var e = new Date();
                    var t = e.toISOString();
                    var n = e.getTimezoneOffset() / 60;
                    var r = '';
                    r = n < 0 ? (n > -10 ? '+0' + Math.abs(100 * n) : '+' + Math.abs(100 * n)) : n >= 10 ? '-' + 100 * n : '-0' + 100 * n;
                    return t.replace('Z', r);
                };
                var ge = function (e) {
                    if (0 === e.length) {
                        return 0;
                    }
                    for (var t = 0, n = 0, r = 'undefined' != typeof document && void 0 !== document.characterSet ? document.characterSet : 'UTF-8'; void 0 !== e[t]; ) {
                        n += e[t++].charCodeAt[t] <= 255 ? 1 : false === r ? 3 : 2;
                    }
                    return n;
                };
                var me = function (e) {
                    var t = e || 99999999;
                    return Math.round(Math.random() * t);
                };
                var ye = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
                var ve = ye.length;
                var _e = function (e, t) {
                    for (var n in e) {
                        if (e[n] === t) {
                            return true;
                        }
                    }
                    return false;
                };
                var Ce = {};
                var Me = function () {
                    if (O) {
                        return 'https:';
                    }
                    var e = window.location.protocol;
                    if (['http:', 'https:'].indexOf(e) < 0) {
                        e = 'http:';
                    }
                    return e;
                };
                var Ie = function (e) {
                    return -1 === e.indexOf('http://') || -1 === e.indexOf('https://') ? 'https://' + e : e.replace(/https|http/, 'https');
                };
                function Se(e, t) {
                    re(e) && re(t)
                        ? t.forEach(function (t) {
                              var n = t.key;
                              var r = t.value;
                              var o = e.find(function (e) {
                                  return e.key === n;
                              });
                              o
                                  ? (o.value = r)
                                  : e.push({
                                        key: n,
                                        value: r
                                    });
                          })
                        : J.warn('updateCustomField target 或 source 不是数组，忽略此次更新。');
                }
                var De = function (e) {
                    return e === t.GRP_PUBLIC;
                };
                var Te = function (e) {
                    return e === t.GRP_AVCHATROOM;
                };
                var Ee = function (e) {
                    return ee(e) && e === t.CONV_SYSTEM;
                };
                function ke(e, t) {
                    var n = {};
                    Object.keys(e).forEach(function (r) {
                        n[r] = t(e[r], r);
                    });
                    return n;
                }
                var Ae = Object.prototype.hasOwnProperty;
                function we(e) {
                    if (null == e) {
                        return true;
                    }
                    if ('boolean' == typeof e) {
                        return false;
                    }
                    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 (ne(e)) {
                        for (var t in e) {
                            if (Ae.call(e, t)) {
                                return false;
                            }
                        }
                        return true;
                    }
                    return (
                        !(
                            'map' !== ue(e) &&
                            !(function (e) {
                                return 'set' === ue(e);
                            })(e) &&
                            !Q(e)
                        ) && 0 === e.size
                    );
                }
                function Re(e, t, n) {
                    if (void 0 === t) {
                        return true;
                    }
                    var r = true;
                    if ('object' === w(t).toLowerCase())
                        Object.keys(t).forEach(function (o) {
                            var i = 1 === e.length ? e[0][o] : void 0;
                            r = !!Oe(i, t[o], n, o) && r;
                        });
                    else if ('array' === w(t).toLowerCase()) {
                        for (var o = 0; o < t.length; o++) {
                            r = !!Oe(e[o], t[o], n, t[o].name) && r;
                        }
                    }
                    if (r) {
                        return r;
                    }
                    throw new Error('Params validate failed.');
                }
                function Oe(e, t, n, r) {
                    if (void 0 === t) {
                        return true;
                    }
                    var o = true;
                    if (t.required && we(e)) {
                        Y.error('TIM ['.concat(n, '] Missing required params: "').concat(r, '".'));
                        o = false;
                    }
                    we(e) ||
                        w(e).toLowerCase() === t.type.toLowerCase() ||
                        (Y.error('TIM ['.concat(n, '] Invalid params: type check failed for "').concat(r, '".Expected ').concat(t.type, '.')), (o = false));
                    if (t.validator && !t.validator(e)) {
                        Y.error('TIM ['.concat(n, '] Invalid params: custom validator check failed for params.'));
                        o = false;
                    }
                    return o;
                }
                var Le = {
                    SUCCESS: 'JoinedSuccess',
                    WAIT_APPROVAL: 'WaitAdminApproval'
                };
                var Ne = {
                    SUCCESS: 0
                };
                var be = {
                    IS_LOGIN: 1,
                    IS_NOT_LOGIN: 0
                };
                var Pe = {
                    UNSEND: 'unSend',
                    SUCCESS: 'success',
                    FAIL: 'fail'
                };
                var Ge = {
                    NOT_START: 'notStart',
                    PENDING: 'pengding',
                    RESOLVED: 'resolved',
                    REJECTED: 'rejected'
                };
                var Ue = (function () {
                    function e(n) {
                        r(this, e);
                        this.type = t.MSG_TEXT;
                        this.content = {
                            text: n.text || ''
                        };
                    }
                    i(e, [
                        {
                            key: 'setText',
                            value: function (e) {
                                this.content.text = e;
                            }
                        },
                        {
                            key: 'sendable',
                            value: function () {
                                return 0 !== this.content.text.length;
                            }
                        }
                    ]);
                    return e;
                })();
                var qe = {
                    JSON: {
                        TYPE: {
                            C2C: {
                                NOTICE: 1,
                                COMMON: 9,
                                EVENT: 10
                            },
                            GROUP: {
                                COMMON: 3,
                                TIP: 4,
                                SYSTEM: 5,
                                TIP2: 6
                            },
                            FRIEND: {
                                NOTICE: 7
                            },
                            PROFILE: {
                                NOTICE: 8
                            }
                        },
                        SUBTYPE: {
                            C2C: {
                                COMMON: 0,
                                READED: 92,
                                KICKEDOUT: 96
                            },
                            GROUP: {
                                COMMON: 0,
                                LOVEMESSAGE: 1,
                                TIP: 2,
                                REDPACKET: 3
                            }
                        },
                        OPTIONS: {
                            GROUP: {
                                JOIN: 1,
                                QUIT: 2,
                                KICK: 3,
                                SET_ADMIN: 4,
                                CANCEL_ADMIN: 5,
                                MODIFY_GROUP_INFO: 6,
                                MODIFY_MEMBER_INFO: 7
                            }
                        }
                    },
                    PROTOBUF: {},
                    IMAGE_TYPES: {
                        ORIGIN: 1,
                        LARGE: 2,
                        SMALL: 3
                    },
                    IMAGE_FORMAT: {
                        JPG: 1,
                        JPEG: 1,
                        GIF: 2,
                        PNG: 3,
                        BMP: 4,
                        UNKNOWN: 255
                    }
                };
                var xe = 1;
                var Fe = 2;
                var He = 3;
                var Be = 4;
                var Ve = 5;
                var Ke = 7;
                var je = 8;
                var $e = 9;
                var Ye = 10;
                var ze = 15;
                var We = 255;
                var Xe = 2;
                var Je = 0;
                var Qe = 1;
                var Ze = {
                    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'
                };
                var et = {
                    UNKNOWN: 'Gender_Type_Unknown',
                    FEMALE: 'Gender_Type_Female',
                    MALE: 'Gender_Type_Male'
                };
                var tt = {
                    NONE: 'AdminForbid_Type_None',
                    SEND_OUT: 'AdminForbid_Type_SendOut'
                };
                var nt = {
                    NEED_CONFIRM: 'AllowType_Type_NeedConfirm',
                    ALLOW_ANY: 'AllowType_Type_AllowAny',
                    DENY_ANY: 'AllowType_Type_DenyAny'
                };
                var rt = (function () {
                    function e(n) {
                        r(this, e);
                        this._imageMemoryURL = '';
                        this._file = n.file;
                        O ? this.createImageDataASURLInWXMiniApp(n.file) : this.createImageDataASURLInWeb(n.file);
                        this._initImageInfoModel();
                        this.type = t.MSG_IMAGE;
                        this._percent = 0;
                        this.content = {
                            imageFormat: qe.IMAGE_FORMAT[n.imageFormat] || qe.IMAGE_FORMAT.UNKNOWN,
                            uuid: n.uuid,
                            imageInfoArray: []
                        };
                        this.initImageInfoArray(n.imageInfoArray);
                        this._defaultImage = 'http://imgcache.qq.com/open/qcloud/video/act/webim-images/default.jpg';
                        this._autoFixUrl();
                    }
                    i(e, [
                        {
                            key: '_initImageInfoModel',
                            value: function () {
                                var that = this;
                                this._ImageInfoModel = function (t) {
                                    this.instanceID = me(9999999);
                                    this.sizeType = t.type || 0;
                                    this.size = t.size || 0;
                                    this.width = t.width || 0;
                                    this.height = t.height || 0;
                                    this.imageUrl = t.url || '';
                                    this.url = t.url || that._imageMemoryURL || that._defaultImage;
                                };
                                this._ImageInfoModel.prototype = {
                                    setSizeType: function (e) {
                                        this.sizeType = e;
                                    },
                                    setImageUrl: function (e) {
                                        if (e) {
                                            this.imageUrl = e;
                                        }
                                    },
                                    getImageUrl: function () {
                                        return this.imageUrl;
                                    }
                                };
                            }
                        },
                        {
                            key: 'initImageInfoArray',
                            value: function (e) {
                                for (var t = 2, n = null, r = null; t >= 0; ) {
                                    r =
                                        void 0 === e || void 0 === e[t]
                                            ? {
                                                  type: 0,
                                                  size: 0,
                                                  width: 0,
                                                  height: 0,
                                                  url: ''
                                              }
                                            : e[t];
                                    (n = new this._ImageInfoModel(r)).setSizeType(t + 1);
                                    this.addImageInfo(n);
                                    t--;
                                }
                            }
                        },
                        {
                            key: 'updateImageInfoArray',
                            value: function (e) {
                                for (var t, n = this.content.imageInfoArray.length, r = 0; r < n; r++) {
                                    t = this.content.imageInfoArray[r];
                                    if (e.size) {
                                        t.size = e.size;
                                    }
                                    if (e.url) {
                                        t.setImageUrl(e.url);
                                    }
                                    if (e.width) {
                                        t.width = e.width;
                                    }
                                    if (e.height) {
                                        t.height = e.height;
                                    }
                                }
                            }
                        },
                        {
                            key: '_autoFixUrl',
                            value: function () {
                                for (var e = this.content.imageInfoArray.length, t = '', n = '', r = ['http', 'https'], o = null, i = 0; i < e; i++) {
                                    if (this.content.imageInfoArray[i].url && '' !== (o = this.content.imageInfoArray[i]).imageUrl) {
                                        n = o.imageUrl.slice(0, o.imageUrl.indexOf('://') + 1);
                                        t = o.imageUrl.slice(o.imageUrl.indexOf('://') + 1);
                                        if (r.indexOf(n) < 0) {
                                            n = 'https:';
                                        }
                                        this.content.imageInfoArray[i].setImageUrl([n, t].join(''));
                                    }
                                }
                            }
                        },
                        {
                            key: 'updatePercent',
                            value: function (e) {
                                this._percent = e;
                                if (this._percent > 1) {
                                    this._percent = 1;
                                }
                            }
                        },
                        {
                            key: 'updateImageFormat',
                            value: function (e) {
                                this.content.imageFormat = e;
                            }
                        },
                        {
                            key: 'createImageDataASURLInWeb',
                            value: function (e) {
                                if (void 0 !== e && e.files.length > 0) {
                                    this._imageMemoryURL = window.URL.createObjectURL(e.files[0]);
                                }
                            }
                        },
                        {
                            key: 'createImageDataASURLInWXMiniApp',
                            value: function (e) {
                                if (e && e.url) {
                                    this._imageMemoryURL = e.url;
                                }
                            }
                        },
                        {
                            key: 'replaceImageInfo',
                            value: function (e, t) {
                                this.content.imageInfoArray[t] instanceof this._ImageInfoModel || (this.content.imageInfoArray[t] = e);
                            }
                        },
                        {
                            key: 'addImageInfo',
                            value: function (e) {
                                this.content.imageInfoArray.length >= 3 || this.content.imageInfoArray.push(e);
                            }
                        },
                        {
                            key: 'sendable',
                            value: function () {
                                return 0 !== this.content.imageInfoArray.length && '' !== this.content.imageInfoArray[0].imageUrl && 0 !== this.content.imageInfoArray[0].size;
                            }
                        }
                    ]);
                    return e;
                })();
                var ot = (function () {
                    function e(n) {
                        r(this, e);
                        this.type = t.MSG_FACE;
                        this.content = n || null;
                    }
                    i(e, [
                        {
                            key: 'sendable',
                            value: function () {
                                return null !== this.content;
                            }
                        }
                    ]);
                    return e;
                })();
                var it = (function () {
                    function e(n) {
                        r(this, e);
                        this.type = t.MSG_AUDIO;
                        this._percent = 0;
                        this.content = {
                            downloadFlag: 2,
                            second: n.second,
                            size: n.size,
                            url: n.url,
                            remoteAudioUrl: '',
                            uuid: n.uuid
                        };
                    }
                    i(e, [
                        {
                            key: 'updatePercent',
                            value: function (e) {
                                this._percent = e;
                                if (this._percent > 1) {
                                    this._percent = 1;
                                }
                            }
                        },
                        {
                            key: 'updateAudioUrl',
                            value: function (e) {
                                this.content.remoteAudioUrl = e;
                            }
                        },
                        {
                            key: 'sendable',
                            value: function () {
                                return '' !== this.content.remoteAudioUrl;
                            }
                        }
                    ]);
                    return e;
                })();
                var st = {
                    from: true,
                    groupID: true,
                    groupName: true,
                    to: true
                };
                var at = (function () {
                    function e(n) {
                        r(this, e);
                        this.type = t.MSG_GRP_TIP;
                        this.content = {};
                        this._initContent(n);
                    }
                    i(e, [
                        {
                            key: '_initContent',
                            value: function (e) {
                                var that = this;
                                Object.keys(e).forEach(function (n) {
                                    switch (n) {
                                        case 'remarkInfo':
                                            break;
                                        case 'groupProfile':
                                            that.content.groupProfile = {};
                                            that._initGroupProfile(e[n]);
                                            break;
                                        case 'operatorInfo':
                                        case 'memberInfoList':
                                            break;
                                        case 'msgMemberInfo':
                                            that.content.memberList = e[n];
                                            Object.defineProperty(that.content, 'msgMemberInfo', {
                                                get: function () {
                                                    J.warn(
                                                        '!!! 禁言的群提示消息中的 payload.msgMemberInfo 属性即将废弃，请使用 payload.memberList 属性替代。 \n',
                                                        'msgMemberInfo 中的 shutupTime 属性对应更改为 memberList 中的 muteTime 属性，表示禁言时长。 \n',
                                                        '参考：群提示消息 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/Message.html#.GroupTipPayload'
                                                    );
                                                    return that.content.memberList.map(function (e) {
                                                        return {
                                                            userID: e.userID,
                                                            shutupTime: e.muteTime
                                                        };
                                                    });
                                                }
                                            });
                                            break;
                                        default:
                                            that.content[n] = e[n];
                                    }
                                });
                                this.content.userIDList || (this.content.userIDList = [this.content.operatorID]);
                            }
                        },
                        {
                            key: '_initGroupProfile',
                            value: function (e) {
                                for (var t = Object.keys(e), n = 0; n < t.length; n++) {
                                    var r = t[n];
                                    if (st[r]) {
                                        this.content.groupProfile[r] = e[r];
                                    }
                                }
                            }
                        }
                    ]);
                    return e;
                })();
                var ut = {
                    from: true,
                    groupID: true,
                    name: true,
                    to: true
                };
                var lt = (function () {
                    function e(n) {
                        r(this, e);
                        this.type = t.MSG_GRP_SYS_NOTICE;
                        this.content = {};
                        this._initContent(n);
                    }
                    i(e, [
                        {
                            key: '_initContent',
                            value: function (e) {
                                var that = this;
                                Object.keys(e).forEach(function (n) {
                                    switch (n) {
                                        case 'memberInfoList':
                                            break;
                                        case 'remarkInfo':
                                            that.content.handleMessage = e[n];
                                            break;
                                        case 'groupProfile':
                                            that.content.groupProfile = {};
                                            that._initGroupProfile(e[n]);
                                            break;
                                        default:
                                            that.content[n] = e[n];
                                    }
                                });
                            }
                        },
                        {
                            key: '_initGroupProfile',
                            value: function (e) {
                                for (var t = Object.keys(e), n = 0; n < t.length; n++) {
                                    var r = t[n];
                                    if (ut[r]) {
                                        this.content.groupProfile[r] = e[r];
                                    }
                                }
                            }
                        }
                    ]);
                    return e;
                })();
                var ct = {
                    70001: 'UserSig 已过期，请重新生成。建议 UserSig 有效期设置不小于24小时。',
                    70002: 'UserSig 长度为0，请检查传入的 UserSig 是否正确。',
                    70003: 'UserSig 非法，请使用官网提供的 API 重新生成 UserSig(https://cloud.tencent.com/document/product/269/32688)。',
                    70005: 'UserSig 非法，请使用官网提供的 API 重新生成 UserSig(https://cloud.tencent.com/document/product/269/32688)。',
                    70009: 'UserSig 验证失败，可能因为生成 UserSig 时混用了其他 SDKAppID 的私钥或密钥导致，请使用对应 SDKAppID 下的私钥或密钥重新生成 UserSig(https://cloud.tencent.com/document/product/269/32688)。',
                    70013: '请求中的 UserID 与生成 UserSig 时使用的 UserID 不匹配，您可以在即时通信 IM 控制台的【开发辅助工具(https://console.cloud.tencent.com/im-detail/tool-usersig)】页面校验 UserSig。',
                    70014: '请求中的 SDKAppID 与生成 UserSig 时使用的 SDKAppID 不匹配，您可以在即时通信 IM 控制台的【开发辅助工具(https://console.cloud.tencent.com/im-detail/tool-usersig)】页面校验 UserSig。',
                    70016: '密钥不存在，UserSig 验证失败，请在即时通信 IM 控制台获取密钥(https://cloud.tencent.com/document/product/269/32578#.E8.8E.B7.E5.8F.96.E5.AF.86.E9.92.A5)。',
                    70020: 'SDKAppID 未找到，请在即时通信 IM 控制台确认应用信息。',
                    70050: 'UserSig 验证次数过于频繁。请检查 UserSig 是否正确，并于1分钟后重新验证。您可以在即时通信 IM 控制台的【开发辅助工具(https://console.cloud.tencent.com/im-detail/tool-usersig)】页面校验 UserSig。',
                    70051: '帐号被拉入黑名单。',
                    70052: 'UserSig 已经失效，请重新生成，再次尝试。',
                    70107: '因安全原因被限制登录，请不要频繁登录。',
                    70169: '请求的用户帐号不存在。',
                    70114: '服务端内部超时，请稍后重试。',
                    70202: '服务端内部超时，请稍后重试。',
                    70206: '请求中批量数量不合法。',
                    70402: '参数非法，请检查必填字段是否填充，或者字段的填充是否满足协议要求。',
                    70403: '请求失败，需要 App 管理员权限。',
                    70398: '帐号数超限。如需创建多于100个帐号，请将应用升级为专业版，具体操作指引请参见购买指引(https://cloud.tencent.com/document/product/269/32458)。',
                    70500: '服务端内部错误，请稍后重试。',
                    71000: '删除帐号失败。仅支持删除体验版帐号，您当前应用为专业版，暂不支持帐号删除。',
                    20001: '请求包非法。',
                    20002: 'UserSig 或 A2 失效。',
                    20003: '消息发送方或接收方 UserID 无效或不存在，请检查 UserID 是否已导入即时通信 IM。',
                    20004: '网络异常，请重试。',
                    20005: '服务端内部错误，请重试。',
                    20006: '触发发送单聊消息之前回调，App 后台返回禁止下发该消息。',
                    20007: '发送单聊消息，被对方拉黑，禁止发送。消息发送状态默认展示为失败，您可以登录控制台修改该场景下的消息发送状态展示结果，具体操作请参见消息保留设置(https://cloud.tencent.com/document/product/269/38656)。',
                    20009: '消息发送双方互相不是好友，禁止发送（配置单聊消息校验好友关系才会出现）。',
                    20010: '发送单聊消息，自己不是对方的好友（单向关系），禁止发送。',
                    20011: '发送单聊消息，对方不是自己的好友（单向关系），禁止发送。',
                    20012: '发送方被禁言，该条消息被禁止发送。',
                    20016: '消息撤回超过了时间限制（默认2分钟）。',
                    20018: '删除漫游内部错误。',
                    90001: 'JSON 格式解析失败，请检查请求包是否符合 JSON 规范。',
                    90002: 'JSON 格式请求包中 MsgBody 不符合消息格式描述，或者 MsgBody 不是 Array 类型，请参考 TIMMsgElement 对象的定义(https://cloud.tencent.com/document/product/269/2720#.E6.B6.88.E6.81.AF.E5.85.83.E7.B4.A0-timmsgelement)。',
                    90003: 'JSON 格式请求包体中缺少 To_Account 字段或者 To_Account 帐号不存在。',
                    90005: 'JSON 格式请求包体中缺少 MsgRandom 字段或者 MsgRandom 字段不是 Integer 类型。',
                    90006: 'JSON 格式请求包体中缺少 MsgTimeStamp 字段或者 MsgTimeStamp 字段不是 Integer 类型。',
                    90007: 'JSON 格式请求包体中 MsgBody 类型不是 Array 类型，请将其修改为 Array 类型。',
                    90008: 'JSON 格式请求包体中缺少 From_Account 字段或者 From_Account 帐号不存在。',
                    90009: '请求需要 App 管理员权限。',
                    90010: 'JSON 格式请求包不符合消息格式描述，请参考 TIMMsgElement 对象的定义(https://cloud.tencent.com/document/product/269/2720#.E6.B6.88.E6.81.AF.E5.85.83.E7.B4.A0-timmsgelement)。',
                    90011: '批量发消息目标帐号超过500，请减少 To_Account 中目标帐号数量。',
                    90012: 'To_Account 没有注册或不存在，请确认 To_Account 是否导入即时通信 IM 或者是否拼写错误。',
                    90026: '消息离线存储时间错误（最多不能超过7天）。',
                    90031: 'JSON 格式请求包体中 SyncOtherMachine 字段不是 Integer 类型。',
                    90044: 'JSON 格式请求包体中 MsgLifeTime 字段不是 Integer 类型。',
                    90048: '请求的用户帐号不存在。',
                    90054: '撤回请求中的 MsgKey 不合法。',
                    90994: '服务内部错误，请重试。',
                    90995: '服务内部错误，请重试。',
                    91000: '服务内部错误，请重试。',
                    90992: '服务内部错误，请重试；如果所有请求都返回该错误码，且 App 配置了第三方回调，请检查 App 服务端是否正常向即时通信 IM 后台服务端返回回调结果。',
                    93000: 'JSON 数据包超长，消息包体请不要超过8k。',
                    91101: 'Web 端长轮询被踢（Web 端同时在线实例个数超出限制）。',
                    10002: '服务端内部错误，请重试。',
                    10003: '请求中的接口名称错误，请核对接口名称并重试。',
                    10004: '参数非法，请根据错误描述检查请求是否正确。',
                    10005: '请求包体中携带的帐号数量过多。',
                    10006: '操作频率限制，请尝试降低调用的频率。',
                    10007: '操作权限不足，例如 Public 群组中普通成员尝试执行踢人操作，但只有 App 管理员才有权限。',
                    10008: '请求非法，可能是请求中携带的签名信息验证不正确，请再次尝试。',
                    10009: '该群不允许群主主动退出。',
                    10010: '群组不存在，或者曾经存在过，但是目前已经被解散。',
                    10011: '解析 JSON 包体失败，请检查包体的格式是否符合 JSON 格式。',
                    10012: '发起操作的 UserID 非法，请检查发起操作的用户 UserID 是否填写正确。',
                    10013: '被邀请加入的用户已经是群成员。',
                    10014: '群已满员，无法将请求中的用户加入群组，如果是批量加人，可以尝试减少加入用户的数量。',
                    10015: '找不到指定 ID 的群组。',
                    10016: 'App 后台通过第三方回调拒绝本次操作。',
                    10017: '因被禁言而不能发送消息，请检查发送者是否被设置禁言。',
                    10018: '应答包长度超过最大包长（1MB），请求的内容过多，请尝试减少单次请求的数据量。',
                    10019: '请求的用户帐号不存在。',
                    10021: '群组 ID 已被使用，请选择其他的群组 ID。',
                    10023: '发消息的频率超限，请延长两次发消息时间的间隔。',
                    10024: '此邀请或者申请请求已经被处理。',
                    10025: '群组 ID 已被使用，并且操作者为群主，可以直接使用。',
                    10026: '该 SDKAppID 请求的命令字已被禁用。',
                    10030: '请求撤回的消息不存在。',
                    10031: '消息撤回超过了时间限制（默认2分钟）。',
                    10032: '请求撤回的消息不支持撤回操作。',
                    10033: '群组类型不支持消息撤回操作。',
                    10034: '该消息类型不支持删除操作。',
                    10035: '音视频聊天室和在线成员广播大群不支持删除消息。',
                    10036: '音视频聊天室创建数量超过了限制，请参考价格说明(https://cloud.tencent.com/document/product/269/11673)购买预付费套餐“IM音视频聊天室”。',
                    10037: '单个用户可创建和加入的群组数量超过了限制，请参考价格说明(https://cloud.tencent.com/document/product/269/11673)购买或升级预付费套餐“单人可创建与加入群组数”。',
                    10038: '群成员数量超过限制，请参考价格说明(https://cloud.tencent.com/document/product/269/11673)购买或升级预付费套餐“扩展群人数上限”。',
                    10041: '该应用（SDKAppID）已配置不支持群消息撤回。'
                };
                var pt = (function (e) {
                    l(n, e);
                    var t = y(n);
                    function n(e) {
                        var o;
                        r(this, n);
                        (o = t.call(this)).code = e.code;
                        o.message = ct[e.code] || e.message;
                        o.data = e.data || {};
                        return o;
                    }
                    return n;
                })(d(Error));
                var ht = 2000;
                var ft = 2001;
                var dt = 2002;
                var gt = 2003;
                var mt = 2022;
                var yt = 2023;
                var vt = 2040;
                var _t = 2100;
                var Ct = 2103;
                var Mt = 2105;
                var It = 2106;
                var St = 2108;
                var Dt = 2109;
                var Tt = 2110;
                var Et = 2251;
                var kt = 2252;
                var At = 2253;
                var wt = 2300;
                var Rt = 2301;
                var Ot = 2350;
                var Lt = 2351;
                var Nt = 2352;
                var bt = 2400;
                var Pt = 2401;
                var Gt = 2402;
                var Ut = 2403;
                var qt = 2500;
                var xt = 2501;
                var Ft = 2502;
                var Ht = 2600;
                var Bt = 2601;
                var Vt = 2620;
                var Kt = 2621;
                var jt = 2622;
                var $t = 2660;
                var Yt = 2661;
                var zt = 2662;
                var Wt = 2680;
                var Xt = 2681;
                var Jt = 2682;
                var Qt = 2683;
                var Zt = 2684;
                var en = 2685;
                var tn = 2700;
                var nn = 2721;
                var rn = 2722;
                var on = 2740;
                var sn = 2741;
                var an = 2742;
                var un = 2800;
                var ln = 2801;
                var cn = 2802;
                var pn = 2803;
                var hn = 2804;
                var fn = 2805;
                var dn = 2900;
                var gn = 2901;
                var mn = 2902;
                var yn = 2903;
                var vn = 2904;
                var _n = 2999;
                var Cn = 91101;
                var Mn = 20002;
                var In = 70001;
                var Sn = '无 SDKAppID';
                var Dn = '无 accountType';
                var Tn = '无 userID';
                var En = '无 userSig';
                var kn = '无 tinyID';
                var An = '无 a2key';
                var wn = '未检测到 COS 上传插件';
                var Rn = '消息发送失败';
                var On = 'MessageController.constructor() 需要参数 options';
                var Ln = '需要 Message 的实例';
                var Nn = 'Message.conversationType 只能为 "C2C" 或 "GROUP"';
                var bn = '无法发送空文件';
                var Pn = '回调函数运行时遇到错误，请检查接入侧代码';
                var Gn = '消息撤回失败';
                var Un = '请先选择一个图片';
                var qn = '只允许上传 jpg png jpeg gif 格式的图片';
                var xn = '图片大小超过20M，无法发送';
                var Fn = '语音上传失败';
                var Hn = '语音大小大于20M，无法发送';
                var Bn = '视频上传失败';
                var Vn = '视频大小超过100M，无法发送';
                var Kn = '只允许上传 mp4 格式的视频';
                var jn = '文件上传失败';
                var $n = '请先选择一个文件';
                var Yn = '文件大小超过100M，无法发送 ';
                var zn = '缺少必要的参数文件 URL';
                var Wn = '没有找到相应的会话，请检查传入参数';
                var Xn = '没有找到相应的用户或群组，请检查传入参数';
                var Jn = '未记录的会话类型';
                var Qn = '非法的群类型，请检查传入参数';
                var Zn = '不能加入 Private 类型的群组';
                var er = 'AVChatRoom 类型的群组不能转让群主';
                var tr = '不能把群主转让给自己';
                var nr = '不能解散 Private 类型的群组';
                var rr = '加群失败，请检查传入参数或重试';
                var or = 'AVChatRoom 类型的群不支持邀请群成员';
                var ir = '非 AVChatRoom 类型的群组不允许匿名加群，请先登录后再加群';
                var sr = '不能在 AVChatRoom 类型的群组踢人';
                var ar = '你不是群主，只有群主才有权限操作';
                var ur = '不能在 Private / AVChatRoom 类型的群中设置群成员身份';
                var lr = '不合法的群成员身份，请检查传入参数';
                var cr = '不能设置自己的群成员身份，请检查传入参数';
                var pr = '不能将自己禁言，请检查传入参数';
                var hr = '传入 deleteFriend 接口的参数无效';
                var fr = '传入 updateMyProfile 接口的参数无效';
                var dr = 'updateMyProfile 无标配资料字段或自定义资料字段';
                var gr = '传入 addToBlacklist 接口的参数无效';
                var mr = '传入 removeFromBlacklist 接口的参数无效';
                var yr = '不能拉黑自己';
                var vr = '网络层初始化错误，缺少 URL 参数';
                var _r = '打包错误，未定义的 serverName';
                var Cr = '未定义的 packageConfig';
                var Mr = '未连接到网络';
                var Ir = '不规范的参数名称';
                var Sr = '意料外的通知条件';
                var Dr = '_syncOffset 丢失';
                var Tr = '获取 longpolling id 失败';
                var Er = '接口需要 SDK 处于 ready 状态后才能调用';
                var kr = ['jpg', 'jpeg', 'gif', 'png'];
                var Ar = ['mp4'];
                var wr = (function () {
                    function e(n) {
                        r(this, e);
                        var o = this._check(n);
                        if (o instanceof pt) {
                            throw o;
                        }
                        this.type = t.MSG_FILE;
                        this._percent = 0;
                        var i = this._getFileInfo(n);
                        this.content = {
                            downloadFlag: 2,
                            fileUrl: n.url || '',
                            uuid: n.uuid,
                            fileName: i.name || '',
                            fileSize: i.size || 0
                        };
                    }
                    i(e, [
                        {
                            key: '_getFileInfo',
                            value: function (e) {
                                if (e.fileName && e.fileSize) {
                                    return {
                                        size: e.fileSize,
                                        name: e.fileName
                                    };
                                }
                                if (O) {
                                    return {};
                                }
                                var t = e.file.files[0];
                                return {
                                    size: t.size,
                                    name: t.name,
                                    type: t.type.slice(t.type.lastIndexOf('/') + 1).toLowerCase()
                                };
                            }
                        },
                        {
                            key: 'updatePercent',
                            value: function (e) {
                                this._percent = e;
                                if (this._percent > 1) {
                                    this._percent = 1;
                                }
                            }
                        },
                        {
                            key: 'updateFileUrl',
                            value: function (e) {
                                this.content.fileUrl = e;
                            }
                        },
                        {
                            key: '_check',
                            value: function (e) {
                                if (e.size > 104857600) {
                                    return new pt({
                                        code: Gt,
                                        message: ''.concat(Yn, ': ').concat(104857600, ' bytes')
                                    });
                                }
                            }
                        },
                        {
                            key: 'sendable',
                            value: function () {
                                return '' !== this.content.fileUrl && '' !== this.content.fileName && 0 !== this.content.fileSize;
                            }
                        }
                    ]);
                    return e;
                })();
                var Rr = (function () {
                    function e(n) {
                        r(this, e);
                        this.type = t.MSG_CUSTOM;
                        this.content = {
                            data: n.data || '',
                            description: n.description || '',
                            extension: n.extension || ''
                        };
                    }
                    i(e, [
                        {
                            key: 'setData',
                            value: function (e) {
                                this.setData(e);
                                return this;
                            }
                        },
                        {
                            key: 'setDescription',
                            value: function (e) {
                                this.content.description = e;
                                return this;
                            }
                        },
                        {
                            key: 'setExtension',
                            value: function (e) {
                                this.content.extension = e;
                                return this;
                            }
                        },
                        {
                            key: 'sendable',
                            value: function () {
                                return 0 !== this.content.data.length || 0 !== this.content.description.length || 0 !== this.content.extension.length;
                            }
                        }
                    ]);
                    return e;
                })();
                var Or = (function () {
                    function e(n) {
                        r(this, e);
                        this.type = t.MSG_VIDEO;
                        this._percent = 0;
                        this.content = {
                            remoteVideoUrl: n.remoteVideoUrl,
                            videoFormat: n.videoFormat,
                            videoSecond: parseInt(n.videoSecond, 10),
                            videoSize: n.videoSize,
                            videoUrl: n.videoUrl,
                            videoDownloadFlag: 2,
                            videoUUID: n.videoUUID,
                            thumbUUID: n.thumbUUID,
                            thumbFormat: n.thumbFormat,
                            thumbWidth: n.thumbWidth,
                            thumbHeight: n.thumbHeight,
                            thumbSize: n.thumbSize,
                            thumbDownloadFlag: 2,
                            thumbUrl: n.thumbUrl
                        };
                    }
                    i(e, [
                        {
                            key: 'updatePercent',
                            value: function (e) {
                                this._percent = e;
                                if (this._percent > 1) {
                                    this._percent = 1;
                                }
                            }
                        },
                        {
                            key: 'updateVideoUrl',
                            value: function (e) {
                                if (e) {
                                    this.content.remoteVideoUrl = e;
                                }
                            }
                        },
                        {
                            key: 'sendable',
                            value: function () {
                                return '' !== this.content.remoteVideoUrl;
                            }
                        }
                    ]);
                    return e;
                })();
                var Lr = function e(n) {
                    r(this, e);
                    this.type = t.MSG_GEO;
                    this.content = n;
                };
                var Nr = {
                    1: t.MSG_PRIORITY_HIGH,
                    2: t.MSG_PRIORITY_NORMAL,
                    3: t.MSG_PRIORITY_LOW,
                    4: t.MSG_PRIORITY_LOWEST
                };
                var br = (function () {
                    function e(n) {
                        r(this, e);
                        this.ID = '';
                        this.conversationID = n.conversationID || null;
                        this.conversationType = n.conversationType || t.CONV_C2C;
                        this.conversationSubType = n.conversationSubType;
                        this.time = n.time || Math.ceil(Date.now() / 1000);
                        this.sequence = n.sequence || 0;
                        this.clientSequence = n.clientSequence || n.sequence || 0;
                        this.random = n.random || me();
                        this.priority = this._computePriority(n.priority);
                        this.nick = '';
                        this.avatar = '';
                        this._elements = [];
                        this.isPlaceMessage = n.isPlaceMessage || 0;
                        this.isRevoked = 2 === n.isPlaceMessage || 8 === n.msgFlagBits;
                        this.geo = {};
                        this.from = n.from || null;
                        this.to = n.to || null;
                        this.flow = '';
                        this.isSystemMessage = n.isSystemMessage || false;
                        this.protocol = n.protocol || 'JSON';
                        this.isResend = false;
                        this.isRead = false;
                        this.status = n.status || Pe.SUCCESS;
                        this.reInitialize(n.currentUser);
                        this.extractGroupInfo(n.groupProfile || null);
                    }
                    i(e, [
                        {
                            key: 'getElements',
                            value: function () {
                                return this._elements;
                            }
                        },
                        {
                            key: 'extractGroupInfo',
                            value: function (e) {
                                if (null !== e) {
                                    if (ee(e.fromAccountNick)) {
                                        this.nick = e.fromAccountNick;
                                    }
                                    if (ee(e.fromAccountHeadurl)) {
                                        this.avatar = e.fromAccountHeadurl;
                                    }
                                }
                            }
                        },
                        {
                            key: '_initProxy',
                            value: function () {
                                this.payload = this._elements[0].content;
                                this.type = this._elements[0].type;
                            }
                        },
                        {
                            key: 'reInitialize',
                            value: function (e) {
                                if (e) {
                                    this.status = this.from ? Pe.SUCCESS : Pe.UNSEND;
                                    if (!this.from) {
                                        this.from = e;
                                    }
                                }
                                this._initFlow(e);
                                this._initielizeSequence(e);
                                this._concactConversationID(e);
                                this.generateMessageID(e);
                            }
                        },
                        {
                            key: 'isSendable',
                            value: function () {
                                return (
                                    0 !== this._elements.length &&
                                    ('function' != typeof this._elements[0].sendable
                                        ? (J.warn(''.concat(this._elements[0].type, ' need "boolean : sendable()" method')), false)
                                        : this._elements[0].sendable())
                                );
                            }
                        },
                        {
                            key: '_initTo',
                            value: function (e) {
                                if (this.conversationType === t.CONV_GROUP) {
                                    this.to = e.groupID;
                                }
                            }
                        },
                        {
                            key: '_initielizeSequence',
                            value: function (e) {
                                if (0 === this.clientSequence && e) {
                                    this.clientSequence = (function (e) {
                                        if (!e) {
                                            J.error('autoincrementIndex(string: key) need key parameter');
                                            return false;
                                        }
                                        if (void 0 === Ce[e]) {
                                            var t = new Date();
                                            var n = '3'.concat(t.getHours()).slice(-2);
                                            var r = '0'.concat(t.getMinutes()).slice(-2);
                                            var o = '0'.concat(t.getSeconds()).slice(-2);
                                            Ce[e] = parseInt([n, r, o, '0001'].join(''));
                                            n = null;
                                            r = null;
                                            o = null;
                                            J.warn('utils.autoincrementIndex() create new sequence : '.concat(e, ' = ').concat(Ce[e]));
                                        }
                                        return Ce[e]++;
                                    })(e);
                                }
                                if (0 === this.sequence && this.conversationType === t.CONV_C2C) {
                                    this.sequence = this.clientSequence;
                                }
                            }
                        },
                        {
                            key: 'generateMessageID',
                            value: function (e) {
                                var t = e === this.from ? 1 : 0;
                                var n = this.sequence > 0 ? this.sequence : this.clientSequence;
                                this.ID = ''.concat(this.conversationID, '-').concat(n, '-').concat(this.random, '-').concat(t);
                            }
                        },
                        {
                            key: '_initFlow',
                            value: function (e) {
                                if ('' !== e) {
                                    e === this.from ? ((this.flow = 'out'), (this.isRead = true)) : (this.flow = 'in');
                                }
                            }
                        },
                        {
                            key: '_concactConversationID',
                            value: function (e) {
                                var n = this.to;
                                var r = '';
                                var o = this.conversationType;
                                o !== t.CONV_SYSTEM
                                    ? ((r = o === t.CONV_C2C ? (e === this.from ? n : this.from) : this.to), (this.conversationID = ''.concat(o).concat(r)))
                                    : (this.conversationID = t.CONV_SYSTEM);
                            }
                        },
                        {
                            key: 'isElement',
                            value: function (e) {
                                return (
                                    e instanceof Ue ||
                                    e instanceof rt ||
                                    e instanceof ot ||
                                    e instanceof it ||
                                    e instanceof wr ||
                                    e instanceof Or ||
                                    e instanceof at ||
                                    e instanceof lt ||
                                    e instanceof Rr ||
                                    e instanceof Lr
                                );
                            }
                        },
                        {
                            key: 'setElement',
                            value: function (e) {
                                var that = this;
                                if (this.isElement(e)) {
                                    this._elements = [e];
                                    return void this._initProxy();
                                }
                                var r = function (e) {
                                    switch (e.type) {
                                        case t.MSG_TEXT:
                                            that.setTextElement(e.content);
                                            break;
                                        case t.MSG_IMAGE:
                                            that.setImageElement(e.content);
                                            break;
                                        case t.MSG_AUDIO:
                                            that.setAudioElement(e.content);
                                            break;
                                        case t.MSG_FILE:
                                            that.setFileElement(e.content);
                                            break;
                                        case t.MSG_VIDEO:
                                            that.setVideoElement(e.content);
                                            break;
                                        case t.MSG_CUSTOM:
                                            that.setCustomElement(e.content);
                                            break;
                                        case t.MSG_GEO:
                                            that.setGEOElement(e.content);
                                            break;
                                        case t.MSG_GRP_TIP:
                                            that.setGroupTipElement(e.content);
                                            break;
                                        case t.MSG_GRP_SYS_NOTICE:
                                            that.setGroupSystemNoticeElement(e.content);
                                            break;
                                        case t.MSG_FACE:
                                            that.setFaceElement(e.content);
                                            break;
                                        default:
                                            J.warn(e.type, e.content, 'no operation......');
                                    }
                                };
                                if (Array.isArray(e)) {
                                    for (var o = 0; o < e.length; o++) {
                                        r(e[o]);
                                    }
                                } else {
                                    r(e);
                                }
                                this._initProxy();
                            }
                        },
                        {
                            key: 'setTextElement',
                            value: function (e) {
                                var t = 'string' == typeof e ? e : e.text;
                                var n = new Ue({
                                    text: t
                                });
                                this._elements.push(n);
                            }
                        },
                        {
                            key: 'setImageElement',
                            value: function (e) {
                                var t = new rt(e);
                                this._elements.push(t);
                            }
                        },
                        {
                            key: 'setAudioElement',
                            value: function (e) {
                                var t = new it(e);
                                this._elements.push(t);
                            }
                        },
                        {
                            key: 'setFileElement',
                            value: function (e) {
                                var t = new wr(e);
                                this._elements.push(t);
                            }
                        },
                        {
                            key: 'setVideoElement',
                            value: function (e) {
                                var t = new Or(e);
                                this._elements.push(t);
                            }
                        },
                        {
                            key: 'setGEOElement',
                            value: function (e) {
                                var t = new Lr(e);
                                this._elements.push(t);
                            }
                        },
                        {
                            key: 'setCustomElement',
                            value: function (e) {
                                var t = new Rr(e);
                                this._elements.push(t);
                            }
                        },
                        {
                            key: 'setGroupTipElement',
                            value: function (e) {
                                if (e.operatorInfo) {
                                    var t = e.operatorInfo;
                                    var n = t.nick;
                                    var r = t.avatar;
                                    if (ee(n)) {
                                        this.nick = n;
                                    }
                                    if (ee(r)) {
                                        this.avatar = r;
                                    }
                                }
                                var o = new at(e);
                                this._elements.push(o);
                            }
                        },
                        {
                            key: 'setGroupSystemNoticeElement',
                            value: function (e) {
                                var t = new lt(e);
                                this._elements.push(t);
                            }
                        },
                        {
                            key: 'setFaceElement',
                            value: function (e) {
                                var t = new ot(e);
                                this._elements.push(t);
                            }
                        },
                        {
                            key: 'setIsRead',
                            value: function (e) {
                                this.isRead = e;
                            }
                        },
                        {
                            key: '_computePriority',
                            value: function (e) {
                                if (oe(e)) {
                                    return t.MSG_PRIORITY_NORMAL;
                                }
                                if (ee(e) && -1 !== Object.values(Nr).indexOf(e)) {
                                    return e;
                                }
                                if (Z(e)) {
                                    var n = '' + e;
                                    if (-1 !== Object.keys(Nr).indexOf(n)) {
                                        return Nr[n];
                                    }
                                }
                                return t.MSG_PRIORITY_NORMAL;
                            }
                        },
                        {
                            key: 'elements',
                            get: function () {
                                J.warn('！！！Message 实例的 elements 属性即将废弃，请尽快修改。使用 type 和 payload 属性处理单条消息，兼容组合消息使用 _elements 属性！！！');
                                return this._elements;
                            }
                        }
                    ]);
                    return e;
                })();
                var Pr = function (e) {
                    return (
                        !!e &&
                        (!!(
                            (function (e) {
                                return ee(e) && e.slice(0, 3) === t.CONV_C2C;
                            })(e) ||
                            (function (e) {
                                return ee(e) && e.slice(0, 5) === t.CONV_GROUP;
                            })(e) ||
                            Ee(e)
                        ) ||
                            (console.warn('非法的会话 ID:'.concat(e, '。会话 ID 组成方式：\n  C2C + userID（单聊）\n  GROUP + groupID（群聊）\n  @TIM#SYSTEM（系统通知会话）')),
                            false))
                    );
                };
                var Gr = {
                    login: {
                        userID: {
                            type: 'String',
                            required: true
                        },
                        userSig: {
                            type: 'String',
                            required: true
                        }
                    },
                    addToBlacklist: {
                        userIDList: {
                            type: 'Array',
                            required: true
                        }
                    },
                    mutilParam: [
                        {
                            name: 'paramName',
                            type: 'Number',
                            required: true
                        },
                        {
                            name: 'paramName',
                            type: 'String',
                            required: true
                        }
                    ],
                    on: [
                        {
                            name: 'eventName',
                            type: 'String',
                            validator: function (e) {
                                return ('string' == typeof e && 0 !== e.length) || (console.warn('on 接口的 eventName 参数必须是 String 类型，且不能为空。'), false);
                            }
                        },
                        {
                            name: 'handler',
                            type: 'Function',
                            validator: function (e) {
                                return 'function' != typeof e
                                    ? (console.warn('on 接口的 handler 参数必须是 Function 类型。'), false)
                                    : ('' === e.name && console.warn('on 接口的 handler 参数推荐使用具名函数。具名函数可以使用 off 接口取消订阅，匿名函数无法取消订阅。'), true);
                            }
                        }
                    ],
                    once: [
                        {
                            name: 'eventName',
                            type: 'String',
                            validator: function (e) {
                                return ('string' == typeof e && 0 !== e.length) || (console.warn('once 接口的 eventName 参数必须是 String 类型，且不能为空。'), false);
                            }
                        },
                        {
                            name: 'handler',
                            type: 'Function',
                            validator: function (e) {
                                return 'function' != typeof e
                                    ? (console.warn('once 接口的 handler 参数必须是 Function 类型。'), false)
                                    : ('' === e.name && console.warn('once 接口的 handler 参数推荐使用具名函数。'), true);
                            }
                        }
                    ],
                    off: [
                        {
                            name: 'eventName',
                            type: 'String',
                            validator: function (e) {
                                return ('string' == typeof e && 0 !== e.length) || (console.warn('off 接口的 eventName 参数必须是 String 类型，且不能为空。'), false);
                            }
                        },
                        {
                            name: 'handler',
                            type: 'Function',
                            validator: function (e) {
                                return 'function' != typeof e
                                    ? (console.warn('off 接口的 handler 参数必须是 Function 类型。'), false)
                                    : ('' === e.name && console.warn('off 接口的 handler 参数为匿名函数，无法取消订阅。'), true);
                            }
                        }
                    ],
                    sendMessage: [
                        {
                            name: 'message',
                            type: 'Object',
                            required: true
                        }
                    ],
                    getMessageList: {
                        conversationID: {
                            type: 'String',
                            required: true,
                            validator: function (e) {
                                return Pr(e);
                            }
                        },
                        nextReqMessageID: {
                            type: 'String'
                        },
                        count: {
                            type: 'Number',
                            validator: function (e) {
                                return !(!oe(e) && !/^[1-9][0-9]*$/.test(e)) || (console.warn('getMessageList 接口的 count 参数必须为正整数'), false);
                            }
                        }
                    },
                    setMessageRead: {
                        conversationID: {
                            type: 'String',
                            required: true,
                            validator: function (e) {
                                return Pr(e);
                            }
                        }
                    },
                    getConversationProfile: [
                        {
                            name: 'conversationID',
                            type: 'String',
                            required: true,
                            validator: function (e) {
                                return Pr(e);
                            }
                        }
                    ],
                    deleteConversation: [
                        {
                            name: 'conversationID',
                            type: 'String',
                            required: true,
                            validator: function (e) {
                                return Pr(e);
                            }
                        }
                    ],
                    getGroupList: {
                        groupProfileFilter: {
                            type: 'Array'
                        }
                    },
                    getGroupProfile: {
                        groupID: {
                            type: 'String',
                            required: true
                        },
                        groupCustomFieldFilter: {
                            type: 'Array'
                        },
                        memberCustomFieldFilter: {
                            type: 'Array'
                        }
                    },
                    getGroupProfileAdvance: {
                        groupIDList: {
                            type: 'Array',
                            required: true
                        }
                    },
                    createGroup: {
                        name: {
                            type: 'String',
                            required: true
                        }
                    },
                    joinGroup: {
                        groupID: {
                            type: 'String',
                            required: true
                        },
                        type: {
                            type: 'String'
                        },
                        applyMessage: {
                            type: 'String'
                        }
                    },
                    quitGroup: [
                        {
                            name: 'groupID',
                            type: 'String',
                            required: true
                        }
                    ],
                    handleApplication: {
                        message: {
                            type: 'Object',
                            required: true
                        },
                        handleAction: {
                            type: 'String',
                            required: true
                        },
                        handleMessage: {
                            type: 'String'
                        }
                    },
                    changeGroupOwner: {
                        groupID: {
                            type: 'String',
                            required: true
                        },
                        newOwnerID: {
                            type: 'String',
                            required: true
                        }
                    },
                    updateGroupProfile: {
                        groupID: {
                            type: 'String',
                            required: true
                        },
                        muteAllMembers: {
                            type: 'Boolean'
                        }
                    },
                    dismissGroup: [
                        {
                            name: 'groupID',
                            type: 'String',
                            required: true
                        }
                    ],
                    searchGroupByID: [
                        {
                            name: 'groupID',
                            type: 'String',
                            required: true
                        }
                    ],
                    getGroupMemberList: {
                        groupID: {
                            type: 'String',
                            required: true
                        },
                        offset: {
                            type: 'Number'
                        },
                        count: {
                            type: 'Number'
                        }
                    },
                    getGroupMemberProfile: {
                        groupID: {
                            type: 'String',
                            required: true
                        },
                        userIDList: {
                            type: 'Array',
                            required: true
                        },
                        memberCustomFieldFilter: {
                            type: 'Array'
                        }
                    },
                    addGroupMemeber: {
                        groupID: {
                            type: 'String',
                            required: true
                        },
                        userIDList: {
                            type: 'Array',
                            required: true
                        }
                    },
                    setGroupMemberRole: {
                        groupID: {
                            type: 'String',
                            required: true
                        },
                        userID: {
                            type: 'String',
                            required: true
                        },
                        role: {
                            type: 'String',
                            required: true
                        }
                    },
                    setGroupMemberMuteTime: {
                        groupID: {
                            type: 'String',
                            required: true
                        },
                        userID: {
                            type: 'String',
                            required: true
                        },
                        muteTime: {
                            type: 'Number',
                            validator: function (e) {
                                return e >= 0;
                            }
                        }
                    },
                    setGroupMemberNameCard: {
                        groupID: {
                            type: 'String',
                            required: true
                        },
                        userID: {
                            type: 'String'
                        },
                        nameCard: {
                            type: 'String',
                            required: true,
                            validator: function (e) {
                                return true !== /^\s+$/.test(e);
                            }
                        }
                    },
                    setMessageRemindType: {
                        groupID: {
                            type: 'String',
                            required: true
                        },
                        messageRemindType: {
                            type: 'String',
                            required: true
                        }
                    },
                    setGroupMemberCustomField: {
                        groupID: {
                            type: 'String',
                            required: true
                        },
                        userID: {
                            type: 'String'
                        },
                        memberCustomField: {
                            type: 'Array',
                            required: true
                        }
                    },
                    deleteGroupMember: {
                        groupID: {
                            type: 'String',
                            required: true
                        }
                    },
                    createTextMessage: {
                        to: {
                            type: 'String',
                            required: true
                        },
                        conversationType: {
                            type: 'String',
                            required: true
                        },
                        payload: {
                            type: 'Object',
                            required: true,
                            validator: function (e) {
                                return ee(e.text)
                                    ? 0 !== e.text.length ||
                                          (console.warn(
                                              'createTextMessage 消息内容不能为空。请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#createTextMessage'
                                          ),
                                          false)
                                    : (console.warn(
                                          'createTextMessage payload.text 类型必须为字符串。请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#createTextMessage'
                                      ),
                                      false);
                            }
                        }
                    },
                    createCustomMessage: {
                        to: {
                            type: 'String',
                            required: true
                        },
                        conversationType: {
                            type: 'String',
                            required: true
                        },
                        payload: {
                            type: 'Object',
                            required: true
                        }
                    },
                    createImageMessage: {
                        to: {
                            type: 'String',
                            required: true
                        },
                        conversationType: {
                            type: 'String',
                            required: true
                        },
                        payload: {
                            type: 'Object',
                            required: true,
                            validator: function (e) {
                                if (oe(e.file)) {
                                    console.warn(
                                        'createImageMessage payload.file 不能为 undefined。请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#createImageMessage'
                                    );
                                    return false;
                                }
                                if (R) {
                                    if (!(e.file instanceof HTMLInputElement || Q(e.file))) {
                                        console.warn(
                                            'createImageMessage payload.file 的类型必须是 HTMLInputElement 或 File。请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#createImageMessage'
                                        );
                                        return false;
                                    }
                                    if (e.file instanceof HTMLInputElement && 0 === e.file.files.length) {
                                        console.warn(
                                            'createImageMessage 您没有选择文件，无法发送。请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#createImageMessage'
                                        );
                                        return false;
                                    }
                                }
                                return true;
                            },
                            onProgress: {
                                type: 'Function',
                                required: false,
                                validator: function (e) {
                                    if (oe(e)) {
                                        console.warn(
                                            'createImageMessage 没有 onProgress 回调，您将无法获取图片上传进度。请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#createImageMessage'
                                        );
                                    }
                                    return true;
                                }
                            }
                        }
                    },
                    createAudioMessage: {
                        to: {
                            type: 'String',
                            required: true
                        },
                        conversationType: {
                            type: 'String',
                            required: true
                        },
                        payload: {
                            type: 'Object',
                            required: true
                        },
                        onProgress: {
                            type: 'Function',
                            required: false,
                            validator: function (e) {
                                if (oe(e)) {
                                    console.warn(
                                        'createAudioMessage 没有 onProgress 回调，您将无法获取音频上传进度。请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#createAudioMessage'
                                    );
                                }
                                return true;
                            }
                        }
                    },
                    createVideoMessage: {
                        to: {
                            type: 'String',
                            required: true
                        },
                        conversationType: {
                            type: 'String',
                            required: true
                        },
                        payload: {
                            type: 'Object',
                            required: true,
                            validator: function (e) {
                                if (oe(e.file)) {
                                    console.warn(
                                        'createVideoMessage payload.file 不能为 undefined。请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#createVideoMessage'
                                    );
                                    return false;
                                }
                                if (R) {
                                    if (!(e.file instanceof HTMLInputElement || Q(e.file))) {
                                        console.warn(
                                            'createVideoMessage payload.file 的类型必须是 HTMLInputElement 或 File。请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#createVideoMessage'
                                        );
                                        return false;
                                    }
                                    if (e.file instanceof HTMLInputElement && 0 === e.file.files.length) {
                                        console.warn(
                                            'createVideoMessage 您没有选择文件，无法发送。请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#createVideoMessage'
                                        );
                                        return false;
                                    }
                                }
                                return true;
                            }
                        },
                        onProgress: {
                            type: 'Function',
                            required: false,
                            validator: function (e) {
                                if (oe(e)) {
                                    console.warn(
                                        'createVideoMessage 没有 onProgress 回调，您将无法获取视频上传进度。请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#createVideoMessage'
                                    );
                                }
                                return true;
                            }
                        }
                    },
                    createFaceMessage: {
                        to: {
                            type: 'String',
                            required: true
                        },
                        conversationType: {
                            type: 'String',
                            required: true
                        },
                        payload: {
                            type: 'Object',
                            required: true,
                            validator: function (e) {
                                return (
                                    !!ne(e) &&
                                    (Z(e.index)
                                        ? !!ee(e.data) || (console.warn('createFaceMessage payload.data 类型必须为 String！'), false)
                                        : (console.warn('createFaceMessage payload.index 类型必须为 Number！'), false))
                                );
                            }
                        }
                    },
                    createFileMessage: {
                        to: {
                            type: 'String',
                            required: true
                        },
                        conversationType: {
                            type: 'String',
                            required: true
                        },
                        payload: {
                            type: 'Object',
                            required: true,
                            validator: function (e) {
                                if (oe(e.file)) {
                                    console.warn(
                                        'createFileMessage payload.file 不能为 undefined。请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#createFileMessage'
                                    );
                                    return false;
                                }
                                if (R) {
                                    if (!(e.file instanceof HTMLInputElement || Q(e.file))) {
                                        console.warn(
                                            'createFileMessage payload.file 的类型必须是 HTMLInputElement 或 File。请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#createFileMessage'
                                        );
                                        return false;
                                    }
                                    if (e.file instanceof HTMLInputElement && 0 === e.file.files.length) {
                                        console.warn(
                                            'createFileMessage 您没有选择文件，无法发送。请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#createFileMessage'
                                        );
                                        return false;
                                    }
                                }
                                return true;
                            }
                        },
                        onProgress: {
                            type: 'Function',
                            required: false,
                            validator: function (e) {
                                if (oe(e)) {
                                    console.warn(
                                        'createFileMessage 没有 onProgress 回调，您将无法获取文件上传进度。请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#createFileMessage'
                                    );
                                }
                                return true;
                            }
                        }
                    },
                    revokeMessage: [
                        {
                            name: 'message',
                            type: 'Object',
                            required: true,
                            validator: function (e) {
                                return e instanceof br
                                    ? e.conversationType === t.CONV_SYSTEM
                                        ? (console.warn('revokeMessage 不能撤回系统会话消息，只能撤回单聊消息或群消息'), false)
                                        : true !== e.isRevoked || (console.warn('revokeMessage 消息已经被撤回，请勿重复操作'), false)
                                    : (console.warn('revokeMessage 参数 message 必须为 Message(https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/Message.html) 实例。'), false);
                            }
                        }
                    ],
                    getUserProfile: {
                        userIDList: {
                            type: 'Array',
                            validator: function (e) {
                                return re(e)
                                    ? (0 === e.length &&
                                          console.warn(
                                              'getUserProfile userIDList 不能为空数组，请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#getUserProfile'
                                          ),
                                      true)
                                    : (console.warn('getUserProfile userIDList 必须为数组，请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#getUserProfile'),
                                      false);
                            }
                        }
                    },
                    updateMyProfile: {
                        profileCustomField: {
                            type: 'Array',
                            validator: function (e) {
                                return (
                                    !!oe(e) ||
                                    !!re(e) ||
                                    (console.warn(
                                        'updateMyProfile profileCustomField 必须为数组，请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#updateMyProfile'
                                    ),
                                    false)
                                );
                            }
                        }
                    }
                };
                var Ur = {
                    login: 'login',
                    logout: 'logout',
                    on: 'on',
                    once: 'once',
                    off: 'off',
                    setLogLevel: 'setLogLevel',
                    downloadLog: 'downloadLog',
                    registerPlugin: 'registerPlugin',
                    destroy: 'destroy',
                    createTextMessage: 'createTextMessage',
                    createImageMessage: 'createImageMessage',
                    createAudioMessage: 'createAudioMessage',
                    createVideoMessage: 'createVideoMessage',
                    createCustomMessage: 'createCustomMessage',
                    createFaceMessage: 'createFaceMessage',
                    createFileMessage: 'createFileMessage',
                    sendMessage: 'sendMessage',
                    resendMessage: 'resendMessage',
                    getMessageList: 'getMessageList',
                    setMessageRead: 'setMessageRead',
                    revokeMessage: 'revokeMessage',
                    getConversationList: 'getConversationList',
                    getConversationProfile: 'getConversationProfile',
                    deleteConversation: 'deleteConversation',
                    getGroupList: 'getGroupList',
                    getGroupProfile: 'getGroupProfile',
                    createGroup: 'createGroup',
                    joinGroup: 'joinGroup',
                    updateGroupProfile: 'updateGroupProfile',
                    quitGroup: 'quitGroup',
                    dismissGroup: 'dismissGroup',
                    changeGroupOwner: 'changeGroupOwner',
                    searchGroupByID: 'searchGroupByID',
                    setMessageRemindType: 'setMessageRemindType',
                    handleGroupApplication: 'handleGroupApplication',
                    getGroupMemberProfile: 'getGroupMemberProfile',
                    getGroupMemberList: 'getGroupMemberList',
                    addGroupMember: 'addGroupMember',
                    deleteGroupMember: 'deleteGroupMember',
                    setGroupMemberNameCard: 'setGroupMemberNameCard',
                    setGroupMemberMuteTime: 'setGroupMemberMuteTime',
                    setGroupMemberRole: 'setGroupMemberRole',
                    setGroupMemberCustomField: 'setGroupMemberCustomField',
                    getMyProfile: 'getMyProfile',
                    getUserProfile: 'getUserProfile',
                    updateMyProfile: 'updateMyProfile',
                    getBlacklist: 'getBlacklist',
                    addToBlacklist: 'addToBlacklist',
                    removeFromBlacklist: 'removeFromBlacklist',
                    getFriendList: 'getFriendList'
                };
                var qr = '1.7.3';
                var xr = '537048168';
                var Fr = '10';
                var Hr = 'protobuf';
                var Br = 'json';
                var Vr = {
                    HOST: {
                        TYPE: 3,
                        ACCESS_LAYER_TYPES: {
                            SANDBOX: 1,
                            TEST: 2,
                            PRODUCTION: 3
                        },
                        CURRENT: {
                            COMMON: 'https://webim.tim.qq.com',
                            PIC: 'https://pic.tim.qq.com',
                            COS: 'https://yun.tim.qq.com'
                        },
                        PRODUCTION: {
                            COMMON: 'https://webim.tim.qq.com',
                            PIC: 'https://pic.tim.qq.com',
                            COS: 'https://yun.tim.qq.com'
                        },
                        SANDBOX: {
                            COMMON: 'https://events.tim.qq.com',
                            PIC: 'https://pic.tim.qq.com',
                            COS: 'https://yun.tim.qq.com'
                        },
                        TEST: {
                            COMMON: 'https://test.tim.qq.com',
                            PIC: 'https://pic.tim.qq.com',
                            COS: 'https://test.tim.qq.com'
                        },
                        setCurrent: function () {
                            var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 3;
                            switch (e) {
                                case this.ACCESS_LAYER_TYPES.SANDBOX:
                                    this.CURRENT = this.SANDBOX;
                                    this.TYPE = this.ACCESS_LAYER_TYPES.SANDBOX;
                                    break;
                                case this.ACCESS_LAYER_TYPES.TEST:
                                    this.CURRENT = this.TEST;
                                    this.TYPE = this.ACCESS_LAYER_TYPES.TEST;
                                    break;
                                default:
                                    this.CURRENT = this.PRODUCTION;
                                    this.TYPE = this.ACCESS_LAYER_TYPES.PRODUCTION;
                            }
                        }
                    },
                    NAME: {
                        OPEN_IM: 'openim',
                        GROUP: 'group_open_http_svc',
                        FRIEND: 'sns',
                        PROFILE: 'profile',
                        RECENT_CONTACT: 'recentcontact',
                        PIC: 'openpic',
                        BIG_GROUP_NO_AUTH: 'group_open_http_noauth_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'
                    },
                    CMD: {
                        ACCESS_LAYER: 'accesslayer',
                        LOGIN: 'login',
                        LOGOUT_LONG_POLL: 'longpollinglogout',
                        LOGOUT_ALL: 'logout',
                        PORTRAIT_GET: 'portrait_get_all',
                        PORTRAIT_SET: 'portrait_set',
                        GET_LONG_POLL_ID: 'getlongpollingid',
                        LONG_POLL: 'longpolling',
                        AVCHATROOM_LONG_POLL: 'get_msg',
                        FRIEND_ADD: 'friend_add',
                        FRIEND_GET_ALL: 'friend_get_all',
                        FRIEND_DELETE: 'friend_delete',
                        RESPONSE_PENDENCY: 'friend_response',
                        GET_PENDENCY: 'pendency_get',
                        DELETE_PENDENCY: 'pendency_delete',
                        GET_GROUP_PENDENCY: 'get_pendency',
                        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',
                        SEND_MESSAGE: 'sendmsg',
                        REVOKE_C2C_MESSAGE: 'msgwithdraw',
                        SEND_GROUP_MESSAGE: 'send_group_msg',
                        REVOKE_GROUP_MESSAGE: 'group_msg_recall',
                        GET_GROUP_INFO: 'get_group_info',
                        GET_GROUP_MEMBER_INFO: 'get_specified_group_member_info',
                        GET_GROUP_MEMBER_LIST: 'get_group_member_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',
                        SEARCH_GROUP_BY_ID: 'get_group_public_info',
                        APPLY_JOIN_GROUP: 'apply_join_group',
                        HANDLE_APPLY_JOIN_GROUP: 'handle_apply_join_group',
                        MODIFY_GROUP_INFO: 'modify_group_base_info',
                        MODIFY_GROUP_MEMBER_INFO: 'modify_group_member_info',
                        DELETE_GROUP_SYSTEM_MESSAGE: 'deletemsg',
                        GET_CONVERSATION_LIST: 'get',
                        PAGING_GET_CONVERSATION_LIST: 'page_get',
                        DELETE_CONVERSATION: 'delete',
                        GET_MESSAGES: 'getmsg',
                        GET_C2C_ROAM_MESSAGES: 'getroammsg',
                        GET_GROUP_ROAM_MESSAGES: 'group_msg_get',
                        SET_C2C_MESSAGE_READ: 'msgreaded',
                        SET_GROUP_MESSAGE_READ: 'msg_read_report',
                        FILE_READ_AND_WRITE_AUTHKEY: 'authkey',
                        FILE_UPLOAD: 'pic_up',
                        COS_SIGN: 'cos',
                        TIM_WEB_REPORT: 'tim_web_report',
                        BIG_DATA_HALLWAY_AUTH_KEY: 'authkey'
                    },
                    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: 'v1',
                        group_open_long_polling_http_noauth_svc: 'v1',
                        imopenstat: 'v4',
                        im_cos_sign_svr: 'v4',
                        webim: 'v4'
                    }
                };
                Vr.HOST.setCurrent(Vr.HOST.ACCESS_LAYER_TYPES.PRODUCTION);
                var Kr = {
                    request: {
                        toAccount: 'To_Account',
                        fromAccount: 'From_Account',
                        to: 'To_Account',
                        from: 'From_Account',
                        groupID: 'GroupId',
                        avatar: 'FaceUrl'
                    },
                    response: {
                        GroupId: 'groupID',
                        Member_Account: 'userID',
                        MsgList: 'messageList',
                        SyncFlag: 'syncFlag',
                        To_Account: 'to',
                        From_Account: 'from',
                        MsgSeq: 'sequence',
                        MsgRandom: 'random',
                        MsgTimeStamp: 'time',
                        MsgContent: 'content',
                        MsgBody: 'elements',
                        GroupWithdrawInfoArray: 'revokedInfos',
                        WithdrawC2cMsgNotify: 'c2cMessageRevokedNotify',
                        C2cWithdrawInfoArray: 'revokedInfos',
                        MsgRand: 'random',
                        MsgType: 'type',
                        MsgShow: 'messageShow',
                        NextMsgSeq: 'nextMessageSeq',
                        FaceUrl: 'avatar',
                        ProfileDataMod: 'profileModify',
                        Profile_Account: 'userID',
                        ValueBytes: 'value',
                        ValueNum: 'value',
                        NoticeSeq: 'noticeSequence',
                        NotifySeq: 'notifySequence',
                        MsgFrom_AccountExtraInfo: 'messageFromAccountExtraInformation',
                        Operator_Account: 'operatorID',
                        OpType: 'operationType',
                        ReportType: 'operationType',
                        UserId: 'userID',
                        User_Account: 'userID',
                        List_Account: 'userIDList',
                        MsgOperatorMemberExtraInfo: 'operatorInfo',
                        MsgMemberExtraInfo: 'memberInfoList',
                        ImageUrl: 'avatar',
                        NickName: 'nick',
                        MsgGroupNewInfo: 'newGroupProfile',
                        MsgAppDefinedData: 'groupCustomField',
                        Owner_Account: 'ownerID',
                        GroupName: 'name',
                        GroupFaceUrl: 'avatar',
                        GroupIntroduction: 'introduction',
                        GroupNotification: 'notification',
                        GroupApplyJoinOption: 'joinOption',
                        MsgKey: 'messageKey',
                        GroupInfo: 'groupProfile',
                        ShutupTime: 'muteTime',
                        Desc: 'description',
                        Ext: 'extension'
                    },
                    ignoreKeyWord: ['C2C', 'ID', 'USP']
                };
                var jr = '_contextWasUpdated';
                var $r = '_contextWasReset';
                var Yr = '_a2KeyAndTinyIDUpdated';
                var zr = '_specifiedConfigUpdated';
                var Wr = '_noticeIsSynchronizing';
                var Xr = '_noticeIsSynchronized';
                var Jr = '_messageSent';
                var Qr = '_syncMessageProcessing';
                var Zr = '_syncMessageFinished';
                var eo = '_receiveInstantMessage';
                var to = '_receiveGroupInstantMessage';
                var no = '_receveGroupSystemNotice';
                var ro = '_messageRevoked';
                var oo = '_longPollGetIDFailed';
                var io = '_longPollRequestFailed';
                var so = '_longPollResponseOK';
                var ao = '_longPollFastStart';
                var uo = '_longPollSlowStart';
                var lo = '_longPollKickedOut';
                var co = '_longPollMitipuleDeviceKickedOut';
                var po = '_longPollGetNewC2CNotice';
                var ho = '_longPollGetNewGroupMessages';
                var fo = '_longPollGetNewGroupTips';
                var go = '_longPollGetNewGroupNotice';
                var mo = '_longPollGetNewFriendMessages';
                var yo = '_longPollProfileModified';
                var vo = '_longPollNoticeReceiveSystemOrders';
                var _o = ' _longpollGroupMessageRevoked';
                var Co = '_longpollC2CMessageRevoked';
                var Mo = '_avlongPollRequestFailed';
                var Io = '_avlongPollResponseOK';
                var So = '_onGroupListUpdated';
                var Do = '_loginSuccess';
                var To = '_signLogoutExcuting';
                var Eo = '_logoutSuccess';
                var ko = '_a2keyExpired';
                var Ao = '_errorHasBeenDetected';
                var wo = '_onConversationListUpdated';
                var Ro = '_onConversationListProfileUpdated';
                var Oo = '_conversationDeleted';
                var Lo = 'onProfileUpdated';
                var No = 'joinAVChatRoomSuccess';
                var bo = 'joinAVChatRoomSuccessNoAuth';
                var Po = '_sdkStateReady';
                function Go(e, t) {
                    if ('string' != typeof e && !Array.isArray(e)) {
                        throw new TypeError('Expected the input to be `string | string[]`');
                    }
                    t = Object.assign(
                        {
                            pascalCase: false
                        },
                        t
                    );
                    var n;
                    return 0 ===
                        (e = Array.isArray(e)
                            ? e
                                  .map(function (e) {
                                      return e.trim();
                                  })
                                  .filter(function (e) {
                                      return e.length;
                                  })
                                  .join('-')
                            : e.trim()).length
                        ? ''
                        : 1 === e.length
                        ? t.pascalCase
                            ? e.toUpperCase()
                            : e.toLowerCase()
                        : (e !== e.toLowerCase() && (e = Uo(e)),
                          (e = e
                              .replace(/^[_.\- ]+/, '')
                              .toLowerCase()
                              .replace(/[_.\- ]+(\w|$)/g, function (e, t) {
                                  return t.toUpperCase();
                              })
                              .replace(/\d+(\w|$)/g, function (e) {
                                  return e.toUpperCase();
                              })),
                          (n = e),
                          t.pascalCase ? n.charAt(0).toUpperCase() + n.slice(1) : n);
                }
                var Uo = function (e) {
                    for (var t = false, n = false, r = false, o = 0; o < e.length; o++) {
                        var i = e[o];
                        t && /[a-zA-Z]/.test(i) && i.toUpperCase() === i
                            ? ((e = e.slice(0, o) + '-' + e.slice(o)), (t = false), (r = n), (n = true), o++)
                            : n && r && /[a-zA-Z]/.test(i) && i.toLowerCase() === i
                            ? ((e = e.slice(0, o - 1) + '-' + e.slice(o - 1)), (r = n), (n = false), (t = true))
                            : ((t = i.toLowerCase() === i && i.toUpperCase() !== i), (r = n), (n = i.toUpperCase() === i && i.toLowerCase() !== i));
                    }
                    return e;
                };
                function qo(e, t, n) {
                    var r = [];
                    var o = 0;
                    var i = (function e(t, n) {
                        if (++o > 10) {
                            o--;
                            return t;
                        }
                        if (re(t)) {
                            var i = t.map(function (t) {
                                return te(t) ? e(t, n) : t;
                            });
                            o--;
                            return i;
                        }
                        if (te(t)) {
                            var s =
                                ((a = t),
                                (u = function (e, t) {
                                    if (!le(t)) {
                                        return false;
                                    }
                                    if ((s = t) !== Go(s)) {
                                        for (var o = true, i = 0; i < Kr.ignoreKeyWord.length; i++) {
                                            if (t.includes(Kr.ignoreKeyWord[i])) {
                                                o = false;
                                                break;
                                            }
                                        }
                                        if (o) {
                                            r.push(t);
                                        }
                                    }
                                    var s;
                                    return oe(n[t])
                                        ? (function (e) {
                                              return e[0].toUpperCase() + Go(e).slice(1);
                                          })(t)
                                        : n[t];
                                }),
                                (l = Object.create(null)),
                                Object.keys(a).forEach(function (e) {
                                    var t = u(a[e], e);
                                    if (t) {
                                        l[t] = a[e];
                                    }
                                }),
                                l);
                            s = ke(s, function (t, r) {
                                return re(t) || te(t) ? e(t, n) : t;
                            });
                            o--;
                            return s;
                        }
                        var a;
                        var u;
                        var l;
                    })(e, (t = u({}, Kr.request, {}, t)));
                    if (r.length > 0) {
                        n.innerEmitter.emit(Ao, {
                            code: dn,
                            message: Ir
                        });
                    }
                    return i;
                }
                function xo(e, t) {
                    t = u({}, Kr.response, {}, t);
                    if (re(e)) {
                        return e.map(function (e) {
                            return te(e) ? xo(e, t) : e;
                        });
                    }
                    if (te(e)) {
                        var n =
                            ((r = e),
                            (o = function (e, n) {
                                return oe(t[n]) ? Go(n) : t[n];
                            }),
                            (i = {}),
                            Object.keys(r).forEach(function (e) {
                                i[o(r[e], e)] = r[e];
                            }),
                            i);
                        return (n = ke(n, function (e) {
                            return re(e) || te(e) ? xo(e, t) : e;
                        }));
                    }
                    var r;
                    var o;
                    var i;
                }
                var Fo = (function () {
                    function e(t) {
                        var that = this;
                        r(this, e);
                        this.url = '';
                        this.requestData = null;
                        this.method = t.method || 'POST';
                        this.callback = function (e) {
                            return xo((e = t.decode(e)), that._getResponseMap(t));
                        };
                        this._initializeServerMap();
                        this._initializeURL(t);
                        this._initializeRequestData(t);
                    }
                    i(e, [
                        {
                            key: '_initializeServerMap',
                            value: function () {
                                this._serverMap = Object.create(null);
                                var e = '';
                                for (var t in Vr.NAME) {
                                    if (Object.prototype.hasOwnProperty.call(Vr.NAME, t)) {
                                        switch ((e = Vr.NAME[t])) {
                                            case Vr.NAME.PIC:
                                                this._serverMap[e] = Vr.HOST.CURRENT.PIC;
                                                break;
                                            case Vr.NAME.IM_COS_SIGN:
                                                this._serverMap[e] = Vr.HOST.CURRENT.COS;
                                                break;
                                            default:
                                                this._serverMap[e] = Vr.HOST.CURRENT.COMMON;
                                        }
                                    }
                                }
                            }
                        },
                        {
                            key: '_getHost',
                            value: function (e) {
                                if (void 0 !== this._serverMap[e]) {
                                    return this._serverMap[e];
                                }
                                throw new pt({
                                    code: pn,
                                    message: _r
                                });
                            }
                        },
                        {
                            key: '_initializeURL',
                            value: function (e) {
                                var t = e.serverName;
                                var n = e.cmd;
                                var r = this._getHost(t);
                                var o = ''.concat(r, '/').concat(Vr.NAME_VERSION[t], '/').concat(t, '/').concat(n);
                                o += '?'.concat(this._getQueryString(e.queryString));
                                this.url = o;
                            }
                        },
                        {
                            key: 'getUrl',
                            value: function () {
                                return this.url.replace(/&reqtime=(\d+)/, '&reqtime='.concat(Math.ceil(+new Date() / 1000)));
                            }
                        },
                        {
                            key: '_initializeRequestData',
                            value: function (e) {
                                var t;
                                var n = e.requestData;
                                t = this._requestDataCleaner(n);
                                this.requestData = e.encode(t);
                            }
                        },
                        {
                            key: '_requestDataCleaner',
                            value: function (e) {
                                var t = Array.isArray(e) ? [] : Object.create(null);
                                for (var r in e) {
                                    if (Object.prototype.hasOwnProperty.call(e, r) && le(r) && null !== e[r]) {
                                        'object' !== n(e[r]) ? (t[r] = e[r]) : (t[r] = this._requestDataCleaner.bind(this)(e[r]));
                                    }
                                }
                                return t;
                            }
                        },
                        {
                            key: '_getQueryString',
                            value: function (e) {
                                var t = [];
                                for (var n in e) {
                                    if (Object.prototype.hasOwnProperty.call(e, n)) {
                                        'function' != typeof e[n] ? t.push(''.concat(n, '=').concat(e[n])) : t.push(''.concat(n, '=').concat(e[n]()));
                                    }
                                }
                                return t.join('&');
                            }
                        },
                        {
                            key: '_getResponseMap',
                            value: function (e) {
                                if (e.keyMaps && e.keyMaps.response && Object.keys(e.keyMaps.response).length > 0) {
                                    return e.keyMaps.response;
                                }
                            }
                        }
                    ]);
                    return e;
                })();
                function Ho(e) {
                    this.mixin(e);
                }
                Ho.mixin = function (e) {
                    var t = e.prototype || e;
                    t._isReady = false;
                    t.ready = function (e) {
                        var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
                        if (e) {
                            return this._isReady ? void (t ? e.call(this) : setTimeout(e, 1)) : ((this._readyQueue = this._readyQueue || []), void this._readyQueue.push(e));
                        }
                    };
                    t.triggerReady = function () {
                        var that = this;
                        this._isReady = true;
                        setTimeout(function () {
                            var t = that._readyQueue;
                            that._readyQueue = [];
                            if (t && t.length > 0) {
                                t.forEach(function (e) {
                                    e.call(this);
                                }, that);
                            }
                        }, 1);
                    };
                    t.resetReady = function () {
                        this._isReady = false;
                        this._readyQueue = [];
                    };
                    t.isReady = function () {
                        return this._isReady;
                    };
                };
                var Bo = (function () {
                    function e(t) {
                        r(this, e);
                        Ho.mixin(this);
                        this.tim = t;
                    }
                    i(e, [
                        {
                            key: 'isLoggedIn',
                            value: function () {
                                return this.tim.context.login === be.IS_LOGIN || !!this.tim.context.a2Key;
                            }
                        },
                        {
                            key: 'createTransportCapsule',
                            value: function (e) {
                                var t = this.tim.packageConfig.get(e);
                                return t ? new Fo(t) : null;
                            }
                        },
                        {
                            key: 'request',
                            value: function (e) {
                                var t = this.createTransportCapsule(e);
                                t || J.error('unknown transport capsule, please check!', e);
                                return this.tim.connectionController.request(t);
                            }
                        },
                        {
                            key: 'emitInnerEvent',
                            value: function (e, t) {
                                this.tim.innerEmitter.emit(e, t);
                            }
                        },
                        {
                            key: 'emitOuterEvent',
                            value: function (e, t) {
                                this.tim.outerEmitter.emit(e, t);
                            }
                        },
                        {
                            key: 'reset',
                            value: function () {
                                J.warn(['method: IMController.reset() method must be implemented'].join());
                            }
                        },
                        {
                            key: 'probeNetwork',
                            value: function () {
                                return this.tim.netMonitor.probe();
                            }
                        },
                        {
                            key: 'getNetworkType',
                            value: function () {
                                return this.tim.netMonitor.getNetworkType();
                            }
                        },
                        {
                            key: 'getPlatform',
                            value: function () {
                                var e = 'web';
                                B ? (e = 'wechat') : O && (e = 'wxmp');
                                return e;
                            }
                        }
                    ]);
                    return e;
                })();
                var Vo = (function () {
                    function e(t, n) {
                        r(this, e);
                        this.setData(t);
                        this._innerEmitter = n;
                        this.defaultData = {};
                        Object.assign(this.defaultData, t);
                        this.initGetterAndSetter();
                    }
                    i(e, [
                        {
                            key: 'initGetterAndSetter',
                            value: function () {
                                var that = this;
                                var t = function (t) {
                                    Object.defineProperty(that, t, {
                                        enumerable: true,
                                        configurable: true,
                                        get: function () {
                                            return that[t];
                                        },
                                        set: function (n) {
                                            if (that[t] !== n) {
                                                that[t] = n;
                                                that.onChange.bind(that)(t, n);
                                            }
                                        }
                                    });
                                };
                                for (var n in that) {
                                    if (Object.prototype.hasOwnProperty.call(that, n)) {
                                        t(n);
                                    }
                                }
                            }
                        },
                        {
                            key: 'onChange',
                            value: function (e, t) {
                                this._innerEmitter.emit(jr, {
                                    key: e,
                                    value: t
                                });
                            }
                        },
                        {
                            key: 'reset',
                            value: function () {
                                for (var e in (J.log('Context.reset'), this)) {
                                    if (Object.prototype.hasOwnProperty.call(this, e)) {
                                        this[e] = this.defaultData.hasOwnProperty(e) ? this.defaultData[e] : null;
                                    }
                                }
                            }
                        }
                    ]);
                    return e;
                })();
                var Ko = (function (e) {
                    l(n, e);
                    var t = y(n);
                    function n(e) {
                        var o;
                        r(this, n);
                        var i = (o = t.call(this, e)).tim.loginInfo;
                        o._context = new Vo(
                            {
                                login: be.IS_NOT_LOGIN,
                                SDKAppID: i.SDKAppID,
                                appIDAt3rd: null,
                                accountType: i.accountType,
                                identifier: i.identifier,
                                tinyID: null,
                                identifierNick: i.identifierNick,
                                userSig: i.userSig,
                                a2Key: null,
                                contentType: 'json',
                                apn: 1
                            },
                            o.tim.innerEmitter
                        );
                        o._initListener();
                        return o;
                    }
                    i(n, [
                        {
                            key: 'reset',
                            value: function () {
                                this._context.reset();
                                this.emitInnerEvent($r);
                            }
                        },
                        {
                            key: '_initListener',
                            value: function () {
                                this.tim.innerEmitter.on(jr, this._onContextMemberChange, this);
                                this.tim.innerEmitter.on(Do, this._updateA2KeyAndTinyID, this);
                            }
                        },
                        {
                            key: '_updateA2KeyAndTinyID',
                            value: function (e) {
                                var t = e.data;
                                var n = t.a2Key;
                                var r = t.tinyID;
                                this._context.a2Key = n;
                                this._context.tinyID = r;
                                this.emitInnerEvent(Yr);
                                this.triggerReady();
                            }
                        },
                        {
                            key: 'getContext',
                            value: function () {
                                return this._context;
                            }
                        },
                        {
                            key: '_onContextMemberChange',
                            value: function (e) {
                                var t = e.data;
                                var n = t.key;
                                var r = t.value;
                                if ('tinyID' === n || 'a2Key' === n) {
                                    r.length <= 0 ? (this._context.login = be.IS_NOT_LOGIN) : (this._context.login = null !== this._context.a2Key ? be.IS_LOGIN : be.IS_NOT_LOGIN);
                                }
                            }
                        }
                    ]);
                    return n;
                })(Bo);
                var jo = function e(t) {
                    r(this, e);
                    this.code = 0;
                    this.setData(t || {});
                };
                var $o = null;
                var Yo = function (e) {
                    $o = e;
                };
                var zo = function (e) {
                    return e instanceof jo
                        ? (J.warn('IMPromise.resolve 此函数会自动用options创建IMResponse实例，调用侧不需创建，建议修改！'), Promise.resolve(e))
                        : Promise.resolve(new jo(e));
                };
                var Wo = function (t) {
                    var n = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
                    if (t instanceof pt) {
                        if (n && null !== $o) {
                            $o.emit(e.ERROR, t);
                        }
                        return Promise.reject(t);
                    }
                    if (t instanceof Error) {
                        var r = new pt({
                            code: yn,
                            message: t.message
                        });
                        if (n && null !== $o) {
                            $o.emit(e.ERROR, r);
                        }
                        return Promise.reject(r);
                    }
                    if (oe(t) || oe(t.code) || oe(t.message)) {
                        J.error('IMPromise.reject 必须指定code(错误码)和message(错误信息)!!!');
                    } else {
                        if (Z(t.code) && ee(t.message)) {
                            var o = new pt(t);
                            if (n && null !== $o) {
                                $o.emit(e.ERROR, o);
                            }
                            return Promise.reject(o);
                        }
                        J.error('IMPromise.reject code(错误码)必须为数字，message(错误信息)必须为字符串!!!');
                    }
                };
                var Xo = 'sdkReady';
                var Jo = 'login';
                var Qo = 'longpolling';
                var Zo = 'longpollingAV';
                var ei = 'sendMessage';
                var ti = 'initConversationList';
                var ni = 'initGroupList';
                var ri = 'upload';
                var oi = (function () {
                    function e() {
                        r(this, e);
                        this.SDKAppID = '';
                        this.version = '';
                        this.tinyID = '';
                        this.userID = '';
                        this.platform = '';
                        this.method = '';
                        this.time = '';
                        this.startts = 0;
                        this.endts = 0;
                        this.timespan = 0;
                        this.codeint = 0;
                        this.message = '';
                        this.text = '';
                        this.msgType = '';
                        this.networkType = '';
                        this.platform = '';
                        this._sentFlag = false;
                    }
                    i(
                        e,
                        [
                            {
                                key: 'setCommonInfo',
                                value: function (e, t, n, r, o) {
                                    this.SDKAppID = ''.concat(e);
                                    this.version = ''.concat(t);
                                    this.tinyID = n;
                                    this.userID = r;
                                    this.platform = o;
                                    this.time = de();
                                    if (this.startts && this.endts && !this.timespan) {
                                        this.timespan = Math.abs(this.endts - this.startts);
                                    }
                                }
                            },
                            {
                                key: 'setMethod',
                                value: function (e) {
                                    this.method = e;
                                    return this;
                                }
                            },
                            {
                                key: 'setStart',
                                value: function () {
                                    this.startts = Date.now();
                                }
                            },
                            {
                                key: 'setEnd',
                                value: function () {
                                    var that = this;
                                    var t = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];
                                    this._sentFlag ||
                                        ((this.endts = Date.now()),
                                        t
                                            ? ((this._sentFlag = true), this._eventStatController.pushIn(this))
                                            : setTimeout(function () {
                                                  that._sentFlag = true;
                                                  that._eventStatController.pushIn(that);
                                              }, 0));
                                }
                            },
                            {
                                key: 'setError',
                                value: function (e, t, n) {
                                    return e instanceof Error
                                        ? (this._sentFlag ||
                                              (this.setNetworkType(n),
                                              t ? (e.code && this.setCode(e.code), e.message && this.setMessage(e.message)) : (this.setCode(fn), this.setMessage(Mr))),
                                          this)
                                        : (J.warn('SSOLogData.setError value not instanceof Error, please check!'), this);
                                }
                            },
                            {
                                key: 'setCode',
                                value: function (e) {
                                    oe(e) || this._sentFlag || (Z(e) ? (this.codeint = e) : J.warn('SSOLogData.setCode value not a number, please check!'));
                                    return this;
                                }
                            },
                            {
                                key: 'setMessage',
                                value: function (e) {
                                    return oe(e) || this._sentFlag ? this : ee(e) ? ((this.message = e), this) : this;
                                }
                            },
                            {
                                key: 'setText',
                                value: function (e) {
                                    Z(e) ? (this.text = e.toString()) : ee(e) && (this.text = e);
                                    return this;
                                }
                            },
                            {
                                key: 'setMessageType',
                                value: function (e) {
                                    this.msgType = e;
                                    return this;
                                }
                            },
                            {
                                key: 'setNetworkType',
                                value: function (e) {
                                    oe(e) ? J.warn('SSOLogData.setNetworkType value is undefined, please check!') : (this.networkType = e);
                                    return this;
                                }
                            }
                        ],
                        [
                            {
                                key: 'bindController',
                                value: function (t) {
                                    e.prototype._eventStatController = t;
                                }
                            }
                        ]
                    );
                    return e;
                })();
                var ii = 'sdkConstruct';
                var si = 'sdkReady';
                var ai = 'accessLayer';
                var ui = 'login';
                var li = 'getCosAuthKey';
                var ci = 'upload';
                var pi = 'sendMessage';
                var hi = 'getC2CRoamingMessages';
                var fi = 'getGroupRoamingMessages';
                var di = 'revokeMessage';
                var gi = 'setC2CMessageRead';
                var mi = 'setGroupMessageRead';
                var yi = 'getConversationList';
                var vi = 'getConversationListInStorage';
                var _i = 'syncConversationList';
                var Ci = 'createGroup';
                var Mi = 'applyJoinGroup';
                var Ii = 'quitGroup';
                var Si = 'changeGroupOwner';
                var Di = 'dismissGroup';
                var Ti = 'updateGroupProfile';
                var Ei = 'getGroupList';
                var ki = 'getGroupListInStorage';
                var Ai = 'getGroupLastSequence';
                var wi = 'setGroupMemberMuteTime';
                var Ri = 'setGroupMemberNameCard';
                var Oi = 'setGroupMemberRole';
                var Li = 'setGroupMemberCustomField';
                var Ni = 'getLongPollID';
                var bi = 'longPollingError';
                var Pi = 'networkJitter';
                var Gi = 'fastStart';
                var Ui = 'slowStart';
                var qi = 'getUserProfile';
                var xi = 'getBlacklist';
                var Fi = 'mpHideToShow';
                var Hi = (function (n) {
                    l(s, n);
                    var o = y(s);
                    function s(e) {
                        var t;
                        r(this, s);
                        (t = o.call(this, e))._initializeListener();
                        return t;
                    }
                    i(s, [
                        {
                            key: 'login',
                            value: function (e) {
                                if (this.isLoggedIn()) {
                                    var t = '您已经登录账号'.concat(e.identifier, '！如需切换账号登录，请先调用 logout 接口登出，再调用 login 接口登录。');
                                    J.warn(t);
                                    return zo({
                                        actionStatus: 'OK',
                                        errorCode: 0,
                                        errorInfo: t,
                                        repeatLogin: true
                                    });
                                }
                                J.log('SignController.login userID=', e.identifier);
                                J.time(Jo);
                                var n = this._checkLoginInfo(e);
                                return we(n)
                                    ? ((this.tim.context.identifier = e.identifier),
                                      (this.tim.context.userSig = e.userSig),
                                      this.tim.context.identifier && this.tim.context.userSig ? this._accessLayer() : void 0)
                                    : Wo(n);
                            }
                        },
                        {
                            key: '_isLoginCurrentUser',
                            value: function (e) {
                                return this.tim.context.identifier === e;
                            }
                        },
                        {
                            key: '_initializeListener',
                            value: function () {
                                var e = this.tim.innerEmitter;
                                e.on(lo, this._onKickedOut, this);
                                e.on(co, this._onMultipleDeviceKickedOut, this);
                                e.on(ko, this._onUserSigExpired, this);
                            }
                        },
                        {
                            key: '_accessLayer',
                            value: function () {
                                var that = this;
                                var t = new oi();
                                t.setMethod(ai).setStart();
                                J.log('SignController._accessLayer.');
                                return this.request({
                                    name: 'accessLayer',
                                    action: 'query'
                                })
                                    .then(function (n) {
                                        t.setCode(0).setNetworkType(that.getNetworkType()).setText(n.data.webImAccessLayer).setEnd();
                                        J.log('SignController._accessLayer ok. webImAccessLayer='.concat(n.data.webImAccessLayer));
                                        if (1 === n.data.webImAccessLayer) {
                                            Vr.HOST.setCurrent(n.data.webImAccessLayer);
                                        }
                                        return that._login();
                                    })
                                    .catch(function (n) {
                                        that.probeNetwork().then(function (r) {
                                            var o = v(r, 2);
                                            var i = o[0];
                                            var s = o[1];
                                            t.setError(n, i, s).setEnd(true);
                                            that.tim.eventStatController.reportAtOnce();
                                        });
                                        J.error('SignController._accessLayer failed. error:'.concat(n));
                                        return Wo(n);
                                    });
                            }
                        },
                        {
                            key: '_login',
                            value: function () {
                                var that = this;
                                var t = new oi();
                                t.setMethod(ui).setStart();
                                return this.request({
                                    name: 'login',
                                    action: 'query'
                                })
                                    .then(function (n) {
                                        var r = null;
                                        if (!n.data.tinyID) {
                                            throw (
                                                ((r = new pt({
                                                    code: mt,
                                                    message: kn
                                                })),
                                                t.setError(r, true, that.getNetworkType()).setEnd(),
                                                r)
                                            );
                                        }
                                        if (!n.data.a2Key) {
                                            throw (
                                                ((r = new pt({
                                                    code: yt,
                                                    message: An
                                                })),
                                                t.setError(r, true, that.getNetworkType()).setEnd(),
                                                r)
                                            );
                                        }
                                        t.setCode(0).setNetworkType(that.getNetworkType()).setText(''.concat(that.tim.loginInfo.identifier)).setEnd();
                                        J.log('SignController.login ok. userID='.concat(that.tim.loginInfo.identifier, ' loginCost=').concat(J.timeEnd(Jo), 'ms'));
                                        that.emitInnerEvent(Do, {
                                            a2Key: n.data.a2Key,
                                            tinyID: n.data.tinyID
                                        });
                                        return zo(n.data);
                                    })
                                    .catch(function (n) {
                                        that.probeNetwork().then(function (e) {
                                            var r = v(e, 2);
                                            var o = r[0];
                                            var i = r[1];
                                            t.setError(n, o, i).setEnd(true);
                                        });
                                        J.error('SignController.login failed. error:'.concat(n));
                                        return Wo(n);
                                    });
                            }
                        },
                        {
                            key: 'logout',
                            value: function () {
                                J.info('SignController.logout');
                                this.emitInnerEvent(To);
                                return this._logout(Qe).then(this._emitLogoutSuccess.bind(this)).catch(this._emitLogoutSuccess.bind(this));
                            }
                        },
                        {
                            key: '_logout',
                            value: function (e) {
                                var t = this.tim.notificationController;
                                var n = e === Je ? 'logout' : 'longPollLogout';
                                var r =
                                    e === Je
                                        ? {
                                              name: n,
                                              action: 'query'
                                          }
                                        : {
                                              name: n,
                                              action: 'query',
                                              param: {
                                                  longPollID: t.getLongPollID()
                                              }
                                          };
                                return this.request(r).catch(function (e) {
                                    J.error('SignController._logout error:', e);
                                    return Wo(e);
                                });
                            }
                        },
                        {
                            key: '_checkLoginInfo',
                            value: function (e) {
                                var t = 0;
                                var n = '';
                                null === e.SDKAppID
                                    ? ((t = ht), (n = Sn))
                                    : null === e.accountType
                                    ? ((t = ft), (n = Dn))
                                    : null === e.identifier
                                    ? ((t = dt), (n = Tn))
                                    : null === e.userSig && ((t = gt), (n = En));
                                return we(t) || we(n)
                                    ? {}
                                    : {
                                          code: t,
                                          message: n
                                      };
                            }
                        },
                        {
                            key: '_emitLogoutSuccess',
                            value: function () {
                                this.emitInnerEvent(Eo);
                                return zo({});
                            }
                        },
                        {
                            key: '_onKickedOut',
                            value: function () {
                                var that = this;
                                J.warn('SignController._onKickedOut kicked out. userID='.concat(this.tim.loginInfo.identifier));
                                this.tim.logout().then(function () {
                                    that.emitOuterEvent(e.KICKED_OUT, {
                                        type: t.KICKED_OUT_MULT_ACCOUNT
                                    });
                                });
                            }
                        },
                        {
                            key: '_onMultipleDeviceKickedOut',
                            value: function () {
                                var that = this;
                                J.warn('SignController._onMultipleDeviceKickedOut kicked out. userID='.concat(this.tim.loginInfo.identifier));
                                this.tim.logout().then(function () {
                                    that.emitOuterEvent(e.KICKED_OUT, {
                                        type: t.KICKED_OUT_MULT_DEVICE
                                    });
                                });
                            }
                        },
                        {
                            key: '_onUserSigExpired',
                            value: function () {
                                J.warn('SignController._onUserSigExpired: userSig 签名过期被踢下线');
                                this.emitOuterEvent(e.KICKED_OUT, {
                                    type: t.KICKED_OUT_USERSIG_EXPIRED
                                });
                                this.tim.resetSDK();
                            }
                        },
                        {
                            key: 'reset',
                            value: function () {
                                J.info('SignController.reset');
                            }
                        }
                    ]);
                    return s;
                })(Bo);
                var Bi = function (e, t) {
                    return function () {
                        for (var n = new Array(arguments.length), r = 0; r < n.length; r++) {
                            n[r] = arguments[r];
                        }
                        return e.apply(t, n);
                    };
                };
                var Vi = Object.prototype.toString;
                function Ki(e) {
                    return '[object Array]' === Vi.call(e);
                }
                function ji(e) {
                    return void 0 === e;
                }
                function $i(e) {
                    return null !== e && 'object' == typeof e;
                }
                function Yi(e) {
                    return '[object Function]' === Vi.call(e);
                }
                function zi(e, t) {
                    if (null != e) {
                        if ('object' != typeof e) {
                            e = [e];
                        }
                        if (Ki(e)) {
                            for (var n = 0, r = e.length; n < r; n++) {
                                t.call(null, e[n], n, e);
                            }
                        } else {
                            for (var o in e) {
                                if (Object.prototype.hasOwnProperty.call(e, o)) {
                                    t.call(null, e[o], o, e);
                                }
                            }
                        }
                    }
                }
                var Wi = {
                    isArray: Ki,
                    isArrayBuffer: function (e) {
                        return '[object ArrayBuffer]' === Vi.call(e);
                    },
                    isBuffer: function (e) {
                        return null !== e && !ji(e) && null !== e.constructor && !ji(e.constructor) && 'function' == typeof e.constructor.isBuffer && e.constructor.isBuffer(e);
                    },
                    isFormData: function (e) {
                        return 'undefined' != typeof FormData && e instanceof FormData;
                    },
                    isArrayBufferView: function (e) {
                        return 'undefined' != typeof ArrayBuffer && ArrayBuffer.isView ? ArrayBuffer.isView(e) : e && e.buffer && e.buffer instanceof ArrayBuffer;
                    },
                    isString: function (e) {
                        return 'string' == typeof e;
                    },
                    isNumber: function (e) {
                        return 'number' == typeof e;
                    },
                    isObject: $i,
                    isUndefined: ji,
                    isDate: function (e) {
                        return '[object Date]' === Vi.call(e);
                    },
                    isFile: function (e) {
                        return '[object File]' === Vi.call(e);
                    },
                    isBlob: function (e) {
                        return '[object Blob]' === Vi.call(e);
                    },
                    isFunction: Yi,
                    isStream: function (e) {
                        return $i(e) && Yi(e.pipe);
                    },
                    isURLSearchParams: function (e) {
                        return 'undefined' != typeof URLSearchParams && e instanceof URLSearchParams;
                    },
                    isStandardBrowserEnv: function () {
                        return (
                            ('undefined' == typeof navigator || ('ReactNative' !== navigator.product && 'NativeScript' !== navigator.product && 'NS' !== navigator.product)) &&
                            'undefined' != typeof window &&
                            'undefined' != typeof document
                        );
                    },
                    forEach: zi,
                    merge: function e() {
                        var t = {};
                        function n(n, r) {
                            'object' == typeof t[r] && 'object' == typeof n ? (t[r] = e(t[r], n)) : (t[r] = n);
                        }
                        for (var r = 0, o = arguments.length; r < o; r++) {
                            zi(arguments[r], n);
                        }
                        return t;
                    },
                    deepMerge: function e() {
                        var t = {};
                        function n(n, r) {
                            'object' == typeof t[r] && 'object' == typeof n ? (t[r] = e(t[r], n)) : (t[r] = 'object' == typeof n ? e({}, n) : n);
                        }
                        for (var r = 0, o = arguments.length; r < o; r++) {
                            zi(arguments[r], n);
                        }
                        return t;
                    },
                    extend: function (e, t, n) {
                        zi(t, function (t, r) {
                            e[r] = n && 'function' == typeof t ? Bi(t, n) : t;
                        });
                        return e;
                    },
                    trim: function (e) {
                        return e.replace(/^\s*/, '').replace(/\s*$/, '');
                    }
                };
                function Xi(e) {
                    return encodeURIComponent(e)
                        .replace(/%40/gi, '@')
                        .replace(/%3A/gi, ':')
                        .replace(/%24/g, '$')
                        .replace(/%2C/gi, ',')
                        .replace(/%20/g, '+')
                        .replace(/%5B/gi, '[')
                        .replace(/%5D/gi, ']');
                }
                var Ji = function (e, t, n) {
                    if (!t) {
                        return e;
                    }
                    var r;
                    if (n) r = n(t);
                    else if (Wi.isURLSearchParams(t)) {
                        r = t.toString();
                    } else {
                        var o = [];
                        Wi.forEach(t, function (e, t) {
                            if (null != e) {
                                Wi.isArray(e) ? (t += '[]') : (e = [e]);
                                Wi.forEach(e, function (e) {
                                    Wi.isDate(e) ? (e = e.toISOString()) : Wi.isObject(e) && (e = JSON.stringify(e));
                                    o.push(Xi(t) + '=' + Xi(e));
                                });
                            }
                        });
                        r = o.join('&');
                    }
                    if (r) {
                        var i = e.indexOf('#');
                        if (-1 !== i) {
                            e = e.slice(0, i);
                        }
                        e += (-1 === e.indexOf('?') ? '?' : '&') + r;
                    }
                    return e;
                };
                function Qi() {
                    this.handlers = [];
                }
                Qi.prototype.use = function (e, t) {
                    this.handlers.push({
                        fulfilled: e,
                        rejected: t
                    });
                    return this.handlers.length - 1;
                };
                Qi.prototype.eject = function (e) {
                    if (this.handlers[e]) {
                        this.handlers[e] = null;
                    }
                };
                Qi.prototype.forEach = function (e) {
                    Wi.forEach(this.handlers, function (t) {
                        if (null !== t) {
                            e(t);
                        }
                    });
                };
                var Zi = Qi;
                var es = function (e, t, n) {
                    Wi.forEach(n, function (n) {
                        e = n(e, t);
                    });
                    return e;
                };
                var ts = function (e) {
                    return !(!e || !e.__CANCEL__);
                };
                function ns() {
                    throw new Error('setTimeout has not been defined');
                }
                function rs() {
                    throw new Error('clearTimeout has not been defined');
                }
                var os = ns;
                var is = rs;
                function ss(e) {
                    if (os === setTimeout) {
                        return setTimeout(e, 0);
                    }
                    if ((os === ns || !os) && setTimeout) {
                        os = setTimeout;
                        return setTimeout(e, 0);
                    }
                    try {
                        return os(e, 0);
                    } catch (t) {
                        console.log('CatchClause', t);
                        console.log('CatchClause', t);
                        try {
                            return os.call(null, e, 0);
                        } catch (t) {
                            console.log('CatchClause', t);
                            console.log('CatchClause', t);
                            return os.call(this, e, 0);
                        }
                    }
                }
                if ('function' == typeof V.setTimeout) {
                    os = setTimeout;
                }
                if ('function' == typeof V.clearTimeout) {
                    is = clearTimeout;
                }
                var as;
                var us = [];
                var ls = false;
                var cs = -1;
                function ps() {
                    if (ls && as) {
                        ls = false;
                        as.length ? (us = as.concat(us)) : (cs = -1);
                        if (us.length) {
                            hs();
                        }
                    }
                }
                function hs() {
                    if (!ls) {
                        var e = ss(ps);
                        ls = true;
                        for (var t = us.length; t; ) {
                            for (as = us, us = []; ++cs < t; ) {
                                if (as) {
                                    as[cs].run();
                                }
                            }
                            cs = -1;
                            t = us.length;
                        }
                        as = null;
                        ls = false;
                        (function (e) {
                            if (is === clearTimeout) {
                                return clearTimeout(e);
                            }
                            if ((is === rs || !is) && clearTimeout) {
                                is = clearTimeout;
                                return clearTimeout(e);
                            }
                            try {
                                is(e);
                            } catch (t) {
                                console.log('CatchClause', t);
                                console.log('CatchClause', t);
                                try {
                                    return is.call(null, e);
                                } catch (t) {
                                    console.log('CatchClause', t);
                                    console.log('CatchClause', t);
                                    return is.call(this, e);
                                }
                            }
                        })(e);
                    }
                }
                function fs(e, t) {
                    this.fun = e;
                    this.array = t;
                }
                fs.prototype.run = function () {
                    this.fun.apply(null, this.array);
                };
                function ds() {}
                var gs = ds;
                var ms = ds;
                var ys = ds;
                var vs = ds;
                var _s = ds;
                var Cs = ds;
                var Ms = ds;
                var Is = V.performance || {};
                var Ss =
                    Is.now ||
                    Is.mozNow ||
                    Is.msNow ||
                    Is.oNow ||
                    Is.webkitNow ||
                    function () {
                        return new Date().getTime();
                    };
                var Ds = new Date();
                var Ts = {
                    nextTick: function (e) {
                        var t = new Array(arguments.length - 1);
                        if (arguments.length > 1) {
                            for (var n = 1; n < arguments.length; n++) {
                                t[n - 1] = arguments[n];
                            }
                        }
                        us.push(new fs(e, t));
                        1 !== us.length || ls || ss(hs);
                    },
                    title: 'browser',
                    browser: true,
                    env: {},
                    argv: [],
                    version: '',
                    versions: {},
                    on: gs,
                    addListener: ms,
                    once: ys,
                    off: vs,
                    removeListener: _s,
                    removeAllListeners: Cs,
                    emit: Ms,
                    binding: function (e) {
                        throw new Error('process.binding is not supported');
                    },
                    cwd: function () {
                        return '/';
                    },
                    chdir: function (e) {
                        throw new Error('process.chdir is not supported');
                    },
                    umask: function () {
                        return 0;
                    },
                    hrtime: function (e) {
                        var t = 0.001 * Ss.call(Is);
                        var n = Math.floor(t);
                        var r = Math.floor((t % 1) * 1000000000);
                        if (e) {
                            n -= e[0];
                            if ((r -= e[1]) < 0) {
                                n--, (r += 1000000000);
                            }
                        }
                        return [n, r];
                    },
                    platform: 'browser',
                    release: {},
                    config: {},
                    uptime: function () {
                        return (new Date() - Ds) / 1000;
                    }
                };
                var Es = function (e, t) {
                    Wi.forEach(e, function (n, r) {
                        if (r !== t && r.toUpperCase() === t.toUpperCase()) {
                            e[t] = n;
                            delete e[r];
                        }
                    });
                };
                var ks = function (e, t, n, r, o) {
                    return (function (e, t, n, r, o) {
                        e.config = t;
                        if (n) {
                            e.code = n;
                        }
                        e.request = r;
                        e.response = o;
                        e.isAxiosError = true;
                        e.toJSON = function () {
                            return {
                                message: this.message,
                                name: this.name,
                                description: this.description,
                                number: this.number,
                                fileName: this.fileName,
                                lineNumber: this.lineNumber,
                                columnNumber: this.columnNumber,
                                stack: this.stack,
                                config: this.config,
                                code: this.code
                            };
                        };
                        return e;
                    })(new Error(e), t, n, r, o);
                };
                var As = [
                    'age',
                    'authorization',
                    'content-length',
                    'content-type',
                    'etag',
                    'expires',
                    'from',
                    'host',
                    'if-modified-since',
                    'if-unmodified-since',
                    'last-modified',
                    'location',
                    'max-forwards',
                    'proxy-authorization',
                    'referer',
                    'retry-after',
                    'user-agent'
                ];
                var ws = Wi.isStandardBrowserEnv()
                    ? (function () {
                          var e;
                          var t = /(msie|trident)/i.test(navigator.userAgent);
                          var n = document.createElement('a');
                          function r(e) {
                              var r = e;
                              if (t) {
                                  n.setAttribute('href', r);
                                  r = n.href;
                              }
                              n.setAttribute('href', r);
                              return {
                                  href: n.href,
                                  protocol: n.protocol ? n.protocol.replace(/:$/, '') : '',
                                  host: n.host,
                                  search: n.search ? n.search.replace(/^\?/, '') : '',
                                  hash: n.hash ? n.hash.replace(/^#/, '') : '',
                                  hostname: n.hostname,
                                  port: n.port,
                                  pathname: '/' === n.pathname.charAt(0) ? n.pathname : '/' + n.pathname
                              };
                          }
                          e = r(window.location.href);
                          return function (t) {
                              var n = Wi.isString(t) ? r(t) : t;
                              return n.protocol === e.protocol && n.host === e.host;
                          };
                      })()
                    : function () {
                          return true;
                      };
                var Rs = Wi.isStandardBrowserEnv()
                    ? {
                          write: function (e, t, n, r, o, i) {
                              var s = [];
                              s.push(e + '=' + encodeURIComponent(t));
                              if (Wi.isNumber(n)) {
                                  s.push('expires=' + new Date(n).toGMTString());
                              }
                              if (Wi.isString(r)) {
                                  s.push('path=' + r);
                              }
                              if (Wi.isString(o)) {
                                  s.push('domain=' + o);
                              }
                              if (true === i) {
                                  s.push('secure');
                              }
                              document.cookie = s.join('; ');
                          },
                          read: function (e) {
                              var t = document.cookie.match(new RegExp('(^|;\\s*)(' + e + ')=([^;]*)'));
                              return t ? decodeURIComponent(t[3]) : null;
                          },
                          remove: function (e) {
                              this.write(e, '', Date.now() - 86400000);
                          }
                      }
                    : {
                          write: function () {},
                          read: function () {
                              return null;
                          },
                          remove: function () {}
                      };
                var Os = function (e) {
                    return new Promise(function (t, n) {
                        var r = e.data;
                        var o = e.headers;
                        if (Wi.isFormData(r)) {
                            delete o['Content-Type'];
                        }
                        var i = new XMLHttpRequest();
                        if (e.auth) {
                            var s = e.auth.username || '';
                            var a = e.auth.password || '';
                            o.Authorization = 'Basic ' + btoa(s + ':' + a);
                        }
                        var u;
                        var l;
                        var c =
                            ((u = e.baseURL),
                            (l = e.url),
                            u && !/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(l)
                                ? (function (e, t) {
                                      return t ? e.replace(/\/+$/, '') + '/' + t.replace(/^\/+/, '') : e;
                                  })(u, l)
                                : l);
                        i.open(e.method.toUpperCase(), Ji(c, e.params, e.paramsSerializer), true);
                        i.timeout = e.timeout;
                        i.onreadystatechange = function () {
                            if (i && 4 === i.readyState && (0 !== i.status || (i.responseURL && 0 === i.responseURL.indexOf('file:')))) {
                                var r;
                                var o;
                                var s;
                                var a;
                                var u;
                                var l =
                                    'getAllResponseHeaders' in i
                                        ? ((r = i.getAllResponseHeaders()),
                                          (u = {}),
                                          r
                                              ? (Wi.forEach(r.split('\n'), function (e) {
                                                    a = e.indexOf(':');
                                                    o = Wi.trim(e.substr(0, a)).toLowerCase();
                                                    s = Wi.trim(e.substr(a + 1));
                                                    if (o) {
                                                        if (u[o] && As.indexOf(o) >= 0) {
                                                            return;
                                                        }
                                                        u[o] = 'set-cookie' === o ? (u[o] ? u[o] : []).concat([s]) : u[o] ? u[o] + ', ' + s : s;
                                                    }
                                                }),
                                                u)
                                              : u)
                                        : null;
                                var c = {
                                    data: e.responseType && 'text' !== e.responseType ? i.response : i.responseText,
                                    status: i.status,
                                    statusText: i.statusText,
                                    headers: l,
                                    config: e,
                                    request: i
                                };
                                !(function (e, t, n) {
                                    var r = n.config.validateStatus;
                                    !r || r(n.status) ? e(n) : t(ks('Request failed with status code ' + n.status, n.config, null, n.request, n));
                                })(t, n, c);
                                i = null;
                            }
                        };
                        i.onabort = function () {
                            if (i) {
                                n(ks('Request aborted', e, 'ECONNABORTED', i));
                                i = null;
                            }
                        };
                        i.onerror = function () {
                            n(ks('Network Error', e, null, i));
                            i = null;
                        };
                        i.ontimeout = function () {
                            var t = 'timeout of ' + e.timeout + 'ms exceeded';
                            if (e.timeoutErrorMessage) {
                                t = e.timeoutErrorMessage;
                            }
                            n(ks(t, e, 'ECONNABORTED', i));
                            i = null;
                        };
                        if (Wi.isStandardBrowserEnv()) {
                            var p = Rs;
                            var h = (e.withCredentials || ws(c)) && e.xsrfCookieName ? p.read(e.xsrfCookieName) : void 0;
                            if (h) {
                                o[e.xsrfHeaderName] = h;
                            }
                        }
                        if ('setRequestHeader' in i) {
                            Wi.forEach(o, function (e, t) {
                                void 0 === r && 'content-type' === t.toLowerCase() ? delete o[t] : i.setRequestHeader(t, e);
                            });
                        }
                        Wi.isUndefined(e.withCredentials) || (i.withCredentials = !!e.withCredentials);
                        if (e.responseType) {
                            try {
                                i.responseType = e.responseType;
                            } catch (f) {
                                console.log('CatchClause', f);
                                console.log('CatchClause', f);
                                if ('json' !== e.responseType) {
                                    throw f;
                                }
                            }
                        }
                        if ('function' == typeof e.onDownloadProgress) {
                            i.addEventListener('progress', e.onDownloadProgress);
                        }
                        if ('function' == typeof e.onUploadProgress && i.upload) {
                            i.upload.addEventListener('progress', e.onUploadProgress);
                        }
                        if (e.cancelToken) {
                            e.cancelToken.promise.then(function (e) {
                                if (i) {
                                    i.abort();
                                    n(e);
                                    i = null;
                                }
                            });
                        }
                        if (void 0 === r) {
                            r = null;
                        }
                        i.send(r);
                    });
                };
                var Ls = {
                    'Content-Type': 'application/x-www-form-urlencoded'
                };
                function Ns(e, t) {
                    if (!Wi.isUndefined(e) && Wi.isUndefined(e['Content-Type'])) {
                        e['Content-Type'] = t;
                    }
                }
                var bs;
                var Ps = {
                    adapter: (('undefined' != typeof XMLHttpRequest || (void 0 !== Ts && '[object process]' === Object.prototype.toString.call(Ts))) && (bs = Os), bs),
                    transformRequest: [
                        function (e, t) {
                            Es(t, 'Accept');
                            Es(t, 'Content-Type');
                            return Wi.isFormData(e) || Wi.isArrayBuffer(e) || Wi.isBuffer(e) || Wi.isStream(e) || Wi.isFile(e) || Wi.isBlob(e)
                                ? e
                                : Wi.isArrayBufferView(e)
                                ? e.buffer
                                : Wi.isURLSearchParams(e)
                                ? (Ns(t, 'application/x-www-form-urlencoded;charset=utf-8'), e.toString())
                                : Wi.isObject(e)
                                ? (Ns(t, 'application/json;charset=utf-8'), JSON.stringify(e))
                                : e;
                        }
                    ],
                    transformResponse: [
                        function (e) {
                            if ('string' == typeof e) {
                                try {
                                    e = JSON.parse(e);
                                } catch (t) {
                                    console.log('CatchClause', t);
                                    console.log('CatchClause', t);
                                }
                            }
                            return e;
                        }
                    ],
                    timeout: 0,
                    xsrfCookieName: 'XSRF-TOKEN',
                    xsrfHeaderName: 'X-XSRF-TOKEN',
                    maxContentLength: -1,
                    validateStatus: function (e) {
                        return e >= 200 && e < 300;
                    }
                };
                Ps.headers = {
                    common: {
                        Accept: 'application/json, text/plain, */*'
                    }
                };
                Wi.forEach(['delete', 'get', 'head'], function (e) {
                    Ps.headers[e] = {};
                });
                Wi.forEach(['post', 'put', 'patch'], function (e) {
                    Ps.headers[e] = Wi.merge(Ls);
                });
                var Gs = Ps;
                function Us(e) {
                    if (e.cancelToken) {
                        e.cancelToken.throwIfRequested();
                    }
                }
                var qs = function (e) {
                    Us(e);
                    e.headers = e.headers || {};
                    e.data = es(e.data, e.headers, e.transformRequest);
                    e.headers = Wi.merge(e.headers.common || {}, e.headers[e.method] || {}, e.headers);
                    Wi.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], function (t) {
                        delete e.headers[t];
                    });
                    return (e.adapter || Gs.adapter)(e).then(
                        function (t) {
                            Us(e);
                            t.data = es(t.data, t.headers, e.transformResponse);
                            return t;
                        },
                        function (t) {
                            ts(t) || (Us(e), t && t.response && (t.response.data = es(t.response.data, t.response.headers, e.transformResponse)));
                            return Promise.reject(t);
                        }
                    );
                };
                var xs = function (e, t) {
                    t = t || {};
                    var n = {};
                    var r = ['url', 'method', 'params', 'data'];
                    var o = ['headers', 'auth', 'proxy'];
                    var i = [
                        'baseURL',
                        'url',
                        'transformRequest',
                        'transformResponse',
                        'paramsSerializer',
                        'timeout',
                        'withCredentials',
                        'adapter',
                        'responseType',
                        'xsrfCookieName',
                        'xsrfHeaderName',
                        'onUploadProgress',
                        'onDownloadProgress',
                        'maxContentLength',
                        'validateStatus',
                        'maxRedirects',
                        'httpAgent',
                        'httpsAgent',
                        'cancelToken',
                        'socketPath'
                    ];
                    Wi.forEach(r, function (e) {
                        if (void 0 !== t[e]) {
                            n[e] = t[e];
                        }
                    });
                    Wi.forEach(o, function (r) {
                        Wi.isObject(t[r])
                            ? (n[r] = Wi.deepMerge(e[r], t[r]))
                            : void 0 !== t[r]
                            ? (n[r] = t[r])
                            : Wi.isObject(e[r])
                            ? (n[r] = Wi.deepMerge(e[r]))
                            : void 0 !== e[r] && (n[r] = e[r]);
                    });
                    Wi.forEach(i, function (r) {
                        void 0 !== t[r] ? (n[r] = t[r]) : void 0 !== e[r] && (n[r] = e[r]);
                    });
                    var s = r.concat(o).concat(i);
                    var a = Object.keys(t).filter(function (e) {
                        return -1 === s.indexOf(e);
                    });
                    Wi.forEach(a, function (r) {
                        void 0 !== t[r] ? (n[r] = t[r]) : void 0 !== e[r] && (n[r] = e[r]);
                    });
                    return n;
                };
                function Fs(e) {
                    this.defaults = e;
                    this.interceptors = {
                        request: new Zi(),
                        response: new Zi()
                    };
                }
                Fs.prototype.request = function (e) {
                    'string' == typeof e ? ((e = arguments[1] || {}).url = arguments[0]) : (e = e || {});
                    (e = xs(this.defaults, e)).method
                        ? (e.method = e.method.toLowerCase())
                        : this.defaults.method
                        ? (e.method = this.defaults.method.toLowerCase())
                        : (e.method = 'get');
                    var t = [qs, void 0];
                    var n = Promise.resolve(e);
                    for (
                        this.interceptors.request.forEach(function (e) {
                            t.unshift(e.fulfilled, e.rejected);
                        }),
                            this.interceptors.response.forEach(function (e) {
                                t.push(e.fulfilled, e.rejected);
                            });
                        t.length;

                    ) {
                        n = n.then(t.shift(), t.shift());
                    }
                    return n;
                };
                Fs.prototype.getUri = function (e) {
                    e = xs(this.defaults, e);
                    return Ji(e.url, e.params, e.paramsSerializer).replace(/^\?/, '');
                };
                Wi.forEach(['delete', 'get', 'head', 'options'], function (e) {
                    Fs.prototype[e] = function (t, n) {
                        return this.request(
                            Wi.merge(n || {}, {
                                method: e,
                                url: t
                            })
                        );
                    };
                });
                Wi.forEach(['post', 'put', 'patch'], function (e) {
                    Fs.prototype[e] = function (t, n, r) {
                        return this.request(
                            Wi.merge(r || {}, {
                                method: e,
                                url: t,
                                data: n
                            })
                        );
                    };
                });
                var Hs = Fs;
                function Bs(e) {
                    this.message = e;
                }
                Bs.prototype.toString = function () {
                    return 'Cancel' + (this.message ? ': ' + this.message : '');
                };
                Bs.prototype.__CANCEL__ = true;
                var Vs = Bs;
                function Ks(e) {
                    if ('function' != typeof e) {
                        throw new TypeError('executor must be a function.');
                    }
                    var t;
                    this.promise = new Promise(function (e) {
                        t = e;
                    });
                    var that = this;
                    e(function (e) {
                        that.reason || ((that.reason = new Vs(e)), t(that.reason));
                    });
                }
                Ks.prototype.throwIfRequested = function () {
                    if (this.reason) {
                        throw this.reason;
                    }
                };
                Ks.source = function () {
                    var e;
                    return {
                        token: new Ks(function (t) {
                            e = t;
                        }),
                        cancel: e
                    };
                };
                var js = Ks;
                function $s(e) {
                    var t = new Hs(e);
                    var n = Bi(Hs.prototype.request, t);
                    Wi.extend(n, Hs.prototype, t);
                    Wi.extend(n, t);
                    return n;
                }
                var Ys = $s(Gs);
                Ys.Axios = Hs;
                Ys.create = function (e) {
                    return $s(xs(Ys.defaults, e));
                };
                Ys.Cancel = Vs;
                Ys.CancelToken = js;
                Ys.isCancel = ts;
                Ys.all = function (e) {
                    return Promise.all(e);
                };
                Ys.spread = function (e) {
                    return function (t) {
                        return e.apply(null, t);
                    };
                };
                var zs = Ys;
                var Ws = Ys;
                zs.default = Ws;
                var Xs = zs;
                var Js = Xs.create({
                    timeout: 30000,
                    headers: {
                        'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
                    }
                });
                Js.interceptors.response.use(
                    function (e) {
                        var t = e.data;
                        var n = t.error_code;
                        var r = t.ErrorCode;
                        if (Z(n)) {
                            r = n;
                        }
                        if (r !== Ne.SUCCESS) {
                            e.data.ErrorCode = Number(r);
                        }
                        return e;
                    },
                    function (e) {
                        if ('Network Error' === e.message) {
                            if (true === Js.defaults.withCredentials) {
                                J.warn('Network Error, try to close `IMAxios.defaults.withCredentials` to false. (IMAxios.js)');
                            }
                            Js.defaults.withCredentials = false;
                        }
                        return Promise.reject(e);
                    }
                );
                var Qs = (function () {
                    function e() {
                        r(this, e);
                    }
                    i(e, [
                        {
                            key: 'request',
                            value: function (e) {
                                console.warn('请注意： ConnectionBase.request() 方法必须被派生类重写:');
                                console.log(
                                    '参数如下：\n    * @param {String} options.url string 是 开发者服务器接口地址\n    * @param {*} options.data - string/object/ArrayBuffer 否 请求的参数\n    * @param {Object} options.header - Object 否 设置请求的 header，\n    * @param {String} options.method - string GET 否 HTTP 请求方法\n    * @param {String} options.dataType - string json 否 返回的数据格式\n    * @param {String} options.responseType - string text 否 响应的数据类型\n    * @param {Boolean} isRetry - string text false 是否为重试的请求\n   '
                                );
                            }
                        },
                        {
                            key: '_checkOptions',
                            value: function (e) {
                                if (false == !!e.url) {
                                    throw new pt({
                                        code: cn,
                                        message: vr
                                    });
                                }
                            }
                        },
                        {
                            key: '_initOptions',
                            value: function (e) {
                                e.method = ['POST', 'GET', 'PUT', 'DELETE', 'OPTION'].indexOf(e.method) >= 0 ? e.method : 'POST';
                                e.dataType = e.dataType || 'json';
                                e.responseType = e.responseType || 'json';
                            }
                        }
                    ]);
                    return e;
                })();
                var Zs = (function (e) {
                    l(n, e);
                    var t = y(n);
                    function n() {
                        var e;
                        r(this, n);
                        (e = t.call(this)).retry = 2;
                        return e;
                    }
                    i(n, [
                        {
                            key: 'request',
                            value: function (e) {
                                this._checkOptions(e);
                                this._initOptions(e);
                                return this._requestWithRetry({
                                    url: e.url,
                                    data: e.data,
                                    method: e.method
                                });
                            }
                        },
                        {
                            key: '_requestWithRetry',
                            value: function (e) {
                                var that = this;
                                var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0;
                                return Js(e).catch(function (r) {
                                    return that.retry && n < that.retry
                                        ? that._requestWithRetry(e, ++n)
                                        : Wo(
                                              new pt({
                                                  code: r.code || '',
                                                  message: r.message || ''
                                              })
                                          );
                                });
                            }
                        }
                    ]);
                    return n;
                })(Qs);
                var ea = [];
                var ta = [];
                var na = 'undefined' != typeof Uint8Array ? Uint8Array : Array;
                var ra = false;
                function oa() {
                    ra = true;
                    for (var e = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', t = 0, n = e.length; t < n; ++t) {
                        ea[t] = e[t];
                        ta[e.charCodeAt(t)] = t;
                    }
                    ta['-'.charCodeAt(0)] = 62;
                    ta['_'.charCodeAt(0)] = 63;
                }
                function ia(e, t, n) {
                    for (var r, o, i = [], s = t; s < n; s += 3) {
                        r = (e[s] << 16) + (e[s + 1] << 8) + e[s + 2];
                        i.push(ea[((o = r) >> 18) & 63] + ea[(o >> 12) & 63] + ea[(o >> 6) & 63] + ea[63 & o]);
                    }
                    return i.join('');
                }
                function sa(e) {
                    var t;
                    ra || oa();
                    for (var n = e.length, r = n % 3, o = '', i = [], s = 0, a = n - r; s < a; s += 16383) {
                        i.push(ia(e, s, s + 16383 > a ? a : s + 16383));
                    }
                    1 === r
                        ? ((t = e[n - 1]), (o += ea[t >> 2]), (o += ea[(t << 4) & 63]), (o += '=='))
                        : 2 === r && ((t = (e[n - 2] << 8) + e[n - 1]), (o += ea[t >> 10]), (o += ea[(t >> 4) & 63]), (o += ea[(t << 2) & 63]), (o += '='));
                    i.push(o);
                    return i.join('');
                }
                function aa(e, t, n, r, o) {
                    var i;
                    var s;
                    var a = 8 * o - r - 1;
                    var u = (1 << a) - 1;
                    var l = u >> 1;
                    var c = -7;
                    var p = n ? o - 1 : 0;
                    var h = n ? -1 : 1;
                    var f = e[t + p];
                    for (p += h, i = f & ((1 << -c) - 1), f >>= -c, c += a; c > 0; i = 256 * i + e[t + p], p += h, c -= 8) {}
                    for (s = i & ((1 << -c) - 1), i >>= -c, c += r; c > 0; s = 256 * s + e[t + p], p += h, c -= 8) {}
                    if (0 === i) {
                        i = 1 - l;
                    } else {
                        if (i === u) {
                            return s ? NaN : Infinity * (f ? -1 : 1);
                        }
                        s += Math.pow(2, r);
                        i -= l;
                    }
                    return (f ? -1 : 1) * s * Math.pow(2, i - r);
                }
                function ua(e, t, n, r, o, i) {
                    var s;
                    var a;
                    var u;
                    var l = 8 * i - o - 1;
                    var c = (1 << l) - 1;
                    var p = c >> 1;
                    var h = 23 === o ? Math.pow(2, -24) - Math.pow(2, -77) : 0;
                    var f = r ? 0 : i - 1;
                    var d = r ? 1 : -1;
                    var g = t < 0 || (0 === t && 1 / t < 0) ? 1 : 0;
                    for (
                        t = Math.abs(t),
                            isNaN(t) || Infinity === t
                                ? ((a = isNaN(t) ? 1 : 0), (s = c))
                                : ((s = Math.floor(Math.log(t) / Math.LN2)),
                                  t * (u = Math.pow(2, -s)) < 1 && (s--, (u *= 2)),
                                  (t += s + p >= 1 ? h / u : h * Math.pow(2, 1 - p)) * u >= 2 && (s++, (u /= 2)),
                                  s + p >= c
                                      ? ((a = 0), (s = c))
                                      : s + p >= 1
                                      ? ((a = (t * u - 1) * Math.pow(2, o)), (s += p))
                                      : ((a = t * Math.pow(2, p - 1) * Math.pow(2, o)), (s = 0)));
                        o >= 8;
                        e[n + f] = 255 & a, f += d, a /= 256, o -= 8
                    ) {}
                    for (s = (s << o) | a, l += o; l > 0; e[n + f] = 255 & s, f += d, s /= 256, l -= 8) {}
                    e[n + f - d] |= 128 * g;
                }
                var la = {}.toString;
                var ca =
                    Array.isArray ||
                    function (e) {
                        return '[object Array]' == la.call(e);
                    };
                function pa() {
                    return fa.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823;
                }
                function ha(e, t) {
                    if (pa() < t) {
                        throw new RangeError('Invalid typed array length');
                    }
                    fa.TYPED_ARRAY_SUPPORT ? ((e = new Uint8Array(t)).__proto__ = fa.prototype) : (null === e && (e = new fa(t)), (e.length = t));
                    return e;
                }
                function fa(e, t, n) {
                    if (!(fa.TYPED_ARRAY_SUPPORT || this instanceof fa)) {
                        return new fa(e, t, n);
                    }
                    if ('number' == typeof e) {
                        if ('string' == typeof t) {
                            throw new Error('If encoding is specified then the first argument must be a string');
                        }
                        return ma(this, e);
                    }
                    return da(this, e, t, n);
                }
                function da(e, t, n, r) {
                    if ('number' == typeof t) {
                        throw new TypeError('"value" argument must not be a number');
                    }
                    return 'undefined' != typeof ArrayBuffer && t instanceof ArrayBuffer
                        ? (function (e, t, n, r) {
                              t.byteLength;
                              if (n < 0 || t.byteLength < n) {
                                  throw new RangeError("'offset' is out of bounds");
                              }
                              if (t.byteLength < n + (r || 0)) {
                                  throw new RangeError("'length' is out of bounds");
                              }
                              t = void 0 === n && void 0 === r ? new Uint8Array(t) : void 0 === r ? new Uint8Array(t, n) : new Uint8Array(t, n, r);
                              fa.TYPED_ARRAY_SUPPORT ? ((e = t).__proto__ = fa.prototype) : (e = ya(e, t));
                              return e;
                          })(e, t, n, r)
                        : 'string' == typeof t
                        ? (function (e, t, n) {
                              ('string' == typeof n && '' !== n) || (n = 'utf8');
                              if (!fa.isEncoding(n)) {
                                  throw new TypeError('"encoding" must be a valid string encoding');
                              }
                              var r = 0 | Ca(t, n);
                              var o = (e = ha(e, r)).write(t, n);
                              if (o !== r) {
                                  e = e.slice(0, o);
                              }
                              return e;
                          })(e, t, n)
                        : (function (e, t) {
                              if (_a(t)) {
                                  var n = 0 | va(t.length);
                                  0 === (e = ha(e, n)).length || t.copy(e, 0, 0, n);
                                  return e;
                              }
                              if (t) {
                                  if (('undefined' != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer) || 'length' in t) {
                                      return 'number' != typeof t.length || (r = t.length) != r ? ha(e, 0) : ya(e, t);
                                  }
                                  if ('Buffer' === t.type && ca(t.data)) {
                                      return ya(e, t.data);
                                  }
                              }
                              var r;
                              throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.');
                          })(e, t);
                }
                function ga(e) {
                    if ('number' != typeof e) {
                        throw new TypeError('"size" argument must be a number');
                    }
                    if (e < 0) {
                        throw new RangeError('"size" argument must not be negative');
                    }
                }
                function ma(e, t) {
                    ga(t);
                    e = ha(e, t < 0 ? 0 : 0 | va(t));
                    if (!fa.TYPED_ARRAY_SUPPORT) {
                        for (var n = 0; n < t; ++n) {
                            e[n] = 0;
                        }
                    }
                    return e;
                }
                function ya(e, t) {
                    var n = t.length < 0 ? 0 : 0 | va(t.length);
                    e = ha(e, n);
                    for (var r = 0; r < n; r += 1) {
                        e[r] = 255 & t[r];
                    }
                    return e;
                }
                function va(e) {
                    if (e >= pa()) {
                        throw new RangeError('Attempt to allocate Buffer larger than maximum size: 0x' + pa().toString(16) + ' bytes');
                    }
                    return 0 | e;
                }
                function _a(e) {
                    return !(null == e || !e._isBuffer);
                }
                function Ca(e, t) {
                    if (_a(e)) {
                        return e.length;
                    }
                    if ('undefined' != typeof ArrayBuffer && 'function' == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer)) {
                        return e.byteLength;
                    }
                    if ('string' != typeof e) {
                        e = '' + e;
                    }
                    var n = e.length;
                    if (0 === n) {
                        return 0;
                    }
                    for (var r = false; ; ) {
                        switch (t) {
                            case 'ascii':
                            case 'latin1':
                            case 'binary':
                                return n;
                            case 'utf8':
                            case 'utf-8':
                            case void 0:
                                return $a(e).length;
                            case 'ucs2':
                            case 'ucs-2':
                            case 'utf16le':
                            case 'utf-16le':
                                return 2 * n;
                            case 'hex':
                                return n >>> 1;
                            case 'base64':
                                return Ya(e).length;
                            default:
                                if (r) {
                                    return $a(e).length;
                                }
                                t = ('' + t).toLowerCase();
                                r = true;
                        }
                    }
                }
                function Ma(e, t, n) {
                    var r = false;
                    if (void 0 === t || t < 0) {
                        t = 0;
                    }
                    if (t > this.length) {
                        return '';
                    }
                    if (void 0 === n || n > this.length) {
                        n = this.length;
                    }
                    if (n <= 0) {
                        return '';
                    }
                    if ((n >>>= 0) <= (t >>>= 0)) {
                        return '';
                    }
                    for (e || (e = 'utf8'); ; ) {
                        switch (e) {
                            case 'hex':
                                return Pa(this, t, n);
                            case 'utf8':
                            case 'utf-8':
                                return La(this, t, n);
                            case 'ascii':
                                return Na(this, t, n);
                            case 'latin1':
                            case 'binary':
                                return ba(this, t, n);
                            case 'base64':
                                return Oa(this, t, n);
                            case 'ucs2':
                            case 'ucs-2':
                            case 'utf16le':
                            case 'utf-16le':
                                return Ga(this, t, n);
                            default:
                                if (r) {
                                    throw new TypeError('Unknown encoding: ' + e);
                                }
                                e = (e + '').toLowerCase();
                                r = true;
                        }
                    }
                }
                function Ia(e, t, n) {
                    var r = e[t];
                    e[t] = e[n];
                    e[n] = r;
                }
                function Sa(e, t, n, r, o) {
                    if (0 === e.length) {
                        return -1;
                    }
                    'string' == typeof n ? ((r = n), (n = 0)) : n > 2147483647 ? (n = 2147483647) : n < -2147483648 && (n = -2147483648);
                    n = +n;
                    if (isNaN(n)) {
                        n = o ? 0 : e.length - 1;
                    }
                    if (n < 0) {
                        n = e.length + n;
                    }
                    if (n >= e.length) {
                        if (o) {
                            return -1;
                        }
                        n = e.length - 1;
                    } else if (n < 0) {
                        if (!o) {
                            return -1;
                        }
                        n = 0;
                    }
                    if ('string' == typeof t) {
                        t = fa.from(t, r);
                    }
                    if (_a(t)) {
                        return 0 === t.length ? -1 : Da(e, t, n, r, o);
                    }
                    if ('number' == typeof t) {
                        t &= 255;
                        return fa.TYPED_ARRAY_SUPPORT && 'function' == typeof Uint8Array.prototype.indexOf
                            ? o
                                ? Uint8Array.prototype.indexOf.call(e, t, n)
                                : Uint8Array.prototype.lastIndexOf.call(e, t, n)
                            : Da(e, [t], n, r, o);
                    }
                    throw new TypeError('val must be string, number or Buffer');
                }
                function Da(e, t, n, r, o) {
                    var i;
                    var s = 1;
                    var a = e.length;
                    var u = t.length;
                    if (void 0 !== r && ('ucs2' === (r = String(r).toLowerCase()) || 'ucs-2' === r || 'utf16le' === r || 'utf-16le' === r)) {
                        if (e.length < 2 || t.length < 2) {
                            return -1;
                        }
                        s = 2;
                        a /= 2;
                        u /= 2;
                        n /= 2;
                    }
                    function l(e, t) {
                        return 1 === s ? e[t] : e.readUInt16BE(t * s);
                    }
                    if (o) {
                        var c = -1;
                        for (i = n; i < a; i++) {
                            if (l(e, i) === l(t, -1 === c ? 0 : i - c)) {
                                if (-1 === c) {
                                    c = i;
                                }
                                if (i - c + 1 === u) {
                                    return c * s;
                                }
                            } else {
                                if (-1 !== c) {
                                    i -= i - c;
                                }
                                c = -1;
                            }
                        }
                    } else {
                        for (n + u > a && (n = a - u), i = n; i >= 0; i--) {
                            for (var p = true, h = 0; h < u; h++) {
                                if (l(e, i + h) !== l(t, h)) {
                                    p = false;
                                    break;
                                }
                            }
                            if (p) {
                                return i;
                            }
                        }
                    }
                    return -1;
                }
                function Ta(e, t, n, r) {
                    n = Number(n) || 0;
                    var o = e.length - n;
                    r ? (r = Number(r)) > o && (r = o) : (r = o);
                    var i = t.length;
                    if (i % 2 != 0) {
                        throw new TypeError('Invalid hex string');
                    }
                    if (r > i / 2) {
                        r = i / 2;
                    }
                    for (var s = 0; s < r; ++s) {
                        var a = parseInt(t.substr(2 * s, 2), 16);
                        if (isNaN(a)) {
                            return s;
                        }
                        e[n + s] = a;
                    }
                    return s;
                }
                function Ea(e, t, n, r) {
                    return za($a(t, e.length - n), e, n, r);
                }
                function ka(e, t, n, r) {
                    return za(
                        (function (e) {
                            for (var t = [], n = 0; n < e.length; ++n) {
                                t.push(255 & e.charCodeAt(n));
                            }
                            return t;
                        })(t),
                        e,
                        n,
                        r
                    );
                }
                function Aa(e, t, n, r) {
                    return ka(e, t, n, r);
                }
                function wa(e, t, n, r) {
                    return za(Ya(t), e, n, r);
                }
                function Ra(e, t, n, r) {
                    return za(
                        (function (e, t) {
                            for (var n, r, o, i = [], s = 0; s < e.length && !((t -= 2) < 0); ++s) {
                                n = e.charCodeAt(s);
                                r = n >> 8;
                                o = n % 256;
                                i.push(o);
                                i.push(r);
                            }
                            return i;
                        })(t, e.length - n),
                        e,
                        n,
                        r
                    );
                }
                function Oa(e, t, n) {
                    return 0 === t && n === e.length ? sa(e) : sa(e.slice(t, n));
                }
                function La(e, t, n) {
                    n = Math.min(e.length, n);
                    for (var r = [], o = t; o < n; ) {
                        var i;
                        var s;
                        var a;
                        var u;
                        var l = e[o];
                        var c = null;
                        var p = l > 239 ? 4 : l > 223 ? 3 : l > 191 ? 2 : 1;
                        if (o + p <= n) {
                            switch (p) {
                                case 1:
                                    if (l < 128) {
                                        c = l;
                                    }
                                    break;
                                case 2:
                                    if (128 == (192 & (i = e[o + 1])) && (u = ((31 & l) << 6) | (63 & i)) > 127) {
                                        c = u;
                                    }
                                    break;
                                case 3:
                                    i = e[o + 1];
                                    s = e[o + 2];
                                    if (128 == (192 & i) && 128 == (192 & s) && (u = ((15 & l) << 12) | ((63 & i) << 6) | (63 & s)) > 2047 && (u < 55296 || u > 57343)) {
                                        c = u;
                                    }
                                    break;
                                case 4:
                                    i = e[o + 1];
                                    s = e[o + 2];
                                    a = e[o + 3];
                                    if (
                                        128 == (192 & i) &&
                                        128 == (192 & s) &&
                                        128 == (192 & a) &&
                                        (u = ((15 & l) << 18) | ((63 & i) << 12) | ((63 & s) << 6) | (63 & a)) > 65535 &&
                                        u < 1114112
                                    ) {
                                        c = u;
                                    }
                            }
                        }
                        null === c ? ((c = 65533), (p = 1)) : c > 65535 && ((c -= 65536), r.push(((c >>> 10) & 1023) | 55296), (c = 56320 | (1023 & c)));
                        r.push(c);
                        o += p;
                    }
                    return (function (e) {
                        var t = e.length;
                        if (t <= 4096) {
                            return String.fromCharCode.apply(String, e);
                        }
                        var n = '';
                        var r = 0;
                        for (; r < t; ) {
                            n += String.fromCharCode.apply(String, e.slice(r, (r += 4096)));
                        }
                        return n;
                    })(r);
                }
                fa.TYPED_ARRAY_SUPPORT = void 0 === V.TYPED_ARRAY_SUPPORT || V.TYPED_ARRAY_SUPPORT;
                fa.poolSize = 8192;
                fa._augment = function (e) {
                    e.__proto__ = fa.prototype;
                    return e;
                };
                fa.from = function (e, t, n) {
                    return da(null, e, t, n);
                };
                if (fa.TYPED_ARRAY_SUPPORT) {
                    fa.prototype.__proto__ = Uint8Array.prototype;
                    fa.__proto__ = Uint8Array;
                }
                fa.alloc = function (e, t, n) {
                    return (function (e, t, n, r) {
                        ga(t);
                        return t <= 0 ? ha(e, t) : void 0 !== n ? ('string' == typeof r ? ha(e, t).fill(n, r) : ha(e, t).fill(n)) : ha(e, t);
                    })(null, e, t, n);
                };
                fa.allocUnsafe = function (e) {
                    return ma(null, e);
                };
                fa.allocUnsafeSlow = function (e) {
                    return ma(null, e);
                };
                fa.isBuffer = function (e) {
                    return (
                        null != e &&
                        (!!e._isBuffer ||
                            Wa(e) ||
                            (function (e) {
                                return 'function' == typeof e.readFloatLE && 'function' == typeof e.slice && Wa(e.slice(0, 0));
                            })(e))
                    );
                };
                fa.compare = function (e, t) {
                    if (!_a(e) || !_a(t)) {
                        throw new TypeError('Arguments must be Buffers');
                    }
                    if (e === t) {
                        return 0;
                    }
                    for (var n = e.length, r = t.length, o = 0, i = Math.min(n, r); o < i; ++o) {
                        if (e[o] !== t[o]) {
                            n = e[o];
                            r = t[o];
                            break;
                        }
                    }
                    return n < r ? -1 : r < n ? 1 : 0;
                };
                fa.isEncoding = function (e) {
                    switch (String(e).toLowerCase()) {
                        case 'hex':
                        case 'utf8':
                        case 'utf-8':
                        case 'ascii':
                        case 'latin1':
                        case 'binary':
                        case 'base64':
                        case 'ucs2':
                        case 'ucs-2':
                        case 'utf16le':
                        case 'utf-16le':
                            return true;
                        default:
                            return false;
                    }
                };
                fa.concat = function (e, t) {
                    if (!ca(e)) {
                        throw new TypeError('"list" argument must be an Array of Buffers');
                    }
                    if (0 === e.length) {
                        return fa.alloc(0);
                    }
                    var n;
                    if (void 0 === t) {
                        for (t = 0, n = 0; n < e.length; ++n) {
                            t += e[n].length;
                        }
                    }
                    var r = fa.allocUnsafe(t);
                    var o = 0;
                    for (n = 0; n < e.length; ++n) {
                        var i = e[n];
                        if (!_a(i)) {
                            throw new TypeError('"list" argument must be an Array of Buffers');
                        }
                        i.copy(r, o);
                        o += i.length;
                    }
                    return r;
                };
                fa.byteLength = Ca;
                fa.prototype._isBuffer = true;
                fa.prototype.swap16 = function () {
                    var e = this.length;
                    if (e % 2 != 0) {
                        throw new RangeError('Buffer size must be a multiple of 16-bits');
                    }
                    for (var t = 0; t < e; t += 2) {
                        Ia(this, t, t + 1);
                    }
                    return this;
                };
                fa.prototype.swap32 = function () {
                    var e = this.length;
                    if (e % 4 != 0) {
                        throw new RangeError('Buffer size must be a multiple of 32-bits');
                    }
                    for (var t = 0; t < e; t += 4) {
                        Ia(this, t, t + 3);
                        Ia(this, t + 1, t + 2);
                    }
                    return this;
                };
                fa.prototype.swap64 = function () {
                    var e = this.length;
                    if (e % 8 != 0) {
                        throw new RangeError('Buffer size must be a multiple of 64-bits');
                    }
                    for (var t = 0; t < e; t += 8) {
                        Ia(this, t, t + 7);
                        Ia(this, t + 1, t + 6);
                        Ia(this, t + 2, t + 5);
                        Ia(this, t + 3, t + 4);
                    }
                    return this;
                };
                fa.prototype.toString = function () {
                    var e = 0 | this.length;
                    return 0 === e ? '' : 0 === arguments.length ? La(this, 0, e) : Ma.apply(this, arguments);
                };
                fa.prototype.equals = function (e) {
                    if (!_a(e)) {
                        throw new TypeError('Argument must be a Buffer');
                    }
                    return this === e || 0 === fa.compare(this, e);
                };
                fa.prototype.inspect = function () {
                    var e = '';
                    if (this.length > 0) {
                        e = this.toString('hex', 0, 50).match(/.{2}/g).join(' ');
                        if (this.length > 50) {
                            e += ' ... ';
                        }
                    }
                    return '<Buffer ' + e + '>';
                };
                fa.prototype.compare = function (e, t, n, r, o) {
                    if (!_a(e)) {
                        throw new TypeError('Argument must be a Buffer');
                    }
                    if (void 0 === t) {
                        t = 0;
                    }
                    if (void 0 === n) {
                        n = e ? e.length : 0;
                    }
                    if (void 0 === r) {
                        r = 0;
                    }
                    if (void 0 === o) {
                        o = this.length;
                    }
                    if (t < 0 || n > e.length || r < 0 || o > this.length) {
                        throw new RangeError('out of range index');
                    }
                    if (r >= o && t >= n) {
                        return 0;
                    }
                    if (r >= o) {
                        return -1;
                    }
                    if (t >= n) {
                        return 1;
                    }
                    if (this === e) {
                        return 0;
                    }
                    for (var i = (o >>>= 0) - (r >>>= 0), s = (n >>>= 0) - (t >>>= 0), a = Math.min(i, s), u = this.slice(r, o), l = e.slice(t, n), c = 0; c < a; ++c) {
                        if (u[c] !== l[c]) {
                            i = u[c];
                            s = l[c];
                            break;
                        }
                    }
                    return i < s ? -1 : s < i ? 1 : 0;
                };
                fa.prototype.includes = function (e, t, n) {
                    return -1 !== this.indexOf(e, t, n);
                };
                fa.prototype.indexOf = function (e, t, n) {
                    return Sa(this, e, t, n, true);
                };
                fa.prototype.lastIndexOf = function (e, t, n) {
                    return Sa(this, e, t, n, false);
                };
                fa.prototype.write = function (e, t, n, r) {
                    if (void 0 === t) {
                        r = 'utf8';
                        n = this.length;
                        t = 0;
                    } else if (void 0 === n && 'string' == typeof t) {
                        r = t;
                        n = this.length;
                        t = 0;
                    } else {
                        if (!isFinite(t)) {
                            throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported');
                        }
                        t |= 0;
                        isFinite(n) ? ((n |= 0), void 0 === r && (r = 'utf8')) : ((r = n), (n = void 0));
                    }
                    var o = this.length - t;
                    if (void 0 === n || n > o) {
                        n = o;
                    }
                    if ((e.length > 0 && (n < 0 || t < 0)) || t > this.length) {
                        throw new RangeError('Attempt to write outside buffer bounds');
                    }
                    r || (r = 'utf8');
                    for (var i = false; ; ) {
                        switch (r) {
                            case 'hex':
                                return Ta(this, e, t, n);
                            case 'utf8':
                            case 'utf-8':
                                return Ea(this, e, t, n);
                            case 'ascii':
                                return ka(this, e, t, n);
                            case 'latin1':
                            case 'binary':
                                return Aa(this, e, t, n);
                            case 'base64':
                                return wa(this, e, t, n);
                            case 'ucs2':
                            case 'ucs-2':
                            case 'utf16le':
                            case 'utf-16le':
                                return Ra(this, e, t, n);
                            default:
                                if (i) {
                                    throw new TypeError('Unknown encoding: ' + r);
                                }
                                r = ('' + r).toLowerCase();
                                i = true;
                        }
                    }
                };
                fa.prototype.toJSON = function () {
                    return {
                        type: 'Buffer',
                        data: Array.prototype.slice.call(this._arr || this, 0)
                    };
                };
                function Na(e, t, n) {
                    var r = '';
                    n = Math.min(e.length, n);
                    for (var o = t; o < n; ++o) {
                        r += String.fromCharCode(127 & e[o]);
                    }
                    return r;
                }
                function ba(e, t, n) {
                    var r = '';
                    n = Math.min(e.length, n);
                    for (var o = t; o < n; ++o) {
                        r += String.fromCharCode(e[o]);
                    }
                    return r;
                }
                function Pa(e, t, n) {
                    var r = e.length;
                    if (!t || t < 0) {
                        t = 0;
                    }
                    if (!n || n < 0 || n > r) {
                        n = r;
                    }
                    for (var o = '', i = t; i < n; ++i) {
                        o += ja(e[i]);
                    }
                    return o;
                }
                function Ga(e, t, n) {
                    for (var r = e.slice(t, n), o = '', i = 0; i < r.length; i += 2) {
                        o += String.fromCharCode(r[i] + 256 * r[i + 1]);
                    }
                    return o;
                }
                function Ua(e, t, n) {
                    if (e % 1 != 0 || e < 0) {
                        throw new RangeError('offset is not uint');
                    }
                    if (e + t > n) {
                        throw new RangeError('Trying to access beyond buffer length');
                    }
                }
                function qa(e, t, n, r, o, i) {
                    if (!_a(e)) {
                        throw new TypeError('"buffer" argument must be a Buffer instance');
                    }
                    if (t > o || t < i) {
                        throw new RangeError('"value" argument is out of bounds');
                    }
                    if (n + r > e.length) {
                        throw new RangeError('Index out of range');
                    }
                }
                function xa(e, t, n, r) {
                    if (t < 0) {
                        t = 65535 + t + 1;
                    }
                    for (var o = 0, i = Math.min(e.length - n, 2); o < i; ++o) {
                        e[n + o] = (t & (255 << (8 * (r ? o : 1 - o)))) >>> (8 * (r ? o : 1 - o));
                    }
                }
                function Fa(e, t, n, r) {
                    if (t < 0) {
                        t = 4294967295 + t + 1;
                    }
                    for (var o = 0, i = Math.min(e.length - n, 4); o < i; ++o) {
                        e[n + o] = (t >>> (8 * (r ? o : 3 - o))) & 255;
                    }
                }
                function Ha(e, t, n, r, o, i) {
                    if (n + r > e.length) {
                        throw new RangeError('Index out of range');
                    }
                    if (n < 0) {
                        throw new RangeError('Index out of range');
                    }
                }
                function Ba(e, t, n, r, o) {
                    o || Ha(e, 0, n, 4);
                    ua(e, t, n, r, 23, 4);
                    return n + 4;
                }
                function Va(e, t, n, r, o) {
                    o || Ha(e, 0, n, 8);
                    ua(e, t, n, r, 52, 8);
                    return n + 8;
                }
                fa.prototype.slice = function (e, t) {
                    var n;
                    var r = this.length;
                    (e = ~~e) < 0 ? (e += r) < 0 && (e = 0) : e > r && (e = r);
                    (t = void 0 === t ? r : ~~t) < 0 ? (t += r) < 0 && (t = 0) : t > r && (t = r);
                    if (t < e) {
                        t = e;
                    }
                    if (fa.TYPED_ARRAY_SUPPORT) {
                        (n = this.subarray(e, t)).__proto__ = fa.prototype;
                    } else {
                        var o = t - e;
                        n = new fa(o, void 0);
                        for (var i = 0; i < o; ++i) {
                            n[i] = this[i + e];
                        }
                    }
                    return n;
                };
                fa.prototype.readUIntLE = function (e, t, n) {
                    e |= 0;
                    t |= 0;
                    n || Ua(e, t, this.length);
                    for (var r = this[e], o = 1, i = 0; ++i < t && (o *= 256); ) {
                        r += this[e + i] * o;
                    }
                    return r;
                };
                fa.prototype.readUIntBE = function (e, t, n) {
                    e |= 0;
                    t |= 0;
                    n || Ua(e, t, this.length);
                    for (var r = this[e + --t], o = 1; t > 0 && (o *= 256); ) {
                        r += this[e + --t] * o;
                    }
                    return r;
                };
                fa.prototype.readUInt8 = function (e, t) {
                    t || Ua(e, 1, this.length);
                    return this[e];
                };
                fa.prototype.readUInt16LE = function (e, t) {
                    t || Ua(e, 2, this.length);
                    return this[e] | (this[e + 1] << 8);
                };
                fa.prototype.readUInt16BE = function (e, t) {
                    t || Ua(e, 2, this.length);
                    return (this[e] << 8) | this[e + 1];
                };
                fa.prototype.readUInt32LE = function (e, t) {
                    t || Ua(e, 4, this.length);
                    return (this[e] | (this[e + 1] << 8) | (this[e + 2] << 16)) + 16777216 * this[e + 3];
                };
                fa.prototype.readUInt32BE = function (e, t) {
                    t || Ua(e, 4, this.length);
                    return 16777216 * this[e] + ((this[e + 1] << 16) | (this[e + 2] << 8) | this[e + 3]);
                };
                fa.prototype.readIntLE = function (e, t, n) {
                    e |= 0;
                    t |= 0;
                    n || Ua(e, t, this.length);
                    for (var r = this[e], o = 1, i = 0; ++i < t && (o *= 256); ) {
                        r += this[e + i] * o;
                    }
                    if (r >= (o *= 128)) {
                        r -= Math.pow(2, 8 * t);
                    }
                    return r;
                };
                fa.prototype.readIntBE = function (e, t, n) {
                    e |= 0;
                    t |= 0;
                    n || Ua(e, t, this.length);
                    for (var r = t, o = 1, i = this[e + --r]; r > 0 && (o *= 256); ) {
                        i += this[e + --r] * o;
                    }
                    if (i >= (o *= 128)) {
                        i -= Math.pow(2, 8 * t);
                    }
                    return i;
                };
                fa.prototype.readInt8 = function (e, t) {
                    t || Ua(e, 1, this.length);
                    return 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e];
                };
                fa.prototype.readInt16LE = function (e, t) {
                    t || Ua(e, 2, this.length);
                    var n = this[e] | (this[e + 1] << 8);
                    return 32768 & n ? 4294901760 | n : n;
                };
                fa.prototype.readInt16BE = function (e, t) {
                    t || Ua(e, 2, this.length);
                    var n = this[e + 1] | (this[e] << 8);
                    return 32768 & n ? 4294901760 | n : n;
                };
                fa.prototype.readInt32LE = function (e, t) {
                    t || Ua(e, 4, this.length);
                    return this[e] | (this[e + 1] << 8) | (this[e + 2] << 16) | (this[e + 3] << 24);
                };
                fa.prototype.readInt32BE = function (e, t) {
                    t || Ua(e, 4, this.length);
                    return (this[e] << 24) | (this[e + 1] << 16) | (this[e + 2] << 8) | this[e + 3];
                };
                fa.prototype.readFloatLE = function (e, t) {
                    t || Ua(e, 4, this.length);
                    return aa(this, e, true, 23, 4);
                };
                fa.prototype.readFloatBE = function (e, t) {
                    t || Ua(e, 4, this.length);
                    return aa(this, e, false, 23, 4);
                };
                fa.prototype.readDoubleLE = function (e, t) {
                    t || Ua(e, 8, this.length);
                    return aa(this, e, true, 52, 8);
                };
                fa.prototype.readDoubleBE = function (e, t) {
                    t || Ua(e, 8, this.length);
                    return aa(this, e, false, 52, 8);
                };
                fa.prototype.writeUIntLE = function (e, t, n, r) {
                    ((e = +e), (t |= 0), (n |= 0), r) || qa(this, e, t, n, Math.pow(2, 8 * n) - 1, 0);
                    var o = 1;
                    var i = 0;
                    for (this[t] = 255 & e; ++i < n && (o *= 256); ) {
                        this[t + i] = (e / o) & 255;
                    }
                    return t + n;
                };
                fa.prototype.writeUIntBE = function (e, t, n, r) {
                    ((e = +e), (t |= 0), (n |= 0), r) || qa(this, e, t, n, Math.pow(2, 8 * n) - 1, 0);
                    var o = n - 1;
                    var i = 1;
                    for (this[t + o] = 255 & e; --o >= 0 && (i *= 256); ) {
                        this[t + o] = (e / i) & 255;
                    }
                    return t + n;
                };
                fa.prototype.writeUInt8 = function (e, t, n) {
                    e = +e;
                    t |= 0;
                    n || qa(this, e, t, 1, 255, 0);
                    fa.TYPED_ARRAY_SUPPORT || (e = Math.floor(e));
                    this[t] = 255 & e;
                    return t + 1;
                };
                fa.prototype.writeUInt16LE = function (e, t, n) {
                    e = +e;
                    t |= 0;
                    n || qa(this, e, t, 2, 65535, 0);
                    fa.TYPED_ARRAY_SUPPORT ? ((this[t] = 255 & e), (this[t + 1] = e >>> 8)) : xa(this, e, t, true);
                    return t + 2;
                };
                fa.prototype.writeUInt16BE = function (e, t, n) {
                    e = +e;
                    t |= 0;
                    n || qa(this, e, t, 2, 65535, 0);
                    fa.TYPED_ARRAY_SUPPORT ? ((this[t] = e >>> 8), (this[t + 1] = 255 & e)) : xa(this, e, t, false);
                    return t + 2;
                };
                fa.prototype.writeUInt32LE = function (e, t, n) {
                    e = +e;
                    t |= 0;
                    n || qa(this, e, t, 4, 4294967295, 0);
                    fa.TYPED_ARRAY_SUPPORT ? ((this[t + 3] = e >>> 24), (this[t + 2] = e >>> 16), (this[t + 1] = e >>> 8), (this[t] = 255 & e)) : Fa(this, e, t, true);
                    return t + 4;
                };
                fa.prototype.writeUInt32BE = function (e, t, n) {
                    e = +e;
                    t |= 0;
                    n || qa(this, e, t, 4, 4294967295, 0);
                    fa.TYPED_ARRAY_SUPPORT ? ((this[t] = e >>> 24), (this[t + 1] = e >>> 16), (this[t + 2] = e >>> 8), (this[t + 3] = 255 & e)) : Fa(this, e, t, false);
                    return t + 4;
                };
                fa.prototype.writeIntLE = function (e, t, n, r) {
                    e = +e;
                    t |= 0;
                    if (!r) {
                        var o = Math.pow(2, 8 * n - 1);
                        qa(this, e, t, n, o - 1, -o);
                    }
                    var i = 0;
                    var s = 1;
                    var a = 0;
                    for (this[t] = 255 & e; ++i < n && (s *= 256); ) {
                        if (e < 0 && 0 === a && 0 !== this[t + i - 1]) {
                            a = 1;
                        }
                        this[t + i] = (((e / s) >> 0) - a) & 255;
                    }
                    return t + n;
                };
                fa.prototype.writeIntBE = function (e, t, n, r) {
                    e = +e;
                    t |= 0;
                    if (!r) {
                        var o = Math.pow(2, 8 * n - 1);
                        qa(this, e, t, n, o - 1, -o);
                    }
                    var i = n - 1;
                    var s = 1;
                    var a = 0;
                    for (this[t + i] = 255 & e; --i >= 0 && (s *= 256); ) {
                        if (e < 0 && 0 === a && 0 !== this[t + i + 1]) {
                            a = 1;
                        }
                        this[t + i] = (((e / s) >> 0) - a) & 255;
                    }
                    return t + n;
                };
                fa.prototype.writeInt8 = function (e, t, n) {
                    e = +e;
                    t |= 0;
                    n || qa(this, e, t, 1, 127, -128);
                    fa.TYPED_ARRAY_SUPPORT || (e = Math.floor(e));
                    if (e < 0) {
                        e = 255 + e + 1;
                    }
                    this[t] = 255 & e;
                    return t + 1;
                };
                fa.prototype.writeInt16LE = function (e, t, n) {
                    e = +e;
                    t |= 0;
                    n || qa(this, e, t, 2, 32767, -32768);
                    fa.TYPED_ARRAY_SUPPORT ? ((this[t] = 255 & e), (this[t + 1] = e >>> 8)) : xa(this, e, t, true);
                    return t + 2;
                };
                fa.prototype.writeInt16BE = function (e, t, n) {
                    e = +e;
                    t |= 0;
                    n || qa(this, e, t, 2, 32767, -32768);
                    fa.TYPED_ARRAY_SUPPORT ? ((this[t] = e >>> 8), (this[t + 1] = 255 & e)) : xa(this, e, t, false);
                    return t + 2;
                };
                fa.prototype.writeInt32LE = function (e, t, n) {
                    e = +e;
                    t |= 0;
                    n || qa(this, e, t, 4, 2147483647, -2147483648);
                    fa.TYPED_ARRAY_SUPPORT ? ((this[t] = 255 & e), (this[t + 1] = e >>> 8), (this[t + 2] = e >>> 16), (this[t + 3] = e >>> 24)) : Fa(this, e, t, true);
                    return t + 4;
                };
                fa.prototype.writeInt32BE = function (e, t, n) {
                    e = +e;
                    t |= 0;
                    n || qa(this, e, t, 4, 2147483647, -2147483648);
                    if (e < 0) {
                        e = 4294967295 + e + 1;
                    }
                    fa.TYPED_ARRAY_SUPPORT ? ((this[t] = e >>> 24), (this[t + 1] = e >>> 16), (this[t + 2] = e >>> 8), (this[t + 3] = 255 & e)) : Fa(this, e, t, false);
                    return t + 4;
                };
                fa.prototype.writeFloatLE = function (e, t, n) {
                    return Ba(this, e, t, true, n);
                };
                fa.prototype.writeFloatBE = function (e, t, n) {
                    return Ba(this, e, t, false, n);
                };
                fa.prototype.writeDoubleLE = function (e, t, n) {
                    return Va(this, e, t, true, n);
                };
                fa.prototype.writeDoubleBE = function (e, t, n) {
                    return Va(this, e, t, false, n);
                };
                fa.prototype.copy = function (e, t, n, r) {
                    n || (n = 0);
                    r || 0 === r || (r = this.length);
                    if (t >= e.length) {
                        t = e.length;
                    }
                    t || (t = 0);
                    if (r > 0 && r < n) {
                        r = n;
                    }
                    if (r === n) {
                        return 0;
                    }
                    if (0 === e.length || 0 === this.length) {
                        return 0;
                    }
                    if (t < 0) {
                        throw new RangeError('targetStart out of bounds');
                    }
                    if (n < 0 || n >= this.length) {
                        throw new RangeError('sourceStart out of bounds');
                    }
                    if (r < 0) {
                        throw new RangeError('sourceEnd out of bounds');
                    }
                    if (r > this.length) {
                        r = this.length;
                    }
                    if (e.length - t < r - n) {
                        r = e.length - t + n;
                    }
                    var o;
                    var i = r - n;
                    if (this === e && n < t && t < r)
                        for (o = i - 1; o >= 0; --o) {
                            e[o + t] = this[o + n];
                        }
                    else if (i < 1000 || !fa.TYPED_ARRAY_SUPPORT) {
                        for (o = 0; o < i; ++o) {
                            e[o + t] = this[o + n];
                        }
                    } else {
                        Uint8Array.prototype.set.call(e, this.subarray(n, n + i), t);
                    }
                    return i;
                };
                fa.prototype.fill = function (e, t, n, r) {
                    if ('string' == typeof e) {
                        'string' == typeof t ? ((r = t), (t = 0), (n = this.length)) : 'string' == typeof n && ((r = n), (n = this.length));
                        if (1 === e.length) {
                            var o = e.charCodeAt(0);
                            if (o < 256) {
                                e = o;
                            }
                        }
                        if (void 0 !== r && 'string' != typeof r) {
                            throw new TypeError('encoding must be a string');
                        }
                        if ('string' == typeof r && !fa.isEncoding(r)) {
                            throw new TypeError('Unknown encoding: ' + r);
                        }
                    } else {
                        if ('number' == typeof e) {
                            e &= 255;
                        }
                    }
                    if (t < 0 || this.length < t || this.length < n) {
                        throw new RangeError('Out of range index');
                    }
                    if (n <= t) {
                        return this;
                    }
                    var i;
                    t >>>= 0;
                    n = void 0 === n ? this.length : n >>> 0;
                    e || (e = 0);
                    if ('number' == typeof e) {
                        for (i = t; i < n; ++i) {
                            this[i] = e;
                        }
                    } else {
                        var s = _a(e) ? e : $a(new fa(e, r).toString());
                        var a = s.length;
                        for (i = 0; i < n - t; ++i) {
                            this[i + t] = s[i % a];
                        }
                    }
                    return this;
                };
                var Ka = /[^+\/0-9A-Za-z-_]/g;
                function ja(e) {
                    return e < 16 ? '0' + e.toString(16) : e.toString(16);
                }
                function $a(e, t) {
                    var n;
                    t = t || Infinity;
                    for (var r = e.length, o = null, i = [], s = 0; s < r; ++s) {
                        if ((n = e.charCodeAt(s)) > 55295 && n < 57344) {
                            if (!o) {
                                if (n > 56319) {
                                    if ((t -= 3) > -1) {
                                        i.push(239, 191, 189);
                                    }
                                    continue;
                                }
                                if (s + 1 === r) {
                                    if ((t -= 3) > -1) {
                                        i.push(239, 191, 189);
                                    }
                                    continue;
                                }
                                o = n;
                                continue;
                            }
                            if (n < 56320) {
                                if ((t -= 3) > -1) {
                                    i.push(239, 191, 189);
                                }
                                o = n;
                                continue;
                            }
                            n = 65536 + (((o - 55296) << 10) | (n - 56320));
                        } else {
                            if (o && (t -= 3) > -1) {
                                i.push(239, 191, 189);
                            }
                        }
                        o = null;
                        if (n < 128) {
                            if ((t -= 1) < 0) {
                                break;
                            }
                            i.push(n);
                        } else if (n < 2048) {
                            if ((t -= 2) < 0) {
                                break;
                            }
                            i.push((n >> 6) | 192, (63 & n) | 128);
                        } else if (n < 65536) {
                            if ((t -= 3) < 0) {
                                break;
                            }
                            i.push((n >> 12) | 224, ((n >> 6) & 63) | 128, (63 & n) | 128);
                        } else {
                            if (!(n < 1114112)) {
                                throw new Error('Invalid code point');
                            }
                            if ((t -= 4) < 0) {
                                break;
                            }
                            i.push((n >> 18) | 240, ((n >> 12) & 63) | 128, ((n >> 6) & 63) | 128, (63 & n) | 128);
                        }
                    }
                    return i;
                }
                function Ya(e) {
                    return (function (e) {
                        var t;
                        var n;
                        var r;
                        var o;
                        var i;
                        var s;
                        ra || oa();
                        var a = e.length;
                        if (a % 4 > 0) {
                            throw new Error('Invalid string. Length must be a multiple of 4');
                        }
                        i = '=' === e[a - 2] ? 2 : '=' === e[a - 1] ? 1 : 0;
                        s = new na((3 * a) / 4 - i);
                        r = i > 0 ? a - 4 : a;
                        var u = 0;
                        for (t = 0, n = 0; t < r; t += 4, n += 3) {
                            o = (ta[e.charCodeAt(t)] << 18) | (ta[e.charCodeAt(t + 1)] << 12) | (ta[e.charCodeAt(t + 2)] << 6) | ta[e.charCodeAt(t + 3)];
                            s[u++] = (o >> 16) & 255;
                            s[u++] = (o >> 8) & 255;
                            s[u++] = 255 & o;
                        }
                        2 === i
                            ? ((o = (ta[e.charCodeAt(t)] << 2) | (ta[e.charCodeAt(t + 1)] >> 4)), (s[u++] = 255 & o))
                            : 1 === i &&
                              ((o = (ta[e.charCodeAt(t)] << 10) | (ta[e.charCodeAt(t + 1)] << 4) | (ta[e.charCodeAt(t + 2)] >> 2)), (s[u++] = (o >> 8) & 255), (s[u++] = 255 & o));
                        return s;
                    })(
                        (function (e) {
                            if (
                                (e = (function (e) {
                                    return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, '');
                                })(e).replace(Ka, '')).length < 2
                            ) {
                                return '';
                            }
                            for (; e.length % 4 != 0; ) {
                                e += '=';
                            }
                            return e;
                        })(e)
                    );
                }
                function za(e, t, n, r) {
                    for (var o = 0; o < r && !(o + n >= t.length || o >= e.length); ++o) {
                        t[o + n] = e[o];
                    }
                    return o;
                }
                function Wa(e) {
                    return !!e.constructor && 'function' == typeof e.constructor.isBuffer && e.constructor.isBuffer(e);
                }
                var Xa = (function (e) {
                    l(n, e);
                    var t = y(n);
                    function n() {
                        var e;
                        r(this, n);
                        (e = t.call(this)).retry = 2;
                        e._request = e.promisify(uni.request);
                        return e;
                    }
                    i(n, [
                        {
                            key: 'request',
                            value: function (e) {
                                this._checkOptions(e);
                                this._initOptions(e);
                                e = u({}, e, {
                                    responseType: 'text'
                                });
                                return this._requestWithRetry(e);
                            }
                        },
                        {
                            key: '_requestWithRetry',
                            value: function (e) {
                                var that = this;
                                var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0;
                                return this._request(e)
                                    .then(this._handleResolve)
                                    .catch(function (r) {
                                        if (ee(r.errMsg)) {
                                            if (r.errMsg.includes('abort')) {
                                                return zo({});
                                            }
                                            if (r.errMsg.includes('timeout')) {
                                                return that.retry > 0 && n < that.retry
                                                    ? that._requestWithRetry(e, ++n)
                                                    : Wo(
                                                          new pt({
                                                              code: ln,
                                                              message: r.errMsg
                                                          })
                                                      );
                                            }
                                            if (r.errMsg.includes('fail')) {
                                                return that.retry > 0 && n < that.retry
                                                    ? that._requestWithRetry(e, ++n)
                                                    : Wo(
                                                          new pt({
                                                              code: un,
                                                              message: r.errMsg
                                                          })
                                                      );
                                            }
                                        }
                                        return Wo(
                                            new pt(
                                                u(
                                                    {
                                                        code: yn,
                                                        message: r.message
                                                    },
                                                    r
                                                )
                                            )
                                        );
                                    });
                            }
                        },
                        {
                            key: '_handleResolve',
                            value: function (e) {
                                var t = e.data;
                                var n = t.error_code;
                                var r = t.ErrorCode;
                                if ('number' == typeof n) {
                                    r = n;
                                }
                                if (r !== Ne.SUCCESS) {
                                    e.data.ErrorCode = Number(''.concat(r));
                                }
                                return e;
                            }
                        },
                        {
                            key: 'promisify',
                            value: function (e) {
                                return function (t) {
                                    return new Promise(function (n, r) {
                                        var o = e(
                                            Object.assign({}, t, {
                                                success: n,
                                                fail: r
                                            })
                                        );
                                        if (t.updateAbort) {
                                            t.updateAbort(function () {
                                                if (o && se(o.abort)) {
                                                    o.abort();
                                                }
                                            });
                                        }
                                    });
                                };
                            }
                        }
                    ]);
                    return n;
                })(Qs);
                var Ja = (function () {
                    function e() {
                        r(this, e);
                        this.request = 0;
                        this.success = 0;
                        this.fail = 0;
                        this.reportRate = 10;
                        this.requestTimeCost = [];
                    }
                    i(e, [
                        {
                            key: 'report',
                            value: function () {
                                if (1 !== this.request) {
                                    if (this.request % this.reportRate != 0) {
                                        return null;
                                    }
                                    var e = this.avgRequestTime();
                                    var t = 'runLoop reports: success='
                                        .concat(this.success, ',fail=')
                                        .concat(this.fail, ',total=')
                                        .concat(this.request, ',avg=')
                                        .concat(e, ',cur=')
                                        .concat(this.requestTimeCost[this.requestTimeCost.length - 1], ',max=')
                                        .concat(Math.max.apply(null, this.requestTimeCost), ',min=')
                                        .concat(Math.min.apply(null, this.requestTimeCost));
                                    J.log(t);
                                }
                            }
                        },
                        {
                            key: 'setRequestTime',
                            value: function (e, t) {
                                var n = Math.abs(t - e);
                                if (100 === this.requestTimeCost.length) {
                                    this.requestTimeCost.shift();
                                }
                                this.requestTimeCost.push(n);
                            }
                        },
                        {
                            key: 'avgRequestTime',
                            value: function () {
                                for (var e, t = this.requestTimeCost.length, n = 0, r = 0; r < t; r++) {
                                    n += this.requestTimeCost[r];
                                }
                                e = n / t;
                                return Math.round(100 * e) / 100;
                            }
                        }
                    ]);
                    return e;
                })();
                var Qa = Xs.create({
                    timeout: 6000,
                    headers: {
                        'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
                    }
                });
                Qa.interceptors.response.use(
                    function (e) {
                        var t = e.data;
                        var n = t.error_code;
                        var r = t.ErrorCode;
                        if (Z(n)) {
                            r = n;
                        }
                        if (r !== Ne.SUCCESS) {
                            e.data.ErrorCode = Number(r);
                        }
                        return e;
                    },
                    function (e) {
                        if ('Network Error' === e.message) {
                            if (true === Qa.defaults.withCredentials) {
                                J.warn('Network Error, try to close `IMAxiosAVChatroom.defaults.withCredentials` to false. (IMAxiosAVChatroom.js)');
                            }
                            Qa.defaults.withCredentials = false;
                        }
                        return Promise.reject(e);
                    }
                );
                var Za = Xs.CancelToken;
                var eu = (function () {
                    function e(t) {
                        r(this, e);
                        this._initializeOptions(t);
                        this._initializeMembers();
                        this.status = new Ja();
                    }
                    i(e, [
                        {
                            key: 'destructor',
                            value: function () {
                                clearTimeout(this._seedID);
                                var e = this._index();
                                for (var t in this) {
                                    if (Object.prototype.hasOwnProperty.call(this, t)) {
                                        this[t] = null;
                                    }
                                }
                                return e;
                            }
                        },
                        {
                            key: 'setIndex',
                            value: function (e) {
                                this._index = e;
                            }
                        },
                        {
                            key: 'getIndex',
                            value: function () {
                                return this._index;
                            }
                        },
                        {
                            key: 'isRunning',
                            value: function () {
                                return !this._stoped;
                            }
                        },
                        {
                            key: '_initializeOptions',
                            value: function (e) {
                                this.options = e;
                            }
                        },
                        {
                            key: '_initializeMembers',
                            value: function () {
                                this._index = -1;
                                this._seedID = 0;
                                this._requestStatus = false;
                                this._stoped = false;
                                this._intervalTime = 0;
                                this._intervalIncreaseStep = 1000;
                                this._intervalDecreaseStep = 1000;
                                this._intervalTimeMax = 5000;
                                this._protectTimeout = 3000;
                                this._getNoticeSeq = this.options.getNoticeSeq;
                                this._retryCount = 0;
                                this._responseTime = Date.now();
                                this._responseTimeThreshold = 2000;
                                this.options.isAVChatRoomLoop ? (this.requestor = Qa) : (this.requestor = Js);
                                J.log('XHRRunLoop._initializeMembers isAVChatRoomLoop='.concat(!!this.options.isAVChatRoomLoop));
                                this.abort = null;
                            }
                        },
                        {
                            key: 'start',
                            value: function () {
                                0 === this._seedID
                                    ? ((this._stoped = false), this._send())
                                    : J.log('XHRRunLoop.start(), XHRRunLoop is running now, if you want to restart runLoop , please run "stop()" first.');
                            }
                        },
                        {
                            key: '_reset',
                            value: function () {
                                J.log('XHRRunLoop._reset(), reset long poll _intervalTime', this._intervalTime);
                                this.stop();
                                this.start();
                            }
                        },
                        {
                            key: '_intervalTimeIncrease',
                            value: function () {
                                if (this._intervalTime !== this._responseTimeThreshold) {
                                    if (this._intervalTime < this._responseTimeThreshold) {
                                        this._intervalTime += this._intervalIncreaseStep;
                                    }
                                    if (this._intervalTime > this._responseTimeThreshold) {
                                        this._intervalTime = this._responseTimeThreshold;
                                    }
                                }
                            }
                        },
                        {
                            key: '_intervalTimeDecrease',
                            value: function () {
                                if (0 !== this._intervalTime) {
                                    if (this._intervalTime > 0) {
                                        this._intervalTime -= this._intervalDecreaseStep;
                                    }
                                    if (this._intervalTime < 0) {
                                        this._intervalTime = 0;
                                    }
                                }
                            }
                        },
                        {
                            key: '_intervalTimeAdjustment',
                            value: function () {
                                var e = Date.now();
                                100 * Math.floor((e - this._responseTime) / 100) <= this._responseTimeThreshold ? this._intervalTimeIncrease() : this._intervalTimeDecrease();
                                this._responseTime = e;
                            }
                        },
                        {
                            key: '_intervalTimeAdjustmentBaseOnResponseData',
                            value: function (e) {
                                e.ErrorCode === Ne.SUCCESS ? this._intervalTimeDecrease() : this._intervalTimeIncrease();
                            }
                        },
                        {
                            key: '_send',
                            value: function () {
                                var that = this;
                                if (true !== this._requestStatus) {
                                    this._requestStatus = true;
                                    this.status.request++;
                                    if ('function' == typeof this.options.before) {
                                        this.options.before(this.options.pack.requestData);
                                    }
                                    var t = Date.now();
                                    var n = 0;
                                    this.requestor
                                        .request({
                                            url: this.options.pack.getUrl(),
                                            data: this.options.pack.requestData,
                                            method: this.options.pack.method,
                                            cancelToken: new Za(function (t) {
                                                that.abort = t;
                                            })
                                        })
                                        .then(function (r) {
                                            that._intervalTimeAdjustmentBaseOnResponseData.bind(that)(r.data);
                                            if (that._retryCount > 0) {
                                                that._retryCount = 0;
                                            }
                                            that.status.success++;
                                            n = Date.now();
                                            that.status.setRequestTime(t, n);
                                            r.data.timecost = n - t;
                                            if ('function' == typeof that.options.success) {
                                                try {
                                                    that.options.success({
                                                        pack: that.options.pack,
                                                        error: false,
                                                        data: that.options.pack.callback(r.data)
                                                    });
                                                } catch (o) {
                                                    console.log('CatchClause', o);
                                                    console.log('CatchClause', o);
                                                    J.warn('XHRRunLoop._send(), error:', o);
                                                }
                                            }
                                            that._requestStatus = false;
                                            if (false === that._stoped) {
                                                that._seedID = setTimeout(that._send.bind(that), that._intervalTime);
                                            }
                                            that.status.report();
                                        })
                                        .catch(function (r) {
                                            that.status.fail++;
                                            that._retryCount++;
                                            that._intervalTimeAdjustment.bind(that)();
                                            if (false === that._stoped) {
                                                that._seedID = setTimeout(that._send.bind(that), that._intervalTime);
                                            }
                                            that._requestStatus = false;
                                            if ('function' == typeof that.options.fail && void 0 !== r.request) {
                                                try {
                                                    that.options.fail({
                                                        pack: that.options.pack,
                                                        error: r,
                                                        data: false
                                                    });
                                                } catch (o) {
                                                    console.log('CatchClause', o);
                                                    console.log('CatchClause', o);
                                                    J.warn('XHRRunLoop._send(), fail callback error:');
                                                    J.error(o);
                                                }
                                            }
                                            n = Date.now();
                                            that.status.setRequestTime(t, n);
                                            that.status.report();
                                        });
                                }
                            }
                        },
                        {
                            key: 'stop',
                            value: function () {
                                this._clearAllTimeOut();
                                this._stoped = true;
                            }
                        },
                        {
                            key: '_clearAllTimeOut',
                            value: function () {
                                clearTimeout(this._seedID);
                                this._seedID = 0;
                            }
                        }
                    ]);
                    return e;
                })();
                var tu = (function () {
                    function e(t) {
                        r(this, e);
                        this._initializeOptions(t);
                        this._initializeMembers();
                        this.status = new Ja();
                    }
                    i(e, [
                        {
                            key: 'destructor',
                            value: function () {
                                clearTimeout(this._seedID);
                                var e = this._index();
                                for (var t in this) {
                                    if (Object.prototype.hasOwnProperty.call(this, t)) {
                                        this[t] = null;
                                    }
                                }
                                return e;
                            }
                        },
                        {
                            key: 'setIndex',
                            value: function (e) {
                                this._index = e;
                            }
                        },
                        {
                            key: 'isRunning',
                            value: function () {
                                return !this._stoped;
                            }
                        },
                        {
                            key: 'getIndex',
                            value: function () {
                                return this._index;
                            }
                        },
                        {
                            key: '_initializeOptions',
                            value: function (e) {
                                this.options = e;
                            }
                        },
                        {
                            key: '_initializeMembers',
                            value: function () {
                                this._index = -1;
                                this._seedID = 0;
                                this._requestStatus = false;
                                this._stoped = false;
                                this._intervalTime = 0;
                                this._intervalIncreaseStep = 1000;
                                this._intervalDecreaseStep = 1000;
                                this._intervalTimeMax = 5000;
                                this._protectTimeout = 3000;
                                this._getNoticeSeq = this.options.getNoticeSeq;
                                this._retryCount = 0;
                                this._responseTime = Date.now();
                                this._responseTimeThreshold = 2000;
                                this.requestor = new Xa();
                                this.abort = null;
                            }
                        },
                        {
                            key: 'start',
                            value: function () {
                                0 === this._seedID
                                    ? ((this._stoped = false), this._send())
                                    : J.log('WXRunLoop.start(): WXRunLoop is running now, if you want to restart runLoop , please run "stop()" first.');
                            }
                        },
                        {
                            key: '_reset',
                            value: function () {
                                J.log('WXRunLoop.reset(), long poll _intervalMaxRate', this._intervalMaxRate);
                                this.stop();
                                this.start();
                            }
                        },
                        {
                            key: '_intervalTimeIncrease',
                            value: function () {
                                if (this._intervalTime !== this._responseTimeThreshold) {
                                    if (this._intervalTime < this._responseTimeThreshold) {
                                        this._intervalTime += this._intervalIncreaseStep;
                                    }
                                    if (this._intervalTime > this._responseTimeThreshold) {
                                        this._intervalTime = this._responseTimeThreshold;
                                    }
                                }
                            }
                        },
                        {
                            key: '_intervalTimeDecrease',
                            value: function () {
                                if (0 !== this._intervalTime) {
                                    if (this._intervalTime > 0) {
                                        this._intervalTime -= this._intervalDecreaseStep;
                                    }
                                    if (this._intervalTime < 0) {
                                        this._intervalTime = 0;
                                    }
                                }
                            }
                        },
                        {
                            key: '_intervalTimeAdjustment',
                            value: function () {
                                var e = Date.now();
                                100 * Math.floor((e - this._responseTime) / 100) <= this._responseTimeThreshold ? this._intervalTimeIncrease() : this._intervalTimeDecrease();
                                this._responseTime = e;
                            }
                        },
                        {
                            key: '_intervalTimeAdjustmentBaseOnResponseData',
                            value: function (e) {
                                e.ErrorCode === Ne.SUCCESS ? this._intervalTimeDecrease() : this._intervalTimeIncrease();
                            }
                        },
                        {
                            key: '_send',
                            value: function () {
                                var that = this;
                                if (true !== this._requestStatus) {
                                    var t = this;
                                    this._requestStatus = true;
                                    this.status.request++;
                                    if ('function' == typeof this.options.before) {
                                        this.options.before(t.options.pack.requestData);
                                    }
                                    var n = Date.now();
                                    var r = 0;
                                    this.requestor
                                        .request({
                                            url: t.options.pack.getUrl(),
                                            data: t.options.pack.requestData,
                                            method: t.options.pack.method,
                                            updateAbort: function (t) {
                                                that.abort = t;
                                            }
                                        })
                                        .then(function (o) {
                                            t._intervalTimeAdjustmentBaseOnResponseData.bind(that)(o.data);
                                            if (t._retryCount > 0) {
                                                t._retryCount = 0;
                                            }
                                            that.status.success++;
                                            r = Date.now();
                                            that.status.setRequestTime(n, r);
                                            o.data.timecost = r - n;
                                            if ('function' == typeof t.options.success) {
                                                try {
                                                    that.options.success({
                                                        pack: that.options.pack,
                                                        error: false,
                                                        data: that.options.pack.callback(o.data)
                                                    });
                                                } catch (i) {
                                                    console.log('CatchClause', i);
                                                    console.log('CatchClause', i);
                                                    J.warn('WXRunLoop._send(), error:', i);
                                                }
                                            }
                                            t._requestStatus = false;
                                            if (false === t._stoped) {
                                                t._seedID = setTimeout(t._send.bind(t), t._intervalTime);
                                            }
                                            that.status.report();
                                        })
                                        .catch(function (o) {
                                            that.status.fail++;
                                            t._retryCount++;
                                            t._intervalTimeAdjustment.bind(that)();
                                            if (false === t._stoped) {
                                                t._seedID = setTimeout(t._send.bind(t), t._intervalTime);
                                            }
                                            t._requestStatus = false;
                                            if ('function' == typeof t.options.fail) {
                                                try {
                                                    that.options.fail({
                                                        pack: that.options.pack,
                                                        error: o,
                                                        data: false
                                                    });
                                                } catch (i) {
                                                    console.log('CatchClause', i);
                                                    console.log('CatchClause', i);
                                                    J.warn('WXRunLoop._send(), fail callback error:');
                                                    J.error(i);
                                                }
                                            }
                                            r = Date.now();
                                            that.status.setRequestTime(n, r);
                                            that.status.report();
                                        });
                                }
                            }
                        },
                        {
                            key: 'stop',
                            value: function () {
                                this._clearAllTimeOut();
                                this._stoped = true;
                            }
                        },
                        {
                            key: '_clearAllTimeOut',
                            value: function () {
                                clearTimeout(this._seedID);
                                this._seedID = 0;
                            }
                        }
                    ]);
                    return e;
                })();
                var nu = (function () {
                    function e(t) {
                        r(this, e);
                        this.tim = t;
                        this.httpConnection = O ? new Xa() : new Zs();
                        this.keepAliveConnections = [];
                    }
                    i(e, [
                        {
                            key: 'initializeListener',
                            value: function () {
                                this.tim.innerEmitter.on(To, this._stopAllRunLoop, this);
                            }
                        },
                        {
                            key: 'request',
                            value: function (e) {
                                var t = {
                                    url: e.url,
                                    data: e.requestData,
                                    method: e.method,
                                    callback: e.callback
                                };
                                return this.httpConnection.request(t).then(function (t) {
                                    t.data = e.callback(t.data);
                                    return t.data.errorCode !== Ne.SUCCESS
                                        ? Wo(
                                              new pt({
                                                  code: t.data.errorCode,
                                                  message: t.data.errorInfo
                                              })
                                          )
                                        : t;
                                });
                            }
                        },
                        {
                            key: 'createRunLoop',
                            value: function (e) {
                                var t = this.createKeepAliveConnection(e);
                                t.setIndex(this.keepAliveConnections.push(t) - 1);
                                return t;
                            }
                        },
                        {
                            key: 'stopRunLoop',
                            value: function (e) {
                                e.stop();
                            }
                        },
                        {
                            key: '_stopAllRunLoop',
                            value: function () {
                                for (var e = this.keepAliveConnections.length, t = 0; t < e; t++) {
                                    this.keepAliveConnections[t].stop();
                                }
                            }
                        },
                        {
                            key: 'destroyRunLoop',
                            value: function (e) {
                                e.stop();
                                var t = e.destructor();
                                this.keepAliveConnections.slice(t, 1);
                            }
                        },
                        {
                            key: 'startRunLoopExclusive',
                            value: function (e) {
                                for (var t = e.getIndex(), n = 0; n < this.keepAliveConnections.length; n++) {
                                    if (n !== t) {
                                        this.keepAliveConnections[n].stop();
                                    }
                                }
                                e.start();
                            }
                        },
                        {
                            key: 'createKeepAliveConnection',
                            value: function (e) {
                                return O ? new tu(e) : (this.tim.options.runLoopNetType === Xe || this.tim.options.runLoopNetType, new eu(e));
                            }
                        },
                        {
                            key: 'clearAll',
                            value: function () {
                                this.conn.cancelAll();
                            }
                        },
                        {
                            key: 'reset',
                            value: function () {
                                this.keepAliveConnections = [];
                            }
                        }
                    ]);
                    return e;
                })();
                var ru = (function () {
                    function t(e) {
                        r(this, t);
                        this.tim = e;
                        this.tim.innerEmitter.on(Ao, this._onErrorDetected, this);
                    }
                    i(t, [
                        {
                            key: '_onErrorDetected',
                            value: function (t) {
                                var n = t.data;
                                n.code
                                    ? J.warn('Oops! code:'.concat(n.code, ' message:').concat(n.message))
                                    : J.warn('Oops! message:'.concat(n.message, ' stack:').concat(n.stack));
                                this.tim.outerEmitter.emit(e.ERROR, n);
                            }
                        }
                    ]);
                    return t;
                })();
                var ou = (function () {
                    function e(n) {
                        var that = this;
                        r(this, e);
                        we(n) ||
                            ((this.userID = n.userID || ''),
                            (this.nick = n.nick || ''),
                            (this.gender = n.gender || ''),
                            (this.birthday = n.birthday || 0),
                            (this.location = n.location || ''),
                            (this.selfSignature = n.selfSignature || ''),
                            (this.allowType = n.allowType || t.ALLOW_TYPE_ALLOW_ANY),
                            (this.language = n.language || 0),
                            (this.avatar = n.avatar || ''),
                            (this.messageSettings = n.messageSettings || 0),
                            (this.adminForbidType = n.adminForbidType || t.FORBID_TYPE_NONE),
                            (this.level = n.level || 0),
                            (this.role = n.role || 0),
                            (this.lastUpdatedTime = 0),
                            (this.profileCustomField = []),
                            we(n.profileCustomField) ||
                                n.profileCustomField.forEach(function (e) {
                                    that.profileCustomField.push({
                                        key: e.key,
                                        value: e.value
                                    });
                                }));
                    }
                    i(e, [
                        {
                            key: 'validate',
                            value: function (e) {
                                var t = true;
                                var n = '';
                                if (we(e)) {
                                    return {
                                        valid: false,
                                        tips: 'empty options'
                                    };
                                }
                                if (e.profileCustomField) {
                                    for (var r = e.profileCustomField.length, o = null, i = 0; i < r; i++) {
                                        o = e.profileCustomField[i];
                                        if (!ee(o.key) || -1 === o.key.indexOf('Tag_Profile_Custom')) {
                                            return {
                                                valid: false,
                                                tips: '自定义资料字段的前缀必须是 Tag_Profile_Custom'
                                            };
                                        }
                                        if (!ee(o.value)) {
                                            return {
                                                valid: false,
                                                tips: '自定义资料字段的 value 必须是字符串'
                                            };
                                        }
                                    }
                                }
                                for (var s in e) {
                                    if (Object.prototype.hasOwnProperty.call(e, s)) {
                                        if ('profileCustomField' === s) {
                                            continue;
                                        }
                                        if (we(e[s]) && !ee(e[s]) && !Z(e[s])) {
                                            n = 'key:' + s + ', invalid value:' + e[s];
                                            t = false;
                                            continue;
                                        }
                                        switch (s) {
                                            case 'nick':
                                                ee(e[s]) || ((n = 'nick should be a string'), (t = false));
                                                if (ge(e[s]) > 500) {
                                                    n = 'nick name limited: must less than or equal to '.concat(500, ' bytes, current size: ').concat(ge(e[s]), ' bytes');
                                                    t = false;
                                                }
                                                break;
                                            case 'gender':
                                                _e(et, e.gender) || ((n = 'key:gender, invalid value:' + e.gender), (t = false));
                                                break;
                                            case 'birthday':
                                                Z(e.birthday) || ((n = 'birthday should be a number'), (t = false));
                                                break;
                                            case 'location':
                                                ee(e.location) || ((n = 'location should be a string'), (t = false));
                                                break;
                                            case 'selfSignature':
                                                ee(e.selfSignature) || ((n = 'selfSignature should be a string'), (t = false));
                                                break;
                                            case 'allowType':
                                                _e(nt, e.allowType) || ((n = 'key:allowType, invalid value:' + e.allowType), (t = false));
                                                break;
                                            case 'language':
                                                Z(e.language) || ((n = 'language should be a number'), (t = false));
                                                break;
                                            case 'avatar':
                                                ee(e.avatar) || ((n = 'avatar should be a string'), (t = false));
                                                break;
                                            case 'messageSettings':
                                                if (0 !== e.messageSettings && 1 !== e.messageSettings) {
                                                    n = 'messageSettings should be 0 or 1';
                                                    t = false;
                                                }
                                                break;
                                            case 'adminForbidType':
                                                _e(tt, e.adminForbidType) || ((n = 'key:adminForbidType, invalid value:' + e.adminForbidType), (t = false));
                                                break;
                                            case 'level':
                                                Z(e.level) || ((n = 'level should be a number'), (t = false));
                                                break;
                                            case 'role':
                                                Z(e.role) || ((n = 'role should be a number'), (t = false));
                                                break;
                                            default:
                                                n = 'unknown key:' + s + '  ' + e[s];
                                                t = false;
                                        }
                                    }
                                }
                                return {
                                    valid: t,
                                    tips: n
                                };
                            }
                        }
                    ]);
                    return e;
                })();
                var iu = (function () {
                    function t(e) {
                        r(this, t);
                        this.userController = e;
                        this.TAG = 'profile';
                        this.Actions = {
                            Q: 'query',
                            U: 'update'
                        };
                        this.accountProfileMap = new Map();
                        this.expirationTime = 86400000;
                    }
                    i(t, [
                        {
                            key: 'setExpirationTime',
                            value: function (e) {
                                this.expirationTime = e;
                            }
                        },
                        {
                            key: 'getUserProfile',
                            value: function (e) {
                                var that = this;
                                var n = e.userIDList;
                                e.fromAccount = this.userController.getMyAccount();
                                if (n.length > 100) {
                                    J.warn('ProfileHandler.getUserProfile 获取用户资料人数不能超过100人');
                                    n.length = 100;
                                }
                                for (var r, o = [], i = [], s = 0, a = n.length; s < a; s++) {
                                    r = n[s];
                                    this.userController.isMyFriend(r) && this._containsAccount(r) ? i.push(this._getProfileFromMap(r)) : o.push(r);
                                }
                                if (0 === o.length) {
                                    return zo(i);
                                }
                                e.toAccount = o;
                                var u = e.bFromGetMyProfile || false;
                                var l = [];
                                e.toAccount.forEach(function (e) {
                                    l.push({
                                        toAccount: e,
                                        standardSequence: 0,
                                        customSequence: 0
                                    });
                                });
                                e.userItem = l;
                                var c = new oi();
                                c.setMethod(qi).setStart();
                                var p = this.userController.generateConfig(this.TAG, this.Actions.Q, e);
                                return this.userController
                                    .request(p)
                                    .then(function (e) {
                                        c.setCode(0).setNetworkType(that.userController.getNetworkType()).setText(e.data.userProfileItem.length).setEnd();
                                        J.info('ProfileHandler.getUserProfile ok');
                                        var n = that._handleResponse(e).concat(i);
                                        return u ? (that.userController.onGotMyProfile(), new jo(n[0])) : new jo(n);
                                    })
                                    .catch(function (e) {
                                        that.userController.probeNetwork().then(function (t) {
                                            var n = v(t, 2);
                                            var r = n[0];
                                            var o = n[1];
                                            c.setError(e, r, o).setEnd();
                                        });
                                        J.error('ProfileHandler.getUserProfile error:', e);
                                        return Wo(e);
                                    });
                            }
                        },
                        {
                            key: 'getMyProfile',
                            value: function () {
                                var e = this.userController.getMyAccount();
                                J.log('ProfileHandler.getMyProfile myAccount=' + e);
                                this._fillMap();
                                if (this._containsAccount(e)) {
                                    var t = this._getProfileFromMap(e);
                                    J.debug('ProfileHandler.getMyProfile from cache, myProfile:' + JSON.stringify(t));
                                    this.userController.onGotMyProfile();
                                    return zo(t);
                                }
                                return this.getUserProfile({
                                    fromAccount: e,
                                    userIDList: [e],
                                    bFromGetMyProfile: true
                                });
                            }
                        },
                        {
                            key: '_handleResponse',
                            value: function (e) {
                                for (var t, n, r = pe.now(), o = e.data.userProfileItem, i = [], s = 0, a = o.length; s < a; s++) {
                                    if ('@TLS#NOT_FOUND' !== o[s].to && '' !== o[s].to) {
                                        t = o[s].to;
                                        n = this._updateMap(t, this._getLatestProfileFromResponse(t, o[s].profileItem));
                                        i.push(n);
                                    }
                                }
                                J.log('ProfileHandler._handleResponse cost ' + (pe.now() - r) + ' ms');
                                return i;
                            }
                        },
                        {
                            key: '_getLatestProfileFromResponse',
                            value: function (e, t) {
                                var n = {};
                                n.userID = e;
                                n.profileCustomField = [];
                                if (!we(t)) {
                                    for (var r = 0, o = t.length; r < o; r++) {
                                        if (t[r].tag.indexOf('Tag_Profile_Custom') > -1) {
                                            n.profileCustomField.push({
                                                key: t[r].tag,
                                                value: t[r].value
                                            });
                                        } else {
                                            switch (t[r].tag) {
                                                case Ze.NICK:
                                                    n.nick = t[r].value;
                                                    break;
                                                case Ze.GENDER:
                                                    n.gender = t[r].value;
                                                    break;
                                                case Ze.BIRTHDAY:
                                                    n.birthday = t[r].value;
                                                    break;
                                                case Ze.LOCATION:
                                                    n.location = t[r].value;
                                                    break;
                                                case Ze.SELFSIGNATURE:
                                                    n.selfSignature = t[r].value;
                                                    break;
                                                case Ze.ALLOWTYPE:
                                                    n.allowType = t[r].value;
                                                    break;
                                                case Ze.LANGUAGE:
                                                    n.language = t[r].value;
                                                    break;
                                                case Ze.AVATAR:
                                                    n.avatar = t[r].value;
                                                    break;
                                                case Ze.MESSAGESETTINGS:
                                                    n.messageSettings = t[r].value;
                                                    break;
                                                case Ze.ADMINFORBIDTYPE:
                                                    n.adminForbidType = t[r].value;
                                                    break;
                                                case Ze.LEVEL:
                                                    n.level = t[r].value;
                                                    break;
                                                case Ze.ROLE:
                                                    n.role = t[r].value;
                                                    break;
                                                default:
                                                    J.warn('ProfileHandler._handleResponse unkown tag->', t[r].tag, t[r].value);
                                            }
                                        }
                                    }
                                }
                                return n;
                            }
                        },
                        {
                            key: 'updateMyProfile',
                            value: function (t) {
                                var that = this;
                                var r = new ou().validate(t);
                                if (!r.valid) {
                                    J.error(
                                        'ProfileHandler.updateMyProfile info:'.concat(
                                            r.tips,
                                            '，请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#updateMyProfile'
                                        )
                                    );
                                    return Wo({
                                        code: nn,
                                        message: fr
                                    });
                                }
                                var o = [];
                                for (var i in t) {
                                    if (Object.prototype.hasOwnProperty.call(t, i)) {
                                        'profileCustomField' === i
                                            ? t.profileCustomField.forEach(function (e) {
                                                  o.push({
                                                      tag: e.key,
                                                      value: e.value
                                                  });
                                              })
                                            : o.push({
                                                  tag: Ze[i.toUpperCase()],
                                                  value: t[i]
                                              });
                                    }
                                }
                                if (0 === o.length) {
                                    J.error(
                                        'ProfileHandler.updateMyProfile info:'.concat(dr, '，请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#updateMyProfile')
                                    );
                                    return Wo({
                                        code: rn,
                                        message: dr
                                    });
                                }
                                var s = this.userController.generateConfig(this.TAG, this.Actions.U, {
                                    fromAccount: this.userController.getMyAccount(),
                                    profileItem: o
                                });
                                return this.userController
                                    .request(s)
                                    .then(function (r) {
                                        J.info('ProfileHandler.updateMyProfile ok');
                                        var o = that._updateMap(that.userController.getMyAccount(), t);
                                        that.userController.emitOuterEvent(e.PROFILE_UPDATED, [o]);
                                        return zo(o);
                                    })
                                    .catch(function (e) {
                                        J.error('ProfileHandler.updateMyProfile error:', e);
                                        return Wo(e);
                                    });
                            }
                        },
                        {
                            key: 'onProfileModified',
                            value: function (t) {
                                var n = t.data;
                                if (!we(n)) {
                                    var r;
                                    var o;
                                    var i = n.length;
                                    J.info('ProfileHandler.onProfileModified length=' + i);
                                    for (var s = [], a = 0; a < i; a++) {
                                        r = n[a].userID;
                                        o = this._updateMap(r, this._getLatestProfileFromResponse(r, n[a].profileList));
                                        s.push(o);
                                    }
                                    this.userController.emitInnerEvent(Lo, s);
                                    this.userController.emitOuterEvent(e.PROFILE_UPDATED, s);
                                }
                            }
                        },
                        {
                            key: '_fillMap',
                            value: function () {
                                if (0 === this.accountProfileMap.size) {
                                    for (var e = this._getCachedProfiles(), t = Date.now(), n = 0, r = e.length; n < r; n++) {
                                        if (t - e[n].lastUpdatedTime < this.expirationTime) {
                                            this.accountProfileMap.set(e[n].userID, e[n]);
                                        }
                                    }
                                    J.log('ProfileHandler._fillMap from cache, map.size=' + this.accountProfileMap.size);
                                }
                            }
                        },
                        {
                            key: '_updateMap',
                            value: function (e, t) {
                                var n;
                                var r = Date.now();
                                this._containsAccount(e)
                                    ? ((n = this._getProfileFromMap(e)),
                                      t.profileCustomField && Se(n.profileCustomField, t.profileCustomField),
                                      he(n, t, ['profileCustomField']),
                                      (n.lastUpdatedTime = r))
                                    : ((n = new ou(t)),
                                      (this.userController.isMyFriend(e) || e === this.userController.getMyAccount()) &&
                                          ((n.lastUpdatedTime = r), this.accountProfileMap.set(e, n)));
                                this._flushMap(e === this.userController.getMyAccount());
                                return n;
                            }
                        },
                        {
                            key: '_flushMap',
                            value: function (e) {
                                var t = _(this.accountProfileMap.values());
                                var n = this.userController.tim.storage;
                                J.debug('ProfileHandler._flushMap length='.concat(t.length, ' flushAtOnce=').concat(e));
                                n.setItem(this.TAG, t, e);
                            }
                        },
                        {
                            key: '_containsAccount',
                            value: function (e) {
                                return this.accountProfileMap.has(e);
                            }
                        },
                        {
                            key: '_getProfileFromMap',
                            value: function (e) {
                                return this.accountProfileMap.get(e);
                            }
                        },
                        {
                            key: '_getCachedProfiles',
                            value: function () {
                                var e = this.userController.tim.storage.getItem(this.TAG);
                                return we(e) ? [] : e;
                            }
                        },
                        {
                            key: 'onConversationsProfileUpdated',
                            value: function (e) {
                                for (var t, n, r, o = [], i = 0, s = e.length; i < s; i++) {
                                    n = (t = e[i]).userID;
                                    if (this.userController.isMyFriend(n)) {
                                        this._containsAccount(n) ? ((r = this._getProfileFromMap(n)), he(r, t) > 0 && o.push(n)) : o.push(t.userID);
                                    }
                                }
                                if (0 !== o.length) {
                                    J.info('ProfileHandler.onConversationsProfileUpdated toAccount:', o);
                                    this.getUserProfile({
                                        userIDList: o
                                    });
                                }
                            }
                        },
                        {
                            key: 'reset',
                            value: function () {
                                this._flushMap(true);
                                this.accountProfileMap.clear();
                            }
                        }
                    ]);
                    return t;
                })();
                var su = (function () {
                    function e(t) {
                        r(this, e);
                        this.options = t
                            ? t.options
                            : {
                                  enablePointer: true
                              };
                        this.pointsList = {};
                        this.reportText = {};
                        this.maxNameLen = 0;
                        this.gapChar = '-';
                        this.log = console.log;
                        this.currentTask = '';
                    }
                    i(e, [
                        {
                            key: 'newTask',
                            value: function (e) {
                                if (false !== this.options.enablePointer) {
                                    e || (e = ['task', this._timeFormat()].join('-'));
                                    this.pointsList[e] = [];
                                    this.currentTask = e;
                                    console.log('Pointer new Task : '.concat(this.currentTask));
                                }
                            }
                        },
                        {
                            key: 'deleteTask',
                            value: function (e) {
                                if (false !== this.options.enablePointer) {
                                    e || (e = this.currentTask);
                                    this.pointsList[e].length = 0;
                                    delete this.pointsList[e];
                                }
                            }
                        },
                        {
                            key: 'dot',
                            value: function () {
                                var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : '';
                                var t = arguments.length > 1 ? arguments[1] : void 0;
                                if (false !== this.options.enablePointer) {
                                    t = t || this.currentTask;
                                    var n = +new Date();
                                    this.maxNameLen = this.maxNameLen < e.length ? e.length : this.maxNameLen;
                                    this.flen = this.maxNameLen + 10;
                                    this.pointsList[t].push({
                                        pointerName: e,
                                        time: n
                                    });
                                }
                            }
                        },
                        {
                            key: '_analisys',
                            value: function (e) {
                                if (false !== this.options.enablePointer) {
                                    e = e || this.currentTask;
                                    for (var t = this.pointsList[e], n = t.length, r = [], o = [], i = 0; i < n; i++) {
                                        if (0 !== i) {
                                            o = this._analisysTowPoints(t[i - 1], t[i]);
                                            r.push(o.join(''));
                                        }
                                    }
                                    o = this._analisysTowPoints(t[0], t[n - 1], true);
                                    r.push(o.join(''));
                                    return r.join('');
                                }
                            }
                        },
                        {
                            key: '_analisysTowPoints',
                            value: function (e, t) {
                                var n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2];
                                if (false !== this.options.enablePointer) {
                                    var r = this.flen;
                                    var o = t.time - e.time;
                                    var i = o.toString();
                                    var s = e.pointerName + this.gapChar.repeat(r - e.pointerName.length);
                                    var a = t.pointerName + this.gapChar.repeat(r - t.pointerName.length);
                                    var u = this.gapChar.repeat(4 - i.length) + i;
                                    var l = n ? ['%c', s, a, u, 'ms\n%c'] : [s, a, u, 'ms\n'];
                                    return l;
                                }
                            }
                        },
                        {
                            key: 'report',
                            value: function (e) {
                                if (false !== this.options.enablePointer) {
                                    e = e || this.currentTask;
                                    var t = this._analisys(e);
                                    this.pointsList = [];
                                    var n = this._timeFormat();
                                    var r = 'Pointer['.concat(e, '(').concat(n, ')]');
                                    var o = 4 * this.maxNameLen;
                                    var i = (o - r.length) / 2;
                                    console.log(['-'.repeat(i), r, '-'.repeat(i)].join(''));
                                    console.log('%c' + t, 'color:#66a', 'color:red', 'color:#66a');
                                    console.log('-'.repeat(o));
                                }
                            }
                        },
                        {
                            key: '_timeFormat',
                            value: function () {
                                var e = new Date();
                                var t = this.zeroFix(e.getMonth() + 1, 2);
                                var n = this.zeroFix(e.getDate(), 2);
                                return ''
                                    .concat(t, '-')
                                    .concat(n, ' ')
                                    .concat(e.getHours(), ':')
                                    .concat(e.getSeconds(), ':')
                                    .concat(e.getMinutes(), '~')
                                    .concat(e.getMilliseconds());
                            }
                        },
                        {
                            key: 'zeroFix',
                            value: function (e, t) {
                                return ('000000000' + e).slice(-t);
                            }
                        },
                        {
                            key: 'reportAll',
                            value: function () {
                                if (false !== this.options.enablePointer) {
                                    for (var e in this.pointsList) {
                                        if (Object.prototype.hasOwnProperty.call(this.pointsList, e)) {
                                            this.eport(e);
                                        }
                                    }
                                }
                            }
                        }
                    ]);
                    return e;
                })();
                var au = function e(t, n) {
                    r(this, e);
                    this.userID = t;
                    var o = {};
                    o.userID = t;
                    if (!we(n)) {
                        for (var i = 0, s = n.length; i < s; i++) {
                            switch (n[i].tag) {
                                case Ze.NICK:
                                    o.nick = n[i].value;
                                    break;
                                case Ze.GENDER:
                                    o.gender = n[i].value;
                                    break;
                                case Ze.BIRTHDAY:
                                    o.birthday = n[i].value;
                                    break;
                                case Ze.LOCATION:
                                    o.location = n[i].value;
                                    break;
                                case Ze.SELFSIGNATURE:
                                    o.selfSignature = n[i].value;
                                    break;
                                case Ze.ALLOWTYPE:
                                    o.allowType = n[i].value;
                                    break;
                                case Ze.LANGUAGE:
                                    o.language = n[i].value;
                                    break;
                                case Ze.AVATAR:
                                    o.avatar = n[i].value;
                                    break;
                                case Ze.MESSAGESETTINGS:
                                    o.messageSettings = n[i].value;
                                    break;
                                case Ze.ADMINFORBIDTYPE:
                                    o.adminForbidType = n[i].value;
                                    break;
                                case Ze.LEVEL:
                                    o.level = n[i].value;
                                    break;
                                case Ze.ROLE:
                                    o.role = n[i].value;
                                    break;
                                default:
                                    J.debug('snsProfileItem unkown tag->', n[i].tag);
                            }
                        }
                    }
                    this.profile = new ou(o);
                };
                var uu = (function () {
                    function e(t) {
                        r(this, e);
                        this.userController = t;
                        this.TAG = 'friend';
                        this.Actions = {
                            G: 'get',
                            D: 'delete'
                        };
                        this.friends = new Map();
                        this.pointer = new su();
                    }
                    i(e, [
                        {
                            key: 'isMyFriend',
                            value: function (e) {
                                var t = this.friends.has(e);
                                t || J.debug('FriendHandler.isMyFriend ' + e + ' is not my friend');
                                return t;
                            }
                        },
                        {
                            key: '_transformFriendList',
                            value: function (e) {
                                if (!we(e) && !we(e.infoItem)) {
                                    J.info('FriendHandler._transformFriendList friendNum=' + e.friendNum);
                                    for (var t, n, r = e.infoItem, o = 0, i = r.length; o < i; o++) {
                                        n = r[o].infoAccount;
                                        t = new au(n, r[o].snsProfileItem);
                                        this.friends.set(n, t);
                                    }
                                }
                            }
                        },
                        {
                            key: '_friends2map',
                            value: function (e) {
                                var t = new Map();
                                for (var n in e) {
                                    if (Object.prototype.hasOwnProperty.call(e, n)) {
                                        t.set(n, e[n]);
                                    }
                                }
                                return t;
                            }
                        },
                        {
                            key: 'getFriendList',
                            value: function () {
                                var that = this;
                                var t = {};
                                t.fromAccount = this.userController.getMyAccount();
                                J.info('FriendHandler.getFriendList myAccount=' + t.fromAccount);
                                var n = this.userController.generateConfig(this.TAG, this.Actions.G, t);
                                return this.userController
                                    .request(n)
                                    .then(function (t) {
                                        J.info('FriendHandler.getFriendList ok');
                                        that._transformFriendList(t.data);
                                        var n = _(that.friends.values());
                                        return zo(n);
                                    })
                                    .catch(function (e) {
                                        J.error('FriendHandler.getFriendList error:', JSON.stringify(e));
                                        return Wo(e);
                                    });
                            }
                        },
                        {
                            key: 'deleteFriend',
                            value: function (e) {
                                if (!Array.isArray(e.toAccount)) {
                                    J.error('FriendHandler.deleteFriend options.toAccount 必需是数组');
                                    return Wo({
                                        code: tn,
                                        message: hr
                                    });
                                }
                                if (e.toAccount.length > 1000) {
                                    J.warn('FriendHandler.deleteFriend 删除好友人数不能超过1000人');
                                    e.toAccount.length = 1000;
                                }
                                var t = this.userController.generateConfig(this.TAG, this.Actions.D, e);
                                return this.userController
                                    .request(t)
                                    .then(function (e) {
                                        J.info('FriendHandler.deleteFriend ok');
                                        return zo();
                                    })
                                    .catch(function (e) {
                                        J.error('FriendHandler.deleteFriend error:', e);
                                        return Wo(e);
                                    });
                            }
                        }
                    ]);
                    return e;
                })();
                var lu = function e(t) {
                    r(this, e);
                    we || ((this.userID = t.userID || ''), (this.timeStamp = t.timeStamp || 0));
                };
                var cu = (function () {
                    function t(e) {
                        r(this, t);
                        this.userController = e;
                        this.TAG = 'blacklist';
                        this.Actions = {
                            G: 'get',
                            C: 'create',
                            D: 'delete'
                        };
                        this.blacklistMap = new Map();
                        this.startIndex = 0;
                        this.maxLimited = 100;
                        this.curruentSequence = 0;
                    }
                    i(t, [
                        {
                            key: 'getBlacklist',
                            value: function () {
                                var that = this;
                                var t = {};
                                t.fromAccount = this.userController.getMyAccount();
                                t.maxLimited = this.maxLimited;
                                t.startIndex = 0;
                                t.lastSequence = this.curruentSequence;
                                var n = new oi();
                                n.setMethod(xi).setStart();
                                var r = this.userController.generateConfig(this.TAG, this.Actions.G, t);
                                return this.userController
                                    .request(r)
                                    .then(function (t) {
                                        var r = we(t.data.blackListItem) ? 0 : t.data.blackListItem.length;
                                        n.setCode(0).setNetworkType(that.userController.getNetworkType()).setText(r).setEnd();
                                        J.info('BlacklistHandler.getBlacklist ok');
                                        that.curruentSequence = t.data.curruentSequence;
                                        that._handleResponse(t.data.blackListItem, true);
                                        return that._onBlacklistUpdated();
                                    })
                                    .catch(function (t) {
                                        that.userController.probeNetwork().then(function (e) {
                                            var r = v(e, 2);
                                            var o = r[0];
                                            var i = r[1];
                                            n.setError(t, o, i).setEnd();
                                        });
                                        J.error('BlacklistHandler.getBlacklist error:', t);
                                        return Wo(t);
                                    });
                            }
                        },
                        {
                            key: 'addBlacklist',
                            value: function (e) {
                                var that = this;
                                if (!re(e.userIDList)) {
                                    J.error('BlacklistHandler.addBlacklist options.userIDList 必需是数组');
                                    return Wo({
                                        code: on,
                                        message: gr
                                    });
                                }
                                var n = this.userController.tim.loginInfo.identifier;
                                if (1 === e.userIDList.length && e.userIDList[0] === n) {
                                    J.error('BlacklistHandler.addBlacklist 不能把自己拉黑');
                                    return Wo({
                                        code: an,
                                        message: yr
                                    });
                                }
                                if (e.userIDList.includes(n)) {
                                    e.userIDList = e.userIDList.filter(function (e) {
                                        return e !== n;
                                    });
                                    J.warn('BlacklistHandler.addBlacklist 不能把自己拉黑，已过滤');
                                }
                                e.fromAccount = this.userController.getMyAccount();
                                e.toAccount = e.userIDList;
                                var r = this.userController.generateConfig(this.TAG, this.Actions.C, e);
                                return this.userController
                                    .request(r)
                                    .then(function (e) {
                                        J.info('BlacklistHandler.addBlacklist ok');
                                        that._handleResponse(e.data.resultItem, true);
                                        return that._onBlacklistUpdated();
                                    })
                                    .catch(function (e) {
                                        J.error('BlacklistHandler.addBlacklist error:', e);
                                        return Wo(e);
                                    });
                            }
                        },
                        {
                            key: '_handleResponse',
                            value: function (e, t) {
                                if (!we(e)) {
                                    for (var n, r, o, i = 0, s = e.length; i < s; i++) {
                                        r = e[i].to;
                                        o = e[i].resultCode;
                                        if (oe(o) || 0 === o) {
                                            t
                                                ? (((n = this.blacklistMap.has(r) ? this.blacklistMap.get(r) : new lu()).userID = r),
                                                  !we(e[i].addBlackTimeStamp) && (n.timeStamp = e[i].addBlackTimeStamp),
                                                  this.blacklistMap.set(r, n))
                                                : this.blacklistMap.has(r) && ((n = this.blacklistMap.get(r)), this.blacklistMap.delete(r));
                                        }
                                    }
                                }
                                J.log('BlacklistHandler._handleResponse total=' + this.blacklistMap.size + ' bAdd=' + t);
                            }
                        },
                        {
                            key: 'deleteBlacklist',
                            value: function (e) {
                                var that = this;
                                if (!re(e.userIDList)) {
                                    J.error('BlacklistHandler.deleteBlacklist options.userIDList 必需是数组');
                                    return Wo({
                                        code: sn,
                                        message: mr
                                    });
                                }
                                e.fromAccount = this.userController.getMyAccount();
                                e.toAccount = e.userIDList;
                                var n = this.userController.generateConfig(this.TAG, this.Actions.D, e);
                                return this.userController
                                    .request(n)
                                    .then(function (e) {
                                        J.info('BlacklistHandler.deleteBlacklist ok');
                                        that._handleResponse(e.data.resultItem, false);
                                        return that._onBlacklistUpdated();
                                    })
                                    .catch(function (e) {
                                        J.error('BlacklistHandler.deleteBlacklist error:', e);
                                        return Wo(e);
                                    });
                            }
                        },
                        {
                            key: '_onBlacklistUpdated',
                            value: function () {
                                var t = _(this.blacklistMap.keys());
                                this.userController.emitOuterEvent(e.BLACKLIST_UPDATED, t);
                                return zo(t);
                            }
                        },
                        {
                            key: 'handleBlackListDelAccount',
                            value: function (t) {
                                for (var n, r = [], o = 0, i = t.length; o < i; o++) {
                                    n = t[o];
                                    if (this.blacklistMap.has(n)) {
                                        this.blacklistMap.delete(n);
                                        r.push(n);
                                    }
                                }
                                if (r.length > 0) {
                                    J.log('BlacklistHandler.handleBlackListDelAccount delCount=' + r.length + ' : ' + r.join(','));
                                    this.userController.emitOuterEvent(e.BLACKLIST_UPDATED, _(this.blacklistMap.keys()));
                                }
                            }
                        },
                        {
                            key: 'handleBlackListAddAccount',
                            value: function (t) {
                                for (var n, r = [], o = 0, i = t.length; o < i; o++) {
                                    n = t[o];
                                    this.blacklistMap.has(n) ||
                                        (this.blacklistMap.set(
                                            n,
                                            new lu({
                                                userID: n
                                            })
                                        ),
                                        r.push(n));
                                }
                                if (r.length > 0) {
                                    J.log('BlacklistHandler.handleBlackListAddAccount addCount=' + r.length + ' : ' + r.join(','));
                                    this.userController.emitOuterEvent(e.BLACKLIST_UPDATED, _(this.blacklistMap.keys()));
                                }
                            }
                        },
                        {
                            key: 'reset',
                            value: function () {
                                this.blacklistMap.clear();
                                this.startIndex = 0;
                                this.maxLimited = 100;
                                this.curruentSequence = 0;
                            }
                        }
                    ]);
                    return t;
                })();
                var pu = (function () {
                    function e(t) {
                        r(this, e);
                        this.userController = t;
                        this.TAG = 'applyC2C';
                        this.Actions = {
                            C: 'create',
                            G: 'get',
                            D: 'delete',
                            U: 'update'
                        };
                    }
                    i(e, [
                        {
                            key: 'applyAddFriend',
                            value: function (e) {
                                var that = this;
                                var n = this.userController.generateConfig(this.TAG, this.Actions.C, e);
                                var r = this.userController.request(n);
                                r.then(function (e) {
                                    that.userController.isActionSuccessful('applyAddFriend', that.Actions.C, e);
                                }).catch(function (e) {});
                                return r;
                            }
                        },
                        {
                            key: 'getPendency',
                            value: function (e) {
                                var that = this;
                                var n = this.userController.generateConfig(this.TAG, this.Actions.G, e);
                                var r = this.userController.request(n);
                                r.then(function (e) {
                                    that.userController.isActionSuccessful('getPendency', that.Actions.G, e);
                                }).catch(function (e) {});
                                return r;
                            }
                        },
                        {
                            key: 'deletePendency',
                            value: function (e) {
                                var that = this;
                                var n = this.userController.generateConfig(this.TAG, this.Actions.D, e);
                                var r = this.userController.request(n);
                                r.then(function (e) {
                                    that.userController.isActionSuccessful('deletePendency', that.Actions.D, e);
                                }).catch(function (e) {});
                                return r;
                            }
                        },
                        {
                            key: 'replyPendency',
                            value: function () {
                                var that = this;
                                var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
                                var n = this.userController.generateConfig(this.TAG, this.Actions.U, t);
                                var r = this.userController.request(n);
                                r.then(function (t) {
                                    that.userController.isActionSuccessful('replyPendency', that.Actions.U, t);
                                }).catch(function (e) {});
                                return r;
                            }
                        }
                    ]);
                    return e;
                })();
                var hu = (function (e) {
                    l(n, e);
                    var t = y(n);
                    function n(e) {
                        var o;
                        r(this, n);
                        (o = t.call(this, e)).profileHandler = new iu(g(o));
                        o.friendHandler = new uu(g(o));
                        o.blacklistHandler = new cu(g(o));
                        o.applyC2CHandler = new pu(g(o));
                        o._initializeListener();
                        return o;
                    }
                    i(n, [
                        {
                            key: '_initializeListener',
                            value: function (e) {
                                var t = this.tim.innerEmitter;
                                t.on(Yr, this.onContextUpdated, this);
                                t.on(yo, this.onProfileModified, this);
                                t.on(mo, this.onNewFriendMessages, this);
                                t.on(Ro, this.onConversationsProfileUpdated, this);
                            }
                        },
                        {
                            key: 'onContextUpdated',
                            value: function (e) {
                                var t = this.tim.context;
                                if (false != !!t.a2Key && false != !!t.tinyID) {
                                    this.profileHandler.getMyProfile();
                                    this.friendHandler.getFriendList();
                                    this.blacklistHandler.getBlacklist();
                                }
                            }
                        },
                        {
                            key: 'onGotMyProfile',
                            value: function () {
                                this.triggerReady();
                            }
                        },
                        {
                            key: 'onProfileModified',
                            value: function (e) {
                                this.profileHandler.onProfileModified(e);
                            }
                        },
                        {
                            key: 'onNewFriendMessages',
                            value: function (e) {
                                J.debug('onNewFriendMessages', JSON.stringify(e.data));
                                we(e.data.blackListDelAccount) || this.blacklistHandler.handleBlackListDelAccount(e.data.blackListDelAccount);
                                we(e.data.blackListAddAccount) || this.blacklistHandler.handleBlackListAddAccount(e.data.blackListAddAccount);
                            }
                        },
                        {
                            key: 'onConversationsProfileUpdated',
                            value: function (e) {
                                this.profileHandler.onConversationsProfileUpdated(e.data);
                            }
                        },
                        {
                            key: 'getMyAccount',
                            value: function () {
                                return this.tim.context.identifier;
                            }
                        },
                        {
                            key: 'isMyFriend',
                            value: function (e) {
                                return this.friendHandler.isMyFriend(e);
                            }
                        },
                        {
                            key: 'generateConfig',
                            value: function (e, t, n) {
                                return {
                                    name: e,
                                    action: t,
                                    param: n
                                };
                            }
                        },
                        {
                            key: 'getMyProfile',
                            value: function () {
                                return this.profileHandler.getMyProfile();
                            }
                        },
                        {
                            key: 'getUserProfile',
                            value: function (e) {
                                return this.profileHandler.getUserProfile(e);
                            }
                        },
                        {
                            key: 'updateMyProfile',
                            value: function (e) {
                                return this.profileHandler.updateMyProfile(e);
                            }
                        },
                        {
                            key: 'getFriendList',
                            value: function () {
                                return this.friendHandler.getFriendList();
                            }
                        },
                        {
                            key: 'deleteFriend',
                            value: function (e) {
                                return this.friendHandler.deleteFriend(e);
                            }
                        },
                        {
                            key: 'getBlacklist',
                            value: function () {
                                return this.blacklistHandler.getBlacklist();
                            }
                        },
                        {
                            key: 'addBlacklist',
                            value: function (e) {
                                return this.blacklistHandler.addBlacklist(e);
                            }
                        },
                        {
                            key: 'deleteBlacklist',
                            value: function (e) {
                                return this.blacklistHandler.deleteBlacklist(e);
                            }
                        },
                        {
                            key: 'applyAddFriend',
                            value: function (e) {
                                return this.applyC2CHandler.applyAddFriend(e);
                            }
                        },
                        {
                            key: 'getPendency',
                            value: function (e) {
                                return this.applyC2CHandler.getPendency(e);
                            }
                        },
                        {
                            key: 'deletePendency',
                            value: function (e) {
                                return this.applyC2CHandler.deletePendency(e);
                            }
                        },
                        {
                            key: 'replyPendency',
                            value: function (e) {
                                return this.applyC2CHandler.replyPendency(e);
                            }
                        },
                        {
                            key: 'reset',
                            value: function () {
                                J.info('UserController.reset');
                                this.resetReady();
                                this.profileHandler.reset();
                                this.blacklistHandler.reset();
                                this.checkTimes = 0;
                            }
                        }
                    ]);
                    return n;
                })(Bo);
                var fu = [
                    'groupID',
                    'name',
                    'avatar',
                    'type',
                    'introduction',
                    'notification',
                    'ownerID',
                    'selfInfo',
                    'createTime',
                    'infoSequence',
                    'lastInfoTime',
                    'lastMessage',
                    'nextMessageSeq',
                    'memberNum',
                    'maxMemberNum',
                    'memberList',
                    'joinOption',
                    'groupCustomField',
                    'muteAllMembers'
                ];
                var du = (function () {
                    function e(t) {
                        r(this, e);
                        this.groupID = '';
                        this.name = '';
                        this.avatar = '';
                        this.type = '';
                        this.introduction = '';
                        this.notification = '';
                        this.ownerID = '';
                        this.createTime = '';
                        this.infoSequence = '';
                        this.lastInfoTime = '';
                        this.selfInfo = {
                            messageRemindType: '',
                            joinTime: '',
                            nameCard: '',
                            role: ''
                        };
                        this.lastMessage = {
                            lastTime: '',
                            lastSequence: '',
                            fromAccount: '',
                            messageForShow: ''
                        };
                        this.nextMessageSeq = '';
                        this.memberNum = '';
                        this.maxMemberNum = '';
                        this.joinOption = '';
                        this.groupCustomField = [];
                        this.muteAllMembers = void 0;
                        this._initGroup(t);
                    }
                    i(e, [
                        {
                            key: '_initGroup',
                            value: function (e) {
                                for (var t in e) {
                                    fu.indexOf(t) < 0 || ('selfInfo' !== t ? (this[t] = e[t]) : this.updateSelfInfo(e[t]));
                                }
                            }
                        },
                        {
                            key: 'updateGroup',
                            value: function (e) {
                                if (e.lastMsgTime) {
                                    this.lastMessage.lastTime = e.lastMsgTime;
                                }
                                oe(e.muteAllMembers) || ('On' === e.muteAllMembers ? (e.muteAllMembers = true) : (e.muteAllMembers = false));
                                if (e.groupCustomField) {
                                    Se(this.groupCustomField, e.groupCustomField);
                                }
                                he(this, e, ['members', 'errorCode', 'lastMsgTime', 'groupCustomField']);
                            }
                        },
                        {
                            key: 'updateSelfInfo',
                            value: function (e) {
                                var t = e.nameCard;
                                var n = e.joinTime;
                                var r = e.role;
                                var o = e.messageRemindType;
                                he(
                                    this.selfInfo,
                                    {
                                        nameCard: t,
                                        joinTime: n,
                                        role: r,
                                        messageRemindType: o
                                    },
                                    [],
                                    ['', null, void 0, 0, NaN]
                                );
                            }
                        },
                        {
                            key: 'setSelfNameCard',
                            value: function (e) {
                                this.selfInfo.nameCard = e;
                            }
                        }
                    ]);
                    return e;
                })();
                var gu = function (e, n) {
                    if (oe(n)) {
                        return '';
                    }
                    switch (e) {
                        case t.MSG_TEXT:
                            return n.text;
                        case t.MSG_IMAGE:
                            return '[图片]';
                        case t.MSG_GEO:
                            return '[位置]';
                        case t.MSG_AUDIO:
                            return '[语音]';
                        case t.MSG_VIDEO:
                            return '[视频]';
                        case t.MSG_FILE:
                            return '[文件]';
                        case t.MSG_CUSTOM:
                            return '[自定义消息]';
                        case t.MSG_GRP_TIP:
                            return '[群提示消息]';
                        case t.MSG_GRP_SYS_NOTICE:
                            return '[群系统通知]';
                        case t.MSG_FACE:
                            return '[动画表情]';
                        default:
                            return '';
                    }
                };
                var mu = (function () {
                    function e(t) {
                        var n;
                        r(this, e);
                        this.conversationID = t.conversationID || '';
                        this.unreadCount = t.unreadCount || 0;
                        this.type = t.type || '';
                        this.lastMessage =
                            ((n = t.lastMessage),
                            oe(n)
                                ? {
                                      lastTime: 0,
                                      lastSequence: 0,
                                      fromAccount: 0,
                                      messageForShow: '',
                                      payload: null,
                                      type: '',
                                      isRevoked: false
                                  }
                                : n instanceof br
                                ? {
                                      lastTime: n.time || 0,
                                      lastSequence: n.sequence || 0,
                                      fromAccount: n.from || '',
                                      messageForShow: gu(n.type, n.payload),
                                      payload: n.payload || null,
                                      type: n.type || null,
                                      isRevoked: false
                                  }
                                : u({}, n, {
                                      isRevoked: false,
                                      messageForShow: gu(n.type, n.payload)
                                  }));
                        this._isInfoCompleted = false;
                        this._initProfile(t);
                    }
                    i(e, [
                        {
                            key: '_initProfile',
                            value: function (e) {
                                var that = this;
                                Object.keys(e).forEach(function (t) {
                                    switch (t) {
                                        case 'userProfile':
                                            that.userProfile = e.userProfile;
                                            break;
                                        case 'groupProfile':
                                            that.groupProfile = e.groupProfile;
                                    }
                                });
                                oe(this.userProfile) && this.type === t.CONV_C2C
                                    ? (this.userProfile = new ou({
                                          userID: e.conversationID.replace('C2C', '')
                                      }))
                                    : oe(this.groupProfile) &&
                                      this.type === t.CONV_GROUP &&
                                      (this.groupProfile = new du({
                                          groupID: e.conversationID.replace('GROUP', '')
                                      }));
                            }
                        },
                        {
                            key: 'updateUnreadCount',
                            value: function (e, n) {
                                oe(e) ||
                                    (this.subType === t.GRP_CHATROOM || Te(this.subType)
                                        ? (this.unreadCount = 0)
                                        : n && this.type === t.CONV_GROUP
                                        ? (this.unreadCount = e)
                                        : (this.unreadCount = this.unreadCount + e));
                            }
                        },
                        {
                            key: 'reduceUnreadCount',
                            value: function () {
                                if (this.unreadCount >= 1) {
                                    this.unreadCount -= 1;
                                }
                            }
                        },
                        {
                            key: 'isLastMessageRevoked',
                            value: function (e) {
                                var n = e.sequence;
                                var r = e.time;
                                return (
                                    (this.type === t.CONV_C2C && n === this.lastMessage.lastSequence && r === this.lastMessage.lastTime) ||
                                    (this.type === t.CONV_GROUP && n === this.lastMessage.lastSequence)
                                );
                            }
                        },
                        {
                            key: 'setLastMessageRevoked',
                            value: function (e) {
                                this.lastMessage.isRevoked = e;
                            }
                        },
                        {
                            key: 'toAccount',
                            get: function () {
                                return this.conversationID.replace('C2C', '').replace('GROUP', '');
                            }
                        },
                        {
                            key: 'subType',
                            get: function () {
                                return this.groupProfile ? this.groupProfile.type : '';
                            }
                        }
                    ]);
                    return e;
                })();
                var yu = (function (n) {
                    l(s, n);
                    var o = y(s);
                    function s(e) {
                        var t;
                        r(this, s);
                        (t = o.call(this, e)).pagingStatus = Ge.NOT_START;
                        t.pagingTimeStamp = 0;
                        t.conversationMap = new Map();
                        t.tempGroupList = [];
                        t._initListeners();
                        return t;
                    }
                    i(s, [
                        {
                            key: 'hasLocalConversationMap',
                            value: function () {
                                return this.conversationMap.size > 0;
                            }
                        },
                        {
                            key: 'createLocalConversation',
                            value: function (e) {
                                return this.conversationMap.has(e)
                                    ? this.conversationMap.get(e)
                                    : new mu({
                                          conversationID: e,
                                          type: e.slice(0, 3) === t.CONV_C2C ? t.CONV_C2C : t.CONV_GROUP
                                      });
                            }
                        },
                        {
                            key: 'hasLocalConversation',
                            value: function (e) {
                                return this.conversationMap.has(e);
                            }
                        },
                        {
                            key: 'getConversationList',
                            value: function () {
                                var that = this;
                                J.log('ConversationController.getConversationList.');
                                if (this.pagingStatus === Ge.REJECTED) {
                                    J.log('ConversationController.getConversationList. continue to sync conversationList');
                                    this._syncConversationList();
                                }
                                var t = new oi();
                                t.setMethod(yi).setStart();
                                return this.request({
                                    name: 'conversation',
                                    action: 'query'
                                })
                                    .then(function (n) {
                                        var r = n.data.conversations;
                                        var o = void 0 === r ? [] : r;
                                        var i = that._getConversationOptions(o);
                                        that._updateLocalConversationList(i, true);
                                        that._setStorageConversationList();
                                        t.setCode(0).setText(o.length).setNetworkType(that.getNetworkType()).setEnd();
                                        J.log('ConversationController.getConversationList ok.');
                                        return zo({
                                            conversationList: that.getLocalConversationList()
                                        });
                                    })
                                    .catch(function (n) {
                                        that.probeNetwork().then(function (e) {
                                            var r = v(e, 2);
                                            var o = r[0];
                                            var i = r[1];
                                            t.setError(n, o, i).setEnd();
                                        });
                                        J.error('ConversationController.getConversationList error:', n);
                                        return Wo(n);
                                    });
                            }
                        },
                        {
                            key: '_syncConversationList',
                            value: function () {
                                var that = this;
                                var t = new oi();
                                t.setMethod(_i).setStart();
                                if (this.pagingStatus === Ge.NOT_START) {
                                    this.conversationMap.clear();
                                }
                                return this._autoPagingSyncConversationList()
                                    .then(function (n) {
                                        that.pagingStatus = Ge.RESOLVED;
                                        that._setStorageConversationList();
                                        t.setCode(0).setText(''.concat(that.conversationMap.size)).setNetworkType(that.getNetworkType()).setEnd();
                                        return n;
                                    })
                                    .catch(function (n) {
                                        that.pagingStatus = Ge.REJECTED;
                                        t.setText(that.pagingTimeStamp);
                                        that.probeNetwork().then(function (e) {
                                            var r = v(e, 2);
                                            var o = r[0];
                                            var i = r[1];
                                            t.setError(n, o, i).setEnd();
                                        });
                                        return Wo(n);
                                    });
                            }
                        },
                        {
                            key: '_autoPagingSyncConversationList',
                            value: function () {
                                var that = this;
                                this.pagingStatus = Ge.PENDING;
                                return this.request({
                                    name: 'conversation',
                                    action: 'pagingQuery',
                                    param: {
                                        fromAccount: this.tim.context.identifier,
                                        timeStamp: this.pagingTimeStamp,
                                        orderType: 1
                                    }
                                }).then(function (t) {
                                    var n = t.data;
                                    var r = n.completeFlag;
                                    var o = n.conversations;
                                    var i = void 0 === o ? [] : o;
                                    var s = n.timeStamp;
                                    J.log('ConversationController._autoPagingSyncConversationList completeFlag='.concat(r, ' nums=').concat(i.length));
                                    if (i.length > 0) {
                                        var a = that._getConversationOptions(i);
                                        that._updateLocalConversationList(a, true);
                                    }
                                    that._isReady ? that._emitConversationUpdate() : that.triggerReady();
                                    that.pagingTimeStamp = s;
                                    return 1 !== r ? that._autoPagingSyncConversationList() : zo();
                                });
                            }
                        },
                        {
                            key: 'getConversationProfile',
                            value: function (e) {
                                var n = this.conversationMap.has(e) ? this.conversationMap.get(e) : this.createLocalConversation(e);
                                return n._isInfoCompleted || n.type === t.CONV_SYSTEM
                                    ? zo({
                                          conversation: n
                                      })
                                    : (J.log('ConversationController.getConversationProfile. conversationID:', e),
                                      this._updateUserOrGroupProfileCompletely(n)
                                          .then(function (t) {
                                              J.log('ConversationController.getConversationProfile ok. conversationID:', e);
                                              return t;
                                          })
                                          .catch(function (e) {
                                              J.error('ConversationController.getConversationProfile error:', e);
                                              return Wo(e);
                                          }));
                            }
                        },
                        {
                            key: 'deleteConversation',
                            value: function (e) {
                                var that = this;
                                var r = {};
                                if (!this.conversationMap.has(e)) {
                                    var o = new pt({
                                        code: qt,
                                        message: Wn
                                    });
                                    return Wo(o);
                                }
                                switch (this.conversationMap.get(e).type) {
                                    case t.CONV_C2C:
                                        r.type = 1;
                                        r.toAccount = e.slice(3);
                                        break;
                                    case t.CONV_GROUP:
                                        r.type = 2;
                                        r.toGroupID = e.slice(5);
                                        break;
                                    case t.CONV_SYSTEM:
                                        this.tim.groupController.deleteGroupSystemNotice({
                                            messageList: this.tim.messageController.getLocalMessageList(e)
                                        });
                                        this.deleteLocalConversation(e);
                                        return zo({
                                            conversationID: e
                                        });
                                    default:
                                        var i = new pt({
                                            code: Ft,
                                            message: Jn
                                        });
                                        return Wo(i);
                                }
                                J.log('ConversationController.deleteConversation. conversationID:', e);
                                return this.tim
                                    .setMessageRead({
                                        conversationID: e
                                    })
                                    .then(function () {
                                        return that.request({
                                            name: 'conversation',
                                            action: 'delete',
                                            param: r
                                        });
                                    })
                                    .then(function () {
                                        J.log('ConversationController.deleteConversation ok. conversationID:', e);
                                        that.deleteLocalConversation(e);
                                        return zo({
                                            conversationID: e
                                        });
                                    })
                                    .catch(function (e) {
                                        J.error('ConversationController.deleteConversation error:', e);
                                        return Wo(e);
                                    });
                            }
                        },
                        {
                            key: 'getLocalConversationList',
                            value: function () {
                                return _(this.conversationMap.values());
                            }
                        },
                        {
                            key: 'getLocalConversation',
                            value: function (e) {
                                return this.conversationMap.get(e);
                            }
                        },
                        {
                            key: '_initLocalConversationList',
                            value: function () {
                                var e = new oi();
                                e.setMethod(vi).setStart();
                                J.time(ti);
                                J.log('ConversationController._initLocalConversationList init');
                                var t = this._getStorageConversationList();
                                if (t) {
                                    for (var n = t.length, r = 0; r < n; r++) {
                                        this.conversationMap.set(t[r].conversationID, new mu(t[r]));
                                    }
                                    this._emitConversationUpdate(true, false);
                                    e.setCode(0).setNetworkType(this.getNetworkType()).setText(n).setEnd();
                                } else {
                                    e.setCode(0).setNetworkType(this.getNetworkType()).setText(0).setEnd();
                                }
                                this._syncConversationList();
                            }
                        },
                        {
                            key: '_getStorageConversationList',
                            value: function () {
                                return this.tim.storage.getItem('conversationMap');
                            }
                        },
                        {
                            key: '_setStorageConversationList',
                            value: function () {
                                var e = this.getLocalConversationList()
                                    .slice(0, 20)
                                    .map(function (e) {
                                        return {
                                            conversationID: e.conversationID,
                                            type: e.type,
                                            subType: e.subType,
                                            lastMessage: e.lastMessage,
                                            groupProfile: e.groupProfile,
                                            userProfile: e.userProfile
                                        };
                                    });
                                this.tim.storage.setItem('conversationMap', e);
                            }
                        },
                        {
                            key: '_initListeners',
                            value: function () {
                                var that = this;
                                this.tim.innerEmitter.once(Yr, this._initLocalConversationList, this);
                                this.tim.innerEmitter.on(Jr, this._onSendOrReceiveMessage, this);
                                this.tim.innerEmitter.on(Qr, this._handleSyncMessages, this);
                                this.tim.innerEmitter.on(Zr, this._handleSyncMessages, this);
                                this.tim.innerEmitter.on(eo, this._onSendOrReceiveMessage, this);
                                this.tim.innerEmitter.on(to, this._onSendOrReceiveMessage, this);
                                this.tim.innerEmitter.on(no, this._onSendOrReceiveMessage, this);
                                this.tim.innerEmitter.on(So, this._onGroupListUpdated, this);
                                this.tim.innerEmitter.on(Lo, this._updateConversationUserProfile, this);
                                this.tim.innerEmitter.on(ro, this._onMessageRevoked, this);
                                this.ready(function () {
                                    if (that.tempGroupList.length > 0) {
                                        that._updateConversationGroupProfile(that.tempGroupList);
                                        that.tempGroupList.length = 0;
                                    }
                                });
                            }
                        },
                        {
                            key: '_onGroupListUpdated',
                            value: function (e) {
                                this._updateConversationGroupProfile(e.data);
                            }
                        },
                        {
                            key: '_updateConversationGroupProfile',
                            value: function (e) {
                                var that = this;
                                (re(e) && 0 === e.length) ||
                                    (this.hasLocalConversationMap()
                                        ? (e.forEach(function (e) {
                                              var n = 'GROUP'.concat(e.groupID);
                                              if (that.conversationMap.has(n)) {
                                                  var r = that.conversationMap.get(n);
                                                  r.groupProfile = e;
                                                  if (r.lastMessage.lastSequence < e.nextMessageSeq) {
                                                      r.lastMessage.lastSequence = e.nextMessageSeq - 1;
                                                  }
                                                  r.subType || (r.subType = e.type);
                                              }
                                          }),
                                          this._emitConversationUpdate(true, false))
                                        : (this.tempGroupList = e));
                            }
                        },
                        {
                            key: '_updateConversationUserProfile',
                            value: function (e) {
                                var that = this;
                                e.data.forEach(function (e) {
                                    var n = 'C2C'.concat(e.userID);
                                    if (that.conversationMap.has(n)) {
                                        that.conversationMap.get(n).userProfile = e;
                                    }
                                });
                                this._emitConversationUpdate(true, false);
                            }
                        },
                        {
                            key: '_onMessageRevoked',
                            value: function (e) {
                                var that = this;
                                var n = e.data;
                                if (0 !== n.length) {
                                    var r = null;
                                    var o = false;
                                    n.forEach(function (e) {
                                        if ((r = that.conversationMap.get(e.conversationID)) && r.isLastMessageRevoked(e)) {
                                            o = true;
                                            r.setLastMessageRevoked(true);
                                        }
                                    });
                                    if (o) {
                                        this._emitConversationUpdate(true, false);
                                    }
                                }
                            }
                        },
                        {
                            key: '_handleSyncMessages',
                            value: function (e) {
                                this._onSendOrReceiveMessage(e, true);
                            }
                        },
                        {
                            key: '_onSendOrReceiveMessage',
                            value: function (e) {
                                var that = this;
                                var n = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
                                var r = e.data.eventDataList;
                                this._isReady
                                    ? 0 !== r.length && (this._updateLocalConversationList(r, false, n), this._setStorageConversationList(), this._emitConversationUpdate())
                                    : this.ready(function () {
                                          that._onSendOrReceiveMessage(e, n);
                                      });
                            }
                        },
                        {
                            key: '_updateLocalConversationList',
                            value: function (e, t, n) {
                                var r;
                                r = this._updateTempConversations(e, t, n);
                                this.conversationMap = new Map(this._sortConversations([].concat(_(r.conversations), _(this.conversationMap))));
                                t || this._updateUserOrGroupProfile(r.newerConversations);
                            }
                        },
                        {
                            key: '_updateTempConversations',
                            value: function (e, n, r) {
                                for (var o = [], i = [], s = 0, a = e.length; s < a; s++) {
                                    var u = new mu(e[s]);
                                    var l = this.conversationMap.get(u.conversationID);
                                    if (this.conversationMap.has(u.conversationID)) {
                                        var c = ['unreadCount', 'allowType', 'adminForbidType', 'payload'];
                                        if (r) {
                                            c.push('lastMessage');
                                        }
                                        he(l, u, c, [null, void 0, '', 0, NaN]);
                                        l.updateUnreadCount(u.unreadCount, n);
                                        r || (l.lastMessage.payload = e[s].lastMessage.payload);
                                        this.conversationMap.delete(l.conversationID);
                                        o.push([l.conversationID, l]);
                                    } else {
                                        if (u.type === t.CONV_GROUP) {
                                            var p = u.groupProfile.groupID;
                                            var h = this.tim.groupController.getLocalGroupProfile(p);
                                            if (h) {
                                                u.groupProfile = h;
                                                u.updateUnreadCount(0);
                                            }
                                        }
                                        i.push(u);
                                        o.push([u.conversationID, u]);
                                    }
                                }
                                return {
                                    conversations: o,
                                    newerConversations: i
                                };
                            }
                        },
                        {
                            key: '_sortConversations',
                            value: function (e) {
                                return e.sort(function (e, t) {
                                    return t[1].lastMessage.lastTime - e[1].lastMessage.lastTime;
                                });
                            }
                        },
                        {
                            key: '_updateUserOrGroupProfile',
                            value: function (e) {
                                var that = this;
                                if (0 !== e.length) {
                                    var r = [];
                                    var o = [];
                                    e.forEach(function (e) {
                                        if (e.type === t.CONV_C2C) r.push(e.toAccount);
                                        else if (e.type === t.CONV_GROUP) {
                                            var i = e.toAccount;
                                            that.tim.groupController.hasLocalGroup(i) ? (e.groupProfile = that.tim.groupController.getLocalGroupProfile(i)) : o.push(i);
                                        }
                                    });
                                    if (r.length > 0) {
                                        this.tim
                                            .getUserProfile({
                                                userIDList: r
                                            })
                                            .then(function (e) {
                                                var t = e.data;
                                                re(t)
                                                    ? t.forEach(function (e) {
                                                          that.conversationMap.get('C2C'.concat(e.userID)).userProfile = e;
                                                      })
                                                    : (that.conversationMap.get('C2C'.concat(t.userID)).userProfile = t);
                                            });
                                    }
                                    if (o.length > 0) {
                                        this.tim.groupController
                                            .getGroupProfileAdvance({
                                                groupIDList: o,
                                                responseFilter: {
                                                    groupBaseInfoFilter: ['Type', 'Name', 'FaceUrl']
                                                }
                                            })
                                            .then(function (e) {
                                                e.data.successGroupList.forEach(function (e) {
                                                    var t = 'GROUP'.concat(e.groupID);
                                                    if (that.conversationMap.has(t)) {
                                                        var r = that.conversationMap.get(t);
                                                        he(r.groupProfile, e, [], [null, void 0, '', 0, NaN]);
                                                        if (!r.subType && e.type) {
                                                            r.subType = e.type;
                                                        }
                                                    }
                                                });
                                            });
                                    }
                                }
                            }
                        },
                        {
                            key: '_updateUserOrGroupProfileCompletely',
                            value: function (e) {
                                var that = this;
                                return e.type === t.CONV_C2C
                                    ? this.tim
                                          .getUserProfile({
                                              userIDList: [e.toAccount]
                                          })
                                          .then(function (t) {
                                              var r = t.data;
                                              return 0 === r.length
                                                  ? Wo(
                                                        new pt({
                                                            code: xt,
                                                            message: Xn
                                                        })
                                                    )
                                                  : ((e.userProfile = r[0]),
                                                    (e._isInfoCompleted = true),
                                                    that._unshiftConversation(e),
                                                    zo({
                                                        conversation: e
                                                    }));
                                          })
                                    : this.tim
                                          .getGroupProfile({
                                              groupID: e.toAccount
                                          })
                                          .then(function (t) {
                                              e.groupProfile = t.data.group;
                                              e._isInfoCompleted = true;
                                              that._unshiftConversation(e);
                                              return zo({
                                                  conversation: e
                                              });
                                          });
                            }
                        },
                        {
                            key: '_unshiftConversation',
                            value: function (e) {
                                if (e instanceof mu && !this.conversationMap.has(e.conversationID)) {
                                    this.conversationMap = new Map([[e.conversationID, e]].concat(_(this.conversationMap)));
                                    this._setStorageConversationList();
                                    this._emitConversationUpdate(true, false);
                                }
                            }
                        },
                        {
                            key: 'deleteLocalConversation',
                            value: function (e) {
                                this.conversationMap.delete(e);
                                this._setStorageConversationList();
                                this.emitInnerEvent(Oo, e);
                                this._emitConversationUpdate(true, false);
                                return this.conversationMap.has(e);
                            }
                        },
                        {
                            key: '_getConversationOptions',
                            value: function (e) {
                                var t = [];
                                var n = e
                                    .filter(function (e) {
                                        var t = e.lastMsg;
                                        return ne(t);
                                    })
                                    .map(function (e) {
                                        if (1 === e.type) {
                                            var n = {
                                                userID: e.userID,
                                                nick: e.c2CNick,
                                                avatar: e.c2CImage
                                            };
                                            t.push(n);
                                            return {
                                                conversationID: 'C2C'.concat(e.userID),
                                                type: 'C2C',
                                                lastMessage: {
                                                    lastTime: e.time,
                                                    lastSequence: e.sequence,
                                                    fromAccount: e.lastC2CMsgFromAccount,
                                                    messageForShow: e.messageShow,
                                                    type: e.lastMsg.elements[0] ? e.lastMsg.elements[0].type : null,
                                                    payload: e.lastMsg.elements[0] ? e.lastMsg.elements[0].content : null
                                                },
                                                userProfile: new ou(n)
                                            };
                                        }
                                        return {
                                            conversationID: 'GROUP'.concat(e.groupID),
                                            type: 'GROUP',
                                            lastMessage: {
                                                lastTime: e.time,
                                                lastSequence: e.messageReadSeq + e.unreadCount,
                                                fromAccount: e.msgGroupFromAccount,
                                                messageForShow: e.messageShow,
                                                type: e.lastMsg.elements[0] ? e.lastMsg.elements[0].type : null,
                                                payload: e.lastMsg.elements[0] ? e.lastMsg.elements[0].content : null
                                            },
                                            groupProfile: new du({
                                                groupID: e.groupID,
                                                name: e.groupNick,
                                                avatar: e.groupImage
                                            }),
                                            unreadCount: e.unreadCount
                                        };
                                    });
                                if (t.length > 0) {
                                    this.emitInnerEvent(Ro, t);
                                }
                                return n;
                            }
                        },
                        {
                            key: '_emitConversationUpdate',
                            value: function () {
                                var t = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0];
                                var n = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1];
                                var r = _(this.conversationMap.values());
                                if (n) {
                                    this.emitInnerEvent(wo, r);
                                }
                                if (t) {
                                    this.emitOuterEvent(e.CONVERSATION_LIST_UPDATED, r);
                                }
                            }
                        },
                        {
                            key: '_conversationMapTreeShaking',
                            value: function (e) {
                                var that = this;
                                var r = new Map(_(this.conversationMap));
                                e.forEach(function (e) {
                                    return r.delete(e.conversationID);
                                });
                                if (r.has(t.CONV_SYSTEM)) {
                                    r.delete(t.CONV_SYSTEM);
                                }
                                var o = this.tim.groupController.getJoinedAVChatRoom();
                                if (o) {
                                    r.delete(''.concat(t.CONV_GROUP).concat(o.groupID));
                                }
                                _(r.keys()).forEach(function (e) {
                                    return that.conversationMap.delete(e);
                                });
                            }
                        },
                        {
                            key: 'reset',
                            value: function () {
                                this.pagingStatus = Ge.NOT_START;
                                this.pagingTimeStamp = 0;
                                this.conversationMap.clear();
                                this.resetReady();
                                this.tim.innerEmitter.once(Yr, this._initLocalConversationList, this);
                            }
                        }
                    ]);
                    return s;
                })(Bo);
                var vu = (function () {
                    function e(t) {
                        r(this, e);
                        if (void 0 === t) {
                            throw new pt({
                                code: Ct,
                                message: On
                            });
                        }
                        if (void 0 === t.tim) {
                            throw new pt({
                                code: Ct,
                                message: ''.concat(On, '.tim')
                            });
                        }
                        this.list = new Map();
                        this.tim = t.tim;
                        this._initializeOptions(t);
                    }
                    i(e, [
                        {
                            key: 'getLocalOldestMessageByConversationID',
                            value: function (e) {
                                if (!e) {
                                    return null;
                                }
                                if (!this.list.has(e)) {
                                    return null;
                                }
                                var t = this.list.get(e).values();
                                return t ? t.next().value : null;
                            }
                        },
                        {
                            key: '_initializeOptions',
                            value: function (e) {
                                this.options = {};
                                var t = {
                                    memory: {
                                        maxDatasPerKey: 100,
                                        maxBytesPerData: 256,
                                        maxKeys: 0
                                    },
                                    cache: {
                                        maxDatasPerKey: 10,
                                        maxBytesPerData: 256,
                                        maxKeys: 0
                                    }
                                };
                                for (var n in t) {
                                    if (Object.prototype.hasOwnProperty.call(t, n)) {
                                        if (void 0 === e[n]) {
                                            this.options[n] = t[n];
                                            continue;
                                        }
                                        var r = t[n];
                                        for (var o in r) {
                                            if (Object.prototype.hasOwnProperty.call(r, o)) {
                                                if (void 0 === e[n][o]) {
                                                    this.options[n][o] = r[o];
                                                    continue;
                                                }
                                                this.options[n][o] = e[n][o];
                                            }
                                        }
                                    }
                                }
                            }
                        },
                        {
                            key: 'pushIn',
                            value: function (e) {
                                var t = e.conversationID;
                                var n = e.ID;
                                var r = true;
                                this.list.has(t) || this.list.set(t, new Map());
                                this.list.has(t) && this.list.get(t).has(n) ? (r = false) : this.list.get(t).set(n, e);
                                return r;
                            }
                        },
                        {
                            key: 'unshift',
                            value: function (e) {
                                re(e) ? e.length > 0 && this._unshiftMultipleMessages(e) : this._unshiftSingleMessage(e);
                            }
                        },
                        {
                            key: '_unshiftSingleMessage',
                            value: function (e) {
                                var t = e.conversationID;
                                var n = e.ID;
                                if (!this.list.has(t)) {
                                    this.list.set(t, new Map());
                                    return void this.list.get(t).set(n, e);
                                }
                                var r = Array.from(this.list.get(t));
                                r.unshift([n, e]);
                                this.list.set(t, new Map(r));
                            }
                        },
                        {
                            key: '_unshiftMultipleMessages',
                            value: function (e) {
                                for (var t = e.length, n = [], r = e[0].conversationID, o = this.list.has(r) ? Array.from(this.list.get(r)) : [], i = 0; i < t; i++) {
                                    n.push([e[i].ID, e[i]]);
                                }
                                this.list.set(r, new Map(n.concat(o)));
                            }
                        },
                        {
                            key: 'remove',
                            value: function (e) {
                                var t = e.conversationID;
                                var n = e.ID;
                                if (this.list.has(t)) {
                                    this.list.get(t).delete(n);
                                }
                            }
                        },
                        {
                            key: 'revoke',
                            value: function (e, t, n) {
                                J.debug('revoke message', e, t, n);
                                if (this.list.has(e)) {
                                    var r;
                                    var o = I(this.list.get(e));
                                    try {
                                        for (o.s(); !(r = o.n()).done; ) {
                                            var i = v(r.value, 2)[1];
                                            if (i.sequence === t && !i.isRevoked && (oe(n) || i.random === n)) {
                                                i.isRevoked = true;
                                                return i;
                                            }
                                        }
                                    } catch (s) {
                                        console.log('CatchClause', s);
                                        console.log('CatchClause', s);
                                        o.e(s);
                                    } finally {
                                        o.f();
                                    }
                                }
                                return null;
                            }
                        },
                        {
                            key: 'removeByConversationID',
                            value: function (e) {
                                if (this.list.has(e)) {
                                    this.list.delete(e);
                                }
                            }
                        },
                        {
                            key: 'hasLocalMessageList',
                            value: function (e) {
                                return this.list.has(e);
                            }
                        },
                        {
                            key: 'getLocalMessageList',
                            value: function (e) {
                                return this.hasLocalMessageList(e) ? _(this.list.get(e).values()) : [];
                            }
                        },
                        {
                            key: 'hasLocalMessage',
                            value: function (e, t) {
                                return !!this.hasLocalMessageList(e) && this.list.get(e).has(t);
                            }
                        },
                        {
                            key: 'getLocalMessage',
                            value: function (e, t) {
                                return this.hasLocalMessage(e, t) ? this.list.get(e).get(t) : null;
                            }
                        },
                        {
                            key: 'reset',
                            value: function () {
                                this.list.clear();
                            }
                        }
                    ]);
                    return e;
                })();
                var _u = (function () {
                    function e(t) {
                        r(this, e);
                        this.tim = t;
                    }
                    i(e, [
                        {
                            key: 'setMessageRead',
                            value: function (e) {
                                var n = e.conversationID;
                                var r = e.messageID;
                                var o = this.tim.conversationController.getLocalConversation(n);
                                J.log('ReadReportHandler.setMessageRead conversationID='.concat(n, ' unreadCount=').concat(o ? o.unreadCount : 0));
                                if (!o || 0 === o.unreadCount) {
                                    return zo();
                                }
                                var i = r ? this.tim.messageController.getLocalMessage(n, r) : null;
                                switch (o.type) {
                                    case t.CONV_C2C:
                                        return this._setC2CMessageRead({
                                            conversationID: n,
                                            lastMessageTime: i ? i.time : o.lastMessage.lastTime
                                        });
                                    case t.CONV_GROUP:
                                        return this._setGroupMessageRead({
                                            conversationID: n,
                                            lastMessageSeq: i ? i.sequence : o.lastMessage.lastSequence
                                        });
                                    case t.CONV_SYSTEM:
                                        o.unreadCount = 0;
                                        return zo();
                                    default:
                                        return zo();
                                }
                            }
                        },
                        {
                            key: '_setC2CMessageRead',
                            value: function (e) {
                                var that = this;
                                var n = e.conversationID;
                                var r = e.lastMessageTime;
                                J.log('ReadReportHandler._setC2CMessageRead conversationID='.concat(n, ' lastMessageTime=').concat(r));
                                Z(r) || J.warn('ReadReportHandler._setC2CMessageRead 请勿修改 Conversation.lastMessage.lastTime，否则可能会导致已读上报结果不准确');
                                var o = new oi();
                                o.setMethod(gi).setText(''.concat(n, '-').concat(r)).setStart();
                                return this.tim.messageController
                                    .request({
                                        name: 'conversation',
                                        action: 'setC2CMessageRead',
                                        param: {
                                            C2CMsgReaded: {
                                                cookie: '',
                                                C2CMsgReadedItem: [
                                                    {
                                                        toAccount: n.replace('C2C', ''),
                                                        lastMessageTime: r
                                                    }
                                                ]
                                            }
                                        }
                                    })
                                    .then(function () {
                                        o.setCode(0).setNetworkType(that.tim.netMonitor.getNetworkType()).setEnd();
                                        J.log('ReadReportHandler._setC2CMessageRead ok.');
                                        that._updateIsReadAfterReadReport({
                                            conversationID: n,
                                            lastMessageTime: r
                                        });
                                        that._updateUnreadCount(n);
                                        return new jo();
                                    })
                                    .catch(function (e) {
                                        that.tim.netMonitor.probe().then(function (t) {
                                            var n = v(t, 2);
                                            var r = n[0];
                                            var i = n[1];
                                            o.setError(e, r, i).setEnd();
                                        });
                                        J.log('ReadReportHandler._setC2CMessageRead failed. '.concat(fe(e)));
                                        return Wo(e);
                                    });
                            }
                        },
                        {
                            key: '_setGroupMessageRead',
                            value: function (e) {
                                var that = this;
                                var n = e.conversationID;
                                var r = e.lastMessageSeq;
                                J.log('ReadReportHandler._setGroupMessageRead conversationID='.concat(n, ' lastMessageSeq=').concat(r));
                                Z(r) || J.warn('ReadReportHandler._setGroupMessageRead 请勿修改 Conversation.lastMessage.lastSequence，否则可能会导致已读上报结果不准确');
                                var o = new oi();
                                o.setMethod(mi).setText(''.concat(n, '-').concat(r)).setStart();
                                return this.tim.messageController
                                    .request({
                                        name: 'conversation',
                                        action: 'setGroupMessageRead',
                                        param: {
                                            groupID: n.replace('GROUP', ''),
                                            messageReadSeq: r
                                        }
                                    })
                                    .then(function () {
                                        o.setCode(0).setNetworkType(that.tim.netMonitor.getNetworkType()).setEnd();
                                        J.log('ReadReportHandler._setGroupMessageRead ok.');
                                        that._updateIsReadAfterReadReport({
                                            conversationID: n,
                                            lastMessageSeq: r
                                        });
                                        that._updateUnreadCount(n);
                                        return new jo();
                                    })
                                    .catch(function (e) {
                                        that.tim.netMonitor.probe().then(function (t) {
                                            var n = v(t, 2);
                                            var r = n[0];
                                            var i = n[1];
                                            o.setError(e, r, i).setEnd();
                                        });
                                        J.log('ReadReportHandler._setGroupMessageRead failed. '.concat(fe(e)));
                                        return Wo(e);
                                    });
                            }
                        },
                        {
                            key: '_updateUnreadCount',
                            value: function (e) {
                                var t = this.tim;
                                var n = t.conversationController;
                                var r = t.messageController;
                                var o = n.getLocalConversation(e);
                                var i = r.getLocalMessageList(e);
                                if (o) {
                                    o.unreadCount = i.filter(function (e) {
                                        return !e.isRead;
                                    }).length;
                                    J.log('ReadReportHandler._updateUnreadCount conversationID='.concat(o.conversationID, ' unreadCount=').concat(o.unreadCount));
                                }
                            }
                        },
                        {
                            key: '_updateIsReadAfterReadReport',
                            value: function (e) {
                                var t = e.conversationID;
                                var n = e.lastMessageSeq;
                                var r = e.lastMessageTime;
                                var o = this.tim.messageController.getLocalMessageList(t);
                                if (0 !== o.length) {
                                    for (var i, s = o.length - 1; s >= 0; s--) {
                                        i = o[s];
                                        if (!((r && i.time > r) || (n && i.sequence > n))) {
                                            if ('in' === i.flow && i.isRead) {
                                                break;
                                            }
                                            i.setIsRead(true);
                                        }
                                    }
                                }
                            }
                        },
                        {
                            key: 'updateIsRead',
                            value: function (e) {
                                var n = this.tim;
                                var r = n.conversationController;
                                var o = n.messageController;
                                var i = r.getLocalConversation(e);
                                var s = o.getLocalMessageList(e);
                                if (i && 0 !== s.length && !Ee(i.type)) {
                                    for (var a = [], u = 0; u < s.length; u++) {
                                        'in' !== s[u].flow ? 'out' !== s[u].flow || s[u].isRead || s[u].setIsRead(true) : a.push(s[u]);
                                    }
                                    var l = 0;
                                    if (i.type === t.CONV_C2C) {
                                        var c = a.slice(-i.unreadCount).filter(function (e) {
                                            return e.isRevoked;
                                        }).length;
                                        l = a.length - i.unreadCount - c;
                                    } else {
                                        l = a.length - i.unreadCount;
                                    }
                                    for (var p = 0; p < l && !a[p].isRead; p++) {
                                        a[p].setIsRead(true);
                                    }
                                }
                            }
                        }
                    ]);
                    return e;
                })();
                var Cu = (function () {
                    function e(t) {
                        var n = t.tim;
                        var o = t.messageController;
                        r(this, e);
                        this.tim = n;
                        this.messageController = o;
                        this.completedMap = new Map();
                        this._initListener();
                    }
                    i(e, [
                        {
                            key: 'getMessageList',
                            value: function (e) {
                                var that = this;
                                var n = e.conversationID;
                                var r = e.nextReqMessageID;
                                var o = e.count;
                                if (this.tim.groupController.checkJoinedAVChatRoomByID(n.replace('GROUP', ''))) {
                                    J.log('GetMessageHandler.getMessageList not available in avchatroom. conversationID='.concat(n));
                                    return zo({
                                        messageList: [],
                                        nextReqMessageID: '',
                                        isCompleted: true
                                    });
                                }
                                if (oe(o) || o > 15) {
                                    o = 15;
                                }
                                var i = this._computeLeftCount({
                                    conversationID: n,
                                    nextReqMessageID: r
                                });
                                J.log('GetMessageHandler.getMessageList. conversationID='.concat(n, ' leftCount=').concat(i, ' count=').concat(o, ' nextReqMessageID=').concat(r));
                                return this._needGetHistory({
                                    conversationID: n,
                                    leftCount: i,
                                    count: o
                                })
                                    ? this.messageController
                                          .getHistoryMessages({
                                              conversationID: n,
                                              count: 20
                                          })
                                          .then(function () {
                                              i = that._computeLeftCount({
                                                  conversationID: n,
                                                  nextReqMessageID: r
                                              });
                                              return new jo(
                                                  that._computeResult({
                                                      conversationID: n,
                                                      nextReqMessageID: r,
                                                      count: o,
                                                      leftCount: i
                                                  })
                                              );
                                          })
                                    : (J.log('GetMessageHandler.getMessageList. get messagelist from memory'),
                                      zo(
                                          this._computeResult({
                                              conversationID: n,
                                              nextReqMessageID: r,
                                              count: o,
                                              leftCount: i
                                          })
                                      ));
                            }
                        },
                        {
                            key: 'setCompleted',
                            value: function (e) {
                                J.log('GetMessageHandler.setCompleted. conversationID='.concat(e));
                                this.completedMap.set(e, true);
                            }
                        },
                        {
                            key: 'deleteCompletedItem',
                            value: function (e) {
                                J.log('GetMessageHandler.deleteCompletedItem. conversationID='.concat(e));
                                this.completedMap.delete(e);
                            }
                        },
                        {
                            key: '_initListener',
                            value: function () {
                                var that = this;
                                this.tim.innerEmitter.on(Po, function () {
                                    that.setCompleted(t.CONV_SYSTEM);
                                });
                                this.tim.innerEmitter.on(No, function (n) {
                                    var r = n.data;
                                    that.setCompleted(''.concat(t.CONV_GROUP).concat(r));
                                });
                            }
                        },
                        {
                            key: '_getMessageListSize',
                            value: function (e) {
                                return this.messageController.getLocalMessageList(e).length;
                            }
                        },
                        {
                            key: '_needGetHistory',
                            value: function (e) {
                                var n = e.conversationID;
                                var r = e.leftCount;
                                var o = e.count;
                                var i = this.tim.conversationController.getLocalConversation(n);
                                var s = !!i && i.type === t.CONV_SYSTEM;
                                var a = !!i && i.subType === t.GRP_AVCHATROOM;
                                return !s && !a && r < o && !this.completedMap.has(n);
                            }
                        },
                        {
                            key: '_computeResult',
                            value: function (e) {
                                var t = e.conversationID;
                                var n = e.nextReqMessageID;
                                var r = e.count;
                                var o = e.leftCount;
                                var i = this._computeMessageList({
                                    conversationID: t,
                                    nextReqMessageID: n,
                                    count: r
                                });
                                var s = this._computeIsCompleted({
                                    conversationID: t,
                                    leftCount: o,
                                    count: r
                                });
                                var a = this._computeNextReqMessageID({
                                    messageList: i,
                                    isCompleted: s,
                                    conversationID: t
                                });
                                J.log(
                                    'GetMessageHandler._computeResult. conversationID='
                                        .concat(t, ' leftCount=')
                                        .concat(o, ' count=')
                                        .concat(r, ' nextReqMessageID=')
                                        .concat(a, ' nums=')
                                        .concat(i.length, ' isCompleted=')
                                        .concat(s)
                                );
                                return {
                                    messageList: i,
                                    nextReqMessageID: a,
                                    isCompleted: s
                                };
                            }
                        },
                        {
                            key: '_computeNextReqMessageID',
                            value: function (e) {
                                var t = e.messageList;
                                var n = e.isCompleted;
                                var r = e.conversationID;
                                if (!n) {
                                    return 0 === t.length ? '' : t[0].ID;
                                }
                                var o = this.messageController.getLocalMessageList(r);
                                return 0 === o.length ? '' : o[0].ID;
                            }
                        },
                        {
                            key: '_computeMessageList',
                            value: function (e) {
                                var t = e.conversationID;
                                var n = e.nextReqMessageID;
                                var r = e.count;
                                var o = this.messageController.getLocalMessageList(t);
                                var i = this._computeIndexEnd({
                                    nextReqMessageID: n,
                                    messageList: o
                                });
                                var s = this._computeIndexStart({
                                    indexEnd: i,
                                    count: r
                                });
                                return o.slice(s, i);
                            }
                        },
                        {
                            key: '_computeIndexEnd',
                            value: function (e) {
                                var t = e.messageList;
                                var n = void 0 === t ? [] : t;
                                var r = e.nextReqMessageID;
                                return r
                                    ? n.findIndex(function (e) {
                                          return e.ID === r;
                                      })
                                    : n.length;
                            }
                        },
                        {
                            key: '_computeIndexStart',
                            value: function (e) {
                                var t = e.indexEnd;
                                var n = e.count;
                                return t > n ? t - n : 0;
                            }
                        },
                        {
                            key: '_computeLeftCount',
                            value: function (e) {
                                var t = e.conversationID;
                                var n = e.nextReqMessageID;
                                return n
                                    ? this.messageController.getLocalMessageList(t).findIndex(function (e) {
                                          return e.ID === n;
                                      })
                                    : this._getMessageListSize(t);
                            }
                        },
                        {
                            key: '_computeIsCompleted',
                            value: function (e) {
                                var t = e.conversationID;
                                return !!(e.leftCount <= e.count && this.completedMap.has(t));
                            }
                        },
                        {
                            key: 'reset',
                            value: function () {
                                J.log('GetMessageHandler.reset');
                                this.completedMap.clear();
                            }
                        }
                    ]);
                    return e;
                })();
                var Mu = function e(t) {
                    r(this, e);
                    this.value = t;
                    this.next = null;
                };
                var Iu = (function () {
                    function e(t) {
                        r(this, e);
                        this.MAX_LENGTH = t;
                        this.pTail = null;
                        this.pNodeToDel = null;
                        this.map = new Map();
                        J.log('SinglyLinkedList init MAX_LENGTH='.concat(this.MAX_LENGTH));
                    }
                    i(e, [
                        {
                            key: 'pushIn',
                            value: function (e) {
                                var t = new Mu(e);
                                if (this.map.size < this.MAX_LENGTH) {
                                    null === this.pTail ? ((this.pTail = t), (this.pNodeToDel = t)) : ((this.pTail.next = t), (this.pTail = t));
                                    this.map.set(e, 1);
                                } else {
                                    var n = this.pNodeToDel;
                                    this.pNodeToDel = this.pNodeToDel.next;
                                    this.map.delete(n.value);
                                    n.next = null;
                                    n = null;
                                    this.pTail.next = t;
                                    this.pTail = t;
                                    this.map.set(e, 1);
                                }
                            }
                        },
                        {
                            key: 'has',
                            value: function (e) {
                                return this.map.has(e);
                            }
                        },
                        {
                            key: 'reset',
                            value: function () {
                                for (var e; null !== this.pNodeToDel; ) {
                                    e = this.pNodeToDel;
                                    this.pNodeToDel = this.pNodeToDel.next;
                                    e.next = null;
                                    e = null;
                                }
                                this.pTail = null;
                                this.map.clear();
                            }
                        }
                    ]);
                    return e;
                })();
                var Su = (function () {
                    function e(t) {
                        r(this, e);
                        this.tim = t;
                    }
                    i(e, [
                        {
                            key: 'upload',
                            value: function (e) {
                                switch (e.type) {
                                    case t.MSG_IMAGE:
                                        return this._uploadImage(e);
                                    case t.MSG_FILE:
                                        return this._uploadFile(e);
                                    case t.MSG_AUDIO:
                                        return this._uploadAudio(e);
                                    case t.MSG_VIDEO:
                                        return this._uploadVideo(e);
                                    default:
                                        return Promise.resolve();
                                }
                            }
                        },
                        {
                            key: '_uploadImage',
                            value: function (e) {
                                var t = this.tim;
                                var n = t.uploadController;
                                var r = t.messageController;
                                var o = e.getElements()[0];
                                var i = r.getMessageOptionByID(e.messageID);
                                return n
                                    .uploadImage({
                                        file: i.payload.file,
                                        to: i.to,
                                        onProgress: function (e) {
                                            o.updatePercent(e);
                                            if (se(i.onProgress)) {
                                                try {
                                                    i.onProgress(e);
                                                } catch (t) {
                                                    console.log('CatchClause', t);
                                                    console.log('CatchClause', t);
                                                    return Wo(
                                                        new pt({
                                                            code: Dt,
                                                            message: ''.concat(Pn)
                                                        })
                                                    );
                                                }
                                            }
                                        }
                                    })
                                    .then(function (e) {
                                        var t;
                                        var n = e.location;
                                        var r = e.fileType;
                                        var i = e.fileSize;
                                        var s = Ie(n);
                                        o.updateImageFormat(r);
                                        o.updateImageInfoArray({
                                            size: i,
                                            url: s
                                        });
                                        t = o._imageMemoryURL;
                                        return O
                                            ? new Promise(function (e, n) {
                                                  uni.getImageInfo({
                                                      src: t,
                                                      success: function (t) {
                                                          e({
                                                              width: t.width,
                                                              height: t.height
                                                          });
                                                      },
                                                      fail: function () {
                                                          e({
                                                              width: 0,
                                                              height: 0
                                                          });
                                                      }
                                                  });
                                              })
                                            : x && 9 === F
                                            ? Promise.resolve({
                                                  width: 0,
                                                  height: 0
                                              })
                                            : new Promise(function (e, n) {
                                                  var r = new Image();
                                                  r.onload = function () {
                                                      e({
                                                          width: this.width,
                                                          height: this.height
                                                      });
                                                      r = null;
                                                  };
                                                  r.onerror = function () {
                                                      e({
                                                          width: 0,
                                                          height: 0
                                                      });
                                                      r = null;
                                                  };
                                                  r.src = t;
                                              });
                                    })
                                    .then(function (t) {
                                        var n = t.width;
                                        var r = t.height;
                                        o.updateImageInfoArray({
                                            width: n,
                                            height: r
                                        });
                                        return e;
                                    });
                            }
                        },
                        {
                            key: '_uploadFile',
                            value: function (e) {
                                var t = this.tim;
                                var n = t.uploadController;
                                var r = t.messageController;
                                var o = e.getElements()[0];
                                var i = r.getMessageOptionByID(e.messageID);
                                return n
                                    .uploadFile({
                                        file: i.payload.file,
                                        to: i.to,
                                        onProgress: function (e) {
                                            o.updatePercent(e);
                                            if (se(i.onProgress)) {
                                                try {
                                                    i.onProgress(e);
                                                } catch (t) {
                                                    console.log('CatchClause', t);
                                                    console.log('CatchClause', t);
                                                    return Wo(
                                                        new pt({
                                                            code: Dt,
                                                            message: ''.concat(Pn)
                                                        })
                                                    );
                                                }
                                            }
                                        }
                                    })
                                    .then(function (t) {
                                        var n = t.location;
                                        var r = Ie(n);
                                        o.updateFileUrl(r);
                                        return e;
                                    });
                            }
                        },
                        {
                            key: '_uploadAudio',
                            value: function (e) {
                                var t = this.tim;
                                var n = t.uploadController;
                                var r = t.messageController;
                                var o = e.getElements()[0];
                                var i = r.getMessageOptionByID(e.messageID);
                                return n
                                    .uploadAudio({
                                        file: i.payload.file,
                                        to: i.to,
                                        onProgress: function (e) {
                                            o.updatePercent(e);
                                            if (se(i.onProgress)) {
                                                try {
                                                    i.onProgress(e);
                                                } catch (t) {
                                                    console.log('CatchClause', t);
                                                    console.log('CatchClause', t);
                                                    return Wo(
                                                        new pt({
                                                            code: Dt,
                                                            message: ''.concat(Pn)
                                                        })
                                                    );
                                                }
                                            }
                                        }
                                    })
                                    .then(function (t) {
                                        var n = t.location;
                                        var r = Ie(n);
                                        o.updateAudioUrl(r);
                                        return e;
                                    });
                            }
                        },
                        {
                            key: '_uploadVideo',
                            value: function (e) {
                                var t = this.tim;
                                var n = t.uploadController;
                                var r = t.messageController;
                                var o = e.getElements()[0];
                                var i = r.getMessageOptionByID(e.messageID);
                                return n
                                    .uploadVideo({
                                        file: i.payload.file,
                                        to: i.to,
                                        onProgress: function (e) {
                                            o.updatePercent(e);
                                            if (se(i.onProgress)) {
                                                try {
                                                    i.onProgress(e);
                                                } catch (t) {
                                                    console.log('CatchClause', t);
                                                    console.log('CatchClause', t);
                                                    return Wo(
                                                        new pt({
                                                            code: Dt,
                                                            message: ''.concat(Pn)
                                                        })
                                                    );
                                                }
                                            }
                                        }
                                    })
                                    .then(function (t) {
                                        var n = Ie(t.location);
                                        o.updateVideoUrl(n);
                                        return e;
                                    });
                            }
                        }
                    ]);
                    return e;
                })();
                var Du = (function (n) {
                    l(s, n);
                    var o = y(s);
                    function s(e) {
                        var t;
                        r(this, s);
                        (t = o.call(this, e))._initializeMembers();
                        t._initializeListener();
                        t._initialzeHandlers();
                        t.messageOptionMap = new Map();
                        return t;
                    }
                    i(s, [
                        {
                            key: '_initializeMembers',
                            value: function () {
                                this.messagesList = new vu({
                                    tim: this.tim
                                });
                                this.currentMessageKey = {};
                                this.singlyLinkedList = new Iu(100);
                            }
                        },
                        {
                            key: '_initialzeHandlers',
                            value: function () {
                                this.readReportHandler = new _u(this.tim, this);
                                this.getMessageHandler = new Cu({
                                    messageController: this,
                                    tim: this.tim
                                });
                                this.uploadFileHandler = new Su(this.tim);
                            }
                        },
                        {
                            key: 'reset',
                            value: function () {
                                this.messagesList.reset();
                                this.currentMessageKey = {};
                                this.getMessageHandler.reset();
                                this.singlyLinkedList.reset();
                                this.messageOptionMap.clear();
                            }
                        },
                        {
                            key: '_initializeListener',
                            value: function () {
                                var e = this.tim.innerEmitter;
                                e.on(po, this._onReceiveC2CMessage, this);
                                e.on(Wr, this._onSyncMessagesProcessing, this);
                                e.on(Xr, this._onSyncMessagesFinished, this);
                                e.on(ho, this._onReceiveGroupMessage, this);
                                e.on(fo, this._onReceiveGroupTips, this);
                                e.on(go, this._onReceiveSystemNotice, this);
                                e.on(_o, this._onReceiveGroupMessageRevokedNotice, this);
                                e.on(Co, this._onReceiveC2CMessageRevokedNotice, this);
                                e.on(Oo, this._clearConversationMessages, this);
                            }
                        },
                        {
                            key: 'sendMessageInstance',
                            value: function (e) {
                                var n;
                                var that = this;
                                var o = this.tim.sumStatController;
                                var i = null;
                                switch (e.conversationType) {
                                    case t.CONV_C2C:
                                        i = this._handleOnSendC2CMessageSuccess.bind(this);
                                        break;
                                    case t.CONV_GROUP:
                                        i = this._handleOnSendGroupMessageSuccess.bind(this);
                                        break;
                                    default:
                                        return Wo(
                                            new pt({
                                                code: It,
                                                message: Nn
                                            })
                                        );
                                }
                                this.singlyLinkedList.pushIn(e.random);
                                return this.uploadFileHandler
                                    .upload(e)
                                    .then(function () {
                                        var i = null;
                                        return e.isSendable()
                                            ? (o.addTotalCount(ei),
                                              (n = Date.now()),
                                              e.conversationType === t.CONV_C2C
                                                  ? (i = that._createC2CMessagePack(e))
                                                  : e.conversationType === t.CONV_GROUP && (i = that._createGroupMessagePack(e)),
                                              that.request(i))
                                            : Wo({
                                                  code: Ut,
                                                  message: zn
                                              });
                                    })
                                    .then(function (s) {
                                        o.addSuccessCount(ei);
                                        o.addCost(ei, Math.abs(Date.now() - n));
                                        if (e.conversationType === t.CONV_GROUP) {
                                            e.sequence = s.data.sequence;
                                            e.time = s.data.time;
                                            e.generateMessageID(that.tim.context.identifier);
                                        }
                                        that.messagesList.pushIn(e);
                                        i(e, s.data);
                                        that.messageOptionMap.delete(e.messageID);
                                        that.emitInnerEvent(Jr, {
                                            eventDataList: [
                                                {
                                                    conversationID: e.conversationID,
                                                    unreadCount: 0,
                                                    type: e.conversationType,
                                                    subType: e.conversationSubType,
                                                    lastMessage: e
                                                }
                                            ]
                                        });
                                        return new jo({
                                            message: e
                                        });
                                    })
                                    .catch(function (t) {
                                        e.status = Pe.FAIL;
                                        var n = new oi();
                                        n.setMethod(pi)
                                            .setMessageType(e.type)
                                            .setText(''.concat(that._generateTjgID(e), '-').concat(e.type, '-').concat(e.from, '-').concat(e.to))
                                            .setStart();
                                        that.probeNetwork().then(function (e) {
                                            var r = v(e, 2);
                                            var o = r[0];
                                            var i = r[1];
                                            n.setError(t, o, i).setEnd();
                                        });
                                        J.error('MessageController.sendMessageInstance error:', t);
                                        return Wo(
                                            new pt({
                                                code: t && t.code ? t.code : _t,
                                                message: t && t.message ? t.message : Rn,
                                                data: {
                                                    message: e
                                                }
                                            })
                                        );
                                    });
                            }
                        },
                        {
                            key: 'resendMessage',
                            value: function (e) {
                                e.isResend = true;
                                e.status = Pe.UNSEND;
                                return this.sendMessageInstance(e);
                            }
                        },
                        {
                            key: '_isFileLikeMessage',
                            value: function (e) {
                                return [t.MSG_IMAGE, t.MSG_FILE, t.MSG_AUDIO, t.MSG_VIDEO].indexOf(e.type) >= 0;
                            }
                        },
                        {
                            key: '_resendBinaryTypeMessage',
                            value: function () {}
                        },
                        {
                            key: '_createC2CMessagePack',
                            value: function (e) {
                                return {
                                    name: 'c2cMessage',
                                    action: 'create',
                                    tjgID: this._generateTjgID(e),
                                    param: {
                                        toAccount: e.to,
                                        msgBody: e.getElements(),
                                        msgSeq: e.sequence,
                                        msgRandom: e.random
                                    }
                                };
                            }
                        },
                        {
                            key: '_handleOnSendC2CMessageSuccess',
                            value: function (e, t) {
                                e.status = Pe.SUCCESS;
                                e.time = t.time;
                            }
                        },
                        {
                            key: '_createGroupMessagePack',
                            value: function (e) {
                                return {
                                    name: 'groupMessage',
                                    action: 'create',
                                    tjgID: this._generateTjgID(e),
                                    param: {
                                        groupID: e.to,
                                        msgBody: e.getElements(),
                                        random: e.random,
                                        priority: e.priority,
                                        clientSequence: e.clientSequence
                                    }
                                };
                            }
                        },
                        {
                            key: '_handleOnSendGroupMessageSuccess',
                            value: function (e, t) {
                                e.sequence = t.sequence;
                                e.time = t.time;
                                e.status = Pe.SUCCESS;
                            }
                        },
                        {
                            key: '_onReceiveC2CMessage',
                            value: function (n) {
                                J.debug('MessageController._onReceiveC2CMessage nums='.concat(n.data.length));
                                var r = this._newC2CMessageStoredAndSummary({
                                    notifiesList: n.data,
                                    type: t.CONV_C2C,
                                    C2CRemainingUnreadList: n.C2CRemainingUnreadList
                                });
                                var o = r.eventDataList;
                                var i = r.result;
                                if (o.length > 0) {
                                    this.emitInnerEvent(eo, {
                                        eventDataList: o,
                                        result: i
                                    });
                                }
                                if (i.length > 0) {
                                    this.emitOuterEvent(e.MESSAGE_RECEIVED, i);
                                }
                            }
                        },
                        {
                            key: '_onReceiveGroupMessage',
                            value: function (t) {
                                J.debug('MessageController._onReceiveGroupMessage nums='.concat(t.data.length));
                                var n = this.newGroupMessageStoredAndSummary(t.data);
                                var r = n.eventDataList;
                                var o = n.result;
                                if (r.length > 0) {
                                    this.emitInnerEvent(to, {
                                        eventDataList: r,
                                        result: o,
                                        isGroupTip: false
                                    });
                                }
                                if (o.length > 0) {
                                    this.emitOuterEvent(e.MESSAGE_RECEIVED, o);
                                }
                            }
                        },
                        {
                            key: '_onReceiveGroupTips',
                            value: function (t) {
                                var n = t.data;
                                J.debug('MessageController._onReceiveGroupTips nums='.concat(n.length));
                                var r = this.newGroupTipsStoredAndSummary(n);
                                var o = r.eventDataList;
                                var i = r.result;
                                if (o.length > 0) {
                                    this.emitInnerEvent(to, {
                                        eventDataList: o,
                                        result: i,
                                        isGroupTip: true
                                    });
                                }
                                if (i.length > 0) {
                                    this.emitOuterEvent(e.MESSAGE_RECEIVED, i);
                                }
                            }
                        },
                        {
                            key: '_onReceiveSystemNotice',
                            value: function (t) {
                                var n = t.data;
                                var r = n.groupSystemNotices;
                                var o = n.type;
                                J.debug('MessageController._onReceiveSystemNotice nums='.concat(r.length));
                                var i = this.newSystemNoticeStoredAndSummary({
                                    notifiesList: r,
                                    type: o
                                });
                                var s = i.eventDataList;
                                var a = i.result;
                                if (s.length > 0) {
                                    this.emitInnerEvent(no, {
                                        eventDataList: s,
                                        result: a,
                                        type: o
                                    });
                                }
                                if (a.length > 0 && 'poll' === o) {
                                    this.emitOuterEvent(e.MESSAGE_RECEIVED, a);
                                }
                            }
                        },
                        {
                            key: '_onReceiveGroupMessageRevokedNotice',
                            value: function (t) {
                                var that = this;
                                J.debug('MessageController._onReceiveGroupMessageRevokedNotice nums='.concat(t.data.length));
                                var r = [];
                                var o = null;
                                t.data.forEach(function (e) {
                                    e.elements.revokedInfos.forEach(function (e) {
                                        if ((o = that.messagesList.revoke('GROUP'.concat(e.groupID), e.sequence))) {
                                            r.push(o);
                                        }
                                    });
                                });
                                if (0 !== r.length) {
                                    this.emitInnerEvent(ro, r);
                                    this.emitOuterEvent(e.MESSAGE_REVOKED, r);
                                }
                            }
                        },
                        {
                            key: '_onReceiveC2CMessageRevokedNotice',
                            value: function (t) {
                                var that = this;
                                J.debug('MessageController._onReceiveC2CMessageRevokedNotice nums='.concat(t.data.length));
                                var r = [];
                                var o = null;
                                t.data.forEach(function (e) {
                                    e.c2cMessageRevokedNotify.revokedInfos.forEach(function (e) {
                                        var t = that.tim.context.identifier === e.from ? 'C2C'.concat(e.to) : 'C2C'.concat(e.from);
                                        if ((o = that.messagesList.revoke(t, e.sequence, e.random))) {
                                            r.push(o);
                                        }
                                    });
                                });
                                if (0 !== r.length) {
                                    this.emitInnerEvent(ro, r);
                                    this.emitOuterEvent(e.MESSAGE_REVOKED, r);
                                }
                            }
                        },
                        {
                            key: '_clearConversationMessages',
                            value: function (e) {
                                var t = e.data;
                                this.messagesList.removeByConversationID(t);
                                this.getMessageHandler.deleteCompletedItem(t);
                            }
                        },
                        {
                            key: '_pushIntoNoticeResult',
                            value: function (e, t) {
                                var n = this.messagesList.pushIn(t);
                                var r = this.singlyLinkedList.has(t.random);
                                return !(!n || false !== r) && (e.push(t), true);
                            }
                        },
                        {
                            key: '_newC2CMessageStoredAndSummary',
                            value: function (e) {
                                for (
                                    var n = e.notifiesList,
                                        r = e.type,
                                        o = e.C2CRemainingUnreadList,
                                        i = e.isFromSync,
                                        s = null,
                                        a = [],
                                        u = [],
                                        l = {},
                                        c = this.tim.bigDataHallwayController,
                                        p = 0,
                                        h = n.length;
                                    p < h;
                                    p++
                                ) {
                                    var f = n[p];
                                    f.currentUser = this.tim.context.identifier;
                                    f.conversationType = r;
                                    f.isSystemMessage = !!f.isSystemMessage;
                                    s = new br(f);
                                    f.elements = c.parseElements(f.elements, f.from);
                                    s.setElement(f.elements);
                                    if (!i) {
                                        if (!this._pushIntoNoticeResult(u, s)) {
                                            continue;
                                        }
                                    }
                                    void 0 === l[s.conversationID]
                                        ? (l[s.conversationID] =
                                              a.push({
                                                  conversationID: s.conversationID,
                                                  unreadCount: 'out' === s.flow ? 0 : 1,
                                                  type: s.conversationType,
                                                  subType: s.conversationSubType,
                                                  lastMessage: s
                                              }) - 1)
                                        : ((a[l[s.conversationID]].type = s.conversationType),
                                          (a[l[s.conversationID]].subType = s.conversationSubType),
                                          (a[l[s.conversationID]].lastMessage = s),
                                          'in' === s.flow && a[l[s.conversationID]].unreadCount++);
                                }
                                if (re(o)) {
                                    for (
                                        var d = function (e, n) {
                                                var r = a.find(function (t) {
                                                    return t.conversationID === 'C2C'.concat(o[e].from);
                                                });
                                                r
                                                    ? (r.unreadCount += o[e].count)
                                                    : a.push({
                                                          conversationID: 'C2C'.concat(o[e].from),
                                                          unreadCount: o[e].count,
                                                          type: t.CONV_C2C
                                                      });
                                            },
                                            g = 0,
                                            m = o.length;
                                        g < m;
                                        g++
                                    ) {
                                        d(g);
                                    }
                                }
                                return {
                                    eventDataList: a,
                                    result: u
                                };
                            }
                        },
                        {
                            key: 'newGroupMessageStoredAndSummary',
                            value: function (e) {
                                for (var n = null, r = [], o = {}, i = [], s = t.CONV_GROUP, a = this.tim.bigDataHallwayController, u = 0, l = e.length; u < l; u++) {
                                    var c = e[u];
                                    c.currentUser = this.tim.context.identifier;
                                    c.conversationType = s;
                                    c.isSystemMessage = !!c.isSystemMessage;
                                    n = new br(c);
                                    c.elements = a.parseElements(c.elements, c.from);
                                    n.setElement(c.elements);
                                    if (!this._isMessageFromAVChatroom(n)) {
                                        if (this._pushIntoNoticeResult(i, n)) {
                                            void 0 === o[n.conversationID]
                                                ? (o[n.conversationID] =
                                                      r.push({
                                                          conversationID: n.conversationID,
                                                          unreadCount: 'out' === n.flow ? 0 : 1,
                                                          type: n.conversationType,
                                                          subType: n.conversationSubType,
                                                          lastMessage: n
                                                      }) - 1)
                                                : ((r[o[n.conversationID]].type = n.conversationType),
                                                  (r[o[n.conversationID]].subType = n.conversationSubType),
                                                  (r[o[n.conversationID]].lastMessage = n),
                                                  'in' === n.flow && r[o[n.conversationID]].unreadCount++);
                                        }
                                    }
                                }
                                return {
                                    eventDataList: r,
                                    result: i
                                };
                            }
                        },
                        {
                            key: '_isMessageFromAVChatroom',
                            value: function (e) {
                                var t = e.conversationID.slice(5);
                                return this.tim.groupController.checkJoinedAVChatRoomByID(t);
                            }
                        },
                        {
                            key: 'newGroupTipsStoredAndSummary',
                            value: function (e) {
                                for (var n = null, r = [], o = [], i = {}, s = 0, a = e.length; s < a; s++) {
                                    var l = e[s];
                                    l.currentUser = this.tim.context.identifier;
                                    l.conversationType = t.CONV_GROUP;
                                    (n = new br(l)).setElement({
                                        type: t.MSG_GRP_TIP,
                                        content: u({}, l.elements, {
                                            groupProfile: l.groupProfile
                                        })
                                    });
                                    n.isSystemMessage = false;
                                    if (!this._isMessageFromAVChatroom(n)) {
                                        if (this._pushIntoNoticeResult(o, n)) {
                                            void 0 === i[n.conversationID]
                                                ? (i[n.conversationID] =
                                                      r.push({
                                                          conversationID: n.conversationID,
                                                          unreadCount: 'out' === n.flow ? 0 : 1,
                                                          type: n.conversationType,
                                                          subType: n.conversationSubType,
                                                          lastMessage: n
                                                      }) - 1)
                                                : ((r[i[n.conversationID]].type = n.conversationType),
                                                  (r[i[n.conversationID]].subType = n.conversationSubType),
                                                  (r[i[n.conversationID]].lastMessage = n),
                                                  'in' === n.flow && r[i[n.conversationID]].unreadCount++);
                                        }
                                    }
                                }
                                return {
                                    eventDataList: r,
                                    result: o
                                };
                            }
                        },
                        {
                            key: 'newSystemNoticeStoredAndSummary',
                            value: function (e) {
                                var n = e.notifiesList;
                                var r = e.type;
                                var o = null;
                                var i = n.length;
                                var s = 0;
                                var a = [];
                                var l = {
                                    conversationID: t.CONV_SYSTEM,
                                    unreadCount: 0,
                                    type: t.CONV_SYSTEM,
                                    subType: null,
                                    lastMessage: null
                                };
                                for (s = 0; s < i; s++) {
                                    var c = n[s];
                                    if (c.elements.operationType !== ze) {
                                        c.currentUser = this.tim.context.identifier;
                                        c.conversationType = t.CONV_SYSTEM;
                                        c.conversationID = t.CONV_SYSTEM;
                                        (o = new br(c)).setElement({
                                            type: t.MSG_GRP_SYS_NOTICE,
                                            content: u({}, c.elements, {
                                                groupProfile: c.groupProfile
                                            })
                                        });
                                        o.isSystemMessage = true;
                                        if ((1 === o.sequence && 1 === o.random) || (2 === o.sequence && 2 === o.random)) {
                                            o.sequence = me();
                                            o.random = me();
                                            o.generateMessageID(c.currentUser);
                                            J.log('MessageController.newSystemNoticeStoredAndSummary sequence and random maybe duplicated, regenerate. ID='.concat(o.ID));
                                        }
                                        if (this._pushIntoNoticeResult(a, o)) {
                                            'poll' === r ? l.unreadCount++ : 'sync' === r && o.setIsRead(true);
                                            l.subType = o.conversationSubType;
                                        }
                                    }
                                }
                                l.lastMessage = a[a.length - 1];
                                return {
                                    eventDataList: a.length > 0 ? [l] : [],
                                    result: a
                                };
                            }
                        },
                        {
                            key: '_onSyncMessagesProcessing',
                            value: function (e) {
                                var n = this._newC2CMessageStoredAndSummary({
                                    notifiesList: e.data,
                                    type: t.CONV_C2C,
                                    isFromSync: true,
                                    C2CRemainingUnreadList: e.C2CRemainingUnreadList
                                });
                                var r = n.eventDataList;
                                var o = n.result;
                                this.emitInnerEvent(Qr, {
                                    eventDataList: r,
                                    result: o
                                });
                            }
                        },
                        {
                            key: '_onSyncMessagesFinished',
                            value: function (e) {
                                this.triggerReady();
                                var n = this._newC2CMessageStoredAndSummary({
                                    notifiesList: e.data.messageList,
                                    type: t.CONV_C2C,
                                    isFromSync: true,
                                    C2CRemainingUnreadList: e.data.C2CRemainingUnreadList
                                });
                                var r = n.eventDataList;
                                var o = n.result;
                                this.emitInnerEvent(Zr, {
                                    eventDataList: r,
                                    result: o
                                });
                            }
                        },
                        {
                            key: 'getHistoryMessages',
                            value: function (e) {
                                if (e.conversationID === t.CONV_SYSTEM) {
                                    return zo();
                                }
                                if (!e.count) {
                                    e.count = 15;
                                }
                                if (e.count > 20) {
                                    e.count = 20;
                                }
                                var n = this.messagesList.getLocalOldestMessageByConversationID(e.conversationID);
                                n ||
                                    (((n = {}).time = 0),
                                    (n.sequence = 0),
                                    0 === e.conversationID.indexOf(t.CONV_C2C)
                                        ? ((n.to = e.conversationID.replace(t.CONV_C2C, '')), (n.conversationType = t.CONV_C2C))
                                        : 0 === e.conversationID.indexOf(t.CONV_GROUP) &&
                                          ((n.to = e.conversationID.replace(t.CONV_GROUP, '')), (n.conversationType = t.CONV_GROUP)));
                                var r = '';
                                switch (n.conversationType) {
                                    case t.CONV_C2C:
                                        r = e.conversationID.replace(t.CONV_C2C, '');
                                        return this.getC2CRoamMessages({
                                            conversationID: e.conversationID,
                                            peerAccount: r,
                                            count: e.count,
                                            lastMessageTime: void 0 === this.currentMessageKey[e.conversationID] ? 0 : n.time
                                        });
                                    case t.CONV_GROUP:
                                        return this.getGroupRoamMessages({
                                            conversationID: e.conversationID,
                                            groupID: n.to,
                                            count: e.count,
                                            sequence: n.sequence - 1
                                        });
                                    default:
                                        return zo();
                                }
                            }
                        },
                        {
                            key: 'getC2CRoamMessages',
                            value: function (e) {
                                var that = this;
                                var r = void 0 !== this.currentMessageKey[e.conversationID] ? this.currentMessageKey[e.conversationID] : '';
                                J.log(
                                    'MessageController.getC2CRoamMessages toAccount='
                                        .concat(e.peerAccount, ' count=')
                                        .concat(e.count || 15, ' lastMessageTime=')
                                        .concat(e.lastMessageTime || 0, ' messageKey=')
                                        .concat(r)
                                );
                                var o = new oi();
                                o.setMethod(hi).setStart();
                                return this.request({
                                    name: 'c2cMessage',
                                    action: 'query',
                                    param: {
                                        peerAccount: e.peerAccount,
                                        count: e.count || 15,
                                        lastMessageTime: e.lastMessageTime || 0,
                                        messageKey: r
                                    }
                                })
                                    .then(function (i) {
                                        var s = i.data;
                                        var a = s.complete;
                                        var u = s.messageList;
                                        oe(u)
                                            ? J.log('MessageController.getC2CRoamMessages ok. complete='.concat(a, ' but messageList is undefined!'))
                                            : J.log('MessageController.getC2CRoamMessages ok. complete='.concat(a, ' nums=').concat(u.length));
                                        o.setCode(0)
                                            .setNetworkType(that.getNetworkType())
                                            .setText(
                                                ''
                                                    .concat(e.peerAccount, '-')
                                                    .concat(e.count || 15, '-')
                                                    .concat(e.lastMessageTime || 0, '-')
                                                    .concat(r, '-')
                                                    .concat(a, '-')
                                                    .concat(u ? u.length : 'undefined')
                                            )
                                            .setEnd();
                                        if (1 === a) {
                                            that.getMessageHandler.setCompleted(e.conversationID);
                                        }
                                        var l = that._roamMessageStore(u, t.CONV_C2C, e.conversationID);
                                        that.readReportHandler.updateIsRead(e.conversationID);
                                        that.currentMessageKey[e.conversationID] = i.data.messageKey;
                                        return l;
                                    })
                                    .catch(function (t) {
                                        that.probeNetwork().then(function (n) {
                                            var i = v(n, 2);
                                            var s = i[0];
                                            var a = i[1];
                                            o.setError(t, s, a)
                                                .setText(
                                                    ''
                                                        .concat(e.peerAccount, '-')
                                                        .concat(e.count || 15, '-')
                                                        .concat(e.lastMessageTime || 0, '-')
                                                        .concat(r)
                                                )
                                                .setEnd();
                                        });
                                        J.warn('MessageController.getC2CRoamMessages failed. '.concat(t));
                                        return Wo(t);
                                    });
                            }
                        },
                        {
                            key: '_computeLastSequence',
                            value: function (e) {
                                return e.sequence >= 0 ? Promise.resolve(e.sequence) : this.tim.groupController.getGroupLastSequence(e.groupID);
                            }
                        },
                        {
                            key: 'getGroupRoamMessages',
                            value: function (e) {
                                var that = this;
                                var r = new oi();
                                var o = 0;
                                return this._computeLastSequence(e)
                                    .then(function (t) {
                                        o = t;
                                        J.log('MessageController.getGroupRoamMessages groupID='.concat(e.groupID, ' lastSequence=').concat(o));
                                        r.setMethod(fi).setStart();
                                        return that.request({
                                            name: 'groupMessage',
                                            action: 'query',
                                            param: {
                                                groupID: e.groupID,
                                                count: 21,
                                                sequence: o
                                            }
                                        });
                                    })
                                    .then(function (i) {
                                        var s = i.data;
                                        var a = s.messageList;
                                        var u = s.complete;
                                        oe(a)
                                            ? J.log('MessageController.getGroupRoamMessages ok. complete='.concat(u, ' but messageList is undefined!'))
                                            : J.log('MessageController.getGroupRoamMessages ok. complete='.concat(u, ' nums=').concat(a.length));
                                        r.setCode(0)
                                            .setNetworkType(that.getNetworkType())
                                            .setText(
                                                ''
                                                    .concat(e.groupID, '-')
                                                    .concat(o, '-')
                                                    .concat(u, '-')
                                                    .concat(a ? a.length : 'undefined')
                                            )
                                            .setEnd();
                                        var l = 'GROUP'.concat(e.groupID);
                                        if (2 === u || we(a)) {
                                            that.getMessageHandler.setCompleted(l);
                                            return [];
                                        }
                                        var c = that._roamMessageStore(a, t.CONV_GROUP, l);
                                        that.readReportHandler.updateIsRead(l);
                                        return c;
                                    })
                                    .catch(function (t) {
                                        that.probeNetwork().then(function (n) {
                                            var i = v(n, 2);
                                            var s = i[0];
                                            var a = i[1];
                                            r.setError(t, s, a).setText(''.concat(e.groupID, '-').concat(o)).setEnd();
                                        });
                                        J.warn('MessageController.getGroupRoamMessages failed. '.concat(t));
                                        return Wo(t);
                                    });
                            }
                        },
                        {
                            key: '_roamMessageStore',
                            value: function () {
                                var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [];
                                var n = arguments.length > 1 ? arguments[1] : void 0;
                                var r = arguments.length > 2 ? arguments[2] : void 0;
                                var o = null;
                                var i = [];
                                var s = 0;
                                var a = e.length;
                                var l = null;
                                var c = n === t.CONV_GROUP;
                                var p = this.tim.bigDataHallwayController;
                                var h = function () {
                                    s = c ? e.length - 1 : 0;
                                    a = c ? 0 : e.length;
                                };
                                var f = function () {
                                    c ? --s : ++s;
                                };
                                var d = function () {
                                    return c ? s >= a : s < a;
                                };
                                for (h(); d(); f()) {
                                    if (c && 1 === e[s].sequence) {
                                        this.getMessageHandler.setCompleted(r);
                                    }
                                    if (1 !== e[s].isPlaceMessage) {
                                        (o = new br(e[s])).to = e[s].to;
                                        o.isSystemMessage = !!e[s].isSystemMessage;
                                        o.conversationType = n;
                                        e[s].event === qe.JSON.TYPE.GROUP.TIP
                                            ? (l = {
                                                  type: t.MSG_GRP_TIP,
                                                  content: u({}, e[s].elements, {
                                                      groupProfile: e[s].groupProfile
                                                  })
                                              })
                                            : ((e[s].elements = p.parseElements(e[s].elements, e[s].from)), (l = e[s].elements));
                                        o.setElement(l);
                                        o.reInitialize(this.tim.context.identifier);
                                        i.push(o);
                                    }
                                }
                                this.messagesList.unshift(i);
                                h = f = d = null;
                                return i;
                            }
                        },
                        {
                            key: 'getLocalMessageList',
                            value: function (e) {
                                return this.messagesList.getLocalMessageList(e);
                            }
                        },
                        {
                            key: 'getLocalMessage',
                            value: function (e, t) {
                                return this.messagesList.getLocalMessage(e, t);
                            }
                        },
                        {
                            key: 'hasLocalMessage',
                            value: function (e, t) {
                                return this.messagesList.hasLocalMessage(e, t);
                            }
                        },
                        {
                            key: 'deleteLocalMessage',
                            value: function (e) {
                                if (e instanceof br) {
                                    this.messagesList.remove(e);
                                }
                            }
                        },
                        {
                            key: 'revokeMessage',
                            value: function (e) {
                                var n;
                                var that = this;
                                e.conversationType === t.CONV_C2C
                                    ? (n = {
                                          name: 'c2cMessageWillBeRevoked',
                                          action: 'create',
                                          param: {
                                              msgInfo: {
                                                  fromAccount: e.from,
                                                  toAccount: e.to,
                                                  msgSeq: e.sequence,
                                                  msgRandom: e.random,
                                                  msgTimeStamp: e.time
                                              }
                                          }
                                      })
                                    : e.conversationType === t.CONV_GROUP &&
                                      (n = {
                                          name: 'groupMessageWillBeRevoked',
                                          action: 'create',
                                          param: {
                                              to: e.to,
                                              msgSeqList: [
                                                  {
                                                      msgSeq: e.sequence
                                                  }
                                              ]
                                          }
                                      });
                                var o = new oi();
                                o.setMethod(di)
                                    .setMessageType(e.type)
                                    .setText(''.concat(this._generateTjgID(e), '-').concat(e.type, '-').concat(e.from, '-').concat(e.to))
                                    .setStart();
                                return this.request(n)
                                    .then(function (t) {
                                        var n = t.data.recallRetList;
                                        if (!we(n) && 0 !== n[0].retCode) {
                                            var i = new pt({
                                                code: n[0].retCode,
                                                message: ct[n[0].retCode] || Gn,
                                                data: {
                                                    message: e
                                                }
                                            });
                                            o.setCode(i.code).setMessage(i.message).setEnd();
                                            return Wo(i);
                                        }
                                        J.info('MessageController.revokeMessage ok. ID='.concat(e.ID));
                                        e.isRevoked = true;
                                        o.setCode(0).setEnd();
                                        that.emitInnerEvent(ro, [e]);
                                        return new jo({
                                            message: e
                                        });
                                    })
                                    .catch(function (t) {
                                        that.probeNetwork().then(function (e) {
                                            var n = v(e, 2);
                                            var r = n[0];
                                            var i = n[1];
                                            o.setError(t, r, i).setEnd();
                                        });
                                        var n = new pt({
                                            code: t && t.code ? t.code : Tt,
                                            message: t && t.message ? t.message : Gn,
                                            data: {
                                                message: e
                                            }
                                        });
                                        J.warn('MessageController.revokeMessage failed. ID='.concat(e.ID, ' code=').concat(n.code, ' message=').concat(n.message));
                                        return Wo(n);
                                    });
                            }
                        },
                        {
                            key: 'setMessageRead',
                            value: function (e) {
                                var that = this;
                                return new Promise(function (n, r) {
                                    that.ready(function () {
                                        that.readReportHandler.setMessageRead(e).then(n).catch(r);
                                    });
                                });
                            }
                        },
                        {
                            key: 'getMessageList',
                            value: function (e) {
                                return this.getMessageHandler.getMessageList(e);
                            }
                        },
                        {
                            key: 'createTextMessage',
                            value: function (e) {
                                e.currentUser = this.tim.context.identifier;
                                var t = new br(e);
                                var n = 'string' == typeof e.payload ? e.payload : e.payload.text;
                                var r = new Ue({
                                    text: n
                                });
                                t.setElement(r);
                                return t;
                            }
                        },
                        {
                            key: 'createCustomMessage',
                            value: function (e) {
                                e.currentUser = this.tim.context.identifier;
                                var t = new br(e);
                                var n = new Rr({
                                    data: e.payload.data,
                                    description: e.payload.description,
                                    extension: e.payload.extension
                                });
                                t.setElement(n);
                                return t;
                            }
                        },
                        {
                            key: 'createImageMessage',
                            value: function (e) {
                                e.currentUser = this.tim.context.identifier;
                                var t = new br(e);
                                if (O) {
                                    var n = e.payload.file;
                                    if (Q(n)) {
                                        return void J.warn('微信小程序环境下调用 createImageMessage 接口时，payload.file 不支持传入 File 对象');
                                    }
                                    var r = n.tempFilePaths[0];
                                    var o = {
                                        url: r,
                                        name: r.slice(r.lastIndexOf('/') + 1),
                                        size: n.tempFiles[0].size,
                                        type: r.slice(r.lastIndexOf('.') + 1).toLowerCase()
                                    };
                                    e.payload.file = o;
                                } else if (R && Q(e.payload.file)) {
                                    var i = e.payload.file;
                                    e.payload.file = {
                                        files: [i]
                                    };
                                }
                                var s = new rt({
                                    imageFormat: 'UNKNOWN',
                                    uuid: this._generateUUID(),
                                    file: e.payload.file
                                });
                                t.setElement(s);
                                this.messageOptionMap.set(t.messageID, e);
                                return t;
                            }
                        },
                        {
                            key: 'createFileMessage',
                            value: function (e) {
                                if (!O) {
                                    if (R && Q(e.payload.file)) {
                                        var t = e.payload.file;
                                        e.payload.file = {
                                            files: [t]
                                        };
                                    }
                                    e.currentUser = this.tim.context.identifier;
                                    var n = new br(e);
                                    var r = new wr({
                                        uuid: this._generateUUID(),
                                        file: e.payload.file
                                    });
                                    n.setElement(r);
                                    this.messageOptionMap.set(n.messageID, e);
                                    return n;
                                }
                                J.warn('微信小程序目前不支持选择文件， createFileMessage 接口不可用！');
                            }
                        },
                        {
                            key: 'createAudioMessage',
                            value: function (e) {
                                if (O) {
                                    var t = e.payload.file;
                                    if (O) {
                                        var n = {
                                            url: t.tempFilePath,
                                            name: t.tempFilePath.slice(t.tempFilePath.lastIndexOf('/') + 1),
                                            size: t.fileSize,
                                            second: parseInt(t.duration) / 1000,
                                            type: t.tempFilePath.slice(t.tempFilePath.lastIndexOf('.') + 1).toLowerCase()
                                        };
                                        e.payload.file = n;
                                    }
                                    e.currentUser = this.tim.context.identifier;
                                    var r = new br(e);
                                    var o = new it({
                                        second: Math.floor(t.duration / 1000),
                                        size: t.fileSize,
                                        url: t.tempFilePath,
                                        uuid: this._generateUUID()
                                    });
                                    r.setElement(o);
                                    this.messageOptionMap.set(r.messageID, e);
                                    return r;
                                }
                                J.warn('createAudioMessage 目前只支持微信小程序发语音消息');
                            }
                        },
                        {
                            key: 'createVideoMessage',
                            value: function (e) {
                                e.currentUser = this.tim.context.identifier;
                                e.payload.file.thumbUrl = 'https://webim-1252463788.cos.ap-shanghai.myqcloud.com/assets/images/transparent.png';
                                e.payload.file.thumbSize = 1668;
                                var t = {};
                                if (O) {
                                    if (Q(e.payload.file)) {
                                        return void J.warn('微信小程序环境下调用 createVideoMessage 接口时，payload.file 不支持传入 File 对象');
                                    }
                                    var n = e.payload.file;
                                    t.url = n.tempFilePath;
                                    t.name = n.tempFilePath.slice(n.tempFilePath.lastIndexOf('/') + 1);
                                    t.size = n.size;
                                    t.second = n.duration;
                                    t.type = n.tempFilePath.slice(n.tempFilePath.lastIndexOf('.') + 1).toLowerCase();
                                } else if (R) {
                                    if (Q(e.payload.file)) {
                                        var r = e.payload.file;
                                        e.payload.file.files = [r];
                                    }
                                    var o = e.payload.file;
                                    t.url = window.URL.createObjectURL(o.files[0]);
                                    t.name = o.files[0].name;
                                    t.size = o.files[0].size;
                                    t.second = o.files[0].duration || 0;
                                    t.type = o.files[0].type.split('/')[1];
                                }
                                e.payload.file.videoFile = t;
                                var i = new br(e);
                                var s = new Or({
                                    videoFormat: t.type,
                                    videoSecond: Number(t.second.toFixed(0)),
                                    videoSize: t.size,
                                    remoteVideoUrl: '',
                                    videoUrl: t.url,
                                    videoUUID: this._generateUUID(),
                                    thumbUUID: this._generateUUID(),
                                    thumbWidth: e.payload.file.width || 200,
                                    thumbHeight: e.payload.file.height || 200,
                                    thumbUrl: e.payload.file.thumbUrl,
                                    thumbSize: e.payload.file.thumbSize,
                                    thumbFormat: e.payload.file.thumbUrl.slice(e.payload.file.thumbUrl.lastIndexOf('.') + 1).toLowerCase()
                                });
                                i.setElement(s);
                                this.messageOptionMap.set(i.messageID, e);
                                return i;
                            }
                        },
                        {
                            key: 'createFaceMessage',
                            value: function (e) {
                                e.currentUser = this.tim.context.identifier;
                                var t = new br(e);
                                var n = new ot(e.payload);
                                t.setElement(n);
                                return t;
                            }
                        },
                        {
                            key: '_generateUUID',
                            value: function () {
                                var e = this.tim.context;
                                return ''
                                    .concat(e.SDKAppID, '-')
                                    .concat(e.identifier, '-')
                                    .concat(
                                        (function () {
                                            for (var e = '', t = 32; t > 0; --t) {
                                                e += ye[Math.floor(Math.random() * ve)];
                                            }
                                            return e;
                                        })()
                                    );
                            }
                        },
                        {
                            key: '_generateTjgID',
                            value: function (e) {
                                return this.tim.context.tinyID + '-' + e.random;
                            }
                        },
                        {
                            key: 'getMessageOptionByID',
                            value: function (e) {
                                return this.messageOptionMap.get(e);
                            }
                        }
                    ]);
                    return s;
                })(Bo);
                var Tu = (function () {
                    function e(t) {
                        r(this, e);
                        this.userID = '';
                        this.avatar = '';
                        this.nick = '';
                        this.role = '';
                        this.joinTime = '';
                        this.lastSendMsgTime = '';
                        this.nameCard = '';
                        this.muteUntil = 0;
                        this.memberCustomField = [];
                        this._initMember(t);
                    }
                    i(e, [
                        {
                            key: '_initMember',
                            value: function (e) {
                                this.updateMember(e);
                            }
                        },
                        {
                            key: 'updateMember',
                            value: function (e) {
                                var t = [null, void 0, '', 0, NaN];
                                if (e.memberCustomField) {
                                    Se(this.memberCustomField, e.memberCustomField);
                                }
                                he(this, e, ['memberCustomField'], t);
                            }
                        },
                        {
                            key: 'updateRole',
                            value: function (e) {
                                ['Owner', 'Admin', 'Member'].indexOf(e) < 0 || (this.role = e);
                            }
                        },
                        {
                            key: 'updateMuteUntil',
                            value: function (e) {
                                oe(e) || (this.muteUntil = Math.floor((Date.now() + 1000 * e) / 1000));
                            }
                        },
                        {
                            key: 'updateNameCard',
                            value: function (e) {
                                oe(e) || (this.nameCard = e);
                            }
                        },
                        {
                            key: 'updateMemberCustomField',
                            value: function (e) {
                                if (e) {
                                    Se(this.memberCustomField, e);
                                }
                            }
                        }
                    ]);
                    return e;
                })();
                var Eu = (function () {
                    function e(t) {
                        r(this, e);
                        this.tim = t.tim;
                        this.groupController = t.groupController;
                        this._initListeners();
                    }
                    i(e, [
                        {
                            key: '_initListeners',
                            value: function () {
                                this.tim.innerEmitter.on(to, this._onReceivedGroupTips, this);
                            }
                        },
                        {
                            key: '_onReceivedGroupTips',
                            value: function (e) {
                                var that = this;
                                var n = e.data;
                                var r = n.result;
                                if (n.isGroupTip) {
                                    r.forEach(function (e) {
                                        switch (e.payload.operationType) {
                                            case 1:
                                                that._onNewMemberComeIn(e);
                                                break;
                                            case 2:
                                                that._onMemberQuit(e);
                                                break;
                                            case 3:
                                                that._onMemberKickedOut(e);
                                                break;
                                            case 4:
                                                that._onMemberSetAdmin(e);
                                                break;
                                            case 5:
                                                that._onMemberCancelledAdmin(e);
                                                break;
                                            case 6:
                                                that._onGroupProfileModified(e);
                                                break;
                                            case 7:
                                                that._onMemberInfoModified(e);
                                                break;
                                            default:
                                                J.warn('GroupTipsHandler._onReceivedGroupTips Unhandled groupTips. operationType=', e.payload.operationType);
                                        }
                                    });
                                }
                            }
                        },
                        {
                            key: '_onNewMemberComeIn',
                            value: function (e) {
                                var t = e.payload;
                                var n = t.memberNum;
                                var r = t.groupProfile.groupID;
                                var o = this.groupController.getLocalGroupProfile(r);
                                if (o && Z(n)) {
                                    o.memberNum = n;
                                }
                            }
                        },
                        {
                            key: '_onMemberQuit',
                            value: function (e) {
                                var t = e.payload;
                                var n = t.memberNum;
                                var r = t.groupProfile.groupID;
                                var o = this.groupController.getLocalGroupProfile(r);
                                if (o && Z(n)) {
                                    o.memberNum = n;
                                }
                                this.groupController.deleteLocalGroupMembers(r, e.payload.userIDList);
                            }
                        },
                        {
                            key: '_onMemberKickedOut',
                            value: function (e) {
                                var t = e.payload;
                                var n = t.memberNum;
                                var r = t.groupProfile.groupID;
                                var o = this.groupController.getLocalGroupProfile(r);
                                if (o && Z(n)) {
                                    o.memberNum = n;
                                }
                                this.groupController.deleteLocalGroupMembers(r, e.payload.userIDList);
                            }
                        },
                        {
                            key: '_onMemberSetAdmin',
                            value: function (e) {
                                var that = this;
                                var r = e.payload.groupProfile.groupID;
                                e.payload.userIDList.forEach(function (e) {
                                    var o = that.groupController.getLocalGroupMemberInfo(r, e);
                                    if (o) {
                                        o.updateRole(t.GRP_MBR_ROLE_ADMIN);
                                    }
                                });
                            }
                        },
                        {
                            key: '_onMemberCancelledAdmin',
                            value: function (e) {
                                var that = this;
                                var r = e.payload.groupProfile.groupID;
                                e.payload.userIDList.forEach(function (e) {
                                    var o = that.groupController.getLocalGroupMemberInfo(r, e);
                                    if (o) {
                                        o.updateRole(t.GRP_MBR_ROLE_MEMBER);
                                    }
                                });
                            }
                        },
                        {
                            key: '_onGroupProfileModified',
                            value: function (e) {
                                var that = this;
                                var n = e.payload.newGroupProfile;
                                var r = e.payload.groupProfile.groupID;
                                var o = this.groupController.getLocalGroupProfile(r);
                                Object.keys(n).forEach(function (e) {
                                    switch (e) {
                                        case 'ownerID':
                                            that._ownerChaged(o, n);
                                            break;
                                        default:
                                            o[e] = n[e];
                                    }
                                });
                                this.groupController.emitGroupListUpdate(true, true);
                            }
                        },
                        {
                            key: '_ownerChaged',
                            value: function (e, n) {
                                var r = e.groupID;
                                var o = this.groupController.getLocalGroupProfile(r);
                                var i = this.tim.context.identifier;
                                if (i === n.ownerID) {
                                    o.updateGroup({
                                        selfInfo: {
                                            role: t.GRP_MBR_ROLE_OWNER
                                        }
                                    });
                                    var s = this.groupController.getLocalGroupMemberInfo(r, i);
                                    var a = this.groupController.getLocalGroupProfile(r).ownerID;
                                    var u = this.groupController.getLocalGroupMemberInfo(r, a);
                                    if (s) {
                                        s.updateRole(t.GRP_MBR_ROLE_OWNER);
                                    }
                                    if (u) {
                                        u.updateRole(t.GRP_MBR_ROLE_MEMBER);
                                    }
                                }
                            }
                        },
                        {
                            key: '_onMemberInfoModified',
                            value: function (e) {
                                var that = this;
                                var n = e.payload.groupProfile.groupID;
                                e.payload.memberList.forEach(function (e) {
                                    var r = that.groupController.getLocalGroupMemberInfo(n, e.userID);
                                    if (r && e.muteTime) {
                                        r.updateMuteUntil(e.muteTime);
                                    }
                                });
                            }
                        }
                    ]);
                    return e;
                })();
                var ku = (function () {
                    function n(e) {
                        r(this, n);
                        this.groupController = e.groupController;
                        this.tim = e.tim;
                        this.pendencyMap = new Map();
                        this._initLiceners();
                    }
                    i(n, [
                        {
                            key: '_initLiceners',
                            value: function () {
                                this.tim.innerEmitter.on(no, this._onReceivedGroupSystemNotice, this);
                                this.tim.innerEmitter.on(Xr, this._clearGroupSystemNotice, this);
                            }
                        },
                        {
                            key: '_clearGroupSystemNotice',
                            value: function () {
                                var that = this;
                                this.getPendencyList().then(function (n) {
                                    n.forEach(function (t) {
                                        that.pendencyMap.set(''.concat(t.from, '_').concat(t.groupID, '_').concat(t.to), t);
                                    });
                                    var r = that.tim.messageController.getLocalMessageList(t.CONV_SYSTEM);
                                    var o = [];
                                    r.forEach(function (t) {
                                        var n = t.payload;
                                        var r = n.operatorID;
                                        var i = n.operationType;
                                        var s = n.groupProfile;
                                        if (i === xe) {
                                            var a = ''.concat(r, '_').concat(s.groupID, '_').concat(s.to);
                                            var u = that.pendencyMap.get(a);
                                            if (u && Z(u.handled) && 0 !== u.handled) {
                                                o.push(t);
                                            }
                                        }
                                    });
                                    that.groupController.deleteGroupSystemNotice({
                                        messageList: o
                                    });
                                });
                            }
                        },
                        {
                            key: 'getPendencyList',
                            value: function (e) {
                                var that = this;
                                return this.groupController
                                    .request({
                                        name: 'group',
                                        action: 'getGroupPendency',
                                        param: {
                                            startTime: e && e.startTime ? e.startTime : 0,
                                            limit: e && e.limit ? e.limit : 10,
                                            handleAccount: this.tim.context.identifier
                                        }
                                    })
                                    .then(function (e) {
                                        var n = e.data;
                                        var r = n.pendencyList;
                                        return 0 !== n.nextStartTime
                                            ? that
                                                  .getPendencyList({
                                                      startTime: n.nextStartTime
                                                  })
                                                  .then(function (e) {
                                                      return [].concat(_(r), _(e));
                                                  })
                                            : r;
                                    });
                            }
                        },
                        {
                            key: '_onReceivedGroupSystemNotice',
                            value: function (t) {
                                var that = this;
                                var r = t.data;
                                var o = r.result;
                                if ('sync' !== r.type) {
                                    o.forEach(function (t) {
                                        switch (t.payload.operationType) {
                                            case 1:
                                                that._onApplyGroupRequest(t);
                                                break;
                                            case 2:
                                                that._onApplyGroupRequestAgreed(t);
                                                break;
                                            case 3:
                                                that._onApplyGroupRequestRefused(t);
                                                break;
                                            case 4:
                                                that._onMemberKicked(t);
                                                break;
                                            case 5:
                                                that._onGroupDismissed(t);
                                                break;
                                            case 6:
                                                break;
                                            case 7:
                                                that._onInviteGroup(t);
                                                break;
                                            case 8:
                                                that._onQuitGroup(t);
                                                break;
                                            case 9:
                                                that._onSetManager(t);
                                                break;
                                            case 10:
                                                that._onDeleteManager(t);
                                                break;
                                            case 11:
                                            case 12:
                                            case 15:
                                                break;
                                            case 255:
                                                that.groupController.emitOuterEvent(e.GROUP_SYSTEM_NOTICE_RECEIVED, {
                                                    message: t,
                                                    type: We
                                                });
                                        }
                                    });
                                }
                            }
                        },
                        {
                            key: '_onApplyGroupRequest',
                            value: function (t) {
                                this.groupController.emitOuterEvent(e.GROUP_SYSTEM_NOTICE_RECEIVED, {
                                    message: t,
                                    type: xe
                                });
                            }
                        },
                        {
                            key: '_onApplyGroupRequestAgreed',
                            value: function (t) {
                                var that = this;
                                var r = t.payload.groupProfile.groupID;
                                this.groupController.hasLocalGroup(r) ||
                                    this.groupController
                                        .getGroupProfile({
                                            groupID: r
                                        })
                                        .then(function (e) {
                                            var t = e.data.group;
                                            if (t) {
                                                that.groupController.updateGroupMap([t]);
                                                that.groupController.emitGroupListUpdate();
                                            }
                                        });
                                this.groupController.emitOuterEvent(e.GROUP_SYSTEM_NOTICE_RECEIVED, {
                                    message: t,
                                    type: Fe
                                });
                            }
                        },
                        {
                            key: '_onApplyGroupRequestRefused',
                            value: function (t) {
                                this.groupController.emitOuterEvent(e.GROUP_SYSTEM_NOTICE_RECEIVED, {
                                    message: t,
                                    type: He
                                });
                            }
                        },
                        {
                            key: '_onMemberKicked',
                            value: function (t) {
                                var n = t.payload.groupProfile.groupID;
                                if (this.groupController.hasLocalGroup(n)) {
                                    this.groupController.deleteLocalGroupAndConversation(n);
                                }
                                this.groupController.emitOuterEvent(e.GROUP_SYSTEM_NOTICE_RECEIVED, {
                                    message: t,
                                    type: Be
                                });
                            }
                        },
                        {
                            key: '_onGroupDismissed',
                            value: function (t) {
                                var n = t.payload.groupProfile.groupID;
                                var r = this.groupController.hasLocalGroup(n);
                                var o = this.groupController.AVChatRoomHandler;
                                if (r) {
                                    this.groupController.deleteLocalGroupAndConversation(n);
                                }
                                if (o.checkJoinedAVChatRoomByID(n)) {
                                    o.reset();
                                }
                                this.groupController.emitOuterEvent(e.GROUP_SYSTEM_NOTICE_RECEIVED, {
                                    message: t,
                                    type: Ve
                                });
                            }
                        },
                        {
                            key: '_onInviteGroup',
                            value: function (t) {
                                var that = this;
                                var r = t.payload.groupProfile.groupID;
                                this.groupController.hasLocalGroup(r) ||
                                    this.groupController
                                        .getGroupProfile({
                                            groupID: r
                                        })
                                        .then(function (e) {
                                            var t = e.data.group;
                                            if (t) {
                                                that.groupController.updateGroupMap([t]);
                                                that.groupController.emitGroupListUpdate();
                                            }
                                        });
                                this.groupController.emitOuterEvent(e.GROUP_SYSTEM_NOTICE_RECEIVED, {
                                    message: t,
                                    type: Ke
                                });
                            }
                        },
                        {
                            key: '_onQuitGroup',
                            value: function (t) {
                                var n = t.payload.groupProfile.groupID;
                                if (this.groupController.hasLocalGroup(n)) {
                                    this.groupController.deleteLocalGroupAndConversation(n);
                                }
                                this.groupController.emitOuterEvent(e.GROUP_SYSTEM_NOTICE_RECEIVED, {
                                    message: t,
                                    type: je
                                });
                            }
                        },
                        {
                            key: '_onSetManager',
                            value: function (n) {
                                var r = n.payload.groupProfile;
                                var o = r.to;
                                var i = r.groupID;
                                var s = this.groupController.getLocalGroupMemberInfo(i, o);
                                if (s) {
                                    s.updateRole(t.GRP_MBR_ROLE_ADMIN);
                                }
                                this.groupController.emitOuterEvent(e.GROUP_SYSTEM_NOTICE_RECEIVED, {
                                    message: n,
                                    type: $e
                                });
                            }
                        },
                        {
                            key: '_onDeleteManager',
                            value: function (n) {
                                var r = n.payload.groupProfile;
                                var o = r.to;
                                var i = r.groupID;
                                var s = this.groupController.getLocalGroupMemberInfo(i, o);
                                if (s) {
                                    s.updateRole(t.GRP_MBR_ROLE_MEMBER);
                                }
                                this.groupController.emitOuterEvent(e.GROUP_SYSTEM_NOTICE_RECEIVED, {
                                    message: n,
                                    type: Ye
                                });
                            }
                        },
                        {
                            key: 'reset',
                            value: function () {
                                this.pendencyMap.clear();
                            }
                        }
                    ]);
                    return n;
                })();
                var Au = {
                    3: true,
                    4: true,
                    5: true,
                    6: true
                };
                var wu = (function () {
                    function n(e) {
                        var t = e.tim;
                        var o = e.groupController;
                        r(this, n);
                        this.tim = t;
                        this.groupController = o;
                        this.AVChatRoomLoop = null;
                        this.key = '';
                        this.startSeq = 0;
                        this.group = {};
                    }
                    i(n, [
                        {
                            key: 'hasJoinedAVChatRoom',
                            value: function () {
                                return !(!this.group || oe(this.group.groupID));
                            }
                        },
                        {
                            key: 'checkJoinedAVChatRoomByID',
                            value: function (e) {
                                return !(!this.group && oe(this.group.groupID)) && e === this.group.groupID;
                            }
                        },
                        {
                            key: 'getJoinedAVChatRoom',
                            value: function () {
                                return this.hasJoinedAVChatRoom() ? this.group : null;
                            }
                        },
                        {
                            key: '_updateProperties',
                            value: function (e) {
                                var that = this;
                                Object.keys(e).forEach(function (n) {
                                    that[n] = e[n];
                                });
                            }
                        },
                        {
                            key: 'start',
                            value: function () {
                                var e = {
                                    key: this.key,
                                    startSeq: this.startSeq
                                };
                                if (null === this.AVChatRoomLoop) {
                                    var t = this.groupController.createTransportCapsule({
                                        name: 'AVChatRoom',
                                        action: 'startLongPoll',
                                        param: e
                                    });
                                    this.AVChatRoomLoop = this.tim.connectionController.createRunLoop({
                                        pack: t,
                                        before: this._updateRequestData.bind(this),
                                        success: this._handleSuccess.bind(this),
                                        fail: this._handleFailure.bind(this),
                                        isAVChatRoomLoop: true
                                    });
                                    this.AVChatRoomLoop.start();
                                    J.log('AVChatRoomHandler.start message channel started');
                                } else {
                                    this.AVChatRoomLoop.isRunning() || this.AVChatRoomLoop.start();
                                }
                            }
                        },
                        {
                            key: 'stop',
                            value: function () {
                                if (null !== this.AVChatRoomLoop && this.AVChatRoomLoop.isRunning()) {
                                    this.AVChatRoomLoop.abort();
                                    this.AVChatRoomLoop.stop();
                                    J.log('AVChatRoomHandler.stop message channel stopped');
                                }
                            }
                        },
                        {
                            key: 'startRunLoop',
                            value: function (e) {
                                var that = this;
                                return this._precheck().then(function () {
                                    var n = e.longPollingKey;
                                    var r = e.group;
                                    that._updateProperties({
                                        key: n,
                                        startSeq: 0,
                                        group: r || {}
                                    });
                                    that.groupController.updateGroupMap([r]);
                                    that.groupController.emitGroupListUpdate(true, false);
                                    that.start();
                                    return that.groupController.isLoggedIn()
                                        ? zo({
                                              status: Le.SUCCESS,
                                              group: r
                                          })
                                        : zo({
                                              status: Le.SUCCESS
                                          });
                                });
                            }
                        },
                        {
                            key: 'joinWithoutAuth',
                            value: function (e) {
                                var that = this;
                                return this.groupController
                                    .request({
                                        name: 'group',
                                        action: 'applyJoinAVChatRoom',
                                        param: e
                                    })
                                    .then(function (n) {
                                        var r = n.data.longPollingKey;
                                        if (oe(r)) {
                                            return Wo(
                                                new pt({
                                                    code: zt,
                                                    message: ir
                                                })
                                            );
                                        }
                                        J.log('AVChatRoomHandler.joinWithoutAuth ok. groupID:', e.groupID);
                                        that.groupController.emitInnerEvent(bo);
                                        that.groupController.emitInnerEvent(No, e.groupID);
                                        var o = new du({
                                            groupID: e.groupID
                                        });
                                        that.startRunLoop({
                                            group: o,
                                            longPollingKey: r
                                        });
                                        return new jo({
                                            status: Le.SUCCESS
                                        });
                                    })
                                    .catch(function (t) {
                                        J.error('AVChatRoomHandler.joinWithoutAuth error:'.concat(t.message, '. groupID:').concat(e.groupID));
                                        return Wo(t);
                                    });
                            }
                        },
                        {
                            key: '_precheck',
                            value: function () {
                                if (!this.hasJoinedAVChatRoom()) {
                                    return Promise.resolve();
                                }
                                if (this.groupController.isLoggedIn()) {
                                    if (!(this.group.selfInfo.role === t.GRP_MBR_ROLE_OWNER || this.group.ownerID === this.tim.loginInfo.identifier)) {
                                        return this.groupController.quitGroup(this.group.groupID);
                                    }
                                    this.groupController.deleteLocalGroupAndConversation(this.group.groupID);
                                } else {
                                    this.groupController.deleteLocalGroupAndConversation(this.group.groupID);
                                }
                                this.reset();
                                return Promise.resolve();
                            }
                        },
                        {
                            key: '_updateRequestData',
                            value: function (e) {
                                e.StartSeq = this.startSeq;
                                e.Key = this.key;
                                this.tim.sumStatController.addTotalCount(Zo);
                            }
                        },
                        {
                            key: '_handleSuccess',
                            value: function (e) {
                                this.tim.sumStatController.addSuccessCount(Zo);
                                this.tim.sumStatController.addCost(Zo, e.data.timecost);
                                this.startSeq = e.data.nextSeq;
                                this.key = e.data.key;
                                if (Array.isArray(e.data.rspMsgList)) {
                                    e.data.rspMsgList.forEach(function (e) {
                                        e.to = e.groupID;
                                    });
                                }
                                if (e.data.rspMsgList && e.data.rspMsgList.length > 0) {
                                    this._dispatchNotice(e.data.rspMsgList);
                                }
                                this.groupController.emitInnerEvent(Io);
                            }
                        },
                        {
                            key: '_handleFailure',
                            value: function (e) {
                                if (e.error) {
                                    if ('ECONNABORTED' === e.error.code || e.error.code === ln) {
                                        if (e.error.config) {
                                            var t = e.error.config.url;
                                            var n = e.error.config.data;
                                            J.log('AVChatRoomHandler._handleFailure request timed out. url='.concat(t, ' data=').concat(n));
                                        } else {
                                            J.log('AVChatRoomHandler._handleFailure request timed out');
                                        }
                                    } else {
                                        J.log('AVChatRoomHandler._handleFailure request failed due to network error');
                                    }
                                }
                                this.groupController.emitInnerEvent(Mo);
                            }
                        },
                        {
                            key: '_dispatchNotice',
                            value: function (n) {
                                if (re(n) && 0 !== n.length) {
                                    for (var r = null, o = [], i = [], s = 0; s < n.length; s++) {
                                        Au[n[s].event]
                                            ? ((r = this.packMessage(n[s], n[s].event)),
                                              this.tim.messageController.hasLocalMessage(r.conversationID, r.ID) || (r.conversationType === t.CONV_SYSTEM && i.push(r), o.push(r)))
                                            : J.warn('AVChatRoomHandler._dispatchMessage 未处理的 event 类型：', n[s].event);
                                    }
                                    if (i.length > 0) {
                                        this.groupController.emitInnerEvent(no, {
                                            result: i,
                                            eventDataList: [],
                                            type: 'poll'
                                        });
                                    }
                                    if (0 !== o.length) {
                                        var a = this.packConversationOption(o);
                                        if (a.length > 0) {
                                            this.groupController.emitInnerEvent(to, {
                                                eventDataList: a,
                                                type: 'poll'
                                            });
                                        }
                                        J.debug('AVChatRoomHandler._dispatchNotice nums='.concat(o.length));
                                        this.groupController.emitOuterEvent(e.MESSAGE_RECEIVED, o);
                                    }
                                }
                            }
                        },
                        {
                            key: 'packMessage',
                            value: function (e, n) {
                                e.currentUser = this.tim.context.identifier;
                                e.conversationType = 5 === n ? t.CONV_SYSTEM : t.CONV_GROUP;
                                e.isSystemMessage = !!e.isSystemMessage;
                                var r = new br(e);
                                var o = this.packElements(e, n);
                                r.setElement(o);
                                return r;
                            }
                        },
                        {
                            key: 'packElements',
                            value: function (e, n) {
                                return 4 === n || 6 === n
                                    ? {
                                          type: t.MSG_GRP_TIP,
                                          content: u({}, e.elements, {
                                              groupProfile: e.groupProfile
                                          })
                                      }
                                    : 5 === n
                                    ? {
                                          type: t.MSG_GRP_SYS_NOTICE,
                                          content: u({}, e.elements, {
                                              groupProfile: e.groupProfile
                                          })
                                      }
                                    : this.tim.bigDataHallwayController.parseElements(e.elements, e.from);
                            }
                        },
                        {
                            key: 'packConversationOption',
                            value: function (e) {
                                for (var t = new Map(), n = 0; n < e.length; n++) {
                                    var r = e[n];
                                    var o = r.conversationID;
                                    if (t.has(o)) {
                                        var i = t.get(o);
                                        i.lastMessage = r;
                                        if ('in' === r.flow) {
                                            i.unreadCount++;
                                        }
                                    } else {
                                        t.set(o, {
                                            conversationID: r.conversationID,
                                            unreadCount: 'out' === r.flow ? 0 : 1,
                                            type: r.conversationType,
                                            subType: r.conversationSubType,
                                            lastMessage: r
                                        });
                                    }
                                }
                                return _(t.values());
                            }
                        },
                        {
                            key: 'reset',
                            value: function () {
                                if (null !== this.AVChatRoomLoop) {
                                    J.log('AVChatRoomHandler.reset');
                                    this.stop();
                                    this.AVChatRoomLoop = null;
                                    this.key = '';
                                    this.startSeq = 0;
                                    this.group = {};
                                }
                            }
                        }
                    ]);
                    return n;
                })();
                var Ru = (function (n) {
                    l(s, n);
                    var o = y(s);
                    function s(e) {
                        var t;
                        r(this, s);
                        (t = o.call(this, e)).groupMap = new Map();
                        t.groupMemberListMap = new Map();
                        t.groupNoticeHandler = new ku({
                            tim: e,
                            groupController: g(t)
                        });
                        t.groupTipsHandler = new Eu({
                            tim: e,
                            groupController: g(t)
                        });
                        t.AVChatRoomHandler = new wu({
                            tim: e,
                            groupController: g(t)
                        });
                        t._initListeners();
                        return t;
                    }
                    i(s, [
                        {
                            key: 'createGroup',
                            value: function (e) {
                                var that = this;
                                if (!['Public', 'Private', 'ChatRoom', 'AVChatRoom'].includes(e.type)) {
                                    var r = new pt({
                                        code: Ht,
                                        message: Qn
                                    });
                                    return Wo(r);
                                }
                                if (Te(e.type) && !oe(e.memberList) && e.memberList.length > 0) {
                                    J.warn('GroupController.createGroup 创建AVChatRoom时不能添加群成员，自动忽略该字段');
                                    e.memberList = void 0;
                                }
                                De(e.type) ||
                                    oe(e.joinOption) ||
                                    (J.warn('GroupController.createGroup 创建Private/ChatRoom/AVChatRoom群时不能设置字段：joinOption，自动忽略该字段'), (e.joinOption = void 0));
                                var o = new oi();
                                o.setMethod(Ci).setStart();
                                J.log('GroupController.createGroup.');
                                return this.request({
                                    name: 'group',
                                    action: 'create',
                                    param: e
                                })
                                    .then(function (r) {
                                        o.setCode(0).setNetworkType(that.getNetworkType()).setText('groupType='.concat(e.type, ' groupID=').concat(r.data.groupID)).setEnd();
                                        J.log('GroupController.createGroup ok. groupID:', r.data.groupID);
                                        if (e.type === t.GRP_AVCHATROOM) {
                                            return that.getGroupProfile({
                                                groupID: r.data.groupID
                                            });
                                        }
                                        that.updateGroupMap([
                                            u({}, e, {
                                                groupID: r.data.groupID
                                            })
                                        ]);
                                        var i = that.tim.createCustomMessage({
                                            to: r.data.groupID,
                                            conversationType: t.CONV_GROUP,
                                            payload: {
                                                data: 'group_create',
                                                extension: ''.concat(that.tim.context.identifier, '创建群组')
                                            }
                                        });
                                        that.tim.sendMessage(i);
                                        that.emitGroupListUpdate();
                                        return that.getGroupProfile({
                                            groupID: r.data.groupID
                                        });
                                    })
                                    .then(function (e) {
                                        var n = e.data.group;
                                        n.selfInfo.messageRemindType = t.MSG_REMIND_ACPT_AND_NOTE;
                                        n.selfInfo.role = t.GRP_MBR_ROLE_OWNER;
                                        return e;
                                    })
                                    .catch(function (t) {
                                        o.setText('groupType='.concat(e.type));
                                        that.probeNetwork().then(function (e) {
                                            var n = v(e, 2);
                                            var r = n[0];
                                            var i = n[1];
                                            o.setError(t, r, i).setEnd();
                                        });
                                        J.error('GroupController.createGroup error:', t);
                                        return Wo(t);
                                    });
                            }
                        },
                        {
                            key: 'joinGroup',
                            value: function (e) {
                                if (this.hasLocalGroup(e.groupID)) {
                                    var n = {
                                        status: t.JOIN_STATUS_ALREADY_IN_GROUP
                                    };
                                    return zo(n);
                                }
                                if (e.type === t.GRP_PRIVATE) {
                                    var r = new pt({
                                        code: Bt,
                                        message: Zn
                                    });
                                    return Wo(r);
                                }
                                J.log('GroupController.joinGroup. groupID:', e.groupID);
                                return this.isLoggedIn() ? this.applyJoinGroup(e) : this.AVChatRoomHandler.joinWithoutAuth(e);
                            }
                        },
                        {
                            key: 'quitGroup',
                            value: function (e) {
                                var that = this;
                                J.log('GroupController.quitGroup. groupID:', e);
                                var n = this.AVChatRoomHandler.checkJoinedAVChatRoomByID(e);
                                if (n && !this.isLoggedIn()) {
                                    J.log('GroupController.quitGroup anonymously ok. groupID:', e);
                                    this.deleteLocalGroupAndConversation(e);
                                    this.AVChatRoomHandler.reset();
                                    return zo({
                                        groupID: e
                                    });
                                }
                                var r = new oi();
                                r.setMethod(Ii).setStart();
                                return this.request({
                                    name: 'group',
                                    action: 'quitGroup',
                                    param: {
                                        groupID: e
                                    }
                                })
                                    .then(function () {
                                        r.setCode(0).setNetworkType(that.getNetworkType()).setText('groupID='.concat(e)).setEnd();
                                        J.log('GroupController.quitGroup ok. groupID:', e);
                                        if (n) {
                                            that.AVChatRoomHandler.reset();
                                        }
                                        that.deleteLocalGroupAndConversation(e);
                                        return new jo({
                                            groupID: e
                                        });
                                    })
                                    .catch(function (n) {
                                        r.setText('groupID='.concat(e));
                                        that.probeNetwork().then(function (e) {
                                            var t = v(e, 2);
                                            var o = t[0];
                                            var i = t[1];
                                            r.setError(n, o, i).setEnd();
                                        });
                                        J.error('GroupController.quitGroup error.  error:'.concat(n, '. groupID:').concat(e));
                                        return Wo(n);
                                    });
                            }
                        },
                        {
                            key: 'changeGroupOwner',
                            value: function (e) {
                                var that = this;
                                if (this.hasLocalGroup(e.groupID) && this.getLocalGroupProfile(e.groupID).type === t.GRP_AVCHATROOM) {
                                    return Wo(
                                        new pt({
                                            code: Vt,
                                            message: er
                                        })
                                    );
                                }
                                if (e.newOwnerID === this.tim.loginInfo.identifier) {
                                    return Wo(
                                        new pt({
                                            code: Kt,
                                            message: tr
                                        })
                                    );
                                }
                                var r = new oi();
                                r.setMethod(Si).setStart();
                                J.log('GroupController.changeGroupOwner. groupID:', e.groupID);
                                return this.request({
                                    name: 'group',
                                    action: 'changeGroupOwner',
                                    param: e
                                })
                                    .then(function () {
                                        r.setCode(0).setNetworkType(that.getNetworkType()).setText('groupID='.concat(e.groupID)).setEnd();
                                        J.log('GroupController.changeGroupOwner ok. groupID:', e.groupID);
                                        var t = e.groupID;
                                        var o = e.newOwnerID;
                                        that.groupMap.get(t).ownerID = o;
                                        var i = that.groupMemberListMap.get(t);
                                        if (i instanceof Map) {
                                            var s = i.get(that.tim.loginInfo.identifier);
                                            oe(s) || (s.updateRole('Member'), (that.groupMap.get(t).selfInfo.role = 'Member'));
                                            var a = i.get(o);
                                            oe(a) || a.updateRole('Owner');
                                        }
                                        that.emitGroupListUpdate(true, false);
                                        return new jo({
                                            group: that.groupMap.get(t)
                                        });
                                    })
                                    .catch(function (t) {
                                        r.setText('groupID='.concat(e.groupID));
                                        that.probeNetwork().then(function (e) {
                                            var n = v(e, 2);
                                            var o = n[0];
                                            var i = n[1];
                                            r.setError(t, o, i).setEnd();
                                        });
                                        J.error('GroupController.changeGroupOwner error:'.concat(t, '. groupID:').concat(e.groupID));
                                        return Wo(t);
                                    });
                            }
                        },
                        {
                            key: 'dismissGroup',
                            value: function (e) {
                                var that = this;
                                if (this.hasLocalGroup(e) && this.getLocalGroupProfile(e).type === t.GRP_PRIVATE) {
                                    return Wo(
                                        new pt({
                                            code: jt,
                                            message: nr
                                        })
                                    );
                                }
                                var r = new oi();
                                r.setMethod(Di).setStart();
                                J.log('GroupController.dismissGroup. groupID:'.concat(e));
                                return this.request({
                                    name: 'group',
                                    action: 'destroyGroup',
                                    param: {
                                        groupID: e
                                    }
                                })
                                    .then(function () {
                                        r.setCode(0).setNetworkType(that.getNetworkType()).setText('groupID='.concat(e)).setEnd();
                                        J.log('GroupController.dismissGroup ok. groupID:'.concat(e));
                                        that.deleteLocalGroupAndConversation(e);
                                        if (that.checkJoinedAVChatRoomByID(e)) {
                                            that.AVChatRoomHandler.reset();
                                        }
                                        return new jo({
                                            groupID: e
                                        });
                                    })
                                    .catch(function (t) {
                                        r.setText('groupID='.concat(e));
                                        that.probeNetwork().then(function (e) {
                                            var n = v(e, 2);
                                            var o = n[0];
                                            var i = n[1];
                                            r.setError(t, o, i).setEnd();
                                        });
                                        J.error('GroupController.dismissGroup error:'.concat(t, '. groupID:').concat(e));
                                        return Wo(t);
                                    });
                            }
                        },
                        {
                            key: 'updateGroupProfile',
                            value: function (e) {
                                var that = this;
                                !this.hasLocalGroup(e.groupID) ||
                                    De(this.getLocalGroupProfile(e.groupID).type) ||
                                    oe(e.joinOption) ||
                                    (J.warn('GroupController.updateGroupProfile Private/ChatRoom/AVChatRoom群不能设置字段：joinOption，自动忽略该字段'), (e.joinOption = void 0));
                                oe(e.muteAllMembers) || (e.muteAllMembers ? (e.muteAllMembers = 'On') : (e.muteAllMembers = 'Off'));
                                var n = new oi();
                                n.setMethod(Ti).setStart();
                                n.setText('groupID='.concat(e.groupID));
                                J.log('GroupController.updateGroupProfile. groupID:', e.groupID);
                                return this.request({
                                    name: 'group',
                                    action: 'updateGroupProfile',
                                    param: e
                                })
                                    .then(function () {
                                        n.setCode(0).setNetworkType(that.getNetworkType()).setEnd();
                                        J.log('GroupController.updateGroupProfile ok. groupID:', e.groupID);
                                        if (that.hasLocalGroup(e.groupID)) {
                                            that.groupMap.get(e.groupID).updateGroup(e);
                                            that._setStorageGroupList();
                                        }
                                        return new jo({
                                            group: that.groupMap.get(e.groupID)
                                        });
                                    })
                                    .catch(function (r) {
                                        that.probeNetwork().then(function (e) {
                                            var t = v(e, 2);
                                            var o = t[0];
                                            var i = t[1];
                                            n.setError(r, o, i).setEnd();
                                        });
                                        J.log('GroupController.updateGroupProfile failed. error:'.concat(fe(r), ' groupID:').concat(e.groupID));
                                        return Wo(r);
                                    });
                            }
                        },
                        {
                            key: 'setGroupMemberRole',
                            value: function (e) {
                                var that = this;
                                var r = e.groupID;
                                var o = e.userID;
                                var i = e.role;
                                var s = this.groupMap.get(r);
                                if (s.selfInfo.role !== t.GRP_MBR_ROLE_OWNER) {
                                    return Wo(
                                        new pt({
                                            code: Xt,
                                            message: ar
                                        })
                                    );
                                }
                                if ([t.GRP_PRIVATE, t.GRP_AVCHATROOM].includes(s.type)) {
                                    return Wo(
                                        new pt({
                                            code: Jt,
                                            message: ur
                                        })
                                    );
                                }
                                if ([t.GRP_MBR_ROLE_ADMIN, t.GRP_MBR_ROLE_MEMBER].indexOf(i) < 0) {
                                    return Wo(
                                        new pt({
                                            code: Qt,
                                            message: lr
                                        })
                                    );
                                }
                                if (o === this.tim.loginInfo.identifier) {
                                    return Wo(
                                        new pt({
                                            code: Zt,
                                            message: cr
                                        })
                                    );
                                }
                                var a = new oi();
                                a.setMethod(Oi).setStart();
                                a.setText('groupID='.concat(r, ' userID=').concat(o, ' role=').concat(i));
                                J.log('GroupController.setGroupMemberRole. groupID:'.concat(r, '. userID: ').concat(o));
                                return this._modifyGroupMemberInfo({
                                    groupID: r,
                                    userID: o,
                                    role: i
                                })
                                    .then(function (e) {
                                        a.setCode(0).setNetworkType(that.getNetworkType()).setEnd();
                                        J.log('GroupController.setGroupMemberRole ok. groupID:'.concat(r, '. userID: ').concat(o));
                                        return new jo({
                                            group: s,
                                            member: e
                                        });
                                    })
                                    .catch(function (e) {
                                        that.probeNetwork().then(function (t) {
                                            var n = v(t, 2);
                                            var r = n[0];
                                            var o = n[1];
                                            a.setError(e, r, o).setEnd();
                                        });
                                        J.error('GroupController.setGroupMemberRole error:'.concat(e, '. groupID:').concat(r, '. userID:').concat(o));
                                        return Wo(e);
                                    });
                            }
                        },
                        {
                            key: 'setGroupMemberMuteTime',
                            value: function (e) {
                                var that = this;
                                var n = e.groupID;
                                var r = e.userID;
                                var o = e.muteTime;
                                if (r === this.tim.loginInfo.identifier) {
                                    return Wo(
                                        new pt({
                                            code: en,
                                            message: pr
                                        })
                                    );
                                }
                                J.log('GroupController.setGroupMemberMuteTime. groupID:'.concat(n, '. userID: ').concat(r));
                                var i = new oi();
                                i.setMethod(wi).setStart();
                                i.setText('groupID='.concat(n, ' userID=').concat(r, ' muteTime=').concat(o));
                                return this._modifyGroupMemberInfo({
                                    groupID: n,
                                    userID: r,
                                    muteTime: o
                                })
                                    .then(function (e) {
                                        i.setCode(0).setNetworkType(that.getNetworkType()).setEnd();
                                        J.log('GroupController.setGroupMemberMuteTime ok. groupID:'.concat(n, '. userID: ').concat(r));
                                        return new jo({
                                            group: that.getLocalGroupProfile(n),
                                            member: e
                                        });
                                    })
                                    .catch(function (e) {
                                        that.probeNetwork().then(function (t) {
                                            var n = v(t, 2);
                                            var r = n[0];
                                            var o = n[1];
                                            i.setError(e, r, o).setEnd();
                                        });
                                        J.error('GroupController.setGroupMemberMuteTime error:'.concat(e, '. groupID:').concat(n, '. userID:').concat(r));
                                        return Wo(e);
                                    });
                            }
                        },
                        {
                            key: 'setMessageRemindType',
                            value: function (e) {
                                var that = this;
                                J.log('GroupController.setMessageRemindType. groupID:'.concat(e.groupID, '. userID: ').concat(e.userID || this.tim.loginInfo.identifier));
                                var n = e.groupID;
                                var r = e.messageRemindType;
                                return this._modifyGroupMemberInfo({
                                    groupID: n,
                                    messageRemindType: r,
                                    userID: this.tim.loginInfo.identifier
                                })
                                    .then(function () {
                                        J.log(
                                            'GroupController.setMessageRemindType ok. groupID:'.concat(e.groupID, '. userID: ').concat(e.userID || that.tim.loginInfo.identifier)
                                        );
                                        var n = that.getLocalGroupProfile(e.groupID);
                                        if (n) {
                                            n.selfInfo.messageRemindType = r;
                                        }
                                        return new jo({
                                            group: n
                                        });
                                    })
                                    .catch(function (n) {
                                        J.error(
                                            'GroupController.setMessageRemindType error:'
                                                .concat(n, '. groupID:')
                                                .concat(e.groupID, '. userID:')
                                                .concat(e.userID || that.tim.loginInfo.identifier)
                                        );
                                        return Wo(n);
                                    });
                            }
                        },
                        {
                            key: 'setGroupMemberNameCard',
                            value: function (e) {
                                var that = this;
                                var n = e.groupID;
                                var r = e.userID;
                                var o = void 0 === r ? this.tim.loginInfo.identifier : r;
                                var i = e.nameCard;
                                J.log('GroupController.setGroupMemberNameCard. groupID:'.concat(n, '. userID: ').concat(o));
                                var s = new oi();
                                s.setMethod(Ri).setStart();
                                s.setText('groupID='.concat(n, ' userID=').concat(o, ' nameCard=').concat(i));
                                return this._modifyGroupMemberInfo({
                                    groupID: n,
                                    userID: o,
                                    nameCard: i
                                })
                                    .then(function (e) {
                                        J.log('GroupController.setGroupMemberNameCard ok. groupID:'.concat(n, '. userID: ').concat(o));
                                        s.setCode(0).setNetworkType(that.getNetworkType()).setEnd();
                                        var r = that.getLocalGroupProfile(n);
                                        if (o === that.tim.loginInfo.identifier && r) {
                                            r.setSelfNameCard(i);
                                        }
                                        return new jo({
                                            group: r,
                                            member: e
                                        });
                                    })
                                    .catch(function (e) {
                                        that.probeNetwork().then(function (t) {
                                            var n = v(t, 2);
                                            var r = n[0];
                                            var o = n[1];
                                            s.setError(e, r, o).setEnd();
                                        });
                                        J.error('GroupController.setGroupMemberNameCard error:'.concat(e, '. groupID:').concat(n, '. userID:').concat(o));
                                        return Wo(e);
                                    });
                            }
                        },
                        {
                            key: 'setGroupMemberCustomField',
                            value: function (e) {
                                var that = this;
                                var n = e.groupID;
                                var r = e.userID;
                                var o = void 0 === r ? this.tim.loginInfo.identifier : r;
                                var i = e.memberCustomField;
                                J.log('GroupController.setGroupMemberCustomField. groupID:'.concat(n, '. userID: ').concat(o));
                                var s = new oi();
                                s.setMethod(Li).setStart();
                                s.setText('groupID='.concat(n, ' userID=').concat(o, ' memberCustomField=').concat(i));
                                return this._modifyGroupMemberInfo({
                                    groupID: n,
                                    userID: o,
                                    memberCustomField: i
                                })
                                    .then(function (e) {
                                        s.setCode(0).setNetworkType(that.getNetworkType()).setEnd();
                                        J.log('GroupController.setGroupMemberCustomField ok. groupID:'.concat(n, '. userID: ').concat(o));
                                        return new jo({
                                            group: that.groupMap.get(n),
                                            member: e
                                        });
                                    })
                                    .catch(function (e) {
                                        that.probeNetwork().then(function (t) {
                                            var n = v(t, 2);
                                            var r = n[0];
                                            var o = n[1];
                                            s.setError(e, r, o).setEnd();
                                        });
                                        J.error('GroupController.setGroupMemberCustomField error:'.concat(e, '. groupID:').concat(n, '. userID:').concat(o));
                                        return Wo(e);
                                    });
                            }
                        },
                        {
                            key: 'getGroupList',
                            value: function (e) {
                                var that = this;
                                var n = new oi();
                                n.setMethod(Ei).setStart();
                                J.log('GroupController.getGroupList');
                                var r = {
                                    introduction: 'Introduction',
                                    notification: 'Notification',
                                    createTime: 'CreateTime',
                                    ownerID: 'Owner_Account',
                                    lastInfoTime: 'LastInfoTime',
                                    memberNum: 'MemberNum',
                                    maxMemberNum: 'MaxMemberNum',
                                    joinOption: 'ApplyJoinOption',
                                    muteAllMembers: 'ShutUpAllMember'
                                };
                                var o = ['Type', 'Name', 'FaceUrl', 'NextMsgSeq', 'LastMsgTime'];
                                if (e && e.groupProfileFilter) {
                                    e.groupProfileFilter.forEach(function (e) {
                                        if (r[e]) {
                                            o.push(r[e]);
                                        }
                                    });
                                }
                                return this.request({
                                    name: 'group',
                                    action: 'list',
                                    param: {
                                        responseFilter: {
                                            groupBaseInfoFilter: o,
                                            selfInfoFilter: ['Role', 'JoinTime', 'MsgFlag']
                                        }
                                    }
                                })
                                    .then(function (e) {
                                        var r = e.data.groups;
                                        n.setCode(0).setNetworkType(that.getNetworkType()).setText(r.length).setEnd();
                                        J.log('GroupController.getGroupList ok. nums='.concat(r.length));
                                        that._groupListTreeShaking(r);
                                        that.updateGroupMap(r);
                                        if (that.tempConversationList) {
                                            J.log('GroupController.getGroupList update last message with tempConversationList, nums='.concat(that.tempConversationList.length));
                                            that._handleUpdateGroupLastMessage({
                                                data: that.tempConversationList
                                            });
                                            that.tempConversationList = null;
                                        }
                                        that.emitGroupListUpdate();
                                        return new jo({
                                            groupList: that.getLocalGroups()
                                        });
                                    })
                                    .catch(function (e) {
                                        that.probeNetwork().then(function (t) {
                                            var r = v(t, 2);
                                            var o = r[0];
                                            var i = r[1];
                                            n.setError(e, o, i).setEnd();
                                        });
                                        J.error('GroupController.getGroupList error: ', e);
                                        return Wo(e);
                                    });
                            }
                        },
                        {
                            key: 'getGroupMemberList',
                            value: function (e) {
                                var that = this;
                                var n = e.groupID;
                                var r = e.offset;
                                var o = void 0 === r ? 0 : r;
                                var i = e.count;
                                var s = void 0 === i ? 15 : i;
                                J.log('GroupController.getGroupMemberList groupID: '.concat(n, ' offset: ').concat(o, ' count: ').concat(s));
                                var a = [];
                                return this.request({
                                    name: 'group',
                                    action: 'getGroupMemberList',
                                    param: {
                                        groupID: n,
                                        offset: o,
                                        limit: s > 100 ? 100 : s,
                                        memberInfoFilter: ['Role', 'NameCard', 'ShutUpUntil']
                                    }
                                })
                                    .then(function (e) {
                                        var r = e.data;
                                        var o = r.members;
                                        var i = r.memberNum;
                                        return re(o) && 0 !== o.length
                                            ? (that.hasLocalGroup(n) && (that.getLocalGroupProfile(n).memberNum = i),
                                              (a = that._updateLocalGroupMemberMap(n, o)),
                                              that.tim.getUserProfile({
                                                  userIDList: o.map(function (e) {
                                                      return e.userID;
                                                  }),
                                                  tagList: [Ze.NICK, Ze.AVATAR]
                                              }))
                                            : Promise.resolve([]);
                                    })
                                    .then(function (e) {
                                        var r = e.data;
                                        if (!re(r) || 0 === r.length) {
                                            return zo({
                                                memberList: []
                                            });
                                        }
                                        var o = r.map(function (e) {
                                            return {
                                                userID: e.userID,
                                                nick: e.nick,
                                                avatar: e.avatar
                                            };
                                        });
                                        that._updateLocalGroupMemberMap(n, o);
                                        J.log('GroupController.getGroupMemberList ok.');
                                        return new jo({
                                            memberList: a
                                        });
                                    })
                                    .catch(function (e) {
                                        J.error('GroupController.getGroupMemberList error: ', e);
                                        return Wo(e);
                                    });
                            }
                        },
                        {
                            key: 'getLocalGroups',
                            value: function () {
                                return _(this.groupMap.values());
                            }
                        },
                        {
                            key: 'getLocalGroupProfile',
                            value: function (e) {
                                return this.groupMap.get(e);
                            }
                        },
                        {
                            key: 'hasLocalGroup',
                            value: function (e) {
                                return this.groupMap.has(e);
                            }
                        },
                        {
                            key: 'getLocalGroupMemberInfo',
                            value: function (e, t) {
                                return this.groupMemberListMap.has(e) ? this.groupMemberListMap.get(e).get(t) : null;
                            }
                        },
                        {
                            key: 'setLocalGroupMember',
                            value: function (e, t) {
                                if (this.groupMemberListMap.has(e)) {
                                    this.groupMemberListMap.get(e).set(t.userID, t);
                                } else {
                                    var n = new Map().set(t.userID, t);
                                    this.groupMemberListMap.set(e, n);
                                }
                            }
                        },
                        {
                            key: 'hasLocalGroupMember',
                            value: function (e, t) {
                                return this.groupMemberListMap.has(e) && this.groupMemberListMap.get(e).has(t);
                            }
                        },
                        {
                            key: 'hasLocalGroupMemberMap',
                            value: function (e) {
                                return this.groupMemberListMap.has(e);
                            }
                        },
                        {
                            key: 'getGroupProfile',
                            value: function (e) {
                                var that = this;
                                J.log('GroupController.getGroupProfile. groupID:', e.groupID);
                                var n = e.groupID;
                                var r = e.groupCustomFieldFilter;
                                var o = {
                                    groupIDList: [n],
                                    responseFilter: {
                                        groupBaseInfoFilter: [
                                            'Type',
                                            'Name',
                                            'Introduction',
                                            'Notification',
                                            'FaceUrl',
                                            'Owner_Account',
                                            'CreateTime',
                                            'InfoSeq',
                                            'LastInfoTime',
                                            'LastMsgTime',
                                            'MemberNum',
                                            'MaxMemberNum',
                                            'ApplyJoinOption',
                                            'NextMsgSeq',
                                            'ShutUpAllMember'
                                        ],
                                        groupCustomFieldFilter: r
                                    }
                                };
                                return this.getGroupProfileAdvance(o)
                                    .then(function (r) {
                                        var o;
                                        var i = r.data;
                                        var s = i.successGroupList;
                                        var a = i.failureGroupList;
                                        J.log('GroupController.getGroupProfile ok. groupID:', e.groupID);
                                        return a.length > 0
                                            ? Wo(a[0])
                                            : (Te(s[0].type) && !that.hasLocalGroup(n) ? (o = new du(s[0])) : (that.updateGroupMap(s), (o = that.getLocalGroupProfile(n))),
                                              o && o.selfInfo && !o.selfInfo.nameCard
                                                  ? that.updateSelfInfo(o).then(function (e) {
                                                        return new jo({
                                                            group: e
                                                        });
                                                    })
                                                  : new jo({
                                                        group: o
                                                    }));
                                    })
                                    .catch(function (t) {
                                        J.error('GroupController.getGroupProfile error:'.concat(t, '. groupID:').concat(e.groupID));
                                        return Wo(t);
                                    });
                            }
                        },
                        {
                            key: 'getGroupMemberProfile',
                            value: function (e) {
                                var that = this;
                                J.log('GroupController.getGroupMemberProfile groupID:'.concat(e.groupID, ' userIDList:').concat(e.userIDList.join(',')));
                                if (e.userIDList.length > 50) {
                                    e.userIDList = e.userIDList.slice(0, 50);
                                }
                                var n = e.groupID;
                                var r = e.userIDList;
                                return this._getGroupMemberProfileAdvance(
                                    u({}, e, {
                                        userIDList: r
                                    })
                                )
                                    .then(function (e) {
                                        var r = e.data.members;
                                        return re(r) && 0 !== r.length
                                            ? (that._updateLocalGroupMemberMap(n, r),
                                              that.tim.getUserProfile({
                                                  userIDList: r.map(function (e) {
                                                      return e.userID;
                                                  }),
                                                  tagList: [Ze.NICK, Ze.AVATAR]
                                              }))
                                            : zo([]);
                                    })
                                    .then(function (e) {
                                        var o = e.data.map(function (e) {
                                            return {
                                                userID: e.userID,
                                                nick: e.nick,
                                                avatar: e.avatar
                                            };
                                        });
                                        that._updateLocalGroupMemberMap(n, o);
                                        var i = r
                                            .filter(function (e) {
                                                return that.hasLocalGroupMember(n, e);
                                            })
                                            .map(function (e) {
                                                return that.getLocalGroupMemberInfo(n, e);
                                            });
                                        return new jo({
                                            memberList: i
                                        });
                                    });
                            }
                        },
                        {
                            key: '_getGroupMemberProfileAdvance',
                            value: function (e) {
                                return this.request({
                                    name: 'group',
                                    action: 'getGroupMemberProfile',
                                    param: u({}, e, {
                                        memberInfoFilter: e.memberInfoFilter ? e.memberInfoFilter : ['Role', 'JoinTime', 'NameCard', 'ShutUpUntil']
                                    })
                                });
                            }
                        },
                        {
                            key: 'updateSelfInfo',
                            value: function (e) {
                                var t = e.groupID;
                                J.log('GroupController.updateSelfInfo groupID:', t);
                                var n = {
                                    groupID: t,
                                    userIDList: [this.tim.loginInfo.identifier]
                                };
                                return this.getGroupMemberProfile(n).then(function (n) {
                                    var r = n.data.memberList;
                                    J.log('GroupController.updateSelfInfo ok. groupID:', t);
                                    if (e && 0 !== r.length) {
                                        e.updateSelfInfo(r[0]);
                                    }
                                    return e;
                                });
                            }
                        },
                        {
                            key: 'addGroupMember',
                            value: function (e) {
                                var t = this.getLocalGroupProfile(e.groupID);
                                if (Te(t.type)) {
                                    var n = new pt({
                                        code: Yt,
                                        message: or
                                    });
                                    return Wo(n);
                                }
                                e.userIDList = e.userIDList.map(function (e) {
                                    return {
                                        userID: e
                                    };
                                });
                                J.log('GroupController.addGroupMember. groupID:', e.groupID);
                                return this.request({
                                    name: 'group',
                                    action: 'addGroupMember',
                                    param: e
                                })
                                    .then(function (n) {
                                        var r = n.data.members;
                                        J.log('GroupController.addGroupMember ok. groupID:', e.groupID);
                                        var o = r
                                            .filter(function (e) {
                                                return 1 === e.result;
                                            })
                                            .map(function (e) {
                                                return e.userID;
                                            });
                                        var i = r
                                            .filter(function (e) {
                                                return 0 === e.result;
                                            })
                                            .map(function (e) {
                                                return e.userID;
                                            });
                                        var s = r
                                            .filter(function (e) {
                                                return 2 === e.result;
                                            })
                                            .map(function (e) {
                                                return e.userID;
                                            });
                                        return 0 === o.length
                                            ? new jo({
                                                  successUserIDList: o,
                                                  failureUserIDList: i,
                                                  existedUserIDList: s
                                              })
                                            : ((t.memberNum += o.length),
                                              new jo({
                                                  successUserIDList: o,
                                                  failureUserIDList: i,
                                                  existedUserIDList: s,
                                                  group: t
                                              }));
                                    })
                                    .catch(function (t) {
                                        J.error('GroupController.addGroupMember error:'.concat(t, ', groupID:').concat(e.groupID));
                                        return Wo(t);
                                    });
                            }
                        },
                        {
                            key: 'deleteGroupMember',
                            value: function (e) {
                                var that = this;
                                J.log('GroupController.deleteGroupMember groupID:'.concat(e.groupID, ' userIDList:').concat(e.userIDList));
                                var r = this.getLocalGroupProfile(e.groupID);
                                return r.type === t.GRP_AVCHATROOM
                                    ? Wo(
                                          new pt({
                                              code: Wt,
                                              message: sr
                                          })
                                      )
                                    : this.request({
                                          name: 'group',
                                          action: 'deleteGroupMember',
                                          param: e
                                      })
                                          .then(function () {
                                              J.log('GroupController.deleteGroupMember ok');
                                              r.memberNum--;
                                              that.deleteLocalGroupMembers(e.groupID, e.userIDList);
                                              return new jo({
                                                  group: r,
                                                  userIDList: e.userIDList
                                              });
                                          })
                                          .catch(function (t) {
                                              J.error('GroupController.deleteGroupMember error:'.concat(t.code, ', groupID:').concat(e.groupID));
                                              return Wo(t);
                                          });
                            }
                        },
                        {
                            key: 'searchGroupByID',
                            value: function (e) {
                                var t = {
                                    groupIDList: [e]
                                };
                                J.log('GroupController.searchGroupByID. groupID:'.concat(e));
                                return this.request({
                                    name: 'group',
                                    action: 'searchGroupByID',
                                    param: t
                                })
                                    .then(function (t) {
                                        var n = t.data.groupProfile;
                                        if (n[0].errorCode !== Ne.SUCCESS) {
                                            throw new pt({
                                                code: n[0].errorCode,
                                                message: n[0].errorInfo
                                            });
                                        }
                                        J.log('GroupController.searchGroupByID ok. groupID:'.concat(e));
                                        return new jo({
                                            group: new du(n[0])
                                        });
                                    })
                                    .catch(function (t) {
                                        J.warn('GroupController.searchGroupByID error:'.concat(fe(t), ', groupID:').concat(e));
                                        return Wo(t);
                                    });
                            }
                        },
                        {
                            key: 'applyJoinGroup',
                            value: function (e) {
                                var that = this;
                                var n = new oi();
                                n.setMethod(Mi).setStart();
                                return this.request({
                                    name: 'group',
                                    action: 'applyJoinGroup',
                                    param: e
                                })
                                    .then(function (r) {
                                        var o = r.data;
                                        var i = o.joinedStatus;
                                        var s = o.longPollingKey;
                                        switch (
                                            (n.setCode(0).setNetworkType(that.getNetworkType()).setText('groupID='.concat(e.groupID, ' joinedStatus=').concat(i)).setEnd(),
                                            J.log('GroupController.joinGroup ok. groupID:', e.groupID),
                                            i)
                                        ) {
                                            case Le.WAIT_APPROVAL:
                                                return new jo({
                                                    status: Le.WAIT_APPROVAL
                                                });
                                            case Le.SUCCESS:
                                                return that
                                                    .getGroupProfile({
                                                        groupID: e.groupID
                                                    })
                                                    .then(function (n) {
                                                        var r = n.data.group;
                                                        var o = {
                                                            status: Le.SUCCESS,
                                                            group: r
                                                        };
                                                        return oe(s)
                                                            ? new jo(o)
                                                            : (that.emitInnerEvent(No, e.groupID),
                                                              that.AVChatRoomHandler.startRunLoop({
                                                                  longPollingKey: s,
                                                                  group: r
                                                              }));
                                                    });
                                            default:
                                                var a = new pt({
                                                    code: $t,
                                                    message: rr
                                                });
                                                J.error('GroupController.joinGroup error:'.concat(a, '. groupID:').concat(e.groupID));
                                                return Wo(a);
                                        }
                                    })
                                    .catch(function (r) {
                                        n.setText('groupID='.concat(e.groupID));
                                        that.probeNetwork().then(function (e) {
                                            var t = v(e, 2);
                                            var o = t[0];
                                            var i = t[1];
                                            n.setError(r, o, i).setEnd();
                                        });
                                        J.error('GroupController.joinGroup error:'.concat(r, '. groupID:').concat(e.groupID));
                                        return Wo(r);
                                    });
                            }
                        },
                        {
                            key: 'applyJoinAVChatRoom',
                            value: function (e) {
                                return this.AVChatRoomHandler.applyJoinAVChatRoom(e);
                            }
                        },
                        {
                            key: 'handleGroupApplication',
                            value: function (e) {
                                var that = this;
                                var n = e.message.payload;
                                var r = n.groupProfile.groupID;
                                var o = n.authentication;
                                var i = n.messageKey;
                                var s = n.operatorID;
                                J.log('GroupController.handleApplication. groupID:', r);
                                return this.request({
                                    name: 'group',
                                    action: 'handleApplyJoinGroup',
                                    param: u({}, e, {
                                        applicant: s,
                                        groupID: r,
                                        authentication: o,
                                        messageKey: i
                                    })
                                })
                                    .then(function () {
                                        J.log('GroupController.handleApplication ok. groupID:', r);
                                        that.deleteGroupSystemNotice({
                                            messageList: [e.message]
                                        });
                                        return new jo({
                                            group: that.getLocalGroupProfile(r)
                                        });
                                    })
                                    .catch(function (e) {
                                        J.error('GroupController.handleApplication error.  error:'.concat(e, '. groupID:').concat(r));
                                        return Wo(e);
                                    });
                            }
                        },
                        {
                            key: 'deleteGroupSystemNotice',
                            value: function (e) {
                                var that = this;
                                return re(e.messageList) && 0 !== e.messageList.length
                                    ? (J.log(
                                          'GroupController.deleteGroupSystemNotice ' +
                                              e.messageList.map(function (e) {
                                                  return e.ID;
                                              })
                                      ),
                                      this.request({
                                          name: 'group',
                                          action: 'deleteGroupSystemNotice',
                                          param: {
                                              messageListToDelete: e.messageList.map(function (e) {
                                                  return {
                                                      from: t.CONV_SYSTEM,
                                                      messageSeq: e.clientSequence,
                                                      messageRandom: e.random
                                                  };
                                              })
                                          }
                                      })
                                          .then(function () {
                                              J.log('GroupController.deleteGroupSystemNotice ok');
                                              e.messageList.forEach(function (e) {
                                                  that.tim.messageController.deleteLocalMessage(e);
                                              });
                                              return new jo();
                                          })
                                          .catch(function (e) {
                                              J.error('GroupController.deleteGroupSystemNotice error:', e);
                                              return Wo(e);
                                          }))
                                    : zo();
                            }
                        },
                        {
                            key: 'getGroupProfileAdvance',
                            value: function (e) {
                                if (re(e.groupIDList) && e.groupIDList.length > 50) {
                                    J.warn('GroupController.getGroupProfileAdvance 获取群资料的数量不能超过50个');
                                    e.groupIDList.length = 50;
                                }
                                J.log('GroupController.getGroupProfileAdvance. groupIDList:', e.groupIDList);
                                return this.request({
                                    name: 'group',
                                    action: 'query',
                                    param: e
                                })
                                    .then(function (e) {
                                        J.log('GroupController.getGroupProfileAdvance ok.');
                                        var t = e.data.groups;
                                        var n = t.filter(function (e) {
                                            return oe(e.errorCode) || e.errorCode === Ne.SUCCESS;
                                        });
                                        var r = t
                                            .filter(function (e) {
                                                return e.errorCode && e.errorCode !== Ne.SUCCESS;
                                            })
                                            .map(function (e) {
                                                return new pt({
                                                    code: Number('500'.concat(e.errorCode)),
                                                    message: e.errorInfo,
                                                    data: {
                                                        groupID: e.groupID
                                                    }
                                                });
                                            });
                                        return new jo({
                                            successGroupList: n,
                                            failureGroupList: r
                                        });
                                    })
                                    .catch(function (t) {
                                        J.error('GroupController.getGroupProfileAdvance error:'.concat(t, '. groupID:').concat(e.groupID));
                                        return Wo(t);
                                    });
                            }
                        },
                        {
                            key: '_deleteLocalGroup',
                            value: function (e) {
                                this.groupMap.delete(e);
                                this.groupMemberListMap.delete(e);
                                this._setStorageGroupList();
                                return this.groupMap.has(e) && this.groupMemberListMap.has(e);
                            }
                        },
                        {
                            key: '_initGroupList',
                            value: function () {
                                var that = this;
                                var t = new oi();
                                t.setMethod(ki).setStart();
                                J.time(ni);
                                J.log('GroupController._initGroupList');
                                var n = this._getStorageGroupList();
                                re(n) && n.length > 0
                                    ? (n.forEach(function (t) {
                                          that.groupMap.set(t.groupID, new du(t));
                                      }),
                                      this.emitGroupListUpdate(true, false),
                                      t.setCode(0).setNetworkType(this.getNetworkType()).setText(this.groupMap.size).setEnd())
                                    : t.setCode(0).setNetworkType(this.getNetworkType()).setText(0).setEnd();
                                this.triggerReady();
                                J.log('GroupController._initGroupList ok. initCost='.concat(J.timeEnd(ni), 'ms'));
                                this.getGroupList();
                            }
                        },
                        {
                            key: '_initListeners',
                            value: function () {
                                var e = this.tim.innerEmitter;
                                e.once(Yr, this._initGroupList, this);
                                e.on(wo, this._handleUpdateGroupLastMessage, this);
                                e.on(to, this._handleReceivedGroupMessage, this);
                                e.on(Lo, this._handleProfileUpdated, this);
                            }
                        },
                        {
                            key: 'emitGroupListUpdate',
                            value: function () {
                                var t = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0];
                                var n = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1];
                                var r = this.getLocalGroups();
                                if (n) {
                                    this.emitInnerEvent(So, r);
                                }
                                if (t) {
                                    this.emitOuterEvent(e.GROUP_LIST_UPDATED, r);
                                }
                            }
                        },
                        {
                            key: '_handleReceivedGroupMessage',
                            value: function (e) {
                                var that = this;
                                var r = e.data.eventDataList;
                                if (Array.isArray(r)) {
                                    r.forEach(function (e) {
                                        var r = e.conversationID.replace(t.CONV_GROUP, '');
                                        if (that.groupMap.has(r)) {
                                            that.groupMap.get(r).nextMessageSeq = e.lastMessage.sequence + 1;
                                        }
                                    });
                                }
                            }
                        },
                        {
                            key: '_onReceivedGroupSystemNotice',
                            value: function (e) {
                                var t = e.data;
                                this.groupNoticeHandler._onReceivedGroupNotice(t);
                            }
                        },
                        {
                            key: '_handleUpdateGroupLastMessage',
                            value: function (e) {
                                var n = e.data;
                                J.log('GroupController._handleUpdateGroupLastMessage convNums='.concat(n.length, ' groupNums=').concat(this.groupMap.size));
                                if (0 !== this.groupMap.size) {
                                    for (var r, o, i, s = false, a = 0, u = n.length; a < u; a++) {
                                        if ((r = n[a]).conversationID && r.type !== t.CONV_GROUP) {
                                            o = r.conversationID.split(/^GROUP/)[1];
                                            if ((i = this.getLocalGroupProfile(o))) {
                                                (i.lastMessage = r.lastMessage), (s = true);
                                            }
                                        }
                                    }
                                    if (s) {
                                        this.groupMap = this._sortLocalGroupList(this.groupMap);
                                        this.emitGroupListUpdate(true, false);
                                    }
                                } else {
                                    this.tempConversationList = n;
                                }
                            }
                        },
                        {
                            key: '_sortLocalGroupList',
                            value: function (e) {
                                var t = _(e).filter(function (e) {
                                    var t = v(e, 2);
                                    t[0];
                                    return !we(t[1].lastMessage);
                                });
                                t.sort(function (e, t) {
                                    return t[1].lastMessage.lastTime - e[1].lastMessage.lastTime;
                                });
                                return new Map([].concat(_(t), _(e)));
                            }
                        },
                        {
                            key: '_getStorageGroupList',
                            value: function () {
                                return this.tim.storage.getItem('groupMap');
                            }
                        },
                        {
                            key: '_setStorageGroupList',
                            value: function () {
                                var e = this.getLocalGroups()
                                    .filter(function (e) {
                                        var t = e.type;
                                        return !Te(t);
                                    })
                                    .slice(0, 20)
                                    .map(function (e) {
                                        return {
                                            groupID: e.groupID,
                                            name: e.name,
                                            avatar: e.avatar,
                                            type: e.type
                                        };
                                    });
                                this.tim.storage.setItem('groupMap', e);
                            }
                        },
                        {
                            key: 'updateGroupMap',
                            value: function (e) {
                                var that = this;
                                e.forEach(function (e) {
                                    that.groupMap.has(e.groupID) ? that.groupMap.get(e.groupID).updateGroup(e) : that.groupMap.set(e.groupID, new du(e));
                                });
                                this._setStorageGroupList();
                            }
                        },
                        {
                            key: '_updateLocalGroupMemberMap',
                            value: function (e, t) {
                                var that = this;
                                return re(t) && 0 !== t.length
                                    ? t.map(function (t) {
                                          that.hasLocalGroupMember(e, t.userID)
                                              ? that.getLocalGroupMemberInfo(e, t.userID).updateMember(t)
                                              : that.setLocalGroupMember(e, new Tu(t));
                                          return that.getLocalGroupMemberInfo(e, t.userID);
                                      })
                                    : [];
                            }
                        },
                        {
                            key: 'deleteLocalGroupMembers',
                            value: function (e, t) {
                                var n = this.groupMemberListMap.get(e);
                                if (n) {
                                    t.forEach(function (e) {
                                        n.delete(e);
                                    });
                                }
                            }
                        },
                        {
                            key: '_modifyGroupMemberInfo',
                            value: function (e) {
                                var that = this;
                                var n = e.groupID;
                                var r = e.userID;
                                return this.request({
                                    name: 'group',
                                    action: 'modifyGroupMemberInfo',
                                    param: e
                                }).then(function () {
                                    if (that.hasLocalGroupMember(n, r)) {
                                        var o = that.getLocalGroupMemberInfo(n, r);
                                        oe(e.muteTime) || o.updateMuteUntil(e.muteTime);
                                        oe(e.role) || o.updateRole(e.role);
                                        oe(e.nameCard) || o.updateNameCard(e.nameCard);
                                        oe(e.memberCustomField) || o.updateMemberCustomField(e.memberCustomField);
                                        return o;
                                    }
                                    return that
                                        .getGroupMemberProfile({
                                            groupID: n,
                                            userIDList: [r]
                                        })
                                        .then(function (e) {
                                            return v(e.data.memberList, 1)[0];
                                        });
                                });
                            }
                        },
                        {
                            key: '_groupListTreeShaking',
                            value: function (e) {
                                for (var t = new Map(_(this.groupMap)), n = 0, r = e.length; n < r; n++) {
                                    t.delete(e[n].groupID);
                                }
                                if (this.AVChatRoomHandler.hasJoinedAVChatRoom()) {
                                    t.delete(this.AVChatRoomHandler.group.groupID);
                                }
                                for (var o = _(t.keys()), i = 0, s = o.length; i < s; i++) {
                                    this.groupMap.delete(o[i]);
                                }
                            }
                        },
                        {
                            key: '_handleProfileUpdated',
                            value: function (e) {
                                for (
                                    var that = this,
                                        n = e.data,
                                        r = function (e) {
                                            var r = n[e];
                                            that.groupMemberListMap.forEach(function (e) {
                                                if (e.has(r.userID)) {
                                                    e.get(r.userID).updateMember({
                                                        nick: r.nick,
                                                        avatar: r.avatar
                                                    });
                                                }
                                            });
                                        },
                                        o = 0;
                                    o < n.length;
                                    o++
                                ) {
                                    r(o);
                                }
                            }
                        },
                        {
                            key: 'getJoinedAVChatRoom',
                            value: function () {
                                return this.AVChatRoomHandler.getJoinedAVChatRoom();
                            }
                        },
                        {
                            key: 'deleteLocalGroupAndConversation',
                            value: function (e) {
                                this._deleteLocalGroup(e);
                                this.tim.conversationController.deleteLocalConversation('GROUP'.concat(e));
                                this.emitGroupListUpdate(true, false);
                            }
                        },
                        {
                            key: 'checkJoinedAVChatRoomByID',
                            value: function (e) {
                                return this.AVChatRoomHandler.checkJoinedAVChatRoomByID(e);
                            }
                        },
                        {
                            key: 'getGroupLastSequence',
                            value: function (e) {
                                var that = this;
                                var n = new oi();
                                n.setMethod(Ai).setStart();
                                var r = 0;
                                if (this.hasLocalGroup(e)) {
                                    var o = this.getLocalGroupProfile(e);
                                    if (o.lastMessage.lastSequence > 0) {
                                        r = o.lastMessage.lastSequence;
                                        J.log(
                                            'GroupController.getGroupLastSequence got lastSequence='
                                                .concat(r, ' from local group profile[lastMessage.lastSequence]. groupID=')
                                                .concat(e)
                                        );
                                        n.setCode(0)
                                            .setNetworkType(this.getNetworkType())
                                            .setText('got lastSequence='.concat(r, ' from local group profile[lastMessage.lastSequence]. groupID=').concat(e))
                                            .setEnd();
                                        return Promise.resolve(r);
                                    }
                                    if (o.nextMessageSeq > 1) {
                                        r = o.nextMessageSeq - 1;
                                        J.log('GroupController.getGroupLastSequence got lastSequence='.concat(r, ' from local group profile[nextMessageSeq]. groupID=').concat(e));
                                        n.setCode(0)
                                            .setNetworkType(this.getNetworkType())
                                            .setText('got lastSequence='.concat(r, ' from local group profile[nextMessageSeq]. groupID=').concat(e))
                                            .setEnd();
                                        return Promise.resolve(r);
                                    }
                                }
                                var i = 'GROUP'.concat(e);
                                var s = this.tim.conversationController.getLocalConversation(i);
                                if (s && s.lastMessage.lastSequence) {
                                    r = s.lastMessage.lastSequence;
                                    J.log(
                                        'GroupController.getGroupLastSequence got lastSequence='
                                            .concat(r, ' from local conversation profile[lastMessage.lastSequence]. groupID=')
                                            .concat(e)
                                    );
                                    n.setCode(0)
                                        .setNetworkType(this.getNetworkType())
                                        .setText('got lastSequence='.concat(r, ' from local conversation profile[lastMessage.lastSequence]. groupID=').concat(e))
                                        .setEnd();
                                    return Promise.resolve(r);
                                }
                                var a = {
                                    groupIDList: [e],
                                    responseFilter: {
                                        groupBaseInfoFilter: ['NextMsgSeq']
                                    }
                                };
                                return this.getGroupProfileAdvance(a)
                                    .then(function (o) {
                                        var i = o.data.successGroupList;
                                        we(i)
                                            ? J.log('GroupController.getGroupLastSequence successGroupList is empty. groupID='.concat(e))
                                            : ((r = i[0].nextMessageSeq - 1),
                                              J.log('GroupController.getGroupLastSequence got lastSequence='.concat(r, ' from getGroupProfileAdvance. groupID=').concat(e)));
                                        n.setCode(0)
                                            .setNetworkType(that.getNetworkType())
                                            .setText('got lastSequence='.concat(r, ' from getGroupProfileAdvance. groupID=').concat(e))
                                            .setEnd();
                                        return r;
                                    })
                                    .catch(function (r) {
                                        that.probeNetwork().then(function (t) {
                                            var o = v(t, 2);
                                            var i = o[0];
                                            var s = o[1];
                                            n.setError(r, i, s).setText('get lastSequence failed from getGroupProfileAdvance. groupID='.concat(e)).setEnd();
                                        });
                                        J.warn('GroupController.getGroupLastSequence failed. '.concat(r));
                                        return Wo(r);
                                    });
                            }
                        },
                        {
                            key: 'reset',
                            value: function () {
                                this.groupMap.clear();
                                this.groupMemberListMap.clear();
                                this.resetReady();
                                this.groupNoticeHandler.reset();
                                this.AVChatRoomHandler.reset();
                                this.tim.innerEmitter.once(Yr, this._initGroupList, this);
                            }
                        }
                    ]);
                    return s;
                })(Bo);
                var Ou = (function (n) {
                    l(s, n);
                    var o = y(s);
                    function s(e) {
                        var n;
                        r(this, s);
                        (n = o.call(this, e)).REALTIME_MESSAGE_TIMEOUT = 110000;
                        n.LONGPOLLING_ID_TIMEOUT = 300000;
                        n._currentState = t.NET_STATE_CONNECTED;
                        n._status = {
                            OPENIM: {
                                lastResponseReceivedTime: 0,
                                jitterCount: 0,
                                failedCount: 0
                            },
                            AVCHATROOM: {
                                lastResponseReceivedTime: 0,
                                jitterCount: 0,
                                failedCount: 0
                            }
                        };
                        var i = n.tim.innerEmitter;
                        i.on(oo, n._onGetLongPollIDFailed, g(n));
                        i.on(so, n._onOpenIMResponseOK, g(n));
                        i.on(io, n._onOpenIMRequestFailed, g(n));
                        i.on(Io, n._onAVChatroomResponseOK, g(n));
                        i.on(Mo, n._onAVChatroomRequestFailed, g(n));
                        return n;
                    }
                    i(s, [
                        {
                            key: '_onGetLongPollIDFailed',
                            value: function () {
                                if (this._currentState !== t.NET_STATE_DISCONNECTED) {
                                    this._emitNetStateChangeEvent(t.NET_STATE_DISCONNECTED);
                                }
                            }
                        },
                        {
                            key: '_onOpenIMResponseOK',
                            value: function () {
                                this._onResponseOK('OPENIM');
                            }
                        },
                        {
                            key: '_onOpenIMRequestFailed',
                            value: function () {
                                this._onRequestFailed('OPENIM');
                            }
                        },
                        {
                            key: '_onAVChatroomResponseOK',
                            value: function () {
                                this.isLoggedIn() || this._onResponseOK('AVCHATROOM');
                            }
                        },
                        {
                            key: '_onAVChatroomRequestFailed',
                            value: function () {
                                this.isLoggedIn() || this._onRequestFailed('AVCHATROOM');
                            }
                        },
                        {
                            key: '_onResponseOK',
                            value: function (e) {
                                var n = this._status[e];
                                var r = Date.now();
                                if (0 !== n.lastResponseReceivedTime) {
                                    var o = r - n.lastResponseReceivedTime;
                                    J.debug(
                                        'StatusController._onResponseOK key='
                                            .concat(e, ' currentState=')
                                            .concat(this._currentState, ' interval=')
                                            .concat(o, ' failedCount=')
                                            .concat(n.failedCount, ' jitterCount=')
                                            .concat(n.jitterCount)
                                    );
                                    if (n.failedCount > 0) {
                                        n.failedCount = 0;
                                        n.jitterCount += 1;
                                        if (this._currentState !== t.NET_STATE_CONNECTED) {
                                            this._emitNetStateChangeEvent(t.NET_STATE_CONNECTED);
                                        }
                                    }
                                    if (o <= this.REALTIME_MESSAGE_TIMEOUT) {
                                        if (n.jitterCount >= 3) {
                                            var i = new oi();
                                            i.setMethod(Pi).setStart();
                                            i.setCode(0).setText(''.concat(e, '-').concat(o, '-').concat(n.jitterCount)).setNetworkType(this.getNetworkType()).setEnd();
                                            n.jitterCount = 0;
                                        }
                                    } else if (o >= this.REALTIME_MESSAGE_TIMEOUT && o < this.LONGPOLLING_ID_TIMEOUT) {
                                        var s = new oi();
                                        s.setMethod(Gi).setStart();
                                        s.setCode(0).setText(''.concat(e, '-').concat(o)).setNetworkType(this.getNetworkType()).setEnd();
                                        J.warn('StatusController._onResponseOK, fast start. key='.concat(e, ' interval=').concat(o, ' ms'));
                                        this.emitInnerEvent(ao);
                                    } else if (o >= this.LONGPOLLING_ID_TIMEOUT) {
                                        var a = new oi();
                                        a.setMethod(Ui).setStart();
                                        a.setCode(0).setText(''.concat(e, '-').concat(o)).setNetworkType(this.getNetworkType()).setEnd();
                                        J.warn('StatusController._onResponseOK, slow start. key='.concat(e, ' interval=').concat(o, ' ms'));
                                        this.emitInnerEvent(uo);
                                    }
                                    n.lastResponseReceivedTime = r;
                                } else {
                                    n.lastResponseReceivedTime = r;
                                }
                            }
                        },
                        {
                            key: '_onRequestFailed',
                            value: function (e) {
                                var that = this;
                                var r = this._status[e];
                                Date.now() - r.lastResponseReceivedTime >= this.LONGPOLLING_ID_TIMEOUT
                                    ? this._currentState !== t.NET_STATE_DISCONNECTED &&
                                      (J.warn(
                                          'StatusController._onRequestFailed, disconnected, longpolling unavailable more than 5min. key='
                                              .concat(e, ' networkType=')
                                              .concat(this.getNetworkType())
                                      ),
                                      this._emitNetStateChangeEvent(t.NET_STATE_DISCONNECTED))
                                    : ((r.failedCount += 1),
                                      r.failedCount > 5
                                          ? this.probeNetwork().then(function (o) {
                                                var i = v(o, 2);
                                                var s = i[0];
                                                var a = i[1];
                                                s
                                                    ? (that._currentState !== t.NET_STATE_CONNECTING && that._emitNetStateChangeEvent(t.NET_STATE_CONNECTING),
                                                      J.warn('StatusController._onRequestFailed, connecting, network jitter. key='.concat(e, ' networkType=').concat(a)))
                                                    : (that._currentState !== t.NET_STATE_DISCONNECTED && that._emitNetStateChangeEvent(t.NET_STATE_DISCONNECTED),
                                                      J.warn(
                                                          'StatusController._onRequestFailed, disconnected, longpolling unavailable. key='.concat(e, ' networkType=').concat(a)
                                                      ));
                                                r.failedCount = 0;
                                                r.jitterCount = 0;
                                            })
                                          : this._currentState === t.NET_STATE_CONNECTED && this._emitNetStateChangeEvent(t.NET_STATE_CONNECTING));
                            }
                        },
                        {
                            key: '_emitNetStateChangeEvent',
                            value: function (t) {
                                J.log('StatusController._emitNetStateChangeEvent net state changed from '.concat(this._currentState, ' to ').concat(t));
                                this._currentState = t;
                                this.emitOuterEvent(e.NET_STATE_CHANGE, {
                                    state: t
                                });
                            }
                        },
                        {
                            key: 'reset',
                            value: function () {
                                J.log('StatusController.reset');
                                this._currentState = t.NET_STATE_CONNECTED;
                                this._status = {
                                    OPENIM: {
                                        lastResponseReceivedTime: 0,
                                        jitterCount: 0,
                                        failedCount: 0
                                    },
                                    AVCHATROOM: {
                                        lastResponseReceivedTime: 0,
                                        jitterCount: 0,
                                        failedCount: 0
                                    }
                                };
                            }
                        }
                    ]);
                    return s;
                })(Bo);
                function Lu() {
                    return null;
                }
                var Nu = (function () {
                    function e(t) {
                        r(this, e);
                        this.tim = t;
                        this.isWX = O;
                        this.storageQueue = new Map();
                        this.checkTimes = 0;
                        this.checkTimer = setInterval(this._onCheckTimer.bind(this), 1000);
                        this._errorTolerantHandle();
                    }
                    i(e, [
                        {
                            key: '_errorTolerantHandle',
                            value: function () {
                                if (!this.isWX && oe(window.localStorage)) {
                                    this.getItem = Lu;
                                    this.setItem = Lu;
                                    this.removeItem = Lu;
                                    this.clear = Lu;
                                }
                            }
                        },
                        {
                            key: '_onCheckTimer',
                            value: function () {
                                this.checkTimes++;
                                if (this.checkTimes % 20 == 0) {
                                    if (0 === this.storageQueue.size) {
                                        return;
                                    }
                                    this._doFlush();
                                }
                            }
                        },
                        {
                            key: '_doFlush',
                            value: function () {
                                try {
                                    var e;
                                    var t = I(this.storageQueue);
                                    try {
                                        for (t.s(); !(e = t.n()).done; ) {
                                            var n = v(e.value, 2);
                                            var r = n[0];
                                            var o = n[1];
                                            this.isWX ? uni.setStorageSync(this._getKey(r), o) : localStorage.setItem(this._getKey(r), JSON.stringify(o));
                                        }
                                    } catch (i) {
                                        console.log('CatchClause', i);
                                        console.log('CatchClause', i);
                                        t.e(i);
                                    } finally {
                                        t.f();
                                    }
                                    this.storageQueue.clear();
                                } catch (s) {
                                    console.log('CatchClause', s);
                                    console.log('CatchClause', s);
                                    J.warn('Storage._doFlush error', s);
                                }
                            }
                        },
                        {
                            key: '_getPrefix',
                            value: function () {
                                var e = this.tim.loginInfo;
                                var t = e.SDKAppID;
                                var n = e.identifier;
                                return 'TIM_'.concat(t, '_').concat(n, '_');
                            }
                        },
                        {
                            key: 'getItem',
                            value: function (e) {
                                var t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1];
                                try {
                                    var n = t ? this._getKey(e) : e;
                                    return this.isWX ? uni.getStorageSync(n) : JSON.parse(localStorage.getItem(n));
                                } catch (r) {
                                    console.log('CatchClause', r);
                                    console.log('CatchClause', r);
                                    J.warn('Storage.getItem error:', r);
                                }
                            }
                        },
                        {
                            key: 'setItem',
                            value: function (e, t) {
                                var n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2];
                                var r = !(arguments.length > 3 && void 0 !== arguments[3]) || arguments[3];
                                if (n) {
                                    var o = r ? this._getKey(e) : e;
                                    this.isWX ? uni.setStorageSync(o, t) : localStorage.setItem(o, JSON.stringify(t));
                                } else {
                                    this.storageQueue.set(e, t);
                                }
                            }
                        },
                        {
                            key: 'clear',
                            value: function () {
                                try {
                                    this.isWX ? uni.clearStorageSync() : localStorage.clear();
                                } catch (e) {
                                    console.log('CatchClause', e);
                                    console.log('CatchClause', e);
                                    J.warn('Storage.clear error:', e);
                                }
                            }
                        },
                        {
                            key: 'removeItem',
                            value: function (e) {
                                var t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1];
                                try {
                                    var n = t ? this._getKey(e) : e;
                                    this.isWX ? uni.removeStorageSync(n) : localStorage.removeItem(n);
                                } catch (r) {
                                    console.log('CatchClause', r);
                                    console.log('CatchClause', r);
                                    J.warn('Storage.removeItem error:', r);
                                }
                            }
                        },
                        {
                            key: 'getSize',
                            value: function (e) {
                                var that = this;
                                var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 'b';
                                try {
                                    var r = {
                                        size: 0,
                                        limitSize: 5242880,
                                        unit: n
                                    };
                                    Object.defineProperty(r, 'leftSize', {
                                        enumerable: true,
                                        get: function () {
                                            return r.limitSize - r.size;
                                        }
                                    });
                                    if (this.isWX) {
                                        r.limitSize = 1024 * uni.getStorageInfoSync().limitSize;
                                    }
                                    if (e) r.size = JSON.stringify(this.getItem(e)).length + this._getKey(e).length;
                                    else if (this.isWX) {
                                        var o = uni.getStorageInfoSync();
                                        var i = o.keys;
                                        i.forEach(function (e) {
                                            r.size += JSON.stringify(uni.getStorageSync(e)).length + that._getKey(e).length;
                                        });
                                    } else {
                                        for (var s in localStorage) {
                                            if (localStorage.hasOwnProperty(s)) {
                                                r.size += localStorage.getItem(s).length + s.length;
                                            }
                                        }
                                    }
                                    return this._convertUnit(r);
                                } catch (a) {
                                    console.log('CatchClause', a);
                                    console.log('CatchClause', a);
                                    J.warn('Storage.getSize error:', a);
                                }
                            }
                        },
                        {
                            key: '_convertUnit',
                            value: function (e) {
                                var t = {};
                                var n = e.unit;
                                for (var r in ((t.unit = n), e)) {
                                    if ('number' == typeof e[r]) {
                                        'kb' === n.toLowerCase()
                                            ? (t[r] = Math.round(e[r] / 1024))
                                            : 'mb' === n.toLowerCase()
                                            ? (t[r] = Math.round(e[r] / 1024 / 1024))
                                            : (t[r] = e[r]);
                                    }
                                }
                                return t;
                            }
                        },
                        {
                            key: '_getKey',
                            value: function (e) {
                                return ''.concat(this._getPrefix()).concat(e);
                            }
                        },
                        {
                            key: 'reset',
                            value: function () {
                                this._doFlush();
                                this.checkTimes = 0;
                            }
                        }
                    ]);
                    return e;
                })();
                var bu = T(function (e) {
                    var t = Object.prototype.hasOwnProperty;
                    var n = '~';
                    function r() {}
                    function o(e, t, n) {
                        this.fn = e;
                        this.context = t;
                        this.once = n || false;
                    }
                    function i(e, t, r, i, s) {
                        if ('function' != typeof r) {
                            throw new TypeError('The listener must be a function');
                        }
                        var a = new o(r, i || e, s);
                        var u = n ? n + t : t;
                        e._events[u] ? (e._events[u].fn ? (e._events[u] = [e._events[u], a]) : e._events[u].push(a)) : ((e._events[u] = a), e._eventsCount++);
                        return e;
                    }
                    function s(e, t) {
                        0 == --e._eventsCount ? (e._events = new r()) : delete e._events[t];
                    }
                    function a() {
                        this._events = new r();
                        this._eventsCount = 0;
                    }
                    if (Object.create) {
                        r.prototype = Object.create(null);
                        new r().__proto__ || (n = false);
                    }
                    a.prototype.eventNames = function () {
                        var e;
                        var r;
                        var o = [];
                        if (0 === this._eventsCount) {
                            return o;
                        }
                        for (r in (e = this._events)) {
                            if (t.call(e, r)) {
                                o.push(n ? r.slice(1) : r);
                            }
                        }
                        return Object.getOwnPropertySymbols ? o.concat(Object.getOwnPropertySymbols(e)) : o;
                    };
                    a.prototype.listeners = function (e) {
                        var t = n ? n + e : e;
                        var r = this._events[t];
                        if (!r) {
                            return [];
                        }
                        if (r.fn) {
                            return [r.fn];
                        }
                        for (var o = 0, i = r.length, s = new Array(i); o < i; o++) {
                            s[o] = r[o].fn;
                        }
                        return s;
                    };
                    a.prototype.listenerCount = function (e) {
                        var t = n ? n + e : e;
                        var r = this._events[t];
                        return r ? (r.fn ? 1 : r.length) : 0;
                    };
                    a.prototype.emit = function (e, t, r, o, i, s) {
                        var a = n ? n + e : e;
                        if (!this._events[a]) {
                            return false;
                        }
                        var u;
                        var l;
                        var c = this._events[a];
                        var p = arguments.length;
                        if (c.fn) {
                            switch ((c.once && this.removeListener(e, c.fn, void 0, true), p)) {
                                case 1:
                                    c.fn.call(c.context);
                                    return true;
                                case 2:
                                    c.fn.call(c.context, t);
                                    return true;
                                case 3:
                                    c.fn.call(c.context, t, r);
                                    return true;
                                case 4:
                                    c.fn.call(c.context, t, r, o);
                                    return true;
                                case 5:
                                    c.fn.call(c.context, t, r, o, i);
                                    return true;
                                case 6:
                                    c.fn.call(c.context, t, r, o, i, s);
                                    return true;
                            }
                            for (l = 1, u = new Array(p - 1); l < p; l++) {
                                u[l - 1] = arguments[l];
                            }
                            c.fn.apply(c.context, u);
                        } else {
                            var h;
                            var f = c.length;
                            for (l = 0; l < f; l++) {
                                switch ((c[l].once && this.removeListener(e, c[l].fn, void 0, true), p)) {
                                    case 1:
                                        c[l].fn.call(c[l].context);
                                        break;
                                    case 2:
                                        c[l].fn.call(c[l].context, t);
                                        break;
                                    case 3:
                                        c[l].fn.call(c[l].context, t, r);
                                        break;
                                    case 4:
                                        c[l].fn.call(c[l].context, t, r, o);
                                        break;
                                    default:
                                        if (!u) {
                                            for (h = 1, u = new Array(p - 1); h < p; h++) {
                                                u[h - 1] = arguments[h];
                                            }
                                        }
                                        c[l].fn.apply(c[l].context, u);
                                }
                            }
                        }
                        return true;
                    };
                    a.prototype.on = function (e, t, n) {
                        return i(this, e, t, n, false);
                    };
                    a.prototype.once = function (e, t, n) {
                        return i(this, e, t, n, true);
                    };
                    a.prototype.removeListener = function (e, t, r, o) {
                        var i = n ? n + e : e;
                        if (!this._events[i]) {
                            return this;
                        }
                        if (!t) {
                            s(this, i);
                            return this;
                        }
                        var a = this._events[i];
                        if (a.fn) {
                            a.fn !== t || (o && !a.once) || (r && a.context !== r) || s(this, i);
                        } else {
                            for (var u = 0, l = [], c = a.length; u < c; u++) {
                                if (a[u].fn !== t || (o && !a[u].once) || (r && a[u].context !== r)) {
                                    l.push(a[u]);
                                }
                            }
                            l.length ? (this._events[i] = 1 === l.length ? l[0] : l) : s(this, i);
                        }
                        return this;
                    };
                    a.prototype.removeAllListeners = function (e) {
                        var t;
                        e ? ((t = n ? n + e : e), this._events[t] && s(this, t)) : ((this._events = new r()), (this._eventsCount = 0));
                        return this;
                    };
                    a.prototype.off = a.prototype.removeListener;
                    a.prototype.addListener = a.prototype.on;
                    a.prefixed = n;
                    a.EventEmitter = a;
                    e.exports = a;
                });
                var Pu = function (e) {
                    var t;
                    var n;
                    var r;
                    var o;
                    var i;
                    we(e.context)
                        ? ((t = ''), (n = 0), (r = 0), (o = 0), (i = 1))
                        : ((t = e.context.a2Key), (n = e.context.tinyID), (r = e.context.SDKAppID), (o = e.context.contentType), (i = e.context.apn));
                    return {
                        platform: Fr,
                        websdkappid: xr,
                        v: qr,
                        a2: t,
                        tinyid: n,
                        sdkappid: r,
                        contentType: o,
                        apn: i,
                        reqtime: function () {
                            return +new Date();
                        }
                    };
                };
                var Gu = (function () {
                    function e(t) {
                        r(this, e);
                        this.tim = t;
                        this.tim.innerEmitter.on(jr, this._update, this);
                        this.tim.innerEmitter.on($r, this._update, this);
                        this.tim.innerEmitter.on(zr, this._updateSpecifiedConfig, this);
                        this._initConfig();
                    }
                    i(e, [
                        {
                            key: '_update',
                            value: function (e) {
                                this._initConfig();
                            }
                        },
                        {
                            key: '_updateSpecifiedConfig',
                            value: function (e) {
                                var that = this;
                                e.data.forEach(function (e) {
                                    that._set(e);
                                });
                            }
                        },
                        {
                            key: 'get',
                            value: function (e) {
                                var t = e.name;
                                var r = e.action;
                                var o = e.param;
                                var i = e.tjgID;
                                if (oe(this.config[t]) || oe(this.config[t][r])) {
                                    throw new pt({
                                        code: hn,
                                        message: ''.concat(Cr, ': PackageConfig.').concat(t)
                                    });
                                }
                                var s = (function e(t) {
                                    if (0 === Object.getOwnPropertyNames(t).length) {
                                        return Object.create(null);
                                    }
                                    var r = Array.isArray(t) ? [] : Object.create(null);
                                    var o = '';
                                    for (var i in t) {
                                        null !== t[i]
                                            ? void 0 !== t[i]
                                                ? ((o = n(t[i])), ['string', 'number', 'function', 'boolean'].indexOf(o) >= 0 ? (r[i] = t[i]) : (r[i] = e(t[i])))
                                                : (r[i] = void 0)
                                            : (r[i] = null);
                                    }
                                    return r;
                                })(this.config[t][r]);
                                s.requestData = this._initRequestData(o, s);
                                s.encode = this._initEncoder(s);
                                s.decode = this._initDecoder(s);
                                if (i) {
                                    s.queryString.tjg_id = i;
                                }
                                return s;
                            }
                        },
                        {
                            key: '_set',
                            value: function (e) {
                                var t = e.key;
                                var r = e.value;
                                if (false != !!t) {
                                    var o = t.split('.');
                                    if (!(o.length <= 0)) {
                                        !(function e(t, r, o, i) {
                                            var s = r[o];
                                            'object' === n(t[s]) ? e(t[s], r, o + 1, i) : (t[s] = i);
                                        })(this.config, o, 0, r);
                                    }
                                }
                            }
                        },
                        {
                            key: '_initConfig',
                            value: function () {
                                var e;
                                this.config = {};
                                this.config.accessLayer =
                                    ((e = this.tim),
                                    {
                                        create: null,
                                        query: {
                                            serverName: Vr.NAME.WEB_IM,
                                            cmd: Vr.CMD.ACCESS_LAYER,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            method: 'POST',
                                            queryString: {
                                                platform: Fr,
                                                identifier: e.context.identifier,
                                                usersig: e.context.userSig,
                                                contentType: e.context.contentType,
                                                apn: null !== e.context ? e.context.apn : 1,
                                                websdkappid: xr,
                                                v: qr
                                            },
                                            requestData: {}
                                        },
                                        update: null,
                                        delete: null
                                    });
                                this.config.login = (function (e) {
                                    return {
                                        create: null,
                                        query: {
                                            serverName: Vr.NAME.OPEN_IM,
                                            cmd: Vr.CMD.LOGIN,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            method: 'POST',
                                            queryString: {
                                                websdkappid: xr,
                                                v: qr,
                                                platform: Fr,
                                                identifier: e.loginInfo.identifier,
                                                usersig: e.loginInfo.userSig,
                                                sdkappid: e.loginInfo.SDKAppID,
                                                accounttype: e.loginInfo.accountType,
                                                contentType: null !== e.context ? e.context.contentType : 0,
                                                apn: null !== e.context ? e.context.apn : 1,
                                                reqtime: +new Date() / 1000
                                            },
                                            requestData: {
                                                state: 'Online'
                                            },
                                            keyMaps: {
                                                request: {
                                                    tinyID: 'tinyId'
                                                },
                                                response: {
                                                    TinyId: 'tinyID'
                                                }
                                            }
                                        },
                                        update: null,
                                        delete: null
                                    };
                                })(this.tim);
                                this.config.logout = (function (e) {
                                    return {
                                        create: null,
                                        query: {
                                            serverName: Vr.NAME.OPEN_IM,
                                            cmd: Vr.CMD.LOGOUT_ALL,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            method: 'POST',
                                            queryString: {
                                                websdkappid: xr,
                                                v: qr,
                                                platform: Fr,
                                                a2: null !== e.context ? e.context.a2Key : '',
                                                tinyid: null !== e.context ? e.context.tinyID : '',
                                                sdkappid: null !== e.loginInfo ? e.loginInfo.SDKAppID : 0,
                                                contentType: null !== e.context ? e.context.contentType : 0,
                                                apn: null !== e.context ? e.context.apn : '',
                                                reqtime: +new Date() / 1000
                                            },
                                            requestData: {}
                                        },
                                        update: null,
                                        delete: null
                                    };
                                })(this.tim);
                                this.config.longPollLogout = (function (e) {
                                    return {
                                        create: null,
                                        query: {
                                            serverName: Vr.NAME.OPEN_IM,
                                            cmd: Vr.CMD.LOGOUT_LONG_POLL,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            method: 'POST',
                                            queryString: {
                                                websdkappid: xr,
                                                v: qr,
                                                platform: Fr,
                                                a2: null !== e.context ? e.context.a2Key : '',
                                                tinyid: null !== e.context ? e.context.tinyID : 0,
                                                sdkappid: null !== e.context ? e.context.SDKAppID : 0,
                                                contentType: null !== e.context ? e.context.contentType : 0,
                                                apn: null !== e.context ? e.context.apn : 1,
                                                reqtime: function () {
                                                    return Date.now();
                                                }
                                            },
                                            requestData: {
                                                longPollID: ''
                                            },
                                            keyMaps: {
                                                request: {
                                                    longPollID: 'LongPollingId'
                                                }
                                            }
                                        },
                                        update: null,
                                        delete: null
                                    };
                                })(this.tim);
                                this.config.profile = (function (e) {
                                    var t = Pu(e);
                                    var n = Vr.NAME.PROFILE;
                                    var r = Vr.CHANNEL.XHR;
                                    var o = Br;
                                    return {
                                        query: {
                                            serverName: n,
                                            cmd: Vr.CMD.PORTRAIT_GET,
                                            channel: r,
                                            protocol: o,
                                            method: 'POST',
                                            queryString: t,
                                            requestData: {
                                                fromAccount: '',
                                                userItem: []
                                            },
                                            keyMaps: {
                                                request: {
                                                    toAccount: 'To_Account',
                                                    standardSequence: 'StandardSequence',
                                                    customSequence: 'CustomSequence'
                                                }
                                            }
                                        },
                                        update: {
                                            serverName: n,
                                            cmd: Vr.CMD.PORTRAIT_SET,
                                            channel: r,
                                            protocol: o,
                                            method: 'POST',
                                            queryString: t,
                                            requestData: {
                                                fromAccount: '',
                                                profileItem: [
                                                    {
                                                        tag: Ze.NICK,
                                                        value: ''
                                                    },
                                                    {
                                                        tag: Ze.GENDER,
                                                        value: ''
                                                    },
                                                    {
                                                        tag: Ze.ALLOWTYPE,
                                                        value: ''
                                                    },
                                                    {
                                                        tag: Ze.AVATAR,
                                                        value: ''
                                                    }
                                                ]
                                            }
                                        }
                                    };
                                })(this.tim);
                                this.config.group = (function (e) {
                                    var n = {
                                        websdkappid: xr,
                                        v: qr,
                                        platform: Fr,
                                        a2: null !== e.context && e.context.a2Key ? e.context.a2Key : void 0,
                                        tinyid: null !== e.context && e.context.tinyID ? e.context.tinyID : void 0,
                                        sdkappid: null !== e.context ? e.context.SDKAppID : 0,
                                        contentType: null !== e.context ? e.context.contentType : 0,
                                        accounttype: null !== e.context ? e.context.accountType : 0
                                    };
                                    var r = {
                                        request: {
                                            ownerID: 'Owner_Account',
                                            userID: 'Member_Account',
                                            newOwnerID: 'NewOwner_Account',
                                            maxMemberNum: 'MaxMemberCount',
                                            groupCustomField: 'AppDefinedData',
                                            memberCustomField: 'AppMemberDefinedData',
                                            groupCustomFieldFilter: 'AppDefinedDataFilter_Group',
                                            memberCustomFieldFilter: 'AppDefinedDataFilter_GroupMember',
                                            messageRemindType: 'MsgFlag',
                                            userIDList: 'MemberList',
                                            groupIDList: 'GroupIdList',
                                            applyMessage: 'ApplyMsg',
                                            muteTime: 'ShutUpTime',
                                            muteAllMembers: 'ShutUpAllMember',
                                            joinOption: 'ApplyJoinOption'
                                        },
                                        response: {
                                            GroupIdList: 'groups',
                                            MsgFlag: 'messageRemindType',
                                            AppDefinedData: 'groupCustomField',
                                            AppMemberDefinedData: 'memberCustomField',
                                            AppDefinedDataFilter_Group: 'groupCustomFieldFilter',
                                            AppDefinedDataFilter_GroupMember: 'memberCustomFieldFilter',
                                            InfoSeq: 'infoSequence',
                                            MemberList: 'members',
                                            GroupInfo: 'groups',
                                            ShutUpUntil: 'muteUntil',
                                            ShutUpAllMember: 'muteAllMembers',
                                            ApplyJoinOption: 'joinOption'
                                        }
                                    };
                                    return {
                                        create: {
                                            serverName: Vr.NAME.GROUP,
                                            cmd: Vr.CMD.CREATE_GROUP,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            queryString: n,
                                            requestData: {
                                                type: t.GRP_PRIVATE,
                                                name: void 0,
                                                groupID: void 0,
                                                ownerID: e.loginInfo.identifier,
                                                introduction: void 0,
                                                notification: void 0,
                                                avatar: void 0,
                                                maxMemberNum: void 0,
                                                joinOption: void 0,
                                                memberList: void 0,
                                                groupCustomField: void 0
                                            },
                                            keyMaps: r
                                        },
                                        list: {
                                            serverName: Vr.NAME.GROUP,
                                            cmd: Vr.CMD.GET_JOINED_GROUPS,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            queryString: n,
                                            requestData: {
                                                userID: e.loginInfo.identifier,
                                                limit: void 0,
                                                offset: void 0,
                                                groupType: void 0,
                                                responseFilter: void 0
                                            },
                                            keyMaps: r
                                        },
                                        query: {
                                            serverName: Vr.NAME.GROUP,
                                            cmd: Vr.CMD.GET_GROUP_INFO,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            queryString: n,
                                            requestData: {
                                                groupIDList: void 0,
                                                responseFilter: void 0
                                            },
                                            keyMaps: r
                                        },
                                        getGroupMemberProfile: {
                                            serverName: Vr.NAME.GROUP,
                                            cmd: Vr.CMD.GET_GROUP_MEMBER_INFO,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            queryString: n,
                                            requestData: {
                                                groupID: void 0,
                                                userIDList: void 0,
                                                memberInfoFilter: void 0,
                                                memberCustomFieldFilter: void 0
                                            },
                                            keyMaps: {
                                                request: u({}, r.request, {
                                                    userIDList: 'Member_List_Account'
                                                }),
                                                response: r.response
                                            }
                                        },
                                        getGroupMemberList: {
                                            serverName: Vr.NAME.GROUP,
                                            cmd: Vr.CMD.GET_GROUP_MEMBER_LIST,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            queryString: n,
                                            requestData: {
                                                groupID: void 0,
                                                limit: 0,
                                                offset: 0,
                                                memberRoleFilter: void 0,
                                                memberInfoFilter: void 0
                                            },
                                            keyMaps: r
                                        },
                                        quitGroup: {
                                            serverName: Vr.NAME.GROUP,
                                            cmd: Vr.CMD.QUIT_GROUP,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            queryString: n,
                                            requestData: {
                                                groupID: void 0
                                            }
                                        },
                                        changeGroupOwner: {
                                            serverName: Vr.NAME.GROUP,
                                            cmd: Vr.CMD.CHANGE_GROUP_OWNER,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            queryString: n,
                                            requestData: {
                                                groupID: void 0,
                                                newOwnerID: void 0
                                            },
                                            keyMaps: r
                                        },
                                        destroyGroup: {
                                            serverName: Vr.NAME.GROUP,
                                            cmd: Vr.CMD.DESTROY_GROUP,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            queryString: n,
                                            requestData: {
                                                groupID: void 0
                                            }
                                        },
                                        updateGroupProfile: {
                                            serverName: Vr.NAME.GROUP,
                                            cmd: Vr.CMD.MODIFY_GROUP_INFO,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            queryString: n,
                                            requestData: {
                                                groupID: void 0,
                                                name: void 0,
                                                introduction: void 0,
                                                notification: void 0,
                                                avatar: void 0,
                                                maxMemberNum: void 0,
                                                joinOption: void 0,
                                                groupCustomField: void 0,
                                                muteAllMembers: void 0
                                            },
                                            keyMaps: {
                                                request: u({}, r.request, {
                                                    groupCustomField: 'AppDefinedData'
                                                }),
                                                response: r.response
                                            }
                                        },
                                        modifyGroupMemberInfo: {
                                            serverName: Vr.NAME.GROUP,
                                            cmd: Vr.CMD.MODIFY_GROUP_MEMBER_INFO,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            queryString: n,
                                            requestData: {
                                                groupID: void 0,
                                                userID: void 0,
                                                messageRemindType: void 0,
                                                nameCard: void 0,
                                                role: void 0,
                                                memberCustomField: void 0,
                                                muteTime: void 0
                                            },
                                            keyMaps: r
                                        },
                                        addGroupMember: {
                                            serverName: Vr.NAME.GROUP,
                                            cmd: Vr.CMD.ADD_GROUP_MEMBER,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            queryString: n,
                                            requestData: {
                                                groupID: void 0,
                                                silence: void 0,
                                                userIDList: void 0
                                            },
                                            keyMaps: r
                                        },
                                        deleteGroupMember: {
                                            serverName: Vr.NAME.GROUP,
                                            cmd: Vr.CMD.DELETE_GROUP_MEMBER,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            queryString: n,
                                            requestData: {
                                                groupID: void 0,
                                                userIDList: void 0,
                                                reason: void 0
                                            },
                                            keyMaps: {
                                                request: {
                                                    userIDList: 'MemberToDel_Account'
                                                }
                                            }
                                        },
                                        searchGroupByID: {
                                            serverName: Vr.NAME.GROUP,
                                            cmd: Vr.CMD.SEARCH_GROUP_BY_ID,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            queryString: n,
                                            requestData: {
                                                groupIDList: void 0,
                                                responseFilter: {
                                                    groupBasePublicInfoFilter: [
                                                        'Type',
                                                        'Name',
                                                        'Introduction',
                                                        'Notification',
                                                        'FaceUrl',
                                                        'CreateTime',
                                                        'Owner_Account',
                                                        'LastInfoTime',
                                                        'LastMsgTime',
                                                        'NextMsgSeq',
                                                        'MemberNum',
                                                        'MaxMemberNum',
                                                        'ApplyJoinOption'
                                                    ]
                                                }
                                            },
                                            keyMaps: {
                                                request: {
                                                    groupIDList: 'GroupIdList'
                                                }
                                            }
                                        },
                                        applyJoinGroup: {
                                            serverName: Vr.NAME.GROUP,
                                            cmd: Vr.CMD.APPLY_JOIN_GROUP,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            queryString: n,
                                            requestData: {
                                                groupID: void 0,
                                                applyMessage: void 0,
                                                userDefinedField: void 0
                                            },
                                            keyMaps: r
                                        },
                                        applyJoinAVChatRoom: {
                                            serverName: Vr.NAME.BIG_GROUP_NO_AUTH,
                                            cmd: Vr.CMD.APPLY_JOIN_GROUP,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            queryString: {
                                                websdkappid: xr,
                                                v: qr,
                                                platform: Fr,
                                                sdkappid: null !== e.context ? e.context.SDKAppID : 0,
                                                contentType: null !== e.context ? e.context.contentType : 0,
                                                accounttype: null !== e.context ? e.context.accountType : 0
                                            },
                                            requestData: {
                                                groupID: void 0,
                                                applyMessage: void 0,
                                                userDefinedField: void 0
                                            },
                                            keyMaps: r
                                        },
                                        handleApplyJoinGroup: {
                                            serverName: Vr.NAME.GROUP,
                                            cmd: Vr.CMD.HANDLE_APPLY_JOIN_GROUP,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            queryString: n,
                                            requestData: {
                                                groupID: void 0,
                                                applicant: void 0,
                                                handleAction: void 0,
                                                handleMessage: void 0,
                                                authentication: void 0,
                                                messageKey: void 0,
                                                userDefinedField: void 0
                                            },
                                            keyMaps: {
                                                request: {
                                                    applicant: 'Applicant_Account',
                                                    handleAction: 'HandleMsg',
                                                    handleMessage: 'ApprovalMsg',
                                                    messageKey: 'MsgKey'
                                                },
                                                response: {
                                                    MsgKey: 'messageKey'
                                                }
                                            }
                                        },
                                        deleteGroupSystemNotice: {
                                            serverName: Vr.NAME.OPEN_IM,
                                            cmd: Vr.CMD.DELETE_GROUP_SYSTEM_MESSAGE,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            queryString: n,
                                            requestData: {
                                                messageListToDelete: void 0
                                            },
                                            keyMaps: {
                                                request: {
                                                    messageListToDelete: 'DelMsgList',
                                                    messageSeq: 'MsgSeq',
                                                    messageRandom: 'MsgRandom'
                                                }
                                            }
                                        },
                                        getGroupPendency: {
                                            serverName: Vr.NAME.GROUP,
                                            cmd: Vr.CMD.GET_GROUP_PENDENCY,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            queryString: n,
                                            requestData: {
                                                startTime: void 0,
                                                limit: void 0,
                                                handleAccount: void 0
                                            },
                                            keyMaps: {
                                                request: {
                                                    handleAccount: 'Handle_Account'
                                                }
                                            }
                                        }
                                    };
                                })(this.tim);
                                this.config.longPollID = (function (e) {
                                    return {
                                        create: {},
                                        query: {
                                            serverName: Vr.NAME.OPEN_IM,
                                            cmd: Vr.CMD.GET_LONG_POLL_ID,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            queryString: {
                                                websdkappid: xr,
                                                v: qr,
                                                platform: Fr,
                                                a2: null !== e.context ? e.context.a2Key : '',
                                                tinyid: null !== e.context ? e.context.tinyID : 0,
                                                sdkappid: null !== e.context ? e.context.SDKAppID : 0,
                                                contentType: null !== e.context ? e.context.contentType : 0,
                                                apn: null !== e.context ? e.context.apn : 1,
                                                reqtime: +new Date() / 1000
                                            },
                                            requestData: {},
                                            keyMaps: {
                                                response: {
                                                    LongPollingId: 'longPollingID'
                                                }
                                            }
                                        },
                                        update: {},
                                        delete: {}
                                    };
                                })(this.tim);
                                this.config.longPoll = (function (e) {
                                    var t = {
                                        websdkappid: xr,
                                        v: qr,
                                        platform: Fr,
                                        a2: null !== e.context ? e.context.a2Key : '',
                                        tinyid: null !== e.context ? e.context.tinyID : 0,
                                        sdkappid: null !== e.context ? e.context.SDKAppID : 0,
                                        contentType: null !== e.context ? e.context.contentType : 0,
                                        accounttype: null !== e.context ? e.loginInfo.accountType : 0,
                                        apn: null !== e.context ? e.context.apn : 1,
                                        reqtime: Math.ceil(+new Date() / 1000)
                                    };
                                    return {
                                        create: {},
                                        query: {
                                            serverName: Vr.NAME.OPEN_IM,
                                            cmd: Vr.CMD.LONG_POLL,
                                            channel: Vr.CHANNEL.AUTO,
                                            protocol: Br,
                                            queryString: t,
                                            requestData: {
                                                timeout: null,
                                                cookie: {
                                                    notifySeq: 0,
                                                    noticeSeq: 0,
                                                    longPollingID: 0
                                                }
                                            },
                                            keyMaps: {
                                                response: {
                                                    C2cMsgArray: 'C2CMessageArray',
                                                    GroupMsgArray: 'groupMessageArray',
                                                    GroupTips: 'groupTips',
                                                    C2cNotifyMsgArray: 'C2CNotifyMessageArray',
                                                    ClientSeq: 'clientSequence',
                                                    MsgPriority: 'priority',
                                                    NoticeSeq: 'noticeSequence',
                                                    MsgContent: 'content',
                                                    MsgType: 'type',
                                                    MsgBody: 'elements',
                                                    ToGroupId: 'to',
                                                    Desc: 'description',
                                                    Ext: 'extension'
                                                }
                                            }
                                        },
                                        update: {},
                                        delete: {}
                                    };
                                })(this.tim);
                                this.config.applyC2C = (function (e) {
                                    var t = Pu(e);
                                    var n = Vr.NAME.FRIEND;
                                    var r = Vr.CHANNEL.XHR;
                                    var o = Br;
                                    return {
                                        create: {
                                            serverName: n,
                                            cmd: Vr.CMD.FRIEND_ADD,
                                            channel: r,
                                            protocol: o,
                                            queryString: t,
                                            requestData: {
                                                fromAccount: '',
                                                addFriendItem: []
                                            }
                                        },
                                        get: {
                                            serverName: n,
                                            cmd: Vr.CMD.GET_PENDENCY,
                                            channel: r,
                                            protocol: o,
                                            queryString: t,
                                            requestData: {
                                                fromAccount: '',
                                                pendencyType: 'Pendency_Type_ComeIn'
                                            }
                                        },
                                        update: {
                                            serverName: n,
                                            cmd: Vr.CMD.RESPONSE_PENDENCY,
                                            channel: r,
                                            protocol: o,
                                            queryString: t,
                                            requestData: {
                                                fromAccount: '',
                                                responseFriendItem: []
                                            }
                                        },
                                        delete: {
                                            serverName: n,
                                            cmd: Vr.CMD.DELETE_PENDENCY,
                                            channel: r,
                                            protocol: o,
                                            queryString: t,
                                            requestData: {
                                                fromAccount: '',
                                                toAccount: [],
                                                pendencyType: 'Pendency_Type_ComeIn'
                                            }
                                        }
                                    };
                                })(this.tim);
                                this.config.friend = (function (e) {
                                    var t = Pu(e);
                                    var n = Vr.NAME.FRIEND;
                                    var r = Vr.CHANNEL.XHR;
                                    var o = Br;
                                    return {
                                        get: {
                                            serverName: n,
                                            cmd: Vr.CMD.FRIEND_GET_ALL,
                                            channel: r,
                                            protocol: o,
                                            method: 'POST',
                                            queryString: t,
                                            requestData: {
                                                fromAccount: '',
                                                timeStamp: 0,
                                                startIndex: 0,
                                                getCount: 100,
                                                lastStandardSequence: 0,
                                                tagList: ['Tag_Profile_IM_Nick', 'Tag_SNS_IM_Remark']
                                            },
                                            keyMaps: {
                                                request: {},
                                                response: {}
                                            }
                                        },
                                        delete: {
                                            serverName: n,
                                            cmd: Vr.CMD.FRIEND_DELETE,
                                            channel: r,
                                            protocol: o,
                                            method: 'POST',
                                            queryString: t,
                                            requestData: {
                                                fromAccount: '',
                                                toAccount: [],
                                                deleteType: 'Delete_Type_Single'
                                            }
                                        }
                                    };
                                })(this.tim);
                                this.config.blacklist = (function (e) {
                                    var t = Pu(e);
                                    return {
                                        create: {
                                            serverName: Vr.NAME.FRIEND,
                                            cmd: Vr.CMD.ADD_BLACKLIST,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            method: 'POST',
                                            queryString: t,
                                            requestData: {
                                                fromAccount: '',
                                                toAccount: []
                                            }
                                        },
                                        get: {
                                            serverName: Vr.NAME.FRIEND,
                                            cmd: Vr.CMD.GET_BLACKLIST,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            method: 'POST',
                                            queryString: t,
                                            requestData: {
                                                fromAccount: '',
                                                startIndex: 0,
                                                maxLimited: 30,
                                                lastSequence: 0
                                            }
                                        },
                                        delete: {
                                            serverName: Vr.NAME.FRIEND,
                                            cmd: Vr.CMD.DELETE_BLACKLIST,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            method: 'POST',
                                            queryString: t,
                                            requestData: {
                                                fromAccount: '',
                                                toAccount: []
                                            }
                                        },
                                        update: {}
                                    };
                                })(this.tim);
                                this.config.c2cMessage = (function (e) {
                                    var t = {
                                        platform: Fr,
                                        websdkappid: xr,
                                        v: qr,
                                        a2: null !== e.context ? e.context.a2Key : '',
                                        tinyid: null !== e.context ? e.context.tinyID : 0,
                                        sdkappid: null !== e.context ? e.context.SDKAppID : 0,
                                        contentType: null !== e.context ? e.context.contentType : 0,
                                        apn: null !== e.context ? e.context.apn : 1,
                                        reqtime: function () {
                                            return +new Date();
                                        }
                                    };
                                    var n = {
                                        request: {
                                            fromAccount: 'From_Account',
                                            toAccount: 'To_Account',
                                            msgTimeStamp: 'MsgTimeStamp',
                                            msgSeq: 'MsgSeq',
                                            msgRandom: 'MsgRandom',
                                            msgBody: 'MsgBody',
                                            count: 'MaxCnt',
                                            lastMessageTime: 'LastMsgTime',
                                            messageKey: 'MsgKey',
                                            peerAccount: 'Peer_Account',
                                            data: 'Data',
                                            description: 'Desc',
                                            extension: 'Ext',
                                            type: 'MsgType',
                                            content: 'MsgContent',
                                            sizeType: 'Type',
                                            uuid: 'UUID',
                                            imageUrl: 'URL',
                                            fileUrl: 'Url',
                                            remoteAudioUrl: 'Url',
                                            remoteVideoUrl: 'VideoUrl',
                                            thumbUUID: 'ThumbUUID',
                                            videoUUID: 'VideoUUID',
                                            videoUrl: '',
                                            downloadFlag: 'Download_Flag'
                                        },
                                        response: {
                                            MsgContent: 'content',
                                            MsgTime: 'time',
                                            Data: 'data',
                                            Desc: 'description',
                                            Ext: 'extension',
                                            MsgKey: 'messageKey',
                                            MsgType: 'type',
                                            MsgBody: 'elements',
                                            Download_Flag: 'downloadFlag',
                                            ThumbUUID: 'thumbUUID',
                                            VideoUUID: 'videoUUID'
                                        }
                                    };
                                    return {
                                        create: {
                                            serverName: Vr.NAME.OPEN_IM,
                                            cmd: Vr.CMD.SEND_MESSAGE,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            method: 'POST',
                                            queryString: t,
                                            requestData: {
                                                fromAccount: e.loginInfo.identifier,
                                                toAccount: '',
                                                msgTimeStamp: Math.ceil(+new Date() / 1000),
                                                msgSeq: 0,
                                                msgRandom: 0,
                                                msgBody: []
                                            },
                                            keyMaps: n
                                        },
                                        query: {
                                            serverName: Vr.NAME.OPEN_IM,
                                            cmd: Vr.CMD.GET_C2C_ROAM_MESSAGES,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            method: 'POST',
                                            queryString: t,
                                            requestData: {
                                                peerAccount: '',
                                                count: 15,
                                                lastMessageTime: 0,
                                                messageKey: '',
                                                withRecalledMsg: 1
                                            },
                                            keyMaps: n
                                        },
                                        update: null,
                                        delete: null
                                    };
                                })(this.tim);
                                this.config.c2cMessageWillBeRevoked = (function (e) {
                                    var t = {
                                        platform: Fr,
                                        websdkappid: xr,
                                        v: qr,
                                        a2: null !== e.context ? e.context.a2Key : '',
                                        tinyid: null !== e.context ? e.context.tinyID : 0,
                                        sdkappid: null !== e.context ? e.context.SDKAppID : 0,
                                        contentType: null !== e.context ? e.context.contentType : 0,
                                        apn: null !== e.context ? e.context.apn : 1,
                                        reqtime: function () {
                                            return +new Date();
                                        }
                                    };
                                    return {
                                        create: {
                                            serverName: Vr.NAME.OPEN_IM,
                                            cmd: Vr.CMD.REVOKE_C2C_MESSAGE,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            method: 'POST',
                                            queryString: t,
                                            requestData: {
                                                msgInfo: {
                                                    fromAccount: '',
                                                    toAccount: '',
                                                    msgTimeStamp: Math.ceil(+new Date() / 1000),
                                                    msgSeq: 0,
                                                    msgRandom: 0
                                                }
                                            },
                                            keyMaps: {
                                                request: {
                                                    msgInfo: 'MsgInfo',
                                                    fromAccount: 'From_Account',
                                                    toAccount: 'To_Account',
                                                    msgTimeStamp: 'MsgTimeStamp',
                                                    msgSeq: 'MsgSeq',
                                                    msgRandom: 'MsgRandom',
                                                    msgBody: 'MsgBody'
                                                }
                                            }
                                        }
                                    };
                                })(this.tim);
                                this.config.groupMessage = (function (e) {
                                    var t = {
                                        platform: Fr,
                                        websdkappid: xr,
                                        v: qr,
                                        a2: null !== e.context ? e.context.a2Key : '',
                                        tinyid: null !== e.context ? e.context.tinyID : 0,
                                        sdkappid: null !== e.context ? e.context.SDKAppID : 0,
                                        contentType: null !== e.context ? e.context.contentType : 0,
                                        apn: null !== e.context ? e.context.apn : 1,
                                        reqtime: function () {
                                            return +new Date();
                                        }
                                    };
                                    var n = {
                                        request: {
                                            to: 'GroupId',
                                            extension: 'Ext',
                                            data: 'Data',
                                            description: 'Desc',
                                            random: 'Random',
                                            sequence: 'ReqMsgSeq',
                                            count: 'ReqMsgNumber',
                                            type: 'MsgType',
                                            priority: 'MsgPriority',
                                            content: 'MsgContent',
                                            elements: 'MsgBody',
                                            sizeType: 'Type',
                                            uuid: 'UUID',
                                            imageUrl: 'URL',
                                            fileUrl: 'Url',
                                            remoteAudioUrl: 'Url',
                                            remoteVideoUrl: 'VideoUrl',
                                            thumbUUID: 'ThumbUUID',
                                            videoUUID: 'VideoUUID',
                                            videoUrl: '',
                                            downloadFlag: 'Download_Flag',
                                            clientSequence: 'ClientSeq'
                                        },
                                        response: {
                                            Random: 'random',
                                            MsgTime: 'time',
                                            MsgSeq: 'sequence',
                                            ReqMsgSeq: 'sequence',
                                            RspMsgList: 'messageList',
                                            IsPlaceMsg: 'isPlaceMessage',
                                            IsSystemMsg: 'isSystemMessage',
                                            ToGroupId: 'to',
                                            EnumFrom_AccountType: 'fromAccountType',
                                            EnumTo_AccountType: 'toAccountType',
                                            GroupCode: 'groupCode',
                                            MsgPriority: 'priority',
                                            MsgBody: 'elements',
                                            MsgType: 'type',
                                            MsgContent: 'content',
                                            IsFinished: 'complete',
                                            Download_Flag: 'downloadFlag',
                                            ClientSeq: 'clientSequence',
                                            ThumbUUID: 'thumbUUID',
                                            VideoUUID: 'videoUUID'
                                        }
                                    };
                                    return {
                                        create: {
                                            serverName: Vr.NAME.GROUP,
                                            cmd: Vr.CMD.SEND_GROUP_MESSAGE,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            method: 'POST',
                                            queryString: t,
                                            requestData: {
                                                groupID: '',
                                                fromAccount: e.loginInfo.identifier,
                                                random: 0,
                                                clientSequence: 0,
                                                priority: '',
                                                msgBody: []
                                            },
                                            keyMaps: n
                                        },
                                        query: {
                                            serverName: Vr.NAME.GROUP,
                                            cmd: Vr.CMD.GET_GROUP_ROAM_MESSAGES,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            method: 'POST',
                                            queryString: t,
                                            requestData: {
                                                withRecalledMsg: 1,
                                                groupID: '',
                                                count: 15,
                                                sequence: ''
                                            },
                                            keyMaps: n
                                        },
                                        update: null,
                                        delete: null
                                    };
                                })(this.tim);
                                this.config.groupMessageWillBeRevoked = (function (e) {
                                    var t = {
                                        platform: Fr,
                                        websdkappid: xr,
                                        v: qr,
                                        a2: null !== e.context ? e.context.a2Key : '',
                                        tinyid: null !== e.context ? e.context.tinyID : 0,
                                        sdkappid: null !== e.context ? e.context.SDKAppID : 0,
                                        contentType: null !== e.context ? e.context.contentType : 0,
                                        apn: null !== e.context ? e.context.apn : 1,
                                        reqtime: function () {
                                            return +new Date();
                                        }
                                    };
                                    return {
                                        create: {
                                            serverName: Vr.NAME.GROUP,
                                            cmd: Vr.CMD.REVOKE_GROUP_MESSAGE,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            method: 'POST',
                                            queryString: t,
                                            requestData: {
                                                to: '',
                                                msgSeqList: []
                                            },
                                            keyMaps: {
                                                request: {
                                                    to: 'GroupId',
                                                    msgSeqList: 'MsgSeqList',
                                                    msgSeq: 'MsgSeq'
                                                }
                                            }
                                        }
                                    };
                                })(this.tim);
                                this.config.conversation = (function (e) {
                                    var t = {
                                        platform: Fr,
                                        websdkappid: xr,
                                        v: qr,
                                        a2: null !== e.context ? e.context.a2Key : '',
                                        tinyid: null !== e.context ? e.context.tinyID : 0,
                                        sdkappid: null !== e.context ? e.context.SDKAppID : 0,
                                        contentType: null !== e.context ? e.context.contentType : 0,
                                        apn: null !== e.context ? e.context.apn : 1
                                    };
                                    return {
                                        query: {
                                            serverName: Vr.NAME.RECENT_CONTACT,
                                            cmd: Vr.CMD.GET_CONVERSATION_LIST,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            method: 'POST',
                                            queryString: t,
                                            requestData: {
                                                fromAccount: e.loginInfo.identifier,
                                                count: 0
                                            },
                                            keyMaps: {
                                                request: {},
                                                response: {
                                                    SessionItem: 'conversations',
                                                    ToAccount: 'groupID',
                                                    To_Account: 'userID',
                                                    UnreadMsgCount: 'unreadCount',
                                                    MsgGroupReadedSeq: 'messageReadSeq'
                                                }
                                            }
                                        },
                                        pagingQuery: {
                                            serverName: Vr.NAME.RECENT_CONTACT,
                                            cmd: Vr.CMD.PAGING_GET_CONVERSATION_LIST,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            method: 'POST',
                                            queryString: t,
                                            requestData: {
                                                fromAccount: void 0,
                                                timeStamp: void 0,
                                                orderType: void 0
                                            },
                                            keyMaps: {
                                                request: {},
                                                response: {
                                                    SessionItem: 'conversations',
                                                    ToAccount: 'groupID',
                                                    To_Account: 'userID',
                                                    UnreadMsgCount: 'unreadCount',
                                                    MsgGroupReadedSeq: 'messageReadSeq'
                                                }
                                            }
                                        },
                                        delete: {
                                            serverName: Vr.NAME.RECENT_CONTACT,
                                            cmd: Vr.CMD.DELETE_CONVERSATION,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            method: 'POST',
                                            queryString: t,
                                            requestData: {
                                                fromAccount: e.loginInfo.identifier,
                                                toAccount: void 0,
                                                type: 1,
                                                toGroupID: void 0
                                            },
                                            keyMaps: {
                                                request: {
                                                    toGroupID: 'ToGroupid'
                                                }
                                            }
                                        },
                                        setC2CMessageRead: {
                                            serverName: Vr.NAME.OPEN_IM,
                                            cmd: Vr.CMD.SET_C2C_MESSAGE_READ,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            method: 'POST',
                                            queryString: t,
                                            requestData: {
                                                C2CMsgReaded: void 0
                                            },
                                            keyMaps: {
                                                request: {
                                                    lastMessageTime: 'LastedMsgTime'
                                                }
                                            }
                                        },
                                        setGroupMessageRead: {
                                            serverName: Vr.NAME.GROUP,
                                            cmd: Vr.CMD.SET_GROUP_MESSAGE_READ,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            method: 'POST',
                                            queryString: t,
                                            requestData: {
                                                groupID: void 0,
                                                messageReadSeq: void 0
                                            },
                                            keyMaps: {
                                                request: {
                                                    messageReadSeq: 'MsgReadedSeq'
                                                }
                                            }
                                        }
                                    };
                                })(this.tim);
                                this.config.syncMessage = (function (e) {
                                    var t = {
                                        platform: Fr,
                                        websdkappid: xr,
                                        v: qr,
                                        a2: null !== e.context ? e.context.a2Key : '',
                                        tinyid: null !== e.context ? e.context.tinyID : 0,
                                        sdkappid: null !== e.context ? e.context.SDKAppID : 0,
                                        contentType: null !== e.context ? e.context.contentType : 0,
                                        apn: null !== e.context ? e.context.apn : 1,
                                        reqtime: function () {
                                            return [Math.ceil(+new Date()), Math.random()].join('');
                                        }
                                    };
                                    return {
                                        create: null,
                                        query: {
                                            serverName: Vr.NAME.OPEN_IM,
                                            cmd: Vr.CMD.GET_MESSAGES,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            method: 'POST',
                                            queryString: t,
                                            requestData: {
                                                cookie: '',
                                                syncFlag: 0,
                                                needAbstract: 1
                                            },
                                            keyMaps: {
                                                request: {
                                                    fromAccount: 'From_Account',
                                                    toAccount: 'To_Account',
                                                    from: 'From_Account',
                                                    to: 'To_Account',
                                                    time: 'MsgTimeStamp',
                                                    sequence: 'MsgSeq',
                                                    random: 'MsgRandom',
                                                    elements: 'MsgBody'
                                                },
                                                response: {
                                                    MsgList: 'messageList',
                                                    SyncFlag: 'syncFlag',
                                                    To_Account: 'to',
                                                    From_Account: 'from',
                                                    ClientSeq: 'clientSequence',
                                                    MsgSeq: 'sequence',
                                                    NoticeSeq: 'noticeSequence',
                                                    NotifySeq: 'notifySequence',
                                                    MsgRandom: 'random',
                                                    MsgTimeStamp: 'time',
                                                    MsgContent: 'content',
                                                    ToGroupId: 'groupID',
                                                    MsgKey: 'messageKey',
                                                    GroupTips: 'groupTips',
                                                    MsgBody: 'elements',
                                                    MsgType: 'type',
                                                    C2CRemainingUnreadCount: 'C2CRemainingUnreadList'
                                                }
                                            }
                                        },
                                        update: null,
                                        delete: null
                                    };
                                })(this.tim);
                                this.config.AVChatRoom = (function (e) {
                                    return {
                                        startLongPoll: {
                                            serverName: Vr.NAME.BIG_GROUP_LONG_POLLING_NO_AUTH,
                                            cmd: Vr.CMD.AVCHATROOM_LONG_POLL,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            method: 'POST',
                                            queryString: {
                                                websdkappid: xr,
                                                v: qr,
                                                platform: Fr,
                                                sdkappid: e.loginInfo.SDKAppID,
                                                accounttype: '792',
                                                apn: null !== e.context ? e.context.apn : 1,
                                                reqtime: function () {
                                                    return +new Date();
                                                }
                                            },
                                            requestData: {
                                                USP: 1,
                                                startSeq: 1,
                                                holdTime: 90,
                                                key: void 0
                                            },
                                            keyMaps: {
                                                request: {
                                                    USP: 'USP'
                                                },
                                                response: {
                                                    ToGroupId: 'groupID',
                                                    MsgPriority: 'priority'
                                                }
                                            }
                                        }
                                    };
                                })(this.tim);
                                this.config.cosUpload = (function (e) {
                                    var t = {
                                        platform: Fr,
                                        websdkappid: xr,
                                        v: qr,
                                        a2: null !== e.context ? e.context.a2Key : '',
                                        tinyid: null !== e.context ? e.context.tinyID : 0,
                                        sdkappid: null !== e.context ? e.context.SDKAppID : 0,
                                        contentType: null !== e.context ? e.context.contentType : 0,
                                        apn: null !== e.context ? e.context.apn : 1,
                                        reqtime: function () {
                                            return Date.now();
                                        }
                                    };
                                    return {
                                        create: {
                                            serverName: Vr.NAME.OPEN_IM,
                                            cmd: Vr.CMD.FILE_UPLOAD,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            method: 'POST',
                                            queryString: t,
                                            requestData: {
                                                appVersion: '2.1',
                                                fromAccount: '',
                                                toAccount: '',
                                                sequence: 0,
                                                time: function () {
                                                    return Math.ceil(Date.now() / 1000);
                                                },
                                                random: function () {
                                                    return me();
                                                },
                                                fileStrMd5: '',
                                                fileSize: '',
                                                serverVer: 1,
                                                authKey: '',
                                                busiId: 1,
                                                pkgFlag: 1,
                                                sliceOffset: 0,
                                                sliceSize: 0,
                                                sliceData: '',
                                                contentType: 'application/x-www-form-urlencoded'
                                            },
                                            keyMaps: {
                                                request: {},
                                                response: {}
                                            }
                                        },
                                        update: null,
                                        delete: null
                                    };
                                })(this.tim);
                                this.config.cosSig = (function (e) {
                                    var t = {
                                        sdkappid: function () {
                                            return e.loginInfo.SDKAppID;
                                        },
                                        identifier: function () {
                                            return e.loginInfo.identifier;
                                        },
                                        userSig: function () {
                                            return e.context.userSig;
                                        }
                                    };
                                    return {
                                        create: null,
                                        query: {
                                            serverName: Vr.NAME.IM_COS_SIGN,
                                            cmd: Vr.CMD.COS_SIGN,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            method: 'POST',
                                            queryString: t,
                                            requestData: {
                                                cmd: 'open_im_cos_svc',
                                                subCmd: 'get_cos_token',
                                                duration: 300,
                                                version: 2
                                            },
                                            keyMaps: {
                                                request: {
                                                    userSig: 'usersig',
                                                    subCmd: 'sub_cmd',
                                                    cmd: 'cmd',
                                                    duration: 'duration',
                                                    version: 'version'
                                                },
                                                response: {
                                                    expired_time: 'expiredTime',
                                                    bucket_name: 'bucketName',
                                                    session_token: 'sessionToken',
                                                    tmp_secret_id: 'secretId',
                                                    tmp_secret_key: 'secretKey'
                                                }
                                            }
                                        },
                                        update: null,
                                        delete: null
                                    };
                                })(this.tim);
                                this.config.bigDataHallwayAuthKey = (function (e) {
                                    return {
                                        create: null,
                                        query: {
                                            serverName: Vr.NAME.OPEN_IM,
                                            cmd: Vr.CMD.BIG_DATA_HALLWAY_AUTH_KEY,
                                            channel: Vr.CHANNEL.XHR,
                                            protocol: Br,
                                            method: 'POST',
                                            queryString: {
                                                websdkappid: xr,
                                                v: qr,
                                                platform: Fr,
                                                sdkappid: e.loginInfo.SDKAppID,
                                                accounttype: '792',
                                                apn: null !== e.context ? e.context.apn : 1,
                                                reqtime: function () {
                                                    return +new Date();
                                                }
                                            },
                                            requestData: {}
                                        }
                                    };
                                })(this.tim);
                                this.config.ssoEventStat = (function (e) {
                                    var t = {
                                        sdkappid: e.loginInfo.SDKAppID,
                                        reqtime: Math.ceil(+new Date() / 1000)
                                    };
                                    return {
                                        create: {
                                            serverName: Vr.NAME.IM_OPEN_STAT,
                                            cmd: Vr.CMD.TIM_WEB_REPORT,
                                            channel: Vr.CHANNEL.AUTO,
                                            protocol: Br,
                                            queryString: t,
                                            requestData: {
                                                table: '',
                                                report: []
                                            },
                                            keyMaps: {
                                                request: {
                                                    table: 'table',
                                                    report: 'report',
                                                    SDKAppID: 'sdkappid',
                                                    version: 'version',
                                                    tinyID: 'tinyid',
                                                    userID: 'userid',
                                                    platform: 'platform',
                                                    method: 'method',
                                                    time: 'time',
                                                    start: 'start',
                                                    end: 'end',
                                                    cost: 'cost',
                                                    status: 'status',
                                                    codeint: 'codeint',
                                                    message: 'message',
                                                    pointer: 'pointer',
                                                    text: 'text',
                                                    msgType: 'msgtype',
                                                    networkType: 'networktype',
                                                    startts: 'startts',
                                                    endts: 'endts',
                                                    timespan: 'timespan'
                                                }
                                            }
                                        },
                                        query: {},
                                        update: {},
                                        delete: {}
                                    };
                                })(this.tim);
                                this.config.ssoSumStat = (function (e) {
                                    var t = null;
                                    if (null !== e.context) {
                                        t = {
                                            sdkappid: e.context.SDKAppID,
                                            reqtime: Math.ceil(+new Date() / 1000)
                                        };
                                    }
                                    return {
                                        create: {
                                            serverName: Vr.NAME.IM_OPEN_STAT,
                                            cmd: Vr.CMD.TIM_WEB_REPORT,
                                            channel: Vr.CHANNEL.AUTO,
                                            protocol: Br,
                                            queryString: t,
                                            requestData: {
                                                table: '',
                                                report: []
                                            },
                                            keyMaps: {
                                                request: {
                                                    table: 'table',
                                                    report: 'report',
                                                    SDKAppID: 'sdkappid',
                                                    version: 'version',
                                                    tinyID: 'tinyid',
                                                    userID: 'userid',
                                                    item: 'item',
                                                    lpID: 'lpid',
                                                    platform: 'platform',
                                                    networkType: 'networktype',
                                                    total: 'total',
                                                    successRate: 'successrate',
                                                    avg: 'avg',
                                                    timespan: 'timespan',
                                                    time: 'time'
                                                }
                                            }
                                        },
                                        query: {},
                                        update: {},
                                        delete: {}
                                    };
                                })(this.tim);
                            }
                        },
                        {
                            key: '_initRequestData',
                            value: function (e, t) {
                                if (void 0 === e) {
                                    return qo(t.requestData, this._getRequestMap(t), this.tim);
                                }
                                var n = t.requestData;
                                var r = Object.create(null);
                                for (var o in n) {
                                    if (Object.prototype.hasOwnProperty.call(n, o)) {
                                        r[o] = 'function' == typeof n[o] ? n[o]() : n[o];
                                        if (void 0 === e[o]) {
                                            continue;
                                        }
                                        r[o] = e[o];
                                    }
                                }
                                return (r = qo(r, this._getRequestMap(t), this.tim));
                            }
                        },
                        {
                            key: '_getRequestMap',
                            value: function (e) {
                                if (e.keyMaps && e.keyMaps.request && Object.keys(e.keyMaps.request).length > 0) {
                                    return e.keyMaps.request;
                                }
                            }
                        },
                        {
                            key: '_initEncoder',
                            value: function (e) {
                                switch (e.protocol) {
                                    case Br:
                                        return function (e) {
                                            if ('string' === n(e)) {
                                                try {
                                                    return JSON.parse(e);
                                                } catch (t) {
                                                    console.log('CatchClause', t);
                                                    console.log('CatchClause', t);
                                                    return e;
                                                }
                                            }
                                            return e;
                                        };
                                    case Hr:
                                        return function (e) {
                                            return e;
                                        };
                                    default:
                                        return function (e) {
                                            J.warn('PackageConfig._initEncoder(), unknow response type, data: ', JSON.stringify(e));
                                            return e;
                                        };
                                }
                            }
                        },
                        {
                            key: '_initDecoder',
                            value: function (e) {
                                switch (e.protocol) {
                                    case Br:
                                        return function (e) {
                                            if ('string' === n(e)) {
                                                try {
                                                    return JSON.parse(e);
                                                } catch (t) {
                                                    console.log('CatchClause', t);
                                                    console.log('CatchClause', t);
                                                    return e;
                                                }
                                            }
                                            return e;
                                        };
                                    case Hr:
                                        return function (e) {
                                            return e;
                                        };
                                    default:
                                        return function (e) {
                                            J.warn('PackageConfig._initDecoder(), unknow response type, data: ', e);
                                            return e;
                                        };
                                }
                            }
                        }
                    ]);
                    return e;
                })();
                var Uu = function () {
                    for (var e = [], t = qu(arguments), n = 0; n < arguments.length; n++) {
                        Number.isInteger(arguments[n]) ? e.push(arguments[n]) : e.push(true == !!arguments[n] ? '1' : '0');
                    }
                    return e.join(t);
                };
                var qu = function (e) {
                    var t = e.length;
                    var n = e[t - 1];
                    if ('string' != typeof n) {
                        return '';
                    }
                    if (n.length > 1) {
                        return '';
                    }
                    var r = e[t - 1];
                    delete e[t - 1];
                    e.length -= t === e.length ? 1 : 0;
                    return r;
                };
                var xu = {
                    C2CMessageArray: 1,
                    groupMessageArray: 1,
                    groupTips: 1,
                    C2CNotifyMessageArray: 1,
                    profileModify: 1,
                    friendListMod: 1
                };
                var Fu = (function (e) {
                    l(n, e);
                    var t = y(n);
                    function n(e) {
                        var o;
                        r(this, n);
                        (o = t.call(this, e))._initialization();
                        return o;
                    }
                    i(n, [
                        {
                            key: '_initialization',
                            value: function () {
                                this._syncOffset = '';
                                this._syncNoticeList = [];
                                this._syncEventArray = [];
                                this._syncMessagesIsRunning = false;
                                this._syncMessagesFinished = false;
                                this._isLongPoll = false;
                                this._longPollID = 0;
                                this._noticeSequence = 0;
                                this._initializeListener();
                                this._runLoop = null;
                                this._initShuntChannels();
                            }
                        },
                        {
                            key: '_initShuntChannels',
                            value: function () {
                                this._shuntChannels = Object.create(null);
                                this._shuntChannels.C2CMessageArray = this._C2CMessageArrayChannel.bind(this);
                                this._shuntChannels.groupMessageArray = this._groupMessageArrayChannel.bind(this);
                                this._shuntChannels.groupTips = this._groupTipsChannel.bind(this);
                                this._shuntChannels.C2CNotifyMessageArray = this._C2CNotifyMessageArrayChannel.bind(this);
                                this._shuntChannels.profileModify = this._profileModifyChannel.bind(this);
                                this._shuntChannels.friendListMod = this._friendListModChannel.bind(this);
                            }
                        },
                        {
                            key: '_C2CMessageArrayChannel',
                            value: function (e, t, n) {
                                this.emitInnerEvent(po, t);
                            }
                        },
                        {
                            key: '_groupMessageArrayChannel',
                            value: function (e, t, n) {
                                this.emitInnerEvent(ho, t);
                            }
                        },
                        {
                            key: '_groupTipsChannel',
                            value: function (e, t, n) {
                                var that = this;
                                switch (e) {
                                    case 4:
                                    case 6:
                                        this.emitInnerEvent(fo, t);
                                        break;
                                    case 5:
                                        t.forEach(function (e) {
                                            re(e.elements.revokedInfos)
                                                ? that.emitInnerEvent(_o, t)
                                                : that.emitInnerEvent(go, {
                                                      groupSystemNotices: t,
                                                      type: n
                                                  });
                                        });
                                        break;
                                    default:
                                        J.log('NotificationController._groupTipsChannel unknown event='.concat(e, ' type=').concat(n), t);
                                }
                            }
                        },
                        {
                            key: '_C2CNotifyMessageArrayChannel',
                            value: function (e, t, n) {
                                this._isKickedoutNotice(t)
                                    ? this.emitInnerEvent(co)
                                    : this._isSysCmdMsgNotify(t)
                                    ? this.emitInnerEvent(vo)
                                    : this._isC2CMessageRevokedNotify(t) && this.emitInnerEvent(Co, t);
                            }
                        },
                        {
                            key: '_profileModifyChannel',
                            value: function (e, t, n) {
                                this.emitInnerEvent(yo, t);
                            }
                        },
                        {
                            key: '_friendListModChannel',
                            value: function (e, t, n) {
                                this.emitInnerEvent(mo, t);
                            }
                        },
                        {
                            key: '_dispatchNotice',
                            value: function (e) {
                                var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 'poll';
                                if (re(e)) {
                                    for (var n = null, r = null, o = '', i = '', s = '', a = 0, u = 0, l = e.length; u < l; u++) {
                                        a = (n = e[u]).event;
                                        o = Object.keys(n).find(function (e) {
                                            return void 0 !== xu[e];
                                        });
                                        se(this._shuntChannels[o])
                                            ? ((r = n[o]), 'poll' === t && this._updatenoticeSequence(r), this._shuntChannels[o](a, r, t))
                                            : ('poll' === t && this._updatenoticeSequence(),
                                              (i = ''.concat(gn)),
                                              (s = ''.concat(Sr, ': ').concat(a, ', ').concat(o)),
                                              this.emitInnerEvent(
                                                  Ao,
                                                  new pt({
                                                      code: i,
                                                      message: s,
                                                      data: {
                                                          payloadName: o,
                                                          event: a
                                                      }
                                                  })
                                              ),
                                              (i = ''),
                                              (s = ''));
                                    }
                                }
                            }
                        },
                        {
                            key: 'getLongPollID',
                            value: function () {
                                return this._longPollID;
                            }
                        },
                        {
                            key: '_IAmReady',
                            value: function () {
                                this.triggerReady();
                            }
                        },
                        {
                            key: 'reset',
                            value: function () {
                                this._noticeSequence = 0;
                                this._resetSync();
                                this.closeNoticeChannel();
                            }
                        },
                        {
                            key: '_resetSync',
                            value: function () {
                                this._syncOffset = '';
                                this._syncNoticeList = [];
                                this._syncEventArray = [];
                                this._syncMessagesIsRunning = false;
                                this._syncMessagesFinished = false;
                            }
                        },
                        {
                            key: '_setNoticeSeqInRequestData',
                            value: function (e) {
                                e.Cookie.NoticeSeq = this._noticeSequence;
                                this.tim.sumStatController.addTotalCount(Qo);
                            }
                        },
                        {
                            key: '_updatenoticeSequence',
                            value: function (e) {
                                if (e) {
                                    var t = e[e.length - 1].noticeSequence;
                                    t && 'number' == typeof t ? t <= this._noticeSequence || (this._noticeSequence = t) : this._noticeSequence++;
                                } else {
                                    this._noticeSequence++;
                                }
                            }
                        },
                        {
                            key: '_initializeListener',
                            value: function () {
                                var e = this.tim.innerEmitter;
                                e.on(Yr, this._startSyncMessages, this);
                                e.on(Eo, this.closeNoticeChannel, this);
                                e.on(ao, this._onFastStart, this);
                            }
                        },
                        {
                            key: 'openNoticeChannel',
                            value: function () {
                                J.log('NotificationController.openNoticeChannel');
                                this._getLongPollID();
                            }
                        },
                        {
                            key: 'closeNoticeChannel',
                            value: function () {
                                J.log('NotificationController.closeNoticeChannel');
                                if (this._runLoop instanceof eu || this._runLoop instanceof tu) {
                                    this._runLoop.abort();
                                    this._runLoop.stop();
                                }
                                this._longPollID = 0;
                                this._isLongPoll = false;
                            }
                        },
                        {
                            key: '_getLongPollID',
                            value: function () {
                                var that = this;
                                if (0 === this._longPollID) {
                                    var t = new oi();
                                    t.setMethod(Ni).setStart();
                                    this.request({
                                        name: 'longPollID',
                                        action: 'query'
                                    })
                                        .then(function (n) {
                                            var r = n.data.longPollingID;
                                            that._onGetLongPollIDSuccess(r);
                                            t.setCode(0).setText('longPollingID='.concat(r)).setNetworkType(that.getNetworkType()).setEnd();
                                        })
                                        .catch(function (n) {
                                            var r = new pt({
                                                code: n.code || vn,
                                                message: n.message || Tr
                                            });
                                            that.emitInnerEvent(oo);
                                            that.emitInnerEvent(Ao, r);
                                            that.probeNetwork().then(function (e) {
                                                var n = v(e, 2);
                                                var o = n[0];
                                                var i = n[1];
                                                t.setError(r, o, i).setEnd();
                                            });
                                        });
                                } else {
                                    this._onGetLongPollIDSuccess(this._longPollID);
                                }
                            }
                        },
                        {
                            key: '_onGetLongPollIDSuccess',
                            value: function (e) {
                                this.emitInnerEvent(zr, [
                                    {
                                        key: 'long_poll_logout.query.requestData.longPollingID',
                                        value: e
                                    },
                                    {
                                        key: 'longPoll.query.requestData.cookie.longPollingID',
                                        value: e
                                    }
                                ]);
                                this._longPollID = e;
                                this._startLongPoll();
                                this._IAmReady();
                                this.tim.sumStatController.recordLongPollingID(this._longPollID);
                            }
                        },
                        {
                            key: '_startLongPoll',
                            value: function () {
                                if (true !== this._isLongPoll) {
                                    J.log('NotificationController._startLongPoll...');
                                    var e = this.tim.connectionController;
                                    var t = this.createTransportCapsule({
                                        name: 'longPoll',
                                        action: 'query'
                                    });
                                    this._isLongPoll = true;
                                    this._runLoop = e.createRunLoop({
                                        pack: t,
                                        before: this._setNoticeSeqInRequestData.bind(this),
                                        success: this._onNoticeReceived.bind(this),
                                        fail: this._onNoticeFail.bind(this)
                                    });
                                    this._runLoop.start();
                                } else {
                                    J.log('NotificationController._startLongPoll is running...');
                                }
                            }
                        },
                        {
                            key: '_onFastStart',
                            value: function () {
                                this.closeNoticeChannel();
                                this.syncMessage();
                            }
                        },
                        {
                            key: '_onNoticeReceived',
                            value: function (e) {
                                var t = e.data;
                                if (t.errorCode !== Ne.SUCCESS) {
                                    var n = new oi();
                                    n.setMethod(bi).setStart();
                                    n.setMessage(t.errorInfo).setCode(t.errorCode).setNetworkType(this.getNetworkType()).setEnd();
                                    this._onResponseError(t);
                                } else {
                                    this.emitInnerEvent(so);
                                }
                                this.tim.sumStatController.addSuccessCount(Qo);
                                this.tim.sumStatController.addCost(Qo, t.timecost);
                                if (e.data.eventArray) {
                                    this._dispatchNotice(e.data.eventArray);
                                }
                            }
                        },
                        {
                            key: '_onResponseError',
                            value: function (e) {
                                switch (e.errorCode) {
                                    case Cn:
                                        J.warn('NotificationController._onResponseError, longPollingID='.concat(this._longPollID, ' was kicked out'));
                                        this.emitInnerEvent(lo);
                                        this.closeNoticeChannel();
                                        break;
                                    case Mn:
                                    case In:
                                        this.emitInnerEvent(ko);
                                        break;
                                    default:
                                        this.emitInnerEvent(
                                            Ao,
                                            new pt({
                                                code: e.errorCode,
                                                message: e.errorInfo
                                            })
                                        );
                                }
                            }
                        },
                        {
                            key: '_onNoticeFail',
                            value: function (e) {
                                if (e.error) {
                                    if ('ECONNABORTED' === e.error.code || e.error.code === ln) {
                                        if (e.error.config) {
                                            var t = e.error.config.url;
                                            var n = e.error.config.data;
                                            J.log('NotificationController._onNoticeFail request timed out. url='.concat(t, ' data=').concat(n));
                                        } else {
                                            J.log('NotificationController._onNoticeFail request timed out.');
                                        }
                                    } else {
                                        J.log('NotificationController._onNoticeFail request failed due to network error');
                                    }
                                }
                                this.emitInnerEvent(io);
                            }
                        },
                        {
                            key: '_isKickedoutNotice',
                            value: function (e) {
                                return !!e[0].hasOwnProperty('kickoutMsgNotify');
                            }
                        },
                        {
                            key: '_isSysCmdMsgNotify',
                            value: function (e) {
                                if (!e[0]) {
                                    return false;
                                }
                                var t = e[0];
                                return !!Object.prototype.hasOwnProperty.call(t, 'sysCmdMsgNotify');
                            }
                        },
                        {
                            key: '_isC2CMessageRevokedNotify',
                            value: function (e) {
                                var t = e[0];
                                return !!Object.prototype.hasOwnProperty.call(t, 'c2cMessageRevokedNotify');
                            }
                        },
                        {
                            key: '_startSyncMessages',
                            value: function (e) {
                                if (true !== this._syncMessagesFinished) {
                                    this.syncMessage();
                                }
                            }
                        },
                        {
                            key: 'syncMessage',
                            value: function () {
                                var that = this;
                                var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : '';
                                var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0;
                                this._syncMessagesIsRunning = true;
                                this.request({
                                    name: 'syncMessage',
                                    action: 'query',
                                    param: {
                                        cookie: t,
                                        syncFlag: n
                                    }
                                })
                                    .then(function (t) {
                                        var n = t.data;
                                        switch (Uu(n.cookie, n.syncFlag)) {
                                            case '00':
                                            case '01':
                                                that.emitInnerEvent(Ao, {
                                                    code: mn,
                                                    message: Dr
                                                });
                                                break;
                                            case '10':
                                            case '11':
                                                if (n.eventArray) {
                                                    that._dispatchNotice(n.eventArray, 'sync');
                                                }
                                                that._syncNoticeList = that._syncNoticeList.concat(n.messageList);
                                                that.emitInnerEvent(Wr, {
                                                    data: n.messageList,
                                                    C2CRemainingUnreadList: n.C2CRemainingUnreadList
                                                });
                                                that._syncOffset = n.cookie;
                                                that.syncMessage(n.cookie, n.syncFlag);
                                                break;
                                            case '12':
                                                if (n.eventArray) {
                                                    that._dispatchNotice(n.eventArray, 'sync');
                                                }
                                                that.openNoticeChannel();
                                                that._syncNoticeList = that._syncNoticeList.concat(n.messageList);
                                                that.emitInnerEvent(Xr, {
                                                    messageList: n.messageList,
                                                    C2CRemainingUnreadList: n.C2CRemainingUnreadList
                                                });
                                                that._syncOffset = n.cookie;
                                                that._syncNoticeList = [];
                                                that._syncMessagesIsRunning = false;
                                                that._syncMessagesFinished = true;
                                        }
                                    })
                                    .catch(function (t) {
                                        that._syncMessagesIsRunning = false;
                                        J.error('NotificationController.syncMessage failed. error:'.concat(t));
                                    });
                            }
                        }
                    ]);
                    return n;
                })(Bo);
                var Hu = (function (e) {
                    l(n, e);
                    var t = y(n);
                    function n(e) {
                        var o;
                        r(this, n);
                        (o = t.call(this, e)).COSSDK = null;
                        o._cosUploadMethod = null;
                        o.expiredTimeLimit = 300;
                        o.appid = 0;
                        o.bucketName = '';
                        o.ciUrl = '';
                        o.directory = '';
                        o.downloadUrl = '';
                        o.uploadUrl = '';
                        o.expiredTimeOut = o.expiredTimeLimit;
                        o.region = 'ap-shanghai';
                        o.cos = null;
                        o.cosOptions = {
                            secretId: '',
                            secretKey: '',
                            sessionToken: '',
                            expiredTime: 0
                        };
                        o._timer = 0;
                        o.tim.innerEmitter.on(Yr, o._init, g(o));
                        o.triggerReady();
                        return o;
                    }
                    i(n, [
                        {
                            key: '_expiredTimer',
                            value: function () {
                                var that = this;
                                this._timer = setInterval(function () {
                                    if (Math.ceil(Date.now() / 1000) >= that.cosOptions.expiredTime - 60) {
                                        that._getAuthorizationKey();
                                        clearInterval(that._timer);
                                    }
                                }, 30000);
                            }
                        },
                        {
                            key: '_init',
                            value: function () {
                                var e = O ? 'cos-wx-sdk' : 'cos-js-sdk';
                                this.COSSDK = this.tim.getPlugin(e);
                                this.COSSDK
                                    ? this._getAuthorizationKey()
                                    : J.warn(
                                          'UploadController._init 没有检测到上传插件，将无法发送图片、音频、视频、文件等类型的消息。详细请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#registerPlugin'
                                      );
                            }
                        },
                        {
                            key: '_getAuthorizationKey',
                            value: function () {
                                var that = this;
                                var t = Math.ceil(Date.now() / 1000);
                                var n = new oi();
                                n.setMethod(li).setStart();
                                this.request({
                                    name: 'cosSig',
                                    action: 'query',
                                    param: {
                                        duration: this.expiredTimeLimit
                                    }
                                })
                                    .then(function (r) {
                                        J.log('UploadController._getAuthorizationKey ok. data:', r.data);
                                        var o = r.data;
                                        var i = o.expiredTime - t;
                                        n.setCode(0).setText('timeout='.concat(i, 's')).setNetworkType(that.getNetworkType()).setEnd();
                                        that.appid = o.appid;
                                        that.bucketName = o.bucketName;
                                        that.ciUrl = o.ciUrl;
                                        that.directory = o.directory;
                                        that.downloadUrl = o.downloadUrl;
                                        that.uploadUrl = o.uploadUrl;
                                        that.expiredTimeOut = i;
                                        that.cosOptions = {
                                            secretId: o.secretId,
                                            secretKey: o.secretKey,
                                            sessionToken: o.sessionToken,
                                            expiredTime: o.expiredTime
                                        };
                                        that._initUploaderMethod();
                                        that._expiredTimer();
                                    })
                                    .catch(function (t) {
                                        that.probeNetwork().then(function (n) {
                                            var r = v(n, 2);
                                            var o = r[0];
                                            var i = r[1];
                                            that.setError(t, o, i).setEnd();
                                        });
                                        J.warn('UploadController._getAuthorizationKey failed. error:', t);
                                    });
                            }
                        },
                        {
                            key: '_initUploaderMethod',
                            value: function () {
                                var that = this;
                                if (this.appid) {
                                    this.cos = O
                                        ? new this.COSSDK({
                                              ForcePathStyle: true,
                                              getAuthorization: this._getAuthorization.bind(this)
                                          })
                                        : new this.COSSDK({
                                              getAuthorization: this._getAuthorization.bind(this)
                                          });
                                    this._cosUploadMethod = O
                                        ? function (t, n) {
                                              that.cos.postObject(t, n);
                                          }
                                        : function (t, n) {
                                              that.cos.uploadFiles(t, n);
                                          };
                                }
                            }
                        },
                        {
                            key: '_getAuthorization',
                            value: function (e, t) {
                                t({
                                    TmpSecretId: this.cosOptions.secretId,
                                    TmpSecretKey: this.cosOptions.secretKey,
                                    XCosSecurityToken: this.cosOptions.sessionToken,
                                    ExpiredTime: this.cosOptions.expiredTime
                                });
                            }
                        },
                        {
                            key: 'uploadImage',
                            value: function (e) {
                                if (!e.file) {
                                    return Wo(
                                        new pt({
                                            code: Et,
                                            message: Un
                                        })
                                    );
                                }
                                var t = this._checkImageType(e.file);
                                if (true !== t) {
                                    return t;
                                }
                                var n = this._checkImageMime(e.file);
                                if (true !== n) {
                                    return n;
                                }
                                var r = this._checkImageSize(e.file);
                                return true !== r ? r : this.upload(e);
                            }
                        },
                        {
                            key: '_checkImageType',
                            value: function (e) {
                                var t = '';
                                t = O ? e.url.slice(e.url.lastIndexOf('.') + 1) : e.files[0].name.slice(e.files[0].name.lastIndexOf('.') + 1);
                                return (
                                    kr.indexOf(t.toLowerCase()) >= 0 ||
                                    Wo(
                                        new pt({
                                            coe: kt,
                                            message: qn
                                        })
                                    )
                                );
                            }
                        },
                        {
                            key: '_checkImageMime',
                            value: function (e) {
                                return true;
                            }
                        },
                        {
                            key: '_checkImageSize',
                            value: function (e) {
                                var t = 0;
                                return 0 === (t = O ? e.size : e.files[0].size)
                                    ? Wo(
                                          new pt({
                                              code: St,
                                              message: ''.concat(bn)
                                          })
                                      )
                                    : t < 20971520 ||
                                          Wo(
                                              new pt({
                                                  coe: At,
                                                  message: ''.concat(xn)
                                              })
                                          );
                            }
                        },
                        {
                            key: 'uploadFile',
                            value: function (e) {
                                var t = null;
                                return e.file
                                    ? e.file.files[0].size > 104857600
                                        ? ((t = new pt({
                                              code: Gt,
                                              message: Yn
                                          })),
                                          Wo(t))
                                        : 0 === e.file.files[0].size
                                        ? ((t = new pt({
                                              code: St,
                                              message: ''.concat(bn)
                                          })),
                                          Wo(t))
                                        : this.upload(e)
                                    : ((t = new pt({
                                          code: Pt,
                                          message: $n
                                      })),
                                      Wo(t));
                            }
                        },
                        {
                            key: 'uploadVideo',
                            value: function (e) {
                                return e.file.videoFile.size > 104857600
                                    ? Wo(
                                          new pt({
                                              code: Lt,
                                              message: ''.concat(Vn)
                                          })
                                      )
                                    : 0 === e.file.videoFile.size
                                    ? Wo(
                                          new pt({
                                              code: St,
                                              message: ''.concat(bn)
                                          })
                                      )
                                    : -1 === Ar.indexOf(e.file.videoFile.type)
                                    ? Wo(
                                          new pt({
                                              code: Nt,
                                              message: ''.concat(Kn)
                                          })
                                      )
                                    : O
                                    ? this.handleVideoUpload({
                                          file: e.file.videoFile
                                      })
                                    : R
                                    ? this.handleVideoUpload(e)
                                    : void 0;
                            }
                        },
                        {
                            key: 'handleVideoUpload',
                            value: function (e) {
                                var that = this;
                                return new Promise(function (n, r) {
                                    that.upload(e)
                                        .then(function (e) {
                                            n(e);
                                        })
                                        .catch(function () {
                                            that.upload(e)
                                                .then(function (e) {
                                                    n(e);
                                                })
                                                .catch(function () {
                                                    r(
                                                        new pt({
                                                            code: Ot,
                                                            message: Bn
                                                        })
                                                    );
                                                });
                                        });
                                });
                            }
                        },
                        {
                            key: 'uploadAudio',
                            value: function (e) {
                                return e.file
                                    ? e.file.size > 20971520
                                        ? Wo(
                                              new pt({
                                                  code: Rt,
                                                  message: ''.concat(Hn)
                                              })
                                          )
                                        : 0 === e.file.size
                                        ? Wo(
                                              new pt({
                                                  code: St,
                                                  message: ''.concat(bn)
                                              })
                                          )
                                        : this.upload(e)
                                    : Wo(
                                          new pt({
                                              code: wt,
                                              message: Fn
                                          })
                                      );
                            }
                        },
                        {
                            key: 'upload',
                            value: function (e) {
                                var that = this;
                                if (!se(this._cosUploadMethod)) {
                                    J.warn(
                                        'UploadController.upload 没有检测到上传插件，将无法发送图片、音频、视频、文件等类型的消息。详细请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html#registerPlugin'
                                    );
                                    return Wo(
                                        new pt({
                                            code: vt,
                                            message: wn
                                        })
                                    );
                                }
                                var n = new oi();
                                n.setMethod(ci).setStart();
                                J.time(ri);
                                var r = O ? e.file : e.file.files[0];
                                return new Promise(function (o, i) {
                                    var s = O ? that._createCosOptionsWXMiniApp(e) : that._createCosOptionsWeb(e);
                                    var a = that;
                                    that._cosUploadMethod(s, function (e, s) {
                                        var u = Object.create(null);
                                        if (s) {
                                            if (e || (re(s.files) && s.files[0].error)) {
                                                var l = new pt({
                                                    code: bt,
                                                    message: jn
                                                });
                                                n.setError(l, true, that.getNetworkType()).setEnd();
                                                J.log('UploadController.upload failed, error:', s.files[0].error);
                                                if (403 === s.files[0].error.statusCode) {
                                                    J.warn('UploadController.upload failed. cos AccessKeyId was invalid, regain auth key!');
                                                    that._getAuthorizationKey();
                                                }
                                                return void i(l);
                                            }
                                            u.fileName = r.name;
                                            u.fileSize = r.size;
                                            u.fileType = r.type.slice(r.type.indexOf('/') + 1).toLowerCase();
                                            u.location = O ? s.Location : s.files[0].data.Location;
                                            var c = J.timeEnd(ri);
                                            var p = a._formatFileSize(r.size);
                                            var h = a._formatSpeed((1000 * r.size) / c);
                                            var f = 'size='.concat(p, ',time=').concat(c, 'ms,speed=').concat(h);
                                            J.log('UploadController.upload success name='.concat(r.name, ',').concat(f));
                                            o(u);
                                            return void n.setCode(0).setNetworkType(that.getNetworkType()).setText(f).setEnd();
                                        }
                                        var d = new pt({
                                            code: bt,
                                            message: jn
                                        });
                                        n.setError(d, true, a.getNetworkType()).setEnd();
                                        J.warn('UploadController.upload failed, error:', e);
                                        if (403 === e.statusCode) {
                                            J.warn('UploadController.upload failed. cos AccessKeyId was invalid, regain auth key!');
                                            that._getAuthorizationKey();
                                        }
                                        i(d);
                                    });
                                });
                            }
                        },
                        {
                            key: '_formatFileSize',
                            value: function (e) {
                                return e < 1024 ? e + 'B' : e < 1048576 ? Math.floor(e / 1024) + 'KB' : Math.floor(e / 1048576) + 'MB';
                            }
                        },
                        {
                            key: '_formatSpeed',
                            value: function (e) {
                                return e <= 1048576 ? (e / 1024).toFixed(1) + 'KB/s' : (e / 1048576).toFixed(1) + 'MB/s';
                            }
                        },
                        {
                            key: '_createCosOptionsWeb',
                            value: function (e) {
                                var t = this.tim.context.identifier;
                                var n = this._genFileName(t, e.to, e.file.files[0].name);
                                return {
                                    files: [
                                        {
                                            Bucket: ''.concat(this.bucketName, '-').concat(this.appid),
                                            Region: this.region,
                                            Key: ''.concat(this.directory, '/').concat(n),
                                            Body: e.file.files[0]
                                        }
                                    ],
                                    SliceSize: 1048576,
                                    onProgress: function (t) {
                                        if ('function' == typeof e.onProgress) {
                                            try {
                                                e.onProgress(t.percent);
                                            } catch (n) {
                                                console.log('CatchClause', n);
                                                console.log('CatchClause', n);
                                                J.warn('onProgress callback error:');
                                                J.error(n);
                                            }
                                        }
                                    },
                                    onFileFinish: function (e, t, n) {}
                                };
                            }
                        },
                        {
                            key: '_createCosOptionsWXMiniApp',
                            value: function (e) {
                                var t = this.tim.context.identifier;
                                var n = this._genFileName(t, e.to, e.file.name);
                                var r = e.file.url;
                                return {
                                    Bucket: ''.concat(this.bucketName, '-').concat(this.appid),
                                    Region: this.region,
                                    Key: ''.concat(this.directory, '/').concat(n),
                                    FilePath: r,
                                    onProgress: function (t) {
                                        J.log(JSON.stringify(t));
                                        if ('function' == typeof e.onProgress) {
                                            try {
                                                e.onProgress(t.percent);
                                            } catch (n) {
                                                console.log('CatchClause', n);
                                                console.log('CatchClause', n);
                                                J.warn('onProgress callback error:');
                                                J.error(n);
                                            }
                                        }
                                    }
                                };
                            }
                        },
                        {
                            key: '_genFileName',
                            value: function (e, t, n) {
                                return ''.concat(e, '-').concat(t, '-').concat(me(99999), '-').concat(n);
                            }
                        },
                        {
                            key: 'reset',
                            value: function () {
                                if (this._timer) {
                                    clearInterval(this._timer);
                                    this._timer = 0;
                                }
                            }
                        }
                    ]);
                    return n;
                })(Bo);
                var Bu = (function (e) {
                    l(o, e);
                    var n = y(o);
                    function o(e) {
                        var t;
                        r(this, o);
                        (t = n.call(this, e)).FILETYPE = {
                            SOUND: 2106,
                            FILE: 2107,
                            VIDEO: 2113
                        };
                        t._bdh_download_server = 'grouptalk.c2c.qq.com';
                        t._BDHBizID = 10001;
                        t._authKey = '';
                        t._expireTime = 0;
                        t.tim.innerEmitter.on(Yr, t._getAuthKey, g(t));
                        return t;
                    }
                    i(o, [
                        {
                            key: '_getAuthKey',
                            value: function () {
                                var that = this;
                                this.request({
                                    name: 'bigDataHallwayAuthKey',
                                    action: 'query'
                                }).then(function (t) {
                                    if (t.data.authKey) {
                                        that._authKey = t.data.authKey;
                                        that._expireTime = parseInt(t.data.expireTime);
                                    }
                                });
                            }
                        },
                        {
                            key: '_isFromOlderVersion',
                            value: function (e) {
                                return 2 !== e.content.downloadFlag;
                            }
                        },
                        {
                            key: 'parseElements',
                            value: function (e, t) {
                                if (!re(e) || !t) {
                                    return [];
                                }
                                for (var n = [], r = null, o = 0; o < e.length; o++) {
                                    r = e[o];
                                    this._needParse(r) ? n.push(this._parseElement(r, t)) : n.push(e[o]);
                                }
                                return n;
                            }
                        },
                        {
                            key: '_needParse',
                            value: function (e) {
                                return !(!this._isFromOlderVersion(e) || (e.type !== t.MSG_AUDIO && e.type !== t.MSG_FILE && e.type !== t.MSG_VIDEO));
                            }
                        },
                        {
                            key: '_parseElement',
                            value: function (e, n) {
                                switch (e.type) {
                                    case t.MSG_AUDIO:
                                        return this._parseAudioElement(e, n);
                                    case t.MSG_FILE:
                                        return this._parseFileElement(e, n);
                                    case t.MSG_VIDEO:
                                        return this._parseVideoElement(e, n);
                                }
                            }
                        },
                        {
                            key: '_parseAudioElement',
                            value: function (e, t) {
                                e.content.url = this._genAudioUrl(e.content.uuid, t);
                                return e;
                            }
                        },
                        {
                            key: '_parseFileElement',
                            value: function (e, t) {
                                e.content.url = this._genFileUrl(e.content.uuid, t, e.content.fileName);
                                return e;
                            }
                        },
                        {
                            key: '_parseVideoElement',
                            value: function (e, t) {
                                e.content.url = this._genVideoUrl(e.content.uuid, t);
                                return e;
                            }
                        },
                        {
                            key: '_genAudioUrl',
                            value: function (e, t) {
                                return '' === this._authKey
                                    ? (J.warn('BigDataHallwayController._genAudioUrl no authKey!'), '')
                                    : 'https://'
                                          .concat(this._bdh_download_server, '/asn.com/stddownload_common_file?authkey=')
                                          .concat(this._authKey, '&bid=')
                                          .concat(this._BDHBizID, '&subbid=')
                                          .concat(this.tim.context.SDKAppID, '&fileid=')
                                          .concat(e, '&filetype=')
                                          .concat(this.FILETYPE.SOUND, '&openid=')
                                          .concat(t, '&ver=0');
                            }
                        },
                        {
                            key: '_genFileUrl',
                            value: function (e, t, n) {
                                return '' === this._authKey
                                    ? (J.warn('BigDataHallwayController._genFileUrl no authKey!'), '')
                                    : (n || (n = ''.concat(Math.floor(100000 * Math.random()), '-').concat(Date.now())),
                                      'https://'
                                          .concat(this._bdh_download_server, '/asn.com/stddownload_common_file?authkey=')
                                          .concat(this._authKey, '&bid=')
                                          .concat(this._BDHBizID, '&subbid=')
                                          .concat(this.tim.context.SDKAppID, '&fileid=')
                                          .concat(e, '&filetype=')
                                          .concat(this.FILETYPE.FILE, '&openid=')
                                          .concat(t, '&ver=0&filename=')
                                          .concat(encodeURIComponent(n)));
                            }
                        },
                        {
                            key: '_genVideoUrl',
                            value: function (e, t) {
                                return '' === this._authKey
                                    ? (J.warn('BigDataHallwayController._genVideoUrl no authKey!'), '')
                                    : 'https://'
                                          .concat(this._bdh_download_server, '/asn.com/stddownload_common_file?authkey=')
                                          .concat(this._authKey, '&bid=')
                                          .concat(this._BDHBizID, '&subbid=')
                                          .concat(this.tim.context.SDKAppID, '&fileid=')
                                          .concat(e, '&filetype=')
                                          .concat(this.FILETYPE.VIDEO, '&openid=')
                                          .concat(t, '&ver=0');
                            }
                        },
                        {
                            key: 'reset',
                            value: function () {
                                this._authKey = '';
                                this.expireTime = 0;
                            }
                        }
                    ]);
                    return o;
                })(Bo);
                var Vu = {
                    app_id: '',
                    event_id: '',
                    api_base: 'https://pingtas.qq.com/pingd',
                    prefix: '_mta_',
                    version: '1.3.9',
                    stat_share_app: false,
                    stat_pull_down_fresh: false,
                    stat_reach_bottom: false,
                    stat_param: true
                };
                function Ku() {
                    try {
                        var e = 's' + ju();
                        uni.setStorageSync(Vu.prefix + 'ssid', e);
                        return e;
                    } catch (t) {
                        console.log('CatchClause', t);
                        console.log('CatchClause', t);
                    }
                }
                function ju(e) {
                    for (var t = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], n = 10; 1 < n; n--) {
                        var r = Math.floor(10 * Math.random());
                        var o = t[r];
                        t[r] = t[n - 1];
                        t[n - 1] = o;
                    }
                    for (n = r = 0; 5 > n; n++) {
                        r = 10 * r + t[n];
                    }
                    return (e || '') + (r + '') + +new Date();
                }
                function $u() {
                    try {
                        var e = getCurrentPages();
                        var t = '/';
                        if (0 < e.length) {
                            t = e.pop().__route__;
                        }
                        return t;
                    } catch (n) {
                        console.log('CatchClause', n);
                        console.log('CatchClause', n);
                        console.log('get current page path error:' + n);
                    }
                }
                function Yu() {
                    var e;
                    var t = {
                        dm: 'wechat.apps.xx',
                        url: encodeURIComponent($u() + Xu(Ju.Data.pageQuery)),
                        pvi: '',
                        si: '',
                        ty: 0
                    };
                    t.pvi =
                        ((e = (function () {
                            try {
                                return uni.getStorageSync(Vu.prefix + 'auid');
                            } catch (t) {
                                console.log('CatchClause', t);
                                console.log('CatchClause', t);
                            }
                        })()) ||
                            ((e = (function () {
                                try {
                                    var t = ju();
                                    uni.setStorageSync(Vu.prefix + 'auid', t);
                                    return t;
                                } catch (e) {
                                    console.log('CatchClause', e);
                                    console.log('CatchClause', e);
                                }
                            })()),
                            (t.ty = 1)),
                        e);
                    t.si = (function () {
                        var e = (function () {
                            try {
                                return uni.getStorageSync(Vu.prefix + 'ssid');
                            } catch (e) {
                                console.log('CatchClause', e);
                                console.log('CatchClause', e);
                            }
                        })();
                        e || (e = Ku());
                        return e;
                    })();
                    return t;
                }
                function zu() {
                    var e = (function () {
                        var e = uni.getSystemInfoSync();
                        return {
                            adt: encodeURIComponent(e.model),
                            scl: e.pixelRatio,
                            scr: e.windowWidth + 'x' + e.windowHeight,
                            lg: e.language,
                            fl: e.version,
                            jv: encodeURIComponent(e.system),
                            tz: encodeURIComponent(e.platform)
                        };
                    })();
                    (function (e) {
                        uni.getNetworkType({
                            success: function (t) {
                                e(t.networkType);
                            }
                        });
                    })(function (e) {
                        try {
                            uni.setStorageSync(Vu.prefix + 'ntdata', e);
                        } catch (t) {
                            console.log('CatchClause', t);
                            console.log('CatchClause', t);
                        }
                    });
                    e.ct = uni.getStorageSync(Vu.prefix + 'ntdata') || '4g';
                    return e;
                }
                function Wu() {
                    var e;
                    var t = Ju.Data.userInfo;
                    var n = [];
                    for (e in t) {
                        if (t.hasOwnProperty(e)) {
                            n.push(e + '=' + t[e]);
                        }
                    }
                    t = n.join(';');
                    return {
                        r2: Vu.app_id,
                        r4: 'wx',
                        ext: 'v=' + Vu.version + (null !== t && '' !== t ? ';ui=' + encodeURIComponent(t) : '')
                    };
                }
                function Xu(e) {
                    if (!Vu.stat_param || !e) {
                        return '';
                    }
                    e = (function (e) {
                        if (1 > Vu.ignore_params.length) {
                            return e;
                        }
                        var t;
                        var n = {};
                        for (t in e) {
                            0 <= Vu.ignore_params.indexOf(t) || (n[t] = e[t]);
                        }
                        return n;
                    })(e);
                    var t;
                    var n = [];
                    for (t in e) {
                        n.push(t + '=' + e[t]);
                    }
                    return 0 < n.length ? '?' + n.join('&') : '';
                }
                var Ju = {
                    App: {
                        init: function (e) {
                            if ('appID' in e) {
                                Vu.app_id = e.appID;
                            }
                            if ('eventID' in e) {
                                Vu.event_id = e.eventID;
                            }
                            if ('statShareApp' in e) {
                                Vu.stat_share_app = e.statShareApp;
                            }
                            if ('statPullDownFresh' in e) {
                                Vu.stat_pull_down_fresh = e.statPullDownFresh;
                            }
                            if ('statReachBottom' in e) {
                                Vu.stat_reach_bottom = e.statReachBottom;
                            }
                            if ('ignoreParams' in e) {
                                Vu.ignore_params = e.ignoreParams;
                            }
                            if ('statParam' in e) {
                                Vu.stat_param = e.statParam;
                            }
                            Ku();
                            try {
                                if ('lauchOpts' in e) {
                                    Ju.Data.lanchInfo = e.lauchOpts;
                                    Ju.Data.lanchInfo.landing = 1;
                                }
                            } catch (t) {
                                console.log('CatchClause', t);
                                console.log('CatchClause', t);
                            }
                            if ('autoReport' in e && e.autoReport) {
                                (function () {
                                    var e = Page;
                                    Page = function (t) {
                                        var n = t.onLoad;
                                        t.onLoad = function (e) {
                                            if (n) {
                                                n.call(this, e);
                                            }
                                            Ju.Data.lastPageQuery = Ju.Data.pageQuery;
                                            Ju.Data.pageQuery = e;
                                            Ju.Data.lastPageUrl = Ju.Data.pageUrl;
                                            Ju.Data.pageUrl = $u();
                                            Ju.Data.show = false;
                                            Ju.Page.init();
                                        };
                                        e(t);
                                    };
                                })();
                            }
                        }
                    },
                    Page: {
                        init: function () {
                            var e;
                            var t = getCurrentPages()[getCurrentPages().length - 1];
                            if (t.onShow) {
                                e = t.onShow;
                                t.onShow = function () {
                                    if (true === Ju.Data.show) {
                                        var t = Ju.Data.lastPageQuery;
                                        Ju.Data.lastPageQuery = Ju.Data.pageQuery;
                                        Ju.Data.pageQuery = t;
                                        Ju.Data.lastPageUrl = Ju.Data.pageUrl;
                                        Ju.Data.pageUrl = $u();
                                    }
                                    Ju.Data.show = true;
                                    Ju.Page.stat();
                                    e.apply(this, arguments);
                                };
                            }
                            if (Vu.stat_pull_down_fresh && t.onPullDownRefresh) {
                                (function () {
                                    var e = t.onPullDownRefresh;
                                    t.onPullDownRefresh = function () {
                                        Ju.Event.stat(Vu.prefix + 'pulldownfresh', {
                                            url: t.__route__
                                        });
                                        e.apply(this, arguments);
                                    };
                                })();
                            }
                            if (Vu.stat_reach_bottom && t.onReachBottom) {
                                (function () {
                                    var e = t.onReachBottom;
                                    t.onReachBottom = function () {
                                        Ju.Event.stat(Vu.prefix + 'reachbottom', {
                                            url: t.__route__
                                        });
                                        e.apply(this, arguments);
                                    };
                                })();
                            }
                            if (Vu.stat_share_app && t.onShareAppMessage) {
                                (function () {
                                    var e = t.onShareAppMessage;
                                    t.onShareAppMessage = function () {
                                        Ju.Event.stat(Vu.prefix + 'shareapp', {
                                            url: t.__route__
                                        });
                                        return e.apply(this, arguments);
                                    };
                                })();
                            }
                        },
                        multiStat: function (e, t) {
                            if (1 == t) {
                                Ju.Page.stat(e);
                            } else {
                                var n = getCurrentPages()[getCurrentPages().length - 1];
                                if (n.onShow) {
                                    (function () {
                                        var t = n.onShow;
                                        n.onShow = function () {
                                            Ju.Page.stat(e);
                                            t.call(this, arguments);
                                        };
                                    })();
                                }
                            }
                        },
                        stat: function (e) {
                            if ('' != Vu.app_id) {
                                var t = [];
                                var n = Wu();
                                if (e) {
                                    n.r2 = e;
                                }
                                e = [Yu(), n, zu()];
                                if (Ju.Data.lanchInfo) {
                                    e.push({
                                        ht: Ju.Data.lanchInfo.scene
                                    });
                                    if (Ju.Data.pageQuery && Ju.Data.pageQuery._mta_ref_id) {
                                        e.push({
                                            rarg: Ju.Data.pageQuery._mta_ref_id
                                        });
                                    }
                                    try {
                                        if (1 == Ju.Data.lanchInfo.landing) {
                                            n.ext += ';lp=1';
                                            Ju.Data.lanchInfo.landing = 0;
                                        }
                                    } catch (i) {
                                        console.log('CatchClause', i);
                                        console.log('CatchClause', i);
                                    }
                                }
                                e.push({
                                    rdm: '/',
                                    rurl:
                                        0 >= Ju.Data.lastPageUrl.length
                                            ? Ju.Data.pageUrl + Xu(Ju.Data.lastPageQuery)
                                            : encodeURIComponent(Ju.Data.lastPageUrl + Xu(Ju.Data.lastPageQuery))
                                });
                                e.push({
                                    rand: +new Date()
                                });
                                n = 0;
                                for (var r = e.length; n < r; n++) {
                                    for (var o in e[n]) {
                                        if (e[n].hasOwnProperty(o)) {
                                            t.push(o + '=' + (void 0 === e[n][o] ? '' : e[n][o]));
                                        }
                                    }
                                }
                                uni.request({
                                    url: Vu.api_base + '?' + t.join('&').toLowerCase()
                                });
                            }
                        }
                    },
                    Event: {
                        stat: function (e, t) {
                            if ('' != Vu.event_id) {
                                var n = [];
                                var r = Yu();
                                var o = Wu();
                                r.dm = 'wxapps.click';
                                r.url = e;
                                o.r2 = Vu.event_id;
                                var i;
                                var s = void 0 === t ? {} : t;
                                var a = [];
                                for (i in s) {
                                    if (s.hasOwnProperty(i)) {
                                        a.push(encodeURIComponent(i) + '=' + encodeURIComponent(s[i]));
                                    }
                                }
                                for (
                                    s = a.join(';'),
                                        o.r5 = s,
                                        s = 0,
                                        o = (r = [
                                            r,
                                            o,
                                            zu(),
                                            {
                                                rand: +new Date()
                                            }
                                        ]).length;
                                    s < o;
                                    s++
                                ) {
                                    for (var u in r[s]) {
                                        if (r[s].hasOwnProperty(u)) {
                                            n.push(u + '=' + (void 0 === r[s][u] ? '' : r[s][u]));
                                        }
                                    }
                                }
                                uni.request({
                                    url: Vu.api_base + '?' + n.join('&').toLowerCase()
                                });
                            }
                        }
                    },
                    Data: {
                        userInfo: null,
                        lanchInfo: null,
                        pageQuery: null,
                        lastPageQuery: null,
                        pageUrl: '',
                        lastPageUrl: '',
                        show: false
                    }
                };
                var Qu = Ju;
                var Zu = (function () {
                    function e() {
                        r(this, e);
                        this.cache = [];
                        this.MtaWX = null;
                        this._init();
                    }
                    i(e, [
                        {
                            key: 'report',
                            value: function (e, t) {
                                var that = this;
                                try {
                                    R
                                        ? window.MtaH5
                                            ? (window.MtaH5.clickStat(e, t),
                                              this.cache.forEach(function (e) {
                                                  var t = e.name;
                                                  var r = e.param;
                                                  window.MtaH5.clickStat(t, r);
                                                  that.cache.shift();
                                              }))
                                            : this.cache.push({
                                                  name: e,
                                                  param: t
                                              })
                                        : O &&
                                          (this.MtaWX
                                              ? (this.MtaWX.Event.stat(e, t),
                                                this.cache.forEach(function (e) {
                                                    var t = e.name;
                                                    var r = e.param;
                                                    that.MtaWX.stat(t, r);
                                                    that.cache.shift();
                                                }))
                                              : this.cache.push({
                                                    name: e,
                                                    param: t
                                                }));
                                } catch (r) {
                                    console.log('CatchClause', r);
                                    console.log('CatchClause', r);
                                }
                            }
                        },
                        {
                            key: 'stat',
                            value: function () {
                                try {
                                    R && window.MtaH5 ? window.MtaH5.pgv() : O && this.MtaWX && this.MtaWX.Page.stat();
                                } catch (e) {
                                    console.log('CatchClause', e);
                                    console.log('CatchClause', e);
                                }
                            }
                        },
                        {
                            key: '_init',
                            value: function () {
                                try {
                                    if (R) {
                                        window._mtac = {
                                            autoReport: 0
                                        };
                                        var e = document.createElement('script');
                                        var t = Me();
                                        e.src = ''.concat(t, '//pingjs.qq.com/h5/stats.js?v2.0.4');
                                        e.setAttribute('name', 'MTAH5');
                                        e.setAttribute('sid', '500690998');
                                        e.setAttribute('cid', '500691017');
                                        var n = document.getElementsByTagName('script')[0];
                                        n.parentNode.insertBefore(e, n);
                                    } else {
                                        if (O) {
                                            this.MtaWX = Qu;
                                            this.MtaWX.App.init({
                                                appID: '500690995',
                                                eventID: '500691014',
                                                autoReport: false,
                                                statParam: true
                                            });
                                        }
                                    }
                                } catch (r) {
                                    console.log('CatchClause', r);
                                    console.log('CatchClause', r);
                                }
                            }
                        }
                    ]);
                    return e;
                })();
                var el = (function (e) {
                    l(n, e);
                    var t = y(n);
                    function n(e) {
                        var o;
                        r(this, n);
                        (o = t.call(this, e)).MTA = new Zu();
                        var i = o.tim.innerEmitter;
                        i.on(Po, o._stat, g(o));
                        i.on(bo, o._stat, g(o));
                        return o;
                    }
                    i(n, [
                        {
                            key: '_stat',
                            value: function () {
                                this.MTA.report('sdkappid', {
                                    value: this.tim.context.SDKAppID
                                });
                                this.MTA.report('version', {
                                    value: dl.VERSION
                                });
                                this.MTA.stat();
                            }
                        }
                    ]);
                    return n;
                })(Bo);
                var tl = (function () {
                    function e(t) {
                        r(this, e);
                        this._table = 'timwebii';
                        this._report = [];
                    }
                    i(e, [
                        {
                            key: 'pushIn',
                            value: function (e) {
                                J.debug('SSOLogBody.pushIn', this._report.length, e);
                                this._report.push(e);
                            }
                        },
                        {
                            key: 'backfill',
                            value: function (e) {
                                var t;
                                if (re(e) && 0 !== e.length) {
                                    J.debug('SSOLogBody.backfill', this._report.length, e.length);
                                    (t = this._report).unshift.apply(t, _(e));
                                }
                            }
                        },
                        {
                            key: 'getLogsNumInMemory',
                            value: function () {
                                return this._report.length;
                            }
                        },
                        {
                            key: 'isEmpty',
                            value: function () {
                                return 0 === this._report.length;
                            }
                        },
                        {
                            key: '_reset',
                            value: function () {
                                this._report.length = 0;
                                this._report = [];
                            }
                        },
                        {
                            key: 'getTable',
                            value: function () {
                                return this._table;
                            }
                        },
                        {
                            key: 'getLogsInMemory',
                            value: function () {
                                var e = this._report.slice();
                                this._reset();
                                return e;
                            }
                        }
                    ]);
                    return e;
                })();
                var nl = (function (e) {
                    l(n, e);
                    var t = y(n);
                    function n(e) {
                        var o;
                        r(this, n);
                        (o = t.call(this, e)).TAG = 'im-ssolog-event';
                        o._reportBody = new tl();
                        o._version = '2.6.2';
                        o.MIN_THRESHOLD = 20;
                        o.MAX_THRESHOLD = 100;
                        o.WAITING_TIME = 60000;
                        o.INTERVAL = 20000;
                        o._timerID = 0;
                        o._resetLastReportTime();
                        o._startReportTimer();
                        o._retryCount = 0;
                        o.MAX_RETRY_COUNT = 3;
                        o.tim.innerEmitter.on(Do, o._onLoginSuccess, g(o));
                        return o;
                    }
                    i(n, [
                        {
                            key: 'reportAtOnce',
                            value: function () {
                                J.debug('EventStatController.reportAtOnce');
                                this._report();
                            }
                        },
                        {
                            key: '_onLoginSuccess',
                            value: function () {
                                var that = this;
                                var t = this.tim.storage;
                                var n = t.getItem(this.TAG, false);
                                we(n) ||
                                    (J.log('EventStatController._onLoginSuccess get ssolog in storage, nums=' + n.length),
                                    n.forEach(function (t) {
                                        that._reportBody.pushIn(t);
                                    }),
                                    t.removeItem(this.TAG, false));
                            }
                        },
                        {
                            key: 'pushIn',
                            value: function (e) {
                                if (e instanceof oi) {
                                    e.setCommonInfo(this.tim.context.SDKAppID, this._version, this.tim.context.tinyID, this.tim.loginInfo.identifier, this.getPlatform());
                                    this._reportBody.pushIn(e);
                                    if (this._reportBody.getLogsNumInMemory() >= this.MIN_THRESHOLD) {
                                        this._report();
                                    }
                                }
                            }
                        },
                        {
                            key: '_resetLastReportTime',
                            value: function () {
                                this._lastReportTime = Date.now();
                            }
                        },
                        {
                            key: '_startReportTimer',
                            value: function () {
                                var that = this;
                                this._timerID = setInterval(function () {
                                    Date.now() < that._lastReportTime + that.WAITING_TIME || that._reportBody.isEmpty() || that._report();
                                }, this.INTERVAL);
                            }
                        },
                        {
                            key: '_stopReportTimer',
                            value: function () {
                                if (this._timerID > 0) {
                                    clearInterval(this._timerID);
                                    this._timerID = 0;
                                }
                            }
                        },
                        {
                            key: '_report',
                            value: function () {
                                var that = this;
                                if (!this._reportBody.isEmpty()) {
                                    var t = this._reportBody.getLogsInMemory();
                                    this.request({
                                        name: 'ssoEventStat',
                                        action: 'create',
                                        param: {
                                            table: this._reportBody.getTable(),
                                            report: t
                                        }
                                    })
                                        .then(function () {
                                            that._resetLastReportTime();
                                            if (that._retryCount > 0) {
                                                J.debug('EventStatController.report retry success');
                                                that._retryCount = 0;
                                            }
                                        })
                                        .catch(function (n) {
                                            J.warn('EventStatController.report, online:'.concat(that.getNetworkType(), ' error:').concat(n));
                                            that._reportBody.backfill(t);
                                            if (that._reportBody.getLogsNumInMemory() > that.MAX_THRESHOLD || that._retryCount === that.MAX_RETRY_COUNT || 0 === that._timerID) {
                                                that._retryCount = 0;
                                                return void that._flushAtOnce();
                                            }
                                            that._retryCount += 1;
                                        });
                                }
                            }
                        },
                        {
                            key: '_flushAtOnce',
                            value: function () {
                                var e = this.tim.storage;
                                var t = e.getItem(this.TAG, false);
                                var n = this._reportBody.getLogsInMemory();
                                if (we(t)) {
                                    J.log('EventStatController._flushAtOnce nums=' + n.length);
                                    e.setItem(this.TAG, n, true, false);
                                } else {
                                    var r = n.concat(t);
                                    if (r.length > this.MAX_THRESHOLD) {
                                        r = r.slice(0, this.MAX_THRESHOLD);
                                    }
                                    J.log('EventStatController._flushAtOnce nums=' + r.length);
                                    e.setItem(this.TAG, r, true, false);
                                }
                            }
                        },
                        {
                            key: 'reset',
                            value: function () {
                                J.log('EventStatController.reset');
                                this._stopReportTimer();
                                this._report();
                            }
                        }
                    ]);
                    return n;
                })(Bo);
                var rl = 'none';
                var ol = 'online';
                var il = (function () {
                    function e() {
                        r(this, e);
                        this._networkType = '';
                        this.maxWaitTime = 3000;
                    }
                    i(e, [
                        {
                            key: 'start',
                            value: function () {
                                var that = this;
                                O
                                    ? (uni.getNetworkType({
                                          success: function (t) {
                                              that._networkType = t.networkType;
                                              t.networkType === rl ? J.warn('NetMonitor no network, please check!') : J.info('NetMonitor networkType:'.concat(t.networkType));
                                          }
                                      }),
                                      uni.onNetworkStatusChange(this._onWxNetworkStatusChange.bind(this)))
                                    : (this._networkType = ol);
                            }
                        },
                        {
                            key: '_onWxNetworkStatusChange',
                            value: function (e) {
                                this._networkType = e.networkType;
                                e.isConnected ? J.info('NetMonitor networkType:'.concat(e.networkType)) : J.warn('NetMonitor no network, please check!');
                            }
                        },
                        {
                            key: 'probe',
                            value: function () {
                                var that = this;
                                return new Promise(function (t, n) {
                                    if (O)
                                        uni.getNetworkType({
                                            success: function (n) {
                                                that._networkType = n.networkType;
                                                n.networkType === rl
                                                    ? (J.warn('NetMonitor no network, please check!'), t([false, n.networkType]))
                                                    : (J.info('NetMonitor networkType:'.concat(n.networkType)), t([true, n.networkType]));
                                            }
                                        });
                                    else if (window && window.fetch) {
                                        fetch(''.concat(Me(), '//webim-1252463788.file.myqcloud.com/assets/test/speed.xml?random=').concat(Math.random()))
                                            .then(function (e) {
                                                e.ok ? t([true, ol]) : t([false, rl]);
                                            })
                                            .catch(function (e) {
                                                t([false, rl]);
                                            });
                                    } else {
                                        var r = new XMLHttpRequest();
                                        var o = setTimeout(function () {
                                            J.warn('NetMonitor fetch timeout. Probably no network, please check!');
                                            r.abort();
                                            that._networkType = rl;
                                            t([false, rl]);
                                        }, that.maxWaitTime);
                                        r.onreadystatechange = function () {
                                            if (4 === r.readyState) {
                                                clearTimeout(o);
                                                200 === r.status || 304 === r.status
                                                    ? ((this._networkType = ol), t([true, ol]))
                                                    : (J.warn('NetMonitor fetch status:'.concat(r.status, '. Probably no network, please check!')),
                                                      (this._networkType = rl),
                                                      t([false, rl]));
                                            }
                                        };
                                        r.open('GET', ''.concat(Me(), '//webim-1252463788.file.myqcloud.com/assets/test/speed.xml?random=').concat(Math.random()));
                                        r.send();
                                    }
                                });
                            }
                        },
                        {
                            key: 'getNetworkType',
                            value: function () {
                                return this._networkType;
                            }
                        },
                        {
                            key: 'reset',
                            value: function () {
                                this._networkType = '';
                            }
                        }
                    ]);
                    return e;
                })();
                var sl = (function () {
                    function e(t) {
                        var that = this;
                        r(this, e);
                        re(t)
                            ? ((this._map = new Map()),
                              t.forEach(function (e) {
                                  that._map.set(e, []);
                              }))
                            : J.warn('AverageCalculator.constructor need keys');
                    }
                    i(e, [
                        {
                            key: 'push',
                            value: function (e, t) {
                                return !(oe(e) || !this._map.has(e) || !Z(t)) && (this._map.get(e).push(t), true);
                            }
                        },
                        {
                            key: 'getSize',
                            value: function (e) {
                                return oe(e) || !this._map.has(e) ? -1 : this._map.get(e).length;
                            }
                        },
                        {
                            key: 'getAvg',
                            value: function (e) {
                                if (oe(e) || !this._map.has(e)) {
                                    return -1;
                                }
                                var t = this._map.get(e);
                                var n = t.length;
                                if (0 === n) {
                                    return 0;
                                }
                                var r = 0;
                                t.forEach(function (e) {
                                    r += e;
                                });
                                t.length = 0;
                                this._map.set(e, []);
                                return parseInt(r / n);
                            }
                        },
                        {
                            key: 'getMax',
                            value: function (e) {
                                return oe(e) || !this._map.has(e) ? -1 : Math.max.apply(null, this._map.get(e));
                            }
                        },
                        {
                            key: 'getMin',
                            value: function (e) {
                                return oe(e) || !this._map.has(e) ? -1 : Math.min.apply(null, this._map.get(e));
                            }
                        },
                        {
                            key: 'reset',
                            value: function () {
                                this._map.forEach(function (e) {
                                    e.length = 0;
                                });
                            }
                        }
                    ]);
                    return e;
                })();
                var al = (function () {
                    function e(t) {
                        var that = this;
                        r(this, e);
                        re(t)
                            ? ((this._map = new Map()),
                              t.forEach(function (e) {
                                  that._map.set(e, {
                                      totalCount: 0,
                                      successCount: 0
                                  });
                              }))
                            : J.warn('SuccessRateCalculator.constructor need keys');
                    }
                    i(e, [
                        {
                            key: 'addTotalCount',
                            value: function (e) {
                                return !(oe(e) || !this._map.has(e)) && ((this._map.get(e).totalCount += 1), true);
                            }
                        },
                        {
                            key: 'addSuccessCount',
                            value: function (e) {
                                return !(oe(e) || !this._map.has(e)) && ((this._map.get(e).successCount += 1), true);
                            }
                        },
                        {
                            key: 'getSuccessRate',
                            value: function (e) {
                                if (oe(e) || !this._map.has(e)) {
                                    return -1;
                                }
                                var t = this._map.get(e);
                                if (0 === t.totalCount) {
                                    return 1;
                                }
                                var n = parseFloat((t.successCount / t.totalCount).toFixed(2));
                                t.totalCount = t.successCount = 0;
                                return n;
                            }
                        },
                        {
                            key: 'getTotalCount',
                            value: function (e) {
                                return oe(e) || !this._map.has(e) ? -1 : this._map.get(e).totalCount;
                            }
                        },
                        {
                            key: 'reset',
                            value: function () {
                                this._map.forEach(function (e) {
                                    e.totalCount = 0;
                                    e.successCount = 0;
                                });
                            }
                        }
                    ]);
                    return e;
                })();
                var ul = (function (e) {
                    l(n, e);
                    var t = y(n);
                    function n(e) {
                        var o;
                        r(this, n);
                        (o = t.call(this, e)).TABLE = 'timwebsum';
                        o.TAG = 'im-ssolog-sumstat';
                        o._items = [Qo, Zo, ei];
                        o._thresholdMap = new Map();
                        o._thresholdMap.set(Qo, 100);
                        o._thresholdMap.set(Zo, 150);
                        o._thresholdMap.set(ei, 15);
                        o._lpID = '';
                        o._platform = o.getPlatform();
                        o._lastReportTime = 0;
                        o._statInfoArr = [];
                        o._retryCount = 0;
                        o._avgCalc = new sl(o._items);
                        o._successRateCalc = new al(o._items);
                        o.tim.innerEmitter.on(Do, o._onLoginSuccess, g(o));
                        return o;
                    }
                    i(n, [
                        {
                            key: '_onLoginSuccess',
                            value: function () {
                                var that = this;
                                var t = this.tim.storage;
                                var n = t.getItem(this.TAG, false);
                                we(n) ||
                                    (J.log('SumStatController._onLoginSuccess get sumstatlog in storage, nums=' + n.length),
                                    n.forEach(function (t) {
                                        that._statInfoArr.pushIn(t);
                                    }),
                                    t.removeItem(this.TAG, false));
                            }
                        },
                        {
                            key: 'recordLongPollingID',
                            value: function (e) {
                                this._lpID = e;
                            }
                        },
                        {
                            key: 'addTotalCount',
                            value: function (e) {
                                this._successRateCalc.addTotalCount(e)
                                    ? 1 === this._successRateCalc.getTotalCount(e) && (this._lastReportTime = Date.now())
                                    : J.warn('SumStatController.addTotalCount invalid key:', e);
                            }
                        },
                        {
                            key: 'addSuccessCount',
                            value: function (e) {
                                this._successRateCalc.addSuccessCount(e) || J.warn('SumStatController.addSuccessCount invalid key:', e);
                            }
                        },
                        {
                            key: 'addCost',
                            value: function (e, t) {
                                this._avgCalc.push(e, t)
                                    ? (J.debug('SumStatController.addCost', e, t, this._avgCalc.getSize(e)),
                                      this._avgCalc.getSize(e) >= this._thresholdMap.get(e) && this._report(e))
                                    : J.warn('SumStatController.addCost invalid key or cost:', e, t);
                            }
                        },
                        {
                            key: '_getItemNum',
                            value: function (e) {
                                switch (e) {
                                    case Qo:
                                        return 1;
                                    case Zo:
                                        return 2;
                                    case ei:
                                        return 3;
                                    default:
                                        return 100;
                                }
                            }
                        },
                        {
                            key: '_getStatInfo',
                            value: function (e) {
                                var t = null;
                                if (this._avgCalc.getSize(e) > 0) {
                                    t = {
                                        SDKAppID: ''.concat(this.tim.context.SDKAppID),
                                        version: ''.concat('2.6.2'),
                                        tinyID: this.tim.context.tinyID,
                                        userID: this.tim.loginInfo.identifier,
                                        item: this._getItemNum(e),
                                        lpID: e === Qo ? this._lpID : '',
                                        platform: this._platform,
                                        networkType: this.getNetworkType(),
                                        total: this._successRateCalc.getTotalCount(e),
                                        successRate: this._successRateCalc.getSuccessRate(e),
                                        avg: this._avgCalc.getAvg(e),
                                        timespan: Date.now() - this._lastReportTime,
                                        time: de()
                                    };
                                }
                                return t;
                            }
                        },
                        {
                            key: '_report',
                            value: function (e) {
                                var that = this;
                                var n = [];
                                var r = null;
                                oe(e)
                                    ? this._items.forEach(function (e) {
                                          if (null !== (r = that._getStatInfo(e))) {
                                              n.push(r);
                                          }
                                      })
                                    : null !== (r = this._getStatInfo(e)) && n.push(r);
                                J.debug('SumStatController._report', n);
                                if (this._statInfoArr.length > 0) {
                                    n = n.concat(this.statInfoArr);
                                    this._statInfoArr = [];
                                }
                                this._doReport(n);
                            }
                        },
                        {
                            key: '_doReport',
                            value: function (e) {
                                var that = this;
                                we(e)
                                    ? J.warn('SumStatController._doReport statInfoArr is empty, do nothing')
                                    : this.request({
                                          name: 'ssoSumStat',
                                          action: 'create',
                                          param: {
                                              table: this.TABLE,
                                              report: e
                                          }
                                      })
                                          .then(function () {
                                              that._lastReportTime = Date.now();
                                              if (that._retryCount > 0) {
                                                  J.debug('SumStatController._doReport retry success');
                                                  that._retryCount = 0;
                                              }
                                          })
                                          .catch(function (n) {
                                              J.warn('SumStatController._doReport, online:'.concat(that.getNetworkType(), ' error:'), n, e);
                                              that._retryCount <= 1
                                                  ? setTimeout(function () {
                                                        J.info('SumStatController._doReport retry', e);
                                                        that._retryCount += 1;
                                                        that._doReport(e);
                                                    }, 5000)
                                                  : ((that._retryCount = 0), (that._statInfoArr = that._statInfoArr.concat(e)), that._flusgAtOnce());
                                          });
                            }
                        },
                        {
                            key: '_flushAtOnce',
                            value: function () {
                                var e = this.tim.storage;
                                var t = e.getItem(this.TAG, false);
                                var n = this._statInfoArr;
                                if (we(t)) {
                                    J.log('SumStatController._flushAtOnce nums=' + n.length);
                                    e.setItem(this.TAG, n, true, false);
                                } else {
                                    var r = n.concat(t);
                                    if (r.length > 10) {
                                        r = r.slice(0, 10);
                                    }
                                    J.log('SumStatController._flushAtOnce nums=' + r.length);
                                    e.setItem(this.TAG, r, true, false);
                                }
                                this._statInfoArr = [];
                            }
                        },
                        {
                            key: 'reset',
                            value: function () {
                                J.info('SumStatController.reset');
                                this._report();
                                this._avgCalc.reset();
                                this._successRateCalc.reset();
                            }
                        }
                    ]);
                    return n;
                })(Bo);
                var ll = (function () {
                    function e() {
                        r(this, e);
                        this._funcMap = new Map();
                    }
                    i(e, [
                        {
                            key: 'defense',
                            value: function (e, t) {
                                var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : void 0;
                                if ('string' != typeof e) {
                                    return null;
                                }
                                if (0 === e.length) {
                                    return null;
                                }
                                if ('function' != typeof t) {
                                    return null;
                                }
                                if (this._funcMap.has(e) && this._funcMap.get(e).has(t)) {
                                    return this._funcMap.get(e).get(t);
                                }
                                this._funcMap.has(e) || this._funcMap.set(e, new Map());
                                var r = null;
                                this._funcMap.get(e).has(t) ? (r = this._funcMap.get(e).get(t)) : ((r = this._pack(t, n)), this._funcMap.get(e).set(t, r));
                                return r;
                            }
                        },
                        {
                            key: 'defenseOnce',
                            value: function (e) {
                                var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : void 0;
                                return 'function' != typeof e ? null : this._pack(e, t);
                            }
                        },
                        {
                            key: 'find',
                            value: function (e, t) {
                                return 'string' != typeof e || 0 === e.length || 'function' != typeof t
                                    ? null
                                    : this._funcMap.has(e)
                                    ? this._funcMap.get(e).has(t)
                                        ? this._funcMap.get(e).get(t)
                                        : (J.log('SafetyCallback.find: 找不到 func —— '.concat(e, '/').concat('' !== t.name ? t.name : '[anonymous]')), null)
                                    : (J.log('SafetyCallback.find: 找不到 eventName-'.concat(e, ' 对应的 func')), null);
                            }
                        },
                        {
                            key: 'delete',
                            value: function (e, t) {
                                return (
                                    'function' == typeof t &&
                                    !!this._funcMap.has(e) &&
                                    !!this._funcMap.get(e).has(t) &&
                                    (this._funcMap.get(e).delete(t), 0 === this._funcMap.get(e).size && this._funcMap.delete(e), true)
                                );
                            }
                        },
                        {
                            key: '_pack',
                            value: function (e, t) {
                                return function () {
                                    try {
                                        e.apply(t, Array.from(arguments));
                                    } catch (n) {
                                        console.log('CatchClause', n);
                                        console.log('CatchClause', n);
                                        console.error(n);
                                    }
                                };
                            }
                        }
                    ]);
                    return e;
                })();
                var cl = (function () {
                    function t(e) {
                        r(this, t);
                        var n = new oi();
                        n.setMethod(ii).setStart();
                        Ho.mixin(this);
                        this._initOptions(e);
                        this._initMemberVariables();
                        this._initControllers();
                        this._initListener();
                        oi.bindController(this.eventStatController);
                        n.setCode(0).setText('mp='.concat(O, '-ua=').concat(L)).setEnd();
                        J.info('SDK inWxMiniApp:'.concat(O, ', SDKAppID:').concat(e.SDKAppID, ', UserAgent:').concat(L));
                        this._safetyCallbackFactory = new ll();
                    }
                    i(t, [
                        {
                            key: 'login',
                            value: function (e) {
                                J.time(Xo);
                                this._ssoLog = new oi();
                                this._ssoLog.setMethod(si).setStart();
                                this.netMonitor.start();
                                this.loginInfo.identifier = e.identifier || e.userID;
                                this.loginInfo.userSig = e.userSig;
                                return this.signController.login(this.loginInfo);
                            }
                        },
                        {
                            key: 'logout',
                            value: function () {
                                var e = this.signController.logout();
                                this.resetSDK();
                                return e;
                            }
                        },
                        {
                            key: 'on',
                            value: function (t, n, r) {
                                if (t === e.GROUP_SYSTEM_NOTICE_RECEIVED) {
                                    J.warn(
                                        '！！！TIM.EVENT.GROUP_SYSTEM_NOTICE_RECEIVED v2.6.0起弃用，为了更好的体验，请在 TIM.EVENT.MESSAGE_RECEIVED 事件回调内接收处理群系统通知，详细请参考：https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/Message.html#.GroupSystemNoticePayload'
                                    );
                                }
                                J.debug('on', 'eventName:'.concat(t));
                                this.outerEmitter.on(t, this._safetyCallbackFactory.defense(t, n, r), r);
                            }
                        },
                        {
                            key: 'once',
                            value: function (e, t, n) {
                                J.debug('once', 'eventName:'.concat(e));
                                this.outerEmitter.once(e, this._safetyCallbackFactory.defenseOnce(t, n), n || this);
                            }
                        },
                        {
                            key: 'off',
                            value: function (e, t, n, r) {
                                J.debug('off', 'eventName:'.concat(e));
                                var o = this._safetyCallbackFactory.find(e, t);
                                if (null !== o) {
                                    this.outerEmitter.off(e, o, n, r);
                                    this._safetyCallbackFactory.delete(e, t);
                                }
                            }
                        },
                        {
                            key: 'registerPlugin',
                            value: function (e) {
                                var that = this;
                                this.plugins || (this.plugins = {});
                                Object.keys(e).forEach(function (n) {
                                    that.plugins[n] = e[n];
                                });
                            }
                        },
                        {
                            key: 'getPlugin',
                            value: function (e) {
                                return this.plugins[e] || void 0;
                            }
                        },
                        {
                            key: 'setLogLevel',
                            value: function (e) {
                                if (e <= 0) {
                                    console.log(
                                        [
                                            '',
                                            ' ________  ______  __       __  __       __  ________  _______',
                                            '|        \\|      \\|  \\     /  \\|  \\  _  |  \\|        \\|       \\',
                                            ' \\$$$$$$$$ \\$$$$$$| $$\\   /  $$| $$ / \\ | $$| $$$$$$$$| $$$$$$$\\',
                                            '   | $$     | $$  | $$$\\ /  $$$| $$/  $\\| $$| $$__    | $$__/ $$',
                                            '   | $$     | $$  | $$$$\\  $$$$| $$  $$$\\ $$| $$  \\   | $$    $$',
                                            '   | $$     | $$  | $$\\$$ $$ $$| $$ $$\\$$\\$$| $$$$$   | $$$$$$$\\',
                                            '   | $$    _| $$_ | $$ \\$$$| $$| $$$$  \\$$$$| $$_____ | $$__/ $$',
                                            '   | $$   |   $$ \\| $$  \\$ | $$| $$$    \\$$$| $$     \\| $$    $$',
                                            '    \\$$    \\$$$$$$ \\$$      \\$$ \\$$      \\$$ \\$$$$$$$$ \\$$$$$$$',
                                            '',
                                            ''
                                        ].join('\n')
                                    );
                                    console.log('%cIM 智能客服，随时随地解决您的问题 →_→ https://cloud.tencent.com/act/event/smarty-service?from=im-doc', 'color:#ff0000');
                                    console.log(
                                        [
                                            '',
                                            '参考以下文档，会更快解决问题哦！(#^.^#)\n',
                                            'SDK 更新日志: https://cloud.tencent.com/document/product/269/38492\n',
                                            'SDK 接口文档: https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/SDK.html\n',
                                            '常见问题: https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/tutorial-01-faq.html\n',
                                            '反馈问题？戳我提 issue: https://github.com/tencentyun/TIMSDK/issues\n',
                                            '如果您需要在生产环境关闭上面的日志，请 tim.setLogLevel(1)\n'
                                        ].join('\n')
                                    );
                                }
                                J.setLevel(e);
                            }
                        },
                        {
                            key: 'downloadLog',
                            value: function () {
                                var e = document.createElement('a');
                                var t = new Date();
                                var n = new Blob(this.getLog());
                                e.download =
                                    'TIM-' +
                                    t.getFullYear() +
                                    '-' +
                                    (t.getMonth() + 1) +
                                    '-' +
                                    t.getDate() +
                                    '-' +
                                    this.loginInfo.SDKAppID +
                                    '-' +
                                    this.context.identifier +
                                    '.txt';
                                e.href = URL.createObjectURL(n);
                                e.click();
                                URL.revokeObjectURL(n);
                            }
                        },
                        {
                            key: 'destroy',
                            value: function () {
                                this.logout();
                                this.outerEmitter.emit(e.SDK_DESTROY, {
                                    SDKAppID: this.loginInfo.SDKAppID
                                });
                            }
                        },
                        {
                            key: 'createTextMessage',
                            value: function (e) {
                                return this.messageController.createTextMessage(e);
                            }
                        },
                        {
                            key: 'createImageMessage',
                            value: function (e) {
                                return this.messageController.createImageMessage(e);
                            }
                        },
                        {
                            key: 'createAudioMessage',
                            value: function (e) {
                                return this.messageController.createAudioMessage(e);
                            }
                        },
                        {
                            key: 'createVideoMessage',
                            value: function (e) {
                                return this.messageController.createVideoMessage(e);
                            }
                        },
                        {
                            key: 'createCustomMessage',
                            value: function (e) {
                                return this.messageController.createCustomMessage(e);
                            }
                        },
                        {
                            key: 'createFaceMessage',
                            value: function (e) {
                                return this.messageController.createFaceMessage(e);
                            }
                        },
                        {
                            key: 'createFileMessage',
                            value: function (e) {
                                return this.messageController.createFileMessage(e);
                            }
                        },
                        {
                            key: 'sendMessage',
                            value: function (e) {
                                return e instanceof br
                                    ? this.messageController.sendMessageInstance(e)
                                    : Wo(
                                          new pt({
                                              code: Mt,
                                              message: Ln
                                          })
                                      );
                            }
                        },
                        {
                            key: 'revokeMessage',
                            value: function (e) {
                                return this.messageController.revokeMessage(e);
                            }
                        },
                        {
                            key: 'resendMessage',
                            value: function (e) {
                                return this.messageController.resendMessage(e);
                            }
                        },
                        {
                            key: 'getMessageList',
                            value: function (e) {
                                return this.messageController.getMessageList(e);
                            }
                        },
                        {
                            key: 'setMessageRead',
                            value: function (e) {
                                return this.messageController.setMessageRead(e);
                            }
                        },
                        {
                            key: 'getConversationList',
                            value: function () {
                                return this.conversationController.getConversationList();
                            }
                        },
                        {
                            key: 'getConversationProfile',
                            value: function (e) {
                                return this.conversationController.getConversationProfile(e);
                            }
                        },
                        {
                            key: 'deleteConversation',
                            value: function (e) {
                                return this.conversationController.deleteConversation(e);
                            }
                        },
                        {
                            key: 'getMyProfile',
                            value: function () {
                                return this.userController.getMyProfile();
                            }
                        },
                        {
                            key: 'getUserProfile',
                            value: function (e) {
                                return this.userController.getUserProfile(e);
                            }
                        },
                        {
                            key: 'updateMyProfile',
                            value: function (e) {
                                return this.userController.updateMyProfile(e);
                            }
                        },
                        {
                            key: 'getFriendList',
                            value: function () {
                                return this.userController.getFriendList();
                            }
                        },
                        {
                            key: 'deleteFriend',
                            value: function (e) {
                                return this.userController.deleteFriend(e);
                            }
                        },
                        {
                            key: 'getBlacklist',
                            value: function () {
                                return this.userController.getBlacklist();
                            }
                        },
                        {
                            key: 'addToBlacklist',
                            value: function (e) {
                                return this.userController.addBlacklist(e);
                            }
                        },
                        {
                            key: 'removeFromBlacklist',
                            value: function (e) {
                                return this.userController.deleteBlacklist(e);
                            }
                        },
                        {
                            key: 'getGroupList',
                            value: function (e) {
                                return this.groupController.getGroupList(e);
                            }
                        },
                        {
                            key: 'getGroupProfile',
                            value: function (e) {
                                return this.groupController.getGroupProfile(e);
                            }
                        },
                        {
                            key: 'createGroup',
                            value: function (e) {
                                return this.groupController.createGroup(e);
                            }
                        },
                        {
                            key: 'dismissGroup',
                            value: function (e) {
                                return this.groupController.dismissGroup(e);
                            }
                        },
                        {
                            key: 'updateGroupProfile',
                            value: function (e) {
                                return this.groupController.updateGroupProfile(e);
                            }
                        },
                        {
                            key: 'joinGroup',
                            value: function (e) {
                                return this.groupController.joinGroup(e);
                            }
                        },
                        {
                            key: 'quitGroup',
                            value: function (e) {
                                return this.groupController.quitGroup(e);
                            }
                        },
                        {
                            key: 'searchGroupByID',
                            value: function (e) {
                                return this.groupController.searchGroupByID(e);
                            }
                        },
                        {
                            key: 'changeGroupOwner',
                            value: function (e) {
                                return this.groupController.changeGroupOwner(e);
                            }
                        },
                        {
                            key: 'handleGroupApplication',
                            value: function (e) {
                                return this.groupController.handleGroupApplication(e);
                            }
                        },
                        {
                            key: 'setMessageRemindType',
                            value: function (e) {
                                return this.groupController.setMessageRemindType(e);
                            }
                        },
                        {
                            key: 'getGroupMemberList',
                            value: function (e) {
                                return this.groupController.getGroupMemberList(e);
                            }
                        },
                        {
                            key: 'getGroupMemberProfile',
                            value: function (e) {
                                return this.groupController.getGroupMemberProfile(e);
                            }
                        },
                        {
                            key: 'addGroupMember',
                            value: function (e) {
                                return this.groupController.addGroupMember(e);
                            }
                        },
                        {
                            key: 'deleteGroupMember',
                            value: function (e) {
                                return this.groupController.deleteGroupMember(e);
                            }
                        },
                        {
                            key: 'setGroupMemberMuteTime',
                            value: function (e) {
                                return this.groupController.setGroupMemberMuteTime(e);
                            }
                        },
                        {
                            key: 'setGroupMemberRole',
                            value: function (e) {
                                return this.groupController.setGroupMemberRole(e);
                            }
                        },
                        {
                            key: 'setGroupMemberNameCard',
                            value: function (e) {
                                return this.groupController.setGroupMemberNameCard(e);
                            }
                        },
                        {
                            key: 'setGroupMemberCustomField',
                            value: function (e) {
                                return this.groupController.setGroupMemberCustomField(e);
                            }
                        },
                        {
                            key: '_initOptions',
                            value: function (e) {
                                this.plugins = {};
                                var t = e.SDKAppID || 0;
                                var n = me();
                                this.context = {
                                    SDKAppID: t,
                                    accountType: n
                                };
                                this.loginInfo = {
                                    SDKAppID: t,
                                    accountType: n,
                                    identifier: null,
                                    userSig: null
                                };
                                this.options = {
                                    runLoopNetType: e.runLoopNetType || Xe,
                                    enablePointer: e.enablePointer || false
                                };
                            }
                        },
                        {
                            key: '_initMemberVariables',
                            value: function () {
                                this.innerEmitter = new bu();
                                this.outerEmitter = new bu();
                                Yo(this.outerEmitter);
                                this.packageConfig = new Gu(this);
                                this.storage = new Nu(this);
                                this.netMonitor = new il();
                                this.outerEmitter._emit = this.outerEmitter.emit;
                                this.outerEmitter.emit = function (e, t) {
                                    var n = arguments[0];
                                    var r = [
                                        n,
                                        {
                                            name: arguments[0],
                                            data: arguments[1]
                                        }
                                    ];
                                    J.debug('emit outer event:'.concat(n), r[1]);
                                    this.outerEmitter._emit.apply(this.outerEmitter, r);
                                }.bind(this);
                                this.innerEmitter._emit = this.innerEmitter.emit;
                                this.innerEmitter.emit = function (e, t) {
                                    var n;
                                    ne(arguments[1]) && arguments[1].data
                                        ? (J.warn('inner eventData has data property, please check!'),
                                          (n = [
                                              e,
                                              {
                                                  name: arguments[0],
                                                  data: arguments[1].data
                                              }
                                          ]))
                                        : (n = [
                                              e,
                                              {
                                                  name: arguments[0],
                                                  data: arguments[1]
                                              }
                                          ]);
                                    J.debug('emit inner event:'.concat(e), n[1]);
                                    this.innerEmitter._emit.apply(this.innerEmitter, n);
                                }.bind(this);
                            }
                        },
                        {
                            key: '_initControllers',
                            value: function () {
                                this.exceptionController = new ru(this);
                                this.connectionController = new nu(this);
                                this.contextController = new Ko(this);
                                this.context = this.contextController.getContext();
                                this.signController = new Hi(this);
                                this.messageController = new Du(this);
                                this.conversationController = new yu(this);
                                this.userController = new hu(this);
                                this.groupController = new Ru(this);
                                this.notificationController = new Fu(this);
                                this.bigDataHallwayController = new Bu(this);
                                this.statusController = new Ou(this);
                                this.uploadController = new Hu(this);
                                this.eventStatController = new nl(this);
                                this.sumStatController = new ul(this);
                                this.mtaReportController = new el(this);
                                this._initReadyListener();
                            }
                        },
                        {
                            key: '_initListener',
                            value: function () {
                                var that = this;
                                this.innerEmitter.on(uo, this._onSlowStart, this);
                                if (O && 'function' == typeof uni.onAppShow && 'function' == typeof uni.onAppHide) {
                                    var t = null;
                                    uni.onAppHide(function () {
                                        (t = new oi()).setMethod(Fi).setStart();
                                    });
                                    uni.onAppShow(function () {
                                        if (null !== t) {
                                            t.setCode(0).setNetworkType(that.netMonitor.getNetworkType()).setEnd();
                                        }
                                    });
                                }
                            }
                        },
                        {
                            key: '_initReadyListener',
                            value: function () {
                                for (var that = this, t = this.readyList, n = 0, r = t.length; n < r; n++) {
                                    this[t[n]].ready(function () {
                                        return that._readyHandle();
                                    });
                                }
                            }
                        },
                        {
                            key: '_onSlowStart',
                            value: function () {
                                J.log('slow start longpolling...');
                                this.resetSDK();
                                this.login(this.loginInfo);
                            }
                        },
                        {
                            key: 'resetSDK',
                            value: function () {
                                var that = this;
                                this.initList.forEach(function (e) {
                                    if (that[e].reset) {
                                        that[e].reset();
                                    }
                                });
                                this.netMonitor.reset();
                                this.storage.reset();
                                this.resetReady();
                                this._initReadyListener();
                                this.outerEmitter.emit(e.SDK_NOT_READY);
                            }
                        },
                        {
                            key: '_readyHandle',
                            value: function () {
                                for (var t = this.readyList, n = true, r = 0, o = t.length; r < o; r++) {
                                    if (!this[t[r]].isReady()) {
                                        n = false;
                                        break;
                                    }
                                }
                                if (n) {
                                    var i = J.timeEnd(Xo);
                                    J.warn('SDK is ready. cost='.concat(i, 'ms'));
                                    this.triggerReady();
                                    this.innerEmitter.emit(Po);
                                    this.outerEmitter.emit(e.SDK_READY);
                                    this._ssoLog.setCode(0).setNetworkType(this.netMonitor.getNetworkType()).setText(i).setEnd();
                                }
                            }
                        }
                    ]);
                    return t;
                })();
                cl.prototype.readyList = ['conversationController'];
                cl.prototype.initList = [
                    'exceptionController',
                    'connectionController',
                    'signController',
                    'contextController',
                    'messageController',
                    'conversationController',
                    'userController',
                    'groupController',
                    'notificationController',
                    'eventStatController',
                    'sumStatController'
                ];
                var pl = {
                    login: 'login',
                    on: 'on',
                    off: 'off',
                    ready: 'ready',
                    setLogLevel: 'setLogLevel',
                    joinGroup: 'joinGroup',
                    quitGroup: 'quitGroup',
                    registerPlugin: 'registerPlugin'
                };
                function hl(e, t) {
                    return (
                        !(!e.isReady() && void 0 === pl[t]) ||
                        (e.innerEmitter.emit(
                            Ao,
                            new pt({
                                code: _n,
                                message: ''.concat(t, ' ').concat(Er, '，请参考 https://imsdk-1252463788.file.myqcloud.com/IM_DOC/Web/module-EVENT.html#.SDK_READY')
                            })
                        ),
                        false)
                    );
                }
                var fl = {};
                var dl = {};
                dl.create = function (t) {
                    if (t.SDKAppID && fl[t.SDKAppID]) {
                        return fl[t.SDKAppID];
                    }
                    J.log('TIM.create');
                    var n = new cl(t);
                    n.on(e.SDK_DESTROY, function (e) {
                        fl[e.data.SDKAppID] = null;
                        delete fl[e.data.SDKAppID];
                    });
                    var r = (function (e) {
                        var t = Object.create(null);
                        Object.keys(Ur).forEach(function (n) {
                            if (e[n]) {
                                var r = Ur[n];
                                var o = new S();
                                t[r] = function () {
                                    var t = Array.from(arguments);
                                    o.use(function (t, r) {
                                        if (hl(e, n)) {
                                            return r();
                                        }
                                    })
                                        .use(function (e, t) {
                                            if (true === Re(e, Gr[n], r)) {
                                                return t();
                                            }
                                        })
                                        .use(function (t, r) {
                                            return e[n].apply(e, t);
                                        });
                                    return o.run(t);
                                };
                            }
                        });
                        return t;
                    })(n);
                    fl[t.SDKAppID] = r;
                    J.log('TIM.create ok');
                    return r;
                };
                dl.TYPES = t;
                dl.EVENT = e;
                dl.VERSION = '2.6.2';
                J.log('TIM.VERSION: '.concat(dl.VERSION));
                return dl;
            });
        },
        function (modId) {
            var map = {};
            return __REQUIRE__(map[modId], modId);
        }
    );
    return __REQUIRE__(1775630722878);
})();
//miniprogram-npm-outsideDeps=[]
//# sourceMappingURL=index.js.map
