From 12437feec2c6ccfc7e8792b1ecc3fb2f8df5669b Mon Sep 17 00:00:00 2001 From: sx <2427911852@qq.com> Date: Sat, 15 Feb 2025 16:21:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 + .../cache/.vite/deps/@tencentcloud_chat.js | 10519 ++++++++++++++++ ...centcloud_chat_modules_group-module__js.js | 3339 +++++ ...cloud_chat_modules_group-module__js.js.map | 7 + .../dist/cache/.vite/deps/_metadata.json | 37 + .../dist/cache/.vite/deps/crypto-js.js | 6591 ++++++++++ .../dist/cache/.vite/deps/crypto-js.js.map | 7 + .../cache/.vite/deps/tim-upload-plugin.js | 242 + .../cache/.vite/deps/tim-upload-plugin.js.map | 7 + 9 files changed, 20753 insertions(+) create mode 100644 .gitignore create mode 100644 jiuyi2/unpackage/dist/cache/.vite/deps/@tencentcloud_chat.js create mode 100644 jiuyi2/unpackage/dist/cache/.vite/deps/@tencentcloud_chat_modules_group-module__js.js create mode 100644 jiuyi2/unpackage/dist/cache/.vite/deps/@tencentcloud_chat_modules_group-module__js.js.map create mode 100644 jiuyi2/unpackage/dist/cache/.vite/deps/_metadata.json create mode 100644 jiuyi2/unpackage/dist/cache/.vite/deps/crypto-js.js create mode 100644 jiuyi2/unpackage/dist/cache/.vite/deps/crypto-js.js.map create mode 100644 jiuyi2/unpackage/dist/cache/.vite/deps/tim-upload-plugin.js create mode 100644 jiuyi2/unpackage/dist/cache/.vite/deps/tim-upload-plugin.js.map diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..5d630ad2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/jiuyi2/unpackage +/jiuyi/unpackage +/jiuyi2/.hbuilderx +/jiuyi/.hbuilderx \ No newline at end of file diff --git a/jiuyi2/unpackage/dist/cache/.vite/deps/@tencentcloud_chat.js b/jiuyi2/unpackage/dist/cache/.vite/deps/@tencentcloud_chat.js new file mode 100644 index 00000000..47f4e6ad --- /dev/null +++ b/jiuyi2/unpackage/dist/cache/.vite/deps/@tencentcloud_chat.js @@ -0,0 +1,10519 @@ +import { + __commonJS +} from "./chunk-TDUMLE5V.js"; + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/@tencentcloud/chat/index.js +var require_chat = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/@tencentcloud/chat/index.js"(exports, module) { + !function(e, t) { + "object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).TencentCloudChat = t(); + }(exports, function() { + function U(t2, e2) { + var n2, o2 = Object.keys(t2); + return Object.getOwnPropertySymbols && (n2 = Object.getOwnPropertySymbols(t2), e2 && (n2 = n2.filter(function(e3) { + return Object.getOwnPropertyDescriptor(t2, e3).enumerable; + })), o2.push.apply(o2, n2)), o2; + } + function y(t2) { + for (var e2 = 1; e2 < arguments.length; e2++) { + var n2 = null != arguments[e2] ? arguments[e2] : {}; + e2 % 2 ? U(Object(n2), true).forEach(function(e3) { + F(t2, e3, n2[e3]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t2, Object.getOwnPropertyDescriptors(n2)) : U(Object(n2)).forEach(function(e3) { + Object.defineProperty(t2, e3, Object.getOwnPropertyDescriptor(n2, e3)); + }); + } + return t2; + } + function b(e2) { + return (b = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e3) { + return typeof e3; + } : function(e3) { + return e3 && "function" == typeof Symbol && e3.constructor === Symbol && e3 !== Symbol.prototype ? "symbol" : typeof e3; + })(e2); + } + function d(e2, t2) { + if (!(e2 instanceof t2)) + throw new TypeError("Cannot call a class as a function"); + } + function w(e2, t2) { + for (var n2 = 0; n2 < t2.length; n2++) { + var o2 = t2[n2]; + o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e2, o2.key, o2); + } + } + function e(e2, t2, n2) { + return t2 && w(e2.prototype, t2), n2 && w(e2, n2), Object.defineProperty(e2, "prototype", { writable: false }), e2; + } + function F(e2, t2, n2) { + return t2 in e2 ? Object.defineProperty(e2, t2, { value: n2, enumerable: true, configurable: true, writable: true }) : e2[t2] = n2, e2; + } + function t(e2, t2) { + if ("function" != typeof t2 && null !== t2) + throw new TypeError("Super expression must either be null or a function"); + e2.prototype = Object.create(t2 && t2.prototype, { constructor: { value: e2, writable: true, configurable: true } }), Object.defineProperty(e2, "prototype", { writable: false }), t2 && x(e2, t2); + } + function q(e2) { + return (q = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e3) { + return e3.__proto__ || Object.getPrototypeOf(e3); + })(e2); + } + function x(e2, t2) { + return (x = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e3, t3) { + return e3.__proto__ = t3, e3; + })(e2, t2); + } + function V() { + if ("undefined" == typeof Reflect || !Reflect.construct) + return false; + if (Reflect.construct.sham) + return false; + if ("function" == typeof Proxy) + return true; + try { + return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { + })), true; + } catch (e2) { + return false; + } + } + function H(e2, t2, n2) { + return (H = V() ? Reflect.construct.bind() : function(e3, t3, n3) { + var o2 = [null], t3 = (o2.push.apply(o2, t3), new (Function.bind.apply(e3, o2))()); + return n3 && x(t3, n3.prototype), t3; + }).apply(null, arguments); + } + function B(e2) { + var n2 = "function" == typeof Map ? /* @__PURE__ */ new Map() : void 0; + return function(e3) { + if (null === e3 || -1 === Function.toString.call(e3).indexOf("[native code]")) + return e3; + if ("function" != typeof e3) + throw new TypeError("Super expression must either be null or a function"); + if (void 0 !== n2) { + if (n2.has(e3)) + return n2.get(e3); + n2.set(e3, t2); + } + function t2() { + return H(e3, arguments, q(this).constructor); + } + return t2.prototype = Object.create(e3.prototype, { constructor: { value: t2, enumerable: false, writable: true, configurable: true } }), x(t2, e3); + }(e2); + } + function K(e2, t2) { + if (null == e2) + return {}; + var n2, o2 = function(e3, t3) { + if (null == e3) + return {}; + for (var n3, o3 = {}, i3 = Object.keys(e3), a3 = 0; a3 < i3.length; a3++) + n3 = i3[a3], 0 <= t3.indexOf(n3) || (o3[n3] = e3[n3]); + return o3; + }(e2, t2); + if (Object.getOwnPropertySymbols) + for (var i2 = Object.getOwnPropertySymbols(e2), a2 = 0; a2 < i2.length; a2++) + n2 = i2[a2], 0 <= t2.indexOf(n2) || Object.prototype.propertyIsEnumerable.call(e2, n2) && (o2[n2] = e2[n2]); + return o2; + } + function i(e2) { + if (void 0 === e2) + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + return e2; + } + function n(n2) { + var o2 = V(); + return function() { + var e2, t2 = q(n2), t2 = (e2 = o2 ? (e2 = q(this).constructor, Reflect.construct(t2, arguments, e2)) : t2.apply(this, arguments), this); + if (e2 && ("object" == typeof e2 || "function" == typeof e2)) + return e2; + if (void 0 !== e2) + throw new TypeError("Derived constructors may only return object or undefined"); + return i(t2); + }; + } + function Y(e2, t2) { + return W(e2) || function(e3, t3) { + var n2 = null == e3 ? null : "undefined" != typeof Symbol && e3[Symbol.iterator] || e3["@@iterator"]; + if (null != n2) { + var o2, i2, a2 = [], s2 = true, r2 = false; + try { + for (n2 = n2.call(e3); !(s2 = (o2 = n2.next()).done) && (a2.push(o2.value), !t3 || a2.length !== t3); s2 = true) + ; + } catch (e4) { + r2 = true, i2 = e4; + } finally { + try { + s2 || null == n2.return || n2.return(); + } finally { + if (r2) + throw i2; + } + } + return a2; + } + }(e2, t2) || J(e2, t2) || X(); + } + function p(e2) { + return function(e3) { + if (Array.isArray(e3)) + return z(e3); + }(e2) || j(e2) || J(e2) || 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 W(e2) { + if (Array.isArray(e2)) + return e2; + } + function j(e2) { + if ("undefined" != typeof Symbol && null != e2[Symbol.iterator] || null != e2["@@iterator"]) + return Array.from(e2); + } + function J(e2, t2) { + var n2; + if (e2) + return "string" == typeof e2 ? z(e2, t2) : "Map" === (n2 = "Object" === (n2 = Object.prototype.toString.call(e2).slice(8, -1)) && e2.constructor ? e2.constructor.name : n2) || "Set" === n2 ? Array.from(e2) : "Arguments" === n2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2) ? z(e2, t2) : void 0; + } + function z(e2, t2) { + (null == t2 || t2 > e2.length) && (t2 = e2.length); + for (var n2 = 0, o2 = new Array(t2); n2 < t2; n2++) + o2[n2] = e2[n2]; + return o2; + } + function X() { + 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 Z(e2, t2) { + var n2, o2, i2, a2, s2 = "undefined" != typeof Symbol && e2[Symbol.iterator] || e2["@@iterator"]; + if (s2) + return i2 = !(o2 = true), { s: function() { + s2 = s2.call(e2); + }, n: function() { + var e3 = s2.next(); + return o2 = e3.done, e3; + }, e: function(e3) { + i2 = true, n2 = e3; + }, f: function() { + try { + o2 || null == s2.return || s2.return(); + } finally { + if (i2) + throw n2; + } + } }; + if (Array.isArray(e2) || (s2 = J(e2)) || t2 && e2 && "number" == typeof e2.length) + return s2 && (e2 = s2), a2 = 0, { s: t2 = function() { + }, n: function() { + return a2 >= e2.length ? { done: true } : { done: false, value: e2[a2++] }; + }, e: function(e3) { + throw e3; + }, f: t2 }; + 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 h = { SDK_READY: "sdkStateReady", SDK_NOT_READY: "sdkStateNotReady", SDK_DESTROY: "sdkDestroy", MESSAGE_RECEIVED: "onMessageReceived", ROOM_CUSTOM_DATA_RECEIVED: "onRoomCustomDataReceived", MESSAGE_MODIFIED: "onMessageModified", MESSAGE_REVOKED: "onMessageRevoked", MESSAGE_READ_BY_PEER: "onMessageReadByPeer", MESSAGE_READ_RECEIPT_RECEIVED: "onMessageReadReceiptReceived", MESSAGE_EXTENSIONS_UPDATED: "onMessageExtensionsUpdated", MESSAGE_EXTENSIONS_DELETED: "onMessageExtensionsDeleted", MESSAGE_REACTIONS_UPDATED: "onMessageReactionsUpdated", CONVERSATION_LIST_UPDATED: "onConversationListUpdated", TOTAL_UNREAD_MESSAGE_COUNT_UPDATED: "onTotalUnreadMessageCountUpdated", CONVERSATION_GROUP_LIST_UPDATED: "onConversationGroupListUpdated", CONVERSATION_IN_GROUP_UPDATED: "onConversationInGroupUpdated", GROUP_LIST_UPDATED: "onGroupListUpdated", GROUP_ATTRIBUTES_UPDATED: "groupAttributesUpdated", GROUP_COUNTER_UPDATED: "onGroupCounterUpdated", TOPIC_CREATED: "onTopicCreated", TOPIC_DELETED: "onTopicDeleted", TOPIC_UPDATED: "onTopicUpdated", PROFILE_UPDATED: "onProfileUpdated", USER_STATUS_UPDATED: "onUserStatusUpdated", BLACKLIST_UPDATED: "blacklistUpdated", FRIEND_LIST_UPDATED: "onFriendListUpdated", FRIEND_GROUP_LIST_UPDATED: "onFriendGroupListUpdated", FRIEND_APPLICATION_LIST_UPDATED: "onFriendApplicationListUpdated", MY_FOLLOWERS_LIST_UPDATED: "onMyFollowersListUpdated", MY_FOLLOWING_LIST_UPDATED: "onMyFollowingListUpdated", MUTUAL_FOLLOWERS_LIST_UPDATED: "onMutualFollowersListUpdated", KICKED_OUT: "kickedOut", ERROR: "error", NET_STATE_CHANGE: "netStateChange", ALL_RECEIVE_MESSAGE_OPT_UPDATED: "onAllReceiveMessageOptUpdated" }, A = { MSG_TEXT: "TIMTextElem", MSG_IMAGE: "TIMImageElem", MSG_SOUND: "TIMSoundElem", MSG_AUDIO: "TIMSoundElem", MSG_FILE: "TIMFileElem", MSG_FACE: "TIMFaceElem", MSG_VIDEO: "TIMVideoFileElem", MSG_GEO: "TIMLocationElem", MSG_LOCATION: "TIMLocationElem", MSG_GRP_TIP: "TIMGroupTipElem", MSG_GRP_SYS_NOTICE: "TIMGroupSystemNoticeElem", MSG_CUSTOM: "TIMCustomElem", MSG_MERGER: "TIMRelayElem", MSG_PRIORITY_HIGH: "High", MSG_PRIORITY_NORMAL: "Normal", MSG_PRIORITY_LOW: "Low", MSG_PRIORITY_LOWEST: "Lowest", CONV_C2C: "C2C", CONV_GROUP: "GROUP", CONV_TOPIC: "TOPIC", CONV_SYSTEM: "@TIM#SYSTEM", CONV_AT_ME: 1, CONV_AT_ALL: 2, CONV_AT_ALL_AT_ME: 3, CONV_MARK_TYPE_STAR: 1, CONV_MARK_TYPE_UNREAD: 2, CONV_MARK_TYPE_FOLD: 4, CONV_MARK_TYPE_HIDE: 8, GRP_PRIVATE: "Private", GRP_WORK: "Private", GRP_PUBLIC: "Public", GRP_CHATROOM: "ChatRoom", GRP_MEETING: "ChatRoom", GRP_AVCHATROOM: "AVChatRoom", GRP_COMMUNITY: "Community", GRP_ROOM: "Room", GRP_LIVE: "Live", GRP_MBR_ROLE_OWNER: "Owner", GRP_MBR_ROLE_ADMIN: "Admin", GRP_MBR_ROLE_MEMBER: "Member", GRP_MBR_ROLE_CUSTOM: "Custom", GRP_TIP_MBR_JOIN: 1, GRP_TIP_MBR_QUIT: 2, GRP_TIP_MBR_KICKED_OUT: 3, GRP_TIP_MBR_SET_ADMIN: 4, GRP_TIP_MBR_CANCELED_ADMIN: 5, GRP_TIP_GRP_PROFILE_UPDATED: 6, GRP_TIP_MBR_PROFILE_UPDATED: 7, GRP_TIP_BAN_AVCHATROOM_MEMBER: 10, GRP_TIP_UNBAN_AVCHATROOM_MEMBER: 11, MSG_REMIND_ACPT_AND_NOTE: "AcceptAndNotify", MSG_REMIND_ACPT_NOT_NOTE: "AcceptNotNotify", MSG_REMIND_DISCARD: "Discard", RECEIVE_WITH_OFFLINE_PUSH_EXCEPT_AT: "AcceptNotNotifyExceptAt", NOT_RECEIVE_OFFLINE_PUSH_EXCEPT_AT: "AcceptNotNotifyExceptAt", NOT_RECEIVE_MSG_EXCEPT_AT: "NotReceiveMsgExceptAt", GENDER_UNKNOWN: "Gender_Type_Unknown", GENDER_FEMALE: "Gender_Type_Female", GENDER_MALE: "Gender_Type_Male", KICKED_OUT_MULT_ACCOUNT: "multipleAccount", KICKED_OUT_MULT_DEVICE: "multipleDevice", KICKED_OUT_USERSIG_EXPIRED: "userSigExpired", KICKED_OUT_REST_API: "REST_API_Kick", ALLOW_TYPE_ALLOW_ANY: "AllowType_Type_AllowAny", ALLOW_TYPE_NEED_CONFIRM: "AllowType_Type_NeedConfirm", ALLOW_TYPE_DENY_ANY: "AllowType_Type_DenyAny", FORBID_TYPE_NONE: "AdminForbid_Type_None", FORBID_TYPE_SEND_OUT: "AdminForbid_Type_SendOut", JOIN_OPTIONS_FREE_ACCESS: "FreeAccess", JOIN_OPTIONS_NEED_PERMISSION: "NeedPermission", JOIN_OPTIONS_DISABLE_APPLY: "DisableApply", JOIN_STATUS_SUCCESS: "JoinedSuccess", JOIN_STATUS_ALREADY_IN_GROUP: "AlreadyInGroup", JOIN_STATUS_WAIT_APPROVAL: "WaitAdminApproval", INVITE_OPTIONS_DISABLE_INVITE: "DisableInvite", INVITE_OPTIONS_NEED_PERMISSION: "NeedPermission", INVITE_OPTIONS_FREE_ACCESS: "FreeAccess", GRP_PROFILE_OWNER_ID: "ownerID", GRP_PROFILE_CREATE_TIME: "createTime", GRP_PROFILE_LAST_INFO_TIME: "lastInfoTime", GRP_PROFILE_MEMBER_NUM: "memberNum", GRP_PROFILE_MAX_MEMBER_NUM: "maxMemberNum", GRP_PROFILE_JOIN_OPTION: "joinOption", GRP_PROFILE_INVITE_OPTION: "inviteOption", GRP_PROFILE_INTRODUCTION: "introduction", GRP_PROFILE_NOTIFICATION: "notification", GRP_PROFILE_MUTE_ALL_MBRS: "muteAllMembers", SNS_ADD_TYPE_SINGLE: "Add_Type_Single", SNS_ADD_TYPE_BOTH: "Add_Type_Both", SNS_DELETE_TYPE_SINGLE: "Delete_Type_Single", SNS_DELETE_TYPE_BOTH: "Delete_Type_Both", SNS_APPLICATION_TYPE_BOTH: "Pendency_Type_Both", SNS_APPLICATION_SENT_TO_ME: "Pendency_Type_ComeIn", SNS_APPLICATION_SENT_BY_ME: "Pendency_Type_SendOut", SNS_APPLICATION_AGREE: "Response_Action_Agree", SNS_APPLICATION_AGREE_AND_ADD: "Response_Action_AgreeAndAdd", SNS_CHECK_TYPE_BOTH: "CheckResult_Type_Both", SNS_CHECK_TYPE_SINGLE: "CheckResult_Type_Single", SNS_TYPE_NO_RELATION: "CheckResult_Type_NoRelation", SNS_TYPE_A_WITH_B: "CheckResult_Type_AWithB", SNS_TYPE_B_WITH_A: "CheckResult_Type_BWithA", SNS_TYPE_BOTH_WAY: "CheckResult_Type_BothWay", NET_STATE_CONNECTED: "connected", NET_STATE_CONNECTING: "connecting", NET_STATE_DISCONNECTED: "disconnected", MSG_AT_ALL: "__kImSDK_MesssageAtALL__", READ_ALL_C2C_MSG: "readAllC2CMessage", READ_ALL_GROUP_MSG: "readAllGroupMessage", READ_ALL_MSG: "readAllMessage", USER_STATUS_UNKNOWN: 0, USER_STATUS_ONLINE: 1, USER_STATUS_OFFLINE: 2, USER_STATUS_UNLOGINED: 3, IOS_OFFLINE_PUSH_NO_SOUND: "push.no_sound", IOS_OFFLINE_PUSH_DEFAULT_SOUND: "default" }, Q = { NEW_INVITATION_RECEIVED: "newInvitationReceived", INVITEE_ACCEPTED: "ts_invitee_accepted", INVITEE_REJECTED: "ts_invitee_rejected", INVITATION_CANCELLED: "ts_invitation_cancelled", INVITATION_TIMEOUT: "ts_invitation_timeout", INVITATION_MODIFIED: "ts_invitation_modified", ACTION_TYPE_UNKNOWN: 0, ACTION_TYPE_INVITE: 1, ACTION_TYPE_CANCEL_INVITE: 2, ACTION_TYPE_ACCEPT_INVITE: 3, ACTION_TYPE_REJECT_INVITE: 4, ACTION_TYPE_INVITE_TIMEOUT: 5 }, $ = (e(de, [{ key: "use", value: function(e2) { + if ("function" != typeof e2) + throw "middleware must be a function"; + return this.cache.push(e2), this; + } }, { key: "next", value: function(e2) { + if (this.middlewares && 0 < this.middlewares.length) + return this.middlewares.shift().call(this, this.options, this.next.bind(this)); + } }, { key: "run", value: function(e2) { + return this.middlewares = this.cache.map(function(e3) { + return e3; + }), this.options = e2, this.next(); + } }]), de), ee = (e(le, [{ key: "equal", value: function(e2) { + return null !== e2 && this.low === e2.low && this.high === e2.high; + } }, { key: "toString", value: function() { + var e2 = Number(this.high).toString(16), t2 = Number(this.low).toString(16); + if (t2.length < 8) + for (var n2 = 8 - t2.length; n2; ) + t2 = "0" + t2, n2--; + return e2 + t2; + } }]), le), te = { TEST: { CHINA: { DEFAULT: "wss://wss-dev.tim.qq.com" }, OVERSEA: { DEFAULT: "wss://wss-dev.tim.qq.com" }, SINGAPORE: { DEFAULT: "wss://wsssgp-dev.im.qcloud.com" }, KOREA: { DEFAULT: "wss://wsskr-dev.im.qcloud.com" }, GERMANY: { DEFAULT: "wss://wssger-dev.im.qcloud.com" }, IND: { DEFAULT: "wss://wssind-dev.im.qcloud.com" }, JPN: { DEFAULT: "wss://wssjpn-dev.im.qcloud.com" }, USA: { DEFAULT: "wss://wssusa-dev.im.qcloud.com" }, INDONESIA: { DEFAULT: "wss://wssidn-dev.im.qcloud.com" } }, PRODUCTION: { CHINA: { DEFAULT0: "wss://*w4c.my-imcloud.com", DEFAULT: "wss://wss.im.qcloud.com", BACKUP: "wss://wss.tim.qq.com", STAT: "https://events.im.qcloud.com", ANYCAST: "wss://162.14.13.203" }, OVERSEA: { DEFAULT0: "wss://*w4c.my-imcloud.com", DEFAULT: "wss://wss.im.qcloud.com", BACKUP: "wss://wss.my-imcloud.com", STAT: "https://api.my-imcloud.com" }, SINGAPORE: { DEFAULT0: "wss://*w4s.my-imcloud.com", DEFAULT: "wss://wsssgp.im.qcloud.com", BACKUP: "wss://wsssgp.my-imcloud.com", STAT: "https://apisgp.my-imcloud.com", ANYCAST: "wss://162.14.19.159" }, KOREA: { DEFAULT0: "wss://*w4k.my-imcloud.com", DEFAULT: "wss://wsskr.im.qcloud.com", BACKUP: "wss://wsskr.my-imcloud.com", STAT: "https://apikr.my-imcloud.com", ANYCAST: "wss://162.14.13.104" }, GERMANY: { DEFAULT0: "wss://*w4g.my-imcloud.com", DEFAULT: "wss://wssger.im.qcloud.com", BACKUP: "wss://wssger.my-imcloud.com", STAT: "https://apiger.my-imcloud.com", ANYCAST: "wss://162.14.3.17" }, IND: { DEFAULT0: "wss://*w4i.my-imcloud.com", DEFAULT: "wss://wssind.my-imcloud.com", BACKUP: "wss://wssind.im.qcloud.com", STAT: "https://apiind.my-imcloud.com", ANYCAST: "wss://162.14.18.188" }, JPN: { DEFAULT0: "wss://*w4j.my-imcloud.com", DEFAULT: "wss://wssjpn.im.qcloud.com", BACKUP: "wss://wssjpn.my-imcloud.com", STAT: "https://apijpn.my-imcloud.com" }, USA: { DEFAULT0: "wss://*w4u.my-imcloud.com", DEFAULT: "wss://wssusa.im.qcloud.com", BACKUP: "wss://wssusa.my-imcloud.com", STAT: "https://apiusa.my-imcloud.com", ANYCAST: "wss://162.14.10.42" }, INDONESIA: { DEFAULT0: "wss://*w4y.my-imcloud.com", DEFAULT: "wss://wssidn.im.qcloud.com", BACKUP: "wss://wssidn.my-imcloud.com", STAT: "https://apiidn.my-imcloud.com", ANYCAST: "wss://43.129.34.169" } } }, ne = { ANDROID: 2, IOS: 3, MAC: 4, WEB: 7, WX_MP: 8, QQ_MP: 9, TT_MP: 10, BAIDU_MP: 11, ALI_MP: 12, IPAD: 13, UNI_NATIVE_APP: 15, DONUT_NATIVE_APP: 19, NS_NATIVE_APP: 20, RN_NATIVE_APP: 21 }, oe = "1.7.3", ae = 537048168, se = "CHINA", a = { HOST: { CURRENT: { DEFAULT: "wss://wss.im.qcloud.com", STAT: "https://events.im.qcloud.com" }, setCurrent: function() { + this.CURRENT = te.PRODUCTION[0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : se]; + } }, NAME: { OPEN_IM: "openim", OPEN_IM_MSG_EXT: "openim_msg_ext_http_svc", GRP: "group_open_http_svc", GRP_AV: "group_open_avchatroom_http_svc", GRP_COMMUNITY: "million_group_open_http_svc", GRP_ATTR: "group_open_attr_http_svc", FD: "sns", PROFILE: "profile", RECENT_CONTACT: "recentcontact", PIC: "openpic", BIG_GRP_NO_AUTH: "group_open_http_noauth_svc", BIG_GRP_POLLING: "group_open_long_polling_http_svc", BIG_GRP_POLLING_NO_AUTH: "group_open_long_polling_http_noauth_svc", IM_OPEN_STAT: "imopenstat", WEB_IM: "webim", IM_COS_SIGN: "im_cos_sign_svr", CUSTOM_UPLOAD: "im_cos_msg", HEARTBEAT: "heartbeat", IM_OPEN_PUSH: "im_open_push", IM_OPEN_STATUS: "im_open_status", IM_LONG_MSG: "im_long_msg", IM_CONFIG_MANAGER: "im_sdk_config_mgr", STAT_SERVICE: "StatSvc", OVERLOAD_PUSH: "OverLoadPush", IM_MSG_AUDIT_MGR: "im_msg_audit_mgr", TUIROOM_SVR: "tui_room_svr", IM_OPEN_TRANSLATE: "im_open_translate", IM_OPEN_SPEECH: "im_open_speech", MSG_SEARCH: "message_search", FOLLOW: "follow", OFFLINE_PUSH_REPORT: "offline_push_report", IM_MSG_LOGIC: "im_msg_db_logic" } }, _ = { SEARCH_GRP_SNS: new ee(0, Math.pow(2, 1)).toString(), AV_HISTORY_MSG: new ee(0, Math.pow(2, 2)).toString(), GRP_COMMUNITY: new ee(0, Math.pow(2, 3)).toString(), MSG_TO_SPECIFIED_GRP_MBR: new ee(0, Math.pow(2, 4)).toString(), AV_MBR_LIST: new ee(0, Math.pow(2, 6)).toString(), USER_STATUS: new ee(0, Math.pow(2, 7)).toString(), CONV_MARK: new ee(0, Math.pow(2, 9)).toString(), CONV_GROUP: new ee(0, Math.pow(2, 10)).toString(), AV_BAN_MBR: new ee(0, Math.pow(2, 11)).toString(), MSG_EXT: new ee(0, Math.pow(2, 13)).toString(), GRP_COUNTER: new ee(0, Math.pow(2, 15)).toString(), PLUGIN_TRANSLATE: new ee(Math.pow(2, 6)).toString(), PLUGIN_VOICE_TO_TEXT: new ee(Math.pow(2, 7)).toString(), PLUGIN_CS: new ee(Math.pow(2, 8)).toString(), PLUGIN_PUSH: new ee(Math.pow(2, 9)).toString(), PLUGIN_BOT: new ee(Math.pow(2, 10)).toString(), MSG_REACTION: new ee(Math.pow(2, 16)).toString(), FOLLOW: new ee(Math.pow(2, 20)).toString() }, re = "group_profile", ce = ["Type", "Name", "Introduction", "Notification", "FaceUrl", "Owner_Account", "CreateTime", "InfoSeq", "LastInfoTime", "LastMsgTime", "MemberNum", "MaxMemberNum", "ApplyJoinOption", "NextMsgSeq", "ShutUpAllMember", "InviteJoinOption"], ue = ["Role", "JoinTime", "MsgSeq", "MsgFlag"]; + function le() { + var e2 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : 0, t2 = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : 0; + d(this, le), this.high = e2, this.low = t2; + } + function de() { + d(this, de), this.cache = [], this.options = null; + } + a.HOST.setCurrent(se); + for (var pe, _e = "undefined" != typeof wx && "function" == typeof wx.getSystemInfoSync && Boolean(wx.getSystemInfoSync().fontSizeSetting), he = _e && "function" == typeof wx.createGamePortal, ge = "undefined" != typeof qq && "function" == typeof qq.getSystemInfoSync && Boolean(qq.getSystemInfoSync().fontSizeSetting), fe = "undefined" != typeof tt && "function" == typeof tt.getSystemInfoSync && Boolean(tt.getSystemInfoSync().fontSizeSetting), me = "undefined" != typeof swan && "function" == typeof swan.getSystemInfoSync && Boolean(swan.getSystemInfoSync().fontSizeSetting), ve = "undefined" != typeof my && "function" == typeof my.getSystemInfoSync && Boolean(my.getSystemInfoSync().fontSizeSetting), o = "undefined" != typeof jd && "function" == typeof jd.getSystemInfoSync, Ie = "undefined" != typeof uni && "undefined" == typeof window && "function" == typeof uni.requireNativePlugin, s = _e && "object" === b(wx.miniapp), Me = "undefined" != typeof uni, v = _e || ge || fe || me || ve || Ie || o, r = "undefined" == typeof window && !v && "undefined" != typeof global && void 0 !== global.NativeScriptGlobals, ye = "undefined" != typeof global && (void 0 !== global.nativeModuleProxy || void 0 !== global.ReactNative), Ce = "undefined" != typeof uni ? !v : "undefined" != typeof window && !v && !ye, I = ge ? qq : fe ? tt : me ? swan : ve ? my : _e ? wx : Ie ? uni : o ? jd : {}, Te = Ce && window && window.navigator && window.navigator.userAgent || "", De = (o = "WEB", /(micromessenger|webbrowser)/i.test(Te) ? o = "WEB" : ge ? o = "QQ_MP" : fe ? o = "TT_MP" : me ? o = "BAIDU_MP" : ve ? o = "ALI_MP" : _e ? o = s ? "DONUT_NATIVE_APP" : "WX_MP" : Ie ? o = "UNI_NATIVE_APP" : r ? o = "NS_NATIVE_APP" : ye && (o = "RN_NATIVE_APP"), ne[o]), s = /iPad/i.test(Te), r = /iPhone/i.test(Te) && !s, o = /iPod/i.test(Te), Ee = r || s || o, Le = (r = Te.match(/OS (\d+)_/i)) && r[1] ? r[1] : null, Se = /Android/i.test(Te), ke = (s = Te.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i)) ? (o = s[1] && parseFloat(s[1]), r = s[2] && parseFloat(s[2]), o && r ? parseFloat(s[1] + "." + s[2]) : o || null) : null, r = /Edge/i.test(Te), s = !r && /Chrome/i.test(Te), Ae = /MSIE/.test(Te) || -1 < Te.indexOf("Trident") && -1 < Te.indexOf("rv:11.0"), Re = o = !(o = (o = /MSIE\s(\d+)\.\d/.exec(Te)) && parseFloat(o[1])) && /Trident\/7.0/i.test(Te) && /rv:11.0/.test(Te) ? 11 : o, o = /Safari/i.test(Te) && !s && !Se && !r, Oe = /Windows/i.test(Te), Ne = /MAC OS X/i.test(Te), Ge = Ce && "undefined" != typeof Worker && !Ae, Pe = Se || Ee, Ue = Ce && void 0 !== window.tencent_cloud_im_csig_flutter_for_web_25F_cy, be = "undefined" != typeof window && void 0 !== window.navigator && (s = window.navigator.standalone, !(!Ee || s || o)), we = "undefined" != typeof console ? console : "undefined" != typeof global && global.console ? global.console : "undefined" != typeof window && window.console ? window.console : {}, Fe = function() { + }, qe = ["assert", "clear", "count", "debug", "dir", "dirxml", "error", "group", "groupCollapsed", "groupEnd", "info", "log", "profile", "profileEnd", "table", "time", "timeEnd", "timeStamp", "trace", "warn"], xe = qe.length; xe--; ) + pe = qe[xe], console[pe] || (we[pe] = Fe); + function Ve() { + var e2 = /* @__PURE__ */ new Date(); + return e2.setTime(We()), e2; + } + function He() { + Ye = 0; + } + function Be() { + return Math.floor(We() / 1e3); + } + var Ke = we, Ye = 0, We = function() { + return (/* @__PURE__ */ new Date()).getTime() + Ye; + }, je = 0; + function Je() { + return Qt() ? "%c Chat %c" : "Chat"; + } + function ze() { + var e2 = Ve(); + return e2.toLocaleTimeString("en-US", { hour12: false }) + "." + function(e3) { + var t2; + switch (e3.toString().length) { + case 1: + t2 = "00" + e3; + break; + case 2: + t2 = "0" + e3; + break; + default: + t2 = e3; + } + return t2; + }(e2.getMilliseconds()); + } + var M = { arguments2String: function(e2) { + var t2 = ""; + if (1 === e2.length) + t2 = e2[0]; + else + for (var n2 = 0, o2 = e2.length; n2 < o2; n2++) { + if (Ct(e2[n2])) + try { + t2 += Tt(e2[n2]) ? JSON.stringify(e2[n2], ["message", "code"]) : JSON.stringify(e2[n2]); + } catch (e3) { + t2 += e3 ? e3.message : ""; + break; + } + else + t2 += e2[n2]; + t2 += " "; + } + return t2; + }, _exec: function(e2, t2) { + Qt() ? Ke[e2](Je(), "background:#0abf5b; padding:1px; border-radius:3px; color: #fff", "background:transparent", ze(), t2) : Ke[e2]("".concat(Je(), " ").concat(ze(), " ").concat(t2)); + }, d: function() { + var e2; + je <= -1 && (e2 = this.arguments2String(arguments), this._exec("debug", e2)); + }, l: function() { + var e2; + je <= 0 && (e2 = this.arguments2String(arguments), this._exec("log", e2)); + }, log: function() { + var e2; + je <= 0 && (e2 = this.arguments2String(arguments), this._exec("log", e2)); + }, i: function() { + var e2; + je <= 1 && (e2 = this.arguments2String(arguments), this._exec("info", e2)); + }, w: function() { + var e2; + je <= 2 && (e2 = this.arguments2String(arguments), this._exec("warn", e2)); + }, e: function() { + var e2; + je <= 3 && (e2 = this.arguments2String(arguments), this._exec("error", e2)); + }, setLevel: function(e2) { + e2 < 4 && this._exec("log", "set level from " + je + " to " + e2), je = e2; + }, getLevel: function() { + return je; + } }, Xe = { JPG: 1, JPEG: 1, GIF: 2, PNG: 3, BMP: 4, UNKNOWN: 255 }, r = "Tag_Profile_IM_", g = { NICK: "".concat(r, "Nick"), GENDER: "".concat(r, "Gender"), BIRTHDAY: "".concat(r, "BirthDay"), LOCATION: "".concat(r, "Location"), SELFSIGNATURE: "".concat(r, "SelfSignature"), ALLOWTYPE: "".concat(r, "AllowType"), LANGUAGE: "".concat(r, "Language"), AVATAR: "".concat(r, "Image"), MESSAGESETTINGS: "".concat(r, "MsgSettings"), ADMINFORBIDTYPE: "".concat(r, "AdminForbidType"), LEVEL: "".concat(r, "Level"), ROLE: "".concat(r, "Role") }, Ze = { GROUP: "".concat("Tag_SNS_IM_", "Group"), REMARK: "".concat("Tag_SNS_IM_", "Remark"), ADDSOURCE: "".concat("Tag_SNS_IM_", "AddSource"), ADDWORDING: "".concat("Tag_SNS_IM_", "Wording"), ADDTIME: "".concat("Tag_SNS_IM_", "AddTime") }, s = "Gender_Type_", Qe = { UNKNOWN: "".concat(s, "Unknown"), FEMALE: "".concat(s, "Female"), MALE: "".concat(s, "Male") }, $e = { NONE: "".concat("AdminForbid_Type_", "None"), SEND_OUT: "".concat("AdminForbid_Type_", "SendOut") }, et = { NEED_CONFIRM: "".concat("AllowType_Type_", "NeedConfirm"), ALLOW_ANY: "".concat("AllowType_Type_", "AllowAny"), DENY_ANY: "".concat("AllowType_Type_", "DenyAny") }, nt = "JoinedSuccess", ot = "WaitAdminApproval", it = "@TOPIC#_", at = Object.prototype.hasOwnProperty; + function S(e2) { + if (null == e2) + return true; + if ("boolean" == typeof e2) + return false; + if ("number" == typeof e2) + return 0 === e2; + if ("string" == typeof e2) + return 0 === e2.length; + if ("function" == typeof e2) + return 0 === e2.length; + if (Array.isArray(e2)) + return 0 === e2.length; + if (e2 instanceof Error) + return "" === e2.message; + if (f(e2)) { + for (var t2 in e2) + if (at.call(e2, t2)) + return false; + return true; + } + return !!(st(e2) || rt(e2) || ct(e2)) && 0 === e2.size; + } + function st(e2) { + return "map" === Dt(e2); + } + function rt(e2) { + return "set" === Dt(e2); + } + function ct(e2) { + return "file" === Dt(e2); + } + function R(e2) { + return null !== e2 && ("number" == typeof e2 && !isNaN(+e2) || "object" === b(e2) && e2.constructor === Number); + } + function ut(e2) { + return null !== e2 && "object" === b(e2); + } + function f(e2) { + if ("object" === b(e2) && null !== e2) { + if (null === (e2 = Object.getPrototypeOf(e2))) + return 1; + for (var t2 = e2; null !== Object.getPrototypeOf(t2); ) + t2 = Object.getPrototypeOf(t2); + return e2 === t2; + } + } + function O(e2) { + return "function" == typeof Array.isArray ? Array.isArray(e2) : "array" === Dt(e2); + } + function lt(e2) { + return "function" == typeof e2; + } + function dt(e2) { + return "filelist" === Dt(e2); + } + function pt(e2) { + return "string" == typeof e2 && (e2 = e2[0], !/[^a-zA-Z0-9]/.test(e2)); + } + function _t(e2, t2, n2, o2) { + if (!Ct(e2) || !Ct(t2)) + return 0; + for (var i2, a2 = 0, s2 = Object.keys(t2), r2 = 0, c2 = s2.length; r2 < c2; r2++) + if (i2 = s2[r2], !(N(t2[i2]) || n2 && n2.includes(i2))) + if (Ct(e2[i2]) && Ct(t2[i2])) + a2 += _t(e2[i2], t2[i2], n2, o2); + else { + if (o2 && o2.includes(t2[i2])) + continue; + e2[i2] !== t2[i2] && (e2[i2] = t2[i2], a2 += 1); + } + return a2; + } + function ht(e2, t2) { + var n2, o2 = /* @__PURE__ */ new Map(), i2 = Z(e2.entries()); + try { + for (i2.s(); !(n2 = i2.n()).done; ) { + var a2 = Y(n2.value, 2), s2 = a2[0], r2 = a2[1]; + r2 && o2.set(s2, t2 ? JSON.stringify(r2) : JSON.parse(JSON.stringify(r2))); + } + } catch (e3) { + i2.e(e3); + } finally { + i2.f(); + } + return o2; + } + function gt(e2) { + if (0 === e2.length) + return 0; + for (var t2 = 0, n2 = 0, o2 = "undefined" != typeof document && void 0 !== document.characterSet ? document.characterSet : "UTF-8"; void 0 !== e2[t2]; ) + n2 += e2[t2++].charCodeAt[t2] <= 255 ? 1 : false === o2 ? 3 : 2; + return n2; + } + function ft(e2) { + return e2 = e2 || 99999999, Math.round(Math.random() * e2); + } + function mt() { + for (var e2 = "", t2 = 32; 0 < t2; --t2) + e2 += Et[Math.floor(Math.random() * Lt)]; + return e2; + } + function vt(e2, t2) { + for (var n2 in e2) + if (e2[n2] === t2) + return 1; + } + function It(e2) { + return -1 === e2.indexOf("http://") || -1 === e2.indexOf("https://") ? "https://" + e2 : e2.replace(/https|http/, "https"); + } + function Mt(e2) { + if (0 === Object.getOwnPropertyNames(e2).length) + return /* @__PURE__ */ Object.create(null); + var t2, n2, o2 = Array.isArray(e2) ? [] : /* @__PURE__ */ Object.create(null); + for (n2 in e2) + null !== e2[n2] ? void 0 !== e2[n2] ? (t2 = b(e2[n2]), 0 <= ["string", "number", "function", "boolean"].indexOf(t2) ? o2[n2] = e2[n2] : o2[n2] = Mt(e2[n2])) : o2[n2] = void 0 : o2[n2] = null; + return o2; + } + var yt = ["url"], m = function(e2) { + return "string" == typeof e2; + }, N = function(e2) { + return void 0 === e2; + }, Ct = function(e2) { + return O(e2) || ut(e2); + }, Tt = function(e2) { + return e2 instanceof Error; + }, Dt = function(e2) { + return Object.prototype.toString.call(e2).match(/^\[object (.*)\]$/)[1].toLowerCase(); + }, Et = (Date.now || (Date.now = function() { + return (/* @__PURE__ */ new Date()).getTime(); + }), "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), Lt = Et.length, St = {}; + function kt(o2, e2) { + var i2; + return !(!O(o2) || !O(e2)) && (i2 = false, e2.forEach(function(e3) { + var t2 = e3.key, e3 = e3.value, n2 = o2.find(function(e4) { + return e4.key === t2; + }); + n2 ? n2.value !== e3 && (n2.value = e3, i2 = true) : (o2.push({ key: t2, value: e3 }), i2 = true); + }), i2); + } + function At(e2) { + return S(e2) ? [] : e2.filter(function(e3) { + return true === e3.isModified; + }); + } + function Rt(e2) { + return S(e2) ? [] : e2.filter(function(e3) { + return false === e3.isModified; + }); + } + function Ot(e2) { + return e2 === A.GRP_AVCHATROOM; + } + function Nt(e2) { + var t2 = e2.type, e2 = e2.groupID; + return t2 === A.GRP_COMMUNITY || "".concat(e2).startsWith("@TGS#_") && !"".concat(e2).includes(it); + } + function Gt(e2) { + return "".concat(e2).startsWith("@TGS#_") && "".concat(e2).includes(it); + } + function Pt(e2) { + return m(e2) && e2.slice(0, 3) === A.CONV_C2C; + } + function Ut(e2) { + return m(e2) && e2.slice(0, 5) === A.CONV_GROUP; + } + function bt(e2) { + return m(e2) && e2 === A.CONV_SYSTEM; + } + function wt(t2, n2) { + var o2 = {}; + return Object.keys(t2).forEach(function(e2) { + o2[e2] = n2(t2[e2], e2); + }), o2; + } + function Ft(o2) { + return ye ? Promise.resolve({ width: 0, height: 0 }) : v ? new Promise(function(t2, e2) { + I.getImageInfo({ src: o2, success: function(e3) { + t2({ width: e3.width, height: e3.height }); + }, fail: function() { + t2({ width: 0, height: 0 }); + } }); + }) : Ae && 9 === Re ? Promise.resolve({ width: 0, height: 0 }) : new Promise(function(e2, t2) { + var n2 = new Image(); + n2.onload = function() { + e2({ width: this.width, height: this.height }), n2 = null; + }, n2.onerror = function() { + e2({ width: 0, height: 0 }), n2 = null; + }, n2.src = o2; + }); + } + function qt() { + function e2() { + return (65536 * (1 + Math.random()) | 0).toString(16).substring(1); + } + return "".concat(e2() + e2()).concat(e2()).concat(e2()).concat(e2()).concat(e2()).concat(e2()).concat(e2()); + } + function xt() { + var e2 = Se ? "android" : Ee ? "ios" : Oe ? "windows" : Ne ? "mac" : "unknown"; + if (v) + try { + var t2 = I.getSystemInfoSync().platform; + void 0 !== t2 && (e2 = t2); + } catch (e3) { + } + return e2; + } + function Vt(e2, t2) { + e2 = e2.split("."), t2 = t2.split("."); + for (var n2 = Math.max(e2.length, t2.length); e2.length < n2; ) + e2.push("0"); + for (; t2.length < n2; ) + t2.push("0"); + for (var o2 = 0; o2 < n2; o2++) { + var i2 = parseInt(e2[o2]), a2 = parseInt(t2[o2]); + if (a2 < i2) + return 1; + if (i2 < a2) + return -1; + } + return 0; + } + function Ht(e2) { + var t2 = e2.originUrl, t2 = void 0 === t2 ? void 0 : t2, n2 = e2.originWidth, o2 = e2.originHeight, e2 = e2.min, e2 = void 0 === e2 ? 198 : e2, n2 = parseInt(n2), o2 = parseInt(o2), i2 = { url: void 0, width: 0, height: 0 }; + return (n2 <= o2 ? n2 : o2) <= e2 ? (i2.url = t2, i2.width = n2, i2.height = o2) : (o2 <= n2 ? (i2.width = Math.ceil(n2 * e2 / o2), i2.height = e2) : (i2.width = e2, i2.height = Math.ceil(o2 * e2 / n2)), o2 = t2 && -1 < t2.indexOf("?") ? "".concat(t2, "&") : "".concat(t2, "?"), i2.url = "".concat(o2, 198 === e2 ? "imageView2/3/w/198/h/198" : "imageView2/3/w/720/h/720")), N(t2) ? K(i2, yt) : i2; + } + function Bt(e2) { + var t2 = e2[2]; + e2[2] = e2[1], e2[1] = t2; + for (var n2 = 0; n2 < e2.length; n2++) + e2[n2].setType(n2); + } + function Kt(e2) { + e2 = e2.servcmd; + return e2.slice(e2.indexOf(".") + 1); + } + function Yt(e2, t2) { + return Math.round(Number(e2) * Math.pow(10, t2)) / Math.pow(10, t2); + } + function Wt(e2, t2) { + return e2.includes(t2); + } + function jt(e2, t2) { + return e2.includes(t2); + } + function Jt(e2) { + return e2.split(it)[0]; + } + var zt = function(e2, t2, n2) { + if (N(t2)) + return ""; + switch (e2) { + case A.MSG_TEXT: + return t2.text; + case A.MSG_IMAGE: + return n2 ? "[Image]" : "[图片]"; + case A.MSG_LOCATION: + return n2 ? "[Location]" : "[位置]"; + case A.MSG_AUDIO: + return n2 ? "[Voice]" : "[语音]"; + case A.MSG_VIDEO: + return n2 ? "[Video]" : "[视频]"; + case A.MSG_FILE: + return n2 ? "[File]" : "[文件]"; + case A.MSG_CUSTOM: + return n2 ? "[Custom Messages]" : "[自定义消息]"; + case A.MSG_GRP_TIP: + return n2 ? "[Group Notification]" : "[群提示消息]"; + case A.MSG_GRP_SYS_NOTICE: + return n2 ? "[Group System Message]" : "[群系统通知]"; + case A.MSG_FACE: + return n2 ? "[Animated Sticker]" : "[动画表情]"; + case A.MSG_MERGER: + return n2 ? "[Chat Record]" : "[聊天记录]"; + default: + return ""; + } + }; + function Xt(e2) { + return e2 === A.MSG_TEXT || e2 === A.MSG_CUSTOM || e2 === A.MSG_LOCATION || e2 === A.MSG_FACE; + } + function Zt(e2) { + var t2 = []; + if (m(e2)) { + var n2 = e2.length; + if (0 !== n2) + for (var o2 = n2 - 1; 0 <= o2; o2--) + "1" === e2[o2] && t2.push(Math.pow(2, n2 - o2 - 1)); + } + return t2; + } + function Qt() { + return !Ae && !v; + } + function $t(e2) { + return "the length of userIDList cannot exceed ".concat(e2); + } + function en(e2) { + var t2; + if (O(e2) && 0 !== e2.length) + return t2 = 0, e2.forEach(function(e3) { + t2 += e3; + }), t2.toFixed(0); + } + function tn(e2) { + var t2; + if (O(e2) && 0 !== e2.length) + return t2 = 0, e2.forEach(function(e3) { + t2 += e3; + }), (t2 / e2.length).toFixed(0); + } + function nn(e2, t2, n2) { + var t2 = !(1 < arguments.length && void 0 !== t2) || t2, n2 = !(2 < arguments.length && void 0 !== n2) || n2, o2 = Date.now(); + return t2 ? n2 ? "".concat(o2 - e2, " ms") : "".concat(Math.round((o2 - e2) / 1e3), " s") : n2 ? o2 - e2 : Math.round((o2 - e2) / 1e3); + } + function on(e2) { + return e2 && 1 < e2 ? true : false; + } + function an(e2, t2, n2, o2) { + var i2, a2, s2; + return void 0 === t2 || (i2 = true, t2.required && S(e2) && (M.e("[".concat(n2, '] Missing required params: "').concat(o2, '".')), i2 = false), S(e2) || (a2 = Dt(e2)) === (s2 = t2.type.toLowerCase()) || "asyncfunction" === a2 && "function" === s2 || (M.e("[".concat(n2, '] Invalid params: type check failed for "').concat(o2, '". Expected ').concat(t2.type, ".")), i2 = false), t2.validator && !t2.validator(e2, n2, o2) && (M.e("[".concat(n2, '] Invalid params: custom validator check failed for "').concat(o2, '".')), i2 = false), i2); + } + function sn(e2) { + return !(!e2 || !(Pt(e2) || Ut(e2) || bt(e2)) && ((e2 = l("InvalidConversationID", e2)) && M.w(e2), 1)); + } + function c(e2) { + "" !== e2.desc && "" !== l("API_REFER") && M.w("[".concat(e2.api, "] | ").concat(e2.paramName, " | ").concat(e2.desc, ", ").concat(l("API_REFER")).concat(e2.api)); + } + function rn() { + return l("StringRequiredLog"); + } + function cn(e2) { + return l("NonEmptyStringRequiredLog", e2); + } + function un() { + return l("NumberRequiredLog"); + } + function ln() { + return l("UndefinedNotAllowedLog"); + } + function dn() { + return l("FileRequiredLog"); + } + function pn() { + return l("FunctionRequiredLog"); + } + function _n() { + return l("ArrayRequiredLog"); + } + function hn() { + return l("NonEmptyArrayLog"); + } + function gn() { + return l("CallbackMissingLog"); + } + function fn() { + return l("PositiveIntegerRequiredLog"); + } + function mn(e2, t2) { + return l("StringNotLongerThanLog", e2, t2); + } + function vn(e2, t2) { + return l("NumberGreaterOrEqualLog", e2, t2); + } + function In(e2) { + return l("KeyValueStringRequiredLog", e2); + } + function Mn() { + return l("PlainObjectRequiredLog"); + } + function yn() { + return l("NonEmptyContentRequiredLog"); + } + function Cn() { + return l("FileNotSelectedLog"); + } + function Tn() { + return l("MessageInstanceRequiredLog"); + } + function Dn() { + return l("NonAnonymousFunctionLog"); + } + function En() { + return l("MessageExtensionNotAvailableLog"); + } + function Ln() { + return l("MessageReactionRequiredLog"); + } + function Sn(e2, t2) { + return l("MaximumArrayLengthLog", e2, t2); + } + function C(e2) { + return { code: 0, data: e2 || {} }; + } + function T(e2) { + return Promise.resolve(C(e2)); + } + function D(e2) { + var t2, n2 = 1 < arguments.length && void 0 !== arguments[1] && arguments[1]; + return e2 instanceof E ? (n2 && null !== qn && qn.emit(h.ERROR, e2), Promise.reject(e2)) : e2 instanceof Error ? (t2 = new E({ code: L.UNCAUGHT_ERROR }), n2 && null !== qn && qn.emit(h.ERROR, t2), Promise.reject(t2)) : N(e2) || N(e2.code) ? Promise.reject(new E({ code: L.UNCAUGHT_ERROR })) : (t2 = new E(e2), n2 && null !== qn && qn.emit(h.ERROR, t2), Promise.reject(t2)); + } + var kn, An = "unSend", Rn = "success", On = "fail", Nn = "notStart", Gn = "pending", Pn = "resolved", Un = "rejected", o = { type: "String", required: true }, r = { type: "Array", required: true }, s = { type: "Object", required: true }, bn = { type: "Boolean", required: true }, u = { type: "number", required: true }, l = null, wn = { hookGetAPITips: function(e2) { + l = e2; + }, login: { userID: o, userSig: o }, addToBlacklist: { userIDList: r }, removeFromBlacklist: { userIDList: r }, on: [{ name: "eventName", type: "String", validator: function(e2, t2, n2) { + return "string" == typeof e2 && 0 !== e2.length || (c({ api: t2, paramName: n2, desc: cn(n2) }), false); + } }, { name: "handler", type: "Function", validator: function(e2, t2, n2) { + return "function" != typeof e2 ? (c({ api: t2, paramName: n2, desc: pn() }), false) : ("" === e2.name && c({ api: t2, paramName: n2, desc: Dn() }), true); + } }], once: [{ name: "eventName", type: "String", validator: function(e2, t2, n2) { + return "string" == typeof e2 && 0 !== e2.length || (c({ api: t2, paramName: n2, desc: cn(n2) }), false); + } }, { name: "handler", type: "Function", validator: function(e2, t2, n2) { + return "function" != typeof e2 ? (c({ api: t2, paramName: n2, desc: pn() }), false) : ("" === e2.name && c({ api: t2, paramName: n2, desc: Dn() }), true); + } }], off: [{ name: "eventName", type: "String", validator: function(e2, t2, n2) { + return "string" == typeof e2 && 0 !== e2.length || (c({ api: t2, paramName: n2, desc: cn(n2) }), false); + } }, { name: "handler", type: "Function", validator: function(e2, t2, n2) { + return "function" != typeof e2 ? (c({ api: t2, paramName: n2, desc: pn() }), false) : ("" === e2.name && c({ api: t2, paramName: n2, desc: Dn() }), true); + } }], sendMessage: [y({ name: "message" }, s)], setMessageExtensions: [y(y({ name: "message" }, s), {}, { validator: function(e2, t2, n2) { + return e2.status === Rn && true === e2.isSupportExtension || (c({ api: t2, paramName: n2, desc: En() }), false); + } }), y({ name: "extensions" }, r)], getMessageExtensions: [y(y({ name: "message" }, s), {}, { validator: function(e2, t2, n2) { + return e2.status === Rn && true === e2.isSupportExtension || (c({ api: t2, paramName: n2, desc: En() }), false); + } })], deleteMessageExtensions: [y(y({ name: "message" }, s), {}, { validator: function(e2, t2, n2) { + return e2.status === Rn && true === e2.isSupportExtension || (c({ api: t2, paramName: n2, desc: En() }), false); + } })], addMessageReaction: [y(y({ name: "message" }, s), {}, { validator: function(e2, t2, n2) { + return e2.status === Rn || (c({ api: t2, paramName: n2, desc: Ln() }), false); + } }), y({ name: "reactionID" }, o)], removeMessageReaction: [y(y({ name: "message" }, s), {}, { validator: function(e2, t2, n2) { + return e2.status === Rn || (c({ api: t2, paramName: n2, desc: Ln() }), false); + } }), y({ name: "reactionID" }, o)], getMessageReactions: { messageList: y({}, r) }, getAllUserListOfMessageReaction: { message: y(y({}, s), {}, { validator: function(e2, t2, n2) { + return e2.status === Rn || (c({ api: t2, paramName: n2, desc: Ln() }), false); + } }), reactionID: y({}, o), nextSeq: { type: "Number" }, count: { type: "Number" } }, getMessageList: { conversationID: y(y({}, o), {}, { validator: sn }), nextReqMessageID: { type: "String" }, count: { type: "Number", validator: function(e2, t2, n2) { + return !(!N(e2) && !/^[1-9][0-9]*$/.test(e2) && (c({ api: t2, paramName: n2, desc: fn() }), 1)); + } } }, getMessageListHopping: { conversationID: y(y({}, o), {}, { validator: sn }), sequence: { type: "Number" }, time: { type: "Number" }, direction: { type: "Number", validator: function(e2, t2, n2) { + return !(!N(e2) && 0 !== e2 && 1 !== e2 && (c({ api: t2, paramName: n2, desc: l("0Or1RequiredLog") }), 1)); + } }, count: { type: "Number", validator: function(e2, t2, n2) { + return !(!N(e2) && !/^[1-9][0-9]*$/.test(e2) && (c({ api: t2, paramName: n2, desc: fn }), 1)); + } } }, setMessageRead: { conversationID: y(y({}, o), {}, { validator: sn }) }, setAllMessageRead: { scope: { type: "String", required: false, validator: function(e2, t2, n2) { + return !e2 || -1 !== [A.READ_ALL_C2C_MSG, A.READ_ALL_GROUP_MSG, A.READ_ALL_MSG].indexOf(e2) || (c({ api: t2, paramName: n2, desc: l("ValidScopeRequired") }), false); + } } }, getConversationProfile: [y(y({ name: "conversationID" }, o), {}, { validator: sn })], clearHistoryMessage: [y(y({ name: "conversationID" }, o), {}, { validator: sn })], pinConversation: { conversationID: y(y({}, o), {}, { validator: sn }), isPinned: y({}, bn) }, setConversationDraft: { conversationID: y(y({}, o), {}, { validator: sn }), draftText: { type: "String", validator: function(e2, t2, n2) { + return !!m(e2) || (c({ api: t2, paramName: n2, desc: rn() }), false); + } } }, setConversationCustomData: { conversationIDList: y({}, r), customData: { type: "String", validator: function(e2, t2, n2) { + return m(e2) ? !(256 < e2.length && (c({ api: t2, paramName: n2, desc: mn(n2, 256) }), 1)) : (c({ api: t2, paramName: n2, desc: rn() }), false); + } } }, markConversation: { conversationIDList: y({}, r), markType: { type: "number", validator: function(e2, t2, n2) { + return R(e2) ? e2 <= 0 ? (c({ api: t2, paramName: n2, desc: l("NumberGreaterThanLog", n2, 0) }), false) : !(e2 >= Math.pow(2, 64) && (c({ api: t2, paramName: n2, desc: l("NumberLessThanLog", n2, "Math.pow(2,64)") }), 1)) : (c({ api: t2, paramName: n2, desc: un() }), false); + } }, enableMark: y({}, bn) }, createConversationGroup: { conversationIDList: y({}, r), groupName: y(y({}, o), {}, { validator: function(e2, t2, n2) { + return !(!e2 || 32 < e2.length && (c({ api: t2, paramName: n2, desc: mn(n2, 32) }), 1)); + } }) }, deleteConversationGroup: [y({ name: "groupName" }, o)], renameConversationGroup: { oldName: y({}, o), newName: y(y({}, o), {}, { validator: function(e2, t2, n2) { + return !(!e2 || 32 < e2.length && (c({ api: t2, paramName: n2, desc: mn(n2, 32) }), 1)); + } }) }, addConversationsToGroup: { conversationIDList: y({}, r), groupName: y({}, o) }, deleteConversationsFromGroup: { conversationIDList: y({}, r), groupName: y({}, o) }, getGroupList: { groupProfileFilter: { type: "Array" } }, getGroupProfile: { groupID: o, groupCustomFieldFilter: { type: "Array" }, memberCustomFieldFilter: { type: "Array" } }, getGroupProfileAdvance: { groupIDList: r }, createGroup: { name: o }, joinGroup: { groupID: o, type: { type: "String" }, applyMessage: { type: "String" } }, quitGroup: [y({ name: "groupID" }, o)], handleApplication: { message: s, handleAction: o, handleMessage: { type: "String" } }, changeGroupOwner: { groupID: o, newOwnerID: o }, updateGroupProfile: { groupID: o, muteAllMembers: { type: "Boolean" } }, dismissGroup: [y({ name: "groupID" }, o)], searchGroupByID: [y({ name: "groupID" }, o)], getGroupOnlineMemberCount: [y({ name: "groupID" }, o)], initGroupAttributes: { groupID: o, groupAttributes: y(y({}, s), {}, { validator: function(t2, n2, o2) { + var i2 = true; + return Object.keys(t2).forEach(function(e2) { + if (!m(t2[e2])) + return c({ api: n2, paramName: o2, desc: In("value") }), i2 = false; + }), i2; + } }) }, setGroupAttributes: { groupID: o, groupAttributes: y(y({}, s), {}, { validator: function(t2, n2, o2) { + var i2 = true; + return Object.keys(t2).forEach(function(e2) { + if (!m(t2[e2])) + return c({ api: n2, paramName: o2, desc: In("value") }), i2 = false; + }), i2; + } }) }, deleteGroupAttributes: { groupID: o, keyList: { type: "Array", validator: function(e2, t2, n2) { + var o2; + return N(e2) || !O(e2) ? (c({ api: t2, paramName: n2, desc: _n() }), false) : !!S(e2) || (o2 = true, e2.forEach(function(e3) { + if (!m(e3)) + return c({ api: t2, paramName: n2, desc: l("StringArrayRequiredLog") }), o2 = false; + }), o2); + } } }, getGroupAttributes: { groupID: o, keyList: { type: "Array", validator: function(e2, t2, n2) { + var o2; + return N(e2) || !O(e2) ? (c({ api: t2, paramName: n2, desc: _n() }), false) : !!S(e2) || (o2 = true, e2.forEach(function(e3) { + if (!m(e3)) + return c({ api: t2, paramName: n2, desc: In("key") }), o2 = false; + }), o2); + } } }, setGroupCounters: { groupID: o, counters: s }, increaseGroupCounter: { groupID: o, key: o, value: u }, decreaseGroupCounter: { groupID: o, key: o, value: u }, getGroupCounters: { groupID: o }, getGroupMemberList: { groupID: o, count: { type: "Number" } }, getGroupMemberProfile: { groupID: o, userIDList: r, memberCustomFieldFilter: { type: "Array" } }, addGroupMember: { groupID: o, userIDList: r }, setGroupMemberRole: { groupID: o, userID: o, role: o }, setGroupMemberMuteTime: { groupID: o, userID: o, muteTime: { type: "Number", validator: function(e2) { + return 0 <= e2; + } } }, setGroupMemberNameCard: { groupID: o, userID: { type: "String" }, nameCard: { type: "String", validator: function(e2, t2, n2) { + return m(e2) ? (e2.length, true) : (c({ api: t2, paramName: n2, desc: rn() }), false); + } } }, setGroupMemberCustomField: { groupID: o, userID: { type: "String" }, memberCustomField: r }, deleteGroupMember: { groupID: o }, markGroupMemberList: { groupID: o, markType: { type: "number", validator: function(e2, t2, n2) { + return R(e2) ? !(e2 < 1e3 && (c({ api: t2, paramName: n2, desc: vn(n2, 1e3) }), 1)) : (c({ api: t2, paramName: n2, desc: un() }), false); + } }, userIDList: y({}, r), enableMark: y({}, bn) }, createTextMessage: { to: o, conversationType: o, payload: y(y({}, s), {}, { validator: function(e2, t2, n2) { + return f(e2) ? m(e2.text) ? 0 !== e2.text.length || (c({ api: t2, paramName: "payload.text", desc: yn() }), false) : (c({ api: t2, paramName: "payload.text", desc: rn() }), false) : (c({ api: t2, paramName: n2, desc: Mn() }), false); + } }) }, createTextAtMessage: { to: o, conversationType: o, payload: y(y({}, s), {}, { validator: function(e2, t2, n2) { + return f(e2) ? m(e2.text) ? 0 === e2.text.length ? (c({ api: t2, paramName: "payload.text", desc: yn() }), false) : !(e2.atUserList && !O(e2.atUserList) && (c({ api: t2, paramName: "payload.atUserList", desc: _n() }), 1)) : (c({ api: t2, paramName: "payload.text", desc: rn() }), false) : (c({ api: t2, paramName: n2, desc: Mn() }), false); + } }) }, createCustomMessage: { to: o, conversationType: o, payload: y(y({}, s), {}, { validator: function(e2, t2, n2) { + return f(e2) ? e2.data && !m(e2.data) ? (c({ api: t2, paramName: "payload.data", desc: rn() }), false) : e2.description && !m(e2.description) ? (c({ api: t2, paramName: "payload.description", desc: rn() }), false) : !(e2.extension && !m(e2.extension) && (c({ api: t2, paramName: "payload.extension", desc: rn() }), 1)) : (c({ api: t2, paramName: "payload", desc: Mn() }), false); + } }) }, createImageMessage: { to: o, conversationType: o, payload: y(y({}, s), {}, { validator: function(e2, t2, n2) { + if (!f(e2)) + return c({ api: t2, paramName: n2, desc: Mn() }), false; + if (N(e2.file)) + return c({ api: t2, paramName: "payload.file", desc: ln() }), false; + if (Ce) { + if (!(e2.file instanceof HTMLInputElement || ct(e2.file))) + return f(e2.file) && "undefined" != typeof uni ? 0 !== e2.file.tempFilePaths.length && 0 !== e2.file.tempFiles.length || (c({ api: t2, paramName: "payload.file", desc: Cn() }), false) : (c({ api: t2, paramName: "payload.file", desc: dn() }), false); + if (e2.file instanceof HTMLInputElement && 0 === e2.file.files.length) + return c({ api: t2, paramName: "payload.file", desc: Cn() }), false; + } + return true; + }, onProgress: { type: "Function", required: false, validator: function(e2, t2, n2) { + return N(e2) && c({ api: t2, paramName: n2, desc: gn() }), true; + } } }) }, createAudioMessage: { to: o, conversationType: o, payload: y(y({}, s), {}, { validator: function(e2, t2, n2) { + return !!f(e2) || (c({ api: t2, paramName: n2, desc: Mn() }), false); + } }), onProgress: { type: "Function", required: false, validator: function(e2, t2, n2) { + return N(e2) && c({ api: t2, paramName: n2, desc: gn() }), true; + } } }, createVideoMessage: { to: o, conversationType: o, payload: y(y({}, s), {}, { validator: function(e2, t2, n2) { + if (!f(e2)) + return c({ api: t2, paramName: n2, desc: Mn() }), false; + if (N(e2.file)) + return c({ api: t2, paramName: "payload.file", desc: ln() }), false; + if (Ce) { + if (!(e2.file instanceof HTMLInputElement || ct(e2.file))) + return f(e2.file) && "undefined" != typeof uni ? !!ct(e2.file.tempFile) || (c({ api: t2, paramName: "payload.file", desc: Cn() }), false) : (c({ api: t2, paramName: "payload.file", desc: dn() }), false); + if (e2.file instanceof HTMLInputElement && 0 === e2.file.files.length) + return c({ api: t2, paramName: "payload.file", desc: Cn() }), false; + } + return true; + } }), onProgress: { type: "Function", required: false, validator: function(e2, t2, n2) { + return N(e2) && c({ api: t2, paramName: n2, desc: gn() }), true; + } } }, createFaceMessage: { to: o, conversationType: o, payload: y(y({}, s), {}, { validator: function(e2, t2, n2) { + return f(e2) ? R(e2.index) ? !!m(e2.data) || (c({ api: t2, paramName: "payload.data", desc: rn() }), false) : (c({ api: t2, paramName: "payload.index", desc: un() }), false) : (c({ api: t2, paramName: n2, desc: Mn() }), false); + } }) }, createFileMessage: { to: o, conversationType: o, payload: y(y({}, s), {}, { validator: function(e2, t2, n2) { + if (!f(e2)) + return c({ api: t2, paramName: n2, desc: Mn() }), false; + if (N(e2.file)) + return c({ api: t2, paramName: "payload.file", desc: ln() }), false; + if (Ce) { + if (!(e2.file instanceof HTMLInputElement || ct(e2.file))) + return f(e2.file) && "undefined" != typeof uni ? 0 !== e2.file.tempFilePaths.length && 0 !== e2.file.tempFiles.length || (c({ api: t2, paramName: "payload.file", desc: Cn() }), false) : (c({ api: t2, paramName: "payload.file", desc: dn() }), false); + if (e2.file instanceof HTMLInputElement && 0 === e2.file.files.length) + return c({ api: t2, paramName: "payload.file", desc: Cn() }), false; + } + return true; + } }), onProgress: { type: "Function", required: false, validator: function(e2, t2, n2) { + return N(e2) && c({ api: t2, paramName: n2, desc: gn() }), true; + } } }, createLocationMessage: { to: o, conversationType: o, payload: y(y({}, s), {}, { validator: function(e2, t2, n2) { + return f(e2) ? m(e2.description) ? R(e2.longitude) ? !!R(e2.latitude) || (c({ api: t2, paramName: "payload.latitude", desc: un() }), false) : (c({ api: t2, paramName: "payload.longitude", desc: un() }), false) : (c({ api: t2, paramName: "payload.description", desc: rn() }), false) : (c({ api: t2, paramName: n2, desc: Mn() }), false); + } }) }, createMergerMessage: { to: o, conversationType: o, payload: y(y({}, s), {}, { validator: function(e2, t2, n2) { + var o2; + return S(e2.messageList) ? (c({ api: t2, paramName: "payload.messageList", desc: hn() }), false) : S(e2.compatibleText) ? (c({ api: t2, paramName: "payload.compatibleText", desc: cn("compatibleText") }), false) : (o2 = false, e2.messageList.forEach(function(e3) { + e3.status === On && (o2 = true); + }), !o2 || (c({ api: t2, paramName: "payload.messageList", desc: l("MergeFailedMessageLog") }), false)); + } }) }, revokeMessage: [y(y({ name: "message" }, s), {}, { validator: function(e2, t2, n2) { + return S(e2) ? (c({ api: t2, paramName: n2, desc: Tn() }), false) : e2.conversationType === A.CONV_SYSTEM ? (c({ api: t2, paramName: n2, desc: l("MessageCanBeRevokedDesc") }), false) : true !== e2.isRevoked || (c({ api: t2, paramName: n2, desc: l("MessageRevokedLog") }), false); + } })], deleteMessage: [y(y({ name: "messageList" }, r), {}, { validator: function(e2, t2, n2) { + return !S(e2) || (c({ api: t2, paramName: n2, desc: hn() }), false); + } })], translateText: { sourceTextList: r, sourceLanguage: o, targetLanguage: o }, convertVoiceToText: { message: y(y({}, s), {}, { validator: function(e2, t2, n2) { + return S(e2) ? (c({ api: t2, paramName: n2, desc: Tn() }), false) : e2.type === A.MSG_AUDIO && e2.status === Rn || (c({ api: t2, paramName: n2, desc: l("AudioMessageRequiredLog") }), false); + } }) }, modifyMessage: [y(y({ name: "message" }, s), {}, { validator: function(e2, t2, n2) { + return S(e2) ? (c({ api: t2, paramName: n2, desc: Tn() }), false) : e2.conversationType === A.CONV_SYSTEM ? (c({ api: t2, paramName: n2, desc: l("MessageCanBeModifiedLog") }), false) : true !== e2._onlineOnlyFlag || (c({ api: t2, paramName: n2, desc: l("OnlineMessageNotSupportLog") }), false); + } })], searchCloudMessages: { keywordList: { type: "Array", required: false, validator: function(e2, t2, n2) { + return !(e2 && (O(e2) ? 0 === e2.length ? (c({ api: t2, paramName: n2, desc: hn() }), 1) : 5 < e2.length && (c({ api: t2, paramName: n2, desc: Sn(n2, 5) }), 1) : (c({ api: t2, paramName: n2, desc: _n() }), 1))); + } }, keywordListMatchType: { type: "String", required: false, validator: function(e2, t2, n2) { + return !e2 || "or" === e2 || "and" === e2 || c({ api: t2, paramName: n2, desc: "".concat(e2, " is invalid match type") }); + } }, senderUserIDList: { type: "Array", required: false, validator: function(e2, t2, n2) { + return !(e2 && (O(e2) ? (0 === e2.length && c({ api: t2, paramName: n2, desc: hn() }), 5 < e2.length && (c({ api: t2, paramName: n2, desc: Sn(n2, 5) }), 1)) : (c({ api: t2, paramName: n2, desc: _n() }), 1))); + } }, messageTypeList: { type: "Array", required: false, validator: function(e2, t2, n2) { + if (!e2) + return true; + if (!O(e2)) + return c({ api: t2, paramName: n2, desc: _n() }), false; + 0 === e2.length && c({ api: t2, paramName: n2, desc: hn() }); + var o2 = [A.MSG_TEXT, A.MSG_IMAGE, A.MSG_AUDIO, A.MSG_FILE, A.MSG_VIDEO, A.MSG_LOCATION, A.MSG_CUSTOM, A.MSG_MERGER]; + return !(0 < e2.filter(function(e3) { + return -1 === o2.indexOf(e3); + }).length && (c({ api: t2, paramName: n2, desc: l("ContainsUnsupportedMessageTypeLog", n2) }), 1)); + } }, conversationID: { type: "String", required: false, validator: function(e2) { + return !e2 || sn(e2); + } }, timePosition: { type: "number", required: false, validator: function(e2, t2, n2) { + return !(e2 && e2 < 0 && (c({ api: t2, paramName: n2, desc: vn(n2, 0) }), 1)); + } }, timePeriod: { type: "number", required: false, validator: function(e2, t2, n2) { + return !(e2 && e2 < 0 && (c({ api: t2, paramName: n2, desc: vn(n2, 0) }), 1)); + } }, cursor: { type: "String", required: false } }, getUserProfile: { userIDList: { type: "Array", validator: function(e2, t2, n2) { + return O(e2) ? (0 === e2.length && c({ api: t2, paramName: n2, desc: hn() }), true) : (c({ api: t2, paramName: n2, desc: _n() }), false); + } } }, updateMyProfile: { profileCustomField: { type: "Array", validator: function(e2, t2, n2) { + return !!N(e2) || !!O(e2) || (c({ api: t2, paramName: n2, desc: _n() }), false); + } } }, setSelfStatus: { customStatus: { type: "String", validator: function(e2, t2, n2) { + return !!m(e2) || (c({ api: t2, paramName: n2, desc: rn() }), false); + } } }, getUserStatus: { userIDList: { type: "Array", validator: function(e2, t2, n2) { + return O(e2) ? 0 !== e2.length || (c({ api: t2, paramName: n2, desc: hn() }), false) : (c({ api: t2, paramName: n2, desc: _n() }), false); + } } }, subscribeUserStatus: { userIDList: { type: "Array", validator: function(e2, t2, n2) { + return O(e2) ? 0 !== e2.length || (c({ api: t2, paramName: n2, desc: hn() }), false) : (c({ api: t2, paramName: n2, desc: _n() }), false); + } } }, unsubscribeUserStatus: { userIDList: { type: "Array", validator: function(e2, t2, n2) { + return !e2 || !!O(e2) || (c({ api: t2, paramName: n2, desc: _n() }), false); + } } }, addFriend: { to: o, source: { type: "String", required: true, validator: function(e2, t2, n2) { + return !(!e2 || (e2.startsWith("AddSource_Type_") ? 8 < e2.replace("AddSource_Type_", "").length && (c({ api: t2, paramName: n2, desc: mn("keyword", 8) }), 1) : (c({ api: t2, paramName: n2, desc: l("SourcePrefixLog") }), 1))); + } }, remark: { type: "String", required: false, validator: function(e2, t2, n2) { + return !(m(e2) && 96 < e2.length && (c({ api: t2, paramName: n2, desc: mn(n2, 96) }), 1)); + } } }, deleteFriend: { userIDList: r }, checkFriend: { userIDList: r }, getFriendProfile: { userIDList: r }, updateFriend: { userID: o, remark: { type: "String", required: false, validator: function(e2, t2, n2) { + return !(m(e2) && 96 < e2.length && (c({ api: t2, paramName: n2, desc: mn(n2, 96) }), 1)); + } }, friendCustomField: { type: "Array", required: false, validator: function(e2, t2, n2) { + var o2; + return !e2 || (O(e2) ? (o2 = true, e2.forEach(function(e3) { + return m(e3.key) && -1 !== e3.key.indexOf("Tag_SNS_Custom") ? m(e3.value) ? 8 < e3.key.replace("Tag_SNS_Custom_", "").length ? (c({ api: t2, paramName: n2, desc: mn("keyword", 8) }), o2 = false) : void 0 : (c({ api: t2, paramName: n2, desc: In("value") }), o2 = false) : (c({ api: t2, paramName: n2, desc: l("FriendCustomFieldPrefixLog") }), o2 = false); + }), o2) : (c({ api: t2, paramName: n2, desc: _n() }), false)); + } } }, acceptFriendApplication: { userID: o }, refuseFriendApplication: { userID: o }, deleteFriendApplication: { userID: o }, createFriendGroup: { name: o }, deleteFriendGroup: { name: o }, addToFriendGroup: { name: o, userIDList: r }, removeFromFriendGroup: { name: o, userIDList: r }, renameFriendGroup: { oldName: o, newName: o }, sendMessageReadReceipt: [{ name: "messageList", type: "Array", validator: function(e2, t2, n2) { + return O(e2) ? 0 !== e2.length || (c({ api: t2, paramName: n2, desc: hn() }), false) : (c({ api: t2, paramName: n2, desc: _n() }), false); + } }], getMessageReadReceiptList: [{ name: "messageList", type: "Array", validator: function(e2, t2, n2) { + return O(e2) ? 0 !== e2.length || (c({ api: t2, paramName: n2, desc: hn() }), false) : (c({ api: t2, paramName: n2, desc: _n() }), false); + } }], createTopicInCommunity: { groupID: o, topicName: o }, deleteTopicFromCommunity: { groupID: o, topicIDList: { type: "Array", validator: function(e2, t2, n2) { + return !e2 || !!O(e2) || (c({ api: t2, paramName: n2, desc: _n() }), false); + } } }, updateTopicProfile: { groupID: o, topicID: o }, getTopicList: { groupID: o, topicIDList: { type: "Array", validator: function(e2, t2, n2) { + return !e2 || !!O(e2) || (c({ api: t2, paramName: n2, desc: _n() }), false); + } } }, followUser: [y({ name: "userIDList" }, r)], unfollowUser: [y({ name: "userIDList" }, r)], getMyFollowingList: [y(y({ name: "startIndex" }, o), {}, { required: false })], getMyFollowersList: [y(y({ name: "startIndex" }, o), {}, { required: false })], getMutualFollowersList: [y(y({ name: "startIndex" }, o), {}, { required: false })], getUserFollowInfo: [y(y({ name: "userIDList" }, r), {}, { required: false })], checkFollowType: [y({ name: "userIDList" }, r)], addSignalingListener: [{ name: "eventName", type: "String", validator: function(e2, t2, n2) { + return "string" == typeof e2 && 0 !== e2.length || (c({ api: t2, paramName: n2, desc: cn(n2) }), false); + } }, { name: "handler", type: "Function", validator: function(e2, t2, n2) { + return "function" != typeof e2 ? (c({ api: t2, paramName: n2, desc: pn() }), false) : ("" === e2.name && c({ api: t2, paramName: n2, desc: Dn() }), true); + } }], removeSignalingListener: [{ name: "eventName", type: "String", validator: function(e2, t2, n2) { + return "string" == typeof e2 && 0 !== e2.length || (c({ api: t2, paramName: n2, desc: cn(n2) }), false); + } }, { name: "handler", type: "Function", validator: function(e2, t2, n2) { + return "function" != typeof e2 ? (c({ api: t2, paramName: n2, desc: pn() }), false) : ("" === e2.name && c({ api: t2, paramName: n2, desc: Dn() }), true); + } }], invite: { userID: o }, inviteSync: [y(y({}, s), {}, { validator: function(e2, t2, n2) { + return f(e2) ? !!m(e2.userID) || (c({ api: t2, paramName: "options.userID", desc: rn() }), false) : (c({ api: t2, paramName: "options", desc: Mn() }), false); + } }), { name: "successCb", type: "Function", required: false, validator: function(e2, t2, n2) { + return N(e2) && c({ api: t2, paramName: n2, desc: pn() }), true; + } }, { name: "errorCb", type: "Function", required: false, validator: function(e2, t2, n2) { + return N(e2) && c({ api: t2, paramName: n2, desc: pn() }), true; + } }], inviteInGroup: { groupID: o, inviteeList: r }, inviteInGroupSync: [y(y({}, s), {}, { validator: function(e2, t2, n2) { + return f(e2) ? m(e2.groupID) ? !!O(e2.inviteeList) || (c({ api: t2, paramName: "options.inviteeList", desc: _n() }), false) : (c({ api: t2, paramName: "options.groupID", desc: rn() }), false) : (c({ api: t2, paramName: "options", desc: Mn() }), false); + } }), { name: "successCb", type: "Function", required: false, validator: function(e2, t2, n2) { + return N(e2) && c({ api: t2, paramName: n2, desc: pn() }), true; + } }, { name: "errorCb", type: "Function", required: false, validator: function(e2, t2, n2) { + return N(e2) && c({ api: t2, paramName: n2, desc: pn() }), true; + } }], accept: { inviteID: o }, reject: { inviteID: o }, getSignalingInfo: [y(y({ name: "message" }, s), {}, { validator: function(e2, t2, n2) { + return !S(e2) || (c({ api: t2, paramName: n2, desc: Tn() }), false); + } })], modifyInvitation: { inviteID: o, data: o } }, Fn = { login: 1, logout: 1, getLoginUser: 1, getServerTime: 1, on: 1, once: 1, off: 1, setLogLevel: 1, registerPlugin: 1, destroy: 1, isReady: 1, createTextMessage: 1, createTextAtMessage: 1, createImageMessage: 1, createAudioMessage: 1, createVideoMessage: 1, createCustomMessage: 1, createFaceMessage: 1, createFileMessage: 1, createLocationMessage: 1, createMergerMessage: 1, downloadMergerMessage: 1, createForwardMessage: 1, sendMessage: 1, resendMessage: 1, revokeMessage: 1, deleteMessage: 1, translateText: 1, convertVoiceToText: 1, modifyMessage: 1, searchCloudMessages: 1, sendMessageReadReceipt: 1, getGroupMessageReadMemberList: 1, getMessageReadReceiptList: 1, setMessageExtensions: 1, getMessageExtensions: 1, deleteMessageExtensions: 1, addMessageReaction: 1, removeMessageReaction: 1, getMessageReactions: 1, getAllUserListOfMessageReaction: 1, getMessageList: 1, findMessage: 1, getMessageListHopping: 1, setMessageRead: 1, setAllMessageRead: 1, getConversationList: 1, getConversationProfile: 1, deleteConversation: 1, setConversationDraft: 1, pinConversation: 1, getTotalUnreadMessageCount: 1, setConversationCustomData: 1, markConversation: 1, createConversationGroup: 1, getConversationGroupList: 1, deleteConversationGroup: 1, renameConversationGroup: 1, addConversationsToGroup: 1, deleteConversationsFromGroup: 1, clearHistoryMessage: 1, setMessageRemindType: 1, setAllReceiveMessageOpt: 1, getAllReceiveMessageOpt: 1, getGroupList: 1, getGroupProfile: 1, createGroup: 1, joinGroup: 1, updateGroupProfile: 1, quitGroup: 1, dismissGroup: 1, changeGroupOwner: 1, searchGroupByID: 1, getGroupApplicationList: 1, handleGroupApplication: 1, initGroupAttributes: 1, setGroupAttributes: 1, deleteGroupAttributes: 1, getGroupAttributes: 1, setGroupCounters: 1, increaseGroupCounter: 1, decreaseGroupCounter: 1, getGroupCounters: 1, getJoinedCommunityList: 1, createTopicInCommunity: 1, deleteTopicFromCommunity: 1, updateTopicProfile: 1, getTopicList: 1, getGroupMemberProfile: 1, getGroupMemberList: 1, addGroupMember: 1, deleteGroupMember: 1, setGroupMemberNameCard: 1, setGroupMemberMuteTime: 1, setGroupMemberRole: 1, setGroupMemberCustomField: 1, getGroupOnlineMemberCount: 1, markGroupMemberList: 1, getMyProfile: 1, getUserProfile: 1, updateMyProfile: 1, setSelfStatus: 1, getUserStatus: 1, subscribeUserStatus: 1, unsubscribeUserStatus: 1, getBlacklist: 1, addToBlacklist: 1, removeFromBlacklist: 1, getFriendList: 1, addFriend: 1, deleteFriend: 1, checkFriend: 1, updateFriend: 1, getFriendProfile: 1, getFriendApplicationList: 1, refuseFriendApplication: 1, deleteFriendApplication: 1, acceptFriendApplication: 1, setFriendApplicationRead: 1, getFriendGroupList: 1, createFriendGroup: 1, renameFriendGroup: 1, deleteFriendGroup: 1, addToFriendGroup: 1, removeFromFriendGroup: 1, followUser: 1, unfollowUser: 1, getMyFollowingList: 1, getMyFollowersList: 1, getMutualFollowersList: 1, getUserFollowInfo: 1, checkFollowType: 1, callExperimentalAPI: 1, addSignalingListener: 1, removeSignalingListener: 1, invite: 1, inviteSync: 1, inviteInGroup: 1, inviteInGroupSync: 1, cancel: 1, accept: 1, reject: 1, getSignalingInfo: 1, modifyInvitation: 1 }, E = (t(io, B(Error)), kn = n(io), e(io)), L = { NO_SDKAPPID: 2e3, NO_ACCOUNT_TYPE: 2001, NO_IDENTIFIER: 2002, NO_USERSIG: 2003, NO_TINYID: 2022, NO_A2KEY: 2023, USER_NOT_LOGGED_IN: 2024, REPEAT_LOGIN: 2025, COS_UNDETECTED: 2040, COS_GET_SIG_FAIL: 2041, MSG_SEND_FAIL: 2100, MSG_SEND_FAIL_NOT_IN_AV: 2101, MSG_INSTANCE_REQUIRED: 2105, MSG_INVALID_CONV_TYPE: 2106, MSG_F_IS_EMPTY: 2108, MSG_ONPROGRESS_ERR: 2109, MSG_REVOKE_FAIL: 2110, MSG_DELETE_FAIL: 2111, MSG_UNREAD_ALL_FAIL: 2112, READ_RECEIPT_MSG_LIST_EMPTY: 2114, MSG_SEND_GRP_WITH_TOPIC_FAIL: 2115, CANNOT_DELETE_GRP_SYSTEM_NOTICE: 2116, TRANSLATE_TEXT_FAIL: 2117, VOICE_TO_TEXT_FAIL: 2118, UNSUPPORTED_VOICE_FORMAT: 2119, MSG_I_SELECT_F_FIRST: 2251, MSG_I_TYPES_LIMIT: 2252, MSG_I_SIZE_LIMIT: 2253, MSG_A_UPLOAD_FAIL: 2300, MSG_A_SIZE_LIMIT: 2301, MSG_V_UPLOAD_FAIL: 2350, MSG_V_SIZE_LIMIT: 2351, MSG_V_TYPES_LIMIT: 2352, MSG_F_UPLOAD_FAIL: 2400, MSG_F_SELECT_F_FIRST: 2401, MSG_F_SIZE_LIMIT: 2402, MSG_F_URL_IS_EMPTY: 2403, MSG_MERGER_TYPE_INVALID: 2450, MSG_MERGER_KEY_INVALID: 2451, MSG_MERGER_DOWNLOAD_FAIL: 2452, MSG_FORWARD_TYPE_INVALID: 2453, MSG_FORWARD_INVALID_ELEMENTS: 2454, MSG_MODIFY_CONFLICT: 2480, MSG_MODIFY_DISABLED_IN_AV: 2481, CONV_NOT_FOUND: 2500, USER_OR_GRP_NOT_FOUND: 2501, CONV_UN_RECORDED_TYPE: 2502, INVALID_CONV_ID: 2503, ILLEGAL_GRP_TYPE: 2600, ILLEGAL_GRP_ID: 2602, CANNOT_FIND_GRP: 2603, CANNOT_CHANGE_OWNER_IN_AV: 2620, CANNOT_CHANGE_OWNER_TO_SELF: 2621, MEMBER_NOT_IN_GRP: 2623, JOIN_GRP_FAIL: 2660, CANNOT_ADD_MEMBER_IN_AV: 2661, CANNOT_JOIN_NON_AV_WITHOUT_LOGIN: 2662, NOT_OWNER: 2681, INVALID_MEMBER_ROLE: 2683, CANNOT_SET_SELF_MEMBER_ROLE: 2684, CANNOT_MUTE_SELF: 2685, BAN_DURATION_INVALID: 2686, OPERATION_NOT_SUPPORTED_IN_AV: 2687, NOT_MY_FRIEND: 2700, ALREADY_MY_FRIEND: 2701, FRIEND_GRP_EXISTED: 2710, FRIEND_GRP_NOT_EXIST: 2711, FRIEND_APPLICATION_NOT_EXIST: 2716, UPDATE_PROFILE_INVALID_PARAM: 2721, UPDATE_PROFILE_NO_KEY: 2722, CANNOT_ADD_SELF_TO_BLACKLIST: 2742, NETWORK_ERROR: 2800, NETWORK_TIMEOUT: 2801, NO_NETWORK: 2805, UNCAUGHT_ERROR: 2903, INVALID_OPERATION: 2905, INVALID_TRTC_CMD: 2995, OVER_FREQUENCY_LIMIT: 2996, NO_PROTOCOL: 2997, NO_MODULE: 2998, SDK_IS_NOT_READY: 2999, LOGGING_IN: 3e3, LOGIN_FAILED: 3001, KICKED_OUT_MULT_DEVICE: 3002, KICKED_OUT_MULT_ACCOUNT: 3003, KICKED_OUT_USERSIG_EXPIRED: 3004, LOGGED_OUT: 3005, KICKED_OUT_REST_API: 3006, ILLEGAL_TOPIC_ID: 3021, NO_USE: 3122, PROFANITY_FOUND: 3123, OPTIONS_IS_EMPTY: 3153, MSG_A2KEY_EXPIRED: 20002, ACCOUNT_A2KEY_EXPIRED: 70001, HELLO_ANSWER_KICKED_OUT: 1002, OPEN_SERVICE_OVERLOAD_ERROR: 60022, SIGNALING_INVALID_INVITE_ID: 8010, SIGNALING_NO_PERMISSION: 8011, SIGNALING_ALREADY_EXISTS: 8012, INVALID_CANCEL_MESSAGE: 8020, MSG_SEARCH_CURSOR_INVALID: 27002, MSG_SEARCH_CURSOR_EXPIRED: 27003 }, qn = null, u = (e(oo, [{ key: "isLoggedIn", value: function() { + return this._m.get(12).isLoggedIn(); + } }, { key: "isOversea", value: function() { + return this._m.get(12).isOversea(); + } }, { key: "isPrivateNetWork", value: function() { + var e2 = this._m.get(12); + return e2.isPrivateNetWork() && !e2.getFileDownloadProxy(); + } }, { key: "getFileDownloadProxy", value: function() { + return this._m.get(12).getFileDownloadProxy(); + } }, { key: "getDowloadFileAuthKey", value: function() { + return this._m.get(12).getDowloadFileAuthKey(); + } }, { key: "getMyUserID", value: function() { + return this._m.get(12).getUserID(); + } }, { key: "getMyTinyID", value: function() { + return this._m.get(12).getTinyID(); + } }, { key: "getSDKAppID", value: function() { + return this._m.get(12).getSDKAppID(); + } }, { key: "isIntl", value: function() { + return this._m.get(12).isIntl(); + } }, { key: "isUsingChatCore", value: function() { + return this._m.get(12).isUsingChatCore(); + } }, { key: "isDevMode", value: function() { + return this._m.get(12).isDevMode(); + } }, { key: "get", value: function(e2) { + return this._m.get(e2); + } }, { key: "getPlatform", value: function() { + return De; + } }, { key: "getCloudConfig", value: function(e2) { + return this._m.get(23).getCloudConfig(e2); + } }, { key: "emitOEvt", value: function(e2, t2) { + this._m.getOEmitInst().emit(e2, t2); + } }, { key: "emitIEvt", value: function(e2, t2) { + this._m.getIEmitInst().emit(e2, t2); + } }, { key: "getIEmitInst", value: function() { + return this._m.getIEmitInst(); + } }, { key: "req", value: function(e2) { + return this._m.get(20).req(e2); + } }, { key: "canIUse", value: function(e2) { + return this._m.get(27).canIUse(e2); + } }, { key: "getErrMsg", value: function(e2, t2, n2) { + return this._m.getErrMsg(e2, t2, n2); + } }, { key: "warn", value: function(e2, t2, n2) { + e2 = this.getErrMsg(e2, t2, n2); + e2 && M.w(e2); + } }, { key: "noUse", value: function(e2) { + var t2 = L.NO_USE; + return D({ code: t2, message: this.getErrMsg(t2, e2) }); + } }]), oo), k = { LOGIN: "wslogin", LOGOUT: "wslogout", HELLO: "wshello", KICK_OTHER: "KickOther", SYNC_UNREAD_MSG: "getmsg", SEND_C2C_MSG: "sendmsg", SEND_GRP_MSG: "send_group_msg", GET_USER_PROFILE: "portrait_get_all", UPDATE_MY_PROFILE: "portrait_set", GET_BL: "black_list_get", ADD_TO_BL: "black_list_add", RM_FROM_BL: "black_list_delete", GET_FD_LIST: "friend_get", GET_FD_PROFILE: "friend_get_specified", CHECK_FD: "friend_check", DEL_FD: "friend_delete", ADD_FD: "friend_add", UPDATE_FD: "friend_update", RESPOND_FD_APPLICATION: "friend_response", GET_FD_APPLICATION_LIST: "pendency_get", DEL_FD_APPLICATION: "pendency_delete", REFUSE_FD_APPLICATION: "pendency_refuse", REPORT_FD_APPLICATION: "pendency_report", GET_FD_GRP_LIST: "group_get", CREATE_FD_GRP: "group_add", DEL_FD_GRP: "group_delete", UPDATE_FD_GRP: "group_update", REVOKE_C2C_MSG: "msgwithdraw", SET_C2C_MSG_READ: "msgreaded", SET_C2C_PEER_MUTE_NOTIFICATIONS: "set_c2c_peer_mute_notifications", GET_C2C_PEER_MUTE_NOTIFICATIONS: "get_c2c_peer_mute_notifications", GET_C2C_ROAMING_MSG: "getroammsg", GET_C2C_PEER_READ_TIME: "get_peer_read_time", DEL_C2C_MSG: "delete_c2c_msg_ramble", MODIFY_C2C_MSG: "modify_c2c_msg", MODIFY_C2C_MSG_EXT: "set_key_values", GET_C2C_MSG_EXT: "get_key_values", ADD_C2C_MSG_REACTION: "reaction_add", RM_C2C_MSG_REACTION: "reaction_del", GET_C2C_MSG_REACTIONS: "reaction_multi_stat", GET_C2C_MSG_REACTION_USER_LIST: "reaction_iterate", PAGING_GET_CONV_LIST: "page_get", DEL_CONV: "batch_delete", CLEAR_HISTORY_MSG: "clear_msg", PIN_CONV: "top", DEL_GROUP_AT_TIPS: "deletemsg", SET_CONV_CUSTOM_DATA: "set_conv_custom_data", MARK_CONV: "mark_contact", CREATE_CONV_GRP: "create_contact_group", DEL_CONV_GRP: "del_contact_group", RENAME_CONV_GRP: "update_contact_group", ADD_CONV_TO_GRP: "add_conv_to_group", DEL_CONV_FROM_GRP: "del_conv_from_group", GET_CONV_GRP_LIST: "get_contact_group", SEARCH_CONV_GRP_MARK: "search_contact_group", GET_GRP_LIST: "get_joined_group_list", GET_GRP_PROFILE: "get_group_self_member_info", CREATE_GRP: "create_group", DISMISS_GRP: "destroy_group", UPDATE_GRP_PROFILE: "modify_group_base_info", APPLY_JOIN_GRP: "apply_join_group", APPLY_JOIN_GRP_NOAUTH: "apply_join_group_noauth", QUIT_GRP: "quit_group", SEARCH_GRP: "get_group_public_info", CHANGE_GRP_OWNER: "change_group_owner", HANDLE_GRP_APPLICATION: "handle_apply_join_group", HANDLE_INVITE_JOIN_GRP: "handle_invite_join_permission_group", HANDLE_GRP_INVITATION: "handle_invite_join_group", REVOKE_GRP_MSG: "group_msg_recall", SET_GRP_MSG_READ: "msg_read_report", SET_ALL_MSG_READ: "read_all_unread_msg", GET_GRP_ROAMING_MSG: "group_msg_get", GET_READ_RECEIPT: "get_group_msg_receipt", SEND_READ_RECEIPT: "group_msg_receipt", SEND_C2C_READ_RECEIPT: "c2c_msg_read_receipt", GET_READ_RECEIPT_DETAIL: "get_group_msg_receipt_detail", GET_GRP_PENDENCY: "get_pendency", DEL_GRP_SYSTEM_NOTICE: "deletemsg", AV_POLLING: "get_msg", AV_NOAUTH_POLLING: "get_msg_noauth", GET_ONLINE_MBR_NUM: "get_online_member_num", DEL_GRP_MSG: "delete_group_ramble_msg_by_seq", MODIFY_GRP_MSG: "modify_group_msg", SET_GRP_ATTR: "set_group_attr", MODIFY_GRP_ATTR: "modify_group_attr", DEL_GRP_ATTR: "delete_group_attr", CLEAR_GRP_ATTR: "clear_group_attr", GET_GRP_ATTR: "get_group_attr", MODIFY_GRP_MSG_EXT: "group_set_key_values", GET_GRP_MSG_EXT: "group_get_key_values", GET_GRP_NOTIFY: "batch_get_group_notify", UPDATE_GRP_COUNTER: "update_group_counter", GET_GRP_COUNTER: "get_group_counter", ADD_GRP_MSG_REACTION: "group_reaction_add", RM_GRP_MSG_REACTION: "group_reaction_del", GET_GRP_MSG_REACTIONS: "group_reaction_multi_stat", GET_GRP_MSG_REACTION_USER_LIST: "group_reaction_iterate", GET_GRP_MBR_LIST: "get_group_member_info", GET_AV_MBR_LIST: "get_members", GET_GRP_MBR_PROFILE: "get_specified_group_member_info", ADD_GRP_MBR: "add_group_member", DEL_GRP_MBR: "delete_group_member", BAN_AV_MBR: "ban_group_member", MODIFY_GRP_MBR_INFO: "modify_group_member_info", MARK_AV_MBR_INFO: "modify_user_info", COS_SIGN: "cos", COS_PRE_SIG: "pre_sig", SIMPLE_COS_PRE_SIG: "simple_sig", GET_IMAGE_INFO: "get_imageinfo", GET_IP: "get_final_ip", VIDEO_COVER: "video_cover", SSO_STAT: "tim_web_report_v2", PING: "alive", MSG_PUSH: "msg_push", MSG_CLOUD_SEARCH: "query", MULTI_MSG_PUSH: "multi_msg_push_ws", MSG_PUSH_ACK: "ws_msg_push_ack", STATUS_FORCE_OFFLINE: "stat_forceoffline", UPLOAD_MERGER_MSG: "save_relay_json_msg", DOWNLOAD_MERGER_MSG: "get_relay_json_msg", FETCH_CLOUD_CTRL_CONFIG: "fetch_config", PUSHED_CLOUD_CTRL_CONFIG: "push_configv2", FETCH_COMMERCIAL_CONFIG: "fetch_imsdk_purchase_bitsv2", PUSHED_COMMERCIAL_CONFIG: "push_imsdk_purchase_bitsv2", OVERLOAD_NOTIFY: "notify2", CREATE_TOPIC: "create_topic", DEL_TOPIC: "destroy_topic", UPDATE_TOPIC_PROFILE: "modify_topic", GET_TOPIC_LIST: "get_topic", SET_SELF_STATUS: "ws_set_custom_status", GET_USER_STATUS: "ws_get_user_status", SUB_USER_STATUS: "ws_status_subscribe", UNSUB_USER_STATUS: "ws_status_unsubscribe", STAT_BACKGROUND: "ws_stat_background", STAT_FOREGROUND: "ws_stat_foreground", SET_TOKEN: "ws_stat_settoken", PUSH_REPORT: "uniapp_sdk_report", GET_PROFANITY_LIST: "get_local_words", TRANSLATE_TEXT: "ws_batch_trans_text", VOICE_TO_TEXT: "ws_sentence_recognition", FOLLOW: "follow_add", UNFOLLOW: "follow_delete", GET_FOLLOW: "follow_get", GET_FOLLOW_INFO: "follow_get_info", CHECK_FOLLOW_TYPE: "follow_check", SET_ALL_RECEIVE_MSG_OPT: "ws_set_do_not_disturb", GET_ALL_RECEIVE_MSG_OPT: "ws_get_do_not_disturb" }, xn = "networkRTT", Vn = "messageE2EDelay", Hn = "sendMessageC2C", Bn = "sendMessageGroup", Kn = "sendMessageGroupAV", Yn = "sendMessageRichMedia", Wn = "cosUpload", jn = "messageReceivedGroup", Jn = "messageReceivedGroupAVPush", zn = "messageReceivedGroupAVPull", Xn = (F(bn = {}, xn, 2), F(bn, Vn, 3), F(bn, Hn, 4), F(bn, Bn, 5), F(bn, Kn, 6), F(bn, Yn, 7), F(bn, jn, 8), F(bn, Jn, 9), F(bn, zn, 10), F(bn, Wn, 11), bn), Zn = { info: 4, warning: 5, error: 6 }, Qn = { wifi: 1, "2g": 2, "3g": 3, "4g": 4, "5g": 5, unknown: 6, none: 7, online: 8 }, $n = { login: 4, plugin_search: 16, plugin_translate: 16, plugin_voice_to_text: 16, plugin_cs: 16, plugin_push: 16, plugin_bot: 16, plugin_emoji_reaction: 16 }, G = (e(no, [{ key: "updateTimeStamp", value: function() { + this.timestamp = We(); + } }, { key: "start", value: function(e2) { + return this._startts = e2, this; + } }, { key: "end", value: function() { + var e2, t2 = this, n2 = 0 < arguments.length && void 0 !== arguments[0] && arguments[0]; + this._sentFlag || (this._netMonitorModule && (e2 = this._netMonitorModule.getNetworkType(), this.setNetworkType(e2)), e2 = We(), 0 === this.costTime && (this.costTime = e2 - this._startts), this.setMoreMessage("startts:".concat(this._startts, " endts:").concat(e2)), n2 ? (this._sentFlag = true, this._eventStatModule && this._eventStatModule.pushIn(this)) : setTimeout(function() { + t2._sentFlag = true, t2._eventStatModule && t2._eventStatModule.pushIn(t2); + }, 0)); + } }, { key: "setError", value: function(e2) { + var t2; + return e2 instanceof Error ? this._sentFlag || (t2 = true, (t2 = this._netMonitorModule ? this._netMonitorModule.isOnline() : t2) ? (e2.code && this.setCode(e2.code), e2.message && this.setMoreMessage(e2.message)) : this.setCode(L.NO_NETWORK), this.setLevel("error")) : M.w("".concat(this._n, ".setError value not instanceof Error, please check!")), this; + } }, { key: "setCode", value: function(e2) { + return N(e2) || this._sentFlag || ("ECONNABORTED" === e2 && (this.code = 103), R(e2) ? this.code = e2 : M.w("".concat(this._n, ".setCode value not a number, please check!"), e2, b(e2))), this; + } }, { key: "setMessage", value: function(e2) { + return N(e2) || this._sentFlag || (R(e2) && (this.message = e2.toString()), m(e2) && (this.message = e2)), this; + } }, { key: "setCostTime", value: function(e2) { + return this.costTime = e2, this; + } }, { key: "setLevel", value: function(e2) { + return N(e2) || this._sentFlag || (this.level = Zn[e2]), this; + } }, { key: "setMoreMessage", value: function(e2) { + return S(this.moreMessage) ? this.moreMessage = "".concat(e2) : this.moreMessage += " ".concat(e2), this; + } }, { key: "setNetworkType", value: function(e2) { + return N(e2) ? M.w("".concat(this._n, ".setNetworkType value is undefined, please check!")) : (e2 = Qn[e2.toLowerCase()], N(e2) || (this.networkType = e2)), this; + } }, { key: "getStartTs", value: function() { + return this._startts; + } }, { key: "setUIPlatform", value: function(e2) { + return this.uiPlatform = e2, this; + } }, { key: "setExtension", value: function(e2) { + return this.extension = e2, this; + } }, { key: "setEventType", value: function(e2) { + return this.eventType = e2, this; + } }], [{ key: "bindEventStatModule", value: function(e2) { + no.prototype._eventStatModule = e2; + } }, { key: "bindNetMonitorModule", value: function(e2) { + no.prototype._netMonitorModule = e2; + } }]), no), eo = (e(to, [{ key: "setText", value: function(e2) { + this.content.text = e2; + } }, { key: "sendable", value: function() { + return 0 !== this.content.text.length; + } }]), to); + function to(e2) { + d(this, to), this.type = A.MSG_TEXT, this.content = { text: e2.text || "" }; + } + function no(e2) { + d(this, no), this._n = "SSOLogData", this.eventType = $n[e2] || 0, this.timestamp = 0, this.networkType = 8, this.code = 0, this.message = "", this.moreMessage = "", this.extension = e2, this.costTime = 0, this.duplicate = false, this.level = 4, this.uiPlatform = void 0, this._sentFlag = false, this._startts = We(); + } + function oo(e2) { + d(this, oo), this._m = e2, this._n = ""; + } + function io(e2) { + d(this, io), t2 = kn.call(this); + var t2, n2 = e2.code, o2 = e2.message, e2 = e2.data; + return t2.code = n2, o2 ? t2.message = o2 : t2._getErrMsg && (t2.message = t2._getErrMsg(t2.code)), t2.data = e2 || {}, t2; + } + function ao(e2, t2, n2, o2) { + var i2, o2 = 3 < arguments.length && void 0 !== o2 ? o2 : []; + if (e2) + return i2 = e2, t2 && (e2.startsWith("http://") ? i2 = e2.replace(/^http:\/\/[^/]+/, t2) : e2.startsWith("https://") && (i2 = e2.replace(/^https:\/\/[^/]+/, t2))), n2 && -1 === i2.indexOf("authKey=") && co(i2, o2) ? (-1 < i2.indexOf("?") ? "".concat(i2, "&authKey=") : "".concat(i2, "?authKey=")).concat(n2) : i2; + } + function so(e2, t2, n2) { + var n2 = 2 < arguments.length && void 0 !== n2 ? n2 : []; + return e2 === A.MSG_VIDEO ? co((t2[0].content || t2[0].payload).snapshotUrl, n2) && (t2[0].content ? (t2[0].content.snapshotUrl = ro(t2[0].content.snapshotUrl), t2[0].content.thumbUrl = ro(t2[0].content.thumbUrl)) : (t2[0].payload.snapshotUrl = ro(t2[0].payload.snapshotUrl), t2[0].payload.thumbUrl = ro(t2[0].payload.thumbUrl))) : e2 === A.MSG_FILE ? co((t2[0].content || t2[0].payload).fileUrl, n2) && (t2[0].content ? t2[0].content.fileUrl = ro(t2[0].content.fileUrl) : t2[0].payload.fileUrl = ro(t2[0].payload.fileUrl)) : e2 === A.MSG_MERGER && (e2 = (n2 = t2[0].content || t2[0].payload).downloadKey, n2 = void 0 === (n2 = n2.messageList) ? [] : n2, S(void 0 === e2 ? "" : e2)) && n2.forEach(function(e3) { + so(e3.messageBody[0].type, e3.messageBody); + }), t2; + } + function ro(e2) { + if (!e2) + return e2; + if (-1 === e2.indexOf("authKey=")) + return e2; + for (var e2 = e2.split("?"), t2 = e2[1].split("&"), n2 = 0, o2 = 0; o2 < t2.length; o2++) + if (-1 < t2[o2].indexOf("authKey=")) { + n2 = o2; + break; + } + return t2.splice(n2, 1), 0 < t2.length ? "".concat(e2[0], "?").concat(t2.join("&")) : e2[0]; + } + function co(e2, t2) { + var n2 = false; + if (e2) { + var e2 = e2.match(/:\/\/([0-9]?\.)?(.[^/:]+)/), o2 = e2 && e2[2] || ""; + if (o2.includes("rich-dev")) + return 1; + for (var i2 = 0; i2 < t2.length; i2++) + if (o2.endsWith(t2[i2])) { + n2 = true; + break; + } + } + return n2; + } + e(bo, [{ key: "_initImageInfoModel", value: function() { + var t2 = this; + this._ImageInfoModel = function(e2) { + this.instanceID = ft(9999999), this.sizeType = e2.type || 0, this.type = 0, this.size = e2.size || 0, this.width = e2.width || 0, this.height = e2.height || 0, this.imageUrl = e2.imageUrl || e2.url || "", this.url = ao(e2.url || t2._imageMemoryURL, t2._fileDownloadProxy, t2._authKey, t2._fileDNList); + }, this._ImageInfoModel.prototype = { setSizeType: function(e2) { + this.sizeType = e2; + }, setType: function(e2) { + this.type = e2; + }, setImageUrl: function(e2) { + e2 && (this.imageUrl = e2); + }, getImageUrl: function() { + return this.imageUrl; + } }; + } }, { key: "initImageInfoArray", value: function(e2) { + for (var t2, n2 = 0, o2 = null; n2 <= 2; ) + t2 = N(e2) || N(e2[n2]) ? { type: 0, size: 0, width: 0, height: 0, url: "" } : e2[n2], (o2 = new this._ImageInfoModel(t2)).setSizeType(n2 + 1), o2.setType(n2), this.addImageInfo(o2), n2++; + this.updateAccessSideImageInfoArray(); + } }, { key: "updateImageInfoArray", value: function(e2) { + for (var t2, n2 = this.content.imageInfoArray.length, o2 = 0; o2 < n2; o2++) + t2 = this.content.imageInfoArray[o2], e2[o2].size && (t2.size = e2[o2].size), e2[o2].url && t2.setImageUrl(e2[o2].url), e2[o2].width && (t2.width = e2[o2].width), e2[o2].height && (t2.height = e2[o2].height); + } }, { key: "_autoFixUrl", value: function() { + for (var e2 = this.content.imageInfoArray.length, t2 = "", n2 = "", o2 = ["http", "https"], i2 = null, a2 = 0; a2 < e2; a2++) + this.content.imageInfoArray[a2].url && "" !== (i2 = this.content.imageInfoArray[a2]).imageUrl && (n2 = i2.imageUrl.slice(0, i2.imageUrl.indexOf("://") + 1), t2 = i2.imageUrl.slice(i2.imageUrl.indexOf("://") + 1), o2.indexOf(n2) < 0 && (n2 = "https:"), this.content.imageInfoArray[a2].setImageUrl([n2, t2].join(""))); + } }, { key: "updatePercent", value: function(e2) { + this._percent = e2, 1 < this._percent && (this._percent = 1); + } }, { key: "updateImageFormat", value: function(e2) { + this.content.imageFormat = Xe[e2.toUpperCase()] || Xe.UNKNOWN; + } }, { key: "createImageDataASURLInWeb", value: function(e2) { + void 0 !== e2 && 0 < e2.files.length && (this._imageMemoryURL = window.URL.createObjectURL(e2.files[0])); + } }, { key: "createImageDataASURL", value: function(e2) { + e2 && e2.url && (this._imageMemoryURL = e2.url); + } }, { key: "replaceImageInfo", value: function(e2, t2) { + this.content.imageInfoArray[t2] instanceof this._ImageInfoModel || (this.content.imageInfoArray[t2] = e2); + } }, { key: "addImageInfo", value: function(e2) { + 3 <= this.content.imageInfoArray.length || this.content.imageInfoArray.push(e2); + } }, { key: "updateAccessSideImageInfoArray", value: function() { + var e2 = this.content.imageInfoArray, t2 = e2[0], n2 = t2.width, n2 = void 0 === n2 ? 0 : n2, t2 = t2.height, t2 = void 0 === t2 ? 0 : t2; + 0 !== n2 && 0 !== t2 && (Bt(e2), Object.assign(e2[2], Ht({ originWidth: n2, originHeight: t2, min: 720 }))); + } }, { key: "sendable", value: function() { + return 0 !== this.content.imageInfoArray.length && "" !== this.content.imageInfoArray[0].imageUrl && 0 !== this.content.imageInfoArray[0].size; + } }]); + var uo = bo, lo = (e(Uo, [{ key: "sendable", value: function() { + return null !== this.content; + } }]), Uo), po = (e(Po, [{ key: "updatePercent", value: function(e2) { + this._percent = e2, 1 < this._percent && (this._percent = 1); + } }, { key: "updateAudioUrl", value: function(e2) { + this.content.remoteAudioUrl = e2; + } }, { key: "sendable", value: function() { + return "" !== this.content.remoteAudioUrl; + } }]), Po), _o = { from: true, groupID: true, groupName: true, to: true }, ho = (e(Go, [{ key: "_initContent", value: function(t2) { + var n2 = this; + Object.keys(t2).forEach(function(e2) { + switch (e2) { + case "remarkInfo": + break; + case "groupProfile": + n2.content.groupProfile = {}, n2._initGroupProfile(t2[e2]); + break; + case "operatorInfo": + n2.content.operatorInfo = {}, n2._initOperatorInfo(t2[e2]); + break; + case "memberInfoList": + case "msgMemberInfo": + n2._updateMemberList(t2[e2]); + break; + case "memberExtraInfo": + case "onlineMemberInfo": + break; + case "memberNum": + n2.content[e2] = t2[e2], n2.content.memberCount = t2[e2]; + break; + case "newGroupProfile": + n2.content.newGroupProfile = {}, n2._initNewGroupProfile(t2[e2]); + break; + default: + n2.content[e2] = t2[e2]; + } + }), this.content.userIDList || (this.content.userIDList = [this.content.operatorID]); + } }, { key: "_initGroupProfile", value: function(e2) { + for (var t2 = Object.keys(e2), n2 = 0; n2 < t2.length; n2++) { + var o2 = t2[n2]; + _o[o2] && (this.content.groupProfile[o2] = e2[o2]); + } + } }, { key: "_initOperatorInfo", value: function(e2) { + for (var t2 = Object.keys(e2), n2 = 0; n2 < t2.length; n2++) { + var o2 = t2[n2]; + this.content.operatorInfo[o2] = e2[o2]; + } + } }, { key: "_updateMemberList", value: function(e2) { + S(this.content.memberList) ? this.content.memberList = e2 : this.content.memberList.forEach(function(t2) { + e2.forEach(function(e3) { + t2.userID === e3.userID && Object.assign(t2, e3); + }); + }); + } }, { key: "_initNewGroupProfile", value: function(e2) { + for (var t2 = Object.keys(e2), n2 = 0; n2 < t2.length; n2++) { + var o2 = t2[n2]; + this.content.newGroupProfile[o2] = "muteAllMembers" !== o2 ? e2[o2] : 1 === e2[o2]; + } + } }]), Go), go = { from: true, groupID: true, groupName: true, to: true, groupType: true }, fo = (e(No, [{ key: "_initContent", value: function(t2) { + var n2 = this; + Object.keys(t2).forEach(function(e2) { + switch (e2) { + case "memberInfoList": + break; + case "remarkInfo": + n2.content.handleMessage = t2[e2]; + break; + case "groupProfile": + n2.content.groupProfile = {}, n2._initGroupProfile(t2[e2]); + break; + default: + n2.content[e2] = t2[e2]; + } + }); + } }, { key: "_initGroupProfile", value: function(e2) { + for (var t2 = Object.keys(e2), n2 = 0; n2 < t2.length; n2++) { + var o2 = t2[n2]; + go[o2] && ("groupName" === o2 ? this.content.groupProfile.name = e2[o2] : this.content.groupProfile[o2] = e2[o2]); + } + } }]), No), mo = (e(Oo, [{ key: "_getFileInfo", value: function(e2) { + var t2, n2; + return N(e2.fileName) || N(e2.fileSize) ? (t2 = e2.file.files[0], Ie && (t2.path && -1 !== t2.path.indexOf(".") && (n2 = t2.path.slice(t2.path.lastIndexOf(".") + 1).toLowerCase(), t2.type = n2, t2.name || (t2.name = "".concat(ft(999999), ".").concat(n2))), t2.name || (t2.type = "", t2.name = t2.path.slice(t2.path.lastIndexOf("/") + 1).toLowerCase()), t2.suffix && (t2.type = t2.suffix), t2.url || (t2.url = t2.path)), { size: t2.size, name: t2.name }) : { size: e2.fileSize, name: e2.fileName }; + } }, { key: "updatePercent", value: function(e2) { + this._percent = e2, 1 < this._percent && (this._percent = 1); + } }, { key: "updateFileUrl", value: function(e2) { + this.content.fileUrl = e2; + } }, { key: "sendable", value: function() { + return "" !== this.content.fileUrl && "" !== this.content.fileName && 0 !== this.content.fileSize; + } }]), Oo), vo = (e(Ro, [{ key: "setData", value: function(e2) { + return this.content.data = e2, this; + } }, { key: "setDescription", value: function(e2) { + return this.content.description = e2, this; + } }, { key: "setExtension", value: function(e2) { + return this.content.extension = e2, this; + } }, { key: "sendable", value: function() { + return 0 !== this.content.data.length || 0 !== this.content.description.length || 0 !== this.content.extension.length; + } }]), Ro), Io = (e(Ao, [{ key: "updatePercent", value: function(e2) { + this._percent = e2, 1 < this._percent && (this._percent = 1); + } }, { key: "updateVideoUrl", value: function(e2) { + e2 && (this.content.remoteVideoUrl = e2); + } }, { key: "updateSnapshotInfo", value: function(e2) { + var t2 = e2.snapshotUrl, n2 = e2.snapshotWidth, e2 = e2.snapshotHeight; + S(t2) || (this.content.thumbUrl = this.content.snapshotUrl = t2), S(n2) || (this.content.thumbWidth = this.content.snapshotWidth = Number(n2)), S(e2) || (this.content.thumbHeight = this.content.snapshotHeight = Number(e2)); + } }, { key: "sendable", value: function() { + return "" !== this.content.remoteVideoUrl; + } }]), Ao), Mo = (e(ko, [{ key: "sendable", value: function() { + return true; + } }]), ko), yo = (e(So, [{ key: "_patchRichMediaPayload", value: function(e2, t2) { + e2 === A.MSG_IMAGE ? t2.imageInfoArray.forEach(function(e3) { + !e3.imageUrl && e3.url && (e3.imageUrl = e3.url, e3.sizeType = e3.type, 1 === e3.type ? e3.type = 0 : 3 === e3.type && (e3.type = 1)); + }) : e2 === A.MSG_VIDEO ? !t2.remoteVideoUrl && t2.videoUrl && (t2.remoteVideoUrl = t2.videoUrl) : e2 === A.MSG_AUDIO ? !t2.remoteAudioUrl && t2.url && (t2.remoteAudioUrl = t2.url) : e2 === A.MSG_FILE && !t2.fileUrl && t2.url && (t2.fileUrl = t2.url, t2.url = void 0); + } }, { key: "_updateRichMediaDownloadUrl", value: function(e2, t2, n2, o2, i2) { + (n2 || o2) && (e2 === A.MSG_IMAGE ? t2.imageInfoArray.forEach(function(e3) { + e3.url = ao(e3.url, n2, o2, i2); + }) : e2 === A.MSG_VIDEO ? (t2.videoUrl = ao(t2.videoUrl, n2, o2, i2), t2.snapshotUrl = ao(t2.thumbUrl, n2, o2, i2), t2.snapshotHeight = t2.thumbHeight, t2.snapshotWidth = t2.thumbWidth) : e2 === A.MSG_AUDIO ? t2.url = ao(t2.url, n2, o2, i2) : e2 === A.MSG_FILE && (t2.fileUrl = ao(t2.fileUrl, n2, o2, i2))); + } }]), So), Co = (e(Lo, [{ key: "sendable", value: function() { + return !S(this.content.messageList) || !S(this.content.downloadKey); + } }]), Lo), To = { 1: A.MSG_PRIORITY_HIGH, 2: A.MSG_PRIORITY_NORMAL, 3: A.MSG_PRIORITY_LOW, 4: A.MSG_PRIORITY_LOWEST }, Do = (e(Eo, [{ key: "elements", get: function() { + return this._elements; + } }, { key: "getElements", value: function() { + return this._elements; + } }, { key: "extractGroupInfo", value: function(e2) { + null !== e2 && (m(e2.nick) && (this.nick = e2.nick), m(e2.avatar) && (this.avatar = e2.avatar), e2 = e2.messageFromAccountExtraInformation, f(e2)) && m(e2.nameCard) && (this.nameCard = e2.nameCard); + } }, { key: "handleGroupAtInfo", value: function(e2) { + var t2 = this; + e2.payload && e2.payload.atUserList && e2.payload.atUserList.forEach(function(e3) { + e3 !== A.MSG_AT_ALL ? (t2._groupAtInfoList.push({ groupAtAllFlag: 0, groupAtUserID: e3 }), t2.atUserList.push(e3)) : (t2._groupAtInfoList.push({ groupAtAllFlag: 1 }), t2.atUserList.push(A.MSG_AT_ALL)); + }), O(e2.groupAtInfo) && e2.groupAtInfo.forEach(function(e3) { + 0 === e3.groupAtAllFlag ? t2.atUserList.push(e3.groupAtUserID) : 1 === e3.groupAtAllFlag && t2.atUserList.push(A.MSG_AT_ALL); + }); + } }, { key: "getGroupAtInfoList", value: function() { + return this._groupAtInfoList; + } }, { key: "_initProxy", value: function() { + this._elements[0] && (this.payload = this._elements[0].content, this.type = this._elements[0].type); + } }, { key: "reInitialize", value: function(e2) { + e2 && (this.status = this.from ? Rn : An, !this.from) && (this.from = e2), this._initFlow(e2), this._initSequence(e2), this._concatConversationID(e2), this.generateMessageID(); + } }, { key: "isSendable", value: function() { + return 0 !== this._elements.length && (true === this._relayFlag || "function" == typeof this._elements[0].sendable && this._elements[0].sendable()); + } }, { key: "_initTo", value: function(e2) { + this.conversationType === A.CONV_GROUP && (this.to = e2.groupID); + } }, { key: "_initSequence", value: function(e2) { + var t2, n2, o2; + 0 === this.clientSequence && e2 && (this.clientSequence = !!(e2 = e2) && (void 0 === St[e2] && (o2 = /* @__PURE__ */ new Date(), t2 = "3".concat(o2.getHours()).slice(-2), n2 = "0".concat(o2.getMinutes()).slice(-2), o2 = "0".concat(o2.getSeconds()).slice(-2), St[e2] = parseInt([t2, n2, o2, "0001"].join("")), o2 = n2 = t2 = null, M.l("autoIncrementIndex start index:".concat(St[e2]))), St[e2]++)), 0 === this.sequence && this.conversationType === A.CONV_C2C && (this.sequence = this.clientSequence); + } }, { key: "generateMessageID", value: function() { + this.from === A.CONV_SYSTEM && (this.senderTinyID = "144115198244471703"), this.ID = "".concat(this.senderTinyID, "-").concat(this.clientTime, "-").concat(this.random); + } }, { key: "_initFlow", value: function(e2) { + "" !== e2 && (e2 === this.from ? (this.flow = "out", this.isRead = true) : this.flow = "in"); + } }, { key: "_concatConversationID", value: function(e2) { + var t2 = this.to, n2 = this.conversationType; + n2 !== A.CONV_SYSTEM ? (e2 = n2 === A.CONV_C2C ? e2 === this.from ? t2 : this.from : this.to, this.conversationID = e2 ? "".concat(n2).concat(e2) : null) : this.conversationID = A.CONV_SYSTEM; + } }, { key: "isElement", value: function(e2) { + return e2 instanceof eo || e2 instanceof uo || e2 instanceof lo || e2 instanceof po || e2 instanceof mo || e2 instanceof Io || e2 instanceof ho || e2 instanceof fo || e2 instanceof vo || e2 instanceof Mo || e2 instanceof Co; + } }, { key: "setElement", value: function(e2, t2, n2, o2) { + var i2 = this; + if (this.isElement(e2)) + this._elements = [e2]; + else { + var a2 = function(e3) { + if (e3.type && e3.content) + switch (e3.type) { + case A.MSG_TEXT: + i2.setTextElement(e3.content); + break; + case A.MSG_IMAGE: + i2.setImageElement(e3.content, t2, n2, o2); + break; + case A.MSG_AUDIO: + i2.setAudioElement(e3.content, t2, n2, o2); + break; + case A.MSG_FILE: + i2.setFileElement(e3.content, t2, n2, o2); + break; + case A.MSG_VIDEO: + i2.setVideoElement(e3.content, t2, n2, o2); + break; + case A.MSG_CUSTOM: + i2.setCustomElement(e3.content); + break; + case A.MSG_LOCATION: + i2.setLocationElement(e3.content); + break; + case A.MSG_GRP_TIP: + i2.setGroupTipElement(e3.content); + break; + case A.MSG_GRP_SYS_NOTICE: + i2.setGroupSystemNoticeElement(e3.content); + break; + case A.MSG_FACE: + i2.setFaceElement(e3.content); + break; + case A.MSG_MERGER: + i2.setMergerElement(e3.content, t2, n2, o2); + } + }; + if (O(e2)) + for (var s2 = 0; s2 < e2.length; s2++) + a2(e2[s2]); + else + a2(e2); + } + this._initProxy(); + } }, { key: "clearElement", value: function() { + this._elements.length = 0; + } }, { key: "setTextElement", value: function(e2) { + e2 = "string" == typeof e2 ? e2 : e2.text, e2 = new eo({ text: e2 }); + this._elements.push(e2); + } }, { key: "setImageElement", value: function(e2, t2, n2, o2) { + e2 = new uo(e2, t2, n2, o2); + this._elements.push(e2); + } }, { key: "setAudioElement", value: function(e2, t2, n2, o2) { + e2 = new po(e2, t2, n2, o2); + this._elements.push(e2); + } }, { key: "setFileElement", value: function(e2, t2, n2, o2) { + e2 = new mo(e2, t2, n2, o2); + this._elements.push(e2); + } }, { key: "setVideoElement", value: function(e2, t2, n2, o2) { + e2 = new Io(e2, t2, n2, o2); + this._elements.push(e2); + } }, { key: "setLocationElement", value: function(e2) { + e2 = new Mo(e2); + this._elements.push(e2); + } }, { key: "setCustomElement", value: function(e2) { + e2 = new vo(e2); + this._elements.push(e2); + } }, { key: "setGroupTipElement", value: function(e2) { + var t2, n2 = {}, o2 = e2.operationType; + S(e2.memberInfoList) ? e2.operatorInfo && (n2 = e2.operatorInfo) : o2 !== A.GRP_TIP_MBR_JOIN && o2 !== A.GRP_TIP_MBR_KICKED_OUT && o2 !== A.GRP_TIP_MBR_SET_ADMIN && o2 !== A.GRP_TIP_MBR_CANCELED_ADMIN || (n2 = e2.memberInfoList[0]), S(e2.memberExtraInfo) || (t2 = e2.memberExtraInfo.reason, e2.msgMemberInfo.forEach(function(e3) { + e3.reason = t2; + })); + o2 = n2.nick, n2 = n2.avatar, m(o2) && (this.nick = o2), m(n2) && (this.avatar = n2), o2 = new ho(e2); + this._elements.push(o2); + } }, { key: "setGroupSystemNoticeElement", value: function(e2) { + e2 = new fo(e2); + this._elements.push(e2); + } }, { key: "setFaceElement", value: function(e2) { + e2 = new lo(e2); + this._elements.push(e2); + } }, { key: "setMergerElement", value: function(e2, t2, n2, o2) { + e2 = new Co(e2, t2, n2, o2); + this._elements.push(e2); + } }, { key: "setIsRead", value: function(e2) { + this.isRead = e2; + } }, { key: "setRelayFlag", value: function(e2) { + this._relayFlag = e2; + } }, { key: "_computePriority", value: function(e2) { + if (!N(e2)) { + if (m(e2) && -1 !== Object.values(To).indexOf(e2)) + return e2; + if (R(e2)) { + e2 = "" + e2; + if (-1 !== Object.keys(To).indexOf(e2)) + return To[e2]; + } + } + return A.MSG_PRIORITY_NORMAL; + } }, { key: "setNickAndAvatar", value: function(e2) { + var t2 = e2.nick, e2 = e2.avatar; + m(t2) && (this.nick = t2), m(e2) && (this.avatar = e2); + } }, { key: "setNameCard", value: function(e2) { + m(e2) && (this.nameCard = e2); + } }, { key: "initC2CReadReceiptInfo", value: function(e2) { + var t2 = e2.readReceiptSentByPeer, e2 = e2.timestamp, e2 = void 0 === e2 ? 0 : e2; + this.conversationType === A.CONV_C2C && true === this.needReadReceipt && (this.readReceiptInfo.isPeerRead = 1 === (void 0 === t2 ? void 0 : t2), this.readReceiptInfo.timestamp = e2); + } }]), Eo); + function Eo(e2) { + d(this, Eo), this.ID = "", this.conversationID = e2.conversationID || null, this.conversationType = e2.conversationType || A.CONV_C2C, this.conversationSubType = e2.conversationSubType, this.time = e2.time || Math.ceil(Date.now() / 1e3), this.sequence = e2.sequence || 0, this.clientSequence = e2.clientSequence || e2.sequence || 0, this.random = e2.random || 0 === e2.random ? e2.random : ft(), this.priority = this._computePriority(e2.priority), this.nick = e2.nick || "", this.avatar = e2.avatar || "", this.isPeerRead = false, this.nameCard = "", this.hasRiskContent = on(e2.checkResult), this._elements = [], this.isPlaceMessage = e2.isPlaceMessage || 0, this.isRevoked = 2 === e2.isPlaceMessage || 8 === e2.msgFlagBits, this.from = e2.from || null, this.to = e2.to || null, this.flow = "", this.isSystemMessage = e2.isSystemMessage || false, this.protocol = e2.protocol || "JSON", this.isResend = false, this.isRead = false, this.status = e2.status || Rn, this._onlineOnlyFlag = false, this._groupAtInfoList = [], this._relayFlag = false, this.atUserList = [], this.cloudCustomData = e2.cloudCustomData || "", this.isDeleted = false, this.isModified = !!e2.messageVersion, this._isExcludedFromUnreadCount = !(!e2.messageControlInfo || 1 !== e2.messageControlInfo.excludedFromUnreadCount), this._isExcludedFromLastMessage = !(!e2.messageControlInfo || 1 !== e2.messageControlInfo.excludedFromLastMessage), this.clientTime = e2.clientTime || Be() || 0, this.senderTinyID = e2.senderTinyID || e2.tinyID || "", this.readReceiptInfo = e2.readReceiptInfo || { readCount: void 0, unreadCount: void 0, isPeerRead: void 0, timestamp: 0 }, this.needReadReceipt = true === e2.needReadReceipt || 1 === e2.needReadReceipt, this.version = e2.messageVersion || 0, this.isBroadcastMessage = e2.isBroadcastMessage || false, this._receiverList = e2.receiverList || void 0, this.isSupportExtension = true === e2.isSupportExtension || 1 === e2.isSupportExtension, this._cmConfigID = e2.customModerationConfigurationID, this.revoker = e2.revokerInfo && e2.revokerInfo.revoker || "", this.revokerInfo = e2.revokerInfo || { userID: "", nick: "", avatar: "" }, this.revokeReason = e2.revokeReason || "", this.reInitialize(e2.currentUser), this.extractGroupInfo(e2.groupProfile || null), this.handleGroupAtInfo(e2), this.initC2CReadReceiptInfo(e2); + } + function Lo(e2, t2, n2, o2) { + var i2, a2, s2, r2, c2, u2, l2; + d(this, Lo), this.type = A.MSG_MERGER, this.content = { downloadKey: "", pbDownloadKey: "", messageList: [], title: "", abstractList: [], compatibleText: "", version: 0, layersOverLimit: false }, e2.downloadKey ? (a2 = e2.downloadKey, s2 = e2.pbDownloadKey, r2 = e2.title, c2 = e2.abstractList, u2 = e2.compatibleText, i2 = e2.version, this.content.downloadKey = a2, this.content.pbDownloadKey = s2, this.content.title = r2, this.content.abstractList = c2, this.content.compatibleText = u2, this.content.version = i2 || 0) : S(e2.messageList) ? 1 === e2.layersOverLimit && (this.content.layersOverLimit = true) : (a2 = e2.messageList, s2 = e2.title, r2 = e2.abstractList, c2 = e2.compatibleText, u2 = e2.version, l2 = [], a2.forEach(function(e3) { + S(e3) || (e3 = new yo(e3, t2, n2, o2), l2.push(e3)); + }), this.content.messageList = l2, this.content.title = s2, this.content.abstractList = r2, this.content.compatibleText = c2, this.content.version = u2 || 0); + } + function So(e2, t2, n2, o2) { + var i2, a2; + d(this, So), this.from = e2.from, this.messageSender = e2.from, this.time = e2.time, this.messageSequence = e2.sequence, this.clientSequence = e2.clientSequence || e2.sequence, this.messageRandom = e2.random, this.cloudCustomData = e2.cloudCustomData || "", this.clientTime = e2.clientTime || void 0, e2.ID ? (this.ID = e2.ID || "", this.nick = e2.nick || "", this.avatar = e2.avatar || "", e2.messageBody ? this.messageBody = JSON.parse(JSON.stringify(e2.messageBody)) : this.messageBody = [{ type: e2.type, payload: e2.payload }], e2.conversationType ? e2.conversationType.startsWith(A.CONV_C2C) ? this.receiverUserID = e2.to : e2.conversationType.startsWith(A.CONV_GROUP) && (this.receiverGroupID = e2.to) : e2.receiverGroupID ? this.receiverGroupID = e2.receiverGroupID : e2.receiverUserID && (this.receiverUserID = e2.receiverUserID), this.messageReceiver = e2.to || e2.messageReceiver) : (this.nick = e2.nick || "", this.avatar = e2.avatar || "", this.messageBody = [], i2 = e2.elements[0].type, a2 = e2.elements[0].content, this._patchRichMediaPayload(i2, a2), this._updateRichMediaDownloadUrl(i2, a2, t2, n2, o2), i2 === A.MSG_MERGER ? this.messageBody.push({ type: i2, payload: new Co(a2, t2, n2, o2).content }) : this.messageBody.push({ type: i2, payload: a2 }), e2.groupID && (this.receiverGroupID = e2.groupID, this.messageReceiver = e2.groupID), e2.to && (this.receiverUserID = e2.to, this.messageReceiver = e2.to), this.ID = "".concat(e2.tinyID, "-").concat(e2.clientTime, "-").concat(e2.random)); + } + function ko(e2) { + d(this, ko), this.type = A.MSG_LOCATION; + var t2 = e2.description, n2 = e2.longitude, e2 = e2.latitude; + this.content = { description: t2, longitude: n2, latitude: e2 }; + } + function Ao(e2, t2, n2, o2) { + d(this, Ao), this.type = A.MSG_VIDEO, this._percent = 0, this.content = { remoteVideoUrl: e2.remoteVideoUrl || e2.videoUrl || "", videoFormat: e2.videoFormat, videoSecond: parseInt(e2.videoSecond, 10), videoSize: e2.videoSize, videoUrl: ao(e2.videoUrl, t2, n2, o2), videoDownloadFlag: 2, videoUUID: e2.videoUUID, thumbUUID: e2.thumbUUID, thumbFormat: e2.thumbFormat, thumbWidth: e2.thumbWidth, snapshotWidth: e2.thumbWidth, thumbHeight: e2.thumbHeight, snapshotHeight: e2.thumbHeight, thumbSize: e2.thumbSize, snapshotSize: e2.thumbSize, thumbDownloadFlag: 2, thumbUrl: ao(e2.thumbUrl, t2, n2, o2), snapshotUrl: ao(e2.thumbUrl, t2, n2, o2) }; + } + function Ro(e2) { + d(this, Ro), this.type = A.MSG_CUSTOM, this.content = { data: e2.data || "", description: e2.description || "", extension: e2.extension || "" }; + } + function Oo(e2, t2, n2, o2) { + d(this, Oo), this.type = A.MSG_FILE, this._percent = 0; + var i2 = this._getFileInfo(e2); + this.content = { downloadFlag: 2, fileUrl: ao(e2.url || e2.fileUrl, t2, n2, o2) || "", uuid: e2.uuid, fileName: i2.name || "", fileSize: i2.size || 0 }; + } + function No(e2) { + d(this, No), this.type = A.MSG_GRP_SYS_NOTICE, this.content = {}, this._initContent(e2); + } + function Go(e2) { + d(this, Go), this.type = A.MSG_GRP_TIP, this.content = {}, this._initContent(e2); + } + function Po(e2, t2, n2, o2) { + d(this, Po), this.type = A.MSG_AUDIO, this._percent = 0, this.content = { downloadFlag: 2, second: e2.second, size: e2.size, url: ao(e2.url, t2, n2, o2), remoteAudioUrl: e2.url || "", uuid: e2.uuid }; + } + function Uo(e2) { + d(this, Uo), this.type = A.MSG_FACE, this.content = e2 || null; + } + function bo(e2, t2, n2, o2) { + d(this, bo), this._imageMemoryURL = "", this._fileDownloadProxy = t2, this._authKey = n2, this._fileDNList = o2, v || ye ? this.createImageDataASURL(e2.file) : this.createImageDataASURLInWeb(e2.file), this._initImageInfoModel(), this.type = A.MSG_IMAGE, this._percent = 0, this.content = { imageFormat: e2.imageFormat || Xe.UNKNOWN, uuid: e2.uuid, imageInfoArray: [] }, this.initImageInfoArray(e2.imageInfoArray), this._autoFixUrl(); + } + function wo(e2) { + if (f(e2)) + return { pushFlag: true === e2.disablePush ? 1 : 0, title: e2.title || "", desc: e2.description || "", ext: e2.extension || "", apnsInfo: (n2 = void 0 === (n2 = (t2 = e2).apnsInfo) ? {} : n2, o2 = t2.ignoreIOSBadge, t2 = t2.disableVoipPush, o2 = true === n2.ignoreIOSBadge || true === (void 0 !== o2 && o2) ? 1 : 0, i2 = void 0, N(t2) || (i2 = false === t2 ? 1 : 0), N(n2.disableVoipPush) || (i2 = false === n2.disableVoipPush ? 1 : 0), y(y({}, n2), {}, { badgeMode: o2, isVoipPush: i2 })), androidInfo: (n2 = void 0 === (n2 = (t2 = e2).androidInfo) ? {} : n2, t2 = t2.androidOPPOChannelID, t2 = n2.OPPOChannelID || (void 0 === t2 ? "" : t2), y(y({}, n2), {}, { Sound: -1 === (i2 = (o2 = n2.sound || "").lastIndexOf(".")) ? o2 : o2.slice(0, i2), OPPOChannelID: t2, GoogleChannelID: n2.FCMChannelID || "" })) }; + var t2, n2, o2, i2; + } + t(Ho, u), Fo = n(Ho), e(Ho, [{ key: "onNewMessage", value: function(e2) { + var t2 = e2.dataList, n2 = e2.isInstantMessage, o2 = e2.C2CRemainingUnreadList, i2 = e2.C2CPairUnreadList, e2 = e2.isSyncingEnded, t2 = (n2 || M.l("".concat(this._n, ".onNewMessage C2CPairUnreadList:"), i2, "C2CRemainingUnreadList:", o2), this._assembly({ dataList: t2, C2CRemainingUnreadList: o2, C2CPairUnreadList: i2, isInstantMessage: n2 })), o2 = t2.conversationOptionsList, i2 = t2.messageList, t2 = t2.isUnreadC2CMessage, a2 = At(i2), a2 = (0 < a2.length && this.emitOEvt(h.MESSAGE_MODIFIED, a2), this.get(11).onNewMessage({ conversationOptionsList: o2, isInstantMessage: n2, isUnreadC2CMessage: t2, isSyncingEnded: e2 }), Rt(i2)); + n2 && 0 < a2.length && this.emitOEvt(h.MESSAGE_RECEIVED, a2), i2.length = 0; + } }, { key: "_assembly", value: function(e2) { + for (var t2 = e2.dataList, n2 = e2.C2CRemainingUnreadList, o2 = e2.C2CPairUnreadList, i2 = e2.isInstantMessage, a2 = null, s2 = [], r2 = [], c2 = {}, u2 = this.get(26), l2 = false, d2 = this.get(11), p2 = this.get(4), e2 = this.get(17), _2 = this.getFileDownloadProxy(), h2 = this.getDowloadFileAuthKey(), g2 = e2.getFileDNList(), f2 = 0, m2 = t2.length; f2 < m2; f2++) + if (this._isC2CNotice(t2[f2])) + this._noticeFromUnreadDBList.push(t2[f2].eventArray[0].c2CNotifyMsgArray[0]); + else { + var v2 = t2[f2], I2 = (v2.currentUser = this.getMyUserID(), v2.conversationType = A.CONV_C2C, v2.isSystemMessage = !!v2.isSystemMessage, (N(v2.nick) || N(v2.avatar)) && (l2 = true), (a2 = new Do(v2)).setElement(v2.elements, _2, h2, g2), a2.setNickAndAvatar({ nick: v2.nick, avatar: v2.avatar }), a2.conversationID); + if (i2) { + if (this._msgFromUnreadDBMap.get(a2.ID)) + continue; + var M2, y2, C2 = false, T2 = (a2.from !== this.getMyUserID() ? (y2 = d2.getLatestMessageSentByPeer(I2)) && (M2 = y2.nick, y2 = y2.avatar, l2 ? a2.setNickAndAvatar({ nick: M2, avatar: y2 }) : M2 === a2.nick && y2 === a2.avatar || (C2 = true)) : (M2 = d2.getLatestMessageSentByMe(I2)) && (y2 = M2.nick, T2 = M2.avatar, y2 === a2.nick && T2 === a2.avatar || (d2.modifyMessageSentByMe({ conversationID: I2, latestNick: a2.nick, latestAvatar: a2.avatar }), p2.mockOnNickAvatarModified(a2.nick, a2.avatar))), 1 === t2[f2].isModified); + if (d2.isMessageSentByCurrentInstance(a2) ? a2.isModified = T2 : T2 = false, 0 === v2.msgLifeTime) + a2._onlineOnlyFlag = true, d2.isMessageSentByCurrentInstance(a2) || r2.push(a2); + else { + if (!d2.pushIntoMessageList(r2, a2, T2)) + continue; + C2 && (d2.modifyMessageSentByPeer({ conversationID: I2, latestNick: a2.nick, latestAvatar: a2.avatar }), d2.updateUserProfileSpecifiedKey({ conversationID: I2, nick: a2.nick, avatar: a2.avatar })); + } + i2 && 0 < a2.clientTime && u2.addMessageDelay(a2.clientTime); + } else + this._msgFromUnreadDBMap.set(a2.ID, a2); + if (0 !== v2.msgLifeTime) { + if (false === a2._onlineOnlyFlag) { + C2 = d2.getLastMessageTime(I2); + if (R(C2) && a2.time < C2) + continue; + i2 && (N(c2[I2]) ? (v2 = 0, "in" !== a2.flow || a2._isExcludedFromUnreadCount || (v2 = 1), c2[I2] = s2.push({ conversationID: I2, unreadCount: v2, type: a2.conversationType, subType: a2.conversationSubType, lastMessage: a2._isExcludedFromLastMessage ? "" : a2 }) - 1) : (v2 = c2[I2], s2[v2].type = a2.conversationType, s2[v2].subType = a2.conversationSubType, s2[v2].lastMessage = a2._isExcludedFromLastMessage ? "" : a2, "in" !== a2.flow || a2._isExcludedFromUnreadCount || s2[v2].unreadCount++)); + } + } else + a2._onlineOnlyFlag = true; + } + this._handleNoticeFromUnreadDB(); + var D2 = false; + if (O(o2) && 0 < o2.length) + for (var E2 = 0, L2 = o2.length; E2 < L2; E2++) + !function(t3) { + if (o2[t3].from === A.CONV_SYSTEM) + return; + D2 = true; + var e3 = s2.find(function(e4) { + return e4.conversationID === "".concat(A.CONV_C2C).concat(o2[t3].from); + }); + e3 ? e3.unreadCount = o2[t3].unreadCount : s2.push({ conversationID: "".concat(A.CONV_C2C).concat(o2[t3].from), unreadCount: o2[t3].unreadCount, type: A.CONV_C2C }); + }(E2); + if (O(n2)) + for (var S2 = 0, k2 = n2.length; S2 < k2; S2++) + !function(t3) { + s2.find(function(e3) { + return e3.conversationID === "".concat(A.CONV_C2C).concat(n2[t3].from); + }) || s2.push({ conversationID: "".concat(A.CONV_C2C).concat(n2[t3].from), type: A.CONV_C2C, lastMsgTime: n2[t3].lastMsgTime }); + }(S2); + return { conversationOptionsList: s2, messageList: r2, isUnreadC2CMessage: D2 }; + } }, { key: "getMessageListFromUnreadDB", value: function() { + return p(this._msgFromUnreadDBMap.values()); + } }, { key: "_isC2CNotice", value: function(e2) { + e2 = e2.eventArray; + return !(!O(e2) || 10 !== e2[0].event); + } }, { key: "_handleNoticeFromUnreadDB", value: function() { + var t2, e2 = this._noticeFromUnreadDBList.length; + 0 !== e2 && (M.l("".concat(this._n, "._handleNoticeFromUnreadDB count:").concat(e2)), t2 = [], this._noticeFromUnreadDBList.forEach(function(e3) { + e3.hasOwnProperty("c2cMessageRevokedNotify") && t2.push(e3); + }), this.onMsgRevoked({ dataList: t2 }), this._noticeFromUnreadDBList.length = 0, t2.length = 0); + } }, { key: "onMsgRevoked", value: function(e2) { + var a2, s2 = this, r2 = this.get(11), c2 = []; + e2.dataList.forEach(function(e3) { + e3.c2cMessageRevokedNotify && (e3 = e3.c2cMessageRevokedNotify.revokedInfos, N(e3) || e3.forEach(function(e4) { + var t2 = s2.getMyUserID() === e4.from ? "".concat(A.CONV_C2C).concat(e4.to) : "".concat(A.CONV_C2C).concat(e4.from); + a2 = r2.revoke(t2, e4.sequence, e4.random); + var n2, o2 = e4.revokerInfo && e4.revokerInfo.revoker, i2 = e4.revokerInfo && e4.revokerInfo.reason || ""; + a2 ? n2 = a2 : (n2 = { conversationID: t2, sequence: e4.sequence }, e4.tinyID && e4.clientTime && e4.random && (n2.ID = "".concat(e4.tinyID, "-").concat(e4.clientTime, "-").concat(e4.random)), e4.time && (n2.time = e4.time)), n2 && (n2.revoker = o2, n2.revokeReason = i2, n2.revokerInfo = { userID: o2, nick: "", avatar: "" }, c2.push(n2)); + })); + }), 0 !== c2.length && (r2.onMessageRevoked(c2), M.l("".concat(this._n, ".onMsgRevoked count:").concat(c2.length)), r2.updateRevokerInfo(c2).then(function(e3) { + s2.emitOEvt(h.MESSAGE_REVOKED, e3); + })); + } }, { key: "onMsgReadReceipt", value: function(e2) { + var i2 = this; + e2.dataList.forEach(function(e3) { + var o2; + S(e3.c2cMessageReadReceipt) || (o2 = e3.c2cMessageReadReceipt.to, e3.c2cMessageReadReceipt.uinPairReadArray.forEach(function(e4) { + var e4 = e4.peerReadTime, t2 = (M.l("".concat(i2._n, ".onMsgReadReceipt to:").concat(o2, " peerReadTime:").concat(e4)), "".concat(A.CONV_C2C).concat(o2)), n2 = i2.get(11); + n2.recordPeerReadTime(t2, e4), n2.updateMsgIsPeerReadProp(t2, e4); + })); + }); + } }, { key: "onMsgReadNotice", value: function(e2) { + var o2 = this; + e2.dataList.forEach(function(e3) { + var n2; + S(e3.c2cMessageReadNotice) || (n2 = o2.get(11), e3.c2cMessageReadNotice.uinPairReadArray.forEach(function(e4) { + var t2 = e4.from, e4 = e4.peerReadTime, t2 = (M.l("".concat(o2._n, ".onMsgReadNotice from:").concat(t2, " lastReadTime:").concat(e4)), "".concat(A.CONV_C2C).concat(t2)); + n2.updateIsReadAfterReadReport({ conversationID: t2, lastMessageTime: e4 }), n2.updateUnreadCount(t2); + })); + }); + } }, { key: "onMsgModified", value: function(e2) { + M.l("".concat(this._n, ".onMsgModified options:"), e2); + var t2 = this.get(11); + e2.dataList.forEach(function(e3) { + t2.onMessageModified(y(y({}, e3), {}, { conversationType: A.CONV_C2C })); + }); + } }, { key: "onReadReceiptList", value: function(e2) { + M.l("".concat(this._n, ".onReadReceiptList options:"), e2), this.get(11).updateReadReceiptInfo(e2.dataList); + } }, { key: "sendMessage", value: function(e2, t2) { + e2 = this._createC2CMessagePack(e2, t2); + return this.req(e2); + } }, { key: "_createC2CMessagePack", value: function(e2, t2) { + var n2 = null, o2 = (t2 && (t2.offlinePushInfo && (n2 = t2.offlinePushInfo), true === t2.onlineUserOnly) && (n2 ? n2.disablePush = true : n2 = { disablePush: true }), ""), i2 = (m(e2.cloudCustomData) && 0 < e2.cloudCustomData.length && (o2 = e2.cloudCustomData), []), a2 = (f(t2) && f(t2.messageControlInfo) && (a2 = (r2 = t2.messageControlInfo).excludedFromUnreadCount, s2 = r2.excludedFromLastMessage, r2 = r2.excludedFromContentModeration, true === a2 && i2.push("NoUnread"), true === s2 && i2.push("NoLastMsg"), true === r2) && i2.push("NoMsgCheck"), this.isOnlineMessage(e2, t2) ? 0 : void 0), s2 = JSON.parse(JSON.stringify(e2.getElements())), r2 = this.get(17).getFileDNList(); + return { P: k.SEND_C2C_MSG, data: { fromAccount: this.getMyUserID(), toAccount: e2.to, msgBody: so(e2.type, s2, r2), cloudCustomData: o2, msgSeq: e2.sequence, msgRandom: e2.random, msgLifeTime: a2, nick: e2.nick, avatar: e2.avatar, offlinePushInfo: wo(n2), messageControlInfo: 0 !== a2 ? i2 : void 0, clientTime: e2.clientTime, needReadReceipt: true === e2.needReadReceipt ? 1 : 0, isSupportExtension: true === e2.isSupportExtension ? 1 : 0, isRelayMessage: true === e2._relayFlag ? 1 : 0, cmConfigID: e2._cmConfigID } }; + } }, { key: "isOnlineMessage", value: function(e2, t2) { + return !(!t2 || true !== t2.onlineUserOnly); + } }, { key: "revokeMessage", value: function(e2) { + return this.req({ P: k.REVOKE_C2C_MSG, data: { msgInfo: { fromAccount: e2.from, toAccount: e2.to, msgSeq: e2.sequence, msgRandom: e2.random, msgTimeStamp: e2.time } } }); + } }, { key: "deleteMessage", value: function(e2) { + var t2 = e2.to, e2 = e2.keyList; + return M.l("".concat(this._n, ".deleteMessage toAccount:").concat(t2, " count:").concat(e2.length)), this.req({ P: k.DEL_C2C_MSG, data: { fromAccount: this.getMyUserID(), to: t2, keyList: e2 } }); + } }, { key: "modifyRemoteMessage", value: function(e2) { + var t2 = e2.from, n2 = e2.to, o2 = e2.version, o2 = void 0 === o2 ? 0 : o2, i2 = e2.sequence, a2 = e2.random, s2 = e2.time, r2 = e2.payload, c2 = e2.type, u2 = e2.cloudCustomData, e2 = e2._elements, l2 = void 0; + return Xt(c2) && (1 < e2.length && e2.splice(0, 1, { type: c2, content: r2 }), l2 = e2), this.req({ P: k.MODIFY_C2C_MSG, data: { from: t2, to: n2, version: o2, sequence: i2, random: a2, time: s2, elements: l2, cloudCustomData: u2 } }); + } }, { key: "setMessageRead", value: function(e2) { + var t2 = this, n2 = e2.conversationID, o2 = e2.lastMessageTime, i2 = "".concat(this._n, ".").concat("setMessageRead"), e2 = "convID:".concat(n2, " lastMessageTime:").concat(o2), a2 = (M.l("".concat(i2, " ").concat(e2)), R(o2) || this.warn("DoNotModifyLastTime"), new G("setMessageRead")); + return a2.setMessage(e2), this.req({ P: k.SET_C2C_MSG_READ, data: { C2CMsgReaded: { cookie: "", C2CMsgReadedItem: [{ toAccount: n2.replace("C2C", ""), lastMessageTime: o2, receipt: 1 }] } } }).then(function() { + a2.end(), M.l("".concat(i2, " ok")); + var e3 = t2.get(11); + return e3.updateIsReadAfterReadReport({ conversationID: n2, lastMessageTime: o2 }), e3.updateUnreadCount(n2), C(); + }).catch(function(e3) { + return a2.setError(e3).end(), M.l("".concat(i2, " failed. error:"), e3), D(e3); + }); + } }, { key: "getRoamingMessage", value: function(e2) { + var s2 = this, r2 = "".concat(this._n, ".").concat("getRoamingMessage"), t2 = e2.peerAccount, c2 = e2.conversationID, n2 = e2.count, o2 = e2.lastMessageTime, e2 = e2.messageKey, u2 = "peerAccount:".concat(t2, " count:").concat(n2 || 15, " lastMessageTime:").concat(o2 || 0, " messageKey:").concat(e2), l2 = (M.l("".concat(r2, " ").concat(u2)), new G("getRoamingMessage")); + return this.req({ P: k.GET_C2C_ROAMING_MSG, data: { peerAccount: t2, count: n2 || 15, lastMessageTime: o2 || 0, messageKey: e2 } }).then(function(e3) { + var e3 = e3.data, t3 = e3.complete, n3 = e3.messageList, o3 = e3.messageKey, e3 = e3.lastMessageTime, i2 = (N(n3) ? M.l("".concat(r2, " ok. complete:").concat(t3, " but messageList is undefined!")) : M.l("".concat(r2, " ok. complete:").concat(t3, " count:").concat(n3.length)), l2.setMessage("".concat(u2, " complete:").concat(t3, " length:").concat(n3.length)).end(), s2.get(11)), t3 = 1 === t3, a2 = (t3 && i2.setCompleted(c2), []), n3 = i2.onRoamingMessage(n3, c2, true, a2), o3 = (i2.modifyMessageList(c2), i2.updateIsRead(c2), i2.updateRoamingMsgKeyAndTime(c2, o3, e3), i2.getPeerReadTime(c2)), o3 = (M.l("".concat(r2, " update isPeerRead property. convID:").concat(c2, " peerReadTime:").concat(o3)), o3 ? i2.updateMsgIsPeerReadProp(c2, o3) : (e3 = c2.replace(A.CONV_C2C, ""), s2.getRemotePeerReadTime([e3]).then(function() { + i2.updateMsgIsPeerReadProp(c2, i2.getPeerReadTime(c2)); + })), ""); + return 0 < n3.length ? o3 = n3[0].ID : (e3 = i2.getLocalOldestMessage(c2)) && (o3 = e3.ID), M.l("".concat(r2, " nextReqID:").concat(o3, " storedMsgCount:").concat(n3.length)), { nextReqID: o3, storedMessageList: n3, assembledMessageList: a2, isPullingCompleted: t3 }; + }).catch(function(e3) { + return l2.setMessage(u2).setError(e3).end(), M.w("".concat(r2, " failed. error:"), e3), D(e3); + }); + } }, { key: "getRoamingMessagesHopping", value: function(e2) { + var a2 = this, s2 = "".concat(this._n, ".").concat("getRoamingMessagesHopping"), t2 = e2.peerAccount, n2 = e2.time, n2 = void 0 === n2 ? 0 : n2, o2 = e2.count, r2 = e2.direction, c2 = "".concat(A.CONV_C2C).concat(t2), u2 = "peerAccount:".concat(t2, " count:").concat(o2, " time:").concat(n2, " direction:").concat(r2), l2 = (M.l("".concat(s2, " ").concat(u2)), new G("getRoamingMessagesHopping")); + return this.req({ P: k.GET_C2C_ROAMING_MSG, data: { peerAccount: t2, count: o2 + 1, lastMessageTime: n2, direction: r2 } }).then(function(e3) { + var e3 = e3.data, t3 = e3.complete, n3 = e3.messageList, n3 = void 0 === n3 ? [] : n3, e3 = e3.lastMessageTime, o3 = "complete:".concat(t3, " count:").concat(n3.length), i2 = (M.l("".concat(s2, " ok. ").concat(o3)), l2.setMessage("".concat(u2, " ").concat(o3)).end(), 1 !== t3 && (1 === r2 ? n3.pop() : n3.shift()), a2.get(11)), o3 = i2.onRoamingMessage(n3, c2, false), n3 = (a2._modifyMessageList(c2, o3), a2._computeResult({ complete: t3, lastMessageTime: e3, resultList: o3 })), t3 = (i2.storeHoppingMessageList(n3.messageList), i2.getPeerReadTime(c2)); + return M.l("".concat(s2, " update isPeerRead property. convID:").concat(c2, " peerReadTime:").concat(t3)), t3 ? i2.updateMsgIsPeerReadProp(c2, t3) : (e3 = c2.replace(A.CONV_C2C, ""), a2.getRemotePeerReadTime([e3]).then(function() { + i2.updateMsgIsPeerReadProp(c2, i2.getPeerReadTime(c2)); + })), C(n3); + }).catch(function(e3) { + return l2.setMessage(u2).setError(e3).end(), M.w("".concat(s2, " failed. error:"), e3), D(e3); + }); + } }, { key: "_computeResult", value: function(e2) { + var t2 = e2.complete, t2 = void 0 === t2 ? 0 : t2, n2 = e2.lastMessageTime, e2 = e2.resultList, e2 = { messageList: p(void 0 === e2 ? [] : e2), isCompleted: false, nextMessageTime: "" }; + return 1 === t2 ? e2.isCompleted = true : e2.nextMessageTime = n2, e2; + } }, { key: "_modifyMessageList", value: function(e2, t2) { + e2 = this.get(11).getLocalConversation(e2); + if (e2) + for (var n2 = e2.userProfile.nick, o2 = e2.userProfile.avatar, e2 = this.get(4).getNickAndAvatarByUserID(this.getMyUserID()), i2 = e2.nick, a2 = e2.avatar, s2 = t2.length - 1; 0 <= s2; s2--) { + var r2 = t2[s2]; + "in" === r2.flow && (r2.nick !== n2 && r2.setNickAndAvatar({ nick: n2 }), r2.avatar !== o2) && r2.setNickAndAvatar({ avatar: o2 }), "out" === r2.flow && (r2.nick !== i2 && r2.setNickAndAvatar({ nick: i2 }), r2.avatar !== a2) && r2.setNickAndAvatar({ avatar: a2 }); + } + } }, { key: "getRemotePeerReadTime", value: function(a2) { + var s2, r2 = this, c2 = "".concat(this._n, ".").concat("getRemotePeerReadTime"); + return S(a2) ? Promise.resolve() : (s2 = new G("getRemotePeerReadTime"), M.l("".concat(c2, " userIDList:").concat(a2)), this.req({ P: k.GET_C2C_PEER_READ_TIME, data: { userIDList: a2 } }).then(function(e2) { + var t2 = e2.data.peerReadTimeList; + M.l("".concat(c2, " ok. peerReadTimeList:").concat(t2)); + for (var n2 = "", o2 = r2.get(11), i2 = 0; i2 < a2.length; i2++) + n2 += "".concat(a2[i2], "-").concat(t2[i2], " "), 0 < t2[i2] && o2.recordPeerReadTime("".concat(A.CONV_C2C).concat(a2[i2]), t2[i2]); + s2.setMessage(n2).end(); + }).catch(function(e2) { + s2.setError(e2).end(), M.w("".concat(c2, " failed. error:"), e2); + })); + } }, { key: "sendReadReceipt", value: function(e2) { + var t2, n2 = e2[0].conversationID.replace(A.CONV_C2C, ""), o2 = new G("sendReadReceipt"), i2 = (o2.setMessage("peerAccount:".concat(n2)), this.getMyUserID()), e2 = e2.filter(function(e3) { + return e3.from !== i2 && true === e3.needReadReceipt; + }).map(function(e3) { + return { fromAccount: e3.from, toAccount: e3.to, sequence: e3.sequence, random: e3.random, time: e3.time, clientTime: e3.clientTime }; + }); + return 0 === e2.length ? D({ code: L.READ_RECEIPT_MSG_LIST_EMPTY }) : (t2 = "".concat(this._n, ".").concat("sendReadReceipt"), M.l("".concat(t2, ". peerAccount:").concat(n2, " length:").concat(e2.length)), this.req({ P: k.SEND_C2C_READ_RECEIPT, data: { peerAccount: n2, messageInfoList: e2 } }).then(function(e3) { + return o2.end(), M.l("".concat(t2, " ok")), C(); + }).catch(function(e3) { + return o2.setError(e3).end(), M.w("".concat(t2, " failed. error:"), e3), D(e3); + })); + } }, { key: "getReadReceiptList", value: function(e2) { + var t2 = e2[0].conversationID.replace(A.CONV_C2C, ""); + return M.l("".concat(this._n, ".getReadReceiptList peerAccount:").concat(t2, " msgCount:").concat(e2.length)), T({ messageList: e2 }); + } }, { key: "getMessageExtensions", value: function(e2, t2) { + return M.l("".concat(this._n, ".getMessageExtensions startSequence:").concat(t2)), this.req({ P: k.GET_C2C_MSG_EXT, data: { from: e2.from, to: e2.to, messageKey: this.getMessageKey(e2), startSequence: t2 } }); + } }, { key: "modifyMsgExts", value: function(e2, t2) { + var n2 = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : 1; + return M.l("".concat(this._n, ".modifyMsgExts operateType:").concat(n2)), this.req({ P: k.MODIFY_C2C_MSG_EXT, data: { from: e2.from, to: e2.to, messageKey: this.getMessageKey(e2), extensionList: t2, operateType: n2 } }); + } }, { key: "getMessageKey", value: function(e2) { + var t2 = e2.clientSequence, n2 = e2.random, e2 = e2.time; + return "".concat(t2, "_").concat(n2, "_").concat(e2); + } }, { key: "reset", value: function() { + M.l("".concat(this._n, ".reset")), this._msgFromUnreadDBMap.clear(), this._noticeFromUnreadDBList.length = 0; + } }]); + var Fo, qo = Ho, P = { A2KEY_AND_TINYID_UPDATED: "_inner".concat(1), CLOUD_CONFIG: "_inner".concat(2), PROFILE_UPDATED: "_inner".concat(3), CONV_SYNC_COMPLETED: "_inner".concat(4), C2C_UNREAD_HANDLE_COMPLETED: "_inner".concat(5) }, xo = (e(Vo, [{ key: "_onCloudConfig", value: function() { + var e2 = this._convM.getCloudConfig("topic_msg_limit"); + N(e2) || (this.TOPIC_MSG_LIMIT = Number(e2)), M.l("".concat(this._n, "._onCloudConfig topicMsgLimit:").concat(this.TOPIC_MSG_LIMIT)); + } }, { key: "onCheckTimer", value: function(e2) { + if (e2 % 20 == 0 && 0 < this._map.size) { + var t2, n2 = Z(this._map); + try { + for (n2.s(); !(t2 = n2.n()).done; ) { + var o2 = Y(t2.value, 2), i2 = o2[0], a2 = o2[1]; + i2.includes(it) && a2.size >= this.TOPIC_MSG_LIMIT && this._convM.clearMemMsg(i2, true); + } + } catch (e3) { + n2.e(e3); + } finally { + n2.f(); + } + } + } }, { key: "pushIn", value: function(e2) { + var t2 = 1 < arguments.length && void 0 !== arguments[1] && arguments[1], n2 = e2.conversationID, o2 = true, i2 = (this._map.has(n2) || this._map.set(n2, /* @__PURE__ */ new Map()), this._getUniqueIDOfMsg(e2)); + if (this._map.get(n2).has(i2)) { + var a2 = this._map.get(n2).get(i2); + if (!t2 || true === a2.isModified) + return false; + } + return this._map.get(n2).set(i2, e2), this._setLatestMsgSentByPeer(n2, e2), this._setLatestMsgSentByMe(n2, e2), o2; + } }, { key: "unshift", value: function(e2, t2) { + var n2; + if (O(e2) ? 0 < e2.length && (n2 = e2[0].conversationID, this._unshiftMultipleMsgs(e2, t2)) : (n2 = e2.conversationID, this._unshiftSingleMsg(e2, t2)), n2) { + var o2 = Array.from(this._map.get(n2).values()), e2 = o2.length; + if (0 !== e2) { + for (var i2 = e2 - 1; 0 <= i2; i2--) + if ("out" === o2[i2].flow) { + this._setLatestMsgSentByMe(n2, o2[i2]); + break; + } + if (n2.startsWith(A.CONV_C2C)) { + for (var a2 = e2 - 1; 0 <= a2; a2--) + if ("in" === o2[a2].flow) { + this._setLatestMsgSentByPeer(n2, o2[a2]); + break; + } + } + } + } + } }, { key: "_unshiftSingleMsg", value: function(e2, t2) { + var n2, o2, i2 = e2.conversationID, a2 = this._getUniqueIDOfMsg(e2); + this._map.has(i2) ? (n2 = this._map.get(i2), o2 = Array.from(n2), n2.has(a2) || (o2.unshift([a2, e2]), this._map.set(i2, new Map(o2)), t2.push(e2))) : (this._map.set(i2, /* @__PURE__ */ new Map()), this._map.get(i2).set(a2, e2), t2.push(e2)); + } }, { key: "_unshiftMultipleMsgs", value: function(e2, t2) { + for (var n2 = e2.length, o2 = [], i2 = e2[0].conversationID, a2 = this._map.get(i2), s2 = this._map.has(i2) ? Array.from(a2) : [], r2 = 0; r2 < n2; r2++) { + var c2 = this._getUniqueIDOfMsg(e2[r2]); + a2 && a2.has(c2) || (o2.push([c2, e2[r2]]), t2.push(e2[r2])); + } + this._map.set(i2, new Map(o2.concat(s2))); + } }, { key: "remove", value: function(e2) { + var t2 = e2.conversationID, e2 = this._getUniqueIDOfMsg(e2); + this._map.has(t2) && this._map.get(t2).delete(e2); + } }, { key: "revoke", value: function(e2, t2, n2) { + var o2; + return this._map.has(e2) ? (o2 = this._map.get(e2), this._updateMsgIsRevoked(o2, t2, n2)) : this._hoppingMsgMap.has(e2) ? (o2 = this._hoppingMsgMap.get(e2), this._updateMsgIsRevoked(o2, t2, n2)) : null; + } }, { key: "_updateMsgIsRevoked", value: function(e2, t2, n2) { + var o2, i2 = Z(e2); + try { + for (i2.s(); !(o2 = i2.n()).done; ) { + var a2 = Y(o2.value, 2)[1]; + if (a2.sequence === t2 && (N(n2) || a2.random === n2)) + return a2.isRevoked || (a2.isRevoked = true), a2; + } + } catch (e3) { + i2.e(e3); + } finally { + i2.f(); + } + } }, { key: "removeByConvID", value: function(e2) { + var t2 = this._map.has(e2); + M.l("".concat(this._n, ".removeByConvID convID:").concat(e2, " has:").concat(t2)), t2 && (this._map.delete(e2), this._latestMsgSentByPeerMap.delete(e2), this._latestMsgSentByMeMap.delete(e2)); + } }, { key: "findMessage", value: function(e2) { + return this._findMsg(e2, this._map) || this._findMsg(e2, this._hoppingMsgMap); + } }, { key: "_findMsg", value: function(e2, t2) { + var n2, o2 = null, i2 = Z(t2); + try { + for (i2.s(); !(n2 = i2.n()).done; ) + for (var a2 = p(Y(n2.value, 2)[1].values()), s2 = a2.length, r2 = 0; r2 < s2; r2++) + if (a2[r2].ID === e2) { + o2 = a2[r2]; + break; + } + } catch (e3) { + i2.e(e3); + } finally { + i2.f(); + } + return o2; + } }, { key: "updateMsgIsPeerReadProp", value: function(e2, t2) { + var n2, o2 = []; + return this._map.has(e2) ? (n2 = this._map.get(e2), o2 = this._updateMsgIsPeerReadProp(n2, t2)) : this._hoppingMsgMap.has(e2) && (n2 = this._hoppingMsgMap.get(e2), o2 = this._updateMsgIsPeerReadProp(n2, t2)), M.l("".concat(this._n, ".updateMsgIsPeerReadProp convID:").concat(e2, " peerReadTime:").concat(t2, " count:").concat(o2.length)), o2; + } }, { key: "_updateMsgIsPeerReadProp", value: function(e2, t2) { + var n2, o2 = [], i2 = Z(e2); + try { + for (i2.s(); !(n2 = i2.n()).done; ) { + var a2 = Y(n2.value, 2)[1]; + a2.time <= t2 && !a2.isPeerRead && "out" === a2.flow && (a2.isPeerRead = true, o2.push(a2)); + } + } catch (e3) { + i2.e(e3); + } finally { + i2.f(); + } + return o2; + } }, { key: "updateMsgIsModifiedProp", value: function(e2) { + var t2 = e2.conversationID; + this._map.has(t2) && (e2 = this._getUniqueIDOfMsg(e2), t2 = this._map.get(t2).get(e2)) && (t2.isModified = true); + } }, { key: "hasLocalMsgList", value: function(e2) { + return this._map.has(e2); + } }, { key: "getLocalMsgList", value: function(e2) { + return this.hasLocalMsgList(e2) ? p(this._map.get(e2).values()) : []; + } }, { key: "getLocalMaxSeq", value: function(e2) { + return this.hasLocalMsgList(e2) ? (e2 = p(this._map.get(e2).values()).map(function(e3) { + return e3.sequence; + }), Math.max.apply(Math, p(e2))) : 0; + } }, { key: "getLocalMaxTime", value: function(e2) { + return this.hasLocalMsgList(e2) ? (e2 = p(this._map.get(e2).values()).map(function(e3) { + return e3.time; + }), Math.max.apply(Math, p(e2))) : 0; + } }, { key: "hasLocalMsg", value: function(e2, t2) { + for (var n2 = false, o2 = this.getLocalMsgList(e2), i2 = o2.length, a2 = 0; a2 < i2; a2++) + o2[a2].ID === t2 && (n2 = true); + return n2; + } }, { key: "getLocalMsg", value: function(e2, t2) { + for (var n2 = null, o2 = this.getLocalMsgList(e2), i2 = o2.length, a2 = 0; a2 < i2; a2++) + if (o2[a2].ID === t2) { + n2 = o2[a2]; + break; + } + return n2; + } }, { key: "getLocalLastMsg", value: function(e2) { + e2 = this.getLocalMsgList(e2); + return e2[e2.length - 1]; + } }, { key: "getLocalSecondLastMsg", value: function(e2) { + e2 = this.getLocalMsgList(e2); + return e2[e2.length - 2]; + } }, { key: "getLocalOldestMsg", value: function(e2) { + return this.getLocalMsgList(e2)[0]; + } }, { key: "_setLatestMsgSentByPeer", value: function(e2, t2) { + e2.startsWith(A.CONV_C2C) && "in" === t2.flow && this._latestMsgSentByPeerMap.set(e2, t2); + } }, { key: "_setLatestMsgSentByMe", value: function(e2, t2) { + "out" === t2.flow && this._latestMsgSentByMeMap.set(e2, t2); + } }, { key: "getLatestMsgSentByPeer", value: function(e2) { + return this._latestMsgSentByPeerMap.get(e2); + } }, { key: "getLatestMsgSentByMe", value: function(e2) { + return this._latestMsgSentByMeMap.get(e2); + } }, { key: "modifyMsgSentByPeer", value: function(e2) { + var t2 = e2.conversationID, n2 = e2.latestNick, o2 = e2.latestAvatar, e2 = this._map.get(t2); + if (!S(e2)) { + var i2 = Array.from(e2.values()), e2 = i2.length; + if (0 !== e2) { + for (var a2 = null, s2 = 0, r2 = false, c2 = e2 - 1; 0 <= c2; c2--) + "in" === i2[c2].flow && ((a2 = i2[c2]).nick !== n2 && (a2.setNickAndAvatar({ nick: n2 }), r2 = true), a2.avatar !== o2 && (a2.setNickAndAvatar({ avatar: o2 }), r2 = true), r2) && (s2 += 1); + M.l("".concat(this._n, ".modifyMsgSentByPeer convID:").concat(t2, " count:").concat(s2)); + } + } + } }, { key: "modifyMsgSentByMe", value: function(e2) { + var t2 = e2.conversationID, n2 = e2.latestNick, o2 = e2.latestAvatar, e2 = this._map.get(t2); + if (!S(e2)) { + var i2 = Array.from(e2.values()), e2 = i2.length; + if (0 !== e2) { + for (var a2 = null, s2 = 0, r2 = false, c2 = e2 - 1; 0 <= c2; c2--) + "out" === i2[c2].flow && ((a2 = i2[c2]).nick !== n2 && (a2.setNickAndAvatar({ nick: n2 }), r2 = true), a2.avatar !== o2 && (a2.setNickAndAvatar({ avatar: o2 }), r2 = true), r2) && (s2 += 1); + M.l("".concat(this._n, ".modifyMsgSentByMe convID:").concat(t2, " count:").concat(s2)); + } + } + } }, { key: "getTopicConvIDList", value: function(t2) { + return p(this._map.keys()).filter(function(e2) { + return e2.startsWith("".concat(A.CONV_GROUP).concat(t2)); + }); + } }, { key: "onMsgModified", value: function(e2, t2) { + var n2, o2, i2, a2; + return (this._map.has(e2) || this._hoppingMsgMap.has(e2)) && (n2 = "".concat(this._n, ".onMsgModified"), i2 = this._getUniqueIDOfMsg(t2), a2 = !!(o2 = this._getTargetMsg(e2, i2)), M.l("".concat(n2, " convID:").concat(e2, " uniqueID:").concat(i2, " has:").concat(a2)), a2) ? (e2 = t2.messageVersion, i2 = t2.elements, a2 = t2.cloudCustomData, t2 = t2.checkResult, M.l("".concat(n2, " localVersion:").concat(o2.version, " remoteVersion:").concat(e2)), o2.version < e2 ? (o2.version = e2, o2._elements = JSON.parse(JSON.stringify(i2)), o2.payload = JSON.parse(JSON.stringify(i2[0].content)), o2.type = i2[0].type, o2.cloudCustomData = a2, o2.isModified = true, o2.hasRiskContent = on(t2), { isUpdated: true, message: o2 }) : { isUpdated: false, message: o2 }) : { isUpdated: false, message: null }; + } }, { key: "_getUniqueIDOfMsg", value: function(e2) { + var t2 = e2.from, n2 = e2.to, o2 = e2.random, i2 = e2.sequence, e2 = e2.time; + return "".concat(t2, "-").concat(n2, "-").concat(o2, "-").concat(i2, "-").concat(e2); + } }, { key: "_getTargetMsg", value: function(e2, t2) { + if (this._map.has(e2)) + return this._map.get(e2).get(t2); + var n2 = void 0; + if (this._hoppingMsgMap.has(e2)) { + for (var o2 = p(this._hoppingMsgMap.get(e2).values()), i2 = 0; i2 < o2.length; i2++) + if (this._getUniqueIDOfMsg(o2[i2]) === t2) { + n2 = o2[i2]; + break; + } + } + return n2; + } }, { key: "storeHoppingMsgList", value: function(e2) { + if (0 !== e2.length) { + var t2 = e2[0].conversationID, n2 = e2.length; + this._hoppingMsgMap.has(t2) || this._hoppingMsgMap.set(t2, /* @__PURE__ */ new Map()); + for (var o2 = this._hoppingMsgMap.get(t2), i2 = 0; i2 < n2; i2++) { + var a2 = e2[i2]; + o2.has(a2.ID) || o2.set(a2.ID, a2); + } + } + } }, { key: "getHoppingMsg", value: function(e2, t2) { + if (this._hoppingMsgMap.has(e2)) + return this._hoppingMsgMap.get(e2).get(t2); + } }, { key: "reset", value: function() { + this._map.clear(), this._latestMsgSentByPeerMap.clear(), this._latestMsgSentByMeMap.clear(), this._hoppingMsgMap.clear(); + } }]), Vo); + function Vo(e2) { + d(this, Vo), this._convM = e2, this._map = /* @__PURE__ */ new Map(), this._n = "MsgListHandler", this._latestMsgSentByPeerMap = /* @__PURE__ */ new Map(), this._latestMsgSentByMeMap = /* @__PURE__ */ new Map(), this._hoppingMsgMap = /* @__PURE__ */ new Map(), this.TOPIC_MSG_LIMIT = 1e3, this._convM.getIEmitInst().on(P.CLOUD_CONFIG, this._onCloudConfig, this); + } + function Ho(e2) { + return d(this, Ho), (e2 = Fo.call(this, e2))._n = "C2CModule", e2._msgFromUnreadDBMap = /* @__PURE__ */ new Map(), e2._noticeFromUnreadDBList = [], e2; + } + function Bo(e2) { + this.mixin(e2); + } + Bo.mixin = function(e2) { + e2 = e2.prototype || e2; + e2._isReady = false, e2.ready = function(e3) { + if (e3) + return this._isReady ? void (1 < arguments.length && void 0 !== arguments[1] && arguments[1] ? e3.call(this) : setTimeout(e3, 1)) : (this._readyQueue = this._readyQueue || [], void this._readyQueue.push(e3)); + }, e2.triggerReady = function() { + var t2 = this; + this._isReady = true, setTimeout(function() { + var e3 = t2._readyQueue; + t2._readyQueue = [], e3 && 0 < e3.length && e3.forEach(function(e4) { + e4.call(this); + }, t2); + }, 1); + }, e2.resetReady = function() { + this._isReady = false, this._readyQueue = []; + }, e2.isReady = function() { + return this._isReady; + }; + }; + function Ko(e2, t2, n2) { + return N(e2) ? { lastTime: 0, lastSequence: 0, fromAccount: "", messageForShow: "", payload: null, type: "", isRevoked: false, cloudCustomData: "", onlineOnlyFlag: false, nick: "", nameCard: "", version: 0, isPeerRead: false, revoker: null } : n2 && e2.ID || e2 instanceof Do ? { lastTime: e2.time || 0, lastSequence: e2.sequence || 0, fromAccount: e2.from || "", messageForShow: zt(e2.type, e2.payload, t2), payload: e2.payload || null, type: e2.type || null, isRevoked: e2.isRevoked || false, cloudCustomData: e2.cloudCustomData || "", onlineOnlyFlag: e2._onlineOnlyFlag || false, nick: e2.nick || "", nameCard: e2.nameCard || "", version: e2.version || 0, isPeerRead: e2.isPeerRead || false, revoker: e2.revoker || null } : y(y({}, e2), {}, { messageForShow: zt(e2.type, e2.payload, t2) }); + } + function Yo(e2, t2) { + return S(e2) ? { lastTime: 0, lastSequence: 0, fromAccount: "", payload: null, type: "", messageForShow: "", nick: "", avatar: "", version: 0, cloudCustomData: "", isRevoked: false, revoker: null } : { lastTime: e2.time || 0, lastSequence: e2.sequence || 0, fromAccount: e2.from || "", payload: e2.payload || null, type: e2.type || "", messageForShow: zt(e2.type, e2.payload, t2), nick: e2.nick || "", avatar: e2.avatar || "", version: e2.version || 0, cloudCustomData: e2.cloudCustomData || "", isRevoked: e2.isRevoked || false, revoker: e2.revoker || null }; + } + function Wo(e2) { + var t2 = String(e2).replace(/[=]+$/, ""), n2 = ""; + if (t2.length % 4 == 1) + return ""; + for (var o2, i2, a2 = 0, s2 = 0; i2 = t2.charAt(s2++); ~i2 && (o2 = a2 % 4 ? 64 * o2 + i2 : i2, a2++ % 4) && (n2 += String.fromCharCode(255 & o2 >> (-2 * a2 & 6)))) + i2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i2); + try { + return decodeURIComponent(escape(n2)); + } catch (e3) { + return ""; + } + } + var jo, Jo, zo, Xo, Zo, Qo = ["jpg", "jpeg", "gif", "png", "bmp", "image", "webp"], $o = ["mp4", "quicktime", "mov"], ei = (e(oa, [{ key: "validate", value: function(e2) { + var t2, n2 = true, o2 = ""; + if (S(e2)) + return { valid: false, tips: "empty options" }; + if (e2.profileCustomField) + for (var i2 = e2.profileCustomField.length, a2 = null, s2 = 0; s2 < i2; s2++) { + if (a2 = e2.profileCustomField[s2], !m(a2.key) || -1 === a2.key.indexOf("Tag_Profile_Custom")) + return { valid: false, tips: "The prefix of keys of the custom profile key-value pairs (which is profileCustomField) must be Tag_Profile_Custom" }; + if (!m(a2.value)) + return { valid: false, tips: "The type of values of the custom profile key-value pairs (which is profileCustomField) must be String" }; + } + for (t2 in e2) + if (Object.prototype.hasOwnProperty.call(e2, t2)) { + if ("profileCustomField" === t2) + continue; + if (S(e2[t2]) && !m(e2[t2]) && !R(e2[t2])) { + o2 = "key:" + t2 + ", invalid value:" + e2[t2], n2 = false; + continue; + } + switch (t2) { + case "nick": + m(e2[t2]) || (n2 = !(o2 = "nick must be a string")), 500 < gt(e2[t2]) && (o2 = "nick name limited: must less than or equal to ".concat(500, " bytes, current size: ").concat(gt(e2[t2]), " bytes"), n2 = false); + break; + case "gender": + vt(Qe, e2.gender) || (o2 = "key:gender, invalid value:" + e2.gender, n2 = false); + break; + case "birthday": + R(e2.birthday) || (n2 = !(o2 = "birthday must be a number")); + break; + case "location": + m(e2.location) || (n2 = !(o2 = "location must be a string")); + break; + case "selfSignature": + m(e2.selfSignature) || (n2 = !(o2 = "selfSignature must be a string")); + break; + case "allowType": + vt(et, e2.allowType) || (o2 = "key:allowType, invalid value:" + e2.allowType, n2 = false); + break; + case "language": + R(e2.language) || (n2 = !(o2 = "language must be a number")); + break; + case "avatar": + m(e2.avatar) || (n2 = !(o2 = "avatar must be a string")); + break; + case "messageSettings": + 0 !== e2.messageSettings && 1 !== e2.messageSettings && (n2 = !(o2 = "messageSettings must be 0 or 1")); + break; + case "adminForbidType": + vt($e, e2.adminForbidType) || (o2 = "key:adminForbidType, invalid value:" + e2.adminForbidType, n2 = false); + break; + case "level": + R(e2.level) || (n2 = !(o2 = "level must be a number")); + break; + case "role": + R(e2.role) || (n2 = !(o2 = "role must be a number")); + break; + default: + o2 = "unknown key:" + t2 + " " + e2[t2], n2 = false; + } + } + return { valid: n2, tips: o2 }; + } }]), oa), ti = (e(na, [{ key: "set", value: function(e2) { + var t2; + this.map.size >= this.MAX_LENGTH && (t2 = this.map.entries().next().value[0], this.map.delete(t2)), this.map.set(e2, 1); + } }, { key: "has", value: function(e2) { + return this.map.has(e2); + } }, { key: "delete", value: function(e2) { + this.has(e2) && this.map.delete(e2); + } }, { key: "reset", value: function() { + this.map.clear(); + } }]), na), ni = ["groupID", "name", "avatar", "type", "introduction", "notification", "ownerID", "selfInfo", "createTime", "infoSequence", "lastInfoTime", "lastMessage", "nextMessageSeq", "memberNum", "maxMemberNum", "memberList", "joinOption", "groupCustomField", "muteAllMembers", "isSupportTopic", "inviteOption", "_lastRevokedTime"], oi = (e(ta, [{ key: "memberNum", get: function() { + return this.memberCount; + }, set: function(e2) { + } }, { key: "maxMemberNum", get: function() { + return this.maxMemberCount; + }, set: function(e2) { + } }, { key: "_initGroup", value: function(e2) { + for (var t2 in e2) + ni.indexOf(t2) < 0 || ("selfInfo" !== t2 ? ("memberNum" === t2 && (this.memberCount = e2[t2]), "maxMemberNum" === t2 && (this.maxMemberCount = e2[t2]), "isSupportTopic" !== t2 ? this[t2] = e2[t2] : this.isSupportTopic = 1 === e2[t2]) : this.updateSelfInfo(e2[t2])); + } }, { key: "updateGroup", value: function(e2) { + var t2 = this, e2 = (e2.appid = void 0, e2.grossTopicNextMsgSeq = void 0, e2.selfInfo && (e2.selfInfo.grossTopicReadSeq = void 0), JSON.parse(JSON.stringify(e2))); + e2.lastMsgTime && (this.lastMessage.lastTime = e2.lastMsgTime), N(e2.muteAllMembers) || ("On" === e2.muteAllMembers ? e2.muteAllMembers = true : e2.muteAllMembers = false), e2.groupCustomField && kt(this.groupCustomField, e2.groupCustomField), N(e2.memberNum) || (this.memberCount = e2.memberNum), N(e2.maxMemberNum) || (this.maxMemberCount = e2.maxMemberNum), N(e2.isSupportTopic) || (this.isSupportTopic = R(e2.isSupportTopic) ? 1 === e2.isSupportTopic : e2.isSupportTopic), _t(this, e2, ["members", "errorCode", "lastMsgTime", "groupCustomField", "memberNum", "maxMemberNum", "isSupportTopic"]), O(e2.members) && 0 < e2.members.length && e2.members.forEach(function(e3) { + e3.userID === t2.selfInfo.userID && _t(t2.selfInfo, e3, ["sequence"]); + }); + } }, { key: "updateSelfInfo", value: function(e2) { + e2 = { nameCard: e2.nameCard, joinTime: e2.joinTime, role: e2.role, messageRemindType: e2.messageRemindType, readedSequence: e2.readedSequence, excludedUnreadSequenceList: e2.excludedUnreadSequenceList }; + _t(this.selfInfo, y({}, e2), [], ["", null, void 0, 0, NaN]); + } }, { key: "setSelfNameCard", value: function(e2) { + this.selfInfo.nameCard = e2; + } }]), ta), ii = (e(ea, [{ key: "toAccount", get: function() { + return this.conversationID.startsWith(A.CONV_C2C) ? this.conversationID.replace(A.CONV_C2C, "") : this.conversationID.startsWith(A.CONV_GROUP) ? this.conversationID.replace(A.CONV_GROUP, "") : ""; + } }, { key: "_initProfile", value: function(t2) { + var n2 = this; + Object.keys(t2).forEach(function(e2) { + switch (e2) { + case "userProfile": + n2.userProfile = t2.userProfile; + break; + case "groupProfile": + n2.groupProfile = t2.groupProfile; + } + }), N(this.userProfile) && this.type === A.CONV_C2C ? this.userProfile = new ei({ userID: t2.conversationID.replace("C2C", "") }) : N(this.groupProfile) && this.type === A.CONV_GROUP && (this.groupProfile = new oi({ groupID: t2.conversationID.replace("GROUP", "") })); + } }, { key: "updateUnreadCount", value: function(e2) { + var t2 = e2.nextUnreadCount, n2 = e2.isFromGetConversations, e2 = e2.isUnreadC2CMessage; + N(t2) || (Ot(this.subType) ? this.unreadCount = 0 : n2 && this.type === A.CONV_GROUP || n2 && this.type === A.CONV_TOPIC || e2 && this.type === A.CONV_C2C ? this.unreadCount = t2 : this.unreadCount = this.unreadCount + t2); + } }, { key: "updateLastMessage", value: function(e2) { + this.lastMessage = Ko(e2); + } }, { key: "updateGroupAtInfoList", value: function(e2) { + var t2; + this._isNeedMergeGroupAtInfo(e2) || (-1 !== (t2 = (W(t2 = e2.groupAtType) || j(t2) || J(t2) || X()).slice(0)).indexOf(A.CONV_AT_ME) && -1 !== t2.indexOf(A.CONV_AT_ALL) && (t2 = [A.CONV_AT_ALL_AT_ME]), t2 = { from: e2.from, groupID: e2.groupID, topicID: e2.topicID, messageSequence: e2.sequence, atTypeArray: t2, __random: e2.__random, __sequence: e2.__sequence }, this.groupAtInfoList.push(t2)); + } }, { key: "_isNeedMergeGroupAtInfo", value: function(t2) { + var n2, e2 = t2.groupID, o2 = t2.sequence; + return !!Nt({ groupID: e2 }) && (n2 = false, this.groupAtInfoList.forEach(function(e3) { + e3.messageSequence === o2 && (-1 < e3.atTypeArray.indexOf(A.CONV_AT_ME) && -1 < t2.groupAtType.indexOf(A.CONV_AT_ALL) && (e3.atTypeArray = [A.CONV_AT_ALL_AT_ME]), -1 < e3.atTypeArray.indexOf(A.CONV_AT_ALL) && -1 < t2.groupAtType.indexOf(A.CONV_AT_ME) && (e3.atTypeArray = [A.CONV_AT_ALL_AT_ME], e3.__random = t2.__random, e3.__sequence = t2.__sequence), n2 = true); + }), n2); + } }, { key: "clearGroupAtInfoList", value: function() { + this.groupAtInfoList.length = 0; + } }, { key: "reduceUnreadCount", value: function() { + return 1 <= this.unreadCount && (--this.unreadCount, true); + } }, { key: "isLastMessageRevoked", value: function(e2) { + var t2 = e2.sequence, e2 = e2.time; + return this.type === A.CONV_C2C && t2 === this.lastMessage.lastSequence && e2 === this.lastMessage.lastTime || this.type === A.CONV_GROUP && t2 === this.lastMessage.lastSequence; + } }, { key: "setLastMessageRevoked", value: function(e2) { + this.lastMessage.isRevoked = e2; + } }, { key: "setLastMessageRevoker", value: function(e2) { + this.lastMessage.revoker = e2; + } }, { key: "setDraftText", value: function(e2) { + this.draftText = e2; + } }]), ea), ai = (F(r = {}, A.MSG_REMIND_ACPT_AND_NOTE, 0), F(r, A.MSG_REMIND_DISCARD, 1), F(r, A.MSG_REMIND_ACPT_NOT_NOTE, 2), r), si = (e($i, [{ key: "onAllRcvMsgOptNotify", value: function(e2) { + e2 = this._handleResult(e2); + this._convM.emitOEvt(h.ALL_RECEIVE_MESSAGE_OPT_UPDATED, e2); + } }, { key: "getC2CMsgRemindType", value: function(t2) { + var n2 = this, o2 = "".concat(this._n, ".getC2CMsgRemindType"); + return this._convM.req({ P: k.GET_C2C_PEER_MUTE_NOTIFICATIONS, data: { toAccount: this._convM.getMyUserID(), userIDList: t2 } }).then(function(e2) { + M.l("".concat(o2, " ok. userIDList:").concat(t2)); + e2 = e2.data.muteFlagList; + n2._convM.onC2CMsgRemindTypeFetched(e2); + }).catch(function(e2) { + M.e("".concat(o2, " failed. error:"), e2); + }); + } }, { key: "set", value: function(e2) { + return e2.groupID ? this._setGroupMsgRemindType(e2) : O(e2.userIDList) ? this._setC2CMsgRemindType(e2) : void 0; + } }, { key: "_setGroupMsgRemindType", value: function(t2) { + var n2 = this, o2 = "".concat(this._n, ".").concat("_setGroupMsgRemindType"), e2 = t2.groupID, i2 = t2.messageRemindType, a2 = "groupID:".concat(e2, " messageRemindType:").concat(i2), s2 = new G("_setGroupMsgRemindType"), r2 = (s2.setMessage(a2), this._get(7)); + return r2 ? r2.modifyGroupMemberInfo({ groupID: e2, messageRemindType: i2, userID: this._convM.getMyUserID() }).then(function() { + s2.end(), M.l("".concat(o2, " ok. ").concat(a2)); + var e3 = n2.onGroupMsgRemindTypeUpdated(t2); + return n2._convM.onTotalUnreadCountUpdate(), C(e3); + }).catch(function(e3) { + return s2.setError(e3).end(), M.e("".concat(o2, " failed. error:"), e3), D(e3); + }) : D({ code: L.NO_MODULE }); + } }, { key: "onGroupMsgRemindTypeUpdated", value: function(e2) { + var t2, n2, o2 = e2.groupID, e2 = e2.messageRemindType, i2 = (M.l("".concat(this._n, ".onGroupMsgRemindTypeUpdated groupID:").concat(o2, " messageRemindType:").concat(e2)), this._get(7).getLocalGroupProfile(o2)); + return i2 && (i2.selfInfo.messageRemindType = e2), Gt(o2) ? (t2 = Jt(n2 = o2), (n2 = this._get(10).getLocalTopic(t2, n2)) && n2.updateSelfInfo({ messageRemindType: e2 }) && this._convM.emitOEvt(h.TOPIC_UPDATED, { groupID: t2, topic: n2 }), { topic: n2 }) : (this._convM.patchMsgRemindType({ ID: o2, isC2CConversation: false, messageRemindType: e2 }) && this._emitConvUpdate(), { group: i2 }); + } }, { key: "_setC2CMsgRemindType", value: function(e2) { + var i2 = this, a2 = "".concat(this._n, ".").concat("_setC2CMsgRemindType"), t2 = e2.userIDList, s2 = e2.messageRemindType, r2 = t2.slice(0, 30), e2 = ai[s2] || 0, c2 = "userIDList:".concat(r2, " messageRemindType:").concat(s2), u2 = new G("_setC2CMsgRemindType"); + return u2.setMessage(c2), this._convM.req({ P: k.SET_C2C_PEER_MUTE_NOTIFICATIONS, data: { userIDList: r2, muteFlag: e2 } }).then(function(e3) { + u2.end(); + var e3 = e3.data.errorList, t3 = [], n2 = [], e3 = (O(e3) && e3.forEach(function(e4) { + t3.push(e4.userID), n2.push({ userID: e4.userID, code: e4.errorCode }); + }), r2.filter(function(e4) { + return -1 === t3.indexOf(e4); + })), o2 = (M.l("".concat(a2, " ok. ").concat(c2, " successUserIDList:").concat(e3, " failureUserIDList:").concat(JSON.stringify(n2))), 0); + return e3.forEach(function(e4) { + i2._convM.patchMsgRemindType({ ID: e4, isC2CConversation: true, messageRemindType: s2 }) && (o2 += 1); + }), 1 <= o2 && i2._emitConvUpdate(), r2.length = t3.length = 0, i2._convM.onTotalUnreadCountUpdate(), T({ successUserIDList: e3.map(function(e4) { + return { userID: e4 }; + }), failureUserIDList: n2 }); + }).catch(function(e3) { + return u2.setError(e3).end(), M.e("".concat(a2, " failed. error:"), e3), D(e3); + }); + } }, { key: "_get", value: function(e2) { + return this._convM.get(e2); + } }, { key: "_emitConvUpdate", value: function() { + this._convM.emitConvUpdate(true, false); + } }, { key: "setAllRcvMsgOpt", value: function(e2) { + var t2 = "".concat(this._n, ".").concat("setAllRcvMsgOpt"), n2 = e2.messageRemindType, n2 = void 0 === n2 ? A.MSG_REMIND_ACPT_NOT_NOTE : n2, o2 = e2.isRepeated, o2 = void 0 === o2 || o2, i2 = this._calcStartAndEndTime(e2), a2 = i2.startTime, a2 = void 0 === a2 ? 0 : a2, i2 = i2.endTime, i2 = void 0 === i2 ? 0 : i2, e2 = JSON.stringify(e2), s2 = new G("setAllRcvMsgOpt"); + return s2.setMessage(e2), M.l("".concat(t2, " options:").concat(e2)), this._convM.req({ P: k.SET_ALL_RECEIVE_MSG_OPT, data: { messageRemindType: ai[n2], startTime: a2, endTime: i2, isRepeated: o2 ? 1 : 0 } }).then(function(e3) { + return s2.end(), M.l("".concat(t2, " ok.")), C(e3); + }).catch(function(e3) { + return s2.setError(e3).end(), M.e("".concat(t2, " failed. error:"), e3), D(e3); + }); + } }, { key: "_calcStartAndEndTime", value: function(e2) { + var t2 = e2.startHour, t2 = void 0 === t2 ? 0 : t2, n2 = e2.startMinute, n2 = void 0 === n2 ? 0 : n2, o2 = e2.startSecond, o2 = void 0 === o2 ? 0 : o2, i2 = e2.duration, i2 = void 0 === i2 ? 0 : i2, e2 = e2.isRepeated, e2 = void 0 === e2 || e2, a2 = /* @__PURE__ */ new Date(), s2 = a2.getFullYear(), r2 = a2.getMonth(), a2 = a2.getDate(), s2 = Math.round(new Date(s2, r2, a2, t2, n2, o2).getTime() / 1e3); + return { startTime: s2, endTime: e2 && 86400 <= i2 ? s2 + 86400 : s2 + i2 }; + } }, { key: "getAllRcvMsgOpt", value: function() { + var t2 = this, n2 = "".concat(this._n, ".").concat("getAllRcvMsgOpt"), o2 = new G("getAllRcvMsgOpt"); + return this._convM.req({ P: k.GET_ALL_RECEIVE_MSG_OPT, data: { toAccount: this._convM.getMyUserID() } }).then(function(e2) { + e2 = e2.data, o2.setMessage(JSON.stringify(e2)).end(), M.l("".concat(n2, " ok. data:").concat(JSON.stringify(e2))), e2 = t2._handleResult(e2); + return C(e2); + }).catch(function(e2) { + return o2.setError(e2).end(), M.e("".concat(n2, " failed. error:"), e2), D(e2); + }); + } }, { key: "_handleResult", value: function(e2) { + var t2 = e2.messageRemindType, n2 = e2.startTime, o2 = e2.endTime, e2 = e2.isRepeated, i2 = A.MSG_REMIND_ACPT_AND_NOTE; + return 1 === t2 && (i2 = A.MSG_REMIND_DISCARD), { messageRemindType: i2 = 2 === t2 ? A.MSG_REMIND_ACPT_NOT_NOTE : i2, startTime: n2, endTime: o2, isRepeated: 1 === e2 }; + } }, { key: "reset", value: function() { + M.l("".concat(this._n, ".reset")); + } }]), $i), ri = (e(Qi, [{ key: "setConvCustomData", value: function(e2) { + var i2 = this, a2 = "".concat(this._n, ".").concat("setConvCustomData"), t2 = e2.conversationIDList, s2 = e2.customData, r2 = (M.l("".concat(a2, " options:"), e2), new G("setConvCustomData")), n2 = (r2.setMessage(JSON.stringify(e2)), { fromAccount: this._getMyUserID(), itemList: [] }), c2 = [], u2 = []; + return t2.forEach(function(e3) { + var t3; + return i2._hasLocalConv(e3) ? Pt(e3) || Ut(e3) ? (t3 = { operationType: 2, contactItem: void 0, customMark: s2 }, Pt(e3) ? t3.contactItem = { type: 1, toAccount: e3.replace(A.CONV_C2C, "") } : Ut(e3) && (t3.contactItem = { type: 2, groupID: e3.replace(A.CONV_GROUP, "") }), void n2.itemList.push(t3)) : (i2._onConvIDInvalid(u2, e3), true) : (i2._onConvNotFound(u2, e3), true); + }), u2.length === t2.length ? T({ successConversationIDList: c2, failureConversationIDList: u2 }) : this._convM.req({ P: k.SET_CONV_CUSTOM_DATA, data: n2 }).then(function(e3) { + r2.end(), M.l("".concat(a2, " ok")); + var t3, n3, o2, e3 = e3.data.resultItem; + return O(e3) && (o2 = false, e3.forEach(function(e4) { + t3 = i2._concatConvID(e4.contactItem), 0 === e4.resultCode ? (c2.push(t3), (n3 = i2._getLocalConv(t3)) && n3.customData !== s2 && (n3.customData = s2, o2 = true)) : u2.push({ conversationID: t3, code: e4.resultCode, message: e4.resultInfo }); + }), true === o2) && i2._emitConvUpdate(), C({ successConversationIDList: c2, failureConversationIDList: u2 }); + }).catch(function(e3) { + return r2.setError(e3).end(), M.e("".concat(a2, " failed. error:"), e3), D(e3); + }); + } }, { key: "markConv", value: function(e2) { + var t2, n2, a2, s2, r2, o2, i2, c2, u2, l2, d2 = this; + return this._convM.canIUse(_.CONV_MARK) ? (t2 = "".concat(this._n, ".").concat("markConv"), n2 = e2.conversationIDList, a2 = e2.markType, s2 = e2.enableMark, M.l("".concat(t2, " options:"), e2), r2 = new G("markConv"), o2 = void r2.setMessage(JSON.stringify(e2)), i2 = void 0, e2 = this._getFlagBit(a2), true === s2 ? i2 = [e2] : o2 = [e2], c2 = { fromAccount: this._getMyUserID(), itemList: [] }, u2 = [], l2 = [], n2.forEach(function(e3) { + var t3; + return d2._hasLocalConv(e3) ? Pt(e3) || Ut(e3) ? (t3 = { operationType: 1, contactItem: void 0, clearMark: o2, setMark: i2 }, Pt(e3) ? t3.contactItem = { type: 1, toAccount: e3.replace(A.CONV_C2C, "") } : Ut(e3) && (t3.contactItem = { type: 2, groupID: e3.replace(A.CONV_GROUP, "") }), void c2.itemList.push(t3)) : (d2._onConvIDInvalid(l2, e3), true) : (d2._onConvNotFound(l2, e3), true); + }), l2.length === n2.length ? T({ successConversationIDList: u2, failureConversationIDList: l2 }) : this._convM.req({ P: k.MARK_CONV, data: c2 }).then(function(e3) { + r2.end(), M.l("".concat(t2, " ok")); + var n3, o3, i3, e3 = e3.data.resultItem; + return O(e3) && (i3 = false, e3.forEach(function(e4) { + var t3; + n3 = d2._concatConvID(e4.contactItem), 0 === e4.resultCode ? (u2.push(n3), (o3 = d2._getLocalConv(n3)) && (t3 = o3.markList.indexOf(a2), true === s2 ? -1 === t3 && (o3.markList.push(a2), i3 = true) : -1 !== t3 && (o3.markList.splice(t3, 1), i3 = true))) : l2.push({ conversationID: n3, code: e4.resultCode, message: e4.resultInfo }); + }), true === i3) && d2._emitConvUpdate(), C({ successConversationIDList: u2, failureConversationIDList: l2 }); + }).catch(function(e3) { + return r2.setError(e3).end(), M.e("".concat(t2, " failed. error:"), e3), D(e3); + })) : this._convM.noUse("markConv"); + } }, { key: "getLocalConvGroupList", value: function() { + var e2 = this; + return M.l("".concat(this._n, ".getLocalConvGroupList pagingStatus:").concat(this._pagingStatus)), this._pagingStatus === Un ? this.getRemoteConvGroupList().then(function() { + return C(p(e2._convGroupMap.values())); + }) : T(p(this._convGroupMap.values())); + } }, { key: "searchConvGroupAndMark", value: function(e2, t2) { + var n2 = this, o2 = "".concat(this._n, ".searchConvGroupAndMark"), i2 = []; + return e2.forEach(function(e3) { + 1 === t2 ? i2.push({ type: 1, toAccount: e3 }) : 2 === t2 && i2.push({ type: 2, groupID: e3 }); + }), M.l("".concat(o2, " type:").concat(t2, " list:"), e2), this._convM.req({ P: k.SEARCH_CONV_GRP_MARK, data: { fromAccount: this._getMyUserID(), contactItem: i2 } }).then(function(e3) { + var e3 = e3.data, t3 = e3.contactItem, e3 = e3.groupItem; + M.l("".concat(o2, " ok. contactItem:"), t3, "groupItem:", e3), n2._fillConvGroupMap(e3), n2._handleContactItem(t3), n2._emitConvUpdate(); + }).catch(function(e3) { + M.w("".concat(o2, " failed. error:"), e3); + }); + } }, { key: "_fillConvGroupMap", value: function(e2) { + var n2 = this; + O(e2) && e2.forEach(function(e3) { + var t2 = e3.convGroupID, e3 = e3.groupName; + n2._convGroupMap.set(t2, e3); + }); + } }, { key: "_handleContactItem", value: function(e2) { + var a2, s2 = this; + O(e2) && e2.forEach(function(e3) { + var t2 = [], n2 = e3.standardMark, o2 = e3.customData, i2 = e3.convGroupIDList; + O(i2) && i2.forEach(function(e4) { + s2._convGroupMap.has(e4) && t2.push(s2._convGroupMap.get(e4)); + }), a2 = s2._concatConvID(e3), (a2 = s2._getLocalConv(a2)) && (a2.markList = Zt(n2), a2.customData = o2 || "", a2.conversationGroupList = [].concat(t2)); + }); + } }, { key: "getRemoteConvGroupList", value: function() { + var i2 = this, a2 = "".concat(this._n, ".getRemoteConvGroupList"); + return this._pagingStatus = Gn, this._convM.req({ P: k.GET_CONV_GRP_LIST, data: { fromAccount: this._getMyUserID(), startIndex: this._startIndex } }).then(function(e2) { + var e2 = e2.data, t2 = e2.completeFlag, n2 = e2.contactItem, o2 = e2.nextStartIndex, o2 = void 0 === o2 ? 0 : o2, e2 = e2.groupItem; + if (i2._startIndex = o2, M.l("".concat(a2, " completeFlag:").concat(t2, " nextStartIndex:").concat(o2, ", groupItem:"), e2, "contactItem:", n2), i2._fillConvGroupMap(e2), i2._handleContactItem(n2), 0 === t2) + return i2.getRemoteConvGroupList(); + 1 === t2 && (i2._pagingStatus = Pn, i2._emitConvUpdate(), i2._emitConvGroupListUpdate()); + }).catch(function(e2) { + i2._pagingStatus = Un, M.w("".concat(a2, " failed. error:"), e2); + }); + } }, { key: "createConvGroup", value: function(e2) { + var a2, s2, r2, t2, c2, u2, l2 = this; + return this._convM.canIUse(_.CONV_GROUP) ? (a2 = "".concat(this._n, ".").concat("createConvGroup"), M.l("".concat(a2, " options:"), e2), (s2 = new G("createConvGroup")).setMessage(JSON.stringify(e2)), r2 = e2.groupName, e2 = e2.conversationIDList, t2 = { fromAccount: this._getMyUserID(), itemList: [{ groupName: r2, contactItem: [] }] }, c2 = [], u2 = [], e2.forEach(function(e3) { + return l2._hasLocalConv(e3) ? Pt(e3) || Ut(e3) ? void (Pt(e3) ? t2.itemList[0].contactItem.push({ type: 1, toAccount: e3.replace(A.CONV_C2C, "") }) : Ut(e3) && t2.itemList[0].contactItem.push({ type: 2, groupID: e3.replace(A.CONV_GROUP, "") })) : (l2._onConvIDInvalid(u2, e3), true) : (l2._onConvNotFound(u2, e3), true); + }), u2.length === e2.length ? T({ successConversationIDList: c2, failureConversationIDList: u2 }) : this._convM.req({ P: k.CREATE_CONV_GRP, data: t2 }).then(function(e3) { + s2.end(), M.l("".concat(a2, " ok")); + var t3, n2, o2, e3 = e3.data.groupResultItem[0], i2 = e3.groupItem, e3 = e3.resultItem; + return f(i2) && (l2._convGroupMap.set(i2.convGroupID, i2.groupName), l2._emitConvGroupListUpdate()), O(e3) && (o2 = false, e3.forEach(function(e4) { + t3 = l2._concatConvID(e4.contactItem), 0 === e4.resultCode ? (c2.push(t3), (n2 = l2._getLocalConv(t3)) && -1 === n2.conversationGroupList.indexOf(r2) && (n2.conversationGroupList.push(r2), o2 = true)) : u2.push({ conversationID: t3, code: e4.resultCode, message: e4.resultInfo }); + }), true === o2) && (l2._emitConvUpdate(), l2._emitConvGroupListUpdate()), C({ successConversationIDList: c2, failureConversationIDList: u2 }); + }).catch(function(e3) { + return s2.setError(e3).end(), M.e("".concat(a2, " failed. error:"), e3), D(e3); + })) : this._convM.noUse("createConvGroup"); + } }, { key: "deleteConvGroup", value: function(n2) { + var o2, i2, a2 = this; + return this._convM.canIUse(_.CONV_GROUP) ? (o2 = "".concat(this._n, ".").concat("deleteConvGroup"), M.l("".concat(o2, " groupName:").concat(n2)), (i2 = new G("deleteConvGroup")).setMessage(n2), this._convM.req({ P: k.DEL_CONV_GRP, data: { fromAccount: this._getMyUserID(), groupName: [n2] } }).then(function(e2) { + i2.end(), M.l("".concat(o2, " ok")); + var t2, e2 = e2.data.groupItem; + O(e2) && (t2 = false, e2.forEach(function(e3) { + a2._convGroupMap.has(e3.convGroupID) && (a2._convGroupMap.delete(e3.convGroupID), t2 = true); + }), true === t2) && a2._emitConvGroupListUpdate(), a2._eraseFromConversationGroupList([n2]); + }).catch(function(e2) { + return i2.setError(e2).end(), M.e("".concat(o2, " failed. error:"), e2), D(e2); + })) : this._convM.noUse("deleteConvGroup"); + } }, { key: "renameConvGroup", value: function(e2) { + var i2, a2, s2, r2, c2 = this; + return this._convM.canIUse(_.CONV_GROUP) ? (i2 = "".concat(this._n, ".").concat("renameConvGroup"), M.l("".concat(i2, " options:"), e2), (a2 = new G("renameConvGroup")).setMessage(JSON.stringify(e2)), s2 = e2.oldName, r2 = e2.newName, this._convM.req({ P: k.RENAME_CONV_GRP, data: { fromAccount: this._getMyUserID(), updateType: 1, updateGroup: { updateGroupType: 1, oldName: s2, newName: r2 } } }).then(function(e3) { + a2.end(), M.l("".concat(i2, " ok")); + e3 = e3.data.updateGroupResult.convGroupID; + c2._convGroupMap.set(e3, r2), c2._emitConvGroupListUpdate(); + var t2, n2, e3 = c2._convM.getLocalConvList(), o2 = false; + e3.forEach(function(e4) { + t2 = e4.conversationGroupList, -1 !== (n2 = t2.indexOf(s2)) && (t2.splice(n2, 1, r2), o2 = true); + }), true === o2 && c2._emitConvUpdate(); + }).catch(function(e3) { + return a2.setError(e3).end(), M.e("".concat(i2, " failed. error:"), e3), D(e3); + })) : this._convM.noUse("renameConvGroup"); + } }, { key: "addConvsToGroup", value: function(e2) { + var i2, a2, t2, s2, n2, r2, c2, u2 = this; + return this._convM.canIUse(_.CONV_GROUP) ? (i2 = "".concat(this._n, ".").concat("addConvsToGroup"), M.l("".concat(i2, " options:"), e2), (a2 = new G("addConvsToGroup")).setMessage(JSON.stringify(e2)), t2 = e2.conversationIDList, s2 = e2.groupName, n2 = { fromAccount: this._getMyUserID(), updateType: 1, updateGroup: { updateGroupType: 2, groupName: s2, updateItem: [] } }, r2 = [], c2 = [], t2.forEach(function(e3) { + return u2._hasLocalConv(e3) ? Pt(e3) || Ut(e3) ? void (Pt(e3) ? n2.updateGroup.updateItem.push({ operationType: 1, contactItem: { type: 1, toAccount: e3.replace(A.CONV_C2C, "") } }) : Ut(e3) && n2.updateGroup.updateItem.push({ operationType: 1, contactItem: { type: 2, groupID: e3.replace(A.CONV_GROUP, "") } })) : (u2._onConvIDInvalid(c2, e3), true) : (u2._onConvNotFound(c2, e3), true); + }), c2.length === t2.length ? T({ successConversationIDList: r2, failureConversationIDList: c2 }) : this._convM.req({ P: k.ADD_CONV_TO_GRP, data: n2 }).then(function(e3) { + a2.end(), M.l("".concat(i2, " ok")); + var t3, n3, o2, e3 = e3.data.updateGroupResult.contactResultItem; + return O(e3) && (o2 = false, e3.forEach(function(e4) { + t3 = u2._concatConvID(e4.contactItem), 0 === e4.resultCode ? (n3 = u2._getLocalConv(t3)) && -1 === n3.conversationGroupList.indexOf(s2) && (n3.conversationGroupList.push(s2), r2.push(t3), o2 = true) : c2.push({ conversationID: t3, code: e4.resultCode, message: e4.resultInfo }); + }), true === o2) && (u2._emitConvUpdate(), u2._emitConvInGroupUpdate(s2)), C({ successConversationIDList: r2, failureConversationIDList: c2 }); + }).catch(function(e3) { + return a2.setError(e3).end(), M.e("".concat(i2, " failed. error:"), e3), D(e3); + })) : this._convM.noUse("addConvsToGroup"); + } }, { key: "deleteConvsFromGroup", value: function(e2) { + var t2, a2, n2, s2, o2, r2, c2, u2 = this, i2 = "deleteConvsFromGroup"; + return this._convM.canIUse(_.CONV_GROUP) ? (t2 = "".concat(this._n, ".").concat(i2), M.l("".concat(t2, " options:"), e2), (a2 = new G(i2)).setMessage(JSON.stringify(e2)), n2 = e2.conversationIDList, s2 = e2.groupName, o2 = { fromAccount: this._getMyUserID(), updateType: 1, updateGroup: { updateGroupType: 2, groupName: s2, updateItem: [] } }, r2 = [], c2 = [], n2.forEach(function(e3) { + return u2._hasLocalConv(e3) ? Pt(e3) || Ut(e3) ? void (Pt(e3) ? o2.updateGroup.updateItem.push({ operationType: 2, contactItem: { type: 1, toAccount: e3.replace(A.CONV_C2C, "") } }) : Ut(e3) && o2.updateGroup.updateItem.push({ operationType: 2, contactItem: { type: 2, groupID: e3.replace(A.CONV_GROUP, "") } })) : (u2._onConvIDInvalid(c2, e3), true) : (u2._onConvNotFound(c2, e3), true); + }), c2.length === n2.length ? T({ successConversationIDList: r2, failureConversationIDList: c2 }) : this._convM.req({ P: k.DEL_CONV_FROM_GRP, data: o2 }).then(function(e3) { + a2.end(), M.l("".concat(t2, " ok")); + var n3, o3, i3, e3 = e3.data.updateGroupResult.contactResultItem; + return O(e3) && (i3 = false, e3.forEach(function(e4) { + var t3; + n3 = u2._concatConvID(e4.contactItem), 0 === e4.resultCode ? (o3 = u2._getLocalConv(n3)) && -1 !== (t3 = o3.conversationGroupList.indexOf(s2)) && (o3.conversationGroupList.splice(t3, 1), r2.push(n3), i3 = true) : c2.push({ conversationID: n3, code: e4.resultCode, message: e4.resultInfo }); + }), true === i3) && (u2._emitConvUpdate(), u2._emitConvInGroupUpdate(s2)), C({ successConversationIDList: r2, failureConversationIDList: c2 }); + }).catch(function(e3) { + return a2.setError(e3).end(), M.e("".concat(t2, " failed. error:"), e3), D(e3); + })) : this._convM.noUse(i2); + } }, { key: "onConvMarkUpdated", value: function(e2) { + var i2, a2, s2 = this; + S(e2) || (M.l("".concat(this._n, ".onConvMarkUpdated markItemList:"), e2), a2 = false, e2.forEach(function(e3) { + var t2 = e3.recentContactItem, n2 = e3.optType, o2 = e3.standardMark, e3 = e3.customMark; + i2 = s2._concatConvID(t2), (i2 = s2._getLocalConv(i2)) && (1 === n2 ? a2 = s2._diffStandardMark(i2, o2) : 2 === n2 ? a2 = s2._diffCustomMark(i2, e3) : 3 === n2 && (t2 = s2._diffStandardMark(i2, o2), n2 = s2._diffCustomMark(i2, e3), a2 = t2 || n2)); + }), true === a2 && this._emitConvUpdate()); + } }, { key: "_diffStandardMark", value: function(e2, t2) { + var t2 = Zt(t2), n2 = false; + return true !== function(e3, t3) { + if (e3 !== t3) { + if (!e3 || !t3) + return false; + if (e3.length !== t3.length) + return false; + for (var n3 = 0, o2 = e3.length; n3 < o2; n3++) + if (e3[n3] !== t3[n3]) + return false; + } + return true; + }(e2.markList, t2) && (e2.markList = t2, n2 = true), n2; + } }, { key: "_diffCustomMark", value: function(e2, t2) { + var n2 = false; + return e2.customData !== t2 && void 0 !== t2 && (e2.customData = t2, n2 = true), n2; + } }, { key: "onConvGroupCreated", value: function(e2) { + var a2 = this, s2 = (M.l("".concat(this._n, ".onConvGroupCreated resultList:"), e2), false), r2 = false; + O(e2) && (e2.forEach(function(e3) { + var t2 = e3.msgGroupItem, n2 = t2.groupID, o2 = t2.groupName; + a2._convGroupMap.get(n2) !== o2 && (a2._convGroupMap.set(n2, o2), r2 = true); + var i2, t2 = e3.msgRecentContactItem; + O(t2) && t2.forEach(function(e4) { + i2 = a2._concatConvID(e4), (i2 = a2._getLocalConv(i2)) && -1 === i2.conversationGroupList.indexOf(o2) && (i2.conversationGroupList.push(o2), s2 = true); + }); + }), true === s2 && this._emitConvUpdate(), true === r2) && this._emitConvGroupListUpdate(); + } }, { key: "onConvGroupDeleted", value: function(e2) { + var n2, o2 = this, i2 = (M.l("".concat(this._n, ".onConvGroupDeleted groupItemList:"), e2), []); + O(e2) && (n2 = false, e2.forEach(function(e3) { + var t2 = e3.groupID, e3 = e3.groupName; + o2._convGroupMap.has(t2) && (o2._convGroupMap.delete(t2), n2 = true, i2.push(e3)); + }), true === n2) && this._emitConvGroupListUpdate(), this._eraseFromConversationGroupList(i2); + } }, { key: "_eraseFromConversationGroupList", value: function(t2) { + S(t2) || (this._convM.getLocalConvList().forEach(function(e2) { + e2.conversationGroupList = e2.conversationGroupList.filter(function(e3) { + return !t2.includes(e3); + }); + }), this._emitConvUpdate()); + } }, { key: "onConvGroupNameUpdated", value: function(e2) { + M.l("".concat(this._n, ".onConvGroupNameUpdated options:"), e2); + var t2, n2, o2, i2 = e2.groupID, a2 = e2.groupName, s2 = e2.oldGroupName; + this._convGroupMap.get(i2) !== a2 && (this._convGroupMap.set(i2, a2), this._emitConvGroupListUpdate(), e2 = this._convM.getLocalConvList(), o2 = false, e2.forEach(function(e3) { + t2 = e3.conversationGroupList, -1 !== (n2 = t2.indexOf(s2)) && (t2.splice(n2, 1, a2), o2 = true); + }), true === o2) && this._emitConvUpdate(); + } }, { key: "onConvInGroupUpdated", value: function(e2) { + var n2, o2, i2, a2 = this, s2 = (M.l("".concat(this._n, ".onConvInGroupUpdated options:"), e2), e2.oldGroupName), e2 = e2.recentContactUpdateGroupItem; + O(e2) && (i2 = false, e2.forEach(function(e3) { + var t2 = e3.contactOptType, e3 = e3.recentContactItem; + n2 = a2._concatConvID(e3), (n2 = a2._getLocalConv(n2)) && (o2 = n2.conversationGroupList.indexOf(s2), 1 === t2 ? -1 === o2 && (n2.conversationGroupList.push(s2), i2 = true) : 2 === t2 && -1 !== o2 && (n2.conversationGroupList.splice(o2, 1), i2 = true)); + }), true === i2) && (this._emitConvUpdate(), this._emitConvInGroupUpdate(s2)); + } }, { key: "onConvAddedToOrDeletedFromGroup", value: function(e2) { + var n2, o2, i2 = this, t2 = (M.l("".concat(this._n, ".onConvAddedToOrDeletedFromGroup options:"), e2), e2.msgRecentContactItem), e2 = e2.msgRecentContactUpdateContactItem, t2 = this._concatConvID(t2), a2 = this._getLocalConv(t2); + a2 && O(e2) && (o2 = false, e2.forEach(function(e3) { + var t3 = e3.groupOptType, e3 = e3.recentContactGroupItem.groupName; + n2 = a2.conversationGroupList.indexOf(e3), 1 === t3 ? -1 === n2 && (a2.conversationGroupList.push(e3), o2 = true) : 2 === t3 && -1 !== n2 && (a2.conversationGroupList.splice(n2, 1), o2 = true), true === o2 && i2._emitConvInGroupUpdate(e3); + }), true === o2) && this._emitConvUpdate(); + } }, { key: "onConvGroupListSynced", value: function(e2) { + O(e2) && 0 !== e2.length && (M.l("".concat(this._n, ".onConvGroupListSynced groupItem:"), e2), this._fillConvGroupMap(e2)); + } }, { key: "getConvGroupListByID", value: function(e2) { + var t2, n2 = this; + if (!S(e2)) + return t2 = [], e2.forEach(function(e3) { + n2._convGroupMap.has(e3) && t2.push(n2._convGroupMap.get(e3)); + }), t2; + } }, { key: "_onConvNotFound", value: function(e2, t2) { + e2.push({ conversationID: t2, code: L.CONV_NOT_FOUND, message: this._convM.getErrMsg(L.CONV_NOT_FOUND) }); + } }, { key: "_onConvIDInvalid", value: function(e2, t2) { + e2.push({ conversationID: t2, code: L.INVALID_CONV_ID, message: this._convM.getErrMsg(L.INVALID_CONV_ID) }); + } }, { key: "_getFlagBit", value: function(e2) { + for (var t2 = e2.toString(2), n2 = t2.length, o2 = n2 - 1; 0 <= o2; o2--) + if ("1" === t2[o2]) + return n2 - o2 - 1; + } }, { key: "_concatConvID", value: function(e2) { + var t2, n2 = e2.type, o2 = e2.to, i2 = e2.groupID, e2 = e2.userID; + return 1 === n2 ? N(e2) ? N(o2) || (t2 = "".concat(A.CONV_C2C).concat(o2)) : t2 = "".concat(A.CONV_C2C).concat(e2) : 2 === n2 && (t2 = "".concat(A.CONV_GROUP).concat(i2)), t2; + } }, { key: "_getMyUserID", value: function() { + return this._convM.getMyUserID(); + } }, { key: "_getLocalConv", value: function(e2) { + return this._convM.getLocalConversation(e2); + } }, { key: "_hasLocalConv", value: function(e2) { + return this._convM.hasLocalConversation(e2); + } }, { key: "_emitConvUpdate", value: function() { + this._convM.emitConvUpdate(true, false); + } }, { key: "_emitConvGroupListUpdate", value: function() { + this._convM.emitOEvt(h.CONVERSATION_GROUP_LIST_UPDATED, p(this._convGroupMap.values())); + } }, { key: "_emitConvInGroupUpdate", value: function(t2) { + var e2 = { groupName: t2, conversationList: [] }, n2 = this._convM.getLocalConvList(); + e2.conversationList = n2.filter(function(e3) { + return e3.conversationGroupList.includes(t2); + }), this._convM.emitOEvt(h.CONVERSATION_IN_GROUP_UPDATED, e2); + } }, { key: "reset", value: function() { + M.l("".concat(this._n, ".reset")), this._convGroupMap.clear(), this._startIndex = 0, this._pagingStatus = Nn; + } }]), Qi), ci = (t(Zi, u), Zo = n(Zi), e(Zi, [{ key: "_initListeners", value: function() { + var e2 = this.getIEmitInst(); + e2.on(P.A2KEY_AND_TINYID_UPDATED, this._init, this), e2.on(P.PROFILE_UPDATED, this._onProfileUpdated, this), e2.on(P.CLOUD_CONFIG, this._onCloudConfig, this); + } }, { key: "_init", value: function() { + var e2 = this, t2 = (M.l("".concat(this._n, "._init")), this.get(13).getItem("conversationMap")), n2 = this.isIntl(), o2 = this.isUsingChatCore(); + if (t2) { + for (var i2 = t2.length, a2 = 0; a2 < i2; a2++) { + var s2 = t2[a2]; + if (s2) { + if (this._isNonExistentAccount(s2.conversationID)) + continue; + if (s2.groupProfile && Ot(s2.groupProfile.type)) + continue; + } + this._convMap.set(s2.conversationID, new ii(t2[a2], n2, o2)); + } + this.emitConvUpdate(true, false); + } + this.ready(function() { + 0 < e2._tmpGroupList.length && (e2.updateConvGroupProfile(e2._tmpGroupList), e2._tmpGroupList.length = 0); + }), this.syncConvList(); + } }, { key: "_isNonExistentAccount", value: function(e2) { + var t2; + return "@TLS#ERROR" === (t2 = e2.startsWith(A.CONV_C2C) ? e2.replace(A.CONV_C2C, "") : t2) || "@TLS#NOT_FOUND" === t2; + } }, { key: "onCheckTimer", value: function(e2) { + this.isLoggedIn() && this._msgListHandler.onCheckTimer(e2); + } }, { key: "onMessageSent", value: function(e2) { + this._onSendOrRcvMsg({ conversationOptionsList: e2.conversationOptionsList, isInstantMessage: true }); + } }, { key: "onNewMessage", value: function(e2) { + this._onSendOrRcvMsg(e2); + } }, { key: "_onSendOrRcvMsg", value: function(e2) { + var t2 = this, n2 = e2.conversationOptionsList, o2 = e2.isInstantMessage, o2 = void 0 === o2 || o2, i2 = e2.isUnreadC2CMessage, i2 = void 0 !== i2 && i2, a2 = e2.updateUnreadCount, a2 = void 0 === a2 || a2, s2 = e2.isSyncingEnded, s2 = void 0 !== s2 && s2; + this._isReady ? 0 !== n2.length ? (true === o2 && this._checkNewConv(n2), this._updateLocalConvList({ conversationOptionsList: n2, isInstantMessage: o2, isUnreadC2CMessage: i2, isFromGetConversations: false, updateUnreadCount: a2 }), o2 || (this._convIDFromUnreadDBMap = new Map([].concat(p(this._convIDFromUnreadDBMap), p(n2.map(function(e3) { + return [e3.conversationID, 1]; + })))), this._diffAndDeleteConv(), s2 && this.emitIEvt(P.C2C_UNREAD_HANDLE_COMPLETED)), 0 < n2.filter(function(e3) { + return !t2._isConvNeedShow(e3.conversationID); + }).length || this.emitConvUpdate()) : s2 && this.emitIEvt(P.C2C_UNREAD_HANDLE_COMPLETED) : this.ready(function() { + t2._onSendOrRcvMsg(e2); + }); + } }, { key: "updateConvGroupProfile", value: function(e2) { + var n2, o2 = this; + O(e2) && 0 === e2.length || (0 !== this._convMap.size ? (n2 = false, e2.forEach(function(e3) { + var t2 = "".concat(A.CONV_GROUP).concat(e3.groupID); + o2._convMap.has(t2) && (n2 = true, (t2 = o2._convMap.get(t2)).groupProfile = JSON.parse(JSON.stringify(e3)), t2.lastMessage.lastSequence < e3.nextMessageSeq && (t2.lastMessage.lastSequence = e3.nextMessageSeq - 1), t2.subType || (t2.subType = e3.type)); + }), n2 && this.emitConvUpdate(true, false)) : this._tmpGroupList = e2); + } }, { key: "onMessageRevoked", value: function(e2, t2) { + var n2, o2, i2, a2 = this; + 0 !== e2.length && (n2 = null, o2 = false, i2 = [], e2.forEach(function(e3) { + (n2 = a2._convMap.get(e3.conversationID)) && (t2 && n2.reduceUnreadCount() && (o2 = n2.type !== A.CONV_TOPIC), n2.type === A.CONV_TOPIC ? i2.push(e3) : n2.isLastMessageRevoked({ sequence: e3.sequence, time: e3.time }) && (n2.setLastMessageRevoked(true), n2.setLastMessageRevoker(e3.revoker), o2 = true)); + }), this.get(10).onMessageRevoked(i2), o2) && this.emitConvUpdate(true, false); + } }, { key: "updateRevokerInfo", value: function(u2) { + for (var e2 = /* @__PURE__ */ new Set(), t2 = 0; t2 < u2.length; t2++) { + var n2 = u2[t2].revoker; + e2.add(n2); + } + var o2 = p(e2), i2 = this.get(4); + return new Promise(function(c2) { + i2.getUserProfile({ userIDList: o2 }).then(function(e3) { + e3 = e3.data; + if (!O(e3) || 0 === e3.length) + return c2(u2); + var t3, n3 = {}, o3 = Z(e3); + try { + for (o3.s(); !(t3 = o3.n()).done; ) { + var i3 = t3.value, a2 = i3.userID, s2 = i3.nick, r2 = i3.avatar; + n3[a2] = { nick: s2, avatar: r2 }; + } + } catch (e4) { + o3.e(e4); + } finally { + o3.f(); + } + u2.forEach(function(e4) { + var t4 = e4.revoker; + n3[t4] && (e4.revokerInfo.nick = n3[t4].nick || "", e4.revokerInfo.avatar = n3[t4].avatar || ""); + }), c2(u2); + }).catch(function() { + c2(u2); + }); + }); + } }, { key: "isLastMessageRevoked", value: function(e2) { + var t2 = false, n2 = e2.conversationID, o2 = e2.sequence, i2 = e2.time, a2 = this._convMap.get(n2); + return a2 && (t2 = a2.type === A.CONV_TOPIC ? this.get(10).isLastMessageRevoked({ topicID: n2.replace(A.CONV_GROUP, ""), sequence: o2 }) : a2.isLastMessageRevoked({ sequence: o2, time: i2 })), M.l("".concat(this._n, ".isLastMessageRevoked options:"), e2, "ret:".concat(t2)), t2; + } }, { key: "onMessageDeleted", value: function(e2) { + var t2 = this; + if (0 !== e2.length) { + var n2 = null; + e2.forEach(function(e3) { + (n2 = t2._msgListHandler.getLocalMsg(e3.conversationID, e3.ID)) && (n2.isDeleted = true), e3 !== n2 && (e3.isDeleted = true); + }); + for (var e2 = e2[0].conversationID, o2 = this._msgListHandler.getLocalMsgList(e2), i2 = {}, a2 = o2.length - 1; 0 <= a2; a2--) + if (!o2[a2].isDeleted) { + i2 = o2[a2]; + break; + } + var s2, r2 = this._convMap.get(e2); + r2 && (s2 = false, r2.lastMessage.lastSequence === i2.sequence && r2.lastMessage.lastTime === i2.time || (S(i2) && (i2 = void 0), r2.updateLastMessage(i2), r2.type !== A.CONV_TOPIC && (s2 = true), M.l("".concat(this._n, ".onMessageDeleted. update convID:").concat(e2, " with lastMessage:"), r2.lastMessage)), e2.startsWith(A.CONV_C2C) && this.updateUnreadCount(e2), s2) && this.emitConvUpdate(true, false); + } + } }, { key: "onMessageModified", value: function(e2) { + var t2 = "".concat(this._n, ".onMessageModified"), n2 = e2.conversationType, o2 = e2.from, i2 = e2.to, a2 = e2.time, s2 = e2.sequence, r2 = e2.elements, c2 = e2.cloudCustomData, u2 = e2.messageVersion, l2 = this.getMyUserID(), d2 = "".concat(n2).concat(i2), l2 = (i2 === l2 && n2 === A.CONV_C2C && (d2 = "".concat(n2).concat(o2)), this._msgListHandler.onMsgModified(d2, e2)), n2 = l2.isUpdated, l2 = l2.message, p2 = (true === n2 && this.emitOEvt(h.MESSAGE_MODIFIED, [l2]), this._isTopicConv(d2)); + return null === l2 ? M.l("".concat(t2, " message is null! options:"), e2) : M.l("".concat(t2, " isUpdated:").concat(n2, " isTopicMessage:").concat(p2, " from:").concat(o2, " to:").concat(i2, " sequence:").concat(l2.sequence, " time:").concat(l2.time)), p2 ? this.get(10).onMessageModified(e2) : (n2 = this._convMap.get(d2)) && (o2 = n2.lastMessage) && o2.lastTime === a2 && o2.lastSequence === s2 && o2.version !== u2 && (M.l("".concat(t2, " convID:").concat(d2, " lastMessage updated")), o2.type = r2[0].type, o2.payload = r2[0].content, o2.messageForShow = zt(o2.type, o2.payload, this.isIntl()), o2.cloudCustomData = c2, o2.version = u2, this.emitConvUpdate(true, false)), l2; + } }, { key: "onNewGroupAtTips", value: function(e2) { + var t2 = this, e2 = e2.dataList, n2 = null; + e2.forEach(function(e3) { + e3.groupAtTips ? n2 = e3.groupAtTips : e3.elements ? n2 = y(y({}, e3.elements), {}, { sync: true }) : e3.groupAtType && (n2 = y(y({}, e3), {}, { sync: true })), n2.__random = e3.random, n2.__sequence = e3.clientSequence, t2._tmpGroupAtTipsList.push(n2); + }), M.l("".concat(this._n, ".onNewGroupAtTips isReady:").concat(this._isReady), this._tmpGroupAtTipsList), this._isReady && this._handleGroupAtTipsList(); + } }, { key: "_handleGroupAtTipsList", value: function() { + var s2, r2 = this; + 0 !== this._tmpGroupAtTipsList.length && (s2 = false, this._tmpGroupAtTipsList.forEach(function(e2) { + var t2, n2 = e2.groupID, o2 = e2.from, i2 = e2.topicID, i2 = void 0 === i2 ? void 0 : i2, a2 = e2.sync, a2 = void 0 !== a2 && a2; + o2 !== r2.getMyUserID() && (N(i2) ? (o2 = r2._convMap.get("".concat(A.CONV_GROUP).concat(n2))) && (o2.updateGroupAtInfoList(e2), s2 = true) : ((n2 = r2._convMap.get("".concat(A.CONV_GROUP).concat(i2))) && (n2.updateGroupAtInfoList(e2), o2 = r2.get(10), t2 = n2.groupAtInfoList, o2.onAtInfoUpdated({ topicID: i2, groupAtInfoList: t2 })), S(n2) && a2 && (r2.updateTopicConversation([{ conversationID: "".concat(A.CONV_GROUP).concat(i2), type: A.CONV_TOPIC }]), r2._convMap.get("".concat(A.CONV_GROUP).concat(i2)).updateGroupAtInfoList(e2)))); + }), s2 && this.emitConvUpdate(true, false), this._tmpGroupAtTipsList.length = 0); + } }, { key: "_checkNewConv", value: function(e2) { + var t2 = this, n2 = [], o2 = []; + e2.forEach(function(e3) { + t2._convMap.has(e3.conversationID) || (e3.type === A.CONV_C2C ? n2.push(e3.conversationID.replace(A.CONV_C2C, "")) : e3.type === A.CONV_GROUP && o2.push(e3.conversationID.replace(A.CONV_GROUP, ""))); + }), 0 < n2.length && (this._onNewC2CConv(n2), n2 = null), 0 < o2.length && (this._onNewGroupConv(o2), o2 = null); + } }, { key: "_onNewC2CConv", value: function(e2) { + var t2 = this.get(6); + return Promise.all([t2.getRemotePeerReadTime(e2), this._msgRemindHandler.getC2CMsgRemindType(e2), this._convGroupHandler.searchConvGroupAndMark(e2, 1)]); + } }, { key: "_onNewGroupConv", value: function(e2) { + var t2 = this.get(7); + return t2 ? Promise.all([t2.getMsgRemindType(e2), this._convGroupHandler.searchConvGroupAndMark(e2, 2)]) : Promise.resolve(); + } }, { key: "_setStorageConvList", value: function() { + var e2 = 0 < arguments.length && void 0 !== arguments[0] && arguments[0], t2 = this.getLocalConvList().filter(function(e3) { + return e3.type === A.CONV_C2C || e3.type === A.CONV_GROUP && e3.lastMessage.type !== A.MSG_GRP_TIP; + }).slice(0, 20).map(function(e3) { + return { conversationID: e3.conversationID, type: e3.type, subType: e3.subType, lastMessage: e3.lastMessage, groupProfile: e3.groupProfile, userProfile: e3.userProfile }; + }); + this.get(13).setItem("conversationMap", t2, e2); + } }, { key: "emitConvUpdate", value: function() { + var e2 = !(0 < arguments.length && void 0 !== arguments[0]) || arguments[0], t2 = !(1 < arguments.length && void 0 !== arguments[1]) || arguments[1], n2 = this.getLocalConvList(); + t2 && (t2 = this.get(7)) && t2.updateGroupLastMessage(n2), e2 && (this.get(12).isPartialUpdatedConvs() ? (this._diffConvMap(this._convMapForDiff, this._convMap), 0 < this._partialUpdatedConvMap.size && (this.emitOEvt(h.CONVERSATION_LIST_UPDATED), this.onTotalUnreadCountUpdate(), this._convMapForDiff.clear(), this._convMapForDiff = ht(this._convMap, true)), 0 === this._convMapForDiff.size && (this._convMapForDiff = ht(this._convMap, true))) : (this.emitOEvt(h.CONVERSATION_LIST_UPDATED), this.onTotalUnreadCountUpdate())); + } }, { key: "_diffConvMap", value: function(e2, t2) { + var n2, o2 = Z(t2); + try { + for (o2.s(); !(n2 = o2.n()).done; ) { + var i2 = Y(n2.value, 2), a2 = i2[0], s2 = i2[1]; + e2.has(a2) && JSON.stringify(s2) === e2.get(a2) || this._partialUpdatedConvMap.set(a2, s2); + } + } catch (e3) { + o2.e(e3); + } finally { + o2.f(); + } + } }, { key: "getPartialUpdatedConvs", value: function() { + var e2 = p(ht(this._partialUpdatedConvMap, false).values()); + return this._partialUpdatedConvMap.clear(), e2; + } }, { key: "getLocalConvList", value: function() { + var t2 = this; + return p(this._convMap.values()).filter(function(e2) { + return t2._isConvNeedShow(e2.conversationID); + }); + } }, { key: "getLocalConversation", value: function(e2) { + return this._convMap.get(e2); + } }, { key: "hasLocalConversation", value: function(e2) { + return this._convMap.has(e2); + } }, { key: "getLocalOldestMessage", value: function(e2) { + return this._msgListHandler.getLocalOldestMsg(e2); + } }, { key: "syncConvList", value: function() { + var o2 = this, e2 = !(0 < arguments.length && void 0 !== arguments[0]) || arguments[0], i2 = "syncConvList", a2 = new G(i2); + return this._pagingStatus === Nn && this._convMap.clear(), this._pagingGetConvList(e2).then(function(e3) { + var t2 = tn(o2._pagingGetCostList), n2 = en(o2._pagingGetCostList), n2 = (o2._pagingGetCostList.length = 0, o2._pagingStatus = Pn, o2._diffAndDeleteConv(), o2.emitConvUpdate(true, false), o2._setStorageConvList(), o2._handleC2CPeerReadTime(), o2.emitIEvt(P.CONV_SYNC_COMPLETED), "count:".concat(o2._convMap.size, " sum:").concat(n2, " avg:").concat(t2)); + return M.l("".concat(o2._n, ".").concat(i2, ". ").concat(n2)), a2.setMessage(n2).end(), e3; + }).catch(function(e3) { + return o2._pagingStatus = Un, a2.setMessage(o2._pagingTs).setError(e3).end(), D(e3); + }); + } }, { key: "_diffAndDeleteConv", value: function() { + var n2, o2 = this; + this._isSyncCompleted() && (n2 = [], this._convMap.forEach(function(e2, t2) { + !o2._pagingConvIDMap.has(t2) && o2._convIDFromUnreadDBMap.has(t2) && (o2._convMap.delete(t2), n2.push(t2)); + }), M.l("".concat(this._n, "._diffAndDeleteConv list:").concat(n2)), n2 = null); + } }, { key: "_pagingGetConvList", value: function() { + var r2 = this, e2 = !(0 < arguments.length && void 0 !== arguments[0]) || arguments[0], c2 = "".concat(this._n, "._pagingGetConvList"), u2 = (M.l("".concat(c2, " incrementalPullFlag:").concat(e2, " ts:").concat(this._pagingTs, " startIdx:").concat(this._pagingStartIdx) + " pinnedTs:".concat(this._pagingPinnedTs, " pinnedStartIdx:").concat(this._pagingPinnedStartIdx)), Date.now()); + return this._pagingStatus = Gn, this.req({ P: k.PAGING_GET_CONV_LIST, data: { fromAccount: this.getMyUserID(), timeStamp: e2 ? this._pagingTs : 0, startIndex: e2 ? this._pagingStartIdx : 0, pinnedTimeStamp: e2 ? this._pagingPinnedTs : 0, pinnedStartIndex: e2 ? this._pagingPinnedStartIdx : 0, orderType: 1 } }).then(function(e3) { + var e3 = e3.data, t2 = e3.completeFlag, n2 = e3.conversations, n2 = void 0 === n2 ? [] : n2, o2 = e3.timeStamp, i2 = e3.startIndex, a2 = e3.pinnedTimeStamp, s2 = e3.pinnedStartIndex, e3 = e3.groupItem; + if (r2._pagingGetCostList.push(nn(u2, false)), M.l("".concat(c2, " ok. completeFlag:").concat(t2, " count:").concat(n2.length, " cost:").concat(nn(u2))), r2._convGroupHandler.onConvGroupListSynced(e3), 0 < n2.length && (e3 = r2._getConvOptions(n2), r2._pagingConvIDMap = new Map([].concat(p(r2._pagingConvIDMap), p(e3.map(function(e4) { + return [e4.conversationID, 1]; + })))), r2._updateLocalConvList({ conversationOptionsList: e3, isFromGetConversations: true, updateUnreadCount: true }), r2.isLoggedIn()) && r2.emitConvUpdate(), !r2._isReady) { + if (!r2.isLoggedIn()) + return T(); + r2.triggerReady(); + } + return r2._pagingTs = o2, r2._pagingStartIdx = i2, r2._pagingPinnedTs = a2, r2._pagingPinnedStartIdx = s2, 1 !== t2 ? r2._pagingGetConvList() : (r2._handleGroupAtTipsList(), r2._convGroupHandler.getRemoteConvGroupList(), T()); + }).catch(function(e3) { + throw !r2.isLoggedIn() || r2._isReady || (M.w("".concat(c2, " failed. error:"), e3), r2.triggerReady()), e3; + }); + } }, { key: "_updateLocalConvList", value: function(e2) { + var t2 = e2.isFromGetConversations, n2 = Date.now(), e2 = this._getTmpConvListMapping(e2).newConvList; + this._convMap = new Map(this._sortConvList(p(this._convMap))), t2 || this._updateUserOrGroupProfile(e2), M.l("".concat(this._n, "._updateLocalConvList cost:").concat(nn(n2))); + } }, { key: "_getTmpConvListMapping", value: function(e2) { + for (var t2 = e2.conversationOptionsList, n2 = e2.isFromGetConversations, o2 = e2.isInstantMessage, i2 = e2.isUnreadC2CMessage, a2 = void 0 !== i2 && i2, s2 = e2.updateUnreadCount, r2 = [], c2 = [], u2 = this.get(7), l2 = this.get(8), d2 = this.isIntl(), p2 = this.isUsingChatCore(), _2 = 0, h2 = t2.length; _2 < h2; _2++) { + var g2 = new ii(t2[_2], d2, p2), f2 = g2.conversationID, m2 = g2.type; + if (!this._isNonExistentAccount(f2)) { + if (this._convMap.has(f2)) { + var v2 = this._convMap.get(f2); + if (n2) { + this._convMap.set(f2, g2), m2 === A.CONV_C2C ? g2.unreadCount = v2.unreadCount : m2 === A.CONV_GROUP && (g2.groupProfile = JSON.parse(JSON.stringify(v2.groupProfile))); + continue; + } + var I2 = ["unreadCount", "allowType", "adminForbidType", "payload"], M2 = (false === o2 && I2.push("lastMessage"), "boolean" == typeof o2 && I2.push("isPinned"), t2[_2].lastMessage), y2 = !N(M2); + y2 || t2[_2].type === A.CONV_TOPIC || this._onLastMsgNotExist(t2[_2]), N(o2) && y2 && null === v2.lastMessage.payload && (v2.lastMessage.payload = M2.payload), S(v2.lastMessage.revoker) || (v2.lastMessage.revoker = null), _t(v2, g2, I2, [null, void 0, "", 0, NaN]), true === s2 && v2.updateUnreadCount({ nextUnreadCount: g2.unreadCount, isFromGetConversations: n2, isUnreadC2CMessage: a2 }), o2 && y2 && (M2.payload && (v2.lastMessage.payload = M2.payload), v2.type === A.CONV_GROUP) && (v2.lastMessage.nameCard = M2.nameCard, v2.lastMessage.nick = M2.nick), y2 && v2.lastMessage.cloudCustomData !== M2.cloudCustomData && (v2.lastMessage.cloudCustomData = M2.cloudCustomData || ""); + } else + m2 === A.CONV_GROUP && u2 ? (I2 = g2.groupProfile.groupID, (y2 = u2.getLocalGroupProfile(I2)) && (g2.groupProfile = y2, true === s2) && g2.updateUnreadCount({ nextUnreadCount: 0 })) : m2 === A.CONV_C2C && (v2 = f2.replace(A.CONV_C2C, ""), l2) && l2.isMyFriend(v2) && (g2.remark = l2.getFriendRemark(v2)), r2.push(g2), this._convMap.set(f2, g2); + this._convMap.get(f2).type === A.CONV_TOPIC && c2.push(this._convMap.get(f2)); + } + } + for (var C2 = this.get(10), T2 = 0, D2 = c2.length; T2 < D2; T2++) { + var E2 = c2[T2], L2 = E2.conversationID, E2 = E2.groupAtInfoList; + S(E2) || C2.onAtInfoUpdated({ topicID: L2.replace(A.CONV_GROUP, ""), groupAtInfoList: E2 }); + } + return { newConvList: r2 }; + } }, { key: "_onLastMsgNotExist", value: function(e2) { + new G("lastMsgNotExist").setMessage(JSON.stringify(e2)).end(); + } }, { key: "_sortConvList", value: function(e2) { + var t2 = [], n2 = [], o2 = [], i2 = []; + return e2.forEach(function(e3) { + (true === e3[1].isPinned ? S(e3[1].lastMessage.lastTime) ? n2 : t2 : S(e3[1].lastMessage.lastTime) ? i2 : o2).push(e3); + }), t2.sort(function(e3, t3) { + return t3[1].lastMessage.lastTime - e3[1].lastMessage.lastTime; + }).concat(n2).concat(o2.sort(function(e3, t3) { + return t3[1].lastMessage.lastTime - e3[1].lastMessage.lastTime; + })).concat(i2); + } }, { key: "_sortConvListAndEmitEvent", value: function() { + this._convMap = new Map(this._sortConvList(p(this._convMap))), this.emitConvUpdate(true, false); + } }, { key: "_updateUserOrGroupProfile", value: function(e2) { + var n2, o2, t2, i2, a2 = this; + 0 !== e2.length && (n2 = [], o2 = [], t2 = this.get(4), i2 = this.get(7), e2.forEach(function(e3) { + var t3; + e3.type === A.CONV_C2C ? n2.push(e3.toAccount) : e3.type === A.CONV_GROUP && (t3 = e3.toAccount, i2.hasLocalGroup(t3) ? e3.groupProfile = i2.getLocalGroupProfile(t3) : o2.push(t3)); + }), M.l("".concat(this._n, "._updateUserOrGroupProfile userIDList:").concat(n2, " groupIDList:").concat(o2)), 0 < n2.length && t2.getUserProfile({ userIDList: n2 }).then(function(e3) { + e3 = e3.data; + O(e3) ? e3.forEach(function(e4) { + a2._doUpdateUserProfile("".concat(A.CONV_C2C).concat(e4.userID), e4); + }) : a2._doUpdateUserProfile("".concat(A.CONV_C2C).concat(e3.userID), e3); + }), 0 < o2.length) && i2.getGroupProfileAdvance({ groupIDList: o2, responseFilter: { groupBaseInfoFilter: ["Type", "Name", "FaceUrl"] } }).then(function(e3) { + var e3 = e3.data.successGroupList, n3 = false; + e3.forEach(function(e4) { + var t3 = "".concat(A.CONV_GROUP).concat(e4.groupID); + a2._convMap.has(t3) && (t3 = a2._convMap.get(t3), _t(t3.groupProfile, e4, [], [null, void 0, "", 0, NaN]), !t3.subType && e4.type && (t3.subType = e4.type), n3 = true); + }), n3 && a2.emitConvUpdate(); + }); + } }, { key: "_doUpdateUserProfile", value: function(e2, t2) { + this.hasLocalConversation(e2) && (this.getLocalConversation(e2).userProfile = t2, this.emitConvUpdate()); + } }, { key: "_getConvOptions", value: function(e2) { + var n2 = this, o2 = [], e2 = e2.filter(function(e3) { + var t2 = e3.type, e3 = e3.userID; + return 1 === t2 && !n2._isNonExistentAccount(e3) || 2 === t2; + }), i2 = this.getMyUserID(), e2 = e2.map(function(e3) { + var t2; + return N(e3.lastMsg) && (e3.lastMsg = { elements: [] }), 1 === e3.type ? (t2 = { userID: e3.userID, nick: e3.peerNick, avatar: e3.peerAvatar }, o2.push(t2), { conversationID: "".concat(A.CONV_C2C).concat(e3.userID), type: A.CONV_C2C, lastMessage: { lastTime: e3.time, lastSequence: e3.sequence, fromAccount: e3.lastC2CMsgFromAccount, type: e3.lastMsg.elements[0] ? e3.lastMsg.elements[0].type : null, payload: e3.lastMsg.elements[0] ? n2._amendLayersOverLimitProp(e3.lastMsg.elements[0].content) : null, cloudCustomData: e3.lastMsg.cloudCustomData || "", isRevoked: 8 === e3.lastMessageFlag, onlineOnlyFlag: false, nick: "", nameCard: "", version: 0, isPeerRead: e3.lastC2CMsgFromAccount === i2 && e3.time <= e3.c2cPeerReadTime, revoker: e3.lastMsg.revokerInfo ? e3.lastMsg.revokerInfo.revoker : null }, unreadCount: 0, userProfile: new ei(t2), peerReadTime: e3.c2cPeerReadTime, isPinned: 1 === e3.isPinned, customData: e3.customMark || "", markList: Zt(e3.standardMark), conversationGroupList: n2._convGroupHandler.getConvGroupListByID(e3.contactGroupId), remark: e3.friendRemark || "", messageRemindType: n2._transMsgRemindType(e3.messageRemindType) }) : { conversationID: "".concat(A.CONV_GROUP).concat(e3.groupID), type: A.CONV_GROUP, lastMessage: y(y({ lastTime: e3.time, lastSequence: e3.sequence, fromAccount: e3.msgGroupFromAccount }, n2._patchTypeAndPayload(e3)), {}, { cloudCustomData: e3.lastMsg.cloudCustomData || "", isRevoked: 2 === e3.lastMessageFlag, onlineOnlyFlag: false, nick: e3.senderNick || "", nameCard: e3.senderNameCard || "", revoker: e3.lastMsg.revokerInfo ? e3.lastMsg.revokerInfo.revoker : null }), groupProfile: new oi({ groupID: e3.groupID, name: e3.groupNick, avatar: e3.groupImage, type: e3.groupType, nextMessageSeq: e3.nextMessageSeq }), unreadCount: n2._computeGroupUnreadCount(e3), peerReadTime: 0, isPinned: 1 === e3.isPinned, version: 0, customData: e3.customMark || "", markList: Zt(e3.standardMark), conversationGroupList: n2._convGroupHandler.getConvGroupListByID(e3.contactGroupId), messageRemindType: n2._transMsgRemindType(e3.messageRemindType) }; + }); + return 0 < o2.length && this.get(4).onConvProfileUpdated(o2), e2; + } }, { key: "_transMsgRemindType", value: function(e2) { + var t2 = ""; + return 0 === e2 ? t2 = A.MSG_REMIND_ACPT_AND_NOTE : 1 === e2 ? t2 = A.MSG_REMIND_DISCARD : 2 === e2 ? t2 = A.MSG_REMIND_ACPT_NOT_NOTE : 3 === e2 && (t2 = A.NOT_RECEIVE_OFFLINE_PUSH_EXCEPT_AT), t2; + } }, { key: "_computeGroupUnreadCount", value: function(e2) { + var t2 = e2.unreadCount, e2 = e2.noUnreadCount, t2 = (void 0 === t2 ? 0 : t2) - (void 0 === e2 ? 0 : e2); + return 0 < t2 ? t2 : 0; + } }, { key: "_patchTypeAndPayload", value: function(e2) { + var e2 = e2.lastMsg, t2 = e2.event, n2 = e2.elements, n2 = void 0 === n2 ? [] : n2, e2 = e2.groupTips, e2 = void 0 === e2 ? {} : e2; + return N(void 0 === t2 ? void 0 : t2) || S(e2) ? { type: n2[0] ? n2[0].type : null, payload: n2[0] ? this._amendLayersOverLimitProp(n2[0].content) : null } : ((t2 = new Do(e2)).setElement({ type: A.MSG_GRP_TIP, content: y(y({}, e2.elements), {}, { groupProfile: e2.groupProfile }) }), n2 = JSON.parse(JSON.stringify(t2.payload)), t2 = null, { type: A.MSG_GRP_TIP, payload: n2 }); + } }, { key: "_amendLayersOverLimitProp", value: function(e2) { + var t2 = e2.layersOverLimit; + return 0 === t2 ? e2.layersOverLimit = false : 1 === t2 && (e2.layersOverLimit = true), e2; + } }, { key: "getLocalMessageList", value: function(e2) { + return this._msgListHandler.getLocalMsgList(e2); + } }, { key: "deleteLocalMessage", value: function(e2) { + e2 instanceof Do && this._msgListHandler.remove(e2); + } }, { key: "onConvDeleted", value: function(e2) { + O(e2) && (e2 = e2.map(function(e3) { + var t2 = e3.type, n2 = e3.userID, e3 = e3.groupID; + return 1 === t2 ? "".concat(A.CONV_C2C).concat(n2) : 2 === t2 ? "".concat(A.CONV_GROUP).concat(e3) : void 0; + }), M.l("".concat(this._n, ".onConvDeleted convIDList:").concat(e2)), this.deleteLocalConvList(e2)); + } }, { key: "onConvPinnedStatus", value: function(e2, i2) { + var a2, s2 = this; + O(e2) && (a2 = false, e2.forEach(function(e3) { + var t2, n2 = e3.type, o2 = e3.userID, e3 = e3.groupID; + 1 === n2 ? t2 = s2.getLocalConversation("".concat(A.CONV_C2C).concat(o2)) : 2 === n2 && (t2 = s2.getLocalConversation("".concat(A.CONV_GROUP).concat(e3))), t2 && (M.l("".concat(s2._n, ".onConvPinnedStatus convID:").concat(t2.conversationID, " localPinned:").concat(t2.isPinned, " remotePinned:").concat(i2)), i2 ? t2.isPinned || (t2.isPinned = true, a2 = true) : t2.isPinned && (t2.isPinned = false, a2 = true)); + }), a2) && this._sortConvListAndEmitEvent(); + } }, { key: "getMessageList", value: function(e2) { + var r2 = this, c2 = e2.conversationID, t2 = e2.nextReqMessageID, e2 = e2.count, u2 = "".concat(this._n, ".getMessageList"), n2 = this.getLocalConversation(c2), o2 = ""; + if (n2 && n2.groupProfile && (o2 = n2.groupProfile.type), Ot(o2)) + return M.l("".concat(u2, " not available in ").concat(o2, ". convID:").concat(c2)), T({ messageList: [], nextReqMessageID: "", isCompleted: true }); + (N(e2) || 15 < e2) && (e2 = 15), t2 || this._isMeInCommunity(c2) || this.clearMemMsg(c2); + var l2 = this._computeRemainingCount({ conversationID: c2, nextReqMessageID: t2 }), n2 = this._completedMap.has(c2); + if (M.l("".concat(u2, " convID:").concat(c2, " isEverCleared:").concat(this._isEverCleared(c2), " nextReqMessageID:").concat(t2) + " remainingCount:".concat(l2, " count:").concat(e2, " isCompleted:").concat(n2)), this._needGetHistory({ conversationID: c2, remainingCount: l2, count: e2 })) + return this.getHistoryMessages({ conversationID: c2, nextReqMessageID: t2, count: 20 }).then(function(e3) { + var t3 = e3.nextReqID, n3 = e3.storedMessageList, o3 = e3.assembledMessageList, e3 = e3.isPullingCompleted, i2 = r2._completedMap.has(c2), a2 = n3, s2 = (0 < l2 && (a2 = r2._msgListHandler.getLocalMsgList(c2).slice(0, n3.length + l2)), { nextReqMessageID: void 0, messageList: void 0, isCompleted: void 0 }), n3 = (r2._isEverCleared(c2) ? (s2.nextReqMessageID = t3, s2.messageList = o3, s2.isCompleted = e3) : (s2.nextReqMessageID = i2 ? "" : t3, s2.messageList = a2, s2.isCompleted = i2), s2.messageList.filter(function(e4) { + return e4.isRevoked; + }) || []), o3 = s2.messageList.map(function(e4) { + return e4.sequence; + }); + return M.l("".concat(u2, " ret.nextReqMessageID:").concat(s2.nextReqMessageID, " ret.isCompleted:").concat(s2.isCompleted, " sequenceList:"), o3), O(n3) && 0 !== n3.length ? r2.updateRevokerInfo(n3).then(function(e4) { + return e4.forEach(function(t4) { + var n4 = t4.revokerInfo; + s2.messageList = s2.messageList.map(function(e5) { + return e5.ID === t4.ID && n4 && (e5.revokeReason = n4.reason || "", e5.revokerInfo = { userID: n4.revoker || e5.revoker, nick: n4.nick, avatar: n4.avatar }), e5; + }); + }), C(s2); + }) : C(s2); + }); + this.modifyMessageList(c2); + o2 = this._getMsgListFromMem({ conversationID: c2, nextReqMessageID: t2, count: e2 }); + return T(o2); + } }, { key: "_isEverCleared", value: function(e2) { + return this._everClearedMap.has(e2); + } }, { key: "_getMsgListFromMem", value: function(e2) { + var t2 = e2.conversationID, n2 = e2.nextReqMessageID, e2 = e2.count, o2 = "".concat(this._n, "._getMsgListFromMem"), i2 = this._msgListHandler.getLocalMsgList(t2), a2 = i2.length, s2 = Pt(t2), r2 = 0, c2 = { isCompleted: false, nextReqMessageID: "", messageList: [] }, e2 = (n2 ? (r2 = s2 ? i2.findIndex(function(e3) { + return e3.ID === n2; + }) : i2.findIndex(function(e3) { + return e3.sequence + "" === n2; + })) > e2 ? (c2.messageList = i2.slice(r2 - e2, r2), c2.nextReqMessageID = s2 ? i2[r2 - e2].ID : i2[r2 - e2].sequence + "") : (c2.messageList = i2.slice(0, r2), c2.isCompleted = true) : e2 < a2 ? (c2.messageList = i2.slice(r2 = a2 - e2, a2), c2.nextReqMessageID = s2 ? i2[r2].ID : i2[r2].sequence + "") : (c2.messageList = i2.slice(0, a2), c2.isCompleted = true), c2.messageList.map(function(e3) { + return e3.sequence; + })); + return M.l("".concat(o2, " convID:").concat(t2) + " ret.nextReqMessageID:".concat(c2.nextReqMessageID, " ret.isCompleted:").concat(c2.isCompleted, " sequenceList:").concat(e2)), c2; + } }, { key: "getMessageListHopping", value: function(e2) { + var t2, n2, o2 = e2.conversationID, i2 = e2.sequence, a2 = e2.time, s2 = e2.count, e2 = e2.direction, e2 = void 0 === e2 ? 0 : e2; + return (N(s2) || 15 < s2) && (s2 = 15), o2.startsWith(A.CONV_C2C) ? (t2 = this.get(6), n2 = o2.replace(A.CONV_C2C, ""), t2.getRoamingMessagesHopping({ peerAccount: n2, time: a2, count: s2, direction: e2 })) : o2.startsWith(A.CONV_GROUP) ? (t2 = this.get(7), n2 = o2.replace(A.CONV_GROUP, ""), t2.getRoamingMessagesHopping({ groupID: n2, sequence: i2, count: s2, direction: e2 })) : void 0; + } }, { key: "_computeRemainingCount", value: function(e2) { + var t2, n2 = e2.conversationID, o2 = e2.nextReqMessageID, e2 = this._msgListHandler.getLocalMsgList(n2), i2 = e2.length; + return M.l("".concat(this._n, "._computeRemainingCount convID:").concat(n2, " nextReqMessageID:").concat(o2, " length:").concat(i2)), o2 ? (t2 = 0, Pt(n2) ? t2 = e2.findIndex(function(e3) { + return e3.ID === o2; + }) : Ut(n2) && (t2 = -1 !== o2.indexOf("-") ? e2.findIndex(function(e3) { + return e3.ID === o2; + }) : e2.findIndex(function(e3) { + return e3.sequence + "" === o2; + })), -1 === t2 ? 0 : t2) : i2; + } }, { key: "_needGetHistory", value: function(e2) { + var t2 = e2.conversationID, n2 = e2.remainingCount, e2 = e2.count, o2 = this.getLocalConversation(t2), i2 = ""; + return o2 && o2.groupProfile && (i2 = o2.groupProfile.type), !(bt(t2) || Ot(i2) || !this._isEverCleared(t2) && (o2 = n2 <= e2 && !this._completedMap.has(t2), M.l("".concat(this._n, "._needGetHistory convID:").concat(t2, " ret:").concat(o2)), !o2)); + } }, { key: "_isTopicConv", value: function(e2) { + e2 = e2.replace(A.CONV_GROUP, ""); + return Gt(e2); + } }, { key: "getHistoryMessages", value: function(e2) { + var t2, n2, o2, i2, a2, s2, r2 = e2.conversationID, c2 = e2.count, e2 = e2.nextReqMessageID; + return r2 === A.CONV_SYSTEM ? T() : (c2 = 20 < c2 ? 20 : 15, t2 = null, Pt(r2) ? (s2 = 0, n2 = "", o2 = false, a2 = this._roamingMsgKeyAndTimeMap.has(r2), e2 && (o2 = true, a2 ? (s2 = this._roamingMsgKeyAndTimeMap.get(r2).lastMessageTime, n2 = this._roamingMsgKeyAndTimeMap.get(r2).messageKey) : (i2 = this._msgListHandler.findMessage(e2)) && (s2 = i2.time, M.l("".concat(this._n, ".getHistoryMessages convID:").concat(r2, " isRelayInfoExisted:").concat(a2, " lastMessageTime:").concat(s2)))), (t2 = this.get(6)).getRoamingMessage({ conversationID: r2, peerAccount: r2.replace(A.CONV_C2C, ""), count: c2, lastMessageTime: o2 ? s2 : 0, messageKey: o2 ? n2 : "" })) : Ut(r2) ? (t2 = this.get(7)) ? (i2 = r2.replace(A.CONV_GROUP, ""), a2 = null, this._convMap.has(r2) && !Gt(i2) && (a2 = this._convMap.get(r2).lastMessage), s2 = 0, e2 ? s2 = Number(e2) : a2 && (s2 = a2.lastSequence), t2.getRoamingMessage({ conversationID: r2, groupID: i2, count: c2, sequence: s2 })) : D({ code: L.NO_MODULE }) : T()); + } }, { key: "patchConvLastMessage", value: function(e2) { + var t2, n2, o2 = 1 < arguments.length && void 0 !== arguments[1] && arguments[1], i2 = this.getLocalConversation(e2); + i2 && (t2 = (n2 = i2.lastMessage).messageForShow, n2 = n2.payload, S(t2) || S(n2) || o2) && 0 !== (t2 = this._msgListHandler.getLocalMsgList(e2)).length && (n2 = t2[t2.length - 1], M.l("".concat(this._n, ".patchConvLastMessage bForceUpdate:").concat(o2, " convID:").concat(e2, " payload:"), n2.payload), i2.updateLastMessage(n2)); + } }, { key: "onRoamingMessage", value: function() { + for (var e2, t2, n2 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : [], o2 = 1 < arguments.length ? arguments[1] : void 0, i2 = !(2 < arguments.length && void 0 !== arguments[2]) || arguments[2], a2 = 3 < arguments.length ? arguments[3] : void 0, s2 = o2.startsWith(A.CONV_C2C) ? A.CONV_C2C : A.CONV_GROUP, r2 = null, c2 = [], o2 = [], u2 = 0, l2 = n2.length, d2 = s2 === A.CONV_GROUP, p2 = this.getFileDownloadProxy(), _2 = this.getDowloadFileAuthKey(), h2 = O(a2), g2 = this.get(17).getFileDNList(), f2 = function() { + d2 ? --u2 : ++u2; + }, m2 = function() { + return d2 ? l2 <= u2 : u2 < l2; + }, u2 = d2 ? n2.length - 1 : 0, l2 = d2 ? 0 : n2.length; m2(); f2()) + 1 !== n2[u2].isPlaceMessage && ((r2 = new Do(n2[u2])).to = n2[u2].to, s2 !== A.CONV_GROUP || N(n2[u2].topicID) || (r2.to = n2[u2].topicID), r2.isSystemMessage = !!n2[u2].isSystemMessage, r2.conversationType = s2, e2 = 4 === n2[u2].event ? { type: A.MSG_GRP_TIP, content: y(y({}, n2[u2].elements), {}, { groupProfile: n2[u2].groupProfile }) } : n2[u2].elements, d2 || r2.setNickAndAvatar({ nick: n2[u2].nick, avatar: n2[u2].avatar }), S(e2) ? ((t2 = new G("emptyMessageBody")).setMessage("from:".concat(r2.from, " to:").concat(r2.to, " sequence:").concat(r2.sequence, " event:").concat(n2[u2].event)), t2.setLevel("warning").end()) : (r2.setElement(e2, p2, _2, g2), r2.reInitialize(this.getMyUserID()), c2.push(r2), h2 && a2.push(r2))); + return f2 = m2 = null, i2 ? (this._msgListHandler.unshift(c2, o2), c2 = null, o2) : c2; + } }, { key: "findMessage", value: function(e2) { + return this._msgListHandler.findMessage(e2); + } }, { key: "_isMeInCommunity", value: function(e2) { + var t2 = true; + return this._isTopicConv(e2) && (e2 = Jt(e2.replace(A.CONV_GROUP, "")), this.get(7).hasLocalGroup(e2) || (t2 = false, M.l("".concat(this._n, "._isMeInCommunity groupID:").concat(e2, " ret:").concat(t2)))), t2; + } }, { key: "deleteTopicRoamingInfo", value: function(e2) { + var t2 = this; + Nt({ groupID: e2 }) && this._msgListHandler.getTopicConvIDList(e2).forEach(function(e3) { + t2.clearMemMsg(e3); + }); + } }, { key: "deleteGroupRoamingInfo", value: function(e2) { + e2 = "".concat(A.CONV_GROUP).concat(e2); + 0 < this._msgListHandler.getLocalMsgList(e2).length && this.clearMemMsg(e2); + } }, { key: "setMessageRead", value: function(e2) { + var t2 = e2.conversationID, n2 = this.getLocalConversation(t2), e2 = "".concat(this._n, ".setMessageRead"); + if (M.l("".concat(e2, " convID:").concat(t2, " unreadCount:").concat(n2 ? n2.unreadCount : 0)), !n2) + return T(); + if (n2.type !== A.CONV_GROUP && n2.type !== A.CONV_TOPIC || S(n2.groupAtInfoList) || this.deleteGroupAtTips(t2), 0 === n2.unreadCount) + return T(); + var o2 = this._msgListHandler.getLocalLastMsg(t2), i2 = n2.lastMessage.lastTime, a2 = this._msgListHandler.getLocalMaxTime(t2), a2 = (i2 < a2 && (M.l("".concat(e2, " update lastMessageTime from ").concat(i2, " to ").concat(a2)), i2 = a2), this._msgListHandler.getLocalMaxSeq(t2)), s2 = n2.lastMessage.lastSequence, r2 = (s2 < a2 && (M.l("".concat(e2, " update lastMessageSeq from ").concat(s2, " to ").concat(a2)), s2 = a2), n2.type === A.CONV_TOPIC && N(o2) && (e2 = this.get(10), o2 = Jt(a2 = t2.replace(A.CONV_GROUP, "")), e2 = e2.getLocalTopic(o2, a2)) && (s2 = e2.nextMessageSeq - 1), null); + switch (n2.type) { + case A.CONV_C2C: + return (r2 = this.get(6)) ? r2.setMessageRead({ conversationID: t2, lastMessageTime: i2 }) : D({ code: L.NO_MODULE }); + case A.CONV_GROUP: + case A.CONV_TOPIC: + return (r2 = this.get(7)) ? r2.setMessageRead({ conversationID: t2, lastMessageSeq: s2 }) : D({ code: L.NO_MODULE }); + case A.CONV_SYSTEM: + return n2.unreadCount = 0, this.emitConvUpdate(true, false), T(); + default: + return T(); + } + } }, { key: "setAllMessageRead", value: function() { + var t2, n2 = this, o2 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {}, e2 = "setAllMessageRead", i2 = "".concat(this._n, ".").concat(e2), a2 = (o2.scope || (o2.scope = A.READ_ALL_MSG), M.l("".concat(i2, " options:"), o2), this._createSetAllMessageReadPack(o2)); + return 0 === a2.readAllC2CMessage && 0 === a2.groupMessageReadInfoList.length ? T() : (t2 = new G(e2), this.req({ P: k.SET_ALL_MSG_READ, data: a2 }).then(function(e3) { + e3 = e3.data, e3 = n2._handleAllMsgRead(e3); + return t2.setMessage("scope:".concat(o2.scope, " failureGroups:").concat(JSON.stringify(e3))).end(), T(); + }).catch(function(e3) { + return t2.setError(e3).end(), M.w("".concat(i2, " failed. error:"), e3), D({ code: e3 && e3.code ? e3.code : L.MSG_UNREAD_ALL_FAIL, message: e3 && e3.message ? e3.message : void 0 }); + })); + } }, { key: "setConvCustomData", value: function(e2) { + return this._convGroupHandler.setConvCustomData(e2); + } }, { key: "markConv", value: function(e2) { + return this._convGroupHandler.markConv(e2); + } }, { key: "getConvGroupList", value: function() { + return this._convGroupHandler.getLocalConvGroupList(); + } }, { key: "createConvGroup", value: function(e2) { + return this._convGroupHandler.createConvGroup(e2); + } }, { key: "deleteConvGroup", value: function(e2) { + return this._convGroupHandler.deleteConvGroup(e2); + } }, { key: "renameConvGroup", value: function(e2) { + return this._convGroupHandler.renameConvGroup(e2); + } }, { key: "addConvsToGroup", value: function(e2) { + return this._convGroupHandler.addConvsToGroup(e2); + } }, { key: "deleteConvsFromGroup", value: function(e2) { + return this._convGroupHandler.deleteConvsFromGroup(e2); + } }, { key: "onConvMarkUpdated", value: function(e2) { + this._convGroupHandler.onConvMarkUpdated(e2); + } }, { key: "onConvGroupCreated", value: function(e2) { + this._convGroupHandler.onConvGroupCreated(e2); + } }, { key: "onConvGroupDeleted", value: function(e2) { + this._convGroupHandler.onConvGroupDeleted(e2); + } }, { key: "onConvGroupNameUpdated", value: function(e2) { + this._convGroupHandler.onConvGroupNameUpdated(e2); + } }, { key: "onConvInGroupUpdated", value: function(e2) { + this._convGroupHandler.onConvInGroupUpdated(e2); + } }, { key: "onConvAddedToOrDeletedFromGroup", value: function(e2) { + this._convGroupHandler.onConvAddedToOrDeletedFromGroup(e2); + } }, { key: "_getConvLastMessageSeq", value: function(e2) { + var t2 = this._msgListHandler.getLocalLastMsg(e2.conversationID), e2 = e2.lastMessage.lastSequence; + return e2 = t2 && e2 < t2.sequence ? t2.sequence : e2; + } }, { key: "_getConvLastMessageTime", value: function(e2) { + var t2 = this._msgListHandler.getLocalLastMsg(e2.conversationID), e2 = e2.lastMessage.lastTime; + return e2 = t2 && e2 < t2.time ? t2.time : e2; + } }, { key: "_createSetAllMessageReadPack", value: function(e2) { + var t2, n2 = { readAllC2CMessage: 0, groupMessageReadInfoList: [] }, o2 = e2.scope, i2 = Z(this._convMap); + try { + for (i2.s(); !(t2 = i2.n()).done; ) { + var a2, s2 = Y(t2.value, 2)[1]; + if (0 < s2.unreadCount) + if (s2.type === A.CONV_C2C && 0 === n2.readAllC2CMessage) { + if (o2 === A.READ_ALL_MSG) + n2.readAllC2CMessage = 1; + else if (o2 === A.READ_ALL_C2C_MSG) { + n2.readAllC2CMessage = 1; + break; + } + } else + s2.type !== A.CONV_GROUP || o2 !== A.READ_ALL_GROUP_MSG && o2 !== A.READ_ALL_MSG || (a2 = this._getConvLastMessageSeq(s2), n2.groupMessageReadInfoList.push({ groupID: s2.groupProfile.groupID, messageSequence: a2 })); + } + } catch (e3) { + i2.e(e3); + } finally { + i2.f(); + } + return n2; + } }, { key: "onPushedAllMessageRead", value: function(e2) { + this._handleAllMsgRead(e2); + } }, { key: "_handleAllMsgRead", value: function(e2) { + var t2 = e2.groupMessageReadInfoList, e2 = e2.readAllC2CMessage, t2 = this._parseGroupReadInfo(t2); + return 1 <= this._updateAllConvUnreadCount({ readAllC2CMessage: e2 }) && this.emitConvUpdate(true, false), t2; + } }, { key: "_parseGroupReadInfo", value: function(e2) { + var t2 = []; + if (e2 && e2.length) + for (var n2 = 0, o2 = e2.length; n2 < o2; n2++) { + var i2 = e2[n2], a2 = i2.groupID, s2 = i2.sequence, r2 = i2.retCode, i2 = i2.lastMessageSeq; + N(r2) ? this._remoteGroupReadSeqMap.set(a2, i2) : (this._remoteGroupReadSeqMap.set(a2, s2), 0 !== r2 && t2.push("".concat(a2, "-").concat(s2, "-").concat(r2))); + } + return t2; + } }, { key: "_updateAllConvUnreadCount", value: function(e2) { + var t2, n2 = e2.readAllC2CMessage, o2 = 0, i2 = Z(this._convMap); + try { + for (i2.s(); !(t2 = i2.n()).done; ) { + var a2, s2, r2, c2, u2 = Y(t2.value, 2), l2 = u2[0], d2 = u2[1]; + 1 <= d2.unreadCount && (1 === n2 && d2.type === A.CONV_C2C ? (a2 = this._getConvLastMessageTime(d2), this.updateIsReadAfterReadReport({ conversationID: l2, lastMessageTime: a2 })) : d2.type === A.CONV_GROUP && (s2 = l2.replace(A.CONV_GROUP, ""), this._remoteGroupReadSeqMap.has(s2)) && (r2 = this._remoteGroupReadSeqMap.get(s2), c2 = this._getConvLastMessageSeq(d2), this.updateIsReadAfterReadReport({ conversationID: l2, remoteReadSequence: r2 }), r2 <= c2) && this._remoteGroupReadSeqMap.delete(s2), this.updateUnreadCount(l2, false)) && (o2 += 1); + } + } catch (e3) { + i2.e(e3); + } finally { + i2.f(); + } + return o2; + } }, { key: "isRemoteRead", value: function(e2) { + var t2, n2 = e2.conversationID, e2 = e2.sequence, o2 = n2.replace(A.CONV_GROUP, ""), i2 = false; + return this._remoteGroupReadSeqMap.has(o2) && (e2 <= (t2 = this._remoteGroupReadSeqMap.get(o2)) && (i2 = true, M.l("".concat(this._n, ".isRemoteRead convID:").concat(n2, " msgSeq:").concat(e2, " remoteReadSeq:").concat(t2))), t2 + 10 <= e2) && this._remoteGroupReadSeqMap.delete(o2), i2; + } }, { key: "updateIsReadAfterReadReport", value: function(e2) { + var t2 = e2.conversationID, n2 = e2.lastMessageSeq, o2 = e2.lastMessageTime, i2 = this._msgListHandler.getLocalMsgList(t2); + if (0 !== i2.length) { + for (var a2, s2 = i2.length - 1; 0 <= s2; s2--) + if (a2 = i2[s2], !(o2 && a2.time > o2 || n2 && a2.sequence > n2)) { + if ("in" === a2.flow && a2.isRead) + break; + a2.setIsRead(true); + } + } + } }, { key: "updateUnreadCount", value: function(e2) { + var t2, n2 = !(1 < arguments.length && void 0 !== arguments[1]) || arguments[1], o2 = false, i2 = this.getLocalConversation(e2), a2 = this._msgListHandler.getLocalMsgList(e2); + if (i2) + return (t2 = i2.unreadCount) !== (a2 = a2.filter(function(e3) { + return !e3.isRead && !e3._onlineOnlyFlag && !e3.isDeleted; + }).length) && (i2.unreadCount = a2, o2 = true, M.l("".concat(this._n, ".updateUnreadCount from ").concat(t2, " to ").concat(a2, ", convID:").concat(e2)), true === n2) && this.emitConvUpdate(true, false), o2 && i2.type === A.CONV_TOPIC && (t2 = i2.unreadCount, a2 = this.get(10), n2 = e2.replace(A.CONV_GROUP, ""), a2.onUnreadCountUpdatedFromConv(n2, t2)), o2; + } }, { key: "clearGroupAtInfoList", value: function(e2) { + var t2, n2 = !(1 < arguments.length && void 0 !== arguments[1]) || arguments[1], o2 = this.getLocalConversation(e2); + o2 && 0 < o2.groupAtInfoList.length && (o2.clearGroupAtInfoList(), M.l("".concat(this._n, ".clearGroupAtInfoList convID:").concat(e2)), o2.type === A.CONV_TOPIC && (o2 = o2.groupAtInfoList, t2 = this.get(10), e2 = e2.replace(A.CONV_GROUP, ""), t2.onAtInfoUpdated({ topicID: e2, groupAtInfoList: o2 })), true === n2) && this.emitConvUpdate(true, false); + } }, { key: "updateReadReceiptInfo", value: function(e2) { + var a2, s2, o2, r2 = this, t2 = e2.userID, i2 = void 0 === t2 ? void 0 : t2, t2 = e2.groupID, c2 = void 0 === t2 ? void 0 : t2, t2 = e2.readReceiptList, e2 = e2.timestamp, u2 = void 0 === e2 ? 0 : e2; + S(t2) || (a2 = [], N(i2) ? N(c2) || (s2 = "".concat(A.CONV_GROUP).concat(c2), t2.forEach(function(e3) { + var t3 = e3.tinyID, n2 = e3.clientTime, o3 = e3.random, i3 = e3.readCount, e3 = e3.unreadCount, t3 = "".concat(t3, "-").concat(n2, "-").concat(o3), n2 = r2._msgListHandler.getLocalMsg(s2, t3) || r2._msgListHandler.getHoppingMsg(s2, t3), o3 = { groupID: c2, messageID: t3, readCount: 0, unreadCount: 0 }; + n2 && (R(i3) && (n2.readReceiptInfo.readCount = i3, o3.readCount = i3), R(e3) && (n2.readReceiptInfo.unreadCount = e3, o3.unreadCount = e3), a2.push(o3)); + })) : (o2 = "".concat(A.CONV_C2C).concat(i2), t2.forEach(function(e3) { + var t3 = e3.tinyID, n2 = e3.clientTime, e3 = e3.random, t3 = "".concat(t3, "-").concat(n2, "-").concat(e3), n2 = r2._msgListHandler.getLocalMsg(o2, t3) || r2._msgListHandler.getHoppingMsg(o2, t3); + n2 && !n2.readReceiptInfo.isPeerRead && (n2.readReceiptInfo.isPeerRead = true, n2.readReceiptInfo.timestamp = u2, a2.push({ userID: i2, messageID: t3, isPeerRead: true, timestamp: u2 })); + })), 0 < a2.length && this.emitOEvt(h.MESSAGE_READ_RECEIPT_RECEIVED, a2)); + } }, { key: "updateIsRead", value: function(e2) { + var t2 = this.getLocalConversation(e2), n2 = this.getLocalMessageList(e2); + if (t2 && 0 !== n2.length && !bt(t2.type)) { + for (var o2 = [], i2 = 0, a2 = n2.length; i2 < a2; i2++) + "in" !== n2[i2].flow ? "out" !== n2[i2].flow || n2[i2].isRead || n2[i2].setIsRead(true) : o2.push(n2[i2]); + var s2 = 0; + s2 = t2.type === A.CONV_C2C ? (e2 = o2.slice(-t2.unreadCount).filter(function(e3) { + return e3.isRevoked; + }).length, o2.length - t2.unreadCount - e2) : o2.length - t2.unreadCount; + for (var r2 = 0; r2 < s2 && !o2[r2].isRead; r2++) + o2[r2].setIsRead(true); + } + } }, { key: "deleteGroupAtTips", value: function(e2) { + var t2, n2, o2, i2 = this, a2 = "".concat(this._n, ".deleteGroupAtTips"), s2 = (M.l("".concat(a2)), this._convMap.get(e2)); + return !s2 || 0 === (t2 = s2.groupAtInfoList).length ? Promise.resolve() : (s2 = void 0, e2.startsWith(A.CONV_GROUP) && (s2 = e2.replace(A.CONV_GROUP, "")), n2 = p(t2), (Nt({ groupID: s2 }) || Gt(s2)) && 0 === (n2 = t2.filter(function(e3) { + return !e3.atTypeArray.includes(A.CONV_AT_ALL); + })).length ? (this.clearGroupAtInfoList(e2, false), Promise.resolve()) : (o2 = this.getMyUserID(), this.req({ P: k.DEL_GROUP_AT_TIPS, data: { messageListToDelete: n2.map(function(e3) { + return { from: e3.from, to: o2, messageSeq: e3.__sequence, messageRandom: e3.__random, groupID: N(e3.topicID) ? e3.groupID : e3.topicID }; + }) } }).then(function() { + return M.l("".concat(a2, " ok. count:").concat(t2.length)), i2.clearGroupAtInfoList(e2, false), Promise.resolve(); + }).catch(function(e3) { + return M.e("".concat(a2, " failed. error:"), e3), D(e3); + }))); + } }, { key: "appendToMessageList", value: function(e2) { + return this._msgListHandler.pushIn(e2); + } }, { key: "setMessageRandom", value: function(e2) { + this._sll.set(e2.random); + } }, { key: "deleteMessageRandom", value: function(e2) { + this._sll.delete(e2.random); + } }, { key: "pushIntoMessageList", value: function(e2, t2, n2) { + return !(!this._msgListHandler.pushIn(t2, n2) || this._sll.has(t2.random) && !n2 || (e2.push(t2), 0)); + } }, { key: "revoke", value: function(e2, t2, n2) { + return this._msgListHandler.revoke(e2, t2, n2); + } }, { key: "getPeerReadTime", value: function(e2) { + return this._peerReadTimeMap.get(e2); + } }, { key: "recordPeerReadTime", value: function(e2, t2) { + (!this._peerReadTimeMap.has(e2) || this._peerReadTimeMap.get(e2) < t2) && this._peerReadTimeMap.set(e2, t2); + } }, { key: "updateMsgIsPeerReadProp", value: function(e2, t2) { + var n2; + e2.startsWith(A.CONV_C2C) && 0 < t2 && (0 < (n2 = this._msgListHandler.updateMsgIsPeerReadProp(e2, t2)).length && this.emitOEvt(h.MESSAGE_READ_BY_PEER, n2), this._convMap.has(e2)) && !S(n2 = this._convMap.get(e2).lastMessage) && n2.fromAccount === this.getMyUserID() && n2.lastTime <= t2 && !n2.isPeerRead && (n2.isPeerRead = true, this.emitConvUpdate(true, false)); + } }, { key: "updateMsgIsModifiedProp", value: function(e2) { + this._msgListHandler.updateMsgIsModifiedProp(e2); + } }, { key: "setCompleted", value: function(e2) { + M.l("".concat(this._n, ".setCompleted convID:").concat(e2)), this._completedMap.set(e2, true); + } }, { key: "updateRoamingMsgKeyAndTime", value: function(e2, t2, n2) { + this._roamingMsgKeyAndTimeMap.set(e2, { messageKey: t2, lastMessageTime: n2 }); + } }, { key: "getConvList", value: function(t2) { + var n2, o2 = this, i2 = "".concat(this._n, ".").concat("getConvList"), e2 = "pagingStatus:".concat(this._pagingStatus, ", local conversation count:").concat(this._convMap.size, ", options:").concat(JSON.stringify(t2)); + return M.l("".concat(i2, ". ").concat(e2)), this._pagingStatus === Un ? ((n2 = new G("getConvList")).setMessage(e2), this.syncConvList().then(function() { + n2.end(); + var e3 = o2._getConvList(t2); + return C({ conversationList: e3, isSyncCompleted: o2._isSyncCompleted() }); + }).catch(function(e3) { + return n2.setError(e3).end(), M.e("".concat(i2, " failed. error:"), e3), D(e3); + })) : (e2 = this._getConvList(t2), M.l("".concat(i2, ". returned conversation count:").concat(e2.length)), T({ conversationList: e2, isSyncCompleted: this._isSyncCompleted() })); + } }, { key: "_getConvList", value: function(t2) { + var n2, o2, i2, a2, s2, r2 = this; + return N(t2) ? this.getLocalConvList() : O(t2) ? 0 === t2.length ? [] : this.getLocalConvList().filter(function(e2) { + return t2.includes(e2.conversationID); + }) : f(t2) ? (n2 = t2.type, o2 = t2.markType, i2 = t2.groupName, a2 = t2.hasUnreadCount, s2 = t2.hasGroupAtInfo, this.getLocalConvList().filter(function(e2) { + return r2._filterType(e2, n2) && r2._filterMarkType(e2, o2) && r2._filterGroupName(e2, i2) && r2._filterUnreadCount(e2, a2) && r2._filterGroupAtInfo(e2, s2); + })) : []; + } }, { key: "_filterType", value: function(e2, t2) { + return t2 !== A.CONV_C2C && t2 !== A.CONV_GROUP || e2.type === t2; + } }, { key: "_filterGroupName", value: function(e2, t2) { + return !m(t2) || ("" === t2 ? 0 === e2.conversationGroupList.length : e2.conversationGroupList.includes(t2)); + } }, { key: "_filterMarkType", value: function(e2, t2) { + return !R(t2) || (0 === t2 ? 0 === e2.markList.length : e2.markList.includes(t2)); + } }, { key: "_filterUnreadCount", value: function(e2, t2) { + var n2 = true; + return true === t2 ? n2 = 1 <= e2.unreadCount : false === t2 && (n2 = 0 === e2.unreadCount), n2; + } }, { key: "_filterGroupAtInfo", value: function(e2, t2) { + var n2 = true; + return true === t2 ? n2 = 1 <= e2.groupAtInfoList.length : false === t2 && (n2 = 0 === e2.groupAtInfoList.length), n2; + } }, { key: "_handleC2CPeerReadTime", value: function() { + var e2, t2 = Z(this._convMap); + try { + for (t2.s(); !(e2 = t2.n()).done; ) { + var n2 = Y(e2.value, 2), o2 = n2[0], i2 = n2[1]; + i2.type === A.CONV_C2C && this.recordPeerReadTime(o2, i2.peerReadTime); + } + } catch (e3) { + t2.e(e3); + } finally { + t2.f(); + } + } }, { key: "_isPagingGetGroupListCompleted", value: function() { + var e2 = this.get(7); + return !e2 || e2.isPagingGetCompleted(); + } }, { key: "_getLocalGroupCount", value: function() { + var e2 = this.get(7); + return e2 ? e2.getLocalGroupList().length : 0; + } }, { key: "_hasLocalGroup", value: function(e2) { + var t2 = this.get(7); + return !!t2 && t2.hasLocalGroup(e2.replace(A.CONV_GROUP, "")); + } }, { key: "getConversationProfile", value: function(o2) { + var i2, a2 = this, s2 = false; + if (this._convMap.has(o2) ? i2 = this._convMap.get(o2) : (i2 = new ii({ conversationID: o2, type: Pt(o2) ? A.CONV_C2C : A.CONV_GROUP }, this.isIntl(), this.isUsingChatCore()), s2 = true), i2._isInfoCompleted || i2.type === A.CONV_SYSTEM) + return T({ conversation: i2 }); + if (Ut(o2)) { + if (!this.get(7)) + return D({ code: L.NO_MODULE }); + if (!this._hasLocalGroup(o2)) + return T({ conversation: i2 }); + } + var r2 = "".concat(this._n, ".").concat("getConversationProfile"), c2 = new G("getConversationProfile"); + return M.l("".concat(r2, ". convID:").concat(o2, " remark:").concat(i2.remark, " lastMessage:"), i2.lastMessage), this._getUserOrGroupProfile(i2).then(function(e2) { + c2.setMessage("convID:".concat(o2, " unreadCount:").concat(e2.data.conversation.unreadCount)).end(); + var t2, n2 = a2.get(8); + if (n2 && i2.type === A.CONV_C2C && (t2 = o2.replace(A.CONV_C2C, ""), n2.isMyFriend(t2)) && (n2 = n2.getFriendRemark(t2), i2.remark !== n2) && (i2.remark = n2, M.l("".concat(r2, ". convID:").concat(o2, " patch remark:").concat(i2.remark))), M.l("".concat(r2, " ok. isNewConv:").concat(s2, " convID:").concat(o2)), s2) { + if (i2.type === A.CONV_C2C) + return a2._onNewC2CConv([o2.replace(A.CONV_C2C, "")]).then(function() { + return T({ conversation: i2 }); + }); + if (i2.type === A.CONV_GROUP) + return a2._onNewGroupConv([o2.replace(A.CONV_GROUP, "")]).then(function() { + return T({ conversation: i2 }); + }); + } + return e2; + }).catch(function(e2) { + return c2.setError(e2).setMessage("convID:".concat(o2)).end(), M.e("".concat(r2, " failed. error:"), e2), D(e2); + }); + } }, { key: "_getUserOrGroupProfile", value: function(t2) { + var n2 = this; + return t2.type === A.CONV_C2C ? this.get(4).getUserProfile({ userIDList: [t2.toAccount] }).then(function(e2) { + e2 = e2.data; + return 0 === e2.length ? D({ code: L.USER_OR_GRP_NOT_FOUND }) : (t2.userProfile = e2[0], t2._isInfoCompleted = true, n2._insertConvAfterTopmost(t2), T({ conversation: t2 })); + }) : this.get(7).getGroupProfile({ groupID: t2.toAccount }).then(function(e2) { + return t2.groupProfile = e2.data.group, t2._isInfoCompleted = true, n2._insertConvAfterTopmost(t2), T({ conversation: t2 }); + }); + } }, { key: "_insertConvAfterTopmost", value: function(e2) { + var t2, n2; + e2 instanceof ii && !this._convMap.has(e2.conversationID) && (n2 = (t2 = p(this._convMap)).findIndex(function(e3) { + return false === e3[1].isPinned; + }), t2.splice(n2, 0, [e2.conversationID, e2]), this._convMap = new Map(t2), this._setStorageConvList(), this.emitConvUpdate(true, false)); + } }, { key: "_onProfileUpdated", value: function(e2) { + var n2 = this; + e2.data.forEach(function(e3) { + var t2 = e3.userID; + t2 === n2.getMyUserID() ? n2._onMyProfileModified({ latestNick: e3.nick, latestAvatar: e3.avatar }) : (t2 = n2._convMap.get("".concat(A.CONV_C2C).concat(t2))) && (t2.userProfile = e3); + }); + } }, { key: "_onCloudConfig", value: function(e2) { + "0" === this.getCloudConfig("pull_on_invite") && (this._bPullOnInvite = false), M.l("".concat(this._n, "._onCloudConfig bPullOnInvite:").concat(this._bPullOnInvite)); + } }, { key: "disableMsgPullOnInvite", value: function() { + this._bPullOnInvite = false; + } }, { key: "_isSyncCompleted", value: function() { + return this._pagingStatus === Pn; + } }, { key: "_errorLog", value: function(e2, t2, n2, o2) { + var i2 = new Error("Params validate failed."), a2 = "".concat(this.getErrMsg("API_REFER")).concat(e2); + throw M.w("[".concat(e2, "] | ").concat(t2, " | ").concat(this.getErrMsg(n2, o2), ", ").concat(a2)), M.e("[".concat(e2, "] Invalid ").concat(t2, ": type check failed for ").concat(t2, ".")), i2; + } }, { key: "_isValidConvID", value: function(e2) { + return Pt(e2) || Ut(e2) || bt(e2); + } }, { key: "deleteConversation", value: function(e2) { + var t2 = this, n2 = "deleteConversation"; + return m(e2) || ut(e2) || this._errorLog(n2, "options", "StringOrObjectRequiredLog"), m(e2) ? (this._isValidConvID(e2) || this._errorLog(n2, "options", "InvalidConversationID", e2), M.l("".concat(this._n, ".").concat(n2, " convID:").concat(e2)), this.deleteConvList({ conversationIDList: [e2], flag: 1 })) : (O(e2.conversationIDList) || this._errorLog(n2, "conversationIDList", "ArrayRequiredLog"), 0 === e2.conversationIDList.length && this._errorLog(n2, "conversationIDList", "NonEmptyArrayLog"), e2.conversationIDList.forEach(function(e3) { + t2._isValidConvID(e3) || t2._errorLog(n2, "conversationIDList", "InvalidConversationID", e3); + }), "clearHistoryMessage" in e2 && "boolean" != typeof e2.clearHistoryMessage && this._errorLog(n2, "clearHistoryMessage", "BooleanRequiredLog"), 100 < e2.conversationIDList.length && (e2.conversationIDList = e2.conversationIDList.slice(0, 100)), this.deleteConvList(e2)); + } }, { key: "deleteConvList", value: function(e2) { + var t2 = e2.conversationIDList, t2 = void 0 === t2 ? [] : t2, n2 = e2.clearHistoryMessage, n2 = void 0 === n2 || n2, e2 = e2.flag, o2 = void 0 === e2 ? 0 : e2, i2 = "".concat(this._n, ".").concat("deleteConvList"), e2 = "convIDList:".concat(t2, " clearHistoryMessage:").concat(n2), a2 = (M.l("".concat(i2, " ").concat(e2)), new G("deleteConvList")); + return a2.setMessage(e2), Promise.all([this.rmLocalOnlyConvList(t2), this.rmLocalAndRemoteConvList(t2, n2)]).then(function(e3) { + a2.end(); + e3 = [].concat(p(e3[0]), p(e3[1])); + return 0 === e3.length ? D(new E({ code: L.CONV_NOT_FOUND })) : (M.l("".concat(i2, " ok")), T(1 === o2 ? { conversationID: e3[0] } : { conversationIDList: e3 })); + }).catch(function(e3) { + return a2.setError(e3).end(), M.e("".concat(i2, " failed. error:"), e3), D(e3); + }); + } }, { key: "rmLocalOnlyConvList", value: function(e2) { + var n2 = this; + return e2.filter(function(e3) { + var t2; + return !!n2._convMap.has(e3) && ((t2 = n2.getLocalConversation(e3).type) !== A.CONV_GROUP || n2._hasLocalGroup(e3) ? t2 === A.CONV_SYSTEM && (n2.get(7).deleteGroupSystemNotice({ messageList: n2._msgListHandler.getLocalMsgList(e3) }), n2.deleteLocalConv(e3), true) : (n2.deleteLocalConv(e3), true)); + }); + } }, { key: "rmLocalAndRemoteConvList", value: function(e2, t2) { + var n2 = this, o2 = { fromAccount: this.getMyUserID(), conversationList: [], clearHistoryMessage: t2 ? 1 : 0 }; + return e2.forEach(function(e3) { + var t3; + n2._convMap.has(e3) && ((t3 = n2.getLocalConversation(e3).type) === A.CONV_C2C ? o2.conversationList.push({ toAccount: e3.replace(t3, ""), type: 1 }) : t3 === A.CONV_GROUP && n2._hasLocalGroup(e3) && o2.conversationList.push({ toGroupID: e3.replace(t3, ""), type: 2 })); + }), 0 === o2.conversationList.length ? [] : this.req({ P: k.DEL_CONV, data: o2 }).then(function(e3) { + var t3 = []; + return 0 < e3.data.resultList.length && e3.data.resultList.map(function(e4) { + 0 === e4.code && (e4 = 1 === e4.type ? "".concat(A.CONV_C2C).concat(e4.to) : "".concat(A.CONV_GROUP).concat(e4.groupID), t3.push(e4)); + }), n2.deleteLocalConvList(t3), t3; + }); + } }, { key: "setConvDraft", value: function(e2) { + var t2 = e2.conversationID, e2 = e2.draftText, n2 = "".concat(this._n, ".").concat("setConvDraft"); + return M.l("".concat(n2, " convID:").concat(t2, " draftText:").concat(e2)), this._convMap.has(t2) ? ((n2 = this._convMap.get(t2)).setDraftText(e2), this.emitConvUpdate(), T({ code: 0, conversation: n2 })) : D({ code: L.CONV_NOT_FOUND }); + } }, { key: "clearHistoryMessage", value: function(t2) { + var n2 = this, e2 = { fromAccount: this.getMyUserID(), toAccount: void 0, type: void 0, toGroupID: void 0 }; + if (!this._convMap.has(t2)) + return D({ code: L.CONV_NOT_FOUND }); + var o2 = this._convMap.get(t2).type; + if (o2 === A.CONV_C2C) + e2.type = 1, e2.toAccount = t2.replace(A.CONV_C2C, ""); + else { + if (o2 !== A.CONV_GROUP) + return o2 === A.CONV_SYSTEM ? (this.get(7).deleteGroupSystemNotice({ messageList: this._msgListHandler.getLocalMsgList(t2) }), T({ conversationID: t2 })) : D({ code: L.CONV_UN_RECORDED_TYPE }); + e2.type = 2, e2.toGroupID = t2.replace(A.CONV_GROUP, ""); + } + var i2 = "".concat(this._n, ".").concat("clearHistoryMessage"), a2 = new G("clearHistoryMessage"); + return a2.setMessage("convID:".concat(t2)), M.l("".concat(i2, ". convID:").concat(t2)), this.setMessageRead({ conversationID: t2 }).then(function() { + return n2.req({ P: k.CLEAR_HISTORY_MSG, data: e2 }); + }).then(function() { + a2.end(), M.l("".concat(i2, " ok")), n2.clearMemMsg(t2); + var e3 = n2.getLocalConversation(t2); + return e3 && (e3.updateLastMessage(), n2._sortConvListAndEmitEvent()), T({ conversationID: t2 }); + }).catch(function(e3) { + return a2.setError(e3).end(), M.e("".concat(i2, " failed. error:"), e3), D(e3); + }); + } }, { key: "pinConversation", value: function(e2) { + var t2, n2, o2, i2 = this, a2 = e2.conversationID, s2 = e2.isPinned, r2 = this.getLocalConversation(a2); + return r2 && r2.isPinned === s2 ? T({ conversationID: a2 }) : bt(a2) ? (r2 && (r2.isPinned = s2), this._sortConvListAndEmitEvent(), T({ conversationID: a2 })) : (e2 = null, Pt(a2) ? e2 = { type: 1, toAccount: a2.replace(A.CONV_C2C, "") } : Ut(a2) && (e2 = { type: 2, groupID: a2.replace(A.CONV_GROUP, "") }), null === e2 ? D({ code: L.INVALID_CONV_ID }) : (t2 = "".concat(this._n, ".").concat("pinConversation"), n2 = "convID:".concat(a2, " isPinned:").concat(s2), (o2 = new G("pinConversation")).setMessage(n2), M.l("".concat(t2, ". ").concat(n2)), this.req({ P: k.PIN_CONV, data: { fromAccount: this.getMyUserID(), operationType: true === s2 ? 1 : 2, itemList: [e2] } }).then(function() { + return o2.end(), M.l("".concat(t2, " ok")), r2 ? r2.isPinned !== s2 && (r2.isPinned = s2) : i2._convMap.set(a2, new ii({ conversationID: a2, type: Pt(a2) ? A.CONV_C2C : A.CONV_GROUP, isPinned: s2 }, i2.isIntl(), i2.isUsingChatCore())), i2._sortConvListAndEmitEvent(), C({ conversationID: a2 }); + }).catch(function(e3) { + return o2.setError(e3).end(), M.e("".concat(t2, " failed. error:"), e3), D(e3); + }))); + } }, { key: "setMessageRemindType", value: function(e2) { + return this._msgRemindHandler.set(e2); + } }, { key: "patchMsgRemindType", value: function(e2) { + var t2 = e2.ID, n2 = e2.isC2CConversation, o2 = e2.messageRemindType, i2 = false, n2 = this.getLocalConversation("".concat(n2 ? A.CONV_C2C : A.CONV_GROUP).concat(t2)); + return n2 && n2.messageRemindType !== o2 && (n2.messageRemindType = o2, i2 = true), M.l("".concat(this._n, ".patchMsgRemindType options:"), e2, "ret:".concat(i2)), i2; + } }, { key: "onC2CMsgRemindTypeFetched", value: function(e2) { + var n2, o2 = this; + O(e2) && 0 < e2.length && (n2 = 0, e2.forEach(function(e3) { + var t2 = e3.userID, e3 = e3.muteFlag, e3 = o2._transMsgRemindType(e3); + true === o2.patchMsgRemindType({ ID: t2, isC2CConversation: true, messageRemindType: e3 }) && (n2 += 1); + }), M.l("".concat(this._n, ".onC2CMsgRemindTypeFetched updateCount:").concat(n2)), 1 <= n2) && this.emitConvUpdate(true, false); + } }, { key: "onC2CMsgRemindTypeSynced", value: function(e2) { + var n2 = this, o2 = "".concat(this._n, ".onC2CMsgRemindTypeSynced"); + e2.dataList.forEach(function(e3) { + var t2; + S(e3.muteNotificationsSync) || (t2 = (e3 = e3.muteNotificationsSync).to, e3 = e3.muteFlag, e3 = n2._transMsgRemindType(e3), n2.patchMsgRemindType({ ID: t2, isC2CConversation: !(t2 = 0), messageRemindType: e3 }) && (t2 += 1), M.l("".concat(o2, " updateCount:").concat(t2)), 1 <= t2 && n2.emitConvUpdate(true, false)); + }); + } }, { key: "onGroupMsgRemindTypeUpdated", value: function(e2) { + this._msgRemindHandler.onGroupMsgRemindTypeUpdated(e2); + } }, { key: "deleteLocalConv", value: function(e2) { + var t2 = !(1 < arguments.length && void 0 !== arguments[1]) || arguments[1], n2 = this._convMap.has(e2); + M.l("".concat(this._n, ".deleteLocalConv convID:").concat(e2, " has:").concat(n2)), n2 && (this._convMap.delete(e2), this._convMapForDiff.delete(e2), this.clearMemMsg(e2), this._setStorageConvList(true), t2) && (n2 = !this._isTopicConv(e2), this.emitConvUpdate(n2, false)); + } }, { key: "pullMsgOnInvite", value: function(e2) { + var t2, n2, o2, i2, a2, s2 = this.get(7); + s2 && (t2 = "".concat(this._n, ".pullMsgOnInvite"), M.l("".concat(t2, " flag:").concat(this._bPullOnInvite)), this._bPullOnInvite) && (a2 = this.getLocalLastMessage(e2), n2 = this.getLocalSecondLastMessage(e2), i2 = o2 = 1, a2 && (o2 = a2.sequence), n2 && (i2 = n2.sequence), a2 = s2.getGroupRemoteLastSeq(e2.replace(A.CONV_GROUP, "")), M.l("".concat(t2, " convID:").concat(e2, " localLastSeq:").concat(o2, " localSecondLastSeq:").concat(i2, " remoteLastSeq:").concat(a2)), this.clearMemMsg(e2), 1 < o2 - i2 ? this._recursiveGetMsgList([], e2, false, o2, i2) : 1 < a2 - o2 && this._recursiveGetMsgList([], e2, true, a2, o2)); + } }, { key: "_recursiveGetMsgList", value: function(i2, a2, s2, r2, c2, e2) { + var u2 = this; + this.getMessageList({ conversationID: a2, nextReqMessageID: e2 }).then(function(e3) { + var e3 = e3.data, t2 = e3.messageList, n2 = e3.isCompleted, e3 = e3.nextReqMessageID, o2 = t2.filter(function(e4) { + return s2 ? e4.sequence > c2 && e4.sequence <= r2 : e4.sequence > c2 && e4.sequence < r2; + }); + i2.unshift.apply(i2, p(o2)), !n2 && 0 < t2.length && t2[0].sequence > c2 && i2.length < 60 ? u2._recursiveGetMsgList(i2, a2, s2, r2, c2, e3) : u2._emitMsgReceived(a2, i2); + }); + } }, { key: "_emitMsgReceived", value: function(e2, t2) { + var n2, o2, i2 = this; + 0 < t2.length && (t2 = t2.filter(function(t3, e3, n3) { + return e3 === n3.findIndex(function(e4) { + return e4.sequence === t3.sequence; + }); + }), n2 = this.hasLocalConversation(e2), o2 = t2.map(function(e3) { + return e3.sequence; + }), M.l("".concat(this._n, "._emitMsgReceived convID:").concat(e2, " has:").concat(n2, " count:").concat(o2.length, " sequenceList:"), o2), this.emitOEvt(h.MESSAGE_RECEIVED, t2), n2 ? this.patchConvLastMessage(e2, true) : this.getConversationProfile(e2).then(function() { + i2.patchConvLastMessage(e2, true); + })); + } }, { key: "deleteLocalConvList", value: function(e2) { + var t2 = this, n2 = false; + e2.forEach(function(e3) { + t2._convMap.has(e3) && (t2.deleteLocalConv(e3, false), n2 = true); + }), M.l("".concat(this._n, ".deleteLocalConvList convID:").concat(e2, " isConvIDExisted:").concat(n2)), n2 && this.emitConvUpdate(true, false); + } }, { key: "isMessageSentByCurrentInstance", value: function(e2) { + return !(!this._msgListHandler.hasLocalMsg(e2.conversationID, e2.ID) && !this._sll.has(e2.random)); + } }, { key: "modifyMessageList", value: function(e2) { + var t2, n2; + e2.startsWith(A.CONV_C2C) && this._convMap.has(e2) && (n2 = this._convMap.get(e2), t2 = Date.now(), this._msgListHandler.modifyMsgSentByPeer({ conversationID: e2, latestNick: n2.userProfile.nick, latestAvatar: n2.userProfile.avatar }), n2 = this.get(4).getNickAndAvatarByUserID(this.getMyUserID()), this._msgListHandler.modifyMsgSentByMe({ conversationID: e2, latestNick: n2.nick, latestAvatar: n2.avatar }), M.l("".concat(this._n, ".modifyMessageList convID:").concat(e2, " cost:").concat(nn(t2)))); + } }, { key: "updateUserProfileSpecifiedKey", value: function(e2) { + M.l("".concat(this._n, ".updateUserProfileSpecifiedKey options:"), e2); + var t2 = e2.conversationID, n2 = e2.nick, e2 = e2.avatar; + this._convMap.has(t2) && (t2 = this._convMap.get(t2).userProfile, m(n2) && t2.nick !== n2 && (t2.nick = n2), m(e2) && t2.avatar !== e2 && (t2.avatar = e2), this.emitConvUpdate(true, false)); + } }, { key: "_onMyProfileModified", value: function(t2) { + var n2 = this, e2 = this.getLocalConvList(), o2 = Date.now(); + e2.forEach(function(e3) { + n2.modifyMessageSentByMe(y({ conversationID: e3.conversationID }, t2)); + }), M.l("".concat(this._n, "._onMyProfileModified. modify all messages sent by me, cost:").concat(nn(o2))); + } }, { key: "modifyMessageSentByMe", value: function(e2) { + this._msgListHandler.modifyMsgSentByMe(e2); + } }, { key: "getLatestMessageSentByMe", value: function(e2) { + return this._msgListHandler.getLatestMsgSentByMe(e2); + } }, { key: "modifyMessageSentByPeer", value: function(e2) { + this._msgListHandler.modifyMsgSentByPeer(e2); + } }, { key: "getLatestMessageSentByPeer", value: function(e2) { + return this._msgListHandler.getLatestMsgSentByPeer(e2); + } }, { key: "pushIntoNoticeResult", value: function(e2, t2) { + return !(!this._msgListHandler.pushIn(t2) || this._sll.has(t2.random) || (e2.push(t2), 0)); + } }, { key: "getLocalLastMessage", value: function(e2) { + return this._msgListHandler.getLocalLastMsg(e2); + } }, { key: "getLocalSecondLastMessage", value: function(e2) { + return this._msgListHandler.getLocalSecondLastMsg(e2); + } }, { key: "checkAndPatchRemark", value: function() { + var e2, n2, o2 = this.get(8); + 0 !== this._convMap.size && o2 && 0 !== (e2 = p(this._convMap.values()).filter(function(e3) { + return e3.type === A.CONV_C2C; + })).length && (n2 = 0, e2.forEach(function(e3) { + var t2 = e3.conversationID.replace(A.CONV_C2C, ""); + o2.isMyFriend(t2) && (t2 = o2.getFriendRemark(t2), e3.remark !== t2) && (e3.remark = t2, n2 += 1); + }), M.l("".concat(this._n, ".checkAndPatchRemark. c2cConvCount:").concat(e2.length, " patchedCount:").concat(n2)), 0 < n2) && this.emitConvUpdate(true, false); + } }, { key: "updateTopicConversation", value: function(e2) { + this._updateLocalConvList({ conversationOptionsList: e2, isFromGetConversations: true, updateUnreadCount: true }); + } }, { key: "sendReadReceipt", value: function(e2) { + var t2 = e2[0], n2 = null; + return t2.conversationType === A.CONV_C2C ? n2 = this._m.get(6) : t2.conversationType === A.CONV_GROUP && (n2 = this._m.get(7)), n2 ? n2.sendReadReceipt(e2) : D({ code: L.NO_MODULE }); + } }, { key: "getReadReceiptList", value: function(e2) { + var t2 = e2[0], n2 = null; + return t2.conversationType === A.CONV_C2C ? n2 = this._m.get(6) : t2.conversationType === A.CONV_GROUP && (n2 = this._m.get(7)), n2 ? n2.getReadReceiptList(e2) : D({ code: L.NO_MODULE }); + } }, { key: "getLastMessageTime", value: function(e2) { + e2 = this.getLocalConversation(e2); + return e2 ? e2.lastMessage.lastTime : 0; + } }, { key: "getTotalUnreadCount", value: function() { + var e2 = this.getLocalConvList(), t2 = 0; + return e2.forEach(function(e3) { + e3.type === A.CONV_SYSTEM || "" !== e3.messageRemindType && e3.messageRemindType !== A.MSG_REMIND_ACPT_AND_NOTE || (t2 += e3.unreadCount); + }), t2; + } }, { key: "onTotalUnreadCountUpdate", value: function() { + var e2 = this.getTotalUnreadCount(); + this._convTotalUnreadCount !== e2 && (M.l("".concat(this._n, ".onTotalUnreadCountUpdate from ").concat(this._convTotalUnreadCount, " to ").concat(e2)), this._convTotalUnreadCount = e2, this.emitOEvt(h.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED)); + } }, { key: "_isConvNeedShow", value: function(e2) { + var t2, n2, e2 = this.getLocalConversation(e2); + return !(!N(e2) && (t2 = e2.type === A.CONV_TOPIC, n2 = e2.type === A.CONV_GROUP && e2.groupProfile.type === A.GRP_ROOM, e2 = e2.type === A.CONV_GROUP && e2.groupProfile.type === A.GRP_LIVE, t2 || n2 || e2)); + } }, { key: "setAllRcvMsgOpt", value: function(e2) { + return this._msgRemindHandler.setAllRcvMsgOpt(e2); + } }, { key: "getAllRcvMsgOpt", value: function() { + return this._msgRemindHandler.getAllRcvMsgOpt(); + } }, { key: "onAllRcvMsgOptNotify", value: function(e2) { + this._msgRemindHandler.onAllRcvMsgOptNotify(e2); + } }, { key: "clearUnreadCount", value: function(e2) { + e2 = this.getLocalConversation(e2); + e2 && 0 < e2.unreadCount && (e2.unreadCount = 0, this.emitConvUpdate(true, false)); + } }, { key: "storeHoppingMessageList", value: function(e2) { + this._msgListHandler.storeHoppingMsgList(e2); + } }, { key: "clearMemMsg", value: function(e2) { + var t2 = 1 < arguments.length && void 0 !== arguments[1] && arguments[1]; + M.l("".concat(this._n, ".clearMemMsg convID:").concat(e2, " isOverLimit:").concat(t2)), this._msgListHandler.removeByConvID(e2), this._completedMap.delete(e2), this._roamingMsgKeyAndTimeMap.delete(e2), this._everClearedMap.set(e2, 1); + } }, { key: "reset", value: function() { + M.l("".concat(this._n, ".reset")), this._setStorageConvList(true), this._pagingStatus = Nn, this._msgListHandler.reset(), this._msgRemindHandler.reset(), this._roamingMsgKeyAndTimeMap.clear(), this._sll.reset(), this._peerReadTimeMap.clear(), this._completedMap.clear(), this._convMap.clear(), this._pagingTs = 0, this._pagingStartIdx = 0, this._pagingPinnedTs = 0, this._pagingPinnedStartIdx = 0, this._remoteGroupReadSeqMap.clear(), this._convTotalUnreadCount = 0, this._pagingGetCostList.length = 0, this._pagingConvIDMap.clear(), this._convIDFromUnreadDBMap.clear(), this._pagingGetCostList.length = 0, this._convMapForDiff.clear(), this._partialUpdatedConvMap.clear(), this._everClearedMap.clear(), this._bPullOnInvite = true, this._convGroupHandler.reset(), this.resetReady(); + } }]), Zi), ui = (e(Xi, [{ key: "onCheckTimer", value: function(e2) { + e2 % 1 == 0 && 0 < this._cachedGroupTipsMap.size && this._check(); + } }, { key: "_check", value: function() { + var i2 = this; + this._cachedGroupTipsMap.forEach(function(e2, t2) { + var n2 = i2._checkCountMap.get(t2), o2 = i2._grpM.hasLocalGroup(t2); + M.l("".concat(i2._n, "._check groupID:").concat(t2, " hasLocalGroup:").concat(o2, " checkCount:").concat(n2)), o2 ? (i2._notifyCachedGroupTips(t2), i2._checkCountMap.delete(t2), i2._grpM.deleteUnjoinedAVChatRoom(t2)) : n2 >= i2.MAX_CHECK_COUNT ? (i2._deleteCachedGroupTips(t2), i2._checkCountMap.delete(t2)) : i2._checkCountMap.set(t2, ++n2); + }); + } }, { key: "onNewGroupTips", value: function(e2) { + M.l("".concat(this._n, ".onNewGroupTips options:").concat(JSON.stringify(e2.dataList))); + var e2 = this._assembly(e2), t2 = e2.eventDataList, n2 = e2.result, e2 = e2.AVChatRoomMessageList; + 0 < e2.length && this._grpM.onAVChatRoomMessage(e2), 0 < n2.length && (this._grpM.emitOEvt(h.MESSAGE_RECEIVED, n2), this._handleTips(n2)), 0 < t2.length && (this._grpM.updateNextMessageSeq(t2), this._grpM.get(11).onNewMessage({ conversationOptionsList: t2, isInstantMessage: true })); + } }, { key: "_assembly", value: function(e2) { + for (var t2 = e2.event, n2 = e2.dataList, o2 = null, i2 = [], a2 = [], s2 = {}, r2 = [], c2 = 0, u2 = n2.length; c2 < u2; c2++) { + var l2 = Mt(n2[c2]); + if (6 === t2) { + if (this._grpM.isGroupAttributesUpdatedNotice(l2)) + continue; + if (this._grpM.isGroupCountersNotice(l2)) + continue; + } + var d2 = l2.groupProfile, p2 = d2.groupID, _2 = d2.communityType, _2 = void 0 === _2 ? 0 : _2, h2 = d2.topicID, h2 = void 0 === h2 ? void 0 : h2, g2 = d2.invisible, d2 = d2.groupType, d2 = void 0 === d2 ? void 0 : d2, f2 = void 0, m2 = this._grpM.isMessageFromTopic(_2, h2), v2 = (m2 && (f2 = A.CONV_TOPIC, l2.to = h2), this._grpM.hasLocalGroup(p2)); + if (v2 || !this._grpM.isUnjoinedAVChatRoom(p2)) + if (v2 || m2) + if (this._grpM.isMessageFromOrToAVChatroom(p2)) + l2.event = t2, r2.push(l2); + else if (l2.currentUser = this._grpM.getMyUserID(), l2.conversationType = A.CONV_GROUP, (o2 = new Do(l2)).setElement({ type: A.MSG_GRP_TIP, content: y(y({}, l2.elements), {}, { groupProfile: l2.groupProfile }) }), o2.isSystemMessage = false, 1 !== g2) { + var v2 = this._grpM.get(11), m2 = o2, g2 = m2.conversationID, m2 = m2.sequence; + if (6 === t2) + o2._onlineOnlyFlag = true, a2.push(o2); + else if (!v2.pushIntoNoticeResult(a2, o2)) + continue; + this._grpM.isMessageFromCommunityOfTopic(_2, h2) || 6 === t2 && v2.getLocalConversation(g2) || (6 !== t2 && this._qualityStat(o2), _2 = v2.isRemoteRead({ conversationID: g2, sequence: m2 }), N(s2[g2]) ? (h2 = 0, "in" !== o2.flow || o2._isExcludedFromUnreadCount || o2._onlineOnlyFlag || _2 || (h2 = 1), s2[g2] = i2.push({ conversationID: g2, unreadCount: h2, type: N(f2) ? o2.conversationType : f2, subType: o2.conversationSubType, lastMessage: o2._isExcludedFromLastMessage ? "" : o2 }) - 1) : (i2[v2 = s2[g2]].type = o2.conversationType, i2[v2].subType = o2.conversationSubType, i2[v2].lastMessage = o2._isExcludedFromLastMessage ? "" : o2, "in" !== o2.flow || o2._isExcludedFromUnreadCount || o2._onlineOnlyFlag || _2 || i2[v2].unreadCount++)); + } else + this._qualityStat(o2); + else + this._cacheAndCompare({ groupID: p2, event: t2, item: l2, groupType: d2 }); + } + return { eventDataList: i2, result: a2, AVChatRoomMessageList: r2 }; + } }, { key: "_qualityStat", value: function(e2) { + this._grpM.get(26).addMessageSequence({ key: jn, message: e2 }); + } }, { key: "_handleTips", value: function(e2) { + var t2 = this; + e2.forEach(function(e3) { + switch (e3.payload.operationType) { + case 1: + t2._onNewMemberComeIn(e3); + break; + case 2: + t2._onMemberQuit(e3); + break; + case 3: + t2._onMemberKickedOut(e3); + break; + case 4: + t2._onMemberSetAdmin(e3); + break; + case 5: + t2._onMemberCancelledAdmin(e3); + break; + case 6: + t2._onGroupProfileModified(e3); + break; + case 7: + t2._onMemberInfoModified(e3); + break; + case 8: + t2._onTopicProfileUpdated(e3); + break; + default: + M.w("".concat(t2._n, "._handleTips unknown operationType:").concat(e3.payload.operationType)); + } + }); + } }, { key: "_onNewMemberComeIn", value: function(e2) { + var e2 = e2.payload, t2 = e2.memberNum, e2 = e2.groupProfile.groupID, e2 = this._grpM.getLocalGroupProfile(e2); + e2 && R(t2) && e2.memberCount !== t2 && (e2.memberCount = t2, this._updateConvGroupProfile(e2)); + } }, { key: "_onMemberQuit", value: function(e2) { + var t2 = e2.payload, n2 = t2.memberNum, t2 = t2.groupProfile.groupID, o2 = this._grpM.getLocalGroupProfile(t2); + o2 && R(n2) && o2.memberCount !== n2 && (o2.memberCount = n2, this._updateConvGroupProfile(o2)), this._grpM.getGroupMemberHandler().deleteLocalGroupMembers(t2, e2.payload.userIDList); + } }, { key: "_onMemberKickedOut", value: function(e2) { + var t2 = e2.payload, n2 = t2.memberNum, t2 = t2.groupProfile.groupID, o2 = this._grpM.getLocalGroupProfile(t2); + o2 && R(n2) && o2.memberCount !== n2 && (o2.memberCount = n2, this._updateConvGroupProfile(o2)), this._grpM.getGroupMemberHandler().deleteLocalGroupMembers(t2, e2.payload.userIDList); + } }, { key: "_updateConvGroupProfile", value: function(e2) { + this._grpM.get(11).updateConvGroupProfile([e2]); + } }, { key: "_onMemberSetAdmin", value: function(e2) { + var t2 = e2.payload.groupProfile.groupID, e2 = e2.payload.userIDList, n2 = this._grpM.getGroupMemberHandler(); + e2.forEach(function(e3) { + e3 = n2.getLocalGroupMemberInfo(t2, e3); + e3 && e3.updateRole(A.GRP_MBR_ROLE_ADMIN); + }); + } }, { key: "_onMemberCancelledAdmin", value: function(e2) { + var t2 = e2.payload.groupProfile.groupID, e2 = e2.payload.userIDList, n2 = this._grpM.getGroupMemberHandler(); + e2.forEach(function(e3) { + e3 = n2.getLocalGroupMemberInfo(t2, e3); + e3 && e3.updateRole(A.GRP_MBR_ROLE_MEMBER); + }); + } }, { key: "_onGroupProfileModified", value: function(e2) { + var t2 = this, e2 = e2.payload, n2 = e2.newGroupProfile, o2 = e2.groupProfile, i2 = e2.operatorInfo, e2 = o2.groupID, a2 = this._grpM.getLocalGroupProfile(e2), o2 = (Object.keys(n2).forEach(function(e3) { + switch (e3) { + case "ownerID": + t2._ownerChanged(a2, n2); + break; + case "groupName": + a2.name = n2[e3]; + break; + default: + a2[e3] = n2[e3]; + } + }), N(i2) || Object.keys(i2).forEach(function(e3) { + "nameCard" === e3 ? a2.updateSelfInfo({ nameCard: i2[e3] }) : "role" === e3 && a2.updateSelfInfo({ role: i2[e3] }); + }), !a2.isSupportTopic); + this._grpM.emitGroupListUpdate(true, o2); + } }, { key: "_ownerChanged", value: function(e2, t2) { + var e2 = e2.groupID, n2 = this._grpM.getLocalGroupProfile(e2), o2 = this._grpM.getMyUserID(); + o2 === t2.ownerID && (n2.updateGroup({ selfInfo: { role: A.GRP_MBR_ROLE_OWNER } }), n2 = (t2 = this._grpM.getGroupMemberHandler()).getLocalGroupMemberInfo(e2, o2), o2 = this._grpM.getLocalGroupProfile(e2).ownerID, t2 = t2.getLocalGroupMemberInfo(e2, o2), n2 && n2.updateRole(A.GRP_MBR_ROLE_OWNER), t2) && t2.updateRole(A.GRP_MBR_ROLE_MEMBER); + } }, { key: "_onMemberInfoModified", value: function(e2) { + var t2 = e2.to, n2 = e2.payload, o2 = n2.groupProfile, n2 = n2.memberList, i2 = o2.groupID, a2 = (Gt(t2) && this._updateTopicMuteTime(e2), this._grpM.getGroupMemberHandler()); + n2.forEach(function(e3) { + var t3 = a2.getLocalGroupMemberInfo(i2, e3.userID); + t3 && R(e3.muteTime) && t3.updateMuteUntil(e3.muteTime); + }); + } }, { key: "_updateTopicMuteTime", value: function(e2) { + var t2 = e2.to, e2 = e2.payload, n2 = e2.groupProfile, e2 = e2.memberList, o2 = void 0 === e2 ? [] : e2, e2 = this._grpM.get(10), n2 = n2.groupID, i2 = e2.getLocalTopic(n2, t2); + if (i2) { + for (var a2 = false, s2 = 0; s2 < o2.length; s2++) { + var r2 = o2[s2]; + if (r2.userID === this._grpM.getMyUserID() && 0 <= r2.muteTime) { + i2.updateSelfInfo({ muteTime: r2.muteTime }), a2 = true; + break; + } + } + a2 && this._grpM.emitOEvt(h.TOPIC_UPDATED, { groupID: n2, topic: i2 }); + } + } }, { key: "_onTopicProfileUpdated", value: function(e2) { + var t2 = e2.payload, n2 = t2.groupProfile.groupID, t2 = t2.newTopicInfo; + this._grpM.get(10).onTopicProfileUpdated(y({ groupID: n2, topicID: e2.to }, t2)); + } }, { key: "_cacheGroupTips", value: function(e2, t2) { + this._cachedGroupTipsMap.has(e2) || this._cachedGroupTipsMap.set(e2, []), this._cachedGroupTipsMap.get(e2).push(t2); + } }, { key: "_deleteCachedGroupTips", value: function(e2) { + this._cachedGroupTipsMap.has(e2) && this._cachedGroupTipsMap.delete(e2); + } }, { key: "_notifyCachedGroupTips", value: function(e2, t2) { + var n2 = this, o2 = this._cachedGroupTipsMap.get(e2) || []; + M.l("".concat(this._n, "._notifyCachedGroupTips groupID:").concat(e2, " groupType:").concat(t2, " count:").concat(o2.length)), o2.forEach(function(e3) { + n2.onNewGroupTips(e3); + }), this._deleteCachedGroupTips(e2); + } }, { key: "_cacheAndCompare", value: function(e2) { + var t2 = e2.groupID, n2 = e2.event, o2 = e2.item, e2 = e2.groupType, n2 = (M.l("".concat(this._n, "._cacheAndCompare groupID:").concat(t2, " groupType:").concat(e2)), this._cacheGroupTips(t2, { event: n2, dataList: [o2] }), { groupID: t2, type: e2 }); + e2 === A.GRP_AVCHATROOM ? this._grpM.hasLocalGroup(t2) ? this._notifyCachedGroupTips(t2, e2) : this._grpM.setUnjoinedAVChatRoom(t2) : (this._grpM.updateGroupMap([n2]), this._notifyCachedGroupTips(t2, e2)), this._checkCountMap.has(t2) || this._checkCountMap.set(t2, 0); + } }, { key: "reset", value: function() { + this._cachedGroupTipsMap.clear(), this._checkCountMap.clear(); + } }]), Xi), li = (e(zi, [{ key: "onCheckTimer", value: function(e2) { + e2 % 1 == 0 && 0 < this._cachedGroupMessageMap.size && this._check(); + } }, { key: "_check", value: function() { + var i2 = this; + this._cachedGroupMessageMap.forEach(function(e2, t2) { + var n2 = i2._checkCountMap.get(t2), o2 = i2._grpM.hasLocalGroup(t2); + M.l("".concat(i2._n, "._check groupID:").concat(t2, " hasLocalGroup:").concat(o2, " checkCount:").concat(n2)), o2 ? (i2._notifyCachedGroupMessage(t2), i2._checkCountMap.delete(t2), i2._grpM.deleteUnjoinedAVChatRoom(t2)) : n2 >= i2.MAX_CHECK_COUNT ? (i2._deleteCachedGroupMessage(t2), i2._checkCountMap.delete(t2)) : i2._checkCountMap.set(t2, ++n2); + }); + } }, { key: "updateLastMsg", value: function(e2) { + var t2 = "".concat(this._n, ".updateLastMsg"); + if (0 !== this._grpM.getGroupMap().size) { + for (var n2, o2, i2, a2, s2 = false, r2 = e2.length, c2 = 0; c2 < r2; c2++) + (n2 = e2[c2]).type === A.CONV_GROUP && 0 !== n2.lastMessage.lastSequence && null !== n2.lastMessage.payload && (o2 = n2.conversationID.split(/^GROUP/)[1], o2 = this._grpM.getLocalGroupProfile(o2)) && (i2 = o2.lastMessage, a2 = n2.lastMessage, JSON.stringify(i2) !== JSON.stringify(a2)) && (o2.lastMessage = y({}, n2.lastMessage), s2 = true); + M.l("".concat(t2, " convCount:").concat(r2, " groupCount:").concat(this._grpM.getLocalGroupList().length, " isUpdated:").concat(s2)), s2 && (this._grpM.sortLocalGroupList(), this._grpM.emitGroupListUpdate(true, false)); + } else + this.tempConversationList = e2; + } }, { key: "onNewMessage", value: function(e2) { + var t2 = this._assembly(e2), n2 = t2.conversationOptionsList, o2 = t2.messageList, t2 = t2.AVChatRoomMessageList, t2 = (0 < t2.length && this._grpM.onAVChatRoomMessage(t2), At(o2)), t2 = (0 < t2.length && this._grpM.emitOEvt(h.MESSAGE_MODIFIED, t2), 0 < n2.length && (this._grpM.get(11).onNewMessage({ conversationOptionsList: n2, isInstantMessage: false !== e2.isInstantMessage, updateUnreadCount: false !== e2.updateUnreadCount }), this._grpM.updateNextMessageSeq(n2)), Rt(o2)); + 0 < t2.length && this._grpM.emitOEvt(h.MESSAGE_RECEIVED, t2), o2.length = 0; + } }, { key: "_assembly", value: function(e2) { + var t2 = e2.dataList, n2 = e2.event, o2 = e2.isInstantMessage, i2 = null, a2 = [], s2 = [], r2 = [], c2 = {}, u2 = this._grpM.getFileDownloadProxy(), l2 = this._grpM.getDowloadFileAuthKey(), d2 = this._grpM.get(17).getFileDNList(), p2 = t2.length; + 1 < p2 && t2.sort(function(e3, t3) { + return e3.sequence - t3.sequence; + }); + for (var _2 = this._grpM.get(11), h2 = this._grpM.get(4), g2 = 0; g2 < p2; g2++) { + var f2, m2 = Mt(t2[g2]), v2 = m2.groupProfile, I2 = v2.groupID, M2 = v2.communityType, M2 = void 0 === M2 ? 0 : M2, y2 = v2.topicID, y2 = void 0 === y2 ? void 0 : y2, C2 = v2.invisible, v2 = v2.groupType, v2 = void 0 === v2 ? void 0 : v2, T2 = void 0, D2 = this._grpM.isMessageFromTopic(M2, y2), E2 = (D2 && (T2 = A.CONV_TOPIC, m2.to = y2), this._grpM.hasLocalGroup(I2)); + !E2 && this._grpM.isUnjoinedAVChatRoom(I2) || (E2 || D2 ? this._grpM.isMessageFromOrToAVChatroom(I2) ? (m2.event = n2, r2.push(m2)) : (m2.currentUser = this._grpM.getMyUserID(), m2.conversationType = A.CONV_GROUP, m2.isSystemMessage = !!m2.isSystemMessage, (i2 = new Do(m2)).setElement(m2.elements, u2, l2, d2), 1 !== C2 ? (E2 = 1 === t2[g2].isModified, _2.isMessageSentByCurrentInstance(i2) ? i2.isModified = E2 : E2 = false, 1 === m2.onlineOnlyFlag ? (i2._onlineOnlyFlag = true, _2.isMessageSentByCurrentInstance(i2) || s2.push(i2)) : this._grpM.isMessageFromCommunityOfTopic(M2, y2) ? s2.push(i2) : (i2.from === this._grpM.getMyUserID() && (D2 = _2.getLatestMessageSentByMe(i2.conversationID)) && (C2 = D2.nick, M2 = D2.avatar, C2 === i2.nick && M2 === i2.avatar || (_2.modifyMessageSentByMe({ conversationID: f2, latestNick: i2.nick, latestAvatar: i2.avatar }), h2.mockOnNickAvatarModified(i2.nick, i2.avatar))), _2.pushIntoMessageList(s2, i2, E2) && (this._qualityStat(o2, i2), f2 = (y2 = i2).conversationID, D2 = y2.sequence, C2 = _2.isRemoteRead({ conversationID: f2, sequence: D2 }), N(c2[f2]) ? (M2 = 0, "in" !== i2.flow || i2._isExcludedFromUnreadCount || C2 || (M2 = 1), c2[f2] = a2.push({ conversationID: f2, unreadCount: M2, type: N(T2) ? i2.conversationType : T2, subType: i2.conversationSubType, lastMessage: i2._isExcludedFromLastMessage ? "" : i2 }) - 1) : (a2[E2 = c2[f2]].type = N(T2) ? i2.conversationType : T2, a2[E2].subType = i2.conversationSubType, a2[E2].lastMessage = i2._isExcludedFromLastMessage ? "" : i2, "in" !== i2.flow || i2._isExcludedFromUnreadCount || C2 || a2[E2].unreadCount++)))) : this._qualityStat(o2, i2)) : this._cacheAndCompare({ groupID: I2, event: n2, item: m2, groupType: v2 })); + } + return { conversationOptionsList: a2, messageList: s2, AVChatRoomMessageList: r2 }; + } }, { key: "_qualityStat", value: function(e2, t2) { + var n2 = this._grpM.get(26); + n2.addMessageSequence({ key: jn, message: t2 }), e2 && 0 < t2.clientTime && n2.addMessageDelay(t2.clientTime); + } }, { key: "onMsgRevoked", value: function(e2, t2) { + var n2 = this, u2 = this._grpM.get(11), l2 = [], d2 = []; + e2.dataList.forEach(function(e3) { + var t3 = e3.elements.revokedInfos, s2 = e3.revokerInfo, r2 = e3.groupProfile, c2 = false; + r2 && (c2 = Nt({ groupID: r2.groupID }) || !S(r2.topicID)), N(t3) || t3.forEach(function(e4) { + var t4, n3 = S(e4.topicID) ? "GROUP".concat(e4.groupID) : "GROUP".concat(e4.topicID), o2 = u2.getLocalConversation(n3), i2 = e4.revokerInfo && e4.revokerInfo.revoker || s2 && s2.revoker, a2 = s2 && s2.reason || ""; + o2 && Ot(o2.type) ? t4 = { conversationID: n3, sequence: e4.sequence, ID: "".concat(e4.tinyID, "-").concat(e4.clientTime, "-").concat(e4.random) } : (o2 = u2.revoke(n3, e4.sequence, e4.random)) ? t4 = o2 : (t4 = { conversationID: n3, sequence: e4.sequence }, e4.tinyID && e4.clientTime && e4.random && (t4.ID = "".concat(e4.tinyID, "-").concat(e4.clientTime, "-").concat(e4.random)), e4.time && (t4.time = e4.time)), t4 && (t4.revoker = i2, t4.revokeReason = a2, t4.revokerInfo = { userID: i2, nick: "", avatar: "" }, (c2 ? (t4.revokerInfo.nick = r2.nick, t4.revokerInfo.avatar = r2.avatar, l2) : d2).push(t4)); + }); + }), 0 === d2.length && 0 === l2.length || (u2.onMessageRevoked([].concat(l2, d2), t2), 0 < l2.length && this._grpM.emitOEvt(h.MESSAGE_REVOKED, l2), 0 < d2.length && u2.updateRevokerInfo(d2).then(function(e3) { + n2._grpM.emitOEvt(h.MESSAGE_REVOKED, e3); + })); + } }, { key: "_groupListTreeShaking", value: function(e2) { + for (var n2 = new Map(p(this._grpM.getGroupMap())), t2 = 0, o2 = e2.length; t2 < o2; t2++) + n2.delete(e2[t2].groupID); + this._grpM.hasJoinedAVChatRoom() && this._grpM.getJoinedAVChatRoom().forEach(function(e3) { + n2.delete(e3); + }), this._grpM.getGroupMap().forEach(function(e3, t3) { + e3.isSupportTopic && n2.delete(t3); + }); + for (var i2 = p(n2.keys()), a2 = 0, s2 = i2.length; a2 < s2; a2++) + this._grpM.deleteGroup(i2[a2]); + } }, { key: "syncGroupList", value: function() { + var o2, i2, a2 = this, e2 = 0 < arguments.length && void 0 !== arguments[0] && arguments[0], t2 = (this._pagingStatus === Nn && this._grpM.clearGroupMap(), p(ce)), n2 = this.PAGING_GRP_COUNT_LIMIT, s2 = []; + return true === e2 ? this._pagingGetGroupListWithTopic({ limit: n2, offset: 0, groupBaseInfoFilter: t2, groupList: s2 }) : (e2 = "syncGroupList", o2 = "".concat(this._n, ".").concat(e2), i2 = new G(e2), this._pagingGetGroupList({ limit: n2, offset: 0, groupBaseInfoFilter: t2, groupList: s2 }).then(function() { + var e3 = tn(a2._pagingGetCostList), t3 = en(a2._pagingGetCostList), n3 = (a2._pagingGetCostList.length = 0, a2._pagingStatus = Pn, a2._groupListTreeShaking(s2), a2._grpM.updateGroupMap(s2), a2._grpM.getLocalGroupList().length), n3 = "count:".concat(n3, " sum:").concat(t3, " avg:").concat(e3); + return M.l("".concat(o2, " ok. ").concat(n3)), i2.setMessage(n3).end(), a2.tempConversationList && (a2.updateLastMsg(a2.tempConversationList), a2.tempConversationList = null), a2._grpM.emitGroupListUpdate(true, true), C({ groupList: a2._grpM.getLocalGroupList() }); + }).catch(function(e3) { + return a2._pagingStatus = Un, i2.setError(e3).end(), M.e("".concat(o2, " failed. error:"), e3), D(e3); + })); + } }, { key: "getGroupList", value: function() { + var e2, t2 = this, n2 = "".concat(this._n, ".").concat("getGroupList"); + return M.l("".concat(n2, " pagingStatus:").concat(this._pagingStatus)), this._pagingStatus === Un || this._pagingStatus === Nn ? this.syncGroupList().then(function() { + var e3 = t2._grpM.getLocalGroupList(); + return C({ groupList: e3, isSyncCompleted: t2.isPagingGetCompleted() }); + }).catch(function(e3) { + return M.e("".concat(n2, " failed. error:"), e3), D(e3); + }) : (e2 = this._grpM.getLocalGroupList(), M.l("".concat(n2, ". returned group count:").concat(e2.length)), T({ groupList: e2, isSyncCompleted: this.isPagingGetCompleted() })); + } }, { key: "isPagingGetCompleted", value: function() { + return this._pagingStatus === Pn; + } }, { key: "_pagingGetGroupList", value: function(e2) { + var o2 = this, i2 = "".concat(this._n, ".").concat("_pagingGetGroupList"), t2 = e2.isCommunityRelay, a2 = void 0 !== t2 && t2, s2 = e2.limit, r2 = e2.offset, c2 = e2.groupBaseInfoFilter, u2 = e2.groupList, l2 = Date.now(); + return this._grpM.req({ P: k.GET_GRP_LIST, data: { type: a2 ? A.GRP_COMMUNITY : void 0, memberAccount: this._grpM.getMyUserID(), limit: s2, offset: r2, responseFilter: { groupBaseInfoFilter: c2, selfInfoFilter: ["Role", "JoinTime", "MsgFlag", "MsgSeq"] } } }).then(function(e3) { + var e3 = e3.data, t3 = e3.groups, t3 = void 0 === t3 ? [] : t3, e3 = e3.totalCount, t3 = (u2.push.apply(u2, p(t3)), o2._handleGroupAtInfoWithoutTopic(a2, t3), r2 + s2), n2 = !(t3 < e3), e3 = "offset:".concat(r2, " limit:").concat(s2, " total:").concat(e3, " isCompleted:").concat(n2, " ") + "current:".concat(u2.length, " isCommunityRelay:").concat(a2); + return o2._pagingGetCostList.push(nn(l2, false)), M.l("".concat(i2, " ok. ").concat(e3, " cost:").concat(nn(l2))), a2 || n2 ? !a2 && n2 ? (M.l("".concat(i2, " start to get community list")), r2 = 0, o2._pagingGetGroupList({ limit: s2, offset: r2, groupBaseInfoFilter: c2, groupList: u2, isCommunityRelay: true })) : a2 && !n2 ? (r2 = t3, o2._pagingGetGroupList({ limit: s2, offset: r2, groupBaseInfoFilter: c2, groupList: u2, isCommunityRelay: true })) : C({ groupList: u2 }) : (r2 = t3, o2._pagingGetGroupList({ limit: s2, offset: r2, groupBaseInfoFilter: c2, groupList: u2 })); + }).catch(function(e3) { + return 10018 === e3.code ? (M.w("".concat(o2.logPrefix, " response size exceeds the limit, request count:").concat(s2)), s2 = 50, o2._pagingGetGroupList({ limit: s2, offset: r2, groupBaseInfoFilter: c2, groupList: u2, isCommunityRelay: a2 })) : a2 ? (11e3 === e3.code && M.l("".concat(i2, " ok. community unavailable")), T({ groupList: u2 })) : D(e3); + }); + } }, { key: "_pagingGetGroupListWithTopic", value: function(e2) { + var o2 = this, i2 = "".concat(this._n, "._pagingGetGroupListWithTopic"), a2 = e2.limit, s2 = e2.offset, r2 = e2.groupBaseInfoFilter, c2 = e2.groupList, u2 = Date.now(); + return this._grpM.req({ P: k.GET_GRP_LIST, data: { type: A.GRP_COMMUNITY, memberAccount: this._grpM.getMyUserID(), limit: a2, offset: s2, responseFilter: { groupBaseInfoFilter: r2, selfInfoFilter: p(ue) }, isSupportTopic: 1, needAppDefineData: 1 } }).then(function(e3) { + var e3 = e3.data, t2 = e3.groups, e3 = e3.totalCount, t2 = (c2.push.apply(c2, p(void 0 === t2 ? [] : t2)), s2 + a2), n2 = !(t2 < e3); + if (M.l("".concat(i2, " ok. offset:").concat(s2, " limit:").concat(a2, " totalCount:").concat(e3, " isCompleted:").concat(n2, " currentCount:").concat(c2.length, " cost:").concat(nn(u2))), !n2) + return s2 = t2, o2._pagingGetGroupListWithTopic({ limit: a2, offset: s2, groupBaseInfoFilter: r2, groupList: c2 }); + o2._grpM.updateGroupMap(c2), o2._grpM.emitGroupListUpdate(true, false); + e3 = o2._grpM.getLocalGroupList().filter(function(e4) { + return true === e4.isSupportTopic; + }); + return C({ groupList: e3 }); + }).catch(function(e3) { + return 10018 === e3.code ? (M.w("".concat(o2.logPrefix, " response size exceeds the limit, request count:").concat(a2)), a2 = 50, o2._pagingGetGroupListWithTopic({ limit: a2, offset: s2, groupBaseInfoFilter: r2, groupList: c2 })) : D(e3); + }); + } }, { key: "_cacheGroupMessage", value: function(e2, t2) { + this._cachedGroupMessageMap.has(e2) || this._cachedGroupMessageMap.set(e2, []), this._cachedGroupMessageMap.get(e2).push(t2); + } }, { key: "_deleteCachedGroupMessage", value: function(e2) { + this._cachedGroupMessageMap.has(e2) && this._cachedGroupMessageMap.delete(e2); + } }, { key: "_notifyCachedGroupMessage", value: function(e2, t2) { + var n2 = this, o2 = this._cachedGroupMessageMap.get(e2) || []; + M.l("".concat(this._n, "._notifyCachedGroupMessage groupID:").concat(e2, " groupType:").concat(t2, " count:").concat(o2.length)), o2.forEach(function(e3) { + n2.onNewMessage(e3); + }), this._deleteCachedGroupMessage(e2); + } }, { key: "_cacheAndCompare", value: function(e2) { + var t2 = e2.groupID, n2 = e2.event, o2 = e2.item, e2 = e2.groupType, n2 = (M.l("".concat(this._n, "._cacheAndCompare groupID:").concat(t2, " groupType:").concat(e2)), this._cacheGroupMessage(t2, { event: n2, dataList: [o2] }), { groupID: t2, type: e2 }); + e2 === A.GRP_AVCHATROOM ? this._grpM.hasLocalGroup(t2) ? this._notifyCachedGroupMessage(t2, e2) : this._grpM.setUnjoinedAVChatRoom(t2) : (this._grpM.updateGroupMap([n2]), this._notifyCachedGroupMessage(t2, e2)), this._checkCountMap.has(t2) || this._checkCountMap.set(t2, 0); + } }, { key: "_handleGroupAtInfoWithoutTopic", value: function(e2, t2) { + var o2 = this; + e2 && 0 !== t2.length && t2.forEach(function(e3) { + var t3 = e3.groupID, e3 = e3.groupAtInfoList, n2 = []; + N(e3) || (e3.forEach(function(e4) { + n2.push(y(y({}, e4), {}, { groupID: t3 })); + }), o2._grpM.get(11).onNewGroupAtTips({ dataList: n2 })); + }); + } }, { key: "setPagingGroupCount", value: function(e2) { + N(e2) || (this.PAGING_GRP_COUNT_LIMIT = parseInt(e2, 10)); + } }, { key: "reset", value: function() { + this.PAGING_GRP_COUNT_LIMIT = 200, this._cachedGroupMessageMap.clear(), this._checkCountMap.clear(), this._pagingStatus = Nn, this._pagingGetCostList = []; + } }]), zi), di = (e(Ji, [{ key: "_onCloudConfig", value: function() { + var e2 = this._grpM.getCloudConfig("grp_attr_cache_time"); + N(e2) || (this.CACHE_EXPIRE_TIME = Number(e2)); + } }, { key: "updateLocalMainSequenceOnReconnected", value: function() { + this._groupAttributesMap.forEach(function(e2) { + e2.localMainSequence = 0; + }); + } }, { key: "isGroupAttributesUpdatedNotice", value: function(e2) { + var t2 = e2.to, e2 = e2.elements.newGroupProfile, n2 = !N(e2) && !S(e2.groupAttributeOption); + return n2 && this._onGroupAttributesUpdated({ groupID: t2, groupAttributeOption: e2.groupAttributeOption }), n2; + } }, { key: "_onGroupAttributesUpdated", value: function(e2) { + var t2, n2 = this, o2 = e2.groupID, e2 = e2.groupAttributeOption, i2 = e2.mainSequence, a2 = e2.isWithChangedAttributeInfo, s2 = e2.groupAttributeList, s2 = void 0 === s2 ? [] : s2, e2 = e2.operationType; + M.l("".concat(this._n, ".onGroupAttributesUpdated. ") + "groupID:".concat(o2, " isWithChangedAttributeInfo:").concat(a2, " operationType:").concat(e2)), N(e2) || (this._groupAttributesCopy = this._getCachedAttributes({ groupID: o2 }), 0 != (t2 = i2 - this._getLocalGroupAttributes(o2).localMainSequence) && (1 === a2 && 1 == t2 ? (this._refreshCachedGroupAttributes({ groupID: o2, remoteMainSequence: i2, groupAttributeList: s2, operationType: e2 }), this._emitGroupAttributesUpdated(o2)) : this._hasLocalGroupAttributes(o2) && (a2 = this._getLocalGroupAttributes(o2).avChatRoomKey, this._getGroupAttributes({ groupID: o2, avChatRoomKey: a2 }).then(function() { + n2._emitGroupAttributesUpdated(o2); + })))); + } }, { key: "initGroupAttributesCache", value: function(e2) { + var t2 = e2.groupID, e2 = e2.avChatRoomKey, e2 = void 0 === e2 ? void 0 : e2; + this._groupAttributesMap.set(t2, { lastUpdateTime: 0, localMainSequence: 0, remoteMainSequence: 0, attributes: /* @__PURE__ */ new Map(), avChatRoomKey: e2 }), M.l("".concat(this._n, ".initGroupAttributesCache groupID:").concat(t2, " avChatRoomKey:").concat(e2)); + } }, { key: "initGroupAttributes", value: function(e2) { + var n2 = this, o2 = e2.groupID, i2 = e2.groupAttributes, e2 = this._getLocalGroupAttributes(o2), t2 = e2.remoteMainSequence, e2 = e2.avChatRoomKey, a2 = new G("initGroupAttributes"); + return a2.setMessage("groupID:".concat(o2, " avChatRoomKey:").concat(e2, " mainSequence:").concat(t2)), this._grpM.req({ P: k.SET_GRP_ATTR, data: { groupID: o2, avChatRoomKey: e2, mainSequence: t2, groupAttributeList: this._transformGroupAttributes(i2) } }).then(function(e3) { + M.l("".concat(n2._n, ".").concat("initGroupAttributes", " ok. groupID:").concat(o2)); + var e3 = e3.data, t3 = e3.mainSequence, e3 = p(e3.groupAttributeList); + return e3.forEach(function(e4) { + e4.value = i2[e4.key]; + }), n2._groupAttributesCopy = n2._getCachedAttributes({ groupID: o2 }), n2._refreshCachedGroupAttributes({ groupID: o2, remoteMainSequence: t3, groupAttributeList: e3, operationType: 1 }), n2._emitGroupAttributesUpdated(o2), a2.end(), C({ groupAttributes: i2 }); + }).catch(function(e3) { + return a2.setError(e3).end(), D(e3); + }); + } }, { key: "setGroupAttributes", value: function(e2) { + var n2 = this, o2 = "".concat(this._n, ".").concat("setGroupAttributes"), i2 = e2.groupID, a2 = e2.groupAttributes, e2 = this._getLocalGroupAttributes(i2), t2 = e2.remoteMainSequence, s2 = e2.avChatRoomKey, r2 = e2.attributes, e2 = this._transformGroupAttributes(a2), c2 = (e2.forEach(function(e3) { + var t3 = e3.key; + e3.sequence = 0, r2.has(t3) && (e3.sequence = r2.get(t3).sequence); + }), new G("setGroupAttributes")); + return c2.setMessage("groupID:".concat(i2, " groupAttributes:").concat(JSON.stringify(a2))), M.l("".concat(o2, ". groupID:").concat(i2, " mainSequence:").concat(t2)), this._grpM.req({ P: k.MODIFY_GRP_ATTR, data: { groupID: i2, avChatRoomKey: s2, mainSequence: t2, groupAttributeList: e2 } }).then(function(e3) { + M.l("".concat(o2, " ok.")); + var e3 = e3.data, t3 = e3.mainSequence, e3 = p(e3.groupAttributeList); + return e3.forEach(function(e4) { + e4.value = a2[e4.key]; + }), n2._groupAttributesCopy = n2._getCachedAttributes({ groupID: i2 }), n2._refreshCachedGroupAttributes({ groupID: i2, remoteMainSequence: t3, groupAttributeList: e3, operationType: 2 }), n2._emitGroupAttributesUpdated(i2), c2.end(), C({ groupAttributes: a2 }); + }).catch(function(e3) { + return c2.setError(e3).end(), D(e3); + }); + } }, { key: "deleteGroupAttributes", value: function(e2) { + var t2 = this, n2 = e2.groupID, e2 = e2.keyList, e2 = void 0 === e2 ? [] : e2, o2 = this._getLocalGroupAttributes(n2), i2 = o2.remoteMainSequence, a2 = o2.avChatRoomKey, s2 = o2.attributes, r2 = p(s2.keys()), o2 = k.CLEAR_GRP_ATTR, c2 = 3, a2 = { groupID: n2, avChatRoomKey: a2, mainSequence: i2 }, u2 = [], l2 = (0 < e2.length && (r2 = [], o2 = k.DEL_GRP_ATTR, c2 = 4, e2.forEach(function(e3) { + var t3 = 0; + s2.has(e3) && (t3 = s2.get(e3).sequence, r2.push(e3)), u2.push({ key: e3, sequence: t3 }); + }), a2.groupAttributeList = u2), new G("deleteGroupAttributes")); + return l2.setMessage("groupID:".concat(n2, " mainSequence:").concat(i2, " keyList:").concat(e2, " proto:").concat(o2)), this._grpM.req({ P: o2, data: a2 }).then(function(e3) { + M.l("".concat(t2._n, ".").concat("deleteGroupAttributes", " ok. groupID:").concat(n2)); + e3 = e3.data.mainSequence; + return t2._groupAttributesCopy = t2._getCachedAttributes({ groupID: n2 }), t2._refreshCachedGroupAttributes({ groupID: n2, remoteMainSequence: e3, groupAttributeList: u2, operationType: c2 }), t2._emitGroupAttributesUpdated(n2), l2.end(), C({ keyList: r2 }); + }).catch(function(e3) { + return l2.setError(e3).end(), D(e3); + }); + } }, { key: "getGroupAttributes", value: function(t2) { + var n2 = this, o2 = "".concat(this._n, ".").concat("getGroupAttributes"), i2 = t2.groupID, e2 = this._getLocalGroupAttributes(i2), a2 = e2.avChatRoomKey, s2 = e2.lastUpdateTime, r2 = e2.localMainSequence, e2 = e2.remoteMainSequence, c2 = new G("getGroupAttributes"); + if (c2.setMessage("groupID:".concat(i2, " localMainSequence:").concat(r2, " remoteMainSequence:").concat(e2, " keyList:").concat(t2.keyList)), Date.now() - s2 >= this.CACHE_EXPIRE_TIME || r2 < e2) + return this._getGroupAttributes({ groupID: i2, avChatRoomKey: a2 }).then(function(e3) { + c2.setMoreMessage("get attributes from remote. count:".concat(e3.length)).end(), M.l("".concat(o2, " from remote. groupID:").concat(i2)); + e3 = n2._getCachedAttributes(t2); + return C({ groupAttributes: e3 }); + }).catch(function(e3) { + return c2.setError(e3).end(), D(e3); + }); + c2.setMoreMessage("get attributes from cache").end(), M.l("".concat(o2, " from cache. groupID:").concat(i2)); + s2 = this._getCachedAttributes(t2); + return T({ groupAttributes: s2 }); + } }, { key: "_getGroupAttributes", value: function(o2) { + var i2 = this, e2 = 0; + return N(o2.avChatRoomKey) || (e2 = 1), this._grpM.req({ P: k.GET_GRP_ATTR, data: y(y({}, o2), {}, { groupType: e2 }) }).then(function(e3) { + M.l("".concat(i2._n, "._getGroupAttributes ok. groupID:").concat(o2.groupID)); + var e3 = e3.data, t2 = e3.mainSequence, e3 = e3.groupAttributeList, n2 = p(e3); + return N(t2) || i2._refreshCachedGroupAttributes({ groupID: o2.groupID, remoteMainSequence: t2, groupAttributeList: n2, operationType: 5 }), e3; + }).catch(function(e3) { + return D(e3); + }); + } }, { key: "_refreshCachedGroupAttributes", value: function(e2) { + var t2 = e2.groupID, n2 = e2.remoteMainSequence, o2 = e2.groupAttributeList, e2 = e2.operationType; + if (this._hasLocalGroupAttributes(t2)) { + var i2 = this._getLocalGroupAttributes(t2), a2 = i2.localMainSequence; + if (5 === e2 || n2 - a2 == 1) + i2.remoteMainSequence = n2, i2.localMainSequence = n2, i2.lastUpdateTime = Date.now(), this._updateCachedAttributes({ groupAttributes: i2, groupAttributeList: o2, operationType: e2 }); + else { + if (a2 === n2) + return; + i2.remoteMainSequence = n2; + } + this._groupAttributesMap.set(t2, i2); + o2 = "operationType:".concat(e2, " localMainSequence:").concat(a2, " remoteMainSequence:").concat(n2); + M.l("".concat(this._n, "._refreshCachedGroupAttributes. ").concat(o2)); + } + } }, { key: "_getCachedAttributes", value: function(e2) { + var t2 = e2.groupID, e2 = e2.keyList, e2 = void 0 === e2 ? [] : e2, n2 = {}; + if (this._hasLocalGroupAttributes(t2)) { + var o2 = this._getLocalGroupAttributes(t2).attributes; + if (0 < e2.length) + e2.forEach(function(e3) { + o2.has(e3) && (n2[e3] = o2.get(e3).value); + }); + else { + var i2, a2 = Z(o2.keys()); + try { + for (a2.s(); !(i2 = a2.n()).done; ) { + var s2 = i2.value; + n2[s2] = o2.get(s2).value; + } + } catch (e3) { + a2.e(e3); + } finally { + a2.f(); + } + } + } + return n2; + } }, { key: "_updateCachedAttributes", value: function(e2) { + var o2 = e2.groupAttributes, t2 = e2.groupAttributeList, e2 = e2.operationType; + 3 !== e2 ? 4 !== e2 ? (1 === e2 && o2.attributes.clear(), t2.forEach(function(e3) { + var t3 = e3.key, n2 = e3.value, e3 = e3.sequence; + o2.attributes.set(t3, { value: n2, sequence: e3 }); + })) : t2.forEach(function(e3) { + o2.attributes.delete(e3.key); + }) : o2.attributes.clear(); + } }, { key: "_hasLocalGroupAttributes", value: function(e2) { + return this._groupAttributesMap.has(e2); + } }, { key: "_getLocalGroupAttributes", value: function(e2) { + return this._hasLocalGroupAttributes(e2) || this.initGroupAttributesCache({ groupID: e2 }), this._groupAttributesMap.get(e2); + } }, { key: "_transformGroupAttributes", value: function(t2) { + var n2 = []; + return Object.keys(t2).forEach(function(e2) { + n2.push({ key: e2, value: t2[e2] }); + }), n2; + } }, { key: "_emitGroupAttributesUpdated", value: function(e2) { + var t2 = this._getCachedAttributes({ groupID: e2 }), n2 = this._computeAttrChangedInfo(t2), o2 = n2.updatedKeyList, n2 = n2.deletedKeyList; + M.l("".concat(this._n, "._emitGroupAttributesUpdated update:").concat(o2.length, ", delete:").concat(n2.length)), 0 === o2.length && 0 === n2.length || this._grpM.emitOEvt(h.GROUP_ATTRIBUTES_UPDATED, { groupID: e2, groupAttributes: t2, updatedKeyList: o2, deletedKeyList: n2 }); + } }, { key: "_computeAttrChangedInfo", value: function(t2) { + var n2 = this, o2 = [], i2 = []; + return Object.keys(t2).forEach(function(e2) { + t2[e2] !== n2._groupAttributesCopy[e2] && o2.push(e2); + }), Object.keys(this._groupAttributesCopy).forEach(function(e2) { + N(t2[e2]) && i2.push(e2); + }), this._groupAttributesCopy = {}, { updatedKeyList: o2, deletedKeyList: i2 }; + } }, { key: "deleteLocalGroupAttributes", value: function(e2) { + this._hasLocalGroupAttributes(e2) && this._groupAttributesMap.delete(e2); + } }, { key: "reset", value: function() { + this._groupAttributesMap.clear(), this._groupAttributesCopy = {}, this.CACHE_EXPIRE_TIME = 3e4; + } }]), Ji), pi = (e(ji, [{ key: "_onCloudConfig", value: function() { + var e2 = this._grpM.getCloudConfig("grp_counter_expire_time"); + N(e2) || (this.EXPIRE_TIME = Number(e2)); + } }, { key: "isGroupCountersNotice", value: function(e2) { + var t2 = e2.to, e2 = e2.elements.groupCounterInfo, n2 = false; + return S(e2) || (this._onGroupCountersUpdated({ groupID: t2, groupCounterInfo: e2 }), n2 = true), n2; + } }, { key: "_onGroupCountersUpdated", value: function(e2) { + var o2 = this, i2 = e2.groupID; + e2.groupCounterInfo.forEach(function(e3) { + var t2 = e3.type, n2 = e3.groupCounterSeq, e3 = e3.counterList, e3 = void 0 === e3 ? [] : e3; + 0 !== t2 && 2 !== t2 || (o2._updateLocalGroupCounters({ groupID: i2, groupCounterSeq: n2, counterList: e3 }), e3.forEach(function(e4) { + o2._grpM.emitOEvt(h.GROUP_COUNTER_UPDATED, { groupID: i2, key: e4.key, value: e4.value }); + })), 1 === t2 && o2._deleteLocalGroupCounters({ groupID: i2, groupCounterSeq: n2, counterList: e3 }); + }), M.l("".concat(this._n, "._onGroupCountersUpdated groupID:").concat(i2)); + } }, { key: "initGroupCountersCache", value: function(e2) { + var t2 = e2.groupID, e2 = e2.avChatRoomKey; + this._groupCountersMap.set(t2, { lastUpdateTime: 0, groupCounterSeq: 0, counters: /* @__PURE__ */ new Map(), avChatRoomKey: e2 }), M.l("".concat(this._n, ".initGroupCountersCache groupID:").concat(t2, " avChatRoomKey:").concat(e2)); + } }, { key: "setGroupCounters", value: function(e2) { + var t2, n2, o2, i2, a2; + return this._grpM.canIUse(_.GRP_COUNTER) ? (t2 = "".concat(this._n, ".").concat("setGroupCounters"), n2 = e2.groupID, e2 = e2.counters, e2 = this._convertObjectToList(e2), o2 = this._getLocalGroupCounters(n2).avChatRoomKey, i2 = "groupID:".concat(n2, " count:").concat(e2.length), (a2 = new G("setGroupCounters")).setMessage("".concat(i2)), M.l("".concat(t2, ". ").concat(i2)), this._updateGroupCounters({ groupID: n2, counterList: e2, avChatRoomKey: o2, mode: "Set" }).then(function(e3) { + return a2.end(), M.l("".concat(t2, " ok.")), C({ counters: e3 }); + }).catch(function(e3) { + return a2.setError(e3).end(), M.e("".concat(t2, " failed. error:"), e3), D(e3); + })) : this._grpM.noUse("setGroupCounters"); + } }, { key: "increaseGroupCounter", value: function(e2) { + var t2, n2, o2, i2, a2, s2, r2 = "increaseGroupCounter"; + return this._grpM.canIUse(_.GRP_COUNTER) ? (t2 = "".concat(this._n, ".").concat(r2), n2 = e2.groupID, o2 = e2.key, e2 = e2.value, i2 = this._getLocalGroupCounters(n2).avChatRoomKey, a2 = "groupID:".concat(n2, " key:").concat(o2, " value:").concat(e2), (s2 = new G(r2)).setMessage("".concat(a2)), M.l("".concat(t2, ". ").concat(a2)), this._updateGroupCounters({ groupID: n2, counterList: [{ key: o2, value: e2 }], avChatRoomKey: i2, mode: "Increase" }).then(function(e3) { + return s2.end(), M.l("".concat(t2, " ok.")), C({ counters: e3 }); + }).catch(function(e3) { + return s2.setError(e3).end(), M.e("".concat(t2, " failed. error:"), e3), D(e3); + })) : this._grpM.noUse(r2); + } }, { key: "decreaseGroupCounter", value: function(e2) { + var t2, n2, o2, i2, a2, s2, r2 = "decreaseGroupCounter"; + return this._grpM.canIUse(_.GRP_COUNTER) ? (t2 = "".concat(this._n, ".").concat(r2), n2 = e2.groupID, o2 = e2.key, e2 = e2.value, i2 = this._getLocalGroupCounters(n2).avChatRoomKey, a2 = "groupID:".concat(n2, " key:").concat(o2, " value:").concat(e2), (s2 = new G(r2)).setMessage("".concat(a2)), M.l("".concat(t2, ". ").concat(a2)), this._updateGroupCounters({ groupID: n2, counterList: [{ key: o2, value: e2 }], avChatRoomKey: i2, mode: "Decrease" }).then(function(e3) { + return s2.end(), M.l("".concat(t2, " ok.")), C({ counters: e3 }); + }).catch(function(e3) { + return s2.setError(e3).end(), M.e("".concat(t2, " failed. error:"), e3), D(e3); + })) : this._grpM.noUse(r2); + } }, { key: "getGroupCounters", value: function(e2) { + var t2 = this; + if (!this._grpM.canIUse(_.GRP_COUNTER)) + return this._grpM.noUse("getGroupCounters"); + var n2 = "".concat(this._n, ".").concat("getGroupCounters"), o2 = e2.groupID, e2 = e2.keyList, i2 = void 0 === e2 ? [] : e2, e2 = this._getLocalGroupCounters(o2), a2 = e2.avChatRoomKey, e2 = e2.lastUpdateTime, s2 = new G("getGroupCounters"); + if (s2.setMessage("groupID:".concat(o2)), Date.now() - e2 >= this.EXPIRE_TIME) + return this._getRemoteGroupCounters({ groupID: o2, avChatRoomKey: a2 }).then(function(e3) { + s2.setMoreMessage("from remote. count:".concat(e3.length)).end(), M.l("".concat(n2, " from remote. groupID:").concat(o2)); + e3 = t2._getLocalCounters(o2, i2); + return C({ counters: e3 }); + }).catch(function(e3) { + return s2.setError(e3).end(), D(e3); + }); + s2.setMoreMessage("from cache").end(), M.l("".concat(n2, " from cache. groupID:").concat(o2)); + e2 = this._getLocalCounters(o2, i2); + return T({ counters: e2 }); + } }, { key: "_getRemoteGroupCounters", value: function(n2) { + var o2 = this; + return this._grpM.req({ P: k.GET_GRP_COUNTER, data: y({}, n2) }).then(function(e2) { + var e2 = e2.data, t2 = e2.counterList, t2 = void 0 === t2 ? [] : t2, e2 = e2.groupCounterSeq; + return o2._updateLocalGroupCounters({ groupID: n2.groupID, counterList: t2, groupCounterSeq: e2 }), M.l("".concat(o2._n, "._getRemoteGroupCounters ok. groupID:").concat(n2.groupID)), t2; + }).catch(function(e2) { + return D(e2); + }); + } }, { key: "_convertObjectToList", value: function(t2) { + var n2 = []; + return Object.keys(t2).forEach(function(e2) { + n2.push({ key: e2, value: t2[e2] }); + }), n2; + } }, { key: "_updateGroupCounters", value: function(e2) { + var t2 = "".concat(this._n, "._updateGroupCounters"), n2 = e2.groupID, o2 = e2.avChatRoomKey, i2 = e2.mode; + return M.l("".concat(t2, ". groupID:").concat(n2, " avChatRoomKey:").concat(o2, " mode:").concat(i2)), this._grpM.req({ P: k.UPDATE_GRP_COUNTER, data: y({}, e2) }).then(function(e3) { + M.l("".concat(t2, " ok.")); + var e3 = e3.data.counterList, n3 = {}; + return (void 0 === e3 ? [] : e3).forEach(function(e4) { + var t3 = e4.key, e4 = e4.value; + n3[t3] = e4; + }), n3; + }).catch(function(e3) { + return D(e3); + }); + } }, { key: "_hasLocalGroupCounters", value: function(e2) { + return this._groupCountersMap.has(e2); + } }, { key: "_getLocalGroupCounters", value: function(e2) { + return this._hasLocalGroupCounters(e2) || this.initGroupCountersCache({ groupID: e2 }), this._groupCountersMap.get(e2); + } }, { key: "_updateLocalGroupCounters", value: function(e2) { + var n2, t2, o2, i2 = e2.groupID, a2 = e2.counterList, a2 = void 0 === a2 ? [] : a2, e2 = e2.groupCounterSeq; + this._hasLocalGroupCounters(i2) && (o2 = this._getLocalGroupCounters(i2), n2 = o2.counters, t2 = o2.avChatRoomKey, o2 = o2.groupCounterSeq, 0 < e2 && e2 < o2 || (a2.forEach(function(e3) { + var t3 = e3.key, e3 = e3.value; + n2.set(t3, e3); + }), this._groupCountersMap.set(i2, { lastUpdateTime: Date.now(), groupCounterSeq: e2, counters: n2, avChatRoomKey: t2 }))); + } }, { key: "_deleteLocalGroupCounters", value: function(e2) { + var t2, n2, o2 = e2.groupID, i2 = e2.counterList, i2 = void 0 === i2 ? [] : i2, e2 = e2.groupCounterSeq; + this._hasLocalGroupCounters(o2) && (n2 = this._getLocalGroupCounters(o2), t2 = n2.counters, n2 = n2.avChatRoomKey, i2.forEach(function(e3) { + t2.delete(e3.key); + }), this._groupCountersMap.set(o2, { lastUpdateTime: Date.now(), groupCounterSeq: e2, counters: t2, avChatRoomKey: n2 })); + } }, { key: "_getLocalCounters", value: function(e2, t2) { + var n2 = {}; + if (this._hasLocalGroupCounters(e2)) { + var o2 = this._getLocalGroupCounters(e2).counters; + if (0 < t2.length) + t2.forEach(function(e3) { + o2.has(e3) && (n2[e3] = o2.get(e3)); + }); + else { + var i2, a2 = Z(o2.keys()); + try { + for (a2.s(); !(i2 = a2.n()).done; ) { + var s2 = i2.value; + n2[s2] = o2.get(s2); + } + } catch (e3) { + a2.e(e3); + } finally { + a2.f(); + } + } + } + return n2; + } }, { key: "reset", value: function() { + this._groupCountersMap.clear(), this.EXPIRE_TIME = 3e4; + } }]), ji), _i = (e(Wi, [{ key: "start", value: function() { + var e2 = this._grpM.isLoggedIn(); + e2 || (this._proto = k.AV_NOAUTH_POLLING), M.l("".concat(this._n, ".start pollingInterval:").concat(this._manager.getPollingInterval(), " isLoggedIn:").concat(e2)), this._isRunning = true, this._request(); + } }, { key: "isRunning", value: function() { + return this._isRunning; + } }, { key: "_request", value: function() { + var t2 = this, e2 = this._onInit(this._groupID); + this._grpM.req({ P: this._proto, data: e2 }).then(function(e3) { + t2._onSuccess(t2._groupID, e3), t2.isRunning() && (clearTimeout(t2._timeoutID), t2._timeoutID = setTimeout(t2._request.bind(t2), t2._manager.getPollingInterval())); + }).catch(function(e3) { + t2._onFail(t2._groupID, e3), t2.isRunning() && (clearTimeout(t2._timeoutID), t2._timeoutID = setTimeout(t2._request.bind(t2), t2._manager.MAX_POLLING_INTERVAL)); + }); + } }, { key: "stop", value: function() { + M.l("".concat(this._n, ".stop")), 0 < this._timeoutID && (clearTimeout(this._timeoutID), this._timeoutID = -1), this._isRunning = false; + } }, { key: "getPollingTimerID", value: function() { + return this._timeoutID; + } }]), Wi), hi = { 3: true, 4: true, 5: true, 6: true, 17: true, 20: true, 21: true, 100: true }, gi = (e(Yi, [{ key: "hasJoinedAVChatRoom", value: function() { + var e2 = []; + return 0 < (e2 = 0 < this._joinedGroupMap.size ? p(this._joinedGroupMap.values()).filter(function(e3) { + return e3.type === A.GRP_AVCHATROOM; + }) : e2).length; + } }, { key: "getJoinedLiveList", value: function() { + var e2 = []; + return e2 = 0 < this._joinedGroupMap.size ? p(this._joinedGroupMap.values()).filter(function(e3) { + return e3.type === A.GRP_LIVE; + }) : e2; + } }, { key: "checkJoinedAVChatRoomByID", value: function(e2) { + return this._joinedGroupMap.has(e2); + } }, { key: "getJoinedAVChatRoom", value: function() { + return 0 < this._joinedGroupMap.size ? p(this._joinedGroupMap.keys()) : []; + } }, { key: "_updatedata", value: function(e2) { + var t2 = this._pollingRequestInfoMap.get(e2); + return e2 === p(this._pollingInstanceMap.keys())[0] ? y(y({}, t2), {}, { startBroadcastSeq: this._startBroadcastSeq, simplifiedMessage: this.DEFAULT_POLLING_SIMPLIFIED_MSG }) : y(y({}, t2), {}, { simplifiedMessage: this.DEFAULT_POLLING_SIMPLIFIED_MSG }); + } }, { key: "_handleSuccess", value: function(e2, t2) { + var n2, o2 = t2.data, i2 = o2.key, a2 = o2.nextSeq, s2 = o2.rspMsgList, r2 = o2.errorCode, c2 = o2.nextBroadcastSeq, o2 = o2.broadcastMessageList; + 0 !== r2 ? (r2 = this._pollingRequestInfoMap.get(e2), n2 = new G("longPollingAVError"), r2 = r2 ? "".concat(r2.key, "-").concat(r2.startSeq) : "requestInfo is undefined", n2.setMessage("".concat(e2, "-").concat(r2, "-").concat(t2.errorInfo)).setCode(t2.errorCode).end(true)) : this.checkJoinedAVChatRoomByID(e2) && (m(i2) && R(a2) && this._pollingRequestInfoMap.set(e2, { key: i2, startSeq: a2 }), R(c2) && c2 > this._startBroadcastSeq && (this._startBroadcastSeq = c2), O(s2) && 0 < s2.length ? (s2.forEach(function(e3) { + e3.to = e3.groupID; + }), this.onMessage(s2, e2)) : (this._pollingNoMessageCount += 1, this._pollingNoMessageCount === this.DEFAULT_POLLING_NO_MESSAGE_COUNT && (this._pollingInterval = this.DEFAULT_POLLING_INTERVAL + this.DEFAULT_POLLING_INTERVAL_PLUS)), this._onBroadcastMessage(o2)); + } }, { key: "_handleFailure", value: function(e2, t2) { + } }, { key: "onMessage", value: function(e2, t2) { + if (O(e2) && 0 !== e2.length) { + var n2 = "".concat(this._n, ".onMessage"), o2 = (t2 && (n2 += " groupID:".concat(t2)), 0 !== this._pollingNoMessageCount && (this._pollingNoMessageCount = 0, this._pollingInterval = this.DEFAULT_POLLING_INTERVAL), null), i2 = [], a2 = this._get(11), s2 = this._get(26), r2 = e2.length, c2 = (1 < r2 && e2.sort(function(e3, t3) { + return e3.sequence - t3.sequence; + }), this._get(12).isUnlimitedAVChatRoom()), u2 = false; + M.getLevel() <= 0 && (t2 = e2.map(function(e3) { + return e3.sequence; + }), M.l("".concat(n2, " count:").concat(t2.length, " sequenceList:").concat(t2)), t2.length = 0); + for (var l2 = 0; l2 < r2; l2++) { + var d2 = this.restoreMessageFromSimplified(e2[l2]); + if (hi[d2.event]) { + if (6 === d2.event) { + if (this._grpM.isGroupAttributesUpdatedNotice(d2)) + continue; + if (this._grpM.isGroupCountersNotice(d2)) + continue; + } + if (20 !== d2.event) + if (21 !== d2.event) + if (100 !== d2.event) { + var o2 = this.packMessage(d2, d2.event), p2 = 1 === d2.isModified, u2 = 1 === d2.isHistoryMessage; + if (!c2) { + if (this._seqSll.has(o2.sequence)) + continue; + this._seqSll.set(o2.sequence); + } + var _2 = this._IDSll.has(o2.ID); + _2 ? M.w("".concat(n2, " ID:").concat(o2.ID, " has:").concat(_2)) : (this._IDSll.set(o2.ID), _2 = false, !u2 && this._isMessageSentByCurrentInstance(o2) ? p2 && (_2 = true, o2.isModified = p2, a2.updateMsgIsModifiedProp(o2)) : _2 = true, _2 && (o2.conversationType === A.CONV_SYSTEM && 5 === o2.payload.operationType && this._onGroupDismissed(o2.payload.groupProfile.groupID), u2 || o2.conversationType === A.CONV_SYSTEM || (p2 = o2.conversationID.replace(A.CONV_GROUP, ""), this._pollingInstanceMap.has(p2) ? this._grpM.isLoggedIn() && s2.addMessageSequence({ key: zn, message: o2 }) : (o2.type !== A.MSG_GRP_TIP && 0 < o2.clientTime && s2.addMessageDelay(o2.clientTime), s2.addMessageSequence({ key: Jn, message: o2 }))), i2.push(o2))); + } else + this.onRoomCustomData(d2); + else + this._get(34).onMessageReactionNotify({ event: 21, dataList: d2.elements.messageReactionNotifyList }); + else + this.handleMessageRevokedNotice(d2); + } else + M.w("".concat(n2, ". unknown event:").concat(d2.event)); + } + 0 !== i2.length && (0 < (t2 = At(i2)).length && this._grpM.emitOEvt(h.MESSAGE_MODIFIED, t2), u2 || 0 < (t2 = this.packConversationOption(i2)).length && a2.onNewMessage({ conversationOptionsList: t2, isInstantMessage: true }), this._checkMessageStacked(i2), 0 < (t2 = Rt(i2)).length && this._grpM.emitOEvt(h.MESSAGE_RECEIVED, t2), i2.length = 0); + } + } }, { key: "handleMessageRevokedNotice", value: function(e2) { + var t2 = this, i2 = e2.groupID, n2 = e2.elements.revokeMsgList, a2 = e2.revokerInfo, s2 = []; + n2.forEach(function(e3) { + var t3 = e3.tinyID, n3 = e3.clientTime, o2 = e3.random, e3 = e3.sequence, t3 = { conversationID: "".concat(A.CONV_GROUP).concat(i2), ID: "".concat(t3, "-").concat(n3, "-").concat(o2), revoker: a2.revoker, revokeReason: a2.reason || "", revokerInfo: { userID: a2.revoker, nick: "", avatar: "" }, sequence: e3 }; + s2.push(t3); + }), 0 !== s2.length && this._get(11).updateRevokerInfo(s2).then(function(e3) { + t2._grpM.emitOEvt(h.MESSAGE_REVOKED, e3); + }); + } }, { key: "isBroadcastOrNormal", value: function(e2) { + return 3 === e2 || 17 === e2; + } }, { key: "isGroupTip", value: function(e2) { + return 4 === e2 || 6 === e2; + } }, { key: "isGroupSystemNotice", value: function(e2) { + return 5 === e2; + } }, { key: "restoreGroupTipElements", value: function() { + var e2 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {}, t2 = e2.operatorInfo, t2 = void 0 === t2 ? {} : t2, n2 = e2.operatorID, o2 = e2.userIDList, o2 = void 0 === o2 ? [] : o2, i2 = e2.operationType, i2 = (R(e2.groupJoinType) || 1 !== i2 && 2 !== i2 || (e2.groupJoinType = 2 === i2 ? 0 : 1), t2.userID), a2 = t2.avatar, t2 = t2.nick, n2 = (e2.operatorInfo = { userID: void 0 === i2 ? n2 : i2, avatar: void 0 === a2 ? "" : a2, nick: void 0 === t2 ? "" : t2 }, o2.map(function(e3) { + return { userID: e3 }; + })); + return e2.memberInfoList = e2.memberInfoList || n2, e2; + } }, { key: "restoreMessageFromSimplified", value: function(n2) { + var e2, t2, o2, i2 = n2.event; + return this.isBroadcastOrNormal(i2) && (n2.cloudCustomData = n2.cloudCustomData || "", n2.elements = n2.elements.map(function(e3) { + var t3; + return e3.type === A.MSG_CUSTOM && (t3 = e3.content, e3.content = y({ data: "", description: "", extension: "" }, void 0 === t3 ? {} : t3)), e3; + })), (this.isGroupTip(i2) || this.isGroupSystemNotice(i2)) && (n2.from = n2.from || "@TIM#SYSTEM"), this.isGroupTip(i2) && (n2.elements = this.restoreGroupTipElements(n2.elements), t2 = (o2 = void 0 === (o2 = n2.elements) ? {} : o2).operationType, e2 = o2.operatorInfo, 1 === t2) && (t2 = [{ userID: (void 0 === e2 ? {} : e2).userID }], o2.memberInfoList = o2.memberInfoList || t2), this.isGroupSystemNotice(i2) && (o2 = (e2 = n2.elements).memberInfoList, t2 = e2.operatorInfo, n2.elements.memberInfoList = y({ userID: n2.elements.operatorID, avatar: "", nick: "" }, o2 = o2 || (void 0 === t2 ? {} : t2)), n2.elements = y({ authentication: "", remarkInfo: "", messageKey: 1e3 * n2.time }, n2.elements), i2 = Object.keys(n2.elements).filter(function(e3) { + return "operatorInfo" !== e3; + }).reduce(function(e3, t3) { + return y(y({}, e3), {}, F({}, t3, n2.elements[t3])); + }, {}), n2.elements = i2), n2; + } }, { key: "_onGroupDismissed", value: function(e2) { + M.l("".concat(this._n, "._onGroupDismissed groupID:").concat(e2)), this._grpM.deleteLocalGroupAndConversation(e2), this.reset(e2); + } }, { key: "_checkMessageStacked", value: function(e2) { + var t2 = "MessageStacked", e2 = e2.length; + 100 <= e2 && (this._grpM.warn(t2, e2), this._reportMessageStackedCount < 5) && (new G(t2).setMessage("count:".concat(e2, " groupID:").concat(p(this._joinedGroupMap.keys()))).setLevel("warning").end(), this._reportMessageStackedCount += 1); + } }, { key: "_isMessageSentByCurrentInstance", value: function(e2) { + return !!this._get(11).isMessageSentByCurrentInstance(e2); + } }, { key: "packMessage", value: function(e2, t2) { + e2.currentUser = this._grpM.getMyUserID(), e2.conversationType = 5 === t2 ? A.CONV_SYSTEM : A.CONV_GROUP, e2.isSystemMessage = !!e2.isSystemMessage; + var n2 = new Do(e2), e2 = this.packElements(e2, t2), t2 = this._grpM.getFileDownloadProxy(), o2 = this._grpM.getDowloadFileAuthKey(), i2 = this._get(17).getFileDNList(); + return n2.setElement(e2, t2, o2, i2), n2; + } }, { key: "packElements", value: function(e2, t2) { + return 4 === t2 || 6 === t2 ? (this._updateMemberCountByGroupTips(e2), { type: A.MSG_GRP_TIP, content: y(y({}, e2.elements), {}, { groupProfile: e2.groupProfile }) }) : 5 === t2 ? { type: A.MSG_GRP_SYS_NOTICE, content: y(y({}, e2.elements), {}, { groupProfile: y(y({}, e2.groupProfile), {}, { groupID: e2.groupID }) }) } : e2.elements; + } }, { key: "packConversationOption", value: function(e2) { + for (var t2 = /* @__PURE__ */ new Map(), n2 = 0; n2 < e2.length; n2++) { + var o2, i2 = e2[n2], a2 = i2.conversationID; + t2.has(a2) ? "in" === ((o2 = t2.get(a2)).lastMessage = i2).flow && o2.unreadCount++ : t2.set(a2, { conversationID: i2.conversationID, unreadCount: "out" === i2.flow ? 0 : 1, type: i2.conversationType, subType: i2.conversationSubType, lastMessage: i2 }); + } + return p(t2.values()); + } }, { key: "_updateMemberCountByGroupTips", value: function(e2) { + var t2, n2, o2, i2 = e2.groupProfile.groupID, e2 = e2.elements.onlineMemberInfo, e2 = void 0 === e2 ? void 0 : e2; + S(e2) || (t2 = void 0 === (t2 = e2.onlineMemberNum) ? 0 : t2, e2 = void 0 === (e2 = e2.expireTime) ? this.DEFAULT_EXPIRE_TIME : e2, n2 = this._onlineMemberCountMap.get(i2) || {}, o2 = Date.now(), S(n2) ? Object.assign(n2, { lastReqTime: 0, lastSyncTime: 0, latestUpdateTime: o2, memberCount: t2, expireTime: e2 }) : (n2.latestUpdateTime = o2, n2.memberCount = t2), this._onlineMemberCountMap.set(i2, n2)); + } }, { key: "_onBroadcastMessage", value: function(e2) { + if (!S(e2)) { + for (var t2 = [], n2 = e2.length, o2 = null, i2 = 0; i2 < n2; i2++) { + var a2 = this.restoreMessageFromSimplified(e2[i2]); + hi[a2.event] ? ((o2 = this.packMessage(a2, a2.event)).isBroadcastMessage = true, this._broadcastMessageIDMap.has(o2.ID) || (t2.push(o2), this._broadcastMessageIDMap.set(o2.ID, 1))) : M.w("".concat(this._n, "._onBroadcastMessage unknown event:").concat(a2.event)); + } + 0 < t2.length && this._grpM.emitOEvt(h.MESSAGE_RECEIVED, t2); + } + } }, { key: "start", value: function(e2) { + var t2; + this._pollingInstanceMap.has(e2) ? (t2 = this._pollingInstanceMap.get(e2)).isRunning() || t2.start() : ((t2 = new _i({ manager: this, groupID: e2, onInit: this._updatedata.bind(this), onSuccess: this._handleSuccess.bind(this), onFail: this._handleFailure.bind(this) })).start(), this._pollingInstanceMap.set(e2, t2), M.l("".concat(this._n, ".start groupID:").concat(e2))); + } }, { key: "handleJoinResult", value: function(o2) { + var i2 = this; + return this._preCheck(o2.group).then(function() { + var e2 = o2.longPollingKey, t2 = o2.group, n2 = t2.groupID; + return i2._joinedGroupMap.set(n2, t2), i2._grpM.updateGroupMap([t2]), i2._grpM.deleteUnjoinedAVChatRoom(n2), i2._grpM.emitGroupListUpdate(true, false), N(e2) ? T({ status: nt, group: t2 }) : Promise.resolve(); + }); + } }, { key: "startRunLoop", value: function(i2) { + var a2 = this; + return this.handleJoinResult(i2).then(function() { + var e2 = i2.longPollingKey, t2 = i2.group, n2 = i2.startSeq, o2 = t2.groupID; + return a2._pollingRequestInfoMap.set(o2, { key: e2, startSeq: void 0 === n2 ? 0 : n2 }), a2.start(o2), a2._grpM.isLoggedIn() ? T({ status: nt, group: t2 }) : T({ status: nt }); + }); + } }, { key: "_preCheck", value: function(e2) { + if (!this._get(12).isUnlimitedAVChatRoom() && this.hasJoinedAVChatRoom() && e2.type !== A.GRP_LIVE) { + var e2 = Y(this._joinedGroupMap.entries().next().value, 2), t2 = e2[0], e2 = e2[1]; + if (this._grpM.isLoggedIn() && e2.selfInfo.role !== A.GRP_MBR_ROLE_OWNER && e2.ownerID !== this._grpM.getMyUserID()) + return this._grpM.quitGroup(t2); + this._grpM.deleteLocalGroupAndConversation(t2), this.reset(t2); + } + return Promise.resolve(); + } }, { key: "joinWithoutAuth", value: function(e2) { + var n2 = this, o2 = e2.groupID, i2 = "".concat(this._n, ".").concat("joinWithoutAuth"), a2 = new G("joinWithoutAuth"); + return this._grpM.req({ P: k.APPLY_JOIN_GRP_NOAUTH, data: e2 }).then(function(e3) { + e3 = e3.data.longPollingKey; + if (a2.setMessage("groupID:".concat(o2, " longPollingKey:").concat(e3)).end(true), N(e3)) + return D({ code: L.CANNOT_JOIN_NON_AV_WITHOUT_LOGIN }); + M.l("".concat(i2, " ok. groupID:").concat(o2)), n2._get(11).setCompleted("".concat(A.CONV_GROUP).concat(o2)); + var t2 = new oi({ groupID: o2 }); + return n2.startRunLoop({ group: t2, longPollingKey: e3 }), C({ status: nt }); + }).catch(function(e3) { + return M.e("".concat(i2, " failed. groupID:").concat(o2, " error:"), e3), a2.setError(e3).setMessage("groupID:".concat(o2)).end(true), D(e3); + }).finally(function() { + n2._grpM.get(14).reportAtOnce(); + }); + } }, { key: "getGroupOnlineMemberCount", value: function(e2) { + var t2 = this._onlineMemberCountMap.get(e2) || {}, n2 = Date.now(); + return S(t2) || n2 - t2.lastSyncTime > 1e3 * t2.expireTime && 1e4 < n2 - t2.latestUpdateTime && 3e3 < n2 - t2.lastReqTime ? (t2.lastReqTime = n2, this._onlineMemberCountMap.set(e2, t2), this._getGroupOnlineMemberCount(e2).then(function(e3) { + return C({ memberCount: e3.memberCount }); + }).catch(function(e3) { + return D(e3); + })) : T({ memberCount: t2.memberCount }); + } }, { key: "_getGroupOnlineMemberCount", value: function(i2) { + var a2 = this, s2 = "".concat(this._n, ".").concat("_getGroupOnlineMemberCount"), t2 = new G("_getGroupOnlineMemberCount"); + return this._grpM.requestOnlineCount(i2).then(function(e2) { + var t3 = a2._onlineMemberCountMap.get(i2) || {}, e2 = e2.data, n2 = e2.memberCount, n2 = void 0 === n2 ? 0 : n2, e2 = e2.expireTime, e2 = void 0 === e2 ? a2.DEFAULT_EXPIRE_TIME : e2, o2 = (M.l("".concat(s2, " ok. groupID:").concat(i2, " memberCount:").concat(n2, " expireTime:").concat(e2)), Date.now()); + return S(t3) && (t3.lastReqTime = o2), a2._onlineMemberCountMap.set(i2, Object.assign(t3, { lastSyncTime: o2, latestUpdateTime: o2, memberCount: n2, expireTime: e2 })), { memberCount: n2 }; + }).catch(function(e2) { + return M.w("".concat(s2, " failed. error:"), e2), t2.setCode(e2.code).setMessage("groupID:".concat(i2, " error:").concat(JSON.stringify(e2))).end(), Promise.reject(e2); + }); + } }, { key: "_get", value: function(e2) { + return this._grpM.get(e2); + } }, { key: "setPollingInterval", value: function(e2) { + N(e2) || (R(e2) ? this._pollingInterval = this.DEFAULT_POLLING_INTERVAL = e2 : this._pollingInterval = this.DEFAULT_POLLING_INTERVAL = parseInt(e2, 10)); + } }, { key: "setPollingIntervalPlus", value: function(e2) { + N(e2) || (R(e2) ? this.DEFAULT_POLLING_INTERVAL_PLUS = e2 : this.DEFAULT_POLLING_INTERVAL_PLUS = parseInt(e2, 10)); + } }, { key: "setPollingNoMessageCount", value: function(e2) { + N(e2) || (R(e2) ? this.DEFAULT_POLLING_NO_MESSAGE_COUNT = e2 : this.DEFAULT_POLLING_NO_MESSAGE_COUNT = parseInt(e2, 10)); + } }, { key: "setPollingSimplifiedMessage", value: function(e2) { + N(e2) || "0" !== e2 && "1" !== e2 || (this.DEFAULT_POLLING_SIMPLIFIED_MSG = parseInt(e2, 10)); + } }, { key: "getPollingInterval", value: function() { + return this._pollingInterval; + } }, { key: "onAVChatRoomMemberBanned", value: function(e2) { + e2 = e2.payload.groupProfile.groupID; + M.l("".concat(this._n, ".onAVChatRoomMemberBanned groupID:").concat(e2)), this._grpM.deleteLocalGroupAndConversation(e2), this.reset(e2); + } }, { key: "restartPolling", value: function() { + M.l("".concat(this._n, ".restartPolling count:").concat(this._pollingInstanceMap.size)); + var e2, t2 = Z(this._pollingInstanceMap.values()); + try { + for (t2.s(); !(e2 = t2.n()).done; ) { + var n2 = e2.value; + n2.stop(), n2.start(); + } + } catch (e3) { + t2.e(e3); + } finally { + t2.f(); + } + } }, { key: "getPollingTimerID", value: function(e2) { + var t2; + return this._pollingInstanceMap.has(e2) ? (t2 = this._pollingInstanceMap.get(e2).getPollingTimerID(), M.l("".concat(this._n, ".getPollingTimerID groupID:").concat(e2, " timerID:").concat(t2)), t2) : -1; + } }, { key: "hasPollingInstance", value: function(e2) { + return this._pollingInstanceMap.has(e2); + } }, { key: "onRoomCustomData", value: function(e2) { + var t2 = e2.groupID, n2 = e2.sequence, o2 = e2.time, e2 = e2.elements, e2 = e2 && e2.content; + this._get(30).onRoomCustomDataReceived(e2), M.l("".concat(this._n, ".onRoomCustomData groupID:").concat(t2, " sequence:").concat(n2, " time:").concat(o2, " data:").concat(e2)); + } }, { key: "reset", value: function(e2) { + if (e2) { + M.l("".concat(this._n, ".reset groupID:").concat(e2)); + var t2 = this._pollingInstanceMap.get(e2); + t2 && t2.stop(), this._pollingInstanceMap.delete(e2), this._joinedGroupMap.delete(e2), this._pollingRequestInfoMap.delete(e2), this._onlineMemberCountMap.delete(e2); + } else { + M.l("".concat(this._n, ".reset all")); + var n2, o2 = Z(this._pollingInstanceMap.values()); + try { + for (o2.s(); !(n2 = o2.n()).done; ) + n2.value.stop(); + } catch (e3) { + o2.e(e3); + } finally { + o2.f(); + } + this._pollingInstanceMap.clear(), this._joinedGroupMap.clear(), this._pollingRequestInfoMap.clear(), this._onlineMemberCountMap.clear(), this._broadcastMessageIDMap.clear(); + } + this._seqSll.reset(), this._IDSll.reset(), this._reportMessageStackedCount = 0, this._pollingInterval = this.DEFAULT_POLLING_INTERVAL = 300, this.DEFAULT_POLLING_NO_MESSAGE_COUNT = 20, this.DEFAULT_POLLING_INTERVAL_PLUS = 2e3, this._pollingNoMessageCount = 0; + } }]), Yi), fi = (e(Ki, [{ key: "updateMember", value: function(e2) { + N(e2.onlineStatus) || (this.isOnline = "Online" === e2.onlineStatus); + var t2 = [null, void 0, "", 0, NaN]; + e2.memberCustomField && kt(this.memberCustomField, e2.memberCustomField), _t(this, e2, ["memberCustomField", "marks", "onlineStatus"], t2); + } }, { key: "updateRole", value: function(e2) { + ["Owner", "Admin", "Member"].indexOf(e2) < 0 || (this.role = e2); + } }, { key: "updateMuteUntil", value: function(e2) { + N(e2) || (this.muteUntil = Math.floor((Date.now() + 1e3 * e2) / 1e3)); + } }, { key: "updateNameCard", value: function(e2) { + N(e2) || (this.nameCard = e2); + } }, { key: "updateMemberCustomField", value: function(e2) { + e2 && kt(this.memberCustomField, e2); + } }]), Ki), mi = (e(Bi, [{ key: "_onProfileUpdated", value: function(e2) { + for (var n2 = this, o2 = e2.data, t2 = 0; t2 < o2.length; t2++) + !function(e3) { + var t3 = o2[e3]; + n2.groupMemberListMap.forEach(function(e4) { + e4.has(t3.userID) && e4.get(t3.userID).updateMember({ nick: t3.nick, avatar: t3.avatar }); + }); + }(t2); + } }, { key: "deleteGroupMemberList", value: function(e2) { + this.groupMemberListMap.delete(e2); + } }, { key: "getGroupMemberList", value: function(e2) { + var t2, o2 = this, i2 = e2.groupID, n2 = e2.role, n2 = void 0 === n2 ? void 0 : n2, a2 = e2.offset, s2 = void 0 === a2 ? 0 : a2, a2 = e2.count, r2 = void 0 === a2 ? 15 : a2, a2 = e2.filter, e2 = void 0 === a2 ? void 0 : a2, c2 = "".concat(this._n, ".").concat("getGroupMemberList"), a2 = this._grpM.hasLocalGroup(i2); + if (M.l("".concat(c2, " groupID:").concat(i2, " role:").concat(n2, " offset:").concat(s2, " count:").concat(r2, " hasLocalGroup:").concat(a2)), !a2) + return T({ memberList: [], offset: 0 }); + if (this._grpM.getLocalGroupProfile(i2).type === A.GRP_AVCHATROOM) { + if (this._grpM.canIUse(_.AV_MBR_LIST)) + return this._getAVChatRoomMemberList({ groupID: i2, offset: s2, filter: e2 }); + this._grpM.warn("LiveOnlineMember"); + } + n2 !== A.GRP_MBR_ROLE_ADMIN && n2 !== A.GRP_MBR_ROLE_OWNER && n2 !== A.GRP_MBR_ROLE_MEMBER || (t2 = n2); + var u2 = new G("getGroupMemberList"), l2 = 0, a2 = { groupID: i2, limit: 100 < r2 ? 100 : r2, memberRoleFilter: t2 ? [t2] : void 0, memberInfoFilter: this.DEFAULT_MEMBER_INFO_FILTER }, d2 = (Nt({ groupID: i2 }) ? a2.next = "".concat(s2) : l2 = (a2.offset = s2) + r2, []); + return this._grpM.req({ P: k.GET_GRP_MBR_LIST, data: a2 }).then(function(e3) { + var e3 = e3.data, t3 = e3.members, n3 = e3.memberNum, e3 = e3.next, e3 = void 0 === e3 ? void 0 : e3; + return N(e3) || (l2 = S(e3) ? 0 : e3), O(t3) && 0 !== t3.length ? (o2._grpM.hasLocalGroup(i2) && (o2._grpM.getLocalGroupProfile(i2).memberNum = n3), d2 = o2._updateLocalGroupMemberMap(i2, t3), o2._grpM.get(4).getUserProfile({ userIDList: t3.map(function(e4) { + return e4.userID; + }), tagList: [g.NICK, g.AVATAR] })) : (l2 = 0, Promise.resolve([])); + }).then(function(e3) { + var e3 = e3.data; + return O(e3) && 0 !== e3.length ? (e3 = e3.map(function(e4) { + return { userID: e4.userID, nick: e4.nick, avatar: e4.avatar }; + }), o2._updateLocalGroupMemberMap(i2, e3), d2.length < r2 && (l2 = 0), u2.setMessage("groupID:".concat(i2, " offset:").concat(s2, " count:").concat(r2)).end(), M.l("".concat(c2, " ok.")), C({ memberList: d2, offset: l2 })) : T({ memberList: [], offset: l2 }); + }).catch(function(e3) { + return u2.setError(e3).end(), M.e("".concat(c2, " failed. error:"), e3), D(e3); + }); + } }, { key: "_getAVChatRoomMemberList", value: function(e2) { + var n2 = this, o2 = e2.groupID, t2 = e2.offset, e2 = e2.filter, i2 = "".concat(this._n, ".").concat("_getAVChatRoomMemberList"), a2 = new G("_getAVChatRoomMemberList"); + return a2.setMessage("groupID:".concat(o2, " offset:").concat(t2, " filter:").concat(e2)), this._grpM.req({ P: k.GET_AV_MBR_LIST, data: { groupID: o2, offset: t2, filter: e2 } }).then(function(e3) { + var e3 = e3.data, t3 = e3.memberList, t3 = void 0 === t3 ? [] : t3, e3 = e3.offset, e3 = void 0 === e3 ? 0 : e3, t3 = (a2.end(), M.l("".concat(i2, " ok. member count:").concat(t3.length, ", next request timestamp:").concat(e3)), t3.map(function(e4) { + return y(y({}, e4), {}, { onlineStatus: "Online" }); + })), t3 = n2._updateLocalGroupMemberMap(o2, t3); + return C({ memberList: t3, offset: e3 }); + }).catch(function(e3) { + return a2.setError(e3).end(), M.e("".concat(i2, " failed. error:"), e3), D(e3); + }); + } }, { key: "getGroupMemberProfile", value: function(e2) { + var t2, n2 = this, o2 = "getGroupMemberProfile", i2 = "".concat(this._n, ".").concat(o2), a2 = "groupID:".concat(e2.groupID), s2 = (5 < e2.userIDList.length ? a2 += " userIDList.length:".concat(e2.userIDList.length) : a2 += " userIDList:".concat(e2.userIDList), M.l("".concat(i2, " ").concat(a2)), 50 < e2.userIDList.length && (e2.userIDList = e2.userIDList.slice(0, 50)), e2.groupID), r2 = e2.userIDList, i2 = this._grpM.getLocalGroupProfile(s2); + return i2 && Ot(i2.type) ? D({ code: i2 = L.OPERATION_NOT_SUPPORTED_IN_AV, message: this._grpM.getErrMsg(i2, o2) }) : ((t2 = new G(o2)).setMessage(a2), this._getGroupMemberProfileAdvance(y(y({}, e2), {}, { userIDList: r2 })).then(function(e3) { + e3 = e3.data.members; + return O(e3) && 0 !== e3.length ? (n2._updateLocalGroupMemberMap(s2, e3), n2._grpM.get(4).getUserProfile({ userIDList: e3.map(function(e4) { + return e4.userID; + }), tagList: [g.NICK, g.AVATAR] })) : T([]); + }).then(function(e3) { + e3 = e3.data.map(function(e4) { + return { userID: e4.userID, nick: e4.nick, avatar: e4.avatar }; + }), n2._updateLocalGroupMemberMap(s2, e3), e3 = r2.filter(function(e4) { + return n2.hasLocalGroupMember(s2, e4); + }).map(function(e4) { + return n2.getLocalGroupMemberInfo(s2, e4); + }); + return t2.end(), C({ memberList: e3 }); + })); + } }, { key: "addGroupMember", value: function(a2) { + var s2 = this, r2 = "".concat(this._n, ".").concat("addGroupMember"), e2 = a2.groupID, c2 = this._grpM.getLocalGroupProfile(e2), t2 = c2.type, u2 = new G("addGroupMember"); + return u2.setMessage("groupID:".concat(e2, " groupType:").concat(t2)), Ot(t2) ? (t2 = new E({ code: L.CANNOT_ADD_MEMBER_IN_AV }), u2.setError(t2).end(), D(t2)) : (a2.userIDList = a2.userIDList.map(function(e3) { + return { userID: e3 }; + }), M.l("".concat(r2, " groupID:").concat(e2)), this._grpM.req({ P: k.ADD_GRP_MBR, data: a2 }).then(function(e3) { + var e3 = e3.data.members, t3 = (M.l("".concat(r2, " ok")), e3.filter(function(e4) { + return 1 === e4.result; + }).map(function(e4) { + return e4.userID; + })), n2 = e3.filter(function(e4) { + return 0 === e4.result; + }).map(function(e4) { + return e4.userID; + }), o2 = e3.filter(function(e4) { + return 2 === e4.result; + }).map(function(e4) { + return e4.userID; + }), e3 = e3.filter(function(e4) { + return 4 === e4.result; + }).map(function(e4) { + return e4.userID; + }), i2 = "groupID:".concat(a2.groupID, ", ") + "successUserIDList:".concat(t3, ", ") + "failureUserIDList:".concat(n2, ", ") + "existedUserIDList:".concat(o2, ", ") + "overLimitUserIDList:".concat(e3); + return u2.setMoreMessage(i2).end(), 0 === t3.length ? C({ successUserIDList: t3, failureUserIDList: n2, existedUserIDList: o2, overLimitUserIDList: e3 }) : (s2._updateConvGroupProfile(c2), C({ successUserIDList: t3, failureUserIDList: n2, existedUserIDList: o2, overLimitUserIDList: e3, group: c2 })); + }).catch(function(e3) { + return u2.setError(e3).end(), M.e("".concat(r2, " failed. error:"), e3), D(e3); + })); + } }, { key: "deleteGroupMember", value: function(e2) { + var t2, n2, o2 = this, i2 = "".concat(this._n, ".").concat("deleteGroupMember"), a2 = e2.groupID, s2 = e2.userIDList, r2 = this._grpM.getLocalGroupProfile(a2); + return N(r2) ? D({ code: L.CANNOT_FIND_GRP }) : Ot(r2.type) ? this._grpM.canIUse(_.AV_BAN_MBR) ? this._banAVChatRoomMember(e2) : this._grpM.noUse("deleteGroupMember") : (t2 = "groupID:".concat(a2, " ").concat(5 < s2.length ? "userIDList.length:".concat(s2.length) : "userIDList:".concat(s2)), M.l("".concat(i2, " groupID:").concat(a2, " userIDList:"), s2), (n2 = new G("deleteGroupMember")).setMessage(t2), this._grpM.req({ P: k.DEL_GRP_MBR, data: e2 }).then(function() { + return n2.end(), M.l("".concat(i2, " ok")), o2._updateConvGroupProfile(r2), o2.deleteLocalGroupMembers(a2, s2), C({ group: r2, userIDList: s2 }); + }).catch(function(e3) { + return n2.setError(e3).end(), M.e("".concat(i2, " failed. error:"), e3), D(e3); + })); + } }, { key: "_updateConvGroupProfile", value: function(e2) { + this._grpM.get(11).updateConvGroupProfile([e2]); + } }, { key: "_banAVChatRoomMember", value: function(e2) { + var t2 = this, n2 = "".concat(this._n, ".").concat("_banAVChatRoomMember"), o2 = e2.groupID, i2 = e2.userIDList, a2 = "groupID:".concat(o2, " ").concat(5 < i2.length ? "userIDList.length:".concat(i2.length) : "userIDList:".concat(i2)), s2 = new G("_banAVChatRoomMember"), r2 = (s2.setMessage(a2), M.l("".concat(n2, " groupID:").concat(o2, " userIDList:"), i2), this._grpM.getLocalGroupProfile(o2)); + return N(e2.duration) || 0 === e2.duration ? D({ code: L.BAN_DURATION_INVALID }) : this._grpM.req({ P: k.BAN_AV_MBR, data: e2 }).then(function() { + return s2.end(), M.l("".concat(n2, " ok")), t2.deleteLocalGroupMembers(o2, i2), C({ group: r2, userIDList: i2 }); + }).catch(function(e3) { + return s2.setError(e3).end(), M.e("".concat(n2, " failed. error:"), e3), D(e3); + }); + } }, { key: "setGroupMemberMuteTime", value: function(e2) { + var t2, n2, o2 = this, i2 = e2.groupID, a2 = e2.userID, e2 = e2.muteTime, s2 = "".concat(this._n, ".").concat("setGroupMemberMuteTime"); + return a2 === this._grpM.getMyUserID() ? D({ code: L.CANNOT_MUTE_SELF }) : (t2 = "groupID:".concat(i2, " userID:").concat(a2, " muteTime:").concat(e2), M.l("".concat(s2, " ").concat(t2)), (n2 = new G("setGroupMemberMuteTime")).setMessage(t2), this.modifyGroupMemberInfo({ groupID: i2, userID: a2, muteTime: e2 }).then(function(e3) { + n2.end(), M.l("".concat(s2, " ok")); + var t3 = o2._grpM.getLocalGroupProfile(i2); + return C({ group: t3, member: e3 }); + }).catch(function(e3) { + return n2.setError(e3).end(), M.e("".concat(s2, " failed. error:"), e3), D(e3); + })); + } }, { key: "setGroupMemberRole", value: function(e2) { + var t2, n2, o2 = "".concat(this._n, ".").concat("setGroupMemberRole"), i2 = e2.groupID, a2 = e2.userID, e2 = e2.role, s2 = "groupID:".concat(i2, " userID:").concat(a2, " role:").concat(e2), r2 = this._grpM.getLocalGroupProfile(i2); + return r2 && r2.selfInfo.role !== A.GRP_MBR_ROLE_OWNER ? D({ code: L.NOT_OWNER }) : (t2 = [A.GRP_MBR_ROLE_ADMIN, A.GRP_MBR_ROLE_MEMBER], Nt({ groupID: i2 }) && t2.push(A.GRP_MBR_ROLE_CUSTOM), t2.indexOf(e2) < 0 ? D({ code: L.INVALID_MEMBER_ROLE }) : a2 === this._grpM.getMyUserID() ? D({ code: L.CANNOT_SET_SELF_MEMBER_ROLE }) : ((n2 = new G("setGroupMemberRole")).setMessage(s2), M.l("".concat(o2, " ").concat(s2)), this.modifyGroupMemberInfo({ groupID: i2, userID: a2, role: e2 }).then(function(e3) { + return n2.end(), M.l("".concat(o2, " ok")), C({ group: r2, member: e3 }); + }).catch(function(e3) { + return n2.setError(e3).end(), M.e("".concat(o2, " failed. error:"), e3), D(e3); + }))); + } }, { key: "_filterProfanity", value: function(e2, t2) { + var n2, o2 = this._grpM.get(29); + return !o2 || (n2 = (o2 = o2.filterText(t2[e2], "group_member_profile")).isAllowedToSend, o2 = o2.modifiedText, true === n2 && (t2[e2] = o2, true)); + } }, { key: "setGroupMemberNameCard", value: function(e2) { + var n2, o2, i2, t2, a2, s2 = this, r2 = "setGroupMemberNameCard", c2 = "".concat(this._n, ".").concat(r2); + return e2.nameCard && false === this._filterProfanity("nameCard", e2) ? D({ code: L.PROFANITY_FOUND }) : (n2 = e2.groupID, t2 = e2.userID, o2 = void 0 === t2 ? this._grpM.getMyUserID() : t2, i2 = e2.nameCard, t2 = "groupID:".concat(n2, " userID:").concat(o2, " nameCard:").concat(i2), M.l("".concat(c2, " ").concat(t2)), (e2 = this._grpM.getLocalGroupProfile(n2)) && Ot(e2.type) ? D({ code: e2 = L.OPERATION_NOT_SUPPORTED_IN_AV, message: this._grpM.getErrMsg(e2, r2) }) : ((a2 = new G(r2)).setMessage(t2), this.modifyGroupMemberInfo({ groupID: n2, userID: o2, nameCard: i2 }).then(function(e3) { + M.l("".concat(c2, " ok")), a2.end(); + var t3 = s2._grpM.getLocalGroupProfile(n2); + return o2 === s2._grpM.getMyUserID() && t3 && t3.setSelfNameCard(i2), C({ group: t3, member: e3 }); + }).catch(function(e3) { + return a2.setError(e3).end(), M.e("".concat(c2, " failed. error:"), e3), D(e3); + }))); + } }, { key: "setGroupMemberCustomField", value: function(e2) { + var n2, o2 = this, t2 = "setGroupMemberCustomField", i2 = "".concat(this._n, ".").concat(t2), a2 = e2.groupID, s2 = e2.userID, s2 = void 0 === s2 ? this._grpM.getMyUserID() : s2, e2 = e2.memberCustomField, r2 = "groupID:".concat(a2, " userID:").concat(s2, " memberCustomField:").concat(JSON.stringify(e2)), c2 = (M.l("".concat(i2, " ").concat(r2)), this._grpM.getLocalGroupProfile(a2)); + return c2 && Ot(c2.type) ? D({ code: c2 = L.OPERATION_NOT_SUPPORTED_IN_AV, message: this._grpM.getErrMsg(c2, t2) }) : ((n2 = new G(t2)).setMessage(r2), this.modifyGroupMemberInfo({ groupID: a2, userID: s2, memberCustomField: e2 }).then(function(e3) { + n2.end(), M.l("".concat(i2, " ok")); + var t3 = o2._grpM.getLocalGroupProfile(a2); + return C({ group: t3, member: e3 }); + }).catch(function(e3) { + return n2.setError(e3).end(), M.e("".concat(i2, " failed. error:"), e3), D(e3); + })); + } }, { key: "modifyGroupMemberInfo", value: function(t2) { + var n2 = this, o2 = t2.groupID, i2 = t2.userID, e2 = void 0; + return Gt(o2) && (o2 = Jt(e2 = o2)), this._grpM.req({ P: k.MODIFY_GRP_MBR_INFO, data: y(y({}, t2), {}, { groupID: o2, topicID: e2 }) }).then(function() { + var e3; + return n2.hasLocalGroupMember(o2, i2) ? (e3 = n2.getLocalGroupMemberInfo(o2, i2), N(t2.muteTime) || e3.updateMuteUntil(t2.muteTime), N(t2.role) || e3.updateRole(t2.role), N(t2.nameCard) || e3.updateNameCard(t2.nameCard), N(t2.memberCustomField) || e3.updateMemberCustomField(t2.memberCustomField), e3) : (e3 = n2._grpM.getLocalGroupProfile(o2)) && !Ot(e3.type) ? n2.getGroupMemberProfile({ groupID: o2, userIDList: [i2] }).then(function(e4) { + return Y(e4.data.memberList, 1)[0]; + }) : void 0; + }); + } }, { key: "markGroupMemberList", value: function(e2) { + var o2 = "".concat(this._n, ".").concat("markGroupMemberList"), t2 = e2.groupID, n2 = e2.markType, i2 = e2.enableMark, e2 = e2.userIDList, a2 = void 0 === e2 ? [] : e2, e2 = "groupID:".concat(t2, " markType:").concat(n2, " enableMark:").concat(i2, " userIDList count:").concat(a2.length), s2 = (M.l("".concat(o2, " ").concat(e2)), 2), r2 = [], i2 = (true === i2 && (s2 = 1), p(a2)), c2 = (500 < a2.length && (i2 = a2.slice(0, 500), M.w("".concat(o2, " ").concat($t(500)))), i2.forEach(function(e3) { + r2.push({ userID: e3, markType: [n2] }); + }), i2 = null, new G("markGroupMemberList")); + return c2.setMessage(e2), this._grpM.req({ P: k.MARK_AV_MBR_INFO, data: { groupID: t2, operationType: s2, memberList: r2 } }).then(function(e3) { + var e3 = e3.data.memberList, e3 = void 0 === e3 ? [] : e3, t3 = [], n3 = [], e3 = (e3.length === a2.length ? t3.push.apply(t3, p(a2)) : (e3.forEach(function(e4) { + t3.push(e4.userID); + }), a2.forEach(function(e4) { + t3.includes(e4) || n3.push(e4); + })), "success count:".concat(t3.length, " fail count:").concat(n3.length)); + return c2.setMessage(e3).end(), M.l("".concat(o2, " ok. ").concat(e3)), C({ successUserIDList: t3, failureUserIDList: n3 }); + }).catch(function(e3) { + return c2.setError(e3).end(), M.e("".concat(o2, " failed. error:"), e3), D(e3); + }); + } }, { key: "_getGroupMemberProfileAdvance", value: function(e2) { + return this._grpM.req({ P: k.GET_GRP_MBR_PROFILE, data: y(y({}, e2), {}, { memberInfoFilter: e2.memberInfoFilter || this.DEFAULT_MEMBER_INFO_FILTER }) }); + } }, { key: "_updateLocalGroupMemberMap", value: function(t2, e2) { + var n2 = this; + return O(e2) && 0 !== e2.length ? e2.map(function(e3) { + return n2.hasLocalGroupMember(t2, e3.userID) ? n2.getLocalGroupMemberInfo(t2, e3.userID).updateMember(e3) : n2.setLocalGroupMember(t2, new fi(e3)), n2.getLocalGroupMemberInfo(t2, e3.userID); + }) : []; + } }, { key: "deleteLocalGroupMembers", value: function(e2, t2) { + var n2 = this.groupMemberListMap.get(e2); + n2 && t2.forEach(function(e3) { + n2.delete(e3); + }); + } }, { key: "getLocalGroupMemberInfo", value: function(e2, t2) { + return this.groupMemberListMap.has(e2) ? this.groupMemberListMap.get(e2).get(t2) : null; + } }, { key: "setLocalGroupMember", value: function(e2, t2) { + this.groupMemberListMap.has(e2) ? this.groupMemberListMap.get(e2).set(t2.userID, t2) : (t2 = (/* @__PURE__ */ new Map()).set(t2.userID, t2), this.groupMemberListMap.set(e2, t2)); + } }, { key: "getLocalGroupMemberList", value: function(e2) { + return this.groupMemberListMap.get(e2); + } }, { key: "hasLocalGroupMember", value: function(e2, t2) { + return this.groupMemberListMap.has(e2) && this.groupMemberListMap.get(e2).has(t2); + } }, { key: "hasLocalGroupMemberMap", value: function(e2) { + return this.groupMemberListMap.has(e2); + } }, { key: "reset", value: function() { + this.groupMemberListMap.clear(); + } }]), Bi), vi = [17, 18, 20], Ii = (e(Hi, [{ key: "onNewGroupSystemNotice", value: function(e2) { + var t2 = e2.dataList, n2 = e2.isSyncingEnded, e2 = e2.isInstantMessage, t2 = (M.d("".concat(this._n, ".onReceiveSystemNotice count:").concat(t2.length)), this._assembly({ notifiesList: t2, isInstantMessage: e2 })), o2 = t2.eventDataList, t2 = t2.result; + 0 < o2.length && (this._grpM.get(11).onNewMessage({ conversationOptionsList: o2, isInstantMessage: e2 }), this._onReceivedGroupSystemNotice({ result: t2, isInstantMessage: e2 })), e2 ? 0 < t2.length && this._grpM.emitOEvt(h.MESSAGE_RECEIVED, t2) : true === n2 && this._clearGroupSystemNotice(); + } }, { key: "_assembly", value: function(e2) { + for (var t2 = e2.notifiesList, n2 = e2.isInstantMessage, o2 = null, i2 = t2.length, a2 = 0, s2 = [], r2 = { conversationID: A.CONV_SYSTEM, unreadCount: 0, type: A.CONV_SYSTEM, subType: null, lastMessage: null }, a2 = 0; a2 < i2; a2++) { + var c2 = t2[a2], u2 = c2.groupProfile, l2 = u2.communityType, u2 = u2.topicID, u2 = void 0 === u2 ? void 0 : u2, d2 = c2.elements, p2 = d2.topicIDList, p2 = void 0 === p2 ? void 0 : p2, d2 = d2.operationType; + if (!(2 !== (void 0 === l2 ? 0 : l2) || S(u2) && S(p2))) { + if (vi.includes(d2)) { + this._handleTopicSystemNotice(c2); + continue; + } + S(u2) || (c2.to = u2); + } + 15 !== c2.elements.operationType && (c2.currentUser = this._grpM.getMyUserID(), c2.conversationType = A.CONV_SYSTEM, c2.conversationID = A.CONV_SYSTEM, (o2 = new Do(c2)).setElement({ type: A.MSG_GRP_SYS_NOTICE, content: y(y({}, c2.elements), {}, { groupProfile: y({}, c2.groupProfile) }) }), o2.isSystemMessage = true, (1 === o2.sequence && 1 === o2.random || 2 === o2.sequence && 2 === o2.random) && (o2.sequence = ft(), o2.random = ft(), o2.generateMessageID(), M.l("".concat(this._n, "._assembly regenerate ID:").concat(o2.ID))), this._grpM.get(11).pushIntoNoticeResult(s2, o2)) && (n2 ? r2.unreadCount++ : o2.setIsRead(true), r2.subType = o2.conversationSubType); + } + return r2.lastMessage = s2[s2.length - 1], { eventDataList: 0 < s2.length ? [r2] : [], result: s2 }; + } }, { key: "_clearGroupSystemNotice", value: function() { + var a2 = this; + this._getPendencyList().then(function(e2) { + e2.forEach(function(e3) { + a2.pendencyMap.set("".concat(e3.from, "_").concat(e3.groupID, "_").concat(e3.to), e3); + }); + var e2 = a2._grpM.get(11).getLocalMessageList(A.CONV_SYSTEM), i2 = []; + e2.forEach(function(e3) { + var t2 = e3.payload, n2 = t2.operatorID, o2 = t2.operationType, t2 = t2.groupProfile; + 1 === o2 && (o2 = "".concat(n2, "_").concat(t2.groupID, "_").concat(t2.to), n2 = a2.pendencyMap.get(o2)) && R(n2.handled) && 0 !== n2.handled && i2.push(e3); + }), a2.deleteGroupSystemNotice({ messageList: i2 }); + }); + } }, { key: "deleteGroupSystemNotice", value: function(e2) { + var n2 = this, o2 = "".concat(this._n, ".deleteGroupSystemNotice"); + return O(e2.messageList) && 0 !== e2.messageList.length ? (M.l("".concat(o2, " ") + e2.messageList.map(function(e3) { + return e3.ID; + })), this._grpM.req({ P: k.DEL_GRP_SYSTEM_NOTICE, data: { messageListToDelete: e2.messageList.map(function(e3) { + return { from: A.CONV_SYSTEM, messageSeq: e3.clientSequence, messageRandom: e3.random }; + }) } }).then(function() { + M.l("".concat(o2, " ok")); + var t2 = n2._grpM.get(11); + return e2.messageList.forEach(function(e3) { + t2.deleteLocalMessage(e3); + }), C(); + }).catch(function(e3) { + return M.e("".concat(o2, " error:"), e3), D(e3); + })) : T(); + } }, { key: "_getPendencyList", value: function() { + var n2 = this, e2 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {}, t2 = e2.type, o2 = e2.startTime, e2 = e2.limit; + return this._grpM.req({ P: k.GET_GRP_PENDENCY, data: { type: void 0 === t2 ? void 0 : t2, startTime: void 0 === o2 ? 0 : o2, limit: void 0 === e2 ? 20 : e2, handleAccount: this._grpM.getMyUserID() } }).then(function(e3) { + var t3 = e3.data.pendencyList; + return 0 !== e3.data.nextStartTime ? n2._getPendencyList({ startTime: e3.data.nextStartTime }).then(function(e4) { + return [].concat(p(t3), p(e4)); + }) : t3; + }); + } }, { key: "getGroupApplicationList", value: function() { + var n2 = this; + return this._getPendencyList().then(function(t2) { + return n2._getPendencyList({ type: A.GRP_COMMUNITY }).then(function(e2) { + return t2.push.apply(t2, p(e2)), n2._handlePendencyResult(t2); + }).catch(function(e2) { + return n2._handlePendencyResult(t2); + }); + }); + } }, { key: "_handlePendencyResult", value: function(e2) { + var t2 = this, n2 = []; + return e2.forEach(function(e3) { + t2.pendencyMap.set("".concat(e3.from, "_").concat(e3.groupID, "_").concat(e3.to), e3), 0 === e3.handled && n2.push({ applicant: e3.from, applicantNick: e3.fromUserNickName, groupName: e3.groupName, groupID: e3.groupID, authentication: e3.authentication, messageKey: e3.time, applicationType: e3.applicationType, userID: e3.userID, note: e3.note }); + }), T({ applicationList: n2 }); + } }, { key: "_onReceivedGroupSystemNotice", value: function(e2) { + var t2 = this, n2 = e2.result; + e2.isInstantMessage && n2.forEach(function(e3) { + switch (e3.payload.operationType) { + case 1: + break; + case 2: + t2._onApplyJoinGroup(e3); + break; + case 3: + break; + case 4: + t2._onMemberKicked(e3); + break; + case 5: + t2._onGroupDismissed(e3); + break; + case 6: + break; + case 7: + t2._onInviteGroup(e3); + break; + case 8: + t2._onQuitGroup(e3); + break; + case 9: + t2._onSetManager(e3); + break; + case 10: + t2._onDeleteManager(e3); + break; + case 11: + case 12: + case 15: + break; + case 20: + t2._onMessageRemindTypeSynced(e3); + break; + case 21: + t2._grpM.onAVChatRoomMemberBanned(e3); + } + }); + } }, { key: "_onApplyJoinGroup", value: function(e2) { + var t2 = this, e2 = e2.payload.groupProfile, n2 = e2.groupID, e2 = e2.groupType, o2 = this._grpM.hasLocalGroup(n2); + M.l("".concat(this._n, "._onApplyJoinGroup groupID:").concat(n2, " groupType:").concat(e2, " hasGroup:").concat(o2)), o2 || Ot(e2) || this._grpM.getGroupProfile({ groupID: n2 }).then(function(e3) { + var e3 = e3.data.group; + e3 && (t2._grpM.updateGroupMap([e3]), e3 = !e3.isSupportTopic, t2._grpM.emitGroupListUpdate(true, e3)); + }); + } }, { key: "_onMemberKicked", value: function(e2) { + e2 = e2.payload.groupProfile.groupID; + this._grpM.hasLocalGroup(e2) && this._grpM.deleteLocalGroupAndConversation(e2); + } }, { key: "_onGroupDismissed", value: function(e2) { + var e2 = e2.payload.groupProfile.groupID, t2 = (this._grpM.hasLocalGroup(e2) && this._grpM.deleteLocalGroupAndConversation(e2), this._grpM._AVChatRoomHandler); + t2 && t2.checkJoinedAVChatRoomByID(e2) && t2.reset(e2); + } }, { key: "_onInviteGroup", value: function(e2) { + var t2 = this, n2 = e2.payload.groupProfile.groupID, e2 = this._grpM.hasLocalGroup(n2); + M.l("".concat(this._n, "._onInviteGroup groupID:").concat(n2, " hasGroup:").concat(e2)), this._grpM.getGroupProfile({ groupID: n2 }).then(function() { + t2._grpM.emitGroupListUpdate(), t2._grpM.get(11).pullMsgOnInvite("".concat(A.CONV_GROUP).concat(n2)); + }); + } }, { key: "_onQuitGroup", value: function(e2) { + var e2 = e2.payload.groupProfile, t2 = e2.groupID, e2 = e2.groupType, n2 = this._grpM.hasLocalGroup(t2); + M.l("".concat(this._n, "._onQuitGroup groupID:").concat(t2, " groupType:").concat(e2, " hasGroup:").concat(n2)), n2 && this._grpM.deleteLocalGroupAndConversation(t2); + } }, { key: "_onSetManager", value: function(e2) { + var e2 = e2.payload.groupProfile, t2 = e2.to, e2 = e2.groupID, e2 = this._grpM.getGroupMemberHandler().getLocalGroupMemberInfo(e2, t2); + e2 && e2.updateRole(A.GRP_MBR_ROLE_ADMIN); + } }, { key: "_onDeleteManager", value: function(e2) { + var e2 = e2.payload.groupProfile, t2 = e2.to, e2 = e2.groupID, e2 = this._grpM.getGroupMemberHandler().getLocalGroupMemberInfo(e2, t2); + e2 && e2.updateRole(A.GRP_MBR_ROLE_MEMBER); + } }, { key: "_onMessageRemindTypeSynced", value: function(e2) { + var t2 = e2.payload.groupProfile.groupID, e2 = e2.payload.messageRemindType; + this._grpM.get(11).onGroupMsgRemindTypeUpdated({ groupID: t2, messageRemindType: e2 }); + } }, { key: "_handleTopicSystemNotice", value: function(e2) { + var t2 = e2.groupProfile, n2 = t2.groupID, t2 = t2.topicID, e2 = e2.elements, o2 = e2.operationType, i2 = e2.topicIDList, e2 = e2.messageRemindType, a2 = this._grpM.get(10); + 17 === o2 ? a2.onTopicCreated({ groupID: n2, topicID: t2 }) : 18 === o2 ? a2.onTopicDeleted({ groupID: n2, topicIDList: i2 }) : 20 === o2 && a2.onMessageRemindTypeUpdated({ groupID: n2, topicID: t2, messageRemindType: e2 }); + } }, { key: "reset", value: function() { + this.pendencyMap.clear(); + } }]), Hi), Mi = ["relayFlag"], yi = (t(Vi, u), Xo = n(Vi), e(Vi, [{ key: "_onCloudConfig", value: function() { + var e2 = this.getCloudConfig("polling_interval"), t2 = this.getCloudConfig("polling_interval_plus"), n2 = this.getCloudConfig("polling_no_msg_count"), o2 = this.getCloudConfig("polling_simplified_msg"), i2 = this.getCloudConfig("paging_grp_count"); + M.l("".concat(this._n, "._onCloudConfig pollingInterval:").concat(e2) + " pollingIntervalPlus:".concat(t2, " pollingNoMessageCount:").concat(n2) + " pollingSimplifiedMessage:".concat(o2, " pagingGroupCount:").concat(i2)), this._AVChatRoomHandler.setPollingInterval(e2), this._AVChatRoomHandler.setPollingIntervalPlus(t2), this._AVChatRoomHandler.setPollingNoMessageCount(n2), this._AVChatRoomHandler.setPollingSimplifiedMessage(o2), this._commonGroupHandler.setPagingGroupCount(i2); + } }, { key: "onCheckTimer", value: function(e2) { + this.isLoggedIn() && (this._commonGroupHandler.onCheckTimer(e2), this._groupTipsHandler.onCheckTimer(e2)); + } }, { key: "guardForAVChatRoom", value: function(t2) { + var n2, o2 = this; + return t2.conversationType !== A.CONV_GROUP || (n2 = Gt(t2.to) ? Jt(t2.to) : t2.to, this.hasLocalGroup(n2)) ? T() : this.getGroupProfile({ groupID: n2 }).then(function(e2) { + var e2 = e2.data.group.type; + return M.l("".concat(o2._n, ".guardForAVChatRoom. groupID:").concat(n2, " type:").concat(e2)), e2 === A.GRP_AVCHATROOM ? D(new E({ code: e2 = L.MSG_SEND_FAIL_NOT_IN_AV, message: o2.getErrMsg(e2, t2.from, n2), data: { message: t2 } })) : T(); + }); + } }, { key: "checkJoinedAVChatRoomByID", value: function(e2) { + return this._AVChatRoomHandler.checkJoinedAVChatRoomByID(e2); + } }, { key: "onNewMessage", value: function(e2) { + this._commonGroupHandler.onNewMessage(e2); + } }, { key: "updateNextMessageSeq", value: function(e2) { + var n2, o2 = this; + O(e2) && (n2 = this.get(10), e2.forEach(function(e3) { + var t2 = e3.conversationID.replace(A.CONV_GROUP, ""); + Gt(t2) && n2.updateUnreadCountAndLastMsg(t2, e3.lastMessage), o2.groupMap.has(t2) && (o2.groupMap.get(t2).nextMessageSeq = e3.lastMessage.sequence + 1); + })); + } }, { key: "onNewGroupTips", value: function(e2) { + this._groupTipsHandler.onNewGroupTips(e2); + } }, { key: "onMsgRevoked", value: function(e2) { + this._commonGroupHandler.onMsgRevoked(e2, !(1 < arguments.length && void 0 !== arguments[1]) || arguments[1]); + } }, { key: "onNewGroupSystemNotice", value: function(e2) { + this._groupSystemNoticeHandler.onNewGroupSystemNotice(e2); + } }, { key: "onMsgReadNotice", value: function(e2) { + var a2 = this; + e2.dataList.forEach(function(e3) { + var i2, e3 = e3.elements.groupMessageReadNotice; + N(e3) || (i2 = a2.get(11), e3.forEach(function(e4) { + var t2 = e4.groupID, n2 = e4.topicID, n2 = void 0 === n2 ? void 0 : n2, e4 = e4.lastMessageSeq, t2 = (M.l("".concat(a2._n, ".onMsgReadNotice groupID:").concat(t2, " lastMessageSeq:").concat(e4)), "".concat(A.CONV_GROUP).concat(t2)), o2 = true; + S(n2) || (t2 = "".concat(A.CONV_GROUP).concat(n2), o2 = false), i2.updateIsReadAfterReadReport({ conversationID: t2, lastMessageSeq: e4 }), i2.updateUnreadCount(t2, o2), i2.clearGroupAtInfoList(t2, o2); + })); + }); + } }, { key: "onReadReceiptList", value: function(e2) { + var o2 = this; + M.l("".concat(this._n, ".onReadReceiptList options:"), e2), e2.dataList.forEach(function(e3) { + var t2 = e3.groupProfile, e3 = e3.elements, t2 = t2.groupID, n2 = o2.get(11), e3 = e3.readReceiptList; + n2.updateReadReceiptInfo({ groupID: t2, readReceiptList: e3 }); + }); + } }, { key: "onMsgModified", value: function(e2) { + M.l("".concat(this._n, ".onMsgModified options:"), e2); + var t2 = this.get(11); + e2.dataList.forEach(function(e3) { + t2.onMessageModified(y(y({}, e3), {}, { conversationType: A.CONV_GROUP, to: e3.topicID || e3.groupID })); + }); + } }, { key: "deleteGroupSystemNotice", value: function(e2) { + this._groupSystemNoticeHandler.deleteGroupSystemNotice(e2); + } }, { key: "initGroupMap", value: function(e2) { + this.groupMap.set(e2.groupID, new oi(e2)); + } }, { key: "clearGroupMap", value: function() { + this.groupMap.clear(); + } }, { key: "deleteGroup", value: function(e2) { + this.groupMap.delete(e2); + } }, { key: "updateGroupMap", value: function(e2) { + var t2, n2 = this, o2 = this.get(11); + e2.forEach(function(e3) { + t2 = e3.groupID, n2.groupMap.has(t2) ? n2.groupMap.get(t2).updateGroup(e3) : (n2.groupMap.set(t2, new oi(e3)), o2.deleteGroupRoamingInfo(t2)); + }); + var i2, a2 = this.getMyUserID(), s2 = Z(this.groupMap); + try { + for (s2.s(); !(i2 = s2.n()).done; ) { + var r2 = Y(i2.value, 2)[1]; + r2.selfInfo.userID = a2, "Owner" === r2.selfInfo.role && (r2.ownerID = a2); + } + } catch (e3) { + s2.e(e3); + } finally { + s2.f(); + } + } }, { key: "getGroupMap", value: function() { + return this.groupMap; + } }, { key: "getLocalGroupList", value: function() { + return p(this.groupMap.values()).filter(function(e2) { + return e2.type !== A.GRP_ROOM && e2.type !== A.GRP_LIVE; + }); + } }, { key: "getLocalGroupProfile", value: function(e2) { + return this.groupMap.get(e2); + } }, { key: "sortLocalGroupList", value: function() { + var e2 = p(this.groupMap).filter(function(e3) { + e3 = Y(e3, 2); + return e3[0], !S(e3[1].lastMessage); + }); + e2.sort(function(e3, t2) { + return t2[1].lastMessage.lastTime - e3[1].lastMessage.lastTime; + }), this.groupMap = new Map(p(e2)); + } }, { key: "updateGroupLastMessage", value: function(e2) { + this._commonGroupHandler.updateLastMsg(e2); + } }, { key: "emitGroupListUpdate", value: function() { + var e2 = !(0 < arguments.length && void 0 !== arguments[0]) || arguments[0], t2 = !(1 < arguments.length && void 0 !== arguments[1]) || arguments[1], n2 = this.getLocalGroupList(); + e2 && this.emitOEvt(h.GROUP_LIST_UPDATED), t2 && (e2 = JSON.parse(JSON.stringify(n2)), this.get(11).updateConvGroupProfile(e2)); + } }, { key: "getMyNameCardByGroupID", value: function(e2) { + e2 = this.getLocalGroupProfile(e2); + return e2 ? e2.selfInfo.nameCard : ""; + } }, { key: "isPagingGetCompleted", value: function() { + return this._commonGroupHandler.isPagingGetCompleted(); + } }, { key: "getMsgRemindType", value: function(e2) { + var n2 = this; + return !O(e2) || 0 === e2.length || 0 === (e2 = e2.filter(function(e3) { + return !Ot(n2.getLocalGroupProfile(e3).type); + })).length ? Promise.resolve() : (M.l("".concat(this._n, ".getMsgRemindType groupIDList:").concat(e2)), this.getGroupProfileAdvance({ groupIDList: e2, responseFilter: { memberInfoFilter: ["MsgFlag"] } }).then(function(e3) { + var e3 = e3.data.successGroupList, t2 = n2.get(11); + e3.forEach(function(e4) { + t2.onGroupMsgRemindTypeUpdated({ groupID: e4.groupID, messageRemindType: O(e4.members) ? e4.members[0].messageRemindType : "" }); + }); + })); + } }, { key: "getGroupList", value: function() { + return this._commonGroupHandler.getGroupList(); + } }, { key: "syncCommunityWithTopic", value: function() { + return this._commonGroupHandler.syncGroupList(true); + } }, { key: "getGroupProfile", value: function(t2) { + var n2 = this, o2 = "".concat(this._n, ".").concat("getGroupProfile"), i2 = new G("getGroupProfile"), a2 = t2.groupID, e2 = t2.groupCustomFieldFilter, e2 = (M.l("".concat(o2, " groupID:").concat(a2)), { groupIDList: [a2], responseFilter: { groupBaseInfoFilter: p(ce), groupCustomFieldFilter: e2, memberInfoFilter: [].concat(p(ue), ["NameCard"]) } }); + return this.getGroupProfileAdvance(e2).then(function(e3) { + var e3 = e3.data, t3 = e3.successGroupList, e3 = e3.failureGroupList; + return M.l("".concat(o2, " ok")), 0 < e3.length ? D(e3[0]) : ((e3 = Ot(t3[0].type) && !n2.hasLocalGroup(a2) ? new oi(t3[0]) : (n2.updateGroupMap(t3), n2.getLocalGroupProfile(a2))).isSupportTopic || n2.get(11).updateConvGroupProfile([e3]), i2.setMessage("groupID:".concat(a2, " type:").concat(e3.type, " muteAllMembers:").concat(e3.muteAllMembers, " ownerID:").concat(e3.ownerID)).end(), C({ group: e3 })); + }).catch(function(e3) { + return i2.setError(e3).setMessage("groupID:".concat(t2.groupID)).end(), M.e("".concat(o2, " failed. error:"), e3), D(e3); + }); + } }, { key: "getGroupProfileAdvance", value: function(e2) { + var t2, n2 = "".concat(this._n, ".getGroupProfileAdvance"), o2 = e2.groupIDList, i2 = (O(o2) && 50 < o2.length && (this.warn("GetGroupProfileLimit"), o2.length = 50), []), a2 = [], o2 = (o2.forEach(function(e3) { + (Nt({ groupID: e3 }) ? a2 : i2).push(e3); + }), []); + return 0 < i2.length && (t2 = this._getGroupProfileAdvance(y(y({}, e2), {}, { groupIDList: i2 })), o2.push(t2)), 0 < a2.length && (t2 = this._getGroupProfileAdvance(y(y({}, e2), {}, { groupIDList: a2, relayFlag: 0 < i2.length })), o2.push(t2)), Promise.all(o2).then(function(e3) { + var t3 = [], n3 = []; + return e3.forEach(function(e4) { + t3.push.apply(t3, p(e4.successGroupList)), n3.push.apply(n3, p(e4.failureGroupList)); + }), C({ successGroupList: t3, failureGroupList: n3 }); + }).catch(function(e3) { + return M.e("".concat(n2, " failed. error:"), e3), D(e3); + }); + } }, { key: "_getGroupProfileAdvance", value: function(t2) { + var n2 = this, e2 = t2.relayFlag, o2 = void 0 !== e2 && e2, i2 = K(t2, Mi); + return this.req({ P: k.GET_GRP_PROFILE, data: i2 }).then(function(e3) { + M.l("".concat(n2._n, "._getGroupProfileAdvance ok. options:"), i2); + e3 = e3.data.groups; + return { successGroupList: e3.filter(function(e4) { + return N(e4.errorCode) || 0 === e4.errorCode; + }), failureGroupList: e3.filter(function(e4) { + return e4.errorCode && 0 !== e4.errorCode; + }).map(function(e4) { + return new E({ code: e4.errorCode, message: e4.errorInfo, data: { groupID: e4.groupID } }); + }) }; + }).catch(function(e3) { + return o2 && Nt({ groupID: t2.groupIDList[0] }) ? { successGroupList: [], failureGroupList: [] } : D(e3); + }); + } }, { key: "createGroup", value: function(s2) { + var r2 = this, e2 = [A.GRP_PUBLIC, A.GRP_WORK, A.GRP_MEETING, A.GRP_AVCHATROOM, A.GRP_COMMUNITY], c2 = "".concat(this._n, ".").concat("createGroup"), t2 = s2.type, n2 = s2.groupID; + if (s2.name && false === this._filterProfanity("name", s2)) + return D({ code: L.PROFANITY_FOUND }); + if (s2.introduction && false === this._filterProfanity("introduction", s2)) + return D({ code: L.PROFANITY_FOUND }); + if (s2.notification && false === this._filterProfanity("notification", s2)) + return D({ code: L.PROFANITY_FOUND }); + if (!e2.includes(t2)) + return D({ code: L.ILLEGAL_GRP_TYPE }); + if (!Nt({ type: t2 })) { + if (!S(n2) && Nt({ groupID: n2 })) + return D({ code: L.ILLEGAL_GRP_ID }); + s2.isSupportTopic = void 0; + } + if (Ot(t2) && !N(s2.memberList) && 0 < s2.memberList.length && (s2.memberList = void 0), this._canIUseJoinOption(t2) || N(s2.joinOption) || (s2.joinOption = void 0), Nt({ type: t2 })) { + if (!S(n2) && !Nt({ groupID: n2 })) + return D({ code: L.ILLEGAL_GRP_ID }); + s2.isSupportTopic = true === s2.isSupportTopic ? 1 : 0; + } + var u2 = new G("createGroup"), l2 = (M.l("".concat(c2, " options:"), s2), null), d2 = []; + return this.req({ P: k.CREATE_GRP, data: y(y({}, s2), {}, { ownerID: this.getMyUserID(), webPushFlag: 1 }) }).then(function(e3) { + var t3, n3, o2, e3 = e3.data, i2 = e3.groupID, e3 = e3.overLimitUserIDList, a2 = void 0 === e3 ? [] : e3, e3 = (l2 = i2, d2 = a2, "groupType:".concat(s2.type, " groupID:").concat(i2, " overLimitUserIDList:").concat(a2)); + return u2.setMessage(e3).end(), M.l("".concat(c2, " ok. ").concat(e3)), s2.type === A.GRP_AVCHATROOM || s2.type === A.GRP_COMMUNITY && 1 === s2.isSupportTopic || (S(s2.memberList) || S(a2) || (s2.memberList = s2.memberList.filter(function(e4) { + return -1 === a2.indexOf(e4.userID); + })), r2.updateGroupMap([y(y({}, s2), {}, { groupID: i2 })]), e3 = r2.get(2), o2 = "", t3 = 0, s2.type === A.GRP_COMMUNITY ? (o2 = r2.isIntl() ? "Create Community" : "创建社群", t3 = 1) : o2 = r2.isIntl() ? "Create Group" : "创建群组", n3 = r2.get(4).getMyNick(), o2 = e3.createCustomMessage({ to: i2, conversationType: A.CONV_GROUP, payload: { data: JSON.stringify({ businessID: "group_create", content: o2, cmd: t3, opUser: n3 || r2.getMyUserID(), version: 4 }) } }), e3.sendMessageInstance(o2), r2.emitGroupListUpdate()), r2.getGroupProfile({ groupID: i2 }); + }).then(function(e3) { + var e3 = e3.data.group, t3 = e3.selfInfo, n3 = t3.nameCard, t3 = t3.joinTime; + return e3.updateSelfInfo({ nameCard: n3, joinTime: t3, messageRemindType: A.MSG_REMIND_ACPT_AND_NOTE, role: A.GRP_MBR_ROLE_OWNER }), C({ group: e3, overLimitUserIDList: d2 }); + }).catch(function(e3) { + var t3; + return u2.setMessage("groupType:".concat(s2.type)).setError(e3).end(), 10010 === e3.code || 10007 === e3.code ? (r2._silentlyGetGroupProfile(e3.code, l2), r2.updateGroupMap([y(y({}, s2), {}, { groupID: l2 })]), (t3 = r2.getLocalGroupProfile(l2)).selfInfo.role = A.GRP_MBR_ROLE_OWNER, C({ group: t3, overLimitUserIDList: d2 })) : (M.e("".concat(c2, " failed. error:"), e3), D(e3)); + }); + } }, { key: "dismissGroup", value: function(e2) { + var t2 = this, n2 = "".concat(this._n, ".").concat("dismissGroup"), o2 = "groupID:".concat(e2), i2 = new G("dismissGroup"); + return i2.setMessage(o2), M.l("".concat(n2, " ").concat(o2)), this.req({ P: k.DISMISS_GRP, data: { groupID: e2 } }).then(function() { + return i2.end(), M.l("".concat(n2, " ok")), t2.deleteLocalGroupAndConversation(e2), t2.checkJoinedAVChatRoomByID(e2) && t2._AVChatRoomHandler.reset(e2), t2._groupAttributesHandler.deleteLocalGroupAttributes(e2), C({ groupID: e2 }); + }).catch(function(e3) { + return i2.setError(e3).end(), M.e("".concat(n2, " failed. error:"), e3), D(e3); + }); + } }, { key: "updateGroupProfile", value: function(e2) { + var t2, n2, o2 = this, i2 = "".concat(this._n, ".").concat("updateGroupProfile"); + return this.hasLocalGroup(e2.groupID) && (t2 = this.getLocalGroupProfile(e2.groupID).type, this._canIUseJoinOption(t2) || N(e2.joinOption) || (M.w("".concat(i2, " joinOption is unavailable for Work/Meeting/AVChatRoom")), e2.joinOption = void 0)), N(e2.muteAllMembers) || (e2.muteAllMembers ? e2.muteAllMembers = "On" : e2.muteAllMembers = "Off"), e2.name && false === this._filterProfanity("name", e2) || e2.introduction && false === this._filterProfanity("introduction", e2) || e2.notification && false === this._filterProfanity("notification", e2) ? D({ code: L.PROFANITY_FOUND }) : ((n2 = new G("updateGroupProfile")).setMessage(JSON.stringify(e2)), M.l("".concat(i2, " groupID:").concat(e2.groupID)), this.req({ P: k.UPDATE_GRP_PROFILE, data: e2 }).then(function() { + return n2.end(), M.l("".concat(i2, " ok")), o2.hasLocalGroup(e2.groupID) && o2.groupMap.get(e2.groupID).updateGroup(e2), C({ group: o2.groupMap.get(e2.groupID) }); + }).catch(function(e3) { + return n2.setError(e3).end(), M.l("".concat(i2, " failed. error:"), e3), D(e3); + })); + } }, { key: "_filterProfanity", value: function(e2, t2) { + var n2, o2 = this.get(29); + return !o2 || (n2 = (o2 = o2.filterText(t2[e2], re)).isAllowedToSend, o2 = o2.modifiedText, true === n2 && (t2[e2] = o2, true)); + } }, { key: "joinGroup", value: function(t2) { + var n2, o2 = this, i2 = t2.groupID, a2 = "".concat(this._n, ".joinGroup"); + return this.deleteUnjoinedAVChatRoom(i2), this.hasLocalGroup(i2) ? this.isLoggedIn() ? (n2 = new G("applyJoinGroup"), this.getGroupProfile({ groupID: i2 }).then(function() { + return n2.setMessage("groupID:".concat(i2, " joinedStatus:").concat(A.JOIN_STATUS_ALREADY_IN_GROUP)).end(), T({ status: A.JOIN_STATUS_ALREADY_IN_GROUP }); + }).catch(function(e2) { + return n2.setMessage("groupID:".concat(i2, " unjoined")).end(), M.w("".concat(a2, " ").concat(i2, " was unjoined, now join!")), o2.groupMap.delete(i2), o2.applyJoinGroup(t2); + })) : T({ status: A.JOIN_STATUS_ALREADY_IN_GROUP }) : (M.l("".concat(a2, " groupID:").concat(i2)), this.isLoggedIn() ? this.applyJoinGroup(t2) : this._AVChatRoomHandler.joinWithoutAuth(t2)); + } }, { key: "applyJoinGroup", value: function(e2) { + var c2, u2, l2 = this, d2 = "".concat(this._n, ".").concat("applyJoinGroup"), p2 = e2.groupID; + return S(e2.applyMessage) || false !== this._filterProfanity("applyMessage", e2) ? (c2 = new G("applyJoinGroup"), e2 = y({}, e2), (u2 = this.canIUse(_.AV_HISTORY_MSG)) && (e2.historyMessageFlag = 1), this.get(11).deleteTopicRoamingInfo(p2), this.req({ P: k.APPLY_JOIN_GRP, data: e2 }).then(function(e3) { + var e3 = e3.data, t2 = e3.joinedStatus, n2 = e3.longPollingKey, o2 = e3.startSeq, i2 = e3.avChatRoomFlag, a2 = e3.avChatRoomKey, s2 = e3.messageList, e3 = "groupID:".concat(p2, " joinedStatus:").concat(t2, " longPollingKey:").concat(n2, " startSeq:").concat(o2) + " avChatRoomFlag:".concat(i2, " canGetAVChatRoomHistoryMsg:").concat(u2, ",") + " historyMsgCount:".concat(S(s2) ? 0 : s2.length); + switch (c2.setMessage(e3).end(), M.l("".concat(d2, " ok. ").concat(e3)), t2) { + case ot: + return C({ status: ot }); + case nt: + return l2.getGroupProfile({ groupID: p2 }).then(function(e4) { + e4 = e4.data.group; + return l2._handleJoinResult({ group: e4, avChatRoomFlag: i2, longPollingKey: n2, startSeq: o2, avChatRoomKey: a2, messageList: s2 }); + }).catch(function(e4) { + var t3; + return 10010 === e4.code || 10007 === e4.code ? (l2._silentlyGetGroupProfile(e4.code, p2), t3 = new oi({ groupID: p2 }), l2.updateGroupMap([t3]), l2._handleJoinResult({ group: t3, avChatRoomFlag: i2, longPollingKey: n2, startSeq: o2, avChatRoomKey: a2, messageList: s2 })) : (M.e("".concat(d2, " failed. error:"), e4), D(e4)); + }); + default: + var r2 = new E({ code: L.JOIN_GRP_FAIL }); + return M.e("".concat(d2, " failed. error:"), r2), D(r2); + } + }).catch(function(e3) { + return c2.setMessage("groupID:".concat(p2)).setError(e3).end(), M.e("".concat(d2, " failed. error:"), e3), D(e3); + })) : D({ code: L.PROFANITY_FOUND }); + } }, { key: "_handleJoinResult", value: function(e2) { + var t2 = this, n2 = e2.group, o2 = e2.avChatRoomFlag, i2 = e2.longPollingKey, a2 = e2.startSeq, s2 = e2.avChatRoomKey, r2 = e2.messageList, c2 = n2.groupID; + return 1 === o2 ? (this.get(11).setCompleted("".concat(A.CONV_GROUP).concat(c2)), this._groupAttributesHandler.initGroupAttributesCache({ groupID: c2, avChatRoomKey: s2 }), this._groupCountersHandler.initGroupCountersCache({ groupID: c2, avChatRoomKey: s2 }), (e2 = N(i2) ? this._AVChatRoomHandler.handleJoinResult({ group: n2 }) : this._AVChatRoomHandler.startRunLoop({ group: n2, longPollingKey: i2, startSeq: a2 })).then(function() { + t2._onAVChatRoomHistoryMessage(r2, c2); + }), e2) : (this.emitGroupListUpdate(true, false), C({ status: nt, group: n2 })); + } }, { key: "quitGroup", value: function(e2) { + var t2, n2 = this, o2 = "".concat(this._n, ".").concat("quitGroup"), i2 = "groupID:".concat(e2), a2 = (M.l("".concat(o2, " ").concat(i2)), this.checkJoinedAVChatRoomByID(e2)); + return a2 || this.hasLocalGroup(e2) ? a2 && !this.isLoggedIn() ? (M.l("".concat(o2, " anonymously ok. ").concat(i2)), this.deleteLocalGroupAndConversation(e2), this._AVChatRoomHandler.reset(e2), T({ groupID: e2 })) : ((t2 = new G("quitGroup")).setMessage(i2), this.req({ P: k.QUIT_GRP, data: { groupID: e2 } }).then(function() { + return t2.end(), M.l("".concat(o2, " ok")), n2.deleteLocalGroupAndConversation(e2), a2 && n2._AVChatRoomHandler.reset(e2), n2._groupAttributesHandler.deleteLocalGroupAttributes(e2), C({ groupID: e2 }); + }).catch(function(e3) { + return t2.setError(e3).end(), M.e("".concat(o2, " failed. error:"), e3), D(e3); + })) : D({ code: L.MEMBER_NOT_IN_GRP }); + } }, { key: "searchGroupByID", value: function(e2) { + var t2 = "".concat(this._n, ".").concat("searchGroupByID"), n2 = { groupIDList: [e2] }, o2 = new G("searchGroupByID"); + return o2.setMessage("groupID:".concat(e2)), M.l("".concat(t2, " groupID:").concat(e2)), this.req({ P: k.SEARCH_GRP, data: n2 }).then(function(e3) { + e3 = e3.data.groupProfile; + if (0 !== e3[0].errorCode) + throw new E({ code: e3[0].errorCode, message: e3[0].errorInfo }); + return o2.end(), M.l("".concat(t2, " ok")), C({ group: new oi(e3[0]) }); + }).catch(function(e3) { + return o2.setError(e3).end(), M.w("".concat(t2, " failed. error:"), e3), D(e3); + }); + } }, { key: "changeGroupOwner", value: function(i2) { + var a2, s2 = this, r2 = "".concat(this._n, ".").concat("changeGroupOwner"); + return this.hasLocalGroup(i2.groupID) && this.getLocalGroupProfile(i2.groupID).type === A.GRP_AVCHATROOM ? D({ code: L.CANNOT_CHANGE_OWNER_IN_AV }) : i2.newOwnerID === this.getMyUserID() ? D({ code: L.CANNOT_CHANGE_OWNER_TO_SELF }) : ((a2 = new G("changeGroupOwner")).setMessage("groupID:".concat(i2.groupID, " newOwnerID:").concat(i2.newOwnerID)), M.l("".concat(r2, " groupID:").concat(i2.groupID)), this.req({ P: k.CHANGE_GRP_OWNER, data: i2 }).then(function() { + a2.end(), M.l("".concat(r2, " ok")); + var e2, t2 = i2.groupID, n2 = i2.newOwnerID, o2 = (s2.groupMap.get(t2).ownerID = n2, s2._groupMemberHandler.getLocalGroupMemberList(t2)); + return o2 instanceof Map && (e2 = o2.get(s2.getMyUserID()), N(e2) || (e2.updateRole("Member"), s2.groupMap.get(t2).selfInfo.role = "Member"), e2 = o2.get(n2), N(e2) || e2.updateRole("Owner")), s2.emitGroupListUpdate(true, false), C({ group: s2.groupMap.get(t2) }); + }).catch(function(e2) { + return a2.setError(e2).end(), M.e("".concat(r2, " failed. error:"), e2), D(e2); + })); + } }, { key: "getGroupApplicationList", value: function() { + return this._groupSystemNoticeHandler.getGroupApplicationList(); + } }, { key: "handleGroupApplication", value: function(e2) { + var t2, n2, o2, i2, a2, s2 = this, r2 = "".concat(this._n, ".").concat("handleGroupApplication"), c2 = e2.handleAction, u2 = e2.handleMessage, l2 = e2.message, d2 = e2.application, p2 = (l2 ? (t2 = l2.payload.operatorID, n2 = l2.payload.groupProfile.groupID, o2 = l2.payload.authentication, i2 = l2.payload.messageKey) : d2 && (t2 = d2.applicant, n2 = d2.groupID, o2 = d2.authentication, i2 = d2.messageKey), k.HANDLE_GRP_APPLICATION), _2 = (d2 && 2 === d2.applicationType && (p2 = k.HANDLE_INVITE_JOIN_GRP, a2 = d2.userID), new G("handleGroupApplication")); + return _2.setMessage("groupID:".concat(n2)), M.l("".concat(r2, " groupID:").concat(n2)), this.req({ P: p2, data: { handleAction: c2, handleMessage: u2, applicant: t2, invitee: a2, groupID: n2, authentication: o2, messageKey: i2 } }).then(function() { + return _2.end(), M.l("".concat(r2, " ok")), l2 && s2._groupSystemNoticeHandler.deleteGroupSystemNotice({ messageList: [e2.message] }), C({ group: s2.getLocalGroupProfile(n2) }); + }).catch(function(e3) { + return _2.setError(e3).end(), M.e("".concat(r2, " failed. error"), e3), D(e3); + }); + } }, { key: "handleGroupInvitation", value: function(e2) { + var t2 = this, n2 = "".concat(this._n, ".").concat("handleGroupInvitation"), o2 = e2.message.payload, i2 = o2.groupProfile.groupID, a2 = o2.authentication, s2 = o2.messageKey, o2 = o2.operatorID, r2 = e2.handleAction, c2 = new G("handleGroupInvitation"); + return c2.setMessage("groupID:".concat(i2, " inviter:").concat(o2, " handleAction:").concat(r2)), M.l("".concat(n2, " groupID:").concat(i2, " inviter:").concat(o2, " handleAction:").concat(r2)), this.req({ P: k.HANDLE_GRP_INVITATION, data: y(y({}, e2), {}, { inviter: o2, groupID: i2, authentication: a2, messageKey: s2 }) }).then(function() { + return c2.end(), M.l("".concat(n2, " ok")), t2._groupSystemNoticeHandler.deleteGroupSystemNotice({ messageList: [e2.message] }), C({ group: t2.getLocalGroupProfile(i2) }); + }).catch(function(e3) { + return c2.setError(e3).end(), M.e("".concat(n2, " failed. error"), e3), D(e3); + }); + } }, { key: "getGroupOnlineMemberCount", value: function(t2) { + var n2 = this, o2 = "".concat(this._n, ".getGroupOnlineMemberCount"), e2 = this._AVChatRoomHandler.checkJoinedAVChatRoomByID(t2), i2 = this.hasLocalGroup(t2); + if (M.l("".concat(o2, " groupID:").concat(t2, " isAVChatRoom:").concat(e2, " has:").concat(i2)), e2) + return this._AVChatRoomHandler.getGroupOnlineMemberCount(t2); + if (!i2) + return T({ memberCount: 0 }); + e2 = Date.now(); + if (this._onlineMemberCountMap.has(t2)) { + i2 = this._onlineMemberCountMap.get(t2); + if (e2 - i2.lastReqTime <= 6e4) + return T({ memberCount: i2.memberCount }); + i2.lastReqTime = e2; + } + return this.requestOnlineCount(t2).then(function(e3) { + e3 = e3.data.memberCount, e3 = void 0 === e3 ? 0 : e3; + return n2._onlineMemberCountMap.set(t2, { lastReqTime: Date.now(), memberCount: e3 }), M.l("".concat(o2, " ok. groupID:").concat(t2, " memberCount:").concat(e3)), T({ memberCount: e3 }); + }).catch(function(e3) { + return M.w("".concat(o2, " failed. error:"), e3), Promise.reject(e3); + }); + } }, { key: "requestOnlineCount", value: function(e2) { + return this.req({ P: k.GET_ONLINE_MBR_NUM, data: { groupID: e2 } }); + } }, { key: "hasLocalGroup", value: function(e2) { + return this.groupMap.has(e2); + } }, { key: "deleteLocalGroupAndConversation", value: function(e2) { + var t2 = this.checkJoinedAVChatRoomByID(e2), n2 = (M.l("".concat(this._n, ".deleteLocalGroupAndConversation groupID:").concat(e2, " isJoinedAVChatRoom:").concat(t2)), this.get(11)), o2 = "".concat(A.CONV_GROUP).concat(e2); + t2 && (this.stopMessageLongPolling({ groupID: e2 }), n2.deleteLocalConv(o2)), Nt({ groupID: e2 }) && (t2 = this.getLocalGroupProfile(e2)) && true === t2.isSupportTopic && this.get(10).deleteTopicListInCommunity(e2), n2.clearUnreadCount(o2), n2.setCompleted(o2), this._deleteLocalGroup(e2), this._onlineMemberCountMap.delete(e2), this.emitGroupListUpdate(true, false); + } }, { key: "_deleteLocalGroup", value: function(e2) { + this.groupMap.delete(e2), this._groupMemberHandler.deleteGroupMemberList(e2); + } }, { key: "sendMessage", value: function(e2, t2) { + return O(e2._receiverList) && 0 < e2._receiverList.length && !this.canIUse(_.MSG_TO_SPECIFIED_GRP_MBR) ? this.noUse("Targeted Group Message") : (e2 = this.createGroupMessagePack(e2, t2), this.req(e2)); + } }, { key: "createGroupMessagePack", value: function(e2, t2) { + var n2 = null, o2 = (t2 && t2.offlinePushInfo && (n2 = t2.offlinePushInfo), ""), i2 = (m(e2.cloudCustomData) && 0 < e2.cloudCustomData.length && (o2 = e2.cloudCustomData), []), a2 = (f(t2) && f(t2.messageControlInfo) && (a2 = (r2 = t2.messageControlInfo).excludedFromUnreadCount, s2 = r2.excludedFromLastMessage, r2 = r2.excludedFromContentModeration, true === a2 && i2.push("NoUnread"), true === s2 && i2.push("NoLastMsg"), true === r2) && i2.push("NoMsgCheck"), void 0), s2 = (O(e2._receiverList) && 0 < e2._receiverList.length && (a2 = e2._receiverList, 50 < e2._receiverList.length) && (a2 = e2._receiverList.slice(0, 50), this.warn("ReceiverListLimit")), this.isOnlineMessage(e2, t2) ? 1 : 0), r2 = JSON.parse(JSON.stringify(e2.getElements())), t2 = this.get(17).getFileDNList(), c2 = e2.getGroupAtInfoList(), r2 = { fromAccount: this.getMyUserID(), groupID: e2.to, msgBody: so(e2.type, r2, t2), cloudCustomData: o2, random: e2.random, priority: e2.priority, clientSequence: e2.clientSequence, groupAtInfo: e2.type !== A.MSG_TEXT || S(c2) ? void 0 : c2, onlineOnlyFlag: s2, clientTime: e2.clientTime, offlinePushInfo: wo(n2), messageControlInfo: 0 == s2 ? i2 : void 0, needReadReceipt: true !== e2.needReadReceipt || this.isMessageFromOrToAVChatroom(e2.to) ? 0 : 1, receiverList: a2, isSupportExtension: true === e2.isSupportExtension ? 1 : 0, isRelayMessage: true === e2._relayFlag ? 1 : 0, cmConfigID: e2._cmConfigID }; + return Gt(e2.to) && (r2.groupID = Jt(e2.to), r2.topicID = e2.to), { P: k.SEND_GRP_MSG, data: r2 }; + } }, { key: "revokeMessage", value: function(e2) { + var t2 = { groupID: e2.to, msgSeqList: [{ msgSeq: e2.sequence }] }; + return Gt(e2.to) && (t2.groupID = Jt(e2.to), t2.topicID = e2.to), this.req({ P: k.REVOKE_GRP_MSG, data: t2 }); + } }, { key: "deleteMessage", value: function(e2) { + var t2 = e2.to, e2 = e2.keyList, e2 = (M.l("".concat(this._n, ".deleteMessage groupID:").concat(t2, " count:").concat(e2.length)), { groupID: t2, deleter: this.getMyUserID(), keyList: e2 }); + return Gt(t2) && (e2.groupID = Jt(t2), e2.topicID = t2), this.req({ P: k.DEL_GRP_MSG, data: e2 }); + } }, { key: "modifyRemoteMessage", value: function(e2) { + var t2 = e2.to, n2 = e2.sequence, o2 = e2.payload, i2 = e2.type, a2 = e2.version, a2 = void 0 === a2 ? 0 : a2, s2 = e2.cloudCustomData, e2 = e2._elements, r2 = t2, c2 = void 0, t2 = (Gt(t2) && (r2 = Jt(t2), c2 = t2), void 0); + return Xt(i2) && (1 < e2.length && e2.splice(0, 1, { type: i2, content: o2 }), t2 = e2), this.req({ P: k.MODIFY_GRP_MSG, data: { groupID: r2, topicID: c2, sequence: n2, version: a2, elements: t2, cloudCustomData: s2 } }); + } }, { key: "getRoamingMessage", value: function(e2) { + var r2 = this, c2 = "".concat(this._n, ".").concat("getRoamingMessage"), u2 = e2.conversationID, l2 = e2.groupID, e2 = e2.sequence, d2 = new G("getRoamingMessage"), p2 = 0, _2 = void 0; + return Gt(l2) && (l2 = Jt(_2 = l2)), this._computeLastSequence({ groupID: l2, topicID: _2, sequence: e2 }).then(function(e3) { + return p2 = e3, M.l("".concat(c2, " groupID:").concat(l2, " startSequence:").concat(p2)), r2.req({ P: k.GET_GRP_ROAMING_MSG, data: { groupID: l2, count: 21, sequence: p2, topicID: _2 } }); + }).then(function(e3) { + var t2 = e3.data, n2 = t2.messageList, o2 = t2.complete, t2 = t2.invisibleSequenceList, t2 = void 0 === t2 ? [] : t2, e3 = e3.data.nextSequence, e3 = void 0 === e3 ? 0 : e3, i2 = (N(n2) ? M.l("".concat(c2, " ok. complete:").concat(o2, " nextSequence:").concat(e3, " but messageList is undefined!")) : M.l("".concat(c2, " ok. complete:").concat(o2, " nextSequence:").concat(e3, " count:").concat(n2.length)), d2.setMessage("groupID:".concat(l2, " topicID:").concat(_2, " startSequence:").concat(p2, " complete:").concat(o2, " nextSequence:").concat(e3)).end(), r2.get(11)), a2 = [], s2 = [], n2 = (S(n2) || (a2 = i2.onRoamingMessage(n2, u2, true, s2), i2.updateIsRead(u2), i2.patchConvLastMessage(u2)), 2 === o2 || e3 < 1); + return n2 && (i2.setCompleted(u2), e3 = ""), M.l("".concat(c2, " isPullingCompleted:").concat(n2, " nextReqID:").concat(e3, " storedMsgCount:").concat(a2.length) + " invisibleSeqCount:".concat(t2.length)), { nextReqID: e3 + "", storedMessageList: a2, assembledMessageList: s2, isPullingCompleted: n2 }; + }).catch(function(e3) { + return d2.setError(e3).setMessage("groupID:".concat(l2, " topicID:").concat(_2, " startSequence:").concat(p2)).end(), M.w("".concat(c2, " failed. error:"), e3), D(e3); + }); + } }, { key: "_getGroupIDOfMessage", value: function(e2) { + return e2.conversationID.replace(A.CONV_GROUP, ""); + } }, { key: "getReadReceiptList", value: function(n2) { + var t2, o2 = "".concat(this._n, ".").concat("getReadReceiptList"), e2 = this._getGroupIDOfMessage(n2[0]), i2 = this.getMyUserID(), a2 = n2.filter(function(e3) { + return e3.from === i2 && true === e3.needReadReceipt; + }).map(function(e3) { + return { sequence: e3.sequence }; + }); + return M.l("".concat(o2, " groupID:").concat(e2, " sequenceList:").concat(JSON.stringify(a2))), 0 === a2.length ? T({ messageList: n2 }) : ((t2 = new G("getReadReceiptList")).setMessage("groupID:".concat(e2)), this.req({ P: k.GET_READ_RECEIPT, data: { groupID: e2, sequenceList: a2 } }).then(function(e3) { + t2.end(), M.l("".concat(o2, " ok")); + e3 = e3.data.readReceiptList; + return O(e3) && e3.forEach(function(t3) { + n2.forEach(function(e4) { + 0 === t3.code && t3.sequence === e4.sequence && (e4.readReceiptInfo.readCount = t3.readCount, e4.readReceiptInfo.unreadCount = t3.unreadCount); + }); + }), C({ messageList: n2 }); + }).catch(function(e3) { + return t2.setError(e3).end(), M.w("".concat(o2, " failed. error:"), e3), D(e3); + })); + } }, { key: "sendReadReceipt", value: function(e2) { + var t2 = "".concat(this._n, ".").concat("sendReadReceipt"), n2 = this._getGroupIDOfMessage(e2[0]), o2 = new G("sendReadReceipt"), i2 = (o2.setMessage("groupID:".concat(n2)), this.getMyUserID()), e2 = e2.filter(function(e3) { + return e3.from !== i2 && true === e3.needReadReceipt; + }).map(function(e3) { + return { sequence: e3.sequence }; + }); + return 0 === e2.length ? D({ code: L.READ_RECEIPT_MSG_LIST_EMPTY }) : (M.l("".concat(t2, ". sequenceList:").concat(JSON.stringify(e2))), this.req({ P: k.SEND_READ_RECEIPT, data: { groupID: n2, sequenceList: e2 } }).then(function(e3) { + return o2.end(), M.l("".concat(t2, " ok")), C(); + }).catch(function(e3) { + return o2.setError(e3).end(), M.w("".concat(t2, " failed. error:"), e3), D(e3); + })); + } }, { key: "getReadReceiptDetail", value: function(e2) { + var i2 = this, t2 = e2.message, n2 = e2.filter, o2 = e2.cursor, e2 = e2.count, a2 = this._getGroupIDOfMessage(t2), s2 = t2.ID, t2 = t2.sequence, r2 = "".concat(this._n, ".").concat("getReadReceiptDetail"), c2 = this._receiptDetailCompleteMap.get(s2) || false, u2 = 0 !== n2 && 1 !== n2 ? 0 : n2, n2 = m(o2) ? o2 : "", o2 = !R(e2) || e2 <= 0 || 100 <= e2 ? 100 : e2, e2 = "groupID:".concat(a2, " sequence:").concat(t2, " cursor:").concat(n2, " filter:").concat(u2, " completeFlag:").concat(c2), l2 = (M.l("".concat(r2, " ").concat(e2)), { cursor: "", isCompleted: false, messageID: s2, unreadUserIDList: [], readUserIDList: [] }), d2 = new G("getReadReceiptDetail"); + return d2.setMessage(e2), this.req({ P: k.GET_READ_RECEIPT_DETAIL, data: { groupID: a2, sequence: t2, flag: u2, cursor: n2, count: o2 } }).then(function(e3) { + d2.end(); + var e3 = e3.data, t3 = e3.cursor, n3 = e3.isCompleted, o3 = e3.unreadUserIDList, e3 = e3.readUserIDList; + return l2.cursor = t3, 1 === n3 && (l2.isCompleted = true, i2._receiptDetailCompleteMap.set(s2, true)), 0 === u2 ? l2.readUserIDList = e3.map(function(e4) { + return e4.userID; + }) : 1 === u2 && (l2.unreadUserIDList = o3.map(function(e4) { + return e4.userID; + })), M.l("".concat(r2, " ok")), C(l2); + }).catch(function(e3) { + return d2.setError(e3).end(), M.w("".concat(r2, " failed. error:"), e3), D(e3); + }); + } }, { key: "getRoamingMessagesHopping", value: function(c2) { + var u2 = this, l2 = "".concat(this._n, ".").concat("getRoamingMessagesHopping"), t2 = c2.groupID, n2 = c2.count, d2 = c2.sequence, p2 = c2.direction, o2 = void 0; + return N(d2) && 1 === p2 ? T({ messageList: [], isCompleted: true, nextMessageSeq: "" }) : (Gt(t2) && (t2 = Jt(o2 = t2)), this._computeReqSeqHopping({ groupID: t2, topicID: o2, sequence: d2 }).then(function(e2) { + N(d2) || 1 !== p2 || (e2 = d2 + n2 - 1); + var s2 = "".concat(o2 ? "topicID:".concat(o2) : "groupID:".concat(t2), " sequence:").concat(d2, " reqSeq:").concat(e2, " direction:").concat(p2), r2 = (M.l("".concat(l2, " ").concat(s2)), new G("getRoamingMessagesHopping")); + return u2.req({ P: k.GET_GRP_ROAMING_MSG, data: { groupID: t2, topicID: o2, count: n2, sequence: e2 } }).then(function(e3) { + var e3 = e3.data, t3 = e3.messageList, t3 = void 0 === t3 ? [] : t3, n3 = e3.complete, o3 = e3.nextSequence, o3 = void 0 === o3 ? 0 : o3, e3 = e3.invisibleSequenceList, e3 = void 0 === e3 ? [] : e3, i2 = "complete:".concat(n3, " nextSequence:").concat(o3, " remoteMsgCount:").concat(t3.length, " invisibleSequenceList:").concat(e3), i2 = (r2.setMessage("".concat(s2, " ").concat(i2)).end(), M.l("".concat(l2, " ok. ").concat(i2)), "".concat(A.CONV_GROUP).concat(c2.groupID)), a2 = u2.get(11), i2 = a2.onRoamingMessage(t3, i2, false), t3 = u2._computeResult({ groupID: c2.groupID, direction: p2, sequence: d2, remoteMessageList: t3, processedMessageList: i2, complete: n3, nextSequence: o3, invisibleSequenceList: e3 }); + return a2.storeHoppingMessageList(t3.messageList), C(t3); + }).catch(function(e3) { + return r2.setError(e3).setMessage("groupID:".concat(t2, " sequence:").concat(d2, " count:").concat(n2)).end(), M.w("".concat(l2, " failed. error:"), e3), D(e3); + }); + })); + } }, { key: "_computeReqSeqHopping", value: function(e2) { + var n2 = this, o2 = e2.groupID, t2 = e2.topicID, t2 = void 0 === t2 ? void 0 : t2, e2 = e2.sequence, e2 = void 0 === e2 ? void 0 : e2; + return 0 < e2 ? Promise.resolve(e2) : N(t2) ? this.getGroupProfileAdvance({ groupIDList: [o2], responseFilter: { groupBaseInfoFilter: ["NextMsgSeq"] } }).then(function(e3) { + var e3 = e3.data.successGroupList, t3 = 0; + return S(e3) || (t3 = e3[0].nextMessageSeq - 1), M.l("".concat(n2._n, "._computeReqSeqHopping groupID:").concat(o2, " lastSequence:").concat(t3, " from remote")), t3; + }).catch(function(e3) { + return D(e3); + }) : Promise.resolve(0); + } }, { key: "_computeResult", value: function(e2) { + var t2 = { messageList: [], isCompleted: false, nextMessageSeq: "" }, n2 = e2.groupID, o2 = e2.direction, i2 = e2.sequence, a2 = e2.remoteMessageList, a2 = void 0 === a2 ? [] : a2, s2 = e2.processedMessageList, s2 = void 0 === s2 ? [] : s2, r2 = e2.complete, c2 = e2.nextSequence, e2 = e2.invisibleSequenceList; + if (0 === o2) + return t2.nextMessageSeq = c2, (2 === r2 || c2 < 1) && (t2.isCompleted = true, t2.nextMessageSeq = ""), t2.messageList = s2, t2; + if (1 === o2) { + if (S(a2)) { + if (S(e2)) + return t2.isCompleted = true, t2.nextMessageSeq = "", t2; + t2.nextMessageSeq = e2[0] + 1; + } else { + r2 = a2[0].sequence, c2 = e2[0] || 0; + t2.nextMessageSeq = c2 < r2 ? r2 + 1 : c2 + 1; + } + return s2.forEach(function(e3) { + e3.sequence >= i2 && t2.messageList.push(e3); + }), (Nt({ groupID: n2 }) || Gt(n2)) && 0 === t2.messageList.length && a2[0].sequence < i2 && (t2.isCompleted = true, t2.nextMessageSeq = ""), t2; + } + } }, { key: "setMessageRead", value: function(e2) { + var o2 = this, i2 = e2.conversationID, a2 = e2.lastMessageSeq, s2 = "".concat(this._n, ".").concat("setMessageRead"), e2 = "convID:".concat(i2, " lastMessageSeq:").concat(a2), r2 = (M.l("".concat(s2, " ").concat(e2)), R(a2) || this.warn("DoNotModifyLastSeq"), new G("setMessageRead")), c2 = (r2.setMessage(e2), i2.replace(A.CONV_GROUP, "")), u2 = void 0; + return Gt(c2) && (c2 = Jt(u2 = c2)), this.req({ P: k.SET_GRP_MSG_READ, data: { groupID: c2, topicID: u2, messageReadSeq: a2 } }).then(function() { + r2.end(), M.l("".concat(s2, " ok")); + var e3, t2 = o2.get(11), n2 = (t2.updateIsReadAfterReadReport({ conversationID: i2, lastMessageSeq: a2 }), true); + return !N(u2) && (n2 = false, e3 = o2.get(10).getLocalTopic(c2, u2)) && e3.updateSelfInfo({ readedSequence: a2 }), t2.updateUnreadCount(i2, n2), C(); + }).catch(function(e3) { + return r2.setError(e3).end(), M.l("".concat(s2, " failed. error:"), e3), D(e3); + }); + } }, { key: "_computeLastSequence", value: function(e2) { + var t2 = e2.groupID, n2 = e2.topicID, n2 = void 0 === n2 ? void 0 : n2, e2 = e2.sequence; + return 0 < e2 ? Promise.resolve(e2) : N(n2) ? this.getGroupLastSequence(t2) : Promise.resolve(0); + } }, { key: "getGroupLastSequence", value: function(e2) { + var t2 = "".concat(this._n, ".").concat("getGroupLastSequence"), n2 = new G("getGroupLastSequence"), o2 = 0, i2 = "", a2 = "groupID:".concat(e2); + if (this.hasLocalGroup(e2)) { + var s2 = this.getLocalGroupProfile(e2), r2 = s2.lastMessage; + if (0 < r2.lastSequence && false === r2.onlineOnlyFlag) + return o2 = r2.lastSequence, i2 = "".concat(a2, ", ").concat(o2, " from group.lastMessage.lastSequence"), M.l("".concat(t2, " ").concat(i2)), n2.setMessage(i2).end(), Promise.resolve(o2); + if (1 < s2.nextMessageSeq) + return o2 = s2.nextMessageSeq - 1, i2 = "".concat(a2, ", ").concat(o2, " from group.nextMessageSeq"), M.l("".concat(t2, " ").concat(i2)), n2.setMessage(i2).end(), Promise.resolve(o2); + } + r2 = this.get(11).getLocalConversation("GROUP".concat(e2)); + return r2 && r2.lastMessage.lastSequence && false === r2.lastMessage.onlineOnlyFlag ? (o2 = r2.lastMessage.lastSequence, i2 = "".concat(a2, ", ").concat(o2, " from conversation.lastMessage.lastSequence"), M.l("".concat(t2, " ").concat(i2)), n2.setMessage(i2).end(), Promise.resolve(o2)) : this.getGroupProfileAdvance({ groupIDList: [e2], responseFilter: { groupBaseInfoFilter: ["NextMsgSeq"] } }).then(function(e3) { + e3 = e3.data.successGroupList; + return S(e3) ? M.w("".concat(t2, " ").concat(a2, ", empty successGroupList")) : (o2 = e3[0].nextMessageSeq - 1, i2 = "".concat(a2, ", ").concat(o2, " from remote"), M.l("".concat(t2, " ").concat(i2))), n2.setMessage(i2).end(), o2; + }).catch(function(e3) { + return n2.setError(e3).setMessage(a2).end(), M.w("".concat(t2, " failed. error:"), e3), D(e3); + }); + } }, { key: "isMessageFromOrToAVChatroom", value: function(e2) { + return this._AVChatRoomHandler.checkJoinedAVChatRoomByID(e2); + } }, { key: "hasJoinedAVChatRoom", value: function() { + return this._AVChatRoomHandler.hasJoinedAVChatRoom(); + } }, { key: "getJoinedAVChatRoom", value: function() { + return this._AVChatRoomHandler.getJoinedAVChatRoom(); + } }, { key: "getGroupRemoteLastSeq", value: function(e2) { + e2 = this.getLocalGroupProfile(e2); + return e2 ? e2.nextMessageSeq - 1 : 1; + } }, { key: "isOnlineMessage", value: function(e2, t2) { + return !(!this._canIUseOnlineOnlyFlag(e2) || !t2 || true !== t2.onlineUserOnly); + } }, { key: "_canIUseOnlineOnlyFlag", value: function(e2) { + var t2 = this.getJoinedAVChatRoom(); + return !t2 || !t2.includes(e2.to) || e2.conversationType !== A.CONV_GROUP; + } }, { key: "_onAVChatRoomHistoryMessage", value: function(e2, t2) { + var n2; + S(e2) || (M.l("".concat(this._n, "._onAVChatRoomHistoryMessage groupID:").concat(t2, " count:").concat(e2.length)), n2 = [], e2.forEach(function(e3) { + n2.push(y(y({}, e3), {}, { isHistoryMessage: 1 })); + }), this.onAVChatRoomMessage(n2, t2)); + } }, { key: "onAVChatRoomMessage", value: function(e2) { + this._AVChatRoomHandler.onMessage(e2, 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : ""); + } }, { key: "onAVChatRoomMemberBanned", value: function(e2) { + this._AVChatRoomHandler.onAVChatRoomMemberBanned(e2); + } }, { key: "setUnjoinedAVChatRoom", value: function(e2) { + this._unjoinedAVChatRoomList.set(e2, 1); + } }, { key: "deleteUnjoinedAVChatRoom", value: function(e2) { + this._unjoinedAVChatRoomList.has(e2) && this._unjoinedAVChatRoomList.delete(e2); + } }, { key: "isUnjoinedAVChatRoom", value: function(e2) { + return this._unjoinedAVChatRoomList.has(e2); + } }, { key: "isGroupAttributesUpdatedNotice", value: function(e2) { + return this._groupAttributesHandler.isGroupAttributesUpdatedNotice(e2); + } }, { key: "updateLocalMainSequenceOnReconnected", value: function() { + this._groupAttributesHandler.updateLocalMainSequenceOnReconnected(); + } }, { key: "initGroupAttributes", value: function(e2) { + return this._groupAttributesHandler.initGroupAttributes(e2); + } }, { key: "setGroupAttributes", value: function(e2) { + return this._groupAttributesHandler.setGroupAttributes(e2); + } }, { key: "deleteGroupAttributes", value: function(e2) { + return this._groupAttributesHandler.deleteGroupAttributes(e2); + } }, { key: "getGroupAttributes", value: function(e2) { + return this._groupAttributesHandler.getGroupAttributes(e2); + } }, { key: "isMessageFromTopic", value: function(e2, t2) { + return 2 === e2 && !S(t2); + } }, { key: "isMessageFromCommunityOfTopic", value: function(e2, t2) { + return 2 === e2 && S(t2); + } }, { key: "getMessageExtensions", value: function(e2, t2) { + return M.l("".concat(this._n, ".getMessageExtensions startSequence:").concat(t2)), this.req({ P: k.GET_GRP_MSG_EXT, data: { groupID: e2.to, messageSequence: e2.sequence, startSequence: t2 } }); + } }, { key: "modifyMsgExts", value: function(e2, t2) { + var n2 = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : 1; + return M.l("".concat(this._n, ".modifyMsgExts operateType:").concat(n2)), this.req({ P: k.MODIFY_GRP_MSG_EXT, data: { groupID: e2.to, messageSequence: e2.sequence, extensionList: t2, operateType: n2 } }); + } }, { key: "_genNotifyReqList", value: function(e2) { + for (var t2, n2, o2, i2, a2 = [], s2 = 0, r2 = e2.length; s2 < r2; s2++) + t2 = e2[s2], i2 = this.getLocalGroupProfile(t2).type, n2 = this._getGroupLastRevokedTime(t2), o2 = 1e3 * We(), i2 = { notifyType: 1, limit: 20, type: Nt({ type: i2, groupID: t2 }) ? A.GRP_COMMUNITY : void 0, groupID: t2, beginTime: n2, endTime: o2 }, a2.push(i2); + return a2; + } }, { key: "getNotice", value: function(e2) { + var r2 = this, t2 = "".concat(this._n, ".getNotice"), e2 = e2.filter(function(e3) { + var t3; + return !!r2.hasLocalGroup(e3) && (t3 = (e3 = r2.getLocalGroupProfile(e3)).type, e3 = e3.isSupportTopic, !Ot(t3)) && !e3; + }); + 0 !== e2.length && (M.l("".concat(t2, " list:").concat(e2)), this.req({ P: k.GET_GRP_NOTIFY, data: { notifyReqList: this._genNotifyReqList(e2) } }).then(function(e3) { + var i2, a2, e3 = e3.data.notifyRspList, s2 = []; + O(e3) && (i2 = { dataList: [] }, a2 = "".concat(t2, " ok."), e3.forEach(function(e4) { + var t3 = e4.nextRevokedTime, n2 = e4.groupID, o2 = e4.notifyList; + a2 += " groupID:".concat(n2, " nextRevokedTime:").concat(t3, " count:").concat(o2.length, "\n"), i2.dataList.push({ elements: { revokedInfos: r2._genRevokedInfos(e4) } }), 0 !== t3 ? (r2._setGroupLastRevokedTime(n2, t3), s2.push(n2)) : r2._setGroupLastRevokedTime(n2, 1e3 * We()); + }), M.l(a2), r2.onMsgRevoked(i2, false)), 0 < s2.length && r2.getNotice(s2); + }).catch(function(e3) { + M.e("".concat(t2, " failed. error:"), e3); + })); + } }, { key: "_genRevokedInfos", value: function(e2) { + var t2 = e2.notifyList, n2 = e2.groupID, o2 = []; + return O(t2) && t2.forEach(function(e3) { + o2.push({ groupID: n2, sequence: e3.sequence, random: e3.random, revokerInfo: y({}, e3.revokerInfo) }); + }), o2; + } }, { key: "_getGroupLastRevokedTime", value: function(e2) { + return this.hasLocalGroup(e2) ? this.getLocalGroupProfile(e2)._lastRevokedTime : 0; + } }, { key: "_setGroupLastRevokedTime", value: function(e2, t2) { + this.hasLocalGroup(e2) && (this.getLocalGroupProfile(e2)._lastRevokedTime = t2); + } }, { key: "isGroupCountersNotice", value: function(e2) { + return this._groupCountersHandler.isGroupCountersNotice(e2); + } }, { key: "setGroupCounters", value: function(e2) { + return this._groupCountersHandler.setGroupCounters(e2); + } }, { key: "increaseGroupCounter", value: function(e2) { + return this._groupCountersHandler.increaseGroupCounter(e2); + } }, { key: "decreaseGroupCounter", value: function(e2) { + return this._groupCountersHandler.decreaseGroupCounter(e2); + } }, { key: "getGroupCounters", value: function(e2) { + return this._groupCountersHandler.getGroupCounters(e2); + } }, { key: "getGroupMemberHandler", value: function() { + return this._groupMemberHandler; + } }, { key: "getGroupMemberList", value: function(e2) { + return this._groupMemberHandler.getGroupMemberList(e2); + } }, { key: "getGroupMemberProfile", value: function(e2) { + return this._groupMemberHandler.getGroupMemberProfile(e2); + } }, { key: "addGroupMember", value: function(e2) { + return this._groupMemberHandler.addGroupMember(e2); + } }, { key: "deleteGroupMember", value: function(e2) { + return this._groupMemberHandler.deleteGroupMember(e2); + } }, { key: "setGroupMemberMuteTime", value: function(e2) { + return this._groupMemberHandler.setGroupMemberMuteTime(e2); + } }, { key: "setGroupMemberRole", value: function(e2) { + return this._groupMemberHandler.setGroupMemberRole(e2); + } }, { key: "setGroupMemberNameCard", value: function(e2) { + return this._groupMemberHandler.setGroupMemberNameCard(e2); + } }, { key: "setGroupMemberCustomField", value: function(e2) { + return this._groupMemberHandler.setGroupMemberCustomField(e2); + } }, { key: "markGroupMemberList", value: function(e2) { + return this._groupMemberHandler.markGroupMemberList(e2); + } }, { key: "modifyGroupMemberInfo", value: function(e2) { + return this._groupMemberHandler.modifyGroupMemberInfo(e2); + } }, { key: "restartPolling", value: function() { + this._AVChatRoomHandler.restartPolling(); + } }, { key: "getPollingTimerID", value: function(e2) { + var t2; + return e2 && (t2 = this.getLocalGroupProfile(e2)) && Ot(t2.type) ? this._AVChatRoomHandler.getPollingTimerID(e2) : -1; + } }, { key: "_canIUseJoinOption", value: function(e2) { + return e2 === A.GRP_PUBLIC || Nt({ type: e2 }); + } }, { key: "_silentlyGetGroupProfile", value: function(e2, t2) { + var n2 = setTimeout(this.getGroupProfile.bind(this, { groupID: t2 }), 3e3); + this._timeoutIDs.push(n2), M.l("".concat(this._n, "._silentlyGetGroupProfile errorCode:").concat(e2, " groupID:").concat(t2, " timeoutIDs:").concat(this._timeoutIDs)); + } }, { key: "_clearTimeoutIDs", value: function() { + this._timeoutIDs.forEach(function(e2) { + clearTimeout(e2); + }), this._timeoutIDs = []; + } }, { key: "startMessageLongPolling", value: function(e2) { + var t2 = e2.groupID, n2 = e2.longPollingKey, e2 = e2.longPollingSequence, e2 = void 0 === e2 ? 1 : e2, o2 = this.get(12).isUnlimitedAVChatRoom(), i2 = (this._AVChatRoomHandler.hasPollingInstance(t2) && this.stopMessageLongPolling({ groupID: t2 }), this._AVChatRoomHandler.getJoinedLiveList()), o2 = (!o2 && 0 < i2.length && this.stopMessageLongPolling({ groupID: i2[0] }), new oi({ groupID: t2, type: A.GRP_LIVE })); + return M.l("".concat(this._n, ".startMessageLongPolling groupID:").concat(t2, " longPollingKey:").concat(n2, " longPollingSequence:").concat(e2)), this._AVChatRoomHandler.startRunLoop({ group: o2, longPollingKey: n2, startSeq: e2 }); + } }, { key: "stopMessageLongPolling", value: function(e2) { + var e2 = e2.groupID, t2 = this.get(11); + return this._AVChatRoomHandler.reset(e2), this._deleteLocalGroup(e2), t2.deleteLocalConv("".concat(A.CONV_GROUP).concat(e2)), M.l("".concat(this._n, ".stopMessageLongPolling ok, groupID:").concat(e2)), T({ groupID: e2 }); + } }, { key: "reset", value: function() { + this.groupMap.clear(), this._unjoinedAVChatRoomList.clear(), this._receiptDetailCompleteMap.clear(), this._onlineMemberCountMap.clear(), this._commonGroupHandler.reset(), this._groupSystemNoticeHandler.reset(), this._groupTipsHandler.reset(), this._groupAttributesHandler.reset(), this._groupCountersHandler.reset(), this._AVChatRoomHandler.reset(), this._groupMemberHandler.reset(), this._clearTimeoutIDs(); + } }]), Vi), Ci = ["topicID", "topicName", "avatar", "introduction", "notification", "unreadCount", "muteAllMembers", "customData", "groupAtInfoList", "nextMessageSeq", "selfInfo"], Ti = (e(xi, [{ key: "_initTopic", value: function(e2) { + for (var t2 in e2) + Ci.indexOf(t2) < 0 || ("selfInfo" === t2 ? this.updateSelfInfo(e2[t2]) : this[t2] = "muteAllMembers" === t2 ? 1 === e2[t2] : e2[t2]); + } }, { key: "updateUnreadCount", value: function() { + this.unreadCount = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : 0; + } }, { key: "updateNextMessageSeq", value: function(e2) { + this.nextMessageSeq = e2; + } }, { key: "updateLastMessage", value: function(e2) { + this.lastMessage = Yo(e2); + } }, { key: "updateGroupAtInfoList", value: function(e2) { + this.groupAtInfoList = JSON.parse(JSON.stringify(e2)); + } }, { key: "updateTopic", value: function(e2) { + N(e2.selfInfo) || this.updateSelfInfo(e2.selfInfo), N(e2.muteAllMembers) || (this.muteAllMembers = 1 === e2.muteAllMembers), _t(this, e2, ["groupID", "lastMessageTime", "selfInfo", "muteAllMembers", "lastMsg"]); + } }, { key: "updateSelfInfo", value: function(e2) { + return 0 === _t(this.selfInfo, e2, [], [""]); + } }, { key: "reduceUnreadCount", value: function() { + return 1 <= this.unreadCount && (--this.unreadCount, true); + } }, { key: "isLastMessageRevoked", value: function(e2) { + return e2.sequence === this.lastMessage.lastSequence; + } }, { key: "setLastMessageRevoked", value: function(e2) { + this.lastMessage.isRevoked = e2; + } }, { key: "setLastMessageRevoker", value: function(e2) { + this.lastMessage.revoker = e2; + } }]), xi), Di = (t(qi, u), zo = n(qi), e(qi, [{ key: "_onCloudConfig", value: function() { + var e2 = this.getCloudConfig("topic_cache_time"), t2 = this.getCloudConfig("topic_last_active_time"); + N(e2) || (this.TOPIC_CACHE_TIME = Number(e2)), N(t2) || (this.TOPIC_LAST_ACTIVE_TIME = Number(t2)); + } }, { key: "onTopicCreated", value: function(e2) { + var t2 = e2.groupID; + this.resetGetTopicTime(t2), this.emitOEvt(h.TOPIC_CREATED, e2); + } }, { key: "onTopicDeleted", value: function(e2) { + var t2 = this, n2 = e2.groupID, o2 = e2.topicIDList; + (void 0 === o2 ? [] : o2).forEach(function(e3) { + t2._deleteLocalTopic(n2, e3); + }), this.emitOEvt(h.TOPIC_DELETED, e2); + } }, { key: "onTopicProfileUpdated", value: function(e2) { + var t2 = e2.groupID, n2 = e2.topicID, n2 = this.getLocalTopic(t2, n2); + n2 && (n2.updateTopic(e2), this.emitOEvt(h.TOPIC_UPDATED, { groupID: t2, topic: n2 })); + } }, { key: "onTopicLatestMsg", value: function(e2) { + var t2, n2, e2 = e2 || {}, o2 = e2.topicLatestMessage, e2 = e2.excludedUnreadSequenceList; + S(o2) || (t2 = o2.groupProfile.topicID, o2.conversationType = A.CONV_GROUP, o2.to = t2, (n2 = new Do(o2)).setElement(o2.elements), this.updateUnreadCountAndLastMsg(t2, n2, e2)); + } }, { key: "onMessageRemindTypeUpdated", value: function(e2) { + var t2, n2 = e2.groupID, o2 = e2.topicID, e2 = e2.messageRemindType, i2 = this.getLocalTopic(n2, o2); + i2 && ((t2 = i2.updateSelfInfo({ messageRemindType: e2 })) && this.emitOEvt(h.TOPIC_UPDATED, { groupID: n2, topic: i2 }), M.l("".concat(this._n, ".onMessageRemindTypeUpdated topicID:").concat(o2, " messageRemindType:").concat(e2, " isUpdated:").concat(t2))); + } }, { key: "onAtInfoUpdated", value: function(e2) { + var t2 = e2.topicID, e2 = e2.groupAtInfoList, n2 = Jt(t2), t2 = this.getLocalTopic(n2, t2); + t2 && !N(e2) && (t2.updateGroupAtInfoList(e2), this.emitOEvt(h.TOPIC_UPDATED, { groupID: n2, topic: t2 })); + } }, { key: "onUnreadCountUpdatedFromConv", value: function(e2) { + var t2 = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : 0, n2 = Jt(e2), e2 = this.getLocalTopic(n2, e2); + e2 && e2.unreadCount !== t2 && (e2.updateUnreadCount(t2), 0 === t2 && e2.updateSelfInfo({ readedSequence: e2.lastMessage.lastSequence }), this.emitOEvt(h.TOPIC_UPDATED, { groupID: n2, topic: e2 })); + } }, { key: "onMessageSent", value: function(e2) { + var t2, n2, o2 = e2.groupID, i2 = e2.topicID, e2 = e2.lastMessage, i2 = this.getLocalTopic(o2, i2); + i2 && (n2 = (t2 = void 0 === (t2 = e2.sequence) ? 0 : t2) + 1) > i2.nextMessageSeq && (i2.updateNextMessageSeq(n2), i2.updateLastMessage(e2), i2.updateSelfInfo({ readedSequence: t2 }), i2.updateUnreadCount(0), this.emitOEvt(h.TOPIC_UPDATED, { groupID: o2, topic: i2 })); + } }, { key: "onMessageModified", value: function(e2) { + var t2, n2 = e2.to, o2 = e2.time, i2 = e2.sequence, a2 = e2.elements, s2 = e2.cloudCustomData, r2 = e2.messageVersion, c2 = Jt(n2), u2 = this.getLocalTopic(c2, n2); + u2 && (t2 = u2.lastMessage, M.d("".concat(this._n, ".onMessageModified topicID:").concat(n2, " lastMessage:"), JSON.stringify(t2), "options:", JSON.stringify(e2)), t2) && (null === t2.payload || t2.lastTime === o2 && t2.lastSequence === i2 && t2.version !== r2) && (t2.type = a2[0].type, t2.payload = a2[0].content, t2.messageForShow = zt(t2.type, t2.payload, this.isIntl()), t2.cloudCustomData = s2, t2.version = r2, t2.lastSequence = i2, t2.lastTime = o2, this.emitOEvt(h.TOPIC_UPDATED, { groupID: c2, topic: u2 })); + } }, { key: "onMessageRevoked", value: function(e2) { + var n2, o2, i2, a2 = this; + 0 !== e2.length && (o2 = n2 = null, i2 = false, e2.forEach(function(e3) { + var t2 = e3.to; + o2 = Jt(t2), (n2 = a2.getLocalTopic(o2, t2)) && (n2.reduceUnreadCount() && (i2 = true), n2.isLastMessageRevoked(e3) && (n2.setLastMessageRevoked(true), n2.setLastMessageRevoker(e3.revoker), i2 = true), (t2 = n2.selfInfo.excludedUnreadSequenceList || []).push(e3.sequence), n2.updateSelfInfo({ excludedUnreadSequenceList: t2 })); + }), i2) && this.emitOEvt(h.TOPIC_UPDATED, { groupID: o2, topic: n2 }); + } }, { key: "isLastMessageRevoked", value: function(e2) { + var t2 = e2.topicID, e2 = e2.sequence, n2 = Jt(t2), n2 = this.getLocalTopic(n2, t2), t2 = false; + return t2 = n2 ? n2.isLastMessageRevoked({ sequence: e2 }) : t2; + } }, { key: "updateUnreadCountAndLastMsg", value: function(e2, t2, n2) { + var o2, i2 = Jt(e2), a2 = this.getLocalTopic(i2, e2); + a2 && (o2 = a2.selfInfo.excludedUnreadSequenceList || [], N(n2) || (o2 = n2), t2._isExcludedFromUnreadCount && o2.push(t2.sequence), a2.updateSelfInfo({ excludedUnreadSequenceList: o2 }), M.l("".concat(this._n, ".updateUnreadCountAndLastMsg seq:").concat(t2.sequence, " lastSeq:").concat(a2.lastMessage.lastSequence)), t2.sequence > a2.lastMessage.lastSequence) && (a2.updateLastMessage(t2), n2 = t2.sequence + 1, a2.updateNextMessageSeq(n2), o2 = this._computeUnreadCount(a2), a2.updateUnreadCount(o2), (t2 = this.get(11).getLocalConversation("".concat(A.CONV_GROUP).concat(e2))) && t2.updateUnreadCount({ nextUnreadCount: o2, isFromGetConversations: true }), this.emitOEvt(h.TOPIC_UPDATED, { groupID: i2, topic: a2 })); + } }, { key: "getJoinedCommunityList", value: function() { + return this.get(7).syncCommunityWithTopic(); + } }, { key: "createTopicInCommunity", value: function(t2) { + var n2, o2 = this, i2 = "".concat(this._n, ".").concat("createTopicInCommunity"), e2 = t2.topicID; + return N(e2) || Gt(e2) ? t2.topicName && false === this._filterProfanity("topicName", t2) || t2.introduction && false === this._filterProfanity("introduction", t2) || t2.notification && false === this._filterProfanity("notification", t2) ? D({ code: L.PROFANITY_FOUND }) : (n2 = new G("createTopicInCommunity"), this.req({ P: k.CREATE_TOPIC, data: y({}, t2) }).then(function(e3) { + e3 = e3.data.topicID; + return n2.setMessage("topicID:".concat(e3)).end(), M.l("".concat(i2, " ok. topicID:").concat(e3)), o2._updateTopicMap([y(y({}, t2), {}, { topicID: e3 })]), C({ topicID: e3 }); + }).catch(function(e3) { + return n2.setError(e3).end(), M.e("".concat(i2, " failed. error:"), e3), D(e3); + })) : D({ code: L.ILLEGAL_TOPIC_ID }); + } }, { key: "deleteTopicFromCommunity", value: function(e2) { + var t2 = this, n2 = "".concat(this._n, ".").concat("deleteTopicFromCommunity"), a2 = e2.groupID, e2 = e2.topicIDList, e2 = void 0 === e2 ? [] : e2, s2 = new G("deleteTopicFromCommunity"); + return s2.setMessage("groupID:".concat(a2, " topicIDList:").concat(e2)), this.req({ P: k.DEL_TOPIC, data: { groupID: a2, topicIDList: e2 } }).then(function(e3) { + var e3 = e3.data.resultList, o2 = [], i2 = [], e3 = ((void 0 === e3 ? [] : e3).forEach(function(e4) { + var t3 = e4.topicID, n3 = e4.errorCode, e4 = e4.errorInfo; + 0 === n3 ? o2.push({ topicID: t3 }) : i2.push({ topicID: t3, code: n3, message: e4 }); + }), "success count:".concat(o2.length, ", fail count:").concat(i2.length)); + return s2.setMoreMessage(e3).end(), M.l("".concat(n2, " ok. ").concat(e3)), o2.forEach(function(e4) { + t2._deleteLocalTopic(a2, e4.topicID); + }), C({ successTopicList: o2, failureTopicList: i2 }); + }).catch(function(e3) { + return s2.setError(e3).end(), M.e("".concat(n2, " failed. error:"), e3), D(e3); + }); + } }, { key: "updateTopicProfile", value: function(e2) { + var t2, n2 = this, o2 = "".concat(this._n, ".").concat("updateTopicProfile"); + return M.l("".concat(o2, " options:"), e2), e2.topicName && false === this._filterProfanity("topicName", e2) || e2.introduction && false === this._filterProfanity("introduction", e2) || e2.notification && false === this._filterProfanity("notification", e2) ? D({ code: L.PROFANITY_FOUND }) : ((t2 = new G("updateTopicProfile")).setMessage("groupID:".concat(e2.groupID, " topicID:").concat(e2.topicID)), N(e2.muteAllMembers) || (e2.muteAllMembers = true === e2.muteAllMembers ? "On" : "Off"), this.req({ P: k.UPDATE_TOPIC_PROFILE, data: y({}, e2) }).then(function() { + return t2.end(), M.l("".concat(o2, " ok")), n2._updateTopicMap([e2]), C({ topic: n2.getLocalTopic(e2.groupID, e2.topicID) }); + }).catch(function(e3) { + return t2.setError(e3).end(), M.e("".concat(o2, " failed. error:"), e3), D(e3); + })); + } }, { key: "getTopicList", value: function(e2) { + var t2 = this, n2 = "".concat(this._n, ".").concat("getTopicList"), o2 = e2.groupID, e2 = e2.topicIDList, e2 = void 0 === e2 ? [] : e2, i2 = 0 === e2.length, c2 = new G("getTopicList"); + if (c2.setMessage("groupID:".concat(o2)), this._getTopicTimeMap.has(o2)) { + var a2 = this._getTopicTimeMap.get(o2), s2 = a2.isGetAll, a2 = a2.time; + if ((s2 || !s2 && !i2) && Date.now() - a2 < 1e3 * this.TOPIC_CACHE_TIME) { + s2 = this._getLocalTopicList(o2, e2); + if (i2 || s2.length === e2.length) + return c2.setMoreMessage("from cache, topic count:".concat(s2.length)).end(), M.l("".concat(n2, " groupID:").concat(o2, " from cache, topic count:").concat(s2.length)), T({ successTopicList: s2, failureTopicList: [] }); + } + } + return this.req({ P: k.GET_TOPIC_LIST, data: { groupID: o2, topicIDList: e2 } }).then(function(e3) { + var e3 = e3.data.topicInfoList, a3 = [], s3 = [], r2 = [], e3 = ((void 0 === e3 ? [] : e3).forEach(function(e4) { + var t3 = e4.topic, n3 = e4.selfInfo, o3 = e4.errorCode, e4 = e4.errorInfo, i3 = t3.topicID; + 0 === o3 ? (a3.push(y(y({}, t3), {}, { selfInfo: n3 })), s3.push(i3)) : r2.push({ topicID: i3, code: o3, message: e4 }); + }), t2._updateTopicMap(a3), t2._handleTopicAtInfo(a3), "success count:".concat(s3.length, ", fail count:").concat(r2.length)), e3 = (c2.setMoreMessage(e3).end(), M.l("".concat(n2, " groupID:").concat(o2, " from remote, ").concat(e3)), []); + return S(s3) || (t2._getTopicTimeMap.set(o2, { time: Date.now(), isGetAll: i2 }), e3 = t2._getLocalTopicList(o2, s3)), C({ successTopicList: e3, failureTopicList: r2 }); + }).catch(function(e3) { + return c2.setError(e3).end(), M.e("".concat(n2, " failed. error:"), e3), D(e3); + }); + } }, { key: "hasLocalTopic", value: function(e2, t2) { + return !!this._topicMap.has(e2) && this._topicMap.get(e2).has(t2); + } }, { key: "getLocalTopic", value: function(e2, t2) { + var n2 = null; + return n2 = this._topicMap.has(e2) ? this._topicMap.get(e2).get(t2) : n2; + } }, { key: "_getLocalTopicList", value: function(e2) { + var t2 = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : [], e2 = this._topicMap.get(e2), n2 = []; + return e2 && (n2 = p(e2.values())), 0 === t2.length ? n2 : n2.filter(function(e3) { + return t2.includes(e3.topicID); + }); + } }, { key: "_deleteLocalTopic", value: function(e2, t2) { + this._topicMap.has(e2) && this._topicMap.get(e2).has(t2) && (this._topicMap.get(e2).delete(t2), M.l("".concat(this._n, "._deleteLocalTopic groupID:").concat(e2, " topicID:").concat(t2))); + } }, { key: "_updateTopicMap", value: function(e2) { + var i2 = this, a2 = []; + e2.forEach(function(e3) { + var t2 = e3.groupID, n2 = e3.topicID, o2 = null, e3 = (i2._topicMap.has(t2) || i2._topicMap.set(t2, /* @__PURE__ */ new Map()), i2._topicMap.get(t2).has(n2) ? (o2 = i2._topicMap.get(t2).get(n2)).updateTopic(e3) : (i2._getTopicLastMessage(e3), o2 = new Ti(e3, i2.isIntl()), i2._topicMap.get(t2).set(n2, o2)), i2._computeUnreadCount(o2)); + o2.updateUnreadCount(e3), a2.push({ conversationID: "".concat(A.CONV_GROUP).concat(n2), type: A.CONV_TOPIC, unreadCount: e3 }); + }), 0 < a2.length && this.get(11).updateTopicConversation(a2); + } }, { key: "resetGetTopicTime", value: function(e2) { + var t2 = this; + N(e2) ? p(this._getTopicTimeMap.keys()).forEach(function(e3) { + t2._getTopicTimeMap.set(e3, 0); + }) : this._getTopicTimeMap.set(e2, 0); + } }, { key: "getTopicListOnReconnected", value: function() { + var o2 = this, e2 = p(this._topicMap.keys()), i2 = [], a2 = this.get(11); + e2.forEach(function(e3) { + var n2 = [], t2 = o2._getLocalTopicList(e3); + a2.deleteTopicRoamingInfo(e3), t2.forEach(function(e4) { + var t3 = e4.lastMessage.lastTime, t3 = void 0 === t3 ? 0 : t3; + Date.now() - 1e3 * t3 < 1e3 * o2.TOPIC_LAST_ACTIVE_TIME && n2.push(e4.topicID); + }), 0 < n2.length && i2.push({ groupID: e3, topicIDList: n2 }); + }), M.l("".concat(this._n, ".getTopicListOnReconnected. active community count:").concat(i2.length)), this._relayGetTopicList(i2); + } }, { key: "_relayGetTopicList", value: function(t2) { + var e2, n2, o2, i2 = this; + 0 !== t2.length && (n2 = 5 < (e2 = t2.shift()).topicIDList.length ? "topicIDList.length:".concat(e2.topicIDList.length) : "topicIDList:".concat(e2.topicIDList), (o2 = new G("relayGetTopicList")).setMessage(n2), M.l("".concat(this._n, "._relayGetTopicList. ").concat(n2)), this.getTopicList(e2).then(function() { + o2.end(), i2._relayGetTopicList(t2); + }).catch(function(e3) { + o2.setError(e3).end(), i2._relayGetTopicList(t2); + })); + } }, { key: "_handleTopicAtInfo", value: function(e2) { + var i2 = this; + 0 !== e2.length && e2.forEach(function(e3) { + var t2 = e3.groupID, n2 = e3.topicID, e3 = e3.groupAtInfoList, o2 = []; + N(e3) || (e3.forEach(function(e4) { + o2.push(y(y({}, e4), {}, { groupID: t2, topicID: n2 })); + }), i2.get(11).onNewGroupAtTips({ dataList: o2 })); + }); + } }, { key: "_getTopicLastMessage", value: function(e2) { + var t2; + N(e2.lastMsg) || (t2 = { time: e2.lastMsg.time, sequence: e2.lastMsg.sequence, from: e2.lastMsg.from, payload: e2.lastMsg.elements[0] ? e2.lastMsg.elements[0].content : null, type: e2.lastMsg.elements[0] ? e2.lastMsg.elements[0].type : "", nick: e2.lastMsg.nick, avatar: e2.lastMsg.avatar, version: e2.lastMsg.messageVersion, cloudCustomData: e2.lastMsg.cloudCustomData, isRevoked: 2 === e2.lastMsg.isPlaceMessage, revoker: S(e2.lastMsg.revokerInfo) ? null : e2.lastMsg.revokerInfo.revoker }, e2.lastMessage = t2); + } }, { key: "deleteTopicListInCommunity", value: function(t2) { + var n2 = this, e2 = this._getLocalTopicList(t2), o2 = this.get(11); + e2.forEach(function(e3) { + e3 = e3.topicID; + n2._deleteLocalTopic(t2, e3), n2._getTopicTimeMap.delete(t2), o2.deleteLocalConv("".concat(A.CONV_GROUP).concat(e3)); + }); + } }, { key: "_computeUnreadCount", value: function(t2) { + var n2, e2 = t2.selfInfo, o2 = e2.excludedUnreadSequenceList, i2 = e2.readedSequence, e2 = t2.nextMessageSeq - t2.selfInfo.readedSequence - 1; + return O(o2) && (n2 = 0, o2.forEach(function(e3) { + i2 < e3 && e3 <= t2.nextMessageSeq - 1 && (n2 += 1); + }), 1 <= n2) && (e2 -= n2), e2 < 0 ? 0 : e2; + } }, { key: "_filterProfanity", value: function(e2, t2) { + var n2, o2 = this.get(29); + return !o2 || (n2 = (o2 = o2.filterText(t2[e2], re)).isAllowedToSend, o2 = o2.modifiedText, true === n2 && (t2[e2] = o2, true)); + } }, { key: "getMessageExtensions", value: function(e2, t2) { + M.l("".concat(this._n, ".getMessageExtensions startSequence:").concat(t2)); + var n2 = Jt(e2.to); + return this.req({ P: k.GET_GRP_MSG_EXT, data: { groupID: n2, topicID: e2.to, messageSequence: e2.sequence, startSequence: t2 } }); + } }, { key: "modifyMsgExts", value: function(e2, t2) { + var n2 = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : 1, o2 = (M.l("".concat(this._n, ".modifyMsgExts operateType:").concat(n2)), Jt(e2.to)); + return this.req({ P: k.MODIFY_GRP_MSG_EXT, data: { groupID: o2, topicID: e2.to, messageSequence: e2.sequence, extensionList: t2, operateType: n2 } }); + } }, { key: "reset", value: function() { + M.l("".concat(this._n, ".reset")), this._topicMap.clear(), this._getTopicTimeMap.clear(), this.TOPIC_CACHE_TIME = 300, this.TOPIC_LAST_ACTIVE_TIME = 3600; + } }]), qi), Ei = (e(Fi, [{ key: "setExpirationTime", value: function(e2) { + this.expirationTime = e2; + } }, { key: "getUserProfile", value: function(e2) { + var t2 = this, n2 = "".concat(this._n, ".").concat("getUserProfile"), o2 = e2.userIDList; + e2.fromAccount = this._userM.getMyAccount(), 100 < o2.length && (M.w("".concat(n2, " ").concat($t(100))), o2.length = 100); + for (var i2, a2 = [], s2 = [], r2 = 0, c2 = o2.length; r2 < c2; r2++) + i2 = o2[r2], this._userM.isMyFriend(i2) && this._contains(i2) ? s2.push(this._getProfileFromMap(i2)) : a2.push(i2); + if (0 === a2.length) + return T(s2); + e2.toAccount = a2; + var u2 = e2.bFromGetMyProfile || false, l2 = [], d2 = (e2.toAccount.forEach(function(e3) { + l2.push({ toAccount: e3, standardSequence: 0, customSequence: 0 }); + }), e2.userItem = l2, new G("getUserProfile")); + return d2.setMessage(5 < o2.length ? "userIDList.length:".concat(o2.length) : "userIDList:".concat(o2)), this._userM.req({ P: k.GET_USER_PROFILE, data: e2 }).then(function(e3) { + d2.end(), M.i("".concat(n2, " ok")); + e3 = t2._handleResponse(e3).concat(s2); + return C(u2 ? e3[0] : e3); + }).catch(function(e3) { + return d2.setError(e3).end(), M.e("".concat(n2, " failed. error:"), e3), D(e3); + }); + } }, { key: "getMyProfile", value: function() { + var e2, t2 = this._userM.getMyAccount(), n2 = "".concat(this._n, ".getMyProfile"); + return M.l("".concat(n2, " myAccount:").concat(t2)), this._fill(), this._contains(t2) ? (e2 = this._getProfileFromMap(t2), M.d("".concat(n2, " from cache, myProfile:").concat(JSON.stringify(e2))), T(e2)) : this.getUserProfile({ fromAccount: t2, userIDList: [t2], bFromGetMyProfile: true }); + } }, { key: "_handleResponse", value: function(e2) { + var t2 = e2.data.userProfileItem; + if (!O(t2)) + return []; + for (var n2 = [], e2 = Date.now(), o2 = 0, i2 = t2.length; o2 < i2; o2++) { + var a2 = t2[o2], s2 = a2.to, a2 = a2.profileItem; + "@TLS#NOT_FOUND" !== s2 && "" !== s2 && (s2 = this._update(s2, this._getLatestProfileFromResponse(s2, a2)).latestProfile, n2.push(s2)); + } + return M.l("".concat(this._n, "._handleResponse cost:").concat(nn(e2))), n2; + } }, { key: "_getLatestProfileFromResponse", value: function(e2, t2) { + var n2 = { userID: e2, profileCustomField: [] }; + if (!S(t2)) + for (var o2 = 0, i2 = t2.length; o2 < i2; o2++) + if (-1 < t2[o2].tag.indexOf("Tag_Profile_Custom")) + n2.profileCustomField.push({ key: t2[o2].tag, value: t2[o2].value }); + else + switch (t2[o2].tag) { + case g.NICK: + n2.nick = t2[o2].value; + break; + case g.GENDER: + n2.gender = t2[o2].value; + break; + case g.BIRTHDAY: + n2.birthday = t2[o2].value; + break; + case g.LOCATION: + n2.location = t2[o2].value; + break; + case g.SELFSIGNATURE: + n2.selfSignature = t2[o2].value; + break; + case g.ALLOWTYPE: + n2.allowType = t2[o2].value; + break; + case g.LANGUAGE: + n2.language = t2[o2].value; + break; + case g.AVATAR: + n2.avatar = t2[o2].value; + break; + case g.MESSAGESETTINGS: + n2.messageSettings = t2[o2].value; + break; + case g.ADMINFORBIDTYPE: + n2.adminForbidType = t2[o2].value; + break; + case g.LEVEL: + n2.level = t2[o2].value; + break; + case g.ROLE: + n2.role = t2[o2].value; + break; + default: + M.w("".concat(this._n, "._getLatestProfileFromResponse unknown tag:"), t2[o2].tag, t2[o2].value); + } + return n2; + } }, { key: "updateMyProfile", value: function(o2) { + var i2 = this, a2 = "".concat(this._n, ".").concat("updateMyProfile"); + if (o2.nick && false === this._userM.filterProfanity("nick", o2)) + return D({ code: L.PROFANITY_FOUND }); + if (o2.selfSignature && false === this._userM.filterProfanity("selfSignature", o2)) + return D({ code: L.PROFANITY_FOUND }); + var s2 = new G("updateMyProfile"), e2 = (s2.setMessage(JSON.stringify(o2)), new ei().validate(o2)); + if (!e2.valid) + return s2.setCode(L.UPDATE_PROFILE_INVALID_PARAM).setMoreMessage("info:".concat(e2.tips)).end(), M.e("".concat(a2, " info:").concat(e2.tips)), D({ code: L.UPDATE_PROFILE_INVALID_PARAM }); + var t2, r2, n2 = []; + for (t2 in o2) + Object.prototype.hasOwnProperty.call(o2, t2) && ("profileCustomField" === t2 ? o2.profileCustomField.forEach(function(e3) { + n2.push({ tag: e3.key, value: e3.value }); + }) : n2.push({ tag: g[t2.toUpperCase()], value: o2[t2] })); + return 0 === n2.length ? (e2 = new E({ code: L.UPDATE_PROFILE_NO_KEY }), s2.setError(e2).end(), M.e("".concat(a2, " failed. error:"), e2), D(e2)) : (r2 = this._userM.getMyAccount(), this._userM.req({ P: k.UPDATE_MY_PROFILE, data: { fromAccount: r2, profileItem: n2 } }).then(function(e3) { + s2.end(), M.i("".concat(a2, " ok")); + var t3 = i2._update(r2, o2), n3 = t3.isProfileUpdated, t3 = t3.latestProfile; + return true === n3 && i2._userM.emitOEvt(h.PROFILE_UPDATED, [t3]), T(t3); + }).catch(function(e3) { + return s2.setError(e3).end(), M.e("".concat(a2, " failed. error:"), e3), D(e3); + })); + } }, { key: "onProfileModified", value: function(e2) { + var t2 = e2.dataList; + if (!S(t2)) { + var n2 = t2.length; + M.d("".concat(this._n, ".onProfileModified count:").concat(n2, " dataList:"), e2.dataList); + for (var o2 = [], i2 = 0; i2 < n2; i2++) { + var a2 = t2[i2].userID, a2 = this._update(a2, this._getLatestProfileFromResponse(a2, t2[i2].profileList)), s2 = a2.isProfileUpdated, a2 = a2.latestProfile; + true === s2 && o2.push(a2); + } + 0 < o2.length && (this._userM.emitIEvt(P.PROFILE_UPDATED, o2), this._userM.emitOEvt(h.PROFILE_UPDATED, o2)); + } + } }, { key: "_fill", value: function() { + if (0 === this.accountProfileMap.size) { + for (var e2 = this._getCachedProfiles(), t2 = Date.now(), n2 = 0, o2 = e2.length; n2 < o2; n2++) + t2 - e2[n2].lastUpdatedTime < this.expirationTime && this.accountProfileMap.set(e2[n2].userID, e2[n2]); + M.l("".concat(this._n, "._fill from cache, size:").concat(this.accountProfileMap.size)); + } + } }, { key: "_update", value: function(e2, t2) { + var n2, o2 = false, i2 = Date.now(); + return this._contains(e2) ? (n2 = this._getProfileFromMap(e2), t2.profileCustomField && true === kt(n2.profileCustomField, t2.profileCustomField) && (n2.lastUpdatedTime = i2, o2 = true), 0 < _t(n2, t2, ["profileCustomField"]) && (n2.lastUpdatedTime = i2, o2 = true)) : (n2 = new ei(t2), !this._userM.isMyFriend(e2) && e2 !== this._userM.getMyAccount() || (n2.lastUpdatedTime = i2, o2 = true, this.accountProfileMap.set(e2, n2))), this._flush(e2 === this._userM.getMyAccount()), true === o2 && M.l("".concat(this._n, "._update account:").concat(e2, " isUpdated:").concat(o2)), { isProfileUpdated: o2, latestProfile: n2 }; + } }, { key: "_flush", value: function(e2) { + var t2 = p(this.accountProfileMap.values()), n2 = this._userM.getStorageModule(); + M.d("".concat(this._n, "._flush length:").concat(t2.length, " flushAtOnce:").concat(e2)), n2.setItem(this.TAG, t2, e2); + } }, { key: "_contains", value: function(e2) { + return this.accountProfileMap.has(e2); + } }, { key: "_getProfileFromMap", value: function(e2) { + return this.accountProfileMap.get(e2); + } }, { key: "_getCachedProfiles", value: function() { + var e2 = this._userM.getStorageModule().getItem(this.TAG); + return S(e2) ? [] : e2; + } }, { key: "onConvProfileUpdated", value: function(e2) { + for (var t2, n2, o2, i2 = [], a2 = 0, s2 = e2.length; a2 < s2; a2++) + n2 = (t2 = e2[a2]).userID, this._userM.isMyFriend(n2) && (this._contains(n2) ? (o2 = this._getProfileFromMap(n2), 0 < _t(o2, t2) && i2.push(n2)) : i2.push(t2.userID)); + 0 !== i2.length && (M.l("".concat(this._n, ".onConvProfileUpdated toAccountList:").concat(i2)), this.getUserProfile({ userIDList: i2 })); + } }, { key: "getNickAndAvatarByUserID", value: function(e2) { + return this._contains(e2) ? { nick: (e2 = this._getProfileFromMap(e2)).nick, avatar: e2.avatar } : { nick: "", avatar: "" }; + } }, { key: "getUserNickAndAvatar", value: function(e2) { + var t2, n2 = this, o2 = p(new Set(e2)), i2 = (M.l("".concat(this._n, ".getUserNickAndAvatar userIDList.length:").concat(e2.length, " uniqueUserIDList.length:").concat(o2.length)), []); + return 0 === e2.length ? Promise.resolve(i2) : (e2 = this._createUserIDListGroup(o2), t2 = [], e2.forEach(function(e3) { + t2.push(n2.getUserProfile({ userIDList: e3 })); + }), Promise.all(t2).then(function(e3) { + return e3.forEach(function(e4) { + e4 = e4.data.map(function(e5) { + return { userID: e5.userID, nick: e5.nick, avatar: e5.avatar }; + }); + i2.push.apply(i2, p(e4)); + }), i2; + })); + } }, { key: "_createUserIDListGroup", value: function(e2) { + for (var t2 = [], n2 = 0; n2 < e2.length; ) + t2.push(e2.slice(n2, n2 += 100)); + return t2; + } }, { key: "reset", value: function() { + this._flush(true), this.accountProfileMap.clear(); + } }]), Fi), Li = e(function e2(t2) { + d(this, e2); + }), Si = (e(wi, [{ key: "getLocalBlacklist", value: function() { + return p(this._blacklistMap.keys()); + } }, { key: "getBlacklist", value: function() { + var o2 = this, i2 = "".concat(this._n, ".getBlacklist"), e2 = { fromAccount: this._userM.getMyAccount(), maxLimited: this.maxLimited, startIndex: 0, lastSequence: this.currentSequence }, a2 = new G("getBlacklist"); + return this._userM.req({ P: k.GET_BL, data: e2 }).then(function(e3) { + var e3 = e3.data, t2 = e3.blackListItem, e3 = e3.currentSequence, n2 = S(t2) ? 0 : t2.length; + a2.setMessage("count:".concat(n2)).end(), M.i("".concat(i2, " ok")), o2.currentSequence = e3, o2._handleResponse(t2, true), o2._userM.emitOEvt(h.BLACKLIST_UPDATED, p(o2._blacklistMap.keys())); + }).catch(function(e3) { + return a2.setError(e3).end(), M.e("".concat(i2, " failed. error:"), e3), D(e3); + }); + } }, { key: "addBlacklist", value: function(t2) { + var e2, n2, o2 = this, i2 = new G("addToBlacklist"), a2 = "".concat(this._n, ".addBlacklist"), s2 = this._userM.getMyAccount(); + return 1 === t2.userIDList.length && t2.userIDList[0] === s2 ? (n2 = this._userM.getErrMsg(e2 = L.CANNOT_ADD_SELF_TO_BLACKLIST), i2.setCode(e2).setMessage(n2).end(), n2 = new E({ code: e2 }), M.e("".concat(a2, " failed. error:"), n2), D(n2)) : (t2.userIDList.includes(s2) && (t2.userIDList = t2.userIDList.filter(function(e3) { + return e3 !== s2; + })), t2.fromAccount = this._userM.getMyAccount(), t2.toAccount = t2.userIDList, this._userM.req({ P: k.ADD_TO_BL, data: t2 }).then(function(e3) { + return i2.setMessage(5 < t2.userIDList.length ? "userIDList.length:".concat(t2.userIDList.length) : "userIDList:".concat(t2.userIDList)).end(), M.i("".concat(a2, " ok")), o2._handleResponse(e3.resultItem, true), C(p(o2._blacklistMap.keys())); + }).catch(function(e3) { + return i2.setError(e3).end(), M.e("".concat(a2, " failed. error:"), e3), D(e3); + })); + } }, { key: "_handleResponse", value: function(e2, t2) { + if (!S(e2)) + for (var n2, o2, i2, a2 = 0, s2 = e2.length; a2 < s2; a2++) + o2 = e2[a2].to, i2 = e2[a2].resultCode, !N(i2) && 0 !== i2 || (t2 ? ((n2 = this._blacklistMap.has(o2) ? this._blacklistMap.get(o2) : new Li()).userID = o2, S(e2[a2].addBlackTimeStamp) || (n2.timeStamp = e2[a2].addBlackTimeStamp), this._blacklistMap.set(o2, n2)) : this._blacklistMap.has(o2) && (n2 = this._blacklistMap.get(o2), this._blacklistMap.delete(o2))); + M.l("".concat(this._n, "._handleResponse total:").concat(this._blacklistMap.size, " bAdd:").concat(t2)); + } }, { key: "deleteBlacklist", value: function(t2) { + var n2 = this, o2 = "".concat(this._n, ".deleteBlacklist"), i2 = new G("removeFromBlacklist"); + return t2.fromAccount = this._userM.getMyAccount(), t2.toAccount = t2.userIDList, this._userM.req({ P: k.RM_FROM_BL, data: t2 }).then(function(e2) { + return i2.setMessage(5 < t2.userIDList.length ? "userIDList.length:".concat(t2.userIDList.length) : "userIDList:".concat(t2.userIDList)).end(), M.i("".concat(o2, " ok")), n2._handleResponse(e2.data.resultItem, false), C(p(n2._blacklistMap.keys())); + }).catch(function(e2) { + return i2.setError(e2).end(), M.e("".concat(o2, " failed. error:"), e2), D(e2); + }); + } }, { key: "onAccountDeleted", value: function(e2) { + for (var t2 = 0, n2 = e2.length; t2 < n2; t2++) { + var o2 = e2[t2]; + this._blacklistMap.has(o2) && this._blacklistMap.delete(o2); + } + var i2 = e2.length; + 0 < i2 && (M.l("".concat(this._n, ".onAccountDeleted count:").concat(i2, " ").concat(i2 < 30 ? "userIDList:".concat(e2) : "")), this._userM.emitOEvt(h.BLACKLIST_UPDATED, p(this._blacklistMap.keys()))); + } }, { key: "onAccountAdded", value: function(e2) { + for (var t2, n2 = [], o2 = 0, i2 = e2.length; o2 < i2; o2++) + t2 = e2[o2], this._blacklistMap.has(t2) || (this._blacklistMap.set(t2, new Li({ userID: t2 })), n2.push(t2)); + 0 < n2.length && (M.l("".concat(this._n, ".onAccountAdded count:").concat(n2.length, " userIDList:"), n2), this._userM.emitOEvt(h.BLACKLIST_UPDATED, p(this._blacklistMap.keys()))); + } }, { key: "reset", value: function() { + this._blacklistMap.clear(), this.startIndex = 0, this.maxLimited = 100, this.currentSequence = 0; + } }]), wi), ki = (e(bi, [{ key: "_onCloudConfig", value: function() { + var e2 = this._userM.getCloudConfig("status_query_count"), t2 = this._userM.getCloudConfig("status_sub_count"), n2 = this._userM.getCloudConfig("status_unsub_count"); + M.l("".concat(this._n, "._onCloudConfig statusQueryCount:").concat(e2, " statusSubscribeCount:").concat(t2) + " statusUnsubscribeCount:".concat(n2)), N(e2) || (this.MAX_QUERY_USER_COUNT = parseInt(e2, 10)), N(e2) || (this.MAX_SUBSCRIBE_USER_COUNT = parseInt(t2, 10)), N(e2) || (this.MAX_UNSUBSCRIBE_USER_COUNT = parseInt(n2, 10)); + } }, { key: "onUserStatusUpdated", value: function(e2) { + var e2 = e2.dataList, o2 = this._userM.getMyUserID(), i2 = this._userM.get(12), e2 = e2.map(function(e3) { + var t2 = e3.to, n2 = e3.statusType, e3 = e3.customStatus, e3 = Wo(e3); + return t2 === o2 && i2.setCustomStatus(e3), { userID: t2, statusType: n2, customStatus: e3 }; + }); + M.l("".concat(this._n, ".onUserStatusUpdated list:").concat(JSON.stringify(e2))), this._userM.emitOEvt(h.USER_STATUS_UPDATED, e2); + } }, { key: "setSelfStatus", value: function(e2) { + var t2, n2, o2 = this, i2 = "".concat(this._n, ".setSelfStatus"); + return false === this._userM.filterProfanity("customStatus", e2) ? D({ code: L.PROFANITY_FOUND }) : (t2 = new G("setSelfStatus"), n2 = e2.customStatus, this._userM.req({ P: k.SET_SELF_STATUS, data: { customStatus: n2 } }).then(function(e3) { + return t2.setMessage("customStatus:".concat(n2)).end(), M.l("".concat(i2, " ok. customStatus:").concat(n2)), o2._userM.get(12).setCustomStatus(n2), C({ userID: o2._userM.getMyUserID(), statusType: 1, customStatus: n2 }); + }).catch(function(e3) { + return t2.setError(e3).end(), M.e("".concat(i2, " failed. error:"), e3), D(e3); + })); + } }, { key: "getUserStatus", value: function(e2) { + var o2 = "".concat(this._n, ".").concat("getUserStatus"), e2 = e2.userIDList, i2 = void 0 === e2 ? [] : e2, e2 = this._userM.getMyUserID(), t2 = p(i2), a2 = void 0, n2 = t2.indexOf(e2); + if (-1 < n2 && (t2.splice(n2, 1), a2 = { userID: e2, statusType: 1, customStatus: this._userM.get(12).getCustomStatus() }), 0 === t2.length) + return T({ successUserList: [a2], failureUserList: [] }); + if (!this._userM.canIUse(_.USER_STATUS)) + return this._userM.noUse("getUserStatus"); + t2.length > this.MAX_QUERY_USER_COUNT && (M.w("".concat(o2, " ").concat($t(this.MAX_QUERY_USER_COUNT))), t2 = i2.slice(0, this.MAX_QUERY_USER_COUNT)); + var s2 = new G("getUserStatus"); + return this._userM.req({ P: k.GET_USER_STATUS, data: { userIDList: t2 } }).then(function(e3) { + var e3 = e3.data, t3 = e3.successUserList, t3 = void 0 === t3 ? [] : t3, e3 = e3.failureUserList, e3 = void 0 === e3 ? [] : e3, t3 = t3.map(function(e4) { + var t4 = e4.userID, n4 = e4.statusType, e4 = e4.customStatus; + return { userID: t4, statusType: n4, customStatus: Wo(e4) }; + }), e3 = e3.map(function(e4) { + var t4 = e4.userID, n4 = e4.invalidUserID, o3 = e4.errorCode, e4 = e4.errorInfo; + return { userID: S(n4) ? t4 : n4, code: o3, message: e4 }; + }), n3 = (N(a2) || t3.unshift(a2), "userID count:".concat(i2.length, ", success count:").concat(t3.length, ", fail count:").concat(e3.length)); + return s2.setMessage("".concat(n3)).end(), M.l("".concat(o2, " ok. ").concat(n3, ".")), C({ successUserList: t3, failureUserList: e3 }); + }).catch(function(e3) { + return s2.setMessage("userID count:".concat(i2.length)).setError(e3).end(), M.e("".concat(o2, " failed. error:"), e3), D(e3); + }); + } }, { key: "subscribeUserStatus", value: function(e2) { + var t2, n2, o2, i2, a2 = "subscribeUserStatus"; + return this._userM.canIUse(_.USER_STATUS) ? (t2 = "".concat(this._n, ".").concat(a2), (n2 = p(e2 = void 0 === (e2 = e2.userIDList) ? [] : e2)).length > this.MAX_SUBSCRIBE_USER_COUNT && (M.w("".concat(t2, " ").concat($t(this.MAX_SUBSCRIBE_USER_COUNT))), n2 = e2.slice(0, this.MAX_SUBSCRIBE_USER_COUNT)), o2 = new G(a2), i2 = "userID count:".concat(e2.length), M.l("".concat(t2, " ").concat(i2)), this._userM.req({ P: k.SUB_USER_STATUS, data: { userIDList: n2 } }).then(function(e3) { + e3 = e3.data.failureUserList, e3 = (void 0 === e3 ? [] : e3).map(function(e4) { + var t3 = e4.userID, n3 = e4.invalidUserID, o3 = e4.errorCode, e4 = e4.errorInfo; + return { userID: S(n3) ? t3 : n3, code: o3, message: e4 }; + }); + return o2.setMessage("".concat(i2, " fail count:").concat(e3.length)).end(), M.l("".concat(t2, " ok. fail count:").concat(e3.length, ".")), C({ failureUserList: e3 }); + }).catch(function(e3) { + return o2.setMessage(i2).setError(e3).end(), M.e("".concat(t2, " failed. error:"), e3), D(e3); + })) : this._userM.noUse(a2); + } }, { key: "unsubscribeUserStatus", value: function(e2) { + var t2, n2, o2, i2, a2 = "unsubscribeUserStatus"; + return this._userM.canIUse(_.USER_STATUS) ? (t2 = "".concat(this._n, ".").concat(a2), n2 = p(e2 = void 0 === (e2 = (e2 || {}).userIDList) ? [] : e2), e2.length > this.MAX_UNSUBSCRIBE_USER_COUNT && (M.w("".concat(t2, " ").concat($t(this.MAX_UNSUBSCRIBE_USER_COUNT))), n2 = e2.slice(0, this.MAX_UNSUBSCRIBE_USER_COUNT)), o2 = new G(a2), i2 = "userID count:".concat(e2.length), M.l("".concat(t2, " ").concat(i2)), e2 = { userIDList: n2 }, 0 === n2.length && (e2.userIDList = void 0, e2.unsubscribeAll = 1), this._userM.req({ P: k.UNSUB_USER_STATUS, data: e2 }).then(function(e3) { + e3 = e3.data.failureUserList, e3 = (void 0 === e3 ? [] : e3).map(function(e4) { + var t3 = e4.userID, n3 = e4.invalidUserID, o3 = e4.errorCode, e4 = e4.errorInfo; + return { userID: S(n3) ? t3 : n3, code: o3, message: e4 }; + }); + return o2.setMessage("".concat(i2, " fail count:").concat(e3.length)).end(), M.l("".concat(t2, " ok. fail count:").concat(e3.length, ".")), C({ failureUserList: e3 }); + }).catch(function(e3) { + return o2.setMessage("".concat(i2)).setError(e3).end(), M.e("".concat(t2, " failed. error:"), e3), D(e3); + })) : this._userM.noUse(a2); + } }, { key: "reset", value: function() { + this.MAX_QUERY_USER_COUNT = 500, this.MAX_SUBSCRIBE_USER_COUNT = 100, this.MAX_UNSUBSCRIBE_USER_COUNT = 100; + } }]), bi), Ai = (t(Ui, u), Jo = n(Ui), e(Ui, [{ key: "onContextUpdated", value: function(e2) { + this._profileHandler.getMyProfile(), this._blacklistHandler.getBlacklist(); + } }, { key: "mockOnNickAvatarModified", value: function(e2, t2) { + M.l("".concat(this._n, "._mockOnNickAvatarModified nick:").concat(e2, " avatar:").concat(t2)), this.onProfileModified({ dataList: [{ pushType: 1, userID: this.getMyUserID(), profileList: [{ tag: g.NICK, value: e2 }, { tag: g.AVATAR, value: t2 }] }] }); + } }, { key: "onProfileModified", value: function(e2) { + this._profileHandler.onProfileModified(e2); + } }, { key: "onRelationChainModified", value: function(e2) { + var t2, n2, e2 = e2.dataList; + S(e2) || (t2 = [], e2.forEach(function(e3) { + e3.blackListDelAccount && t2.push.apply(t2, p(e3.blackListDelAccount)); + }), 0 < t2.length && this._blacklistHandler.onAccountDeleted(t2), n2 = [], e2.forEach(function(e3) { + e3.blackListAddAccount && n2.push.apply(n2, p(e3.blackListAddAccount)); + }), 0 < n2.length && this._blacklistHandler.onAccountAdded(n2)); + } }, { key: "onConvProfileUpdated", value: function(e2) { + this._profileHandler.onConvProfileUpdated(e2); + } }, { key: "getMyAccount", value: function() { + return this.getMyUserID(); + } }, { key: "getMyNick", value: function() { + return this._profileHandler.getNickAndAvatarByUserID(this.getMyUserID()).nick; + } }, { key: "getMyProfile", value: function() { + return this._profileHandler.getMyProfile(); + } }, { key: "getStorageModule", value: function() { + return this.get(13); + } }, { key: "filterProfanity", value: function(e2, t2) { + var n2, o2 = this.get(29); + return !o2 || (n2 = (o2 = o2.filterText(t2[e2], "user_profile")).isAllowedToSend, o2 = o2.modifiedText, true === n2 && (t2[e2] = o2, true)); + } }, { key: "isMyFriend", value: function(e2) { + var t2 = this.get(8); + return !!t2 && t2.isMyFriend(e2); + } }, { key: "getUserProfile", value: function(e2) { + return this._profileHandler.getUserProfile(e2); + } }, { key: "updateMyProfile", value: function(e2) { + return this._profileHandler.updateMyProfile(e2); + } }, { key: "getNickAndAvatarByUserID", value: function(e2) { + return this._profileHandler.getNickAndAvatarByUserID(e2); + } }, { key: "getUserNickAndAvatar", value: function(e2) { + return this._profileHandler.getUserNickAndAvatar(e2); + } }, { key: "getLocalBlacklist", value: function() { + var e2 = this._blacklistHandler.getLocalBlacklist(); + return T(e2); + } }, { key: "addBlacklist", value: function(e2) { + return this._blacklistHandler.addBlacklist(e2); + } }, { key: "deleteBlacklist", value: function(e2) { + return this._blacklistHandler.deleteBlacklist(e2); + } }, { key: "onUserStatusUpdated", value: function(e2) { + this._userStatusHandler.onUserStatusUpdated(e2); + } }, { key: "setSelfStatus", value: function(e2) { + return this._userStatusHandler.setSelfStatus(e2); + } }, { key: "getUserStatus", value: function(e2) { + return this._userStatusHandler.getUserStatus(e2); + } }, { key: "subscribeUserStatus", value: function(e2) { + return this._userStatusHandler.subscribeUserStatus(e2); + } }, { key: "unsubscribeUserStatus", value: function(e2) { + return this._userStatusHandler.unsubscribeUserStatus(e2); + } }, { key: "reset", value: function() { + M.l("".concat(this._n, ".reset")), this._profileHandler.reset(), this._blacklistHandler.reset(), this._userStatusHandler.reset(); + } }]), Ui), Ri = (e(Pi, [{ key: "isLoggedIn", value: function() { + return this._isLoggedIn; + } }, { key: "isOversea", value: function() { + return this._oversea; + } }, { key: "isPrivateNetWork", value: function() { + return this._proxyServer; + } }, { key: "isDevMode", value: function() { + return this._isDevMode; + } }, { key: "isTestEnv", value: function() { + return this._isTestEnv; + } }, { key: "isPartialUpdatedConvs", value: function() { + return this._isPartialUpdatedConvs; + } }, { key: "isSingaporeSite", value: function() { + return 2e7 <= this._SDKAppID && this._SDKAppID < 3e7 || 172e7 <= this._SDKAppID && this._SDKAppID < 173e7; + } }, { key: "isKoreaSite", value: function() { + return 3e7 <= this._SDKAppID && this._SDKAppID < 4e7 || 173e7 <= this._SDKAppID && this._SDKAppID < 174e7; + } }, { key: "isGermanySite", value: function() { + return 4e7 <= this._SDKAppID && this._SDKAppID < 5e7 || 174e7 <= this._SDKAppID && this._SDKAppID < 175e7; + } }, { key: "isIndiaSite", value: function() { + return 5e7 <= this._SDKAppID && this._SDKAppID < 6e7 || 175e7 <= this._SDKAppID && this._SDKAppID < 176e7; + } }, { key: "isJapanSite", value: function() { + return 6e7 <= this._SDKAppID && this._SDKAppID < 7e7 || 176e7 <= this._SDKAppID && this._SDKAppID < 177e7; + } }, { key: "isUSASite", value: function() { + return 7e7 <= this._SDKAppID && this._SDKAppID < 8e7 || 177e7 <= this._SDKAppID && this._SDKAppID < 178e7; + } }, { key: "isIndonesiaSite", value: function() { + return 8e7 <= this._SDKAppID && this._SDKAppID < 9e7 || 178e7 <= this._SDKAppID && this._SDKAppID < 179e7; + } }, { key: "isIntl", value: function() { + return 0 === (e2 = this._SDKAppID) || 2e7 <= e2 && e2 < 9e7 || 172e7 <= e2 && e2 < 179e7; + var e2; + } }, { key: "isUnlimitedAVChatRoom", value: function() { + return this._unlimitedAVChatRoom; + } }, { key: "isUsingChatCore", value: function() { + return this._isUsingChatCore; + } }, { key: "setUsingChatCore", value: function(e2) { + this._isUsingChatCore = e2; + } }, { key: "getUIPlatform", value: function() { + return this._uiPlatform; + } }, { key: "setUIPlatform", value: function(e2) { + this._uiPlatform = e2; + } }, { key: "setUserID", value: function(e2) { + this._userID = e2; + } }, { key: "getUserID", value: function() { + return this._userID; + } }, { key: "setUserSig", value: function(e2) { + this._userSig = e2; + } }, { key: "getUserSig", value: function() { + return this._userSig; + } }, { key: "getSDKAppID", value: function() { + return this._SDKAppID; + } }, { key: "setTinyID", value: function(e2) { + this._tinyID = e2, this._isLoggedIn = true; + } }, { key: "getTinyID", value: function() { + return this._tinyID; + } }, { key: "setCustomStatus", value: function(e2) { + this._customStatus = e2; + } }, { key: "getCustomStatus", value: function() { + return this._customStatus; + } }, { key: "getScene", value: function() { + return Ue ? window.tencent_cloud_im_csig_flutter_for_web_25F_cy : this._isTUIKit() ? "tuikit" : this._scene; + } }, { key: "getInstanceID", value: function() { + return this._instanceID; + } }, { key: "getStatusInstanceID", value: function() { + return this._statusInstanceID; + } }, { key: "setStatusInstanceID", value: function(e2) { + this._statusInstanceID = e2; + } }, { key: "getVersion", value: function() { + return this._version; + } }, { key: "getA2Key", value: function() { + return this._a2Key; + } }, { key: "setA2Key", value: function(e2) { + this._a2Key = e2; + } }, { key: "getContentType", value: function() { + return this._contentType; + } }, { key: "getProxyServer", value: function() { + return this._proxyServer; + } }, { key: "getFileUploadProxy", value: function() { + return this._fileUploadProxy; + } }, { key: "getFileDownloadProxy", value: function() { + return this._fileDownloadProxy; + } }, { key: "setApplicationID", value: function(e2) { + this._applicationID = e2; + } }, { key: "getApplicationID", value: function() { + return this._applicationID; + } }, { key: "setDowloadFileAuthKey", value: function(e2) { + this._authKey = e2; + } }, { key: "getDowloadFileAuthKey", value: function() { + return this._authKey; + } }, { key: "setCustomLoginInfo", value: function(e2) { + this._customLoginInfo = e2; + } }, { key: "getCustomLoginInfo", value: function() { + return this._customLoginInfo; + } }, { key: "_isTUIKit", value: function() { + var e2 = false, t2 = false, n2 = false, o2 = false, i2 = []; + v && (i2 = Object.keys(I)); + for (var a2 = 0, s2 = (i2 = Ce ? Me ? Object.keys(uni) : Object.keys(window) : i2).length; a2 < s2; a2++) + if (i2[a2].toLowerCase().includes("uikit")) { + e2 = true; + break; + } + var r2, i2 = null, c2 = (v && !lt(I.createGamePortal) && lt(getApp) && !N(getApp()) && (r2 = getApp().globalData, f(r2)) && true === r2.isTUIKit && (t2 = true), true === this._m.get(13).getStorageSync("TIM_".concat(this._SDKAppID, "_isTUIKit")) && (n2 = true), null); + if (_e && !fe && "undefined" == typeof uni && __wxConfig && (c2 = __wxConfig.pages), ge && "undefined" == typeof uni && __qqConfig && (c2 = __qqConfig.pages), O(c2) && 0 < c2.length) { + for (var u2 = 0, l2 = c2.length; u2 < l2; u2++) + if (c2[u2].toLowerCase().includes("tui")) { + o2 = true; + break; + } + c2 = null; + } + return e2 || t2 || n2 || o2; + } }, { key: "reset", value: function() { + this._isLoggedIn = false, this._userSig = "", this._a2Key = "", this._tinyID = "", this._customStatus = "", this._statusInstanceID = 0; + } }]), Pi), Oi = { "k-vue2-pc": 1, "k-vue2-h5": 2, "k-vue2-h5-uni": 3, "k-vue2-app-uni": 4, "k-vue2-mp-uni": 5, "k-vue2-pc-uni": 6, "k-vue3-pc": 7, "k-vue3-h5": 8, "k-vue3-h5-uni": 9, "k-vue3-app-uni": 10, "k-vue3-mp-uni": 11, "k-vue3-pc-uni": 12, "k-rn": 13 }, Ni = (t(Gi, u), jo = n(Gi), e(Gi, [{ key: "onCheckTimer", value: function(e2) { + this.isLoggedIn() && e2 % this._helloInterval == 0 && this._hello(); + } }, { key: "getPushModule", value: function() { + var e2 = void 0, t2 = this.get(36), n2 = this.get(28); + return t2.canIUseTIMPush() ? e2 = t2 : n2.canIUseOfflinePush() && (e2 = n2), e2; + } }, { key: "login", value: function(e2) { + if (this.isLoggedIn()) + return n2 = this.getMyUserID(), (n2 = this.getErrMsg("RepeatLogin", n2)) && M.w(n2), T({ actionStatus: "OK", errorCode: 0, errorInfo: n2, repeatLogin: true }); + if (Date.now() - this._lastLoginTs <= 15e3) + return this.warn("LoggingIn", e2.userID), D({ code: L.REPEAT_LOGIN }); + M.l("".concat(this._n, ".login userID:").concat(e2.userID)); + var t2, n2 = this._checkLoginInfo(e2); + return 0 !== n2.code ? D(n2) : (n2 = this.get(12), t2 = e2.userID, e2 = e2.userSig, n2.setUserID(t2), n2.setUserSig(e2), this.get(20).updateProtocolConfig(), this._login()); + } }, { key: "_login", value: function() { + var _2 = this, h2 = this.get(12), g2 = h2.getScene(), e2 = 0, t2 = g2, f2 = (g2 && g2.startsWith("k-") && (t2 = Oi[g2], g2 = "tuikit"), new G("login")), n2 = (f2.setMessage("".concat(t2)).setMoreMessage("identifier:".concat(this.getMyUserID())), "tuikit" === g2), o2 = 0, n2 = (Me ? o2 = n2 ? 3 === t2 || 4 === t2 || 5 === t2 || 6 === t2 ? 31 : 9 === t2 || 10 === t2 || 11 === t2 || 12 === t2 ? 32 : 4 : 3 : v ? o2 = he ? 36 : "tuikit" === g2 ? 12 : 11 : Ce ? o2 = Ue ? "flutter_web_uikit" === g2 ? 21 : 20 : this._isReactUIKit() ? Pe ? 25 : 24 : n2 ? 1 === t2 || 2 === t2 ? 29 : 7 === t2 || 8 === t2 ? 30 : Pe ? 17 : 14 : Pe ? 16 : 13 : 13 === t2 && (o2 = 38), f2.setUIPlatform(o2), h2.setUIPlatform(o2), this.getPushModule()), m2 = (n2 && (this._isWebUniapp = n2.getUniAppPlatform(), t2 = this._getStatusInstanceID(), h2.setStatusInstanceID(t2), this.get(20).updateProtocolConfig(), e2 = n2.getDeviceBrand()), "".concat(this._n, "._login")); + return this._lastLoginTs = Date.now(), this.req({ P: k.LOGIN, data: { deviceBrand: e2, isWebUniapp: this._isWebUniapp, customInfo: h2.getCustomLoginInfo() } }).then(function(e3) { + _2._lastLoginTs = 0; + var t3 = Date.now(), n3 = null, o3 = e3.data, i2 = o3.a2Key, a2 = o3.tinyID, s2 = o3.helloInterval, r2 = o3.instanceID, c2 = o3.timeStamp, u2 = o3.customStatus, u2 = void 0 === u2 ? "" : u2, l2 = o3.purchaseBits, o3 = o3.authKey, o3 = void 0 === o3 ? "" : o3, d2 = 1e3 * c2, p2 = t3 - f2.getStartTs(), p2 = d2 + parseInt(p2 / 2) - t3, t3 = f2.getStartTs() + p2; + if (f2.start(t3), t3 = d2, Ye = p2, (d2 = /* @__PURE__ */ new Date()).setTime(t3), M.i("baseTime from server:".concat(d2, " offset:").concat(Ye)), a2) { + if (i2) + return t3 = _2.get(21).getSocketID(), d2 = Wo(u2), u2 = "socketID:".concat(t3, " scene:").concat(g2, " helloInterval:").concat(s2, " instanceID:").concat(r2, " timeStamp:").concat(c2) + " offset:".concat(p2, " customStatus:").concat(d2, " isWebUniapp:").concat(_2._isWebUniapp), M.l("".concat(m2, " ok. ").concat(u2)), c2 = t3 = "", _e && lt(I.getAccountInfoSync) && (p2 = I.getAccountInfoSync().miniProgram) && (t3 = p2.appId, c2 = p2.envVersion), f2.setMoreMessage("".concat(u2, " href:").concat(Ce ? window.location.href : "", " mpAppId:").concat(t3, " envVersion:").concat(c2, " authKey:").concat(o3)).end(), h2.setA2Key(i2), h2.setTinyID(a2), h2.setStatusInstanceID(r2), h2.setCustomStatus(d2), h2.setDowloadFileAuthKey(o3), l2 && _2.get(27).onPushedConfig({ errorCode: 0, expiredTime: 0, purchaseBits: l2 }), _2.get(20).updateProtocolConfig(), _2.emitIEvt(P.A2KEY_AND_TINYID_UPDATED), _2._helloInterval = s2, _2.triggerReady(), (p2 = _2.getPushModule()) && (uni.setStorageSync("timUniAppInstanceID", r2), p2.init()), _2._fetchCloudControlConfig(), _2.get(29).init(), e3; + n3 = new E({ code: L.NO_A2KEY }); + } else + n3 = new E({ code: L.NO_TINYID }); + throw f2.setError(n3).end(), n3; + }).catch(function(e3) { + return f2.setError(e3).end(true), _2._m.setNotReadyReason(L.LOGIN_FAILED), M.e("".concat(m2, " failed. error:"), e3), _2._lastLoginTs = 0, _2._m.onLoginFailed(), D(e3); + }); + } }, { key: "logout", value: function() { + var t2 = this, e2 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : 0, n2 = "".concat(this._n, ".logout"), o2 = this.isLoggedIn(); + return M.i("".concat(n2, " type:").concat(e2, " isLoggedIn:").concat(o2, " isWebUniapp:").concat(this._isWebUniapp)), o2 ? (new G("logout").setMessage("identifier:".concat(this.getMyUserID())).end(true), 0 === e2 && this._m.setNotReadyReason(L.LOGGED_OUT), this.req({ P: k.LOGOUT, data: { type: e2, isWebUniapp: this._isWebUniapp } }).then(function() { + return t2.resetReady(), T({}); + }).catch(function(e3) { + return M.e("".concat(n2, " error:"), e3), t2.resetReady(), T({}); + })) : D({ code: L.USER_NOT_LOGGED_IN }); + } }, { key: "getLoginUser", value: function() { + return this.isLoggedIn() ? this.getMyUserID() : ""; + } }, { key: "_fetchCloudControlConfig", value: function() { + this.get(23).fetchConfig(); + } }, { key: "_getStatusInstanceID", value: function() { + return uni.getStorageSync("timUniAppInstanceID") || 0; + } }, { key: "_hello", value: function() { + var t2 = this; + this._lastWsHelloTs = Date.now(), this.req({ P: k.HELLO, data: { isWebUniapp: this._isWebUniapp } }).catch(function(e2) { + M.w("".concat(t2._n, "._hello error:"), e2); + }); + } }, { key: "getLastWsHelloTs", value: function() { + return this._lastWsHelloTs; + } }, { key: "_checkLoginInfo", value: function(e2) { + var t2 = 0; + return S(this.get(12).getSDKAppID()) ? t2 = L.NO_SDKAPPID : S(e2.userID) ? t2 = L.NO_IDENTIFIER : S(e2.userSig) && (t2 = L.NO_USERSIG), { code: t2 }; + } }, { key: "_isReactUIKit", value: function() { + return Ce && void 0 !== window.tencent_cloud_im_csig_react_uikit_23F_xa; + } }, { key: "onMultipleAccountKickedOut", value: function(e2) { + var t2 = this; + new G("kickedOut").setMessage("type:".concat(A.KICKED_OUT_MULT_ACCOUNT, " newInstanceInfo:").concat(JSON.stringify(e2))).end(true), M.w("".concat(this._n, ".onMultipleAccountKickedOut userID:").concat(this.getMyUserID(), " newInstanceInfo:"), e2), this.logout(1).then(function() { + t2.emitOEvt(h.KICKED_OUT, { type: A.KICKED_OUT_MULT_ACCOUNT }), t2._m.setNotReadyReason(L.KICKED_OUT_MULT_ACCOUNT), t2._m.reset(); + }); + } }, { key: "onMultipleDeviceKickedOut", value: function(e2) { + var t2 = this; + new G("kickedOut").setMessage("type:".concat(A.KICKED_OUT_MULT_DEVICE, " newInstanceInfo:").concat(JSON.stringify(e2))).end(true), M.w("".concat(this._n, ".onMultipleDeviceKickedOut userID:").concat(this.getMyUserID(), " newInstanceInfo:"), e2), this.logout(1).then(function() { + t2.emitOEvt(h.KICKED_OUT, { type: A.KICKED_OUT_MULT_DEVICE }), t2._m.setNotReadyReason(L.KICKED_OUT_MULT_DEVICE), t2._m.reset(); + }); + } }, { key: "onUserSigExpired", value: function() { + new G("kickedOut").setMessage(A.KICKED_OUT_USERSIG_EXPIRED).end(true), M.w("".concat(this._n, ".onUserSigExpired userID:").concat(this.getMyUserID())), 0 !== this.get(12).getStatusInstanceID() && (this.emitOEvt(h.KICKED_OUT, { type: A.KICKED_OUT_USERSIG_EXPIRED }), this._m.setNotReadyReason(L.KICKED_OUT_USERSIG_EXPIRED), this._m.reset()); + } }, { key: "onRestApiKickedOut", value: function(e2) { + new G("kickedOut").setMessage("type:".concat(A.KICKED_OUT_REST_API, " newInstanceInfo:").concat(JSON.stringify(e2))).end(true), M.w("".concat(this._n, ".onRestApiKickedOut userID:").concat(this.getMyUserID(), " newInstanceInfo:"), e2), 0 !== this.get(12).getStatusInstanceID() && (this.emitOEvt(h.KICKED_OUT, { type: A.KICKED_OUT_REST_API }), this._m.setNotReadyReason(L.KICKED_OUT_REST_API), this._m.reset(), this.get(21).onRestApiKickedOut()); + } }, { key: "reset", value: function() { + M.l("".concat(this._n, ".reset")), this.resetReady(), this._helloInterval = 120, this._lastLoginTs = 0, this._lastWsHelloTs = 0, this._isWebUniapp = 0; + } }]), Gi); + function Gi(e2) { + return d(this, Gi), (e2 = jo.call(this, e2))._n = "SignModule", e2._helloInterval = 120, e2._lastLoginTs = 0, e2._lastWsHelloTs = 0, e2._isWebUniapp = 0, Bo.mixin(i(e2)), e2; + } + function Pi(e2, t2) { + d(this, Pi), this._m = e2, this._isLoggedIn = false, this._SDKAppID = t2.SDKAppID, this._userID = t2.userID || "", this._userSig = t2.userSig || "", this._version = "3.4.7", this._a2Key = "", this._tinyID = "", this._customStatus = "", this._contentType = "json", this._unlimitedAVChatRoom = t2.unlimitedAVChatRoom, this._scene = t2.scene || "", this._oversea = t2.oversea, this._instanceID = t2.instanceID, this._statusInstanceID = 0, this._isDevMode = t2.devMode, this._isTestEnv = t2.testEnv, this._proxyServer = t2.proxyServer, this._fileUploadProxy = t2.fileUploadProxy, this._fileDownloadProxy = t2.fileDownloadProxy, this._applicationID = 0, this._isPartialUpdatedConvs = t2.partialUpdatedConversations, this._isUsingChatCore = false, this._uiPlatform = 0, this._authKey = "", this._customLoginInfo = ""; + } + function Ui(e2) { + return d(this, Ui), (e2 = Jo.call(this, e2))._n = "UserModule", e2._profileHandler = new Ei(i(e2)), e2._blacklistHandler = new Si(i(e2)), e2._userStatusHandler = new ki(i(e2)), e2.getIEmitInst().on(P.A2KEY_AND_TINYID_UPDATED, e2.onContextUpdated, i(e2)), e2; + } + function bi(e2) { + d(this, bi), this._userM = e2, this._n = "UserStatusHandler", this.MAX_QUERY_USER_COUNT = 500, this.MAX_SUBSCRIBE_USER_COUNT = 100, this.MAX_UNSUBSCRIBE_USER_COUNT = 100, this._userM.getIEmitInst().on(P.CLOUD_CONFIG, this._onCloudConfig, this); + } + function wi(e2) { + d(this, wi), this._userM = e2, this._n = "BlacklistHandler", this._blacklistMap = /* @__PURE__ */ new Map(), this.startIndex = 0, this.maxLimited = 100, this.currentSequence = 0; + } + function Fi(e2) { + d(this, Fi), this._userM = e2, this._n = "ProfileHandler", this.TAG = "profile", this.accountProfileMap = /* @__PURE__ */ new Map(), this.expirationTime = 864e5; + } + function qi(e2) { + return d(this, qi), (e2 = zo.call(this, e2))._n = "TopicModule", e2._topicMap = /* @__PURE__ */ new Map(), e2._getTopicTimeMap = /* @__PURE__ */ new Map(), e2.TOPIC_CACHE_TIME = 300, e2.TOPIC_LAST_ACTIVE_TIME = 3600, e2.getIEmitInst().on(P.CLOUD_CONFIG, e2._onCloudConfig, i(e2)), e2; + } + function xi(e2, t2) { + d(this, xi), this.topicID = "", this.topicName = "", this.avatar = "", this.introduction = "", this.notification = "", this.unreadCount = 0, this.muteAllMembers = false, this.customData = "", this.groupAtInfoList = [], this.nextMessageSeq = 0, this.lastMessage = Yo(e2.lastMessage, t2), this.selfInfo = { muteTime: 0, readedSequence: 0, messageRemindType: "", excludedUnreadSequenceList: void 0 }, this._initTopic(e2); + } + function Vi(e2) { + return d(this, Vi), (e2 = Xo.call(this, e2))._n = "GroupModule", e2._commonGroupHandler = new li(i(e2)), e2._groupAttributesHandler = new di(i(e2)), e2._groupCountersHandler = new pi(i(e2)), e2._AVChatRoomHandler = new gi(i(e2)), e2._groupTipsHandler = new ui(i(e2)), e2._groupSystemNoticeHandler = new Ii(i(e2)), e2._groupMemberHandler = new mi(i(e2)), e2.groupMap = /* @__PURE__ */ new Map(), e2._unjoinedAVChatRoomList = /* @__PURE__ */ new Map(), e2._receiptDetailCompleteMap = /* @__PURE__ */ new Map(), e2._onlineMemberCountMap = /* @__PURE__ */ new Map(), e2._timeoutIDs = [], e2.getIEmitInst().on(P.CLOUD_CONFIG, e2._onCloudConfig, i(e2)), e2; + } + function Hi(e2) { + d(this, Hi), this._grpM = e2, this._n = "GroupSystemNoticeHandler", this.pendencyMap = /* @__PURE__ */ new Map(); + } + function Bi(e2) { + d(this, Bi), this._grpM = e2, this._n = "GroupMemberHandler", this.groupMemberListMap = /* @__PURE__ */ new Map(), this.DEFAULT_MEMBER_INFO_FILTER = ["Role", "JoinTime", "NameCard", "ShutUpUntil", "OnlineStatus"], this._grpM.getIEmitInst().on(P.PROFILE_UPDATED, this._onProfileUpdated, this); + } + function Ki(e2) { + d(this, Ki), this.userID = "", this.avatar = "", this.nick = "", this.role = "", this.joinTime = "", this.lastSendMsgTime = "", this.nameCard = "", this.muteUntil = 0, this.memberCustomField = [], this.isOnline = false, this.updateMember(e2); + } + function Yi(e2) { + d(this, Yi), this._grpM = e2, this._n = "AVChatRoomHandler", this._joinedGroupMap = /* @__PURE__ */ new Map(), this._pollingRequestInfoMap = /* @__PURE__ */ new Map(), this._pollingInstanceMap = /* @__PURE__ */ new Map(), this._seqSll = new ti(200), this._IDSll = new ti(100), this._reportMessageStackedCount = 0, this._onlineMemberCountMap = /* @__PURE__ */ new Map(), this.DEFAULT_EXPIRE_TIME = 60, this.DEFAULT_POLLING_INTERVAL = 300, this.MAX_POLLING_INTERVAL = 2e3, this._pollingInterval = this.DEFAULT_POLLING_INTERVAL, this.DEFAULT_POLLING_NO_MESSAGE_COUNT = 20, this.DEFAULT_POLLING_INTERVAL_PLUS = 2e3, this._pollingNoMessageCount = 0, this._startBroadcastSeq = 1, this._broadcastMessageIDMap = /* @__PURE__ */ new Map(), this.DEFAULT_POLLING_SIMPLIFIED_MSG = 0; + } + function Wi(e2) { + d(this, Wi); + var t2 = e2.manager, n2 = e2.groupID, o2 = e2.onInit, i2 = e2.onSuccess, e2 = e2.onFail; + this._n = "Polling", this._manager = t2, this._grpM = t2._grpM, this._onInit = o2, this._onSuccess = i2, this._onFail = e2, this._groupID = n2, this._timeoutID = -1, this._isRunning = false, this._proto = k.AV_POLLING; + } + function ji(e2) { + d(this, ji), this._grpM = e2, this._n = "GroupCountersHandler", this._groupCountersMap = /* @__PURE__ */ new Map(), this.EXPIRE_TIME = 3e4, this._grpM.getIEmitInst().on(P.CLOUD_CONFIG, this._onCloudConfig, this); + } + function Ji(e2) { + d(this, Ji), this._grpM = e2, this._n = "GroupAttributesHandler", this._groupAttributesMap = /* @__PURE__ */ new Map(), this._groupAttributesCopy = {}, this.CACHE_EXPIRE_TIME = 3e4, this._grpM.getIEmitInst().on(P.CLOUD_CONFIG, this._onCloudConfig, this); + } + function zi(e2) { + d(this, zi), this._grpM = e2, this._n = "CommonGroupHandler", this.tempConversationList = null, this._cachedGroupMessageMap = /* @__PURE__ */ new Map(), this._checkCountMap = /* @__PURE__ */ new Map(), this.MAX_CHECK_COUNT = 4, this.PAGING_GRP_COUNT_LIMIT = 200, this._pagingStatus = Nn, this._pagingGetCostList = [], e2.getIEmitInst().on(P.A2KEY_AND_TINYID_UPDATED, this.syncGroupList, this); + } + function Xi(e2) { + d(this, Xi), this._grpM = e2, this._n = "GroupTipsHandler", this._cachedGroupTipsMap = /* @__PURE__ */ new Map(), this._checkCountMap = /* @__PURE__ */ new Map(), this.MAX_CHECK_COUNT = 4; + } + function Zi(e2) { + return d(this, Zi), (e2 = Zo.call(this, e2))._n = "ConvModule", Bo.mixin(i(e2)), e2._msgListHandler = new xo(i(e2)), e2._msgRemindHandler = new si(i(e2)), e2._convGroupHandler = new ri(i(e2)), e2._sll = new ti(100), e2._pagingStatus = Nn, e2._pagingTs = 0, e2._pagingStartIdx = 0, e2._pagingPinnedTs = 0, e2._pagingPinnedStartIdx = 0, e2._pagingConvIDMap = /* @__PURE__ */ new Map(), e2._convIDFromUnreadDBMap = /* @__PURE__ */ new Map(), e2._convMap = /* @__PURE__ */ new Map(), e2._tmpGroupList = [], e2._tmpGroupAtTipsList = [], e2._peerReadTimeMap = /* @__PURE__ */ new Map(), e2._completedMap = /* @__PURE__ */ new Map(), e2._roamingMsgKeyAndTimeMap = /* @__PURE__ */ new Map(), e2._remoteGroupReadSeqMap = /* @__PURE__ */ new Map(), e2._convTotalUnreadCount = 0, e2._pagingGetCostList = [], e2._convMapForDiff = /* @__PURE__ */ new Map(), e2._partialUpdatedConvMap = /* @__PURE__ */ new Map(), e2._everClearedMap = /* @__PURE__ */ new Map(), e2._bPullOnInvite = true, e2._initListeners(), e2; + } + function Qi(e2) { + d(this, Qi), this._convM = e2, this._n = "ConvGroupHandler", this._convGroupMap = /* @__PURE__ */ new Map(), this._startIndex = 0, this._pagingStatus = Nn; + } + function $i(e2) { + d(this, $i), this._convM = e2, this._n = "MsgRemindHandler"; + } + function ea(e2, t2) { + var n2 = 2 < arguments.length && void 0 !== arguments[2] && arguments[2]; + d(this, ea), this.conversationID = e2.conversationID || "", this.unreadCount = e2.unreadCount || 0, this.type = e2.type || "", this.lastMessage = Ko(e2.lastMessage, t2, n2), e2.lastMsgTime && (this.lastMessage.lastTime = e2.lastMsgTime), this._isInfoCompleted = false, this.peerReadTime = e2.peerReadTime || 0, this.groupAtInfoList = [], this.remark = "", this.isPinned = e2.isPinned || false, this.messageRemindType = e2.messageRemindType, this.markList = e2.markList || [], this.customData = e2.customData || "", this.conversationGroupList = e2.conversationGroupList || [], this.draftText = e2.draftText || "", this._initProfile(e2), this.subType = this.groupProfile ? this.groupProfile.type : ""; + } + function ta(e2) { + d(this, ta), 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: "", userID: "", memberCustomField: void 0, readedSequence: 0, excludedUnreadSequenceList: void 0 }, this.lastMessage = { lastTime: "", lastSequence: "", fromAccount: "", messageForShow: "" }, this.nextMessageSeq = "", this.memberNum = "", this.memberCount = "", this.maxMemberNum = "", this.maxMemberCount = "", this.joinOption = "", this.inviteOption = "", this.groupCustomField = [], this.muteAllMembers = false, this.isSupportTopic = false, this._lastRevokedTime = 0, this._initGroup(e2); + } + function na(e2) { + d(this, na), this.MAX_LENGTH = e2, this.map = /* @__PURE__ */ new Map(); + } + function oa(e2) { + var t2 = this; + d(this, oa), S(e2) || (this.userID = e2.userID || "", this.nick = e2.nick || "", this.gender = e2.gender || "", this.birthday = e2.birthday || 0, this.location = e2.location || "", this.selfSignature = e2.selfSignature || "", this.allowType = e2.allowType || A.ALLOW_TYPE_ALLOW_ANY, this.language = e2.language || 0, this.avatar = e2.avatar || "", this.messageSettings = e2.messageSettings || 0, this.adminForbidType = e2.adminForbidType || A.FORBID_TYPE_NONE, this.level = e2.level || 0, this.role = e2.role || 0, this.lastUpdatedTime = 0, this.profileCustomField = [], S(e2.profileCustomField)) || e2.profileCustomField.forEach(function(e3) { + t2.profileCustomField.push({ key: e3.key, value: e3.value }); + }); + } + function ia() { + return null; + } + function aa(e2) { + var t2 = e2.get(12); + return { SDKType: 10, SDKAppID: t2.getSDKAppID(), SDKVersion: t2.getVersion(), tinyID: Number(t2.getTinyID()), userID: t2.getUserID(), platform: e2.getPlatform(), instanceID: t2.getInstanceID(), traceID: We() }; + } + e(fa, [{ key: "_errorTolerantHandle", value: function() { + v || "undefined" != typeof window && this._canIUseCookies() || (this.getItem = ia, this.setItem = ia, this.removeItem = ia, this.clear = ia); + } }, { key: "onCheckTimer", value: function(e2) { + e2 % 20 == 0 && 0 !== this._storageQueue.size && this._doFlush(); + } }, { key: "_doFlush", value: function() { + try { + var e2, t2 = Z(this._storageQueue); + try { + for (t2.s(); !(e2 = t2.n()).done; ) { + var n2 = Y(e2.value, 2), o2 = n2[0], i2 = n2[1]; + this._setStorageSync(this._getKey(o2), i2); + } + } catch (e3) { + t2.e(e3); + } finally { + t2.f(); + } + this._storageQueue.clear(); + } catch (e3) { + M.w("".concat(this._n, "._doFlush error:"), e3); + } + } }, { key: "_getPrefix", value: function() { + var e2 = this._m.get(12); + return "TIM_".concat(e2.getSDKAppID(), "_").concat(e2.getUserID(), "_"); + } }, { key: "_getKey", value: function(e2) { + return "".concat(this._getPrefix()).concat(e2); + } }, { key: "getItem", value: function(e2) { + var t2 = !(1 < arguments.length && void 0 !== arguments[1]) || arguments[1]; + try { + var n2 = t2 ? this._getKey(e2) : e2; + return this.getStorageSync(n2); + } catch (e3) { + return M.w("".concat(this._n, ".getItem error:"), e3), {}; + } + } }, { key: "setItem", value: function(e2, t2) { + var n2; + 2 < arguments.length && void 0 !== arguments[2] && arguments[2] ? (n2 = !(3 < arguments.length && void 0 !== arguments[3]) || arguments[3] ? this._getKey(e2) : e2, this._setStorageSync(n2, t2)) : this._storageQueue.set(e2, t2); + } }, { key: "clear", value: function() { + try { + v ? I.clearStorageSync() : this._canIUseCookies() && localStorage.clear(); + } catch (e2) { + M.w("".concat(this._n, ".clear error:"), e2); + } + } }, { key: "removeItem", value: function(e2) { + var t2 = !(1 < arguments.length && void 0 !== arguments[1]) || arguments[1]; + try { + var n2 = t2 ? this._getKey(e2) : e2; + this._removeStorageSync(n2); + } catch (e3) { + M.w("".concat(this._n, ".removeItem error:"), e3); + } + } }, { key: "getSize", value: function(e2) { + var t2 = this, n2 = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : "b"; + try { + var o2 = { size: 0, limitSize: 5242880, unit: n2 }; + if (Object.defineProperty(o2, "leftSize", { enumerable: true, get: function() { + return o2.limitSize - o2.size; + } }), v && (o2.limitSize = 1024 * I.getStorageInfoSync().limitSize), e2) + o2.size = JSON.stringify(this.getItem(e2)).length + this._getKey(e2).length; + else if (v) + I.getStorageInfoSync().keys.forEach(function(e3) { + o2.size += JSON.stringify(t2.getStorageSync(e3)).length + t2._getKey(e3).length; + }); + else if (this._canIUseCookies()) + for (var i2 in localStorage) + localStorage.hasOwnProperty(i2) && (o2.size += localStorage.getItem(i2).length + i2.length); + return this._convertUnit(o2); + } catch (e3) { + M.w("".concat(this._n, " error:"), e3); + } + } }, { key: "_convertUnit", value: function(e2) { + var t2, n2 = {}, o2 = e2.unit; + for (t2 in n2.unit = o2, e2) + "number" == typeof e2[t2] && ("kb" === o2.toLowerCase() ? n2[t2] = Math.round(e2[t2] / 1024) : "mb" === o2.toLowerCase() ? n2[t2] = Math.round(e2[t2] / 1024 / 1024) : n2[t2] = e2[t2]); + return n2; + } }, { key: "_setStorageSync", value: function(e2, t2) { + v ? ve ? my.setStorageSync({ key: e2, data: t2 }) : I.setStorageSync(e2, t2) : this._canIUseCookies() && localStorage.setItem(e2, JSON.stringify(t2)); + } }, { key: "getStorageSync", value: function(e2) { + return v ? ve ? my.getStorageSync({ key: e2 }).data : I.getStorageSync(e2) : this._canIUseCookies() ? JSON.parse(localStorage.getItem(e2)) : {}; + } }, { key: "_removeStorageSync", value: function(e2) { + v ? ve ? my.removeStorageSync({ key: e2 }) : I.removeStorageSync(e2) : this._canIUseCookies() && localStorage.removeItem(e2); + } }, { key: "_canIUseCookies", value: function() { + return "undefined" != typeof window && navigator && navigator.cookieEnabled && localStorage; + } }, { key: "reset", value: function() { + M.l("".concat(this._n, ".reset")), this._doFlush(); + } }]); + var sa, ra = fa, ca = (e(ga, [{ key: "pushIn", value: function(e2) { + M.d("".concat(this._n, ".pushIn"), this._report.length, e2), this._report.push(e2); + } }, { key: "backfill", value: function(e2) { + var t2; + O(e2) && 0 !== e2.length && (M.d("".concat(this._n, ".backfill"), this._report.length, e2.length), (t2 = this._report).unshift.apply(t2, p(e2))); + } }, { 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: "getLogsInMemory", value: function() { + var e2 = this._report.slice(); + return this._reset(), e2; + } }]), ga), ua = (t(ha, u), sa = n(ha), e(ha, [{ key: "reportAtOnce", value: function() { + this._report(); + } }, { key: "_onLoginSuccess", value: function() { + var t2 = this, e2 = this.get(13), n2 = e2.getItem(this.TAG, false); + !S(n2) && lt(n2.forEach) && (M.l("".concat(this._n, "._onLoginSuccess. logs count:").concat(n2.length)), n2.forEach(function(e3) { + t2._reportBody.pushIn(e3); + }), e2.removeItem(this.TAG, false)); + } }, { key: "_onCloudConfig", value: function() { + var e2 = this.getCloudConfig("evt_rpt_threshold"), t2 = this.getCloudConfig("evt_rpt_waiting"), n2 = this.getCloudConfig("evt_rpt_level"), o2 = this.getCloudConfig("evt_rpt_sdkappid_bl"), i2 = this.getCloudConfig("evt_rpt_tinyid_wl"); + N(e2) || (this.MIN_THRESHOLD = Number(e2)), N(t2) || (this.WAITING_TIME = Number(t2)), N(n2) || (this.REPORT_LEVEL = n2.split(",").map(function(e3) { + return Number(e3); + })), N(o2) || (this.REPORT_SDKAPPID_BLACKLIST = o2.split(",").map(function(e3) { + return Number(e3); + })), N(i2) || (this.REPORT_TINYID_WHITELIST = i2.split(",")); + } }, { key: "pushIn", value: function(e2) { + e2 instanceof G && (e2.updateTimeStamp(), this._reportBody.pushIn(e2), this._reportBody.getLogsNumInMemory() >= this.MIN_THRESHOLD) && this._report(); + } }, { key: "onCheckTimer", value: function() { + Date.now() < this._lastReportTime + this.WAITING_TIME || this._reportBody.isEmpty() || this._report(); + } }, { key: "_filterLogs", value: function(e2) { + var t2 = this, n2 = this.get(12), o2 = n2.getSDKAppID(), n2 = n2.getTinyID(); + return Wt(this.REPORT_SDKAPPID_BLACKLIST, o2) && !jt(this.REPORT_TINYID_WHITELIST, n2) ? [] : e2.filter(function(e3) { + return t2.REPORT_LEVEL.includes(e3.level); + }); + } }, { key: "_report", value: function() { + var t2, e2, n2 = this; + this._reportBody.isEmpty() || (t2 = this._reportBody.getLogsInMemory(), 0 !== (e2 = this._filterLogs(t2)).length ? (e2 = { header: aa(this), event: e2 }, this.req({ P: k.SSO_STAT, data: y({}, e2) }).then(function() { + n2._lastReportTime = Date.now(); + }).catch(function(e3) { + M.w("".concat(n2._n, "._report failed. error:"), e3), n2._lastReportTime = Date.now(), n2._reportBody.backfill(t2), n2._reportBody.getLogsNumInMemory() > n2.MAX_THRESHOLD && n2._flushAtOnce(); + })) : this._lastReportTime = Date.now()); + } }, { key: "_flushAtOnce", value: function() { + var e2 = this.get(13), t2 = e2.getItem(this.TAG, false), n2 = this._reportBody.getLogsInMemory(), o2 = "".concat(this._n, "._flushAtOnce"); + S(t2) ? (M.l("".concat(o2, " count:").concat(n2.length)), e2.setItem(this.TAG, n2, true, false)) : ((n2 = n2.concat(t2)).length > this.MAX_THRESHOLD && (n2 = n2.slice(0, this.MAX_THRESHOLD)), M.l("".concat(o2, " count:").concat(n2.length)), e2.setItem(this.TAG, n2, true, false)); + } }, { key: "reset", value: function() { + M.l("".concat(this._n, ".reset")), this._lastReportTime = 0, this._report(), this.REPORT_SDKAPPID_BLACKLIST = [], this.REPORT_TINYID_WHITELIST = []; + } }]), ha), la = "none", da = "online", pa = (e(_a, [{ key: "_startRN", value: function() { + var e2, n2 = this; + ye && (e2 = this._m.get(18).getPlugin("chat-network-monitor")) && (this._removeListener = e2.addEventListener(function(e3) { + var t2 = e3.isConnected, e3 = e3.type; + n2._networkType !== e3 && n2._onNetworkStatusChange({ isConnected: void 0 !== t2 && t2, networkType: e3 }); + })); + } }, { key: "start", value: function() { + var t2 = this, n2 = "".concat(this._n, ".start"); + v ? (I.getNetworkType({ success: function(e2) { + t2._networkType = e2.networkType || e2.subtype || "", e2.networkType === la ? M.w("".concat(n2, " no network, please check!")) : M.i("".concat(n2, " networkType:").concat(e2.networkType)); + } }), this._mpNetworkStatusCallback = this._onNetworkStatusChange.bind(this), I.onNetworkStatusChange(this._mpNetworkStatusCallback)) : Ce && (this._networkType = da, this._webOnlineCallback = this._onWebOnline.bind(this), this._webOfflineCallback = this._onWebOffline.bind(this), window.addEventListener("online", this._webOnlineCallback), window.addEventListener("offline", this._webOfflineCallback)); + } }, { key: "_onWebOnline", value: function() { + this._onNetworkStatusChange({ isConnected: true, networkType: da }); + } }, { key: "_onWebOffline", value: function() { + this._onNetworkStatusChange({ isConnected: false, networkType: la }); + } }, { key: "_onNetworkStatusChange", value: function(e2) { + var t2 = e2.isConnected, e2 = e2.networkType, n2 = "".concat(this._n, "._onNetworkStatusChange"), o2 = false, i2 = "previous:".concat(this._networkType, " current:").concat(e2); + t2 ? (M.i("".concat(n2, " ").concat(i2)), this._networkType !== e2 && (o2 = true, this._networkType = e2, this._m.get(21).reConnect(true))) : this._networkType !== e2 && (o2 = true, this._networkType = e2, M.w("".concat(n2, " no network, please check!")), this._m.get(21).offline()), o2 && new G("networkChange").setMessage("isConnected:".concat(t2, " ").concat(i2)).end(); + } }, { key: "isOnline", value: function() { + return this._networkType !== la; + } }, { key: "getNetworkType", value: function() { + return this._networkType; + } }, { key: "reset", value: function() { + M.l("".concat(this._n, ".reset")), v ? null !== this._mpNetworkStatusCallback && (I.offNetworkStatusChange && I.offNetworkStatusChange(this._mpNetworkStatusCallback), this._mpNetworkStatusCallback = null) : Ce ? (null !== this._webOnlineCallback && (window.removeEventListener("online", this._webOnlineCallback), this._webOnlineCallback = null), null !== this._onWebOffline && (window.removeEventListener("offline", this._webOfflineCallback), this._webOfflineCallback = null)) : ye && this._removeListener && (this._removeListener(), this._removeListener = null); + } }]), _a); + function _a(e2) { + d(this, _a), this._m = e2, this._networkType = da, this._n = "NetMonitorModule", this._mpNetworkStatusCallback = null, this._webOnlineCallback = null, this._webOfflineCallback = null, this._removeListener = null, this._m.getIEmitInst().on(P.A2KEY_AND_TINYID_UPDATED, this._startRN, this); + } + function ha(e2) { + d(this, ha), (e2 = sa.call(this, e2))._n = "EventStatModule", e2.TAG = "im-ssolog-event", e2._reportBody = new ca(), e2.MIN_THRESHOLD = 20, e2.MAX_THRESHOLD = 100, e2.WAITING_TIME = 6e4, e2.REPORT_LEVEL = [4, 5, 6], e2.REPORT_SDKAPPID_BLACKLIST = [], e2.REPORT_TINYID_WHITELIST = [], e2._lastReportTime = Date.now(); + var t2 = e2.getIEmitInst(); + return t2.on(P.A2KEY_AND_TINYID_UPDATED, e2._onLoginSuccess, i(e2)), t2.on(P.CLOUD_CONFIG, e2._onCloudConfig, i(e2)), e2; + } + function ga(e2) { + d(this, ga), this._n = "SSOLogBody", this._report = []; + } + function fa(e2) { + d(this, fa), this._m = e2, this._n = "StorageModule", this._storageQueue = /* @__PURE__ */ new Map(), this._errorTolerantHandle(); + } + function ma(e2, t2) { + return e2(t2 = { exports: {} }, t2.exports), t2.exports; + } + var va, Ia = ma(function(e2) { + var o2 = Object.prototype.hasOwnProperty, _2 = "~"; + function n2() { + } + function a2(e3, t3, n3) { + this.fn = e3, this.context = t3, this.once = n3 || false; + } + function i2(e3, t3, n3, o3, i3) { + if ("function" != typeof n3) + throw new TypeError("The listener must be a function"); + n3 = new a2(n3, o3 || e3, i3), o3 = _2 ? _2 + t3 : t3; + return e3._events[o3] ? e3._events[o3].fn ? e3._events[o3] = [e3._events[o3], n3] : e3._events[o3].push(n3) : (e3._events[o3] = n3, e3._eventsCount++), e3; + } + function c2(e3, t3) { + 0 == --e3._eventsCount ? e3._events = new n2() : delete e3._events[t3]; + } + function t2() { + this._events = new n2(), this._eventsCount = 0; + } + Object.create && (n2.prototype = /* @__PURE__ */ Object.create(null), new n2().__proto__ || (_2 = false)), t2.prototype.eventNames = function() { + var e3, t3, n3 = []; + if (0 === this._eventsCount) + return n3; + for (t3 in e3 = this._events) + o2.call(e3, t3) && n3.push(_2 ? t3.slice(1) : t3); + return Object.getOwnPropertySymbols ? n3.concat(Object.getOwnPropertySymbols(e3)) : n3; + }, t2.prototype.listeners = function(e3) { + var e3 = _2 ? _2 + e3 : e3, t3 = this._events[e3]; + if (!t3) + return []; + if (t3.fn) + return [t3.fn]; + for (var n3 = 0, o3 = t3.length, i3 = new Array(o3); n3 < o3; n3++) + i3[n3] = t3[n3].fn; + return i3; + }, t2.prototype.listenerCount = function(e3) { + e3 = _2 ? _2 + e3 : e3, e3 = this._events[e3]; + return e3 ? e3.fn ? 1 : e3.length : 0; + }, t2.prototype.emit = function(e3, t3, n3, o3, i3, a3) { + var s2 = _2 ? _2 + e3 : e3; + if (!this._events[s2]) + return false; + var r2, c3 = this._events[s2], u2 = arguments.length; + if (c3.fn) { + switch (c3.once && this.removeListener(e3, c3.fn, void 0, true), u2) { + case 1: + return c3.fn.call(c3.context), true; + case 2: + return c3.fn.call(c3.context, t3), true; + case 3: + return c3.fn.call(c3.context, t3, n3), true; + case 4: + return c3.fn.call(c3.context, t3, n3, o3), true; + case 5: + return c3.fn.call(c3.context, t3, n3, o3, i3), true; + case 6: + return c3.fn.call(c3.context, t3, n3, o3, i3, a3), true; + } + for (p2 = 1, r2 = new Array(u2 - 1); p2 < u2; p2++) + r2[p2 - 1] = arguments[p2]; + c3.fn.apply(c3.context, r2); + } else + for (var l2, d2 = c3.length, p2 = 0; p2 < d2; p2++) + switch (c3[p2].once && this.removeListener(e3, c3[p2].fn, void 0, true), u2) { + case 1: + c3[p2].fn.call(c3[p2].context); + break; + case 2: + c3[p2].fn.call(c3[p2].context, t3); + break; + case 3: + c3[p2].fn.call(c3[p2].context, t3, n3); + break; + case 4: + c3[p2].fn.call(c3[p2].context, t3, n3, o3); + break; + default: + if (!r2) + for (l2 = 1, r2 = new Array(u2 - 1); l2 < u2; l2++) + r2[l2 - 1] = arguments[l2]; + c3[p2].fn.apply(c3[p2].context, r2); + } + return true; + }, t2.prototype.on = function(e3, t3, n3) { + return i2(this, e3, t3, n3, false); + }, t2.prototype.once = function(e3, t3, n3) { + return i2(this, e3, t3, n3, true); + }, t2.prototype.removeListener = function(e3, t3, n3, o3) { + e3 = _2 ? _2 + e3 : e3; + if (this._events[e3]) + if (t3) { + var i3 = this._events[e3]; + if (i3.fn) + i3.fn !== t3 || o3 && !i3.once || n3 && i3.context !== n3 || c2(this, e3); + else { + for (var a3 = 0, s2 = [], r2 = i3.length; a3 < r2; a3++) + (i3[a3].fn !== t3 || o3 && !i3[a3].once || n3 && i3[a3].context !== n3) && s2.push(i3[a3]); + s2.length ? this._events[e3] = 1 === s2.length ? s2[0] : s2 : c2(this, e3); + } + } else + c2(this, e3); + return this; + }, t2.prototype.removeAllListeners = function(e3) { + return e3 ? (e3 = _2 ? _2 + e3 : e3, this._events[e3] && c2(this, e3)) : (this._events = new n2(), this._eventsCount = 0), this; + }, t2.prototype.off = t2.prototype.removeListener, t2.prototype.addListener = t2.prototype.on, t2.prefixed = _2, e2.exports = t2.EventEmitter = t2; + }), Ma = ["rich.my-imcloud.com", "imrich.qcloud.com"], ya = ["requestSnapshotUrl"], Ca = (t(ka, u), va = n(ka), e(ka, [{ key: "_init", value: function() { + this._fileDownloadProxy = this.getFileDownloadProxy(), this._authKey = this.getDowloadFileAuthKey(); + var e2 = this.get(18); + this.TIMUploadPlugin = e2.getPlugin("tim-upload-plugin"), this.TIMUploadPlugin ? this._initUploaderMethod() : (this.COSSDK = e2.getPlugin(e2 = v ? "cos-wx-sdk" : "cos-js-sdk"), this.COSSDK ? (this._getAuthorizationKey(), this.warn("CosReplacement", e2)) : this.warn("PluginUndetected")); + } }, { key: "_onCloudConfig", value: function() { + var t2 = this, e2 = "".concat(this._n, "._onCloudConfig"), n2 = this.getCloudConfig("upload_size_limit"), o2 = this.getCloudConfig("simple_cos"), i2 = this.getCloudConfig("file_dn_list"); + if (M.l("".concat(e2, " uploadSizeLimit:").concat(n2, " simpleCos:").concat(o2)), !N(n2)) + try { + var a2 = JSON.parse(n2); + this.UPLOAD_SIZE_LIMIT = { A: a2.a ? 1048576 * parseInt(a2.a) : this.UPLOAD_SIZE_LIMIT.A, F: a2.f ? 1048576 * parseInt(a2.f) : this.UPLOAD_SIZE_LIMIT.F, I: a2.i ? 1048576 * parseInt(a2.i) : this.UPLOAD_SIZE_LIMIT.I, V: a2.v ? 1048576 * parseInt(a2.v) : this.UPLOAD_SIZE_LIMIT.V }; + } catch (e3) { + } + if (N(o2) || (this.isSimpleCos = "1" === o2), !N(i2)) + try { + JSON.parse(i2).forEach(function(e3) { + t2._fileDNList.includes(e3) || t2._fileDNList.push(e3); + }); + } catch (e3) { + } + } }, { key: "_getAuthorizationKey", value: function() { + var n2 = this, o2 = "".concat(this._n, ".").concat("_getAuthorizationKey"), i2 = new G("_getAuthorizationKey"), a2 = Math.ceil(Date.now() / 1e3); + this.req({ P: k.COS_SIGN, data: { duration: this.expiredTimeLimit } }).then(function(e2) { + var e2 = e2.data, t2 = (M.l("".concat(o2, " ok. data:"), e2), e2.expiredTime - a2); + i2.setMessage("requestId:".concat(e2.requestId, " requestTime:").concat(a2, " expiredTime:").concat(e2.expiredTime, " diff:").concat(t2, "s")).end(), !v && e2.region && (n2.region = e2.region), n2.appid = e2.appid, n2.bucketName = e2.bucketName, n2.ciUrl = e2.ciUrl, n2.directory = e2.directory, n2.downloadUrl = e2.downloadUrl, n2.uploadUrl = e2.uploadUrl, n2.cosOptions = { secretId: e2.secretId, secretKey: e2.secretKey, sessionToken: e2.sessionToken, expiredTime: e2.expiredTime }, M.l("".concat(o2, " ok. region:").concat(n2.region, " bucketName:").concat(n2.bucketName)), n2._initUploaderMethod(); + }).catch(function(e2) { + i2.setError(e2).end(), M.w("".concat(o2, " failed. error:"), e2); + }); + } }, { key: "_getCosPreSigUrl", value: function(t2) { + var i2 = this, a2 = "".concat(this._n, ".").concat("_getCosPreSigUrl"), s2 = Math.ceil(Date.now() / 1e3), r2 = new G("_getCosPreSigUrl"), e2 = { uploadMethod: t2.uploadMethod, platform: this.getPlatform(), SDKAppID: this.getSDKAppID(), userID: t2.userID, conversationType: t2.conversationType, uploadConfig: [{ fileID: 1, fileType: t2.fileType, fileName: t2.fileName }] }, n2 = k.SIMPLE_COS_PRE_SIG; + return this.isSimpleCos || (e2 = { fileType: t2.fileType, fileName: t2.fileName, uploadMethod: t2.uploadMethod, duration: t2.duration }, n2 = k.COS_PRE_SIG), this.req({ P: n2, data: e2 }).then(function(e3) { + i2.tryCount = 0; + var t3, n3, e3 = e3.data || {}, o2 = (M.l("".concat(a2, " ok. isSimpleCos:").concat(i2.isSimpleCos, " data:"), e3), ""); + return o2 = i2.isSimpleCos ? (t3 = (n3 = e3.preSig[0]).uploadUrl, n3 = n3.fileKey, "uploadIP:".concat(e3.uploadIP, " uploadUrl:").concat(t3, " fileKey:").concat(n3, " cost:").concat(nn(s2))) : "requestId:".concat(e3.requestId, " expiredTime:").concat(e3.expiredTime, " diff:").concat(e3.expiredTime - s2, "s"), r2.setMessage(o2).end(), e3; + }).catch(function(e3) { + return -1 === e3.code && (e3.code = L.COS_GET_SIG_FAIL), r2.setError(e3).end(), M.w("".concat(a2, " failed. error:"), e3), i2.tryCount < 1 ? (i2.tryCount++, i2._getCosPreSigUrl(t2)) : (i2.tryCount = 0, D({ code: L.COS_GET_SIG_FAIL })); + }); + } }, { key: "_initUploaderMethod", value: function() { + var n2 = this; + this.TIMUploadPlugin ? (this.timUploadPlugin = new this.TIMUploadPlugin(), this._cosUploadMethod = function(e2, t2) { + n2.timUploadPlugin.uploadFile(e2, t2); + }) : this.appid && (this.cos = v ? new this.COSSDK({ ForcePathStyle: true, getAuthorization: this._getAuthorization.bind(this) }) : new this.COSSDK({ getAuthorization: this._getAuthorization.bind(this) }), this._cosUploadMethod = v ? function(e2, t2) { + n2.cos.postObject(e2, t2); + } : function(e2, t2) { + n2.cos.uploadFiles(e2, t2); + }); + } }, { key: "onCheckTimer", value: function(e2) { + !this.COSSDK || this.TIMUploadPlugin || this.isLoggedIn() && e2 % 60 == 0 && Math.ceil(Date.now() / 1e3) >= this.cosOptions.expiredTime - 120 && this._getAuthorizationKey(); + } }, { key: "getFileDNList", value: function() { + return this._fileDNList; + } }, { key: "_getAuthorization", value: function(e2, t2) { + t2({ TmpSecretId: this.cosOptions.secretId, TmpSecretKey: this.cosOptions.secretKey, XCosSecurityToken: this.cosOptions.sessionToken, ExpiredTime: this.cosOptions.expiredTime }); + } }, { key: "upload", value: function(e2) { + if (true === e2._relayFlag) + return Promise.resolve(); + var t2 = this.get(26); + switch (e2.type) { + case A.MSG_IMAGE: + return t2.addTotalCount(Wn), this._uploadImage(e2); + case A.MSG_FILE: + return t2.addTotalCount(Wn), this._uploadFile(e2); + case A.MSG_AUDIO: + return t2.addTotalCount(Wn), this._uploadAudio(e2); + case A.MSG_VIDEO: + return t2.addTotalCount(Wn), this._uploadVideo(e2); + default: + return Promise.resolve(); + } + } }, { key: "_uploadImage", value: function(v2) { + var I2 = this, e2 = this.get(2), M2 = v2.getElements()[0], t2 = e2.getMessageOption(v2.clientSequence); + return this.doUploadImage({ file: t2.payload.file, to: t2.to, message: v2, onProgress: function(e3) { + if (M2.updatePercent(e3), lt(t2.onProgress)) + try { + t2.onProgress(e3); + } catch (e4) { + return D({ code: L.MSG_ONPROGRESS_ERR }); + } + } }).then(function(e3) { + var t3 = e3.location, n2 = e3.fileType, o2 = e3.fileSize, i2 = e3.width, a2 = e3.height, s2 = e3.smallImageUrl, r2 = e3.smallImageWidth, c2 = e3.smallImageHeight, u2 = e3.largeImageUrl, l2 = e3.largeImageWidth, d2 = e3.largeImageHeight, p2 = e3.imageInfoArray, e3 = I2.isPrivateNetWork() ? t3 : It(t3); + M2.updateImageFormat(n2); + var _2, h2, g2 = { size: o2, url: e3, width: i2, height: a2 }; + if (p2 && 0 < p2.length) + for (var f2 = 0; f2 < p2.length; f2++) { + var m2 = p2[f2]; + 1 === m2.type ? _2 = m2 : 2 === m2.type ? h2 = m2 : g2 = y(y({}, g2), m2); + } + else + h2 = s2 && u2 ? (_2 = { url: s2, width: r2, height: c2 }, { url: u2, width: l2, height: d2 }) : (_2 = Ht({ originUrl: e3, originWidth: i2, originHeight: a2, min: 198 }), Ht({ originUrl: e3, originWidth: i2, originHeight: a2, min: 720 })); + return M2.updateImageInfoArray([y({}, g2), y({}, h2), y({}, _2)]), v2; + }); + } }, { key: "_uploadFile", value: function(n2) { + var o2 = this, e2 = this.get(2), i2 = n2.getElements()[0], t2 = e2.getMessageOption(n2.clientSequence); + return this.doUploadFile({ file: t2.payload.file, to: t2.to, message: n2, onProgress: function(e3) { + if (i2.updatePercent(e3), lt(t2.onProgress)) + try { + t2.onProgress(e3); + } catch (e4) { + return D({ code: L.MSG_ONPROGRESS_ERR }); + } + } }).then(function(e3) { + var e3 = e3.location, t3 = e3; + return o2.isPrivateNetWork() || (t3 = ao(t3 = It(e3), o2._fileDownloadProxy, o2._authKey, o2._fileDNList)), i2.updateFileUrl(t3), n2; + }); + } }, { key: "_uploadAudio", value: function(t2) { + var n2 = this, e2 = this.get(2), o2 = t2.getElements()[0], i2 = e2.getMessageOption(t2.clientSequence); + return this.doUploadAudio({ file: i2.payload.file, to: i2.to, message: t2, onProgress: function(e3) { + if (o2.updatePercent(e3), lt(i2.onProgress)) + try { + i2.onProgress(e3); + } catch (e4) { + return D({ code: L.MSG_ONPROGRESS_ERR }); + } + } }).then(function(e3) { + e3 = e3.location, e3 = n2.isPrivateNetWork() ? e3 : It(e3); + return o2.updateAudioUrl(e3), t2; + }); + } }, { key: "_uploadVideo", value: function(n2) { + var o2 = this, e2 = this.get(2), i2 = n2.getElements()[0], t2 = e2.getMessageOption(n2.clientSequence); + return this.doUploadVideo({ file: t2.payload.file, to: t2.to, message: n2, onProgress: function(e3) { + if (i2.updatePercent(e3), lt(t2.onProgress)) + try { + t2.onProgress(e3); + } catch (e4) { + return D({ code: L.MSG_ONPROGRESS_ERR }); + } + } }).then(function(e3) { + var t3 = e3.location, e3 = e3.snapshotInfo, t3 = o2.isPrivateNetWork() ? t3 : It(t3); + return i2.updateVideoUrl(t3), S(e3) || i2.updateSnapshotInfo(e3), n2; + }); + } }, { key: "_checkSizeError", value: function(e2) { + var t2 = ""; + return "A" === e2 ? t2 = "audio" : "I" === e2 ? t2 = "image" : "V" === e2 ? t2 = "video" : "F" === e2 && (t2 = "file"), D({ code: L["MSG_".concat(e2, "_SIZE_LIMIT")], message: this.getErrMsg("UploadSizeLimit", t2, "".concat(this.UPLOAD_SIZE_LIMIT[e2] / 1048576, "MB")) }); + } }, { key: "doUploadImage", value: function(o2) { + var e2, i2, a2 = this; + return !o2.file || this._isEmptyFileList(o2.file.files) ? D({ code: L.MSG_I_SELECT_F_FIRST }) : true !== (e2 = this._checkImageType(o2.file)) ? e2 : true !== (e2 = this._checkImageSize(o2.file)) ? e2 : (i2 = null, this._setUploadFileType(1), this.uploadByCOS(o2).then(function(e3) { + if (i2 = e3, a2.isPrivateNetWork()) + return Ft(n2); + if (O(i2.imageInfoArray)) { + var t2 = i2.imageInfoArray.find(function(e4) { + return 3 === e4.type; + }); + if (t2) + return t2; + } + var n2; + return ye ? { width: o2.file.width, height: o2.file.height } : (n2 = It(e3.location), a2.COSSDK ? Ft(n2) : Ft(n2 = ao(n2, a2._fileDownloadProxy, a2._authKey, a2._fileDNList))); + }).then(function(e3) { + return i2.width = e3.width, i2.height = e3.height, Promise.resolve(i2); + })); + } }, { key: "_checkImageType", value: function(e2) { + var t2 = "", t2 = v ? e2.url.slice(e2.url.lastIndexOf(".") + 1) : ye ? e2.type.split("/")[1] : e2.files[0].name.slice(e2.files[0].name.lastIndexOf(".") + 1); + return 0 <= Qo.indexOf(t2.toLowerCase()) || D({ code: L.MSG_I_TYPES_LIMIT }); + } }, { key: "_checkImageSize", value: function(e2) { + return 0 === (e2 = (v || ye ? e2 : e2.files[0]).size) ? D({ code: L.MSG_F_IS_EMPTY }) : e2 < this.UPLOAD_SIZE_LIMIT.I || this._checkSizeError("I"); + } }, { key: "doUploadFile", value: function(e2) { + return !e2.file || this._isEmptyFileList(e2.file.files) ? D({ code: L.MSG_F_SELECT_F_FIRST }) : e2.file.files[0].size > this.UPLOAD_SIZE_LIMIT.F ? this._checkSizeError("F") : 0 === e2.file.files[0].size ? D({ code: L.MSG_F_IS_EMPTY }) : (this._setUploadFileType(255), this.uploadByCOS(e2)); + } }, { key: "doUploadVideo", value: function(e2) { + return e2.file.videoFile.size > this.UPLOAD_SIZE_LIMIT.V ? this._checkSizeError("V") : 0 === e2.file.videoFile.size ? D({ code: L.MSG_F_IS_EMPTY }) : -1 === $o.indexOf(e2.file.videoFile.type) ? D({ code: L.MSG_V_TYPES_LIMIT }) : (this._setUploadFileType(2), v || ye ? this.handleVideoUpload(y(y({}, e2), {}, { file: e2.file.videoFile })) : Ce ? this.handleVideoUpload(e2) : void 0); + } }, { key: "handleVideoUpload", value: function(n2) { + var o2 = this; + return new Promise(function(t2, e2) { + o2.uploadByCOS(n2).then(function(e3) { + t2(e3); + }).catch(function() { + o2.uploadByCOS(n2).then(function(e3) { + t2(e3); + }).catch(function() { + e2(new E({ code: L.MSG_V_UPLOAD_FAIL })); + }); + }); + }); + } }, { key: "doUploadAudio", value: function(e2) { + return e2.file ? e2.file.size > this.UPLOAD_SIZE_LIMIT.A ? this._checkSizeError("A") : 0 === e2.file.size ? D({ code: L.MSG_F_IS_EMPTY }) : (this._setUploadFileType(3), this.uploadByCOS(e2)) : D({ code: L.MSG_A_UPLOAD_FAIL }); + } }, { key: "uploadByCOS", value: function(t2) { + var c2, u2, l2, d2, p2 = this; + return lt(this._cosUploadMethod) ? this.timUploadPlugin ? this._uploadWithPreSigUrl(t2) : (c2 = new G("upload"), u2 = "".concat(this._n, ".uploadByCOS"), l2 = Date.now(), d2 = this._getFile(t2), new Promise(function(a2, s2) { + var e2 = v ? p2._createCosOptionsWXMiniApp(t2) : p2._createCosOptionsWeb(t2), r2 = p2; + p2._cosUploadMethod(e2, function(e3, t3) { + var n2, o2, i2 = /* @__PURE__ */ Object.create(null); + t3 ? e3 || O(t3.files) && t3.files[0].error ? (n2 = new E({ code: L.MSG_F_UPLOAD_FAIL }), c2.setError(n2).end(), M.l("".concat(u2, " failed. error:"), t3.files[0].error), 403 === t3.files[0].error.statusCode && p2._getAuthorizationKey(), s2(n2)) : (i2.fileName = d2.name, i2.fileSize = d2.size, i2.fileType = d2.type.slice(d2.type.indexOf("/") + 1).toLowerCase(), i2.location = (v ? t3 : t3.files[0].data).Location, n2 = Date.now() - l2, t3 = r2._formatFileSize(d2.size), o2 = r2._formatSpeed(1e3 * d2.size / n2), t3 = "size:".concat(t3, " time:").concat(n2, "ms speed:").concat(o2), M.l("".concat(u2, " success. name:").concat(d2.name, " ").concat(t3)), a2(i2), (o2 = p2.get(26)).addCost(Wn, n2), o2.addFileSize(Wn, d2.size), c2.setMessage(t3).end()) : (i2 = new E({ code: L.MSG_F_UPLOAD_FAIL }), c2.setError(i2).end(), M.w("".concat(u2, " failed. error:"), e3), 403 === e3.statusCode && p2._getAuthorizationKey(), s2(i2)); + }); + })) : (this.warn("PluginUndetected"), D({ code: L.COS_UNDETECTED })); + } }, { key: "_uploadWithPreSigUrl", value: function(e2) { + var p2 = this, _2 = "".concat(this._n, "._uploadWithPreSigUrl"), h2 = this._getFile(e2); + return this._createCosOptionsPreSigUrl(e2).then(function(d2) { + return new Promise(function(a2, s2) { + var r2 = new G("upload"), e3 = d2.requestSnapshotUrl, c2 = void 0 === e3 ? void 0 : e3, u2 = K(d2, ya), l2 = Date.now(); + p2._cosUploadMethod(u2, function(e4, t2) { + if (e4 || 403 === t2.statusCode) + r2.setError(new E(e4)).end(), o2 = { HttpStatusCode: 9999, CostTime: nn(l2, false), error: e4, url: d2.url }, t2.data && t2.data.uploadIP && (o2.uploadIP = t2.data.uploadIP), p2._uploadSSOLog(o2), M.l("".concat(_2, " failed, error:"), e4), s2(new E({ code: L.MSG_F_UPLOAD_FAIL })); + else { + var n2 = /* @__PURE__ */ Object.create(null), o2 = t2.data.location || "", e4 = (p2.isPrivateNetWork() || 0 !== o2.indexOf("https://") && 0 !== o2.indexOf("http://") || (o2 = o2.split("//")[1]), n2.fileName = h2.name, n2.fileSize = h2.size, n2.fileType = h2.type.slice(h2.type.indexOf("/") + 1).toLowerCase(), n2.location = o2, nn(l2, false)), o2 = p2._formatFileSize(h2.size), i2 = p2._formatSpeed(1e3 * h2.size / e4), o2 = "size:".concat(o2, " time:").concat(e4, "ms speed:").concat(i2, " res:").concat(JSON.stringify(t2.data)), i2 = (M.l("".concat(_2, " ok. name:").concat(h2.name, " ").concat(o2)), r2.setMessage(o2).end(), { HttpStatusCode: t2.statusCode, FileSize: h2.size, CostTime: e4, url: d2.url }), o2 = (t2.data && t2.data.uploadIP && (i2.uploadIP = t2.data.uploadIP), p2._uploadSSOLog(i2), p2.get(26)), i2 = (o2.addCost(Wn, e4), o2.addFileSize(Wn, h2.size), []); + if (u2.thumbUrl && u2.largeUrl && i2.push.apply(i2, [p2._getSmallImageInfoByUrl(u2.thumbUrl, n2), p2._getLargeImageInfoByUrl(u2.largeUrl, n2)]), 1 === p2.uploadFileType && p2.isSimpleCos && !p2.isPrivateNetWork() && (i2.push(p2._getImageInfoArray(u2.downloadUrl, n2)), t2.data.uploadIP) && i2.push(p2._getDownloadIP(u2.downloadUrl.split("//")[1].split("/")[0], n2)), c2 && i2.push(p2._getSnapshotInfoByUrl(c2, n2)), 0 < i2.length) + return Promise.all(i2).then(function() { + a2(n2); + }); + a2(n2); + } + }); + }); + }); + } }, { key: "_getDownloadIP", value: function(e2, n2) { + var o2 = "".concat(this._n, "._getDownloadIP"), i2 = Date.now(); + return this.req({ P: k.GET_IP, data: { domainName: e2 } }).then(function(e3) { + var t2; + e3.data && e3.data.ip && (M.l("".concat(o2, " ok. downloadIP:").concat(e3.data.ip, " cost:").concat(nn(i2))), (t2 = n2.location.split("/"))[0] = e3.data.ip, n2.location = t2.join("/")); + }).catch(function(e3) { + }); + } }, { key: "_getImageInfoArray", value: function(t2, n2) { + var o2 = this, i2 = "".concat(this._n, "._getImageInfoArray"), a2 = Date.now(); + return this.req({ P: k.GET_IMAGE_INFO, data: { imageUrl: t2 } }).then(function(e2) { + e2 = e2.data || {}; + return M.l("".concat(i2, " ok. data: ").concat(JSON.stringify(e2), " cost:").concat(nn(a2))), n2.imageInfoArray = e2.imageInfoArray, e2; + }).catch(function(e2) { + n2.imageInfoArray = void 0, o2._uploadSSOLog({ HttpStatusCode: 1e4, CostTime: nn(a2, false), url: t2 }); + }); + } }, { key: "_uploadSSOLog", value: function(e2) { + var t2, n2; + this.isSimpleCos && ((t2 = new G()).setEventType(18), e2.error && t2.setError(new E(e2.error)), n2 = "HttpStatusCode:".concat(e2.HttpStatusCode, "|CosRequestId:").concat(e2.CosRequestId || "", "|") + "FileAlreadyExist:".concat(e2.FileAlreadyExist || 0, "|FileSize:").concat(e2.FileSize || 0, "|CostTime:").concat(e2.CostTime), e2.uploadIP && (n2 += "|FinalIP:".concat(e2.uploadIP)), t2.setMessage("OK").setMoreMessage(e2.url).setExtension(n2).end()); + } }, { key: "_getRawOrUploadProxyUrl", value: function(e2) { + var t2 = this.get(12).getFileUploadProxy(), n2 = e2; + return n2 = t2 ? e2.replace(/^https:\/\/[^/]+/, t2) : n2; + } }, { key: "_getFile", value: function(e2) { + return O(e2.file.files) || dt(e2.file.files) ? e2.file.files[0] : e2.file; + } }, { key: "_formatFileSize", value: function(e2) { + return e2 < 1024 ? e2 + "B" : e2 < 1048576 ? Math.floor(e2 / 1024) + "KB" : Math.floor(e2 / 1048576) + "MB"; + } }, { key: "_formatSpeed", value: function(e2) { + return e2 <= 1048576 ? Yt(e2 / 1024, 1) + "KB/s" : Yt(e2 / 1048576, 1) + "MB/s"; + } }, { key: "_createCosOptionsWeb", value: function(t2) { + var e2 = this._getFile(t2), n2 = e2.name, n2 = n2.slice(n2.lastIndexOf(".")), n2 = this._genFileName("".concat(ft(999999)).concat(n2)); + return { files: [{ Bucket: "".concat(this.bucketName, "-").concat(this.appid), Region: this.region, Key: "".concat(this.directory, "/").concat(n2), Body: e2 }], SliceSize: 1048576, onProgress: function(e3) { + if ("function" == typeof t2.onProgress) + try { + t2.onProgress(e3.percent); + } catch (e4) { + M.w("onProgress callback error:", e4); + } + }, onFileFinish: function(e3, t3, n3) { + } }; + } }, { key: "_createCosOptionsWXMiniApp", value: function(t2) { + var e2 = this._getFile(t2), n2 = this._genFileName(e2.name), e2 = e2.url; + return { Bucket: "".concat(this.bucketName, "-").concat(this.appid), Region: this.region, Key: "".concat(this.directory, "/").concat(n2), FilePath: e2, onProgress: function(e3) { + if (M.l(JSON.stringify(e3)), "function" == typeof t2.onProgress) + try { + t2.onProgress(e3.percent); + } catch (e4) { + M.w("onProgress callback error:", e4); + } + } }; + } }, { key: "_createCosOptionsPreSigUrl", value: function(r2) { + var e2, c2 = this, u2 = "", l2 = "", t2 = 0, n2 = this._getFile(r2), t2 = v || ye ? (u2 = r2.message.type === A.MSG_FILE ? (e2 = (e2 = n2.name).slice(e2.lastIndexOf(".")), this._genFileName("".concat(ft(999999)).concat(e2))) : this._genFileName(n2.name), l2 = n2.url, 1) : (e2 = (e2 = n2.name).slice(e2.lastIndexOf(".")), u2 = this._genFileName("".concat(ft(999999)).concat(e2)), l2 = n2, 0); + return this._getCosPreSigUrl({ fileType: this.uploadFileType, fileName: u2, uploadMethod: t2, duration: this.duration, userID: r2.message.from, conversationType: Pt(r2.message.conversationID) ? 1 : 2 }).then(function(e3) { + var t3 = c2.isSimpleCos ? e3.preSig[0] : e3, n3 = t3.uploadUrl, o2 = t3.downloadUrl, i2 = t3.requestSnapshotUrl, i2 = void 0 === i2 ? void 0 : i2, a2 = t3.thumbUrl, s2 = t3.largeUrl, t3 = t3.fileKey, e3 = e3.uploadIP, e3 = void 0 === e3 ? "" : e3; + return { url: c2._getRawOrUploadProxyUrl(n3), fileType: c2.uploadFileType, fileName: u2, resources: l2, downloadUrl: o2, requestSnapshotUrl: i2, thumbUrl: a2, largeUrl: s2, fileKey: t3, uploadIP: !c2.isPrivateNetWork() && e3, onProgress: function(e4) { + if ("function" == typeof r2.onProgress) + try { + r2.onProgress(e4.percent); + } catch (e5) { + M.w("onProgress callback error:", e5), M.e(e5); + } + } }; + }); + } }, { key: "_genFileName", value: function(e2) { + return "".concat(qt(), "-").concat(e2); + } }, { key: "_setUploadFileType", value: function(e2) { + this.uploadFileType = e2; + } }, { key: "_getSnapshotInfoByUrl", value: function(e2, n2) { + var o2 = this, i2 = "_getSnapshotInfoByUrl", a2 = new G(i2); + return this.req({ P: k.VIDEO_COVER, data: { platform: this.getPlatform(), coverName: this._genFileName(ft(99999)), requestSnapshotUrl: e2 } }).then(function(e3) { + var t2, e3 = (e3.data || {}).snapshotUrl; + return M.l("".concat(o2._n, ".").concat(i2, " ok. snapshotUrl:").concat(e3)), a2.setMessage("snapshotUrl:".concat(e3)).end(), S(e3) ? {} : Ft(t2 = ao(e3, o2._fileDownloadProxy, o2._authKey, o2._fileDNList)).then(function(e4) { + n2.snapshotInfo = { snapshotUrl: t2, snapshotWidth: e4.width, snapshotHeight: e4.height }; + }); + }).catch(function(e3) { + return M.w("".concat(o2._n, ".").concat(i2, " failed. error:"), e3), a2.setCode(e3.errorCode).setMessage(e3.errorInfo).end(), {}; + }); + } }, { key: "_getSmallImageInfoByUrl", value: function(t2, n2) { + return Ft(ao(t2, this._fileDownloadProxy, this._authKey, this._fileDNList)).then(function(e2) { + n2.smallImageUrl = t2, n2.smallImageWidth = e2.width, n2.smallImageHeight = e2.height; + }); + } }, { key: "_getLargeImageInfoByUrl", value: function(t2, n2) { + return Ft(ao(t2, this._fileDownloadProxy, this._authKey, this._fileDNList)).then(function(e2) { + n2.largeImageUrl = t2, n2.largeImageWidth = e2.width, n2.largeImageHeight = e2.height; + }); + } }, { key: "_isEmptyFileList", value: function(e2) { + return !(!dt(e2) || 0 !== e2.length); + } }, { key: "reset", value: function() { + M.l("".concat(this._n, ".reset")); + } }]), ka), Ta = ["downloadKey", "pbDownloadKey", "messageList"], Da = (e(Sa, [{ key: "uploadMergerMessage", value: function(e2, n2) { + var o2 = "".concat(this._n, ".").concat("uploadMergerMessage"), e2 = (M.d("".concat(o2, " message:"), e2, "messageBytes:".concat(n2)), JSON.parse(JSON.stringify(e2.payload)).messageList), i2 = e2.length, t2 = this._msgM.get(17).getFileDNList(), a2 = new G("uploadMergerMessage"); + return e2.forEach(function(e3) { + so(e3.messageBody[0].type, e3.messageBody, t2); + }), this._msgM.req({ P: k.UPLOAD_MERGER_MSG, data: { messageList: e2 } }).then(function(e3) { + M.d("".concat(o2, " ok. response:"), e3.data); + var e3 = e3.data, t3 = e3.pbDownloadKey, e3 = e3.downloadKey, t3 = { pbDownloadKey: t3, downloadKey: e3, messageNumber: i2 }; + return a2.setMessage("".concat(i2, "-").concat(n2, "-").concat(e3)).end(), t3; + }).catch(function(e3) { + throw M.w("".concat(o2, " failed. error:"), e3), a2.setError(e3).end(), e3; + }); + } }, { key: "downloadMergerMessage", value: function(i2) { + var a2 = this, s2 = "".concat(this._n, ".").concat("downloadMergerMessage"), t2 = (M.d("".concat(s2, " message:"), i2), i2.payload.downloadKey), r2 = this._msgM.getFileDownloadProxy(), c2 = this._msgM.getDowloadFileAuthKey(), u2 = new G("downloadMergerMessage"); + return u2.setMessage("downloadKey:".concat(t2)), this._msgM.req({ P: k.DOWNLOAD_MERGER_MSG, data: { downloadKey: t2 } }).then(function(e2) { + M.d("".concat(s2, " ok. response:"), e2.data); + var t3, n2, o2 = a2._msgM.get(17).getFileDNList(); + return lt(i2.clearElement) ? ((t3 = i2.payload).downloadKey, t3.pbDownloadKey, t3.messageList, t3 = K(t3, Ta), i2.clearElement(), i2.setElement({ type: i2.type, content: y({ messageList: e2.data.messageList }, t3) }, r2, c2, o2)) : (n2 = [], e2.data.messageList.forEach(function(e3) { + S(e3) || (e3 = new yo(e3, r2, c2, o2), n2.push(e3)); + }), i2.payload.messageList = n2, i2.payload.downloadKey = "", i2.payload.pbDownloadKey = ""), u2.end(), i2; + }).catch(function(e2) { + throw M.w("".concat(s2, " failed. key:").concat(t2, " error:"), e2), u2.setError(e2).end(), e2; + }); + } }, { key: "createMergerMessagePack", value: function(e2, t2, n2) { + return e2.conversationType === A.CONV_C2C ? this._createC2CMergerMessagePack(e2, t2, n2) : this._createGroupMergerMessagePack(e2, t2, n2); + } }, { key: "_createC2CMergerMessagePack", value: function(e2, t2, n2) { + var o2 = null, i2 = (t2 && (t2.offlinePushInfo && (o2 = t2.offlinePushInfo), true === t2.onlineUserOnly) && (o2 ? o2.disablePush = true : o2 = { disablePush: true }), []), a2 = (f(t2) && f(t2.messageControlInfo) && (a2 = (r2 = t2.messageControlInfo).excludedFromUnreadCount, s2 = r2.excludedFromLastMessage, r2 = r2.excludedFromContentModeration, true === a2 && i2.push("NoUnread"), true === s2 && i2.push("NoLastMsg"), true === r2) && i2.push("NoMsgCheck"), ""), s2 = (m(e2.cloudCustomData) && 0 < e2.cloudCustomData.length && (a2 = e2.cloudCustomData), n2.pbDownloadKey), r2 = n2.downloadKey, n2 = n2.messageNumber, c2 = e2.payload, u2 = c2.title, l2 = c2.abstractList, c2 = c2.compatibleText, d2 = this._msgM.get(6), d2 = d2 && d2.isOnlineMessage(e2, t2) ? 0 : void 0; + return { P: k.SEND_C2C_MSG, data: { fromAccount: this._msgM.getMyUserID(), toAccount: e2.to, msgBody: [{ msgType: e2.type, msgContent: { pbDownloadKey: s2, downloadKey: r2, title: u2, abstractList: l2, compatibleText: c2, messageNumber: n2 } }], cloudCustomData: a2, clientTime: e2.clientTime, msgSeq: e2.sequence, msgRandom: e2.random, msgLifeTime: d2, offlinePushInfo: wo(o2), messageControlInfo: 0 !== d2 ? i2 : void 0, isSupportExtension: true === e2.isSupportExtension ? 1 : 0, isRelayMessage: true === e2._relayFlag ? 1 : 0 } }; + } }, { key: "_createGroupMergerMessagePack", value: function(e2, t2, n2) { + var o2 = null, i2 = (t2 && t2.offlinePushInfo && (o2 = t2.offlinePushInfo), []), a2 = (f(t2) && f(t2.messageControlInfo) && (a2 = (r2 = t2.messageControlInfo).excludedFromUnreadCount, s2 = r2.excludedFromLastMessage, r2 = r2.excludedFromContentModeration, true === a2 && i2.push("NoUnread"), true === s2 && i2.push("NoLastMsg"), true === r2) && i2.push("NoMsgCheck"), ""), s2 = (m(e2.cloudCustomData) && 0 < e2.cloudCustomData.length && (a2 = e2.cloudCustomData), n2.pbDownloadKey), r2 = n2.downloadKey, n2 = n2.messageNumber, c2 = e2.payload, u2 = c2.title, l2 = c2.abstractList, c2 = c2.compatibleText, d2 = this._msgM.get(7), t2 = d2 && d2.isOnlineMessage(e2, t2) ? 1 : 0; + return { P: k.SEND_GRP_MSG, data: { fromAccount: this._msgM.getMyUserID(), groupID: e2.to, msgBody: [{ msgType: e2.type, msgContent: { pbDownloadKey: s2, downloadKey: r2, title: u2, abstractList: l2, compatibleText: c2, messageNumber: n2 } }], random: e2.random, priority: e2.priority, clientSequence: e2.clientSequence, groupAtInfo: void 0, cloudCustomData: a2, onlineOnlyFlag: t2, offlinePushInfo: wo(o2), clientTime: e2.clientTime, needReadReceipt: true !== e2.needReadReceipt || d2.isMessageFromOrToAVChatroom(e2.to) ? 0 : 1, messageControlInfo: 0 == t2 ? i2 : void 0, isSupportExtension: true === e2.isSupportExtension ? 1 : 0, isRelayMessage: true === e2._relayFlag ? 1 : 0 } }; + } }]), Sa), Ea = { ERR_SVR_COMM_SENSITIVE_TEXT: 80001, ERR_SVR_COMM_BODY_SIZE_LIMIT: 80002, OPEN_SERVICE_OVERLOAD_ERROR: 60022, ERR_SVR_MSG_PKG_PARSE_FAILED: 20001, ERR_SVR_MSG_INTERNAL_AUTH_FAILED: 20002, ERR_SVR_MSG_INVALID_ID: 20003, ERR_SVR_MSG_PUSH_DENY: 20006, ERR_SVR_MSG_IN_PEER_BLACKLIST: 20007, ERR_SVR_MSG_BOTH_NOT_FRIEND: 20009, ERR_SVR_MSG_NOT_PEER_FRIEND: 20010, ERR_SVR_MSG_NOT_SELF_FRIEND: 20011, ERR_SVR_MSG_SHUTUP_DENY: 20012, ERR_SVR_GROUP_INVALID_PARAMETERS: 10004, ERR_SVR_GROUP_PERMISSION_DENY: 10007, ERR_SVR_GROUP_NOT_FOUND: 10010, ERR_SVR_GROUP_INVALID_GROUPID: 10015, ERR_SVR_GROUP_REJECT_FROM_THIRDPARTY: 10016, ERR_SVR_GROUP_SHUTUP_DENY: 10017, MSG_SEND_FAIL: 2100, OVER_FREQUENCY_LIMIT: 2996 }, La = [L.MSG_ONPROGRESS_ERR, L.MSG_I_SELECT_F_FIRST, L.MSG_I_TYPES_LIMIT, L.MSG_F_IS_EMPTY, L.MSG_I_SIZE_LIMIT, L.MSG_F_SELECT_F_FIRST, L.MSG_F_SIZE_LIMIT, L.MSG_V_SIZE_LIMIT, L.MSG_V_TYPES_LIMIT, L.MSG_A_UPLOAD_FAIL, L.MSG_A_SIZE_LIMIT, L.COS_UNDETECTED]; + function Sa(e2) { + d(this, Sa), this._n = "MergerMessageHandler", this._msgM = e2; + } + function ka(e2) { + d(this, ka), (e2 = va.call(this, e2))._n = "UploadModule", e2.TIMUploadPlugin = null, e2.timUploadPlugin = null, e2.COSSDK = null, e2._cosUploadMethod = null, e2.expiredTimeLimit = 600, e2.appid = 0, e2.bucketName = "", e2.ciUrl = "", e2.directory = "", e2.downloadUrl = "", e2.uploadUrl = "", e2.region = "ap-shanghai", e2.cos = null, e2.cosOptions = { secretId: "", secretKey: "", sessionToken: "", expiredTime: 0 }, e2.uploadFileType = "", e2.duration = 900, e2.tryCount = 0, e2.UPLOAD_SIZE_LIMIT = { A: 20971520, F: 104857600, I: 20971520, V: 104857600 }, e2.isSimpleCos = false, e2._fileDownloadProxy = "", e2._authKey = "", e2._fileDNList = Ma; + var t2 = e2.getIEmitInst(); + return t2.on(P.A2KEY_AND_TINYID_UPDATED, e2._init, i(e2)), t2.on(P.CLOUD_CONFIG, e2._onCloudConfig, i(e2)), e2; + } + function Aa(e2) { + var t2 = false; + return Object.values(Ea).includes(e2) && (t2 = true), t2 = 120001 <= e2 && e2 <= 13e4 || 10100 <= e2 && e2 <= 10200 ? true : t2; + } + var Ra, Oa, Na, Ga, Pa, Ua, ba = ["conversationID", "timePosition", "timePeriod"], wa = (t(za, u), Ua = n(za), e(za, [{ key: "createTextMessage", value: function(e2) { + var t2 = this.getMyUserID(), n2 = (e2.currentUser = t2, e2.senderTinyID = this.getMyTinyID(), new Do(e2)), e2 = m(e2.payload) ? e2.payload : e2.payload.text, e2 = new eo({ text: e2 }), t2 = this._getNickAndAvatarByUserID(t2); + return n2.setElement(e2), n2.setNickAndAvatar(t2), n2.setNameCard(this._getNameCardByGroupID(n2)), n2; + } }, { key: "createImageMessage", value: function(e2) { + var t2 = this.getMyUserID(), n2 = (e2.currentUser = t2, e2.senderTinyID = this.getMyTinyID(), new Do(e2)); + if (v) { + var o2 = e2.payload.file; + if (ct(o2)) + return void this.warn("FileUnsupportedInMP", "createImageMessage"); + var i2 = o2.tempFiles[0].path || o2.tempFiles[0].tempFilePath, o2 = { url: i2, name: i2.slice(i2.lastIndexOf("/") + 1), size: o2.tempFiles && o2.tempFiles[0].size || 1, type: i2.slice(i2.lastIndexOf(".") + 1).toLowerCase() }; + e2.payload.file = o2; + } else + ye ? (o2 = { url: (i2 = e2.payload.file).uri, name: i2.fileName, size: i2.fileSize || 1, type: i2.type, width: i2.width, height: i2.height }, e2.payload.file = o2) : Ce && (ct(e2.payload.file) ? (i2 = e2.payload.file, e2.payload.file = { files: [i2] }) : f(e2.payload.file) && "undefined" != typeof uni && (o2 = e2.payload.file.tempFiles[0], e2.payload.file = { files: [o2] })); + i2 = new uo({ imageFormat: Xe.UNKNOWN, uuid: this._generateUUID(e2.payload.file), file: e2.payload.file }), o2 = this._getNickAndAvatarByUserID(t2); + return n2.setElement(i2), n2.setNickAndAvatar(o2), n2.setNameCard(this._getNameCardByGroupID(n2)), this._messageOptionsMap.set(n2.clientSequence, e2), n2; + } }, { key: "createAudioMessage", value: function(e2) { + var t2 = e2.payload.file, n2 = (v && (n2 = { url: t2.tempFilePath, name: t2.tempFilePath.slice(t2.tempFilePath.lastIndexOf("/") + 1), size: t2.fileSize, second: parseInt(t2.duration) / 1e3, type: t2.tempFilePath.slice(t2.tempFilePath.lastIndexOf(".") + 1).toLowerCase() }, e2.payload.file = n2), ye && (n2 = { url: t2.uri, name: t2.uri.slice(t2.uri.lastIndexOf("/") + 1), size: t2.fileSize || 1, second: Math.floor(t2.duration / 1e3), type: t2.uri.slice(t2.uri.lastIndexOf(".") + 1).toLowerCase() }, e2.payload.file = n2), this.getMyUserID()), o2 = (e2.currentUser = n2, e2.senderTinyID = this.getMyTinyID(), new Do(e2)), t2 = new po({ second: Math.floor(t2.duration / 1e3), size: t2.fileSize || t2.size || 1, url: t2.tempFilePath, uuid: this._generateUUID(e2.payload.file) }), n2 = this._getNickAndAvatarByUserID(n2); + return o2.setElement(t2), o2.setNickAndAvatar(n2), o2.setNameCard(this._getNameCardByGroupID(o2)), this._messageOptionsMap.set(o2.clientSequence, e2), o2; + } }, { key: "createVideoMessage", value: function(e2) { + var t2 = this.getMyUserID(), n2 = (e2.currentUser = t2, e2.senderTinyID = this.getMyTinyID(), e2.payload.file.thumbUrl = "", e2.payload.file.thumbSize = 0, {}); + if (v) { + if (ve) + return void this.warn("VideoUnsupportedInAlipay"); + if (ct(e2.payload.file)) + return void this.warn("FileUnsupportedInMP", "createVideoMessage"); + var o2 = e2.payload.file; + O(o2.tempFiles) && (o2 = o2.tempFiles[0]), n2.url = o2.tempFilePath, n2.name = o2.tempFilePath.slice(o2.tempFilePath.lastIndexOf("/") + 1), n2.size = o2.size || 1, n2.second = o2.duration || 0, n2.type = o2.tempFilePath.slice(o2.tempFilePath.lastIndexOf(".") + 1).toLowerCase(); + } else + ye ? (o2 = e2.payload.file, n2.url = o2.uri, n2.name = o2.fileName, n2.size = o2.fileSize || 1, n2.second = o2.duration || 0, n2.type = o2.type.split("/")[1]) : Ce && (ct(e2.payload.file) ? (o2 = e2.payload.file, e2.payload.file.files = [o2]) : f(e2.payload.file) && "undefined" != typeof uni && (o2 = e2.payload.file.tempFile, e2.payload.file.files = [o2]), o2 = e2.payload.file, n2.url = window.URL.createObjectURL(o2.files[0]), n2.name = o2.files[0].name, n2.size = o2.files[0].size || 1, n2.second = o2.files[0].duration || 0, n2.type = o2.files[0].type.split("/")[1]); + e2.payload.file.videoFile = n2; + o2 = new Do(e2), n2 = new Io({ videoFormat: n2.type, videoSecond: Yt(n2.second, 0), videoSize: n2.size, remoteVideoUrl: "", videoUrl: n2.url, videoUUID: this._generateUUID(e2.payload.file.videoFile), thumbUUID: this._generateUUID(e2.payload.file.videoFile), thumbWidth: e2.payload.file.width || 200, thumbHeight: e2.payload.file.height || 200, thumbUrl: e2.payload.file.thumbUrl, thumbSize: e2.payload.file.thumbSize, thumbFormat: e2.payload.file.thumbUrl.slice(e2.payload.file.thumbUrl.lastIndexOf(".") + 1).toLowerCase() }), t2 = this._getNickAndAvatarByUserID(t2); + return o2.setElement(n2), o2.setNickAndAvatar(t2), o2.setNameCard(this._getNameCardByGroupID(o2)), this._messageOptionsMap.set(o2.clientSequence, e2), o2; + } }, { key: "createCustomMessage", value: function(e2) { + var t2 = this.getMyUserID(), n2 = (e2.currentUser = t2, e2.senderTinyID = this.getMyTinyID(), new Do(e2)), e2 = new vo({ data: e2.payload.data, description: e2.payload.description, extension: e2.payload.extension }), t2 = this._getNickAndAvatarByUserID(t2); + return n2.setElement(e2), n2.setNickAndAvatar(t2), n2.setNameCard(this._getNameCardByGroupID(n2)), n2; + } }, { key: "createFaceMessage", value: function(e2) { + var t2 = this.getMyUserID(), n2 = (e2.currentUser = t2, e2.senderTinyID = this.getMyTinyID(), new Do(e2)), e2 = new lo(e2.payload), t2 = this._getNickAndAvatarByUserID(t2); + return n2.setElement(e2), n2.setNickAndAvatar(t2), n2.setNameCard(this._getNameCardByGroupID(n2)), n2; + } }, { key: "createMergerMessage", value: function(e2) { + var t2 = this.getMyUserID(), t2 = (e2.currentUser = t2, e2.senderTinyID = this.getMyTinyID(), this._getNickAndAvatarByUserID(t2)), n2 = new Do(e2), e2 = new Co(e2.payload); + return n2.setElement(e2), n2.setNickAndAvatar(t2), n2.setNameCard(this._getNameCardByGroupID(n2)), n2.setRelayFlag(true), n2; + } }, { key: "createForwardMessage", value: function(e2) { + var t2, n2, o2 = e2.to, i2 = e2.conversationType, a2 = e2.priority, s2 = e2.payload, r2 = e2.needReadReceipt, c2 = e2.receiverList; + return O(s2._elements) ? (t2 = this.getMyUserID(), n2 = this._getNickAndAvatarByUserID(t2), s2.type === A.MSG_GRP_TIP ? D({ code: L.MSG_FORWARD_TYPE_INVALID }) : (i2 = { to: o2, conversationType: i2, conversationID: "".concat(i2).concat(o2), priority: a2, isPlaceMessage: 0, status: An, currentUser: t2, senderTinyID: this.getMyTinyID(), cloudCustomData: e2.cloudCustomData || s2.cloudCustomData || "", needReadReceipt: r2, receiverList: c2, isSupportExtension: e2.isSupportExtension || false }, (o2 = new Do(i2)).setElement(s2._elements[0]), o2.setNickAndAvatar(n2), o2.setNameCard(this._getNameCardByGroupID(s2)), o2.setRelayFlag(true), o2)) : D({ code: L.MSG_FORWARD_INVALID_ELEMENTS }); + } }, { key: "downloadMergerMessage", value: function(e2) { + return this._mergerMessageHandler.downloadMergerMessage(e2); + } }, { key: "createFileMessage", value: function(e2) { + if (v) { + if (!_e && !ge && !Ie) + return; + var t2 = I.getSystemInfoSync().SDKVersion; + if (_e && Vt(t2, "2.5.0") < 0) + return void this.warn("WXChooseMessageFile"); + if (ge && Vt(t2, "1.18.0") < 0) + return void this.warn("QQChooseMessageFile"); + } + Ce || Ie ? ct(e2.payload.file) ? (t2 = e2.payload.file, e2.payload.file = { files: [t2] }) : f(e2.payload.file) && "undefined" != typeof uni && (o2 = (t2 = e2.payload.file).tempFiles, t2 = t2.files, n2 = null, O(o2) ? n2 = o2[0] : O(t2) && (n2 = t2[0]), e2.payload.file = { files: [n2] }) : _e || ge ? (t2 = y(y({}, (o2 = e2.payload.file.tempFiles)[0]), {}, { url: o2[0].path }), e2.payload.file = { files: [t2] }) : ye && (o2 = y(y({}, n2 = e2.payload.file), {}, { url: n2.uri }), e2.payload.file = { files: [o2] }); + var t2 = this.getMyUserID(), n2 = (e2.currentUser = t2, e2.senderTinyID = this.getMyTinyID(), new Do(e2)), o2 = new mo({ uuid: this._generateUUID(e2.payload.file), file: e2.payload.file }), t2 = this._getNickAndAvatarByUserID(t2); + return n2.setElement(o2), n2.setNickAndAvatar(t2), n2.setNameCard(this._getNameCardByGroupID(n2)), this._messageOptionsMap.set(n2.clientSequence, e2), n2; + } }, { key: "createLocationMessage", value: function(e2) { + var t2 = this.getMyUserID(), n2 = (e2.currentUser = t2, e2.senderTinyID = this.getMyTinyID(), new Do(e2)), e2 = new Mo(e2.payload), t2 = this._getNickAndAvatarByUserID(t2); + return n2.setElement(e2), n2.setNickAndAvatar(t2), n2.setNameCard(this._getNameCardByGroupID(n2)), n2; + } }, { key: "_onNoModule", value: function() { + return D({ code: L.NO_MODULE }); + } }, { key: "sendMessageInstance", value: function(i2, a2) { + var s2 = this; + if (false === this.get(29).filterMessage(i2, a2)) + return i2.hasRiskContent = true, this._onSendMessageFailed(i2, new E({ code: L.PROFANITY_FOUND })); + var r2, c2, u2, l2, t2 = null; + if (i2.conversationType === A.CONV_C2C) + t2 = this.get(6); + else { + if (i2.conversationType !== A.CONV_GROUP) + return D({ code: L.MSG_INVALID_CONV_TYPE }); + t2 = this.get(7); + } + return t2 ? (c2 = "".concat(this._n, ".sendMessageInstance"), u2 = this.get(11), l2 = t2.isOnlineMessage(i2, a2), this.get(17).upload(i2).then(function() { + return s2._getSendMessageSpecifiedKey(i2) === Yn && s2.get(26).addSuccessCount(Wn), s2._guardForGroup(i2).then(function() { + if (!i2.isSendable()) + return D({ code: L.MSG_F_URL_IS_EMPTY }); + s2._addSendMessageTotalCount(i2), r2 = Date.now(); + var e2 = function(e3) { + var t3 = "utf-8"; + Ce && document && (t3 = document.charset.toLowerCase()); + var n2, o2 = 0, i3 = e3.length; + if ("utf-8" === t3 || "utf8" === t3) + for (var a3 = 0; a3 < i3; a3++) + (n2 = e3.codePointAt(a3)) <= 127 ? o2 += 1 : n2 <= 2047 ? o2 += 2 : n2 <= 65535 ? o2 += 3 : (o2 += 4, a3++); + else if ("utf-16" === t3 || "utf16" === t3) + for (var s3 = 0; s3 < i3; s3++) + (n2 = e3.codePointAt(s3)) <= 65535 ? o2 += 2 : (o2 += 4, s3++); + else + o2 = e3.replace(/[^\x00-\xff]/g, "aa").length; + return o2; + }(JSON.stringify(i2)); + return i2.type === A.MSG_MERGER && 11264 < e2 ? s2._mergerMessageHandler.uploadMergerMessage(i2, e2).then(function(e3) { + e3 = s2._mergerMessageHandler.createMergerMessagePack(i2, a2, e3); + return s2.req(e3); + }) : (u2.setMessageRandom(i2), t2.sendMessage(i2, a2)); + }).then(function(e2) { + var e2 = e2.data, t3 = e2.time, n2 = e2.sequence, o2 = e2.readReceiptCode, e2 = e2.messageDropReason, e2 = (R(o2) && 0 !== o2 && (new G("sendMessageWithReceipt").setMessage("from:".concat(i2.from, " to:").concat(i2.to, " sequence:").concat(n2, " readReceiptCode:").concat(o2)).end(), M.w("".concat(c2, " readReceiptCode:").concat(o2, " message:").concat(s2.getErrMsg(o2)))), e2 && (o2 = new G("messageDropReason"), e2 = "from:".concat(i2.from, " to:").concat(i2.to, " sequence:").concat(n2, " messageDropReason:").concat(e2), o2.setMessage(e2).end(), M.w("".concat(c2, " ").concat(e2))), s2._addSendMessageSuccessCount(i2, r2), s2._messageOptionsMap.delete(i2.clientSequence), true === i2.isResend && (o2 = u2.findMessage(i2.ID)) && (M.l("".concat(c2, " resend ok. ID:").concat(o2.ID)), u2.deleteLocalMessage(o2)), i2.status = Rn, i2.time = t3, false); + return i2.conversationType === A.CONV_GROUP ? i2.sequence = n2 : i2.conversationType === A.CONV_C2C && (o2 = u2.getLatestMessageSentByMe(i2.conversationID)) && (t3 = o2.nick, n2 = o2.avatar, t3 === i2.nick && n2 === i2.avatar || (e2 = true)), e2 && u2.modifyMessageSentByMe({ conversationID: i2.conversationID, latestNick: i2.nick, latestAvatar: i2.avatar }), true === l2 ? i2._onlineOnlyFlag = true : (u2.appendToMessageList(i2), o2 = i2, f(a2) && f(a2.messageControlInfo) && (true === a2.messageControlInfo.excludedFromLastMessage && (i2._isExcludedFromLastMessage = true, o2 = ""), true === a2.messageControlInfo.excludedFromUnreadCount) && (i2._isExcludedFromUnreadCount = true), t3 = i2.conversationType, Gt(i2.to) && (t3 = A.CONV_TOPIC, s2.get(10).onMessageSent({ groupID: Jt(i2.to), topicID: i2.to, lastMessage: o2 })), u2.onMessageSent({ conversationOptionsList: [{ conversationID: i2.conversationID, unreadCount: 0, type: t3, subType: i2.conversationSubType, lastMessage: o2 }] })), i2._relayFlag || "TIMImageElem" !== i2.type || Bt(i2.payload.imageInfoArray), C({ message: i2 }); + }); + }).catch(function(e2) { + return s2._onSendMessageFailed(i2, e2, l2); + })) : this._onNoModule(); + } }, { key: "_guardForGroup", value: function(e2) { + if (e2.conversationType !== A.CONV_GROUP) + return Promise.resolve(); + var t2 = this.get(7); + if (!t2) + return this._onNoModule(); + if (Nt({ groupID: e2.to })) { + var n2 = t2.getLocalGroupProfile(e2.to); + if (n2 && n2.isSupportTopic) + return D({ code: L.MSG_SEND_GRP_WITH_TOPIC_FAIL }); + } + return t2.guardForAVChatRoom(e2); + } }, { key: "_onSendMessageFailed", value: function(e2, t2) { + var n2 = 2 < arguments.length && void 0 !== arguments[2] && arguments[2], o2 = "".concat(this._n, "._onSendMessageFailed"), i2 = (e2.status = On, 80001 !== t2.code && 80004 !== t2.code || (e2.hasRiskContent = true), this.get(11)), a2 = (i2.deleteMessageRandom(e2), 10100 <= t2.code && t2.code <= 10200 || 120001 <= t2.code && t2.code <= 13e4), n2 = (n2 || a2 || true === i2.appendToMessageList(e2) && M.l("".concat(o2, " message stored, ID:").concat(e2.ID)), this._addSendMessageFailCountOnUser(e2, t2), new G("sendMessage")), a2 = "head.seq:".concat(t2.data.headSeq, " type:").concat(e2.type, " from:").concat(e2.from, " to:").concat(e2.to); + return Ce && ("connection" in navigator && (i2 = navigator.connection, a2 += " downlink:".concat(i2.downlink, " effectiveType:").concat(i2.effectiveType, " rtt:").concat(i2.rtt)), "memory" in window.performance) && (i2 = window.performance.memory, a2 += " usedJSHeapSize:".concat(i2.usedJSHeapSize, " totalJSHeapSize:").concat(i2.totalJSHeapSize, " jsHeapSizeLimit:").concat(i2.jsHeapSizeLimit)), n2.setMessage(a2).setError(t2).end(), M.e("".concat(o2, " ").concat(a2, " error:"), t2), D(new E({ code: t2 && t2.code ? t2.code : L.MSG_SEND_FAIL, message: t2 && t2.message ? t2.message : void 0, data: { message: e2 } })); + } }, { key: "_getSendMessageSpecifiedKey", value: function(e2) { + if ([A.MSG_IMAGE, A.MSG_AUDIO, A.MSG_VIDEO, A.MSG_FILE].includes(e2.type)) + return Yn; + if (e2.conversationType === A.CONV_C2C) + return Hn; + if (e2.conversationType === A.CONV_GROUP) { + var t2 = this.get(7); + if (t2) { + t2 = t2.getLocalGroupProfile(e2.to); + if (t2) + return e2 = t2.type, Ot(e2) ? Kn : Bn; + } + } + } }, { key: "_addSendMessageTotalCount", value: function(e2) { + e2 = this._getSendMessageSpecifiedKey(e2); + e2 && this.get(26).addTotalCount(e2); + } }, { key: "_addSendMessageSuccessCount", value: function(e2, t2) { + var n2, e2 = this._getSendMessageSpecifiedKey(e2); + e2 && ((n2 = this.get(26)).addSuccessCount(e2), n2.addCost(e2, nn(t2, false))); + } }, { key: "_addSendMessageFailCountOnUser", value: function(e2, t2) { + var n2, t2 = t2.code, t2 = void 0 === t2 ? -1 : t2, o2 = this.get(26), e2 = this._getSendMessageSpecifiedKey(e2); + e2 === Yn && (n2 = false, n2 = La.includes(t2) ? true : n2) ? o2.addFailedCountOfUserSide(Wn) : Aa(t2) && e2 && o2.addFailedCountOfUserSide(e2); + } }, { key: "resendMessage", value: function(e2, t2) { + return e2.isResend = true, e2.status = An, this.sendMessageInstance(e2, t2); + } }, { key: "revokeMessage", value: function(n2) { + var o2, i2, t2 = this, e2 = null; + return n2.conversationType === A.CONV_C2C ? e2 = this.get(6) : n2.conversationType === A.CONV_GROUP && (e2 = this.get(7)), e2 ? ((o2 = new G("revokeMessage")).setMessage("type:".concat(n2.type, " from:").concat(n2.from, " to:").concat(n2.to)), i2 = "".concat(this._n, ".").concat("revokeMessage"), e2.revokeMessage(n2).then(function(e3) { + var e3 = e3.data.recallRetList; + return S(e3) || 0 === e3[0].retCode ? (M.i("".concat(i2, " ok. ID:").concat(n2.ID)), n2.isRevoked = true, o2.end(), t2.get(11).onMessageRevoked([n2]), C({ message: n2 })) : (e3 = new E({ code: e3[0].retCode, data: { message: n2 } }), o2.setCode(e3.code).setMoreMessage(e3.message).end(), D(e3)); + }).catch(function(e3) { + o2.setError(e3).end(); + var t3 = new E({ code: e3 && e3.code ? e3.code : L.MSG_REVOKE_FAIL, message: e3 && e3.message ? e3.message : void 0, data: { message: n2 } }); + return M.w("".concat(i2, " failed. error:"), e3), D(t3); + })) : this._onNoModule(); + } }, { key: "deleteMessage", value: function(e2) { + var t2 = this, n2 = null, o2 = e2[0], i2 = o2.conversationID, a2 = "", s2 = [], r2 = []; + if (o2.conversationType === A.CONV_C2C) + n2 = this.get(6), a2 = i2.replace(A.CONV_C2C, ""), e2.forEach(function(e3) { + e3 && e3.status === Rn && e3.conversationID === i2 && (e3._onlineOnlyFlag || s2.push("".concat(e3.sequence, "_").concat(e3.random, "_").concat(e3.time)), r2.push(e3)); + }); + else if (o2.conversationType === A.CONV_GROUP) + n2 = this.get(7), a2 = i2.replace(A.CONV_GROUP, ""), e2.forEach(function(e3) { + e3 && e3.status === Rn && e3.conversationID === i2 && (e3._onlineOnlyFlag || s2.push("".concat(e3.sequence)), r2.push(e3)); + }); + else if (o2.conversationType === A.CONV_SYSTEM) + return D({ code: L.CANNOT_DELETE_GRP_SYSTEM_NOTICE }); + if (!n2) + return this._onNoModule(); + if (0 === s2.length) + return this._onMessageDeleted(r2); + 30 < s2.length && (s2 = s2.slice(0, 30), r2 = r2.slice(0, 30)); + var c2 = new G("deleteMessage"), u2 = (c2.setMessage("to:".concat(a2, " count:").concat(s2.length)), "".concat(this._n, ".").concat("deleteMessage")); + return n2.deleteMessage({ to: a2, keyList: s2 }).then(function(e3) { + return c2.end(), M.i("".concat(u2, " ok")), t2._onMessageDeleted(r2); + }).catch(function(e3) { + c2.setError(e3).end(), M.w("".concat(u2, " failed. error:"), e3); + e3 = new E({ code: e3 && e3.code ? e3.code : L.MSG_DELETE_FAIL, message: e3 && e3.message ? e3.message : void 0 }); + return D(e3); + }); + } }, { key: "_onMessageDeleted", value: function(e2) { + return this.get(11).onMessageDeleted(e2), T({ messageList: e2 }); + } }, { key: "translateText", value: function(e2) { + var o2 = "".concat(this._n, ".").concat("translateText"), t2 = e2.sourceTextList, n2 = e2.sourceLanguage, e2 = e2.targetLanguage, i2 = new G("translateText"); + return i2.setMessage("sourceLanguage:".concat(n2, " targetLanguage:").concat(e2)), this.req({ P: k.TRANSLATE_TEXT, data: { sourceTextList: t2, source: n2 || "auto", target: e2, from: this.getMyTinyID(), SDKAppID: this.getSDKAppID() } }).then(function(e3) { + var e3 = e3.data, t3 = e3.error, n3 = e3.requestID, e3 = e3.translatedTextList; + if (0 === t3.code) + return i2.end(), M.i("".concat(o2, " ok. requestID:").concat(n3)), C({ translatedTextList: e3 }); + throw y(y({}, t3), {}, { requestID: n3 }); + }).catch(function(e3) { + return i2.setCode(e3.code).setMoreMessage(e3.requestID).end(), M.w("".concat(o2, " failed. error:"), e3), D({ code: L.TRANSLATE_TEXT_FAIL }); + }); + } }, { key: "convertVoiceToText", value: function(e2) { + var t2, o2, i2, n2 = e2.message, e2 = e2.language, a2 = n2.payload.url, n2 = (n2.from === this.getMyUserID() && "out" === n2.flow && (a2 = n2.payload.remoteAudioUrl), /\.(wav|pcm|ogg-opus|speex|silk|mp3|m4a|aac|amr)/); + return n2.test(a2) ? (n2 = n2.exec(a2)[1] || "mp3", t2 = "16k_zh-PY", e2 ? "zh (cmn-Hans-CN)" === e2 ? t2 = "16k_zh" : "en-US" === e2 ? t2 = "16k_en" : "yue-Hant-HK" === e2 ? t2 = "16k_yue" : "ja-JP" === e2 && (t2 = "16k_ja") : t2 = "16k_zh-PY", e2 = "serviceType:".concat(t2, " url:").concat(a2), o2 = "".concat(this._n, ".").concat("convertVoiceToText"), M.i("".concat(o2, " ").concat(e2)), (i2 = new G("convertVoiceToText")).setMessage(e2), this.req({ P: k.VOICE_TO_TEXT, data: { url: a2, language: t2, SDKAppID: this.getSDKAppID(), format: n2 } }).then(function(e3) { + var e3 = e3.data, t3 = e3.error, n3 = e3.requestID, e3 = e3.result; + if (0 === t3.code) + return i2.end(), M.i("".concat(o2, " ok. requestID:").concat(n3)), C({ result: e3 }); + throw y(y({}, t3), {}, { requestID: n3 }); + }).catch(function(e3) { + return i2.setCode(e3.code).setMoreMessage(e3.requestID || "").end(), M.w("".concat(o2, " failed. error:"), e3), D({ code: L.VOICE_TO_TEXT_FAIL }); + })) : D({ code: L.UNSUPPORTED_VOICE_FORMAT }); + } }, { key: "modifyRemoteMessage", value: function(n2) { + var o2 = this, e2 = null, t2 = n2.conversationType, i2 = n2.to, a2 = this.get(7); + if (!a2) + return this._onNoModule(); + if (a2.isMessageFromOrToAVChatroom(i2)) + return D({ code: L.MSG_MODIFY_DISABLED_IN_AV, data: { message: n2 } }); + if (false === this.get(29).filterMessage(n2)) + return n2.hasRiskContent = true, D({ code: L.PROFANITY_FOUND, data: { message: n2 } }); + t2 === A.CONV_C2C ? e2 = this.get(6) : t2 === A.CONV_GROUP && (e2 = this.get(7)); + var s2 = new G("modifyMessage"), r2 = (s2.setMessage("to:".concat(i2)), "".concat(this._n, ".modifyRemoteMessage")); + return e2.modifyRemoteMessage(n2).then(function(e3) { + s2.end(), M.i("".concat(r2, " ok")); + e3 = o2._onModifyRemoteMessageResp(n2, e3.data); + return C({ message: e3 }); + }).catch(function(e3) { + var t3; + return s2.setCode(e3.code).setMoreMessage(e3.message).end(), M.w("".concat(r2, " failed. error:"), e3), 20027 === e3.code ? (t3 = o2._onModifyRemoteMessageResp(n2, e3.data), D({ code: L.MSG_MODIFY_CONFLICT, data: { message: t3 } })) : D({ code: e3.code, message: e3.message, data: { message: n2 } }); + }); + } }, { key: "_generateSearchdata", value: function(e2) { + var t2 = e2.conversationID, n2 = e2.timePosition, o2 = e2.timePeriod, e2 = K(e2, ba); + return N(t2) || (Pt(t2) && (e2.account = t2.replace(A.CONV_C2C, "")), Ut(t2) && (e2.groupID = t2.replace(A.CONV_GROUP, ""))), R(o2) && 0 < o2 && (R(n2) && 0 < n2 ? e2.startTime = n2 - o2 : e2.startTime = Be() - o2), e2.startTime && e2.startTime < 0 && (e2.startTime = void 0), R(n2) && 0 < n2 && (e2.endTime = n2), e2; + } }, { key: "searchCloudMessages", value: function(i2) { + var a2 = this, e2 = "searchCloudMessages", s2 = "".concat(this._n, ".").concat(e2); + if (!i2) + return D({ code: L.OPTIONS_IS_EMPTY, message: this.getErrMsg(L.OPTIONS_IS_EMPTY, e2) }); + var r2, c2, u2, t2 = i2.keywordList, n2 = i2.keywordListMatchType, o2 = i2.conversationID, l2 = i2.cursor, d2 = O(i2.senderUserIDList) && 0 < i2.senderUserIDList.length, p2 = O(i2.messageTypeList) && 0 < i2.messageTypeList.length; + if (t2 || d2 || p2) + return r2 = Date.now(), c2 = new G(e2), u2 = "keywordList:".concat(t2, " keywordListMatchType:").concat(n2, " ") + "convID:".concat(o2, " cursor:").concat(l2), M.l("".concat(s2, " ").concat(u2)), this.req({ P: k.MSG_CLOUD_SEARCH, data: this._generateSearchdata(i2) }).then(function(e3) { + var t3 = e3.data, n3 = t3.code, t3 = t3.message; + if (0 !== n3) + return t3 = a2.getErrMsg(60020 === n3 ? "SearchCloudMessagesUnavailable" : n3) || t3, n3 = new E({ code: n3, message: t3 }), c2.setMessage(u2).setError(n3).end(), D(n3); + a2.get(27).isSearchCloudMessagesEnabled(); + var t3 = e3.data, n3 = t3.cursor, e3 = t3.totalCount, t3 = t3.searchResult, o3 = "totalCount:".concat(e3, " cost:").concat(nn(r2)), o3 = (M.l("".concat(s2, " ok. cursor:").concat(n3, " ").concat(o3)), c2.setMessage("".concat(u2, " ").concat(o3)).end(), a2._handleSearchResults(t3, !i2.conversationID)); + return C({ searchResultList: o3, cursor: n3, totalCount: e3 }); + }).catch(function(e3) { + return c2.setMessage(u2).setError(e3).end(), D(e3); + }); + throw M.e("[".concat(e2, '] Missing required params: "keywordList".')), new Error("Params validate failed."); + } }, { key: "_handleSearchResults", value: function(e2, a2) { + var s2 = this.get(11); + return O(e2) && 0 !== e2.length ? e2.map(function(e3) { + var t2 = e3.groupID, n2 = e3.userID, o2 = e3.messageCount, e3 = e3.messageList, e3 = void 0 === e3 ? [] : e3, n2 = t2 ? "".concat(A.CONV_GROUP).concat(t2) : "".concat(A.CONV_C2C).concat(n2), i2 = { conversationID: n2, messageCount: o2, messageList: [] }; + return a2 && 1 < o2 || 0 < (o2 = e3.filter(function(e4) { + return !!e4; + })).length && (e3 = s2.onRoamingMessage(o2, n2, false), t2 && e3.reverse(), i2.messageList = e3, i2.messageCount = e3.length), i2; + }) : []; + } }, { key: "_onModifyRemoteMessageResp", value: function(e2, t2) { + M.d("".concat(this._n, "._onModifyRemoteMessageResp options:"), t2); + var n2 = e2.conversationType, o2 = e2.from, i2 = e2.to, a2 = e2.random, s2 = e2.sequence, e2 = e2.time, r2 = t2.elements, c2 = t2.messageVersion, t2 = t2.cloudCustomData, t2 = void 0 === t2 ? "" : t2; + return this.get(11).onMessageModified({ conversationType: n2, from: o2, to: i2, time: e2, random: a2, sequence: s2, elements: r2, cloudCustomData: t2, messageVersion: c2 }); + } }, { key: "_generateUUID", value: function(e2) { + var t2 = this.get(12), t2 = "".concat(t2.getSDKAppID(), "-").concat(t2.getUserID(), "-").concat(mt()), e2 = e2.name || e2.value || e2.url || e2.tempFilePath, e2 = e2 && e2.slice(e2.lastIndexOf(".") + 1); + return t2 = e2 ? "".concat(t2, ".").concat(e2) : t2; + } }, { key: "getMessageOption", value: function(e2) { + return this._messageOptionsMap.get(e2); + } }, { key: "_getNickAndAvatarByUserID", value: function(e2) { + return this.get(4).getNickAndAvatarByUserID(e2); + } }, { key: "_getNameCardByGroupID", value: function(e2) { + if (e2.conversationType === A.CONV_GROUP) { + var t2 = this.get(7); + if (t2) + return t2.getMyNameCardByGroupID(e2.to); + } + return ""; + } }, { key: "reset", value: function() { + M.l("".concat(this._n, ".reset")), this._messageOptionsMap.clear(); + } }]), za), Fa = (t(Ja, u), Pa = n(Ja), e(Ja, [{ key: "onMsgExtNotify", value: function(e2) { + var o2 = this, e2 = e2.dataList, t2 = e2.messageInfo, i2 = e2.operateType, n2 = e2.operateResultList, a2 = e2.tinyID, e2 = e2.globalSequence, s2 = t2.clientTime, t2 = t2.random, r2 = "".concat(a2, "-").concat(s2, "-").concat(t2), c2 = [], u2 = [], l2 = (M.l("".concat(this._n, ".onMsgExtNotify messageID:").concat(r2, " operateType:").concat(i2, " globalSequence:").concat(e2)), this._updateGlobalSeq(r2, e2), false), d2 = false; + n2.forEach(function(e3) { + var t3 = e3.extensions, t3 = void 0 === t3 ? [] : t3, n3 = e3.clearSequence; + 1 === i2 ? (l2 = true, t3.forEach(function(e4) { + c2.push({ key: e4.key, value: e4.value }); + }), o2._updateLocalExt(r2, t3)) : 2 === i2 ? (d2 = true, t3.forEach(function(e4) { + u2.push(e4.key); + }), o2._updateLocalExt(r2, t3)) : 3 === i2 && (d2 = true, o2._hasLocalExt(r2) && o2._getLocalExt(r2).forEach(function(e4, t4) { + e4.seq <= n3 && !S(e4.value) && u2.push(t4); + }), o2._clearLocalExt(r2, n3)); + }), l2 && this.emitOEvt(h.MESSAGE_EXTENSIONS_UPDATED, { messageID: r2, extensions: c2 }), d2 && this.emitOEvt(h.MESSAGE_EXTENSIONS_DELETED, { messageID: r2, keyList: u2 }); + } }, { key: "setMessageExtensions", value: function(e2, t2) { + var o2, n2, i2, a2, s2, r2, c2, u2 = "setMessageExtensions"; + return this.canIUse(_.MSG_EXT) ? (o2 = "".concat(this._n, ".").concat(u2), n2 = e2.ID, i2 = e2.conversationID, a2 = e2.sequence, s2 = e2.time, r2 = p(t2), 20 < t2.length && (r2 = t2.slice(0, 20), M.w("".concat(o2, ". the length of extensions cannot exceed 20."))), t2 = "convID:".concat(i2, " messageID:").concat(n2, " sequence:").concat(a2, " time:").concat(s2, " count:").concat(r2.length), (c2 = new G(u2)).setMessage(t2), M.l("".concat(o2, " ").concat(t2)), this._modifyMsgExts(e2, r2).then(function(e3) { + var t3 = e3.resultList, n3 = e3.successCount, e3 = e3.failureCount, n3 = "successCount:".concat(n3, " failCount:").concat(e3); + return c2.setMoreMessage(n3).end(), M.l("".concat(o2, " ok. ").concat(n3)), C({ extensions: t3 }); + }).catch(function(e3) { + return c2.setError(e3).end(), M.e("".concat(o2, " failed. error:"), e3), D(e3); + })) : this.noUse(u2); + } }, { key: "getMessageExtensions", value: function(e2) { + var t2, n2, o2, i2, a2, s2, r2, c2 = this, u2 = "getMessageExtensions"; + return this.canIUse(_.MSG_EXT) ? (t2 = "".concat(this._n, ".").concat(u2), n2 = e2.ID, a2 = e2.conversationID, o2 = e2.sequence, i2 = e2.time, a2 = "convID:".concat(a2, " messageID:").concat(n2, " sequence:").concat(o2, " time:").concat(i2), (s2 = new G(u2)).setMessage(a2), r2 = void M.l("".concat(t2, " ").concat(a2)), this.getMsgExtsMap.has(n2) && (r2 = this._getGlobalSeq(n2)), this._getMsgExts(e2, r2).then(function(e3) { + return s2.end(), M.l("".concat(t2, " ok. extCount:").concat(e3.length)), N(r2) && 0 < e3.length && c2.getMsgExtsMap.set(n2, 1), C({ extensions: e3 }); + }).catch(function(e3) { + return s2.setError(e3).end(), M.e("".concat(t2, " failed. error:"), e3), D(e3); + })) : this.noUse(u2); + } }, { key: "deleteMessageExtensions", value: function(e2, t2) { + var i2, n2, a2, o2, s2, r2, c2, u2 = "deleteMessageExtensions"; + return this.canIUse(_.MSG_EXT) ? (i2 = "".concat(this._n, ".").concat(u2), n2 = [], a2 = 3, S(t2) || (a2 = 2, t2.forEach(function(e3) { + n2.push({ key: e3, value: "", seq: 0 }); + })), t2 = e2.ID, r2 = e2.conversationID, o2 = e2.sequence, s2 = e2.time, r2 = "convID:".concat(r2, " messageID:").concat(t2, " sequence:").concat(o2, " time:").concat(s2, " operateType:").concat(a2), (c2 = new G(u2)).setMessage(r2), M.l("".concat(i2, " ").concat(r2)), this._modifyMsgExts(e2, n2, a2).then(function(e3) { + var t3 = e3.resultList, n3 = e3.successCount, e3 = e3.failureCount, o3 = ""; + return 2 === a2 && (o3 = "success count:".concat(n3, " fail count:").concat(e3)), c2.setMoreMessage("".concat(o3)).end(), M.l("".concat(i2, " ok. ").concat(o3)), C({ extensions: t3 }); + }).catch(function(e3) { + return c2.setError(e3).end(), M.e("".concat(i2, " failed. error:"), e3), D(e3); + })) : this.noUse(u2); + } }, { key: "_modifyMsgExts", value: function(n2, e2) { + var o2 = this, t2 = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : 1, i2 = Gt(n2.to) ? A.CONV_TOPIC : n2.conversationType, a2 = void 0, s2 = (3 !== t2 && (a2 = this._getReqExts(n2, e2)), null); + switch (i2) { + case A.CONV_C2C: + s2 = this.get(6); + break; + case A.CONV_GROUP: + s2 = this.get(7); + break; + case A.CONV_TOPIC: + s2 = this.get(10); + break; + default: + return D({ code: L.NO_MODULE }); + } + return s2.modifyMsgExts(n2, a2, t2).then(function(e3) { + var e3 = e3.data, t3 = e3.extensions, e3 = e3.seq, i3 = [], a3 = 0, s3 = 0, r2 = []; + return (t3 = S(t3) ? [] : t3).forEach(function(e4) { + var t4 = e4.errorCode, e4 = e4.extension, n3 = e4.key, o3 = e4.value, e4 = e4.seq; + i3.push({ code: t4, key: n3, value: o3 }), 0 === t4 ? a3++ : s3++, r2.push({ key: n3, value: o3, seq: e4 }); + }), o2._updateGlobalSeq(n2.ID, e3), 0 < r2.length && (o2._updateLocalExt(n2.ID, r2), r2 = null), { resultList: i3, successCount: a3, failureCount: s3 }; + }).catch(function(e3) { + return D(e3); + }); + } }, { key: "_getReqExts", value: function(e2, t2) { + var o2, i2 = []; + return this._hasLocalExt(e2.ID) ? (o2 = this._getLocalExt(e2.ID), t2.forEach(function(e3) { + var t3 = e3.key, e3 = e3.value, n2 = 0; + o2.has(t3) && (n2 = o2.get(t3).seq), i2.push({ key: t3, value: e3, seq: n2 }); + })) : t2.forEach(function(e3) { + var t3 = e3.key, e3 = e3.value; + i2.push({ key: t3, value: e3, seq: 0 }); + }), i2; + } }, { key: "_getMsgExts", value: function(i2, e2) { + var a2 = this, s2 = "".concat(this._n, "._getMsgExts"), r2 = i2.ID, t2 = i2.to, n2 = null; + switch (Gt(t2) ? A.CONV_TOPIC : i2.conversationType) { + case A.CONV_C2C: + n2 = this.get(6); + break; + case A.CONV_GROUP: + n2 = this.get(7); + break; + case A.CONV_TOPIC: + n2 = this.get(10); + break; + default: + return D({ code: L.NO_MODULE }); + } + return n2.getMessageExtensions(i2, e2).then(function(e3) { + var e3 = e3.data, t3 = e3.extensions, n3 = e3.completeFlag, o2 = e3.globalSequence, e3 = e3.clearSequence, t3 = S(t3) ? [] : t3; + return M.l("".concat(s2, " ok. completeFlag:").concat(n3, " globalSequence:").concat(o2, " clearSequence:").concat(e3, " count:").concat(t3.length)), a2._updateLocalExt(r2, t3), a2._clearLocalExt(r2, e3), a2._updateGlobalSeq(r2, o2), 1 !== n3 ? (e3 = t3.slice(-1)[0].seq + 1, a2._getMsgExts(i2, e3)) : a2._getLocalExtList(r2); + }).catch(function(e3) { + return D(e3); + }); + } }, { key: "_hasLocalExt", value: function(e2) { + return this.msgExtMap.has(e2); + } }, { key: "_getLocalExt", value: function(e2) { + return this.msgExtMap.get(e2); + } }, { key: "_updateLocalExt", value: function(e2, t2) { + this._hasLocalExt(e2) || this.msgExtMap.set(e2, /* @__PURE__ */ new Map()); + var o2 = this._getLocalExt(e2); + t2.forEach(function(e3) { + var t3 = e3.key, n2 = e3.value, e3 = e3.seq; + o2.set(t3, { value: void 0 === n2 ? "" : n2, seq: e3 }); + }); + } }, { key: "_clearLocalExt", value: function(e2, n2) { + var o2; + n2 <= 0 || !this._hasLocalExt(e2) || (o2 = this._getLocalExt(e2)).forEach(function(e3, t2) { + e3.seq <= n2 && o2.delete(t2); + }); + } }, { key: "_getLocalExtList", value: function(e2) { + var n2 = []; + return this._hasLocalExt(e2) && this._getLocalExt(e2).forEach(function(e3, t2) { + e3 = e3.value; + S(e3) || n2.push({ key: t2, value: e3 }); + }), n2; + } }, { key: "_getGlobalSeq", value: function(e2) { + return this.globalSeqMap.get(e2); + } }, { key: "_updateGlobalSeq", value: function(e2, t2) { + this.globalSeqMap.set(e2, t2); + } }, { key: "reset", value: function() { + M.l("".concat(this._n, ".reset")), this.msgExtMap.clear(), this.globalSeqMap.clear(), this.getMsgExtsMap.clear(); + } }]), Ja), qa = (t(ja, u), Ga = n(ja), e(ja, [{ key: "onReactionNotifyList", value: function(e2) { + var a2 = this, e2 = (e2 || {}).dataList; + (void 0 === e2 ? [] : e2).forEach(function(e3) { + var t2 = e3.C2CMessageInfo, n2 = e3.groupMessageInfo, n2 = void 0 === n2 ? {} : n2, e3 = e3.reactionList, e3 = void 0 === e3 ? [] : e3, t2 = y(y({}, void 0 === t2 ? {} : t2), n2), n2 = t2.tinyID, o2 = t2.clientTime, t2 = t2.random, n2 = "".concat(n2, "-").concat(o2, "-").concat(t2), i2 = []; + e3.forEach(function(e4) { + N(e4.userIDList) && (e4.userIDList = [], e4.count = 0), i2.push.apply(i2, p(e4.userIDList)); + }), M.l("".concat(a2._n, ".onReactionNotifyList messageID:").concat(n2, " reactionList:").concat(e3.length)), a2._handleReactionSummary([{ messageID: n2, reactionList: e3 }], i2).then(function(e4) { + a2.emitOEvt(h.MESSAGE_REACTIONS_UPDATED, y({}, e4[0])); + }); + }); + } }, { key: "onReactionNotify", value: function(e2) { + var e2 = e2.dataList || {}, t2 = e2.C2CMessageInfo, n2 = e2.groupMessageInfo, n2 = void 0 === n2 ? {} : n2, o2 = e2.reactionID, e2 = e2.operateType, t2 = y(y({}, void 0 === t2 ? {} : t2), n2), n2 = t2.tinyID, i2 = t2.clientTime, t2 = t2.random, n2 = "".concat(n2, "-").concat(i2, "-").concat(t2), i2 = (M.l("".concat(this._n, ".onReactionNotify messageID:").concat(n2, " reactionID:").concat(o2, " operateType:").concat(e2)), 1 === e2 ? this._addReactedByMyselfMap(n2, o2) : this._removeReactedByMyselfMap(n2, o2), "".concat(n2, "-").concat(o2)); + this._reactionInfoMap.has(i2) && ((t2 = this._reactionInfoMap.get(i2)).reactedByMyself = 1 === e2, this.emitOEvt(h.MESSAGE_REACTIONS_UPDATED, { messageID: n2, reactionList: [t2] })); + } }, { key: "addMessageReaction", value: function(t2, n2) { + var o2, e2, i2, a2, s2 = this, r2 = "addMessageReaction"; + return this.canIUse(_.MSG_REACTION) ? (o2 = "".concat(this._n, ".").concat(r2), a2 = t2.ID, e2 = t2.conversationID, e2 = "convID:".concat(e2, " messageID:").concat(a2, " reactionID:").concat(n2), (i2 = new G(r2)).setMessage(e2), M.l("".concat(o2, " ").concat(e2)), a2 = this._createReactionOperationPack(t2, n2, 1), this._addReactedByMyselfMap(t2.ID, n2), this.req(a2).then(function() { + return i2.end(), M.l("".concat(o2, " ok.")), C(); + }).catch(function(e3) { + return s2._removeReactedByMyselfMap(t2.ID, n2), i2.setError(e3).end(), M.e("".concat(o2, " failed. error:"), e3), D(e3); + })) : this.noUse(r2); + } }, { key: "removeMessageReaction", value: function(e2, t2) { + var n2, o2, i2, a2, s2 = "removeMessageReaction"; + return this.canIUse(_.MSG_REACTION) ? (n2 = "".concat(this._n, ".").concat(s2), a2 = e2.ID, o2 = e2.conversationID, o2 = "convID:".concat(o2, " messageID:").concat(a2, " reactionID:").concat(t2), (i2 = new G(s2)).setMessage(o2), M.l("".concat(n2, " ").concat(o2)), a2 = this._createReactionOperationPack(e2, t2, 2), this._removeReactedByMyselfMap(e2.ID, t2), this.req(a2).then(function() { + return i2.end(), M.l("".concat(n2, " ok.")), C(); + }).catch(function(e3) { + return i2.setError(e3).end(), M.e("".concat(n2, " failed. error:"), e3), D(e3); + })) : this.noUse(s2); + } }, { key: "getMessageReactions", value: function(e2) { + var t2, n2, o2, i2, a2, s2, r2 = this, c2 = "getMessageReactions"; + return this.canIUse(_.MSG_REACTION) ? (t2 = "".concat(this._n, ".").concat(c2), n2 = e2.messageList, s2 = e2.maxUserCountPerReaction, o2 = n2[0].conversationID, o2 = "convID:".concat(o2, " maxUserCountPerReaction:").concat(s2, " msgCount:").concat(n2.length), (i2 = new G(c2)).setMessage(o2), M.l("".concat(t2, " ").concat(o2)), a2 = /* @__PURE__ */ new Map(), s2 = this._createReactionSummaryPack(y(y({}, e2), {}, { messageIDMap: a2 })), this.req(s2).then(function(e3) { + var e3 = e3.data.resultList, o3 = [], i3 = []; + return (void 0 === e3 ? [] : e3).forEach(function(e4) { + var t3 = e4.messageKey, t3 = void 0 === t3 ? void 0 : t3, n3 = e4.messageSequence, n3 = void 0 === n3 ? void 0 : n3, e4 = e4.reactionList, e4 = void 0 === e4 ? [] : e4, n3 = N(t3) ? a2.get(n3) : a2.get(t3); + o3.push({ messageID: n3, reactionList: e4 }), e4.forEach(function(e5) { + i3.push.apply(i3, p(e5.userIDList)); + }); + }), r2._handleReactionSummary(o3, i3); + }).then(function(e3) { + return i2.end(), M.l("".concat(t2, " ok.")), a2.clear(), C({ resultList: e3 }); + }).catch(function(e3) { + return i2.setError(e3).end(), M.e("".concat(t2, " failed. error:"), e3), D(e3); + })) : this.noUse(c2); + } }, { key: "getAllUserListOfMessageReaction", value: function(e2) { + var t2, n2, o2, i2, a2, s2, r2, c2, u2 = this, l2 = "getAllUserListOfMessageReaction"; + return this.canIUse(_.MSG_REACTION) ? (t2 = "".concat(this._n, ".").concat(l2), a2 = e2.message, n2 = e2.reactionID, o2 = e2.nextSeq, i2 = e2.count, c2 = a2.ID, a2 = a2.conversationID, a2 = "convID:".concat(a2, " messageID:").concat(c2, " reactionID:").concat(n2, " nextSeq:").concat(o2, " count:").concat(i2), (s2 = new G(l2)).setMessage(a2), M.l("".concat(t2, " ").concat(a2)), r2 = { userList: [], nextSeq: 0, isCompleted: false }, c2 = this._createReactionUserListPack(e2), this.req(c2).then(function(e3) { + var e3 = e3.data, t3 = e3.userIDList, t3 = void 0 === t3 ? [] : t3, e3 = e3.nextSeq, e3 = void 0 === e3 ? 0 : e3; + return r2.nextSeq = e3, r2.isCompleted = 0 === e3, u2.get(4).getUserNickAndAvatar(t3); + }).then(function(e3) { + return r2.userList = e3, s2.end(), M.l("".concat(t2, " ok.")), C(r2); + }).catch(function(e3) { + return s2.setError(e3).end(), M.e("".concat(t2, " failed. error:"), e3), D(e3); + })) : this.noUse(l2); + } }, { key: "_createReactionOperationPack", value: function(e2, t2, n2) { + var o2, i2, a2 = void 0, t2 = { reactionID: t2, userIDList: [this.getMyUserID()] }; + return e2.conversationType === A.CONV_C2C && (o2 = this.get(6), a2 = 1 === n2 ? k.ADD_C2C_MSG_REACTION : k.RM_C2C_MSG_REACTION, t2.from = e2.from, t2.to = e2.to, t2.messageKey = o2.getMessageKey(e2)), e2.conversationType === A.CONV_GROUP && (o2 = void 0, i2 = e2.to, Gt(e2.to) && (i2 = Jt(o2 = e2.to)), a2 = 1 === n2 ? k.ADD_GRP_MSG_REACTION : k.RM_GRP_MSG_REACTION, t2.groupID = i2, t2.topicID = o2, t2.messageSequence = e2.sequence), { P: a2, data: t2 }; + } }, { key: "_createReactionSummaryPack", value: function(e2) { + var n2, t2, o2, i2 = e2.messageList, a2 = e2.maxUserCountPerReaction, a2 = void 0 === a2 ? 10 : a2, s2 = e2.messageIDMap, e2 = i2[0], r2 = void 0, c2 = void 0; + return e2.conversationType === A.CONV_C2C && (n2 = this.get(6), t2 = i2.map(function(e3) { + var t3 = n2.getMessageKey(e3); + return s2.set(t3, e3.ID), t3; + }), r2 = k.GET_C2C_MSG_REACTIONS, c2 = { from: e2.from, to: e2.to, messageKeyList: t2, count: a2 }), e2.conversationType === A.CONV_GROUP && (t2 = void 0, o2 = e2.to, Gt(e2.to) && (o2 = Jt(t2 = e2.to)), e2 = i2.map(function(e3) { + return s2.set(e3.sequence, e3.ID), e3.sequence; + }), r2 = k.GET_GRP_MSG_REACTIONS, c2 = { groupID: o2, topicID: t2, messageSequenceList: e2, count: a2 }), { P: r2, data: c2 }; + } }, { key: "_createReactionUserListPack", value: function(e2) { + var t2 = e2.message, n2 = e2.reactionID, o2 = e2.nextSeq, e2 = e2.count, e2 = void 0 === e2 ? 100 : e2, i2 = void 0, n2 = { reactionID: n2, nextSeq: void 0 === o2 ? 0 : o2, count: 100 < e2 ? 100 : e2 }; + return t2.conversationType === A.CONV_C2C && (o2 = this.get(6), i2 = k.GET_C2C_MSG_REACTION_USER_LIST, n2.from = t2.from, n2.to = t2.to, n2.messageKey = o2.getMessageKey(t2)), t2.conversationType === A.CONV_GROUP && (e2 = void 0, o2 = t2.to, Gt(t2.to) && (o2 = Jt(e2 = t2.to)), i2 = k.GET_GRP_MSG_REACTION_USER_LIST, n2.groupID = o2, n2.topicID = e2, n2.messageSequence = t2.sequence), { P: i2, data: n2 }; + } }, { key: "_handleReactionSummary", value: function(t2, e2) { + var c2 = this; + return this.get(4).getUserNickAndAvatar(e2).then(function(r2) { + var e3 = []; + return t2.forEach(function(a2) { + var s2 = []; + a2.reactionList.forEach(function(e4) { + var t3 = e4.reactionID, n2 = e4.count, o2 = e4.userIDList, e4 = e4.reactedByMyself, e4 = void 0 === e4 ? void 0 : e4, i2 = [], o2 = (o2.forEach(function(t4) { + r2.forEach(function(e5) { + t4 === e5.userID && i2.push(e5); + }); + }), { reactionID: t3, totalUserCount: n2, partialUserList: i2, reactedByMyself: c2._computeReactedByMyself({ reactedByMyself: e4, messageID: a2.messageID, reactionID: t3 }) }); + s2.push(o2), N(e4) && !c2._reactedByMyselfMap.has(a2.messageID) && (n2 = "".concat(a2.messageID, "-").concat(t3), c2._reactionInfoMap.set(n2, o2)); + }), e3.push({ messageID: a2.messageID, reactionList: s2 }); + }), e3; + }); + } }, { key: "_addReactedByMyselfMap", value: function(e2, t2) { + this._reactedByMyselfMap.has(e2) || this._reactedByMyselfMap.set(e2, []); + e2 = this._reactedByMyselfMap.get(e2); + -1 === e2.indexOf(t2) && e2.push(t2); + } }, { key: "_removeReactedByMyselfMap", value: function(e2, t2) { + this._reactedByMyselfMap.has(e2) && -1 < (t2 = (e2 = this._reactedByMyselfMap.get(e2)).indexOf(t2)) && e2.splice(t2, 1); + } }, { key: "_computeReactedByMyself", value: function(e2) { + var t2 = e2.reactedByMyself, n2 = e2.messageID, e2 = e2.reactionID; + return N(t2) ? !!this._reactedByMyselfMap.has(n2) && this._reactedByMyselfMap.get(n2).includes(e2) : 1 === t2; + } }, { key: "reset", value: function() { + M.l("".concat(this._n, ".reset")), this._reactedByMyselfMap.clear(), this._reactionInfoMap.clear(); + } }]), ja), xa = (t(Wa, u), Na = n(Wa), e(Wa, [{ key: "sendMessage", value: function(e2) { + var o2 = this, i2 = this._createMsg(e2); + if (null === i2) + return D({ code: L.MSG_SEND_FAIL }); + this._addSendMessageTotalCount(i2); + var a2 = Date.now(); + return this.get(11).setMessageRandom(i2), this._sendComboMessage(i2, e2).then(function(e3) { + var e3 = e3.data, t2 = e3.time, n2 = e3.sequence, e3 = e3.readReceiptCode, e3 = (R(e3) && 0 !== e3 && (new G("sendMessageWithReceipt").setMessage("from:".concat(i2.from, " to:").concat(i2.to, " sequence:").concat(n2, " readReceiptCode:").concat(e3)).end(), M.w("".concat(o2._n, ".sendMessage readReceiptCode:").concat(e3, " message:").concat(o2.getErrMsg(e3)))), o2._addSendMessageSuccessCount(i2, a2), o2.get(11)), t2 = (i2.status = Rn, i2.time = t2, i2.conversationType === A.CONV_GROUP && (i2.sequence = n2), e3.appendToMessageList(i2), i2); + return true === i2._isExcludedFromLastMessage && (t2 = ""), e3.onMessageSent({ conversationOptionsList: [{ conversationID: i2.conversationID, unreadCount: 0, type: i2.conversationType, subType: i2.conversationSubType, lastMessage: t2 }] }), C({ message: i2 }); + }).catch(function(e3) { + return o2._onSendMessageFailed(i2, e3); + }); + } }, { key: "_sendComboMessage", value: function(e2, t2) { + var n2 = this._m.get(20), o2 = ""; + return e2.conversationType === A.CONV_C2C && (o2 = "".concat(a.NAME.OPEN_IM, ".").concat(k.SEND_C2C_MSG)), e2.conversationType === A.CONV_GROUP && (o2 = "".concat(a.NAME.GRP, ".").concat(k.SEND_GRP_MSG)), n2.sendComboMessage({ servcmd: o2, data: t2 }); + } }, { key: "_createMsg", value: function(e2) { + var t2 = "".concat(this._n, "._createMsg"), n2 = null; + try { + var o2, i2 = this.getMyUserID(), a2 = {}; + a2.senderTinyID = this.getMyTinyID(), a2.currentUser = i2, a2.from = e2.From_Account || i2, e2.GroupId ? (a2.conversationID = "".concat(A.CONV_GROUP).concat(e2.GroupId), a2.conversationType = A.CONV_GROUP, a2.to = e2.GroupId) : e2.To_Account && (a2.conversationID = "".concat(A.CONV_C2C).concat(e2.To_Account), a2.conversationType = A.CONV_C2C, a2.to = e2.To_Account), a2.time = e2.MsgTimeStamp || 0, a2.random = e2.Random || e2.MsgRandom || 0, a2.priority = e2.MsgPriority, m(e2.CloudCustomData) && 0 < e2.CloudCustomData.length && (a2.cloudCustomData = e2.CloudCustomData), O(e2.SendMsgControl) && (a2.messageControlInfo = {}, e2.SendMsgControl.includes("NoUnread") && (a2.messageControlInfo.excludedFromUnreadCount = 1), e2.SendMsgControl.includes("NoLastMsg")) && (a2.messageControlInfo.excludedFromLastMessage = 1), a2.conversationType === A.CONV_GROUP && O(e2.To_Account) && 0 < e2.To_Account.length && (o2 = e2.To_Account, 50 < e2.To_Account.length && (o2 = e2.To_Account.slice(0, 50), M.w("".concat(t2, " To_Account must be less than or equal to 50."))), a2.receiverList = p(o2), e2.To_Account = p(o2)), 1 !== e2.IsNeedReadReceipt && 1 !== e2.NeedReadReceipt || (a2.needReadReceipt = true), 1 === e2.SupportMessageExtension && (a2.isSupportExtension = true), (n2 = new Do(a2)).status = An, e2.MsgClientTime = n2.clientTime, n2.conversationType === A.CONV_C2C && (e2.MsgSeq = n2.sequence); + for (var s2, r2 = e2.MsgBody.length, c2 = 0; c2 < r2; c2++) + "TIMTextElem" === (s2 = e2.MsgBody[c2]).MsgType ? n2.setTextElement(s2.MsgContent.Text) : "TIMCustomElem" === s2.MsgType ? n2.setCustomElement({ data: s2.MsgContent.Data || "", description: s2.MsgContent.Desc || "", extension: s2.MsgContent.Ext || "" }) : "TIMFaceElem" === s2.MsgType && n2.setFaceElement({ index: s2.MsgContent.Index, data: s2.MsgContent.Data }); + var u2 = n2.getElements(); + n2.payload = u2[0].content, n2.type = u2[0].type; + } catch (e3) { + n2 = null, M.e("".concat(t2, " failed. error:"), e3); + } + return n2; + } }, { key: "_onSendMessageFailed", value: function(e2, t2) { + e2.status = On, this.get(11).deleteMessageRandom(e2), this._addSendMessageFailCountOnUser(e2, t2); + var n2 = new G("sendMessage"), o2 = "head.seq:".concat(t2.data.headSeq, " type:").concat(e2.type, " from:").concat(e2.from, " to:").concat(e2.to); + return n2.setMessage(o2).setError(t2).end(), M.e("".concat(this._n, "._onSendMessageFailed ").concat(o2, " error:"), t2), D(new E({ code: t2 && t2.code ? t2.code : L.MSG_SEND_FAIL, message: t2 && t2.message ? t2.message : void 0, data: { message: e2 } })); + } }, { key: "_getSendMessageSpecifiedKey", value: function(e2) { + if (e2.conversationType === A.CONV_C2C) + return Hn; + if (e2.conversationType === A.CONV_GROUP) { + var e2 = this.get(7).getLocalGroupProfile(e2.to); + if (e2) + return e2 = e2.type, Ot(e2) ? Kn : Bn; + } + } }, { key: "_addSendMessageTotalCount", value: function(e2) { + e2 = this._getSendMessageSpecifiedKey(e2); + e2 && this.get(26).addTotalCount(e2); + } }, { key: "_addSendMessageSuccessCount", value: function(e2, t2) { + var n2, e2 = this._getSendMessageSpecifiedKey(e2); + e2 && ((n2 = this.get(26)).addSuccessCount(e2), n2.addCost(e2, nn(t2, false))); + } }, { key: "_addSendMessageFailCountOnUser", value: function(e2, t2) { + var t2 = t2.code, t2 = void 0 === t2 ? -1 : t2, n2 = this.get(26), e2 = this._getSendMessageSpecifiedKey(e2); + Aa(t2) && e2 && n2.addFailedCountOfUserSide(e2); + } }]), Wa), Va = (t(Ya, u), Oa = n(Ya), e(Ya, [{ key: "registerPlugin", value: function(t2) { + var n2 = this, o2 = "0"; + Object.keys(t2).forEach(function(e2) { + n2.plugins[e2] = t2[e2], "tim-upload-plugin" === e2 && "function" == typeof t2[e2].getVersion && (o2 = t2[e2].getVersion()); + }), new G("registerPlugin").setMessage("".concat(Object.keys(t2))).setMoreMessage("version:".concat(o2)).end(); + } }, { key: "getPlugin", value: function(e2) { + return this.plugins[e2]; + } }, { key: "reset", value: function() { + } }]), Ya), Ha = (t(Ka, u), Ra = n(Ka), e(Ka, [{ key: "_init", value: function() { + this._startSync({ cookie: this._cookie, syncFlag: 0, isOnlineSync: 0 }); + } }, { key: "_startSync", value: function(e2) { + var i2 = this, t2 = e2.cookie, n2 = e2.syncFlag, o2 = e2.isOnlineSync, a2 = "".concat(this._n, "._startSync"), s2 = (M.l("".concat(a2, " options:"), e2), new G("syncUnread")); + s2.setMessage(JSON.stringify(e2)), this.req({ P: k.SYNC_UNREAD_MSG, data: { cookie: t2, syncFlag: n2, isOnlineSync: o2 } }).then(function(e3) { + var t3 = e3.data, n3 = t3.cookie, t3 = t3.syncFlag, o3 = "$cookie:".concat(n3, " syncFlag:").concat(t3); + M.l("".concat(a2, " ok. ").concat(o3)), i2._cookie = n3, s2.setMoreMessage(o3).end(), S(n3) || (0 === t3 || 1 === t3 ? (i2._dispatch(y(y({}, e3.data), {}, { isSyncingEnded: false })), i2._startSync({ cookie: n3, syncFlag: t3, isOnlineSync: 0 })) : 2 === t3 && i2._dispatch(y(y({}, e3.data), {}, { isSyncingEnded: true }))); + }).catch(function(e3) { + s2.setError(e3).end(), M.e("".concat(a2, " failed. error:"), e3); + }); + } }, { key: "_dispatch", value: function(e2) { + e2.eventArray && this.get(20).onMessage({ head: {}, body: { eventArray: e2.eventArray, isInstantMessage: this._onlineSyncFlag, isSyncingEnded: e2.isSyncingEnded } }), this.get(6).onNewMessage({ dataList: e2.messageList, isInstantMessage: !!e2.isSyncingEnded && this._onlineSyncFlag, C2CRemainingUnreadList: e2.C2CRemainingUnreadList, C2CPairUnreadList: e2.C2CPairUnreadList, isSyncingEnded: e2.isSyncingEnded }); + } }, { key: "syncOnNeed", value: function() { + M.l("".concat(this._n, ".syncOnNeed cookie:").concat(this._cookie)), this._onlineSyncFlag = true, this._startSync({ cookie: this._cookie, syncFlag: 0, isOnlineSync: 1 }); + } }, { key: "syncOnReconnected", value: function() { + M.l("".concat(this._n, ".syncOnReconnected cookie:").concat(this._cookie)), this._onlineSyncFlag = true, this._startSync({ cookie: this._cookie, syncFlag: 0, isOnlineSync: 0 }); + } }, { key: "reset", value: function() { + M.l("".concat(this._n, ".reset")), this._onlineSyncFlag = false, this._cookie = ""; + } }]), Ka), Ba = { req: { toAccount: "To_Account", fromAccount: "From_Account", to: "To_Account", from: "From_Account", groupID: "GroupId", groupAtUserID: "GroupAt_Account", extension: "Ext", data: "Data", description: "Desc", elements: "MsgBody", sizeType: "Type", downloadFlag: "Download_Flag", thumbUUID: "ThumbUUID", videoUUID: "VideoUUID", remoteAudioUrl: "Url", remoteVideoUrl: "VideoUrl", videoUrl: "", imageUrl: "URL", fileUrl: "Url", uuid: "UUID", priority: "MsgPriority", receiverUserID: "To_Account", receiverGroupID: "GroupId", messageSender: "SenderId", messageReceiver: "ReceiverId", nick: "From_AccountNick", avatar: "From_AccountHeadurl", messageNumber: "MsgNum", pbDownloadKey: "PbMsgKey", downloadKey: "JsonMsgKey", applicationType: "PendencyType", userIDList: "To_Account", groupNameList: "GroupName", userID: "To_Account", groupAttributeList: "GroupAttr", mainSequence: "AttrMainSeq", avChatRoomKey: "BytesKey", attributeControl: "AttrControl", sequence: "seq", messageControlInfo: "SendMsgControl", updateSequence: "UpdateSeq", clientTime: "MsgClientTime", sequenceList: "MsgSeqList", topicID: "TopicId", customData: "CustomString", isSupportTopic: "SupportTopic", isWebUniapp: "is_web_uniapp", isSupportExtension: "SupportMessageExtension", messageSequence: "MsgSeq", messageKey: "MsgKey", startSequence: "startSeq", simplifiedMessage: "DownsizeFlag", isRelayMessage: "IsRelayMsg", reactionID: "Reaction", messageSequenceList: "MsgSeqList", messageKeyList: "MsgKeyList", cmConfigID: "CustomModerationConfigID" }, res: { MsgPriority: "priority", ThumbUUID: "thumbUUID", VideoUUID: "videoUUID", Download_Flag: "downloadFlag", GroupId: "groupID", Member_Account: "userID", MsgList: "messageList", SyncFlag: "syncFlag", To_Account: "to", From_Account: "from", MsgSeq: "sequence", MsgRandom: "random", MsgTime: "time", MsgTimeStamp: "time", MsgContent: "content", MsgBody: "elements", From_AccountNick: "nick", From_AccountHeadurl: "avatar", GroupWithdrawInfoArray: "revokedInfos", GroupReadInfoArray: "groupMessageReadNotice", LastReadMsgSeq: "lastMessageSeq", WithdrawC2cMsgNotify: "c2cMessageRevokedNotify", C2cWithdrawInfoArray: "revokedInfos", C2cReadedReceipt: "c2cMessageReadReceipt", ReadC2cMsgNotify: "c2cMessageReadNotice", LastReadTime: "peerReadTime", 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", GroupFaceUrl: "avatar", GroupIntroduction: "introduction", GroupNotification: "notification", GroupApplyJoinOption: "joinOption", MsgKey: "messageKey", GroupInfo: "groupProfile", ShutupTime: "muteTime", Desc: "description", Ext: "extension", GroupAt_Account: "groupAtUserID", MsgNum: "messageNumber", PbMsgKey: "pbDownloadKey", JsonMsgKey: "downloadKey", MsgModifiedFlag: "isModified", PendencyItem: "applicationItem", PendencyType: "applicationType", AddTime: "time", AddSource: "source", AddWording: "wording", ProfileImImage: "avatar", PendencyAdd: "friendApplicationAdded", FrienPencydDel_Account: "friendApplicationDeletedUserIDList", Peer_Account: "userID", GroupAttr: "groupAttributeList", GroupAttrAry: "groupAttributeList", AttrMainSeq: "mainSequence", seq: "sequence", GroupAttrOption: "groupAttributeOption", BytesChangedKeys: "changedKeyList", GroupAttrInfo: "groupAttributeList", GroupAttrSeq: "mainSequence", PushChangedAttrValFlag: "isWithChangedAttributeInfo", SubKeySeq: "sequence", Val: "value", MsgGroupFromCardName: "senderNameCard", MsgGroupFromNickName: "senderNick", C2cNick: "peerNick", C2cImage: "peerAvatar", SendMsgControl: "messageControlInfo", NoLastMsg: "excludedFromLastMessage", NoUnread: "excludedFromUnreadCount", UpdateSeq: "updateSequence", MuteNotifications: "muteFlag", MsgClientTime: "clientTime", TinyId: "tinyID", GroupMsgReceiptList: "readReceiptList", ReadNum: "readCount", UnreadNum: "unreadCount", TopicId: "topicID", MillionGroupFlag: "communityType", SupportTopic: "isSupportTopic", MsgTopicNewInfo: "newTopicInfo", ShutupAll: "muteAllMembers", CustomString: "customData", TopicFaceUrl: "avatar", TopicIntroduction: "introduction", TopicNotification: "notification", TopicIdArray: "topicIDList", MsgVersion: "messageVersion", C2cMsgModNotifys: "c2cMessageModified", GroupMsgModNotifys: "groupMessageModified", ApplyJoinOption: "joinOption", MsgFlag: "messageRemindType", AtInfoList: "groupAtInfoList", AtFlagList: "groupAtType", AtMsgSeq: "sequence", BanDuration: "duration", BanDescription: "reason", NotVisible: "invisible", BytesTag: "tag", BytesValue: "value", RptBytesValue: "value", LatestSeq: "globalSequence", ClearSeq: "clearSequence", SupportMessageExtension: "isSupportExtension", ExtensionList: "extensions", GroupCounter: "counterList", Revoker_Account: "revoker", MsgExtensionNotify: "messageExtensionNotify", ExtensionC2cMsgInfo: "messageInfo", ExtensionGroupMsgInfo: "messageInfo", MsgOptType: "operateType", SetKVInfo: "operateResultList", DeleteKVInfo: "operateResultList", ClearKVInfo: "operateResultList", MsgKeyValue: "extensions", ClearMsgSeq: "clearSequence", MsgLastSeq: "globalSequence", InviteJoinOption: "inviteOption", MemberList_Account: "inviteeList", MsgMemberExtraInfoList: "inviteeInfoList", E: "event", GInf: "groupProfile", MCT: "clientTime", MR: "random", MP: "priority", MTS: "time", GId: "groupID", MS: "sequence", CCD: "cloudCustomData", F_Account: "from", F_Hd: "avatar", F_NN: "nick", GN: "groupName", GT: "groupType", IsSys: "isSystemMessage", OpInf: "operatorInfo", Img: "avatar", NN: "nick", OnlineInf: "onlineMemberInfo", ET: "expireTime", Num: "onlineMemberNum", Opt: "operationType", O_Account: "operatorID", RT: "operationType", UDF: "userDefinedField", L_Account: "userIDList", IsPlaceMsg: "isPlaceMessage", MsgCheckResult: "checkResult", Results: "resultList", Reaction: "reactionID", Reaction_Account: "userIDList", MsgReactionNotifyList: "messageReactionNotifyList", MsgReactionNotify: "messageReactionNotify", MsgReactionSummary: "reactionList", C2CMsgInfo: "C2CMessageInfo", GroupMsgInfo: "groupMessageInfo", int32_err_code: "errorCode", str_err_msg: "errorMsg", MsgDropReason: "messageDropReason", ReactedByMe: "reactedByMyself", Level: "messageRemindType", PeerReadTime: "timestamp", NoUnreadSeqList: "excludedUnreadSequenceList", NewMsg: "topicLatestMessage" }, ignoreKeyWord: ["C2C", "ID", "USP"] }; + function Ka(e2) { + return d(this, Ka), (e2 = Ra.call(this, e2))._n = "SyncUnreadMsgModule", e2._cookie = "", e2._onlineSyncFlag = false, e2.getIEmitInst().on(P.A2KEY_AND_TINYID_UPDATED, e2._init, i(e2)), e2; + } + function Ya(e2) { + return d(this, Ya), (e2 = Oa.call(this, e2))._n = "PluginModule", e2.plugins = {}, e2; + } + function Wa(e2) { + return d(this, Wa), (e2 = Na.call(this, e2))._n = "ComboMsgModule", e2; + } + function ja(e2) { + return d(this, ja), (e2 = Ga.call(this, e2))._n = "MsgReactionModule", e2._reactedByMyselfMap = /* @__PURE__ */ new Map(), e2._reactionInfoMap = /* @__PURE__ */ new Map(), e2; + } + function Ja(e2) { + return d(this, Ja), (e2 = Pa.call(this, e2))._n = "MsgExtModule", e2.msgExtMap = /* @__PURE__ */ new Map(), e2.globalSeqMap = /* @__PURE__ */ new Map(), e2.getMsgExtsMap = /* @__PURE__ */ new Map(), e2; + } + function za(e2) { + return d(this, za), (e2 = Ua.call(this, e2))._n = "MessageModule", e2._messageOptionsMap = /* @__PURE__ */ new Map(), e2._mergerMessageHandler = new Da(i(e2)), e2; + } + function Xa(e2, t2) { + if ("string" == typeof e2 || Array.isArray(e2)) + return t2 = Object.assign({ pascalCase: false }, t2), 0 === (e2 = Array.isArray(e2) ? e2.map(function(e3) { + return e3.trim(); + }).filter(function(e3) { + return e3.length; + }).join("-") : e2.trim()).length ? "" : 1 === e2.length ? t2.pascalCase ? e2.toUpperCase() : e2.toLowerCase() : (e2 = e2 = (e2 = e2 !== e2.toLowerCase() ? Za(e2) : e2).replace(/^[_.\- ]+/, "").toLowerCase().replace(/[_.\- ]+(\w|$)/g, function(e3, t3) { + return t3.toUpperCase(); + }).replace(/\d+(\w|$)/g, function(e3) { + return e3.toUpperCase(); + }), t2.pascalCase ? e2.charAt(0).toUpperCase() + e2.slice(1) : e2); + throw new TypeError("Expected the input to be `string | string[]`"); + } + var Za = function(e2) { + for (var t2 = false, n2 = false, o2 = false, i2 = 0; i2 < e2.length; i2++) { + var a2 = e2[i2]; + t2 && /[a-zA-Z]/.test(a2) && a2.toUpperCase() === a2 ? (e2 = e2.slice(0, i2) + "-" + e2.slice(i2), o2 = n2, n2 = !(t2 = false), i2++) : n2 && o2 && /[a-zA-Z]/.test(a2) && a2.toLowerCase() === a2 ? (e2 = e2.slice(0, i2 - 1) + "-" + e2.slice(i2 - 1), o2 = n2, t2 = !(n2 = false)) : (t2 = a2.toLowerCase() === a2 && a2.toUpperCase() !== a2, o2 = n2, n2 = a2.toUpperCase() === a2 && a2.toLowerCase() !== a2); + } + return e2; + }; + function Qa(e2, t2) { + var r2 = 0; + return function n2(e3, i2) { + var t3, o2, a2, s2; + return 100 < ++r2 ? (r2--, e3) : O(e3) ? (t3 = e3.map(function(e4) { + return ut(e4) ? n2(e4, i2) : e4; + }), r2--, t3) : ut(e3) ? (o2 = e3, a2 = function(e4, t4) { + if (!pt(t4)) + return false; + if (t4 !== Xa(t4)) + for (var n3 = 0; n3 < Ba.ignoreKeyWord.length && !t4.includes(Ba.ignoreKeyWord[n3]); n3++) + ; + var o3; + return N(i2[t4]) ? "OPPOChannelID" === (o3 = t4) ? o3 : o3[0].toUpperCase() + Xa(o3).slice(1) : i2[t4]; + }, s2 = /* @__PURE__ */ Object.create(null), Object.keys(o2).forEach(function(e4) { + var t4 = a2(o2[e4], e4); + t4 && (s2[t4] = o2[e4]); + }), t3 = wt(t3 = s2, function(e4, t4) { + return O(e4) || ut(e4) ? n2(e4, i2) : e4; + }), r2--, t3) : void 0; + }(e2, t2); + } + for (var $a, es = String.fromCharCode, ts = function(e2) { + var t2 = 0 | e2.charCodeAt(0); + if (55296 <= t2) + if (t2 < 56320) { + e2 = 0 | e2.charCodeAt(1); + if (56320 <= e2 && e2 <= 57343) { + if (65535 < (t2 = (t2 << 10) + e2 - 56613888 | 0)) + return es(240 | t2 >>> 18, 128 | t2 >>> 12 & 63, 128 | t2 >>> 6 & 63, 128 | 63 & t2); + } else + t2 = 65533; + } else + t2 <= 57343 && (t2 = 65533); + return t2 <= 2047 ? es(192 | t2 >>> 6, 128 | 63 & t2) : es(224 | t2 >>> 12, 128 | t2 >>> 6 & 63, 128 | 63 & t2); + }, ns = function(e2) { + for (var t2 = void 0 === e2 ? "" : ("" + e2).replace(/[\x80-\uD7ff\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]?/g, ts), n2 = 0 | t2.length, o2 = new Uint8Array(n2), i2 = 0; i2 < n2; i2 = i2 + 1 | 0) + o2[i2] = 0 | t2.charCodeAt(i2); + return o2; + }, os = (e(Ls, [{ key: "getID", value: function() { + return this._id; + } }, { key: "_onOpen", value: function(e2) { + this._handler.onOpen({ id: this._id, res: JSON.stringify(e2) }); + } }, { key: "_onClose", value: function(e2) { + this._handler.onClose({ id: this._id, e: e2 }); + } }, { key: "_onMessage", value: function(e2) { + e2 = this._canIUseBinaryFrame ? this._isAppCompressedData(e2.data) ? this._handler.inflate(e2.data) : function(e3) { + for (var t2 = new Uint8Array(e3), n2 = "", o2 = 0, i2 = t2.length; o2 < i2; ) { + var a2 = t2[o2], s2 = 0, r2 = 0; + if (a2 <= 127 ? (s2 = 0, r2 = 255 & a2) : a2 <= 223 ? (s2 = 1, r2 = 31 & a2) : a2 <= 239 ? (s2 = 2, r2 = 15 & a2) : a2 <= 244 && (s2 = 3, r2 = 7 & a2), 0 < i2 - o2 - s2) + for (var c2 = 0; c2 < s2; ) + r2 = r2 << 6 | 63 & (a2 = t2[o2 + c2 + 1]), c2 += 1; + else + r2 = 65533, s2 = i2 - o2; + n2 += String.fromCodePoint(r2), o2 += s2 + 1; + } + return n2; + }(e2.data) : e2.data; + this._handler.onMessage({ data: e2 }); + } }, { key: "_isAppCompressedData", value: function(e2) { + e2 = new Uint8Array(e2); + return 67 === e2[0] && 79 === e2[1] && 77 === e2[2] && 80 === e2[3]; + } }, { key: "_onError", value: function(e2) { + this._handler.onError({ id: this._id, e: e2 }); + } }, { key: "setIsWorkerEnabled", value: function(e2) { + this._isWorkerEnabled = true; + } }, { key: "close", value: function(e2) { + this._workerSocket && (this._workerSocket.postMessage({ cmd: "stop", code: e2 }), this._workerSocket.terminate(), this._workerSocket = null), ve ? (I.offSocketClose(), I.offSocketMessage(), I.offSocketOpen(), I.offSocketError(), I.closeSocket()) : this._socket && (v ? (this._socket.onClose(function() { + }), this._socket.onOpen(function() { + }), this._socket.onMessage(function() { + }), this._socket.onError(function() { + })) : (this._socket.onopen = null, this._socket.onmessage = null, this._socket.onclose = null, this._socket.onerror = null), me ? this._socket.close({ code: e2 }) : this._socket.close(e2), this._socket = null); + } }, { key: "send", value: function(e2) { + this._workerSocket ? this._workerSocket.postMessage({ cmd: "sendMessage", data: this._canIUseBinaryFrame ? ns(e2.data).buffer : e2.data }) : ve ? I.sendSocketMessage({ data: e2.data, fail: function() { + e2.fail && e2.requestID && e2.fail(e2.requestID); + } }) : this._socket && (v ? this._socket.send({ data: this._canIUseBinaryFrame ? ns(e2.data).buffer : e2.data, fail: function() { + e2.fail && e2.requestID && e2.fail(e2.requestID); + } }) : this._socket.send(this._canIUseBinaryFrame ? ns(e2.data) : e2.data)); + } }]), Ls), is = ["keyMap"], as = ["keyMap"], ss = "connected", rs = "connecting", cs = "disconnected", us = (e(Es, [{ key: "_setWebsocketHost", value: function() { + var e2 = this._chM.get(12); + this._currentSite = se, this._chM.isOversea() && (this._currentSite = "OVERSEA"), e2.isSingaporeSite() ? this._currentSite = "SINGAPORE" : e2.isKoreaSite() ? this._currentSite = "KOREA" : e2.isGermanySite() ? this._currentSite = "GERMANY" : e2.isIndiaSite() ? this._currentSite = "IND" : e2.isJapanSite() ? this._currentSite = "JPN" : e2.isUSASite() ? this._currentSite = "USA" : e2.isIndonesiaSite() && (this._currentSite = "INDONESIA"), a.HOST.setCurrent(this._currentSite); + } }, { key: "_initConnection", value: function() { + var e2 = this._chM.get(12).getSDKAppID() + "", e2 = (N(a.HOST.CURRENT.BACKUP) ? this._url = a.HOST.CURRENT.DEFAULT : "" === this._url ? this._url = a.HOST.CURRENT.DEFAULT0.replace("*", e2) : -1 < this._url.indexOf(e2) ? this._url = a.HOST.CURRENT.DEFAULT : this._url === a.HOST.CURRENT.DEFAULT ? this._url = a.HOST.CURRENT.BACKUP : this._url === a.HOST.CURRENT.BACKUP ? this._url = this._canIUseAnyCast() ? a.HOST.CURRENT.ANYCAST : a.HOST.CURRENT.DEFAULT : this._url === a.HOST.CURRENT.ANYCAST && (a.HOST.CURRENT.ANYCAST = "", this._url = a.HOST.CURRENT.DEFAULT), this._chM.get(12)), t2 = e2.getProxyServer(); + S(t2) || (this._url = t2), e2.isTestEnv() && (this._url = te.TEST[this._currentSite].DEFAULT), this._connect(), this._nextPingTs = 0; + } }, { key: "_canIUseAnyCast", value: function() { + return Ce && a.HOST.CURRENT.ANYCAST; + } }, { key: "onCheckTimer", value: function(e2) { + e2 % 1 == 0 && (this._checkPromiseMap(), this._checkNativeAppWS()); + } }, { key: "_checkPromiseMap", value: function() { + var a2 = this; + 0 !== this._promiseMap.size && this._promiseMap.forEach(function(e2, t2) { + var n2 = e2.reject, o2 = e2.timestamp, e2 = e2.headSeq, i2 = 15e3; + -1 !== t2.indexOf(k.LOGIN) ? i2 = 9e4 : -1 !== t2.indexOf(k.PING) && (i2 = 3e3), Date.now() - o2 >= i2 && (M.l("".concat(a2._n, "._checkPromiseMap request timeout, delete requestID:").concat(t2)), a2._promiseMap.delete(t2), n2(new E({ code: L.NETWORK_TIMEOUT, data: { headSeq: e2 } })), a2._chM.onRequestTimeout()); + }); + } }, { key: "_checkNativeAppWS", value: function() { + Ie && !this.isConnected() && this._reConnect(); + } }, { key: "onOpen", value: function(e2) { + var t2, n2; + this._readyState !== cs && (this._onOpenTs = Date.now(), n2 = e2.id, e2 = e2.res, this._socketID = n2, t2 = nn(this._startTs, false), n2 = "socketID:".concat(n2, " res:").concat(e2), M.l("".concat(this._n, "._onOpen cost:").concat(t2, " ms. ").concat(n2)), new G("wsOnOpen").setMessage(t2).setCostTime(t2).setMoreMessage(n2).end(), this._readyState = ss, this._reConnectCount = 0, this._resend(), true === this._reConnectFlag && (this._chM.onReconnected(), this._reConnectFlag = false), this._chM.onOpen()); + } }, { key: "onClose", value: function(e2) { + var t2 = new G("wsOnClose"), n2 = e2.id, e2 = e2.e, o2 = "sourceSocketID:".concat(n2, " currentSocketID:").concat(this._socketID, " code:").concat(e2.code, " reason:").concat(e2.reason), i2 = 0; + 0 !== this._onOpenTs && (i2 = Date.now() - this._onOpenTs), t2.setMessage(i2).setCostTime(i2).setMoreMessage(o2).setCode(e2.code).end(true), M.l("".concat(this._n, "._onClose ").concat(o2, " onlineTime:").concat(i2)), n2 === this._socketID && (this._readyState = cs, i2 < 1e3 ? this._chM.onReconnectFailed() : this._chM.onClose()); + } }, { key: "onError", value: function(e2) { + var t2 = e2.id, e2 = e2.e, n2 = "sourceSocketID:".concat(t2, " currentSocketID:").concat(this._socketID); + new G("wsOnError").setMessage(e2.errMsg || JSON.stringify(e2, ["message", "code"])).setMoreMessage(n2).setLevel("error").end(true), M.w("".concat(this._n, "._onError"), e2, n2), t2 === this._socketID && (this._readyState = cs, this._chM.onError()); + } }, { key: "onMessage", value: function(t2) { + var e2, n2, o2, i2, a2, s2; + try { + e2 = JSON.parse(t2.data); + } catch (e3) { + new G("jsonParseError").setMessage(t2.data).end(); + } + e2 && e2.head && (t2 = this._getRequestIDFromHead(e2.head), n2 = e2.body, this._chM.get(30).isTRTCCommand(t2) || (s2 = Kt(e2.head), n2 = function t3(e3, n3) { + var o3, i3, a3; + return O(e3) ? e3.map(function(e4) { + return ut(e4) ? t3(e4, n3) : e4; + }) : ut(e3) ? (o3 = e3, i3 = function(e4, t4) { + return N(n3[t4]) ? Xa(t4) : n3[t4]; + }, a3 = {}, Object.keys(o3).forEach(function(e4) { + a3[i3(o3[e4], e4)] = o3[e4]; + }), wt(a3, function(e4) { + return O(e4) || ut(e4) ? t3(e4, n3) : e4; + })) : void 0; + }(e2.body, this._getResKeyMap(s2))), M.d("".concat(this._n, ".onMessage ret:").concat(JSON.stringify(n2), " requestID:").concat(t2, " has:").concat(this._promiseMap.has(t2))), this._setNextPingTs(), this._promiseMap.has(t2) ? (o2 = (s2 = this._promiseMap.get(t2)).resolve, i2 = s2.reject, a2 = s2.timestamp, s2 = s2.headSeq, this._promiseMap.delete(t2), this._calcRTT(a2), n2.errorCode && 0 !== n2.errorCode ? (this._chM.onErrorCodeNotZero(n2), i2(new E({ code: n2.errorCode, message: n2.errorInfo || "", data: t2.includes(k.MODIFY_C2C_MSG) || t2.includes(k.MODIFY_GRP_MSG) ? { elements: n2.elements, messageVersion: n2.messageVersion, cloudCustomData: n2.cloudCustomData, headSeq: s2 } : { headSeq: s2 } }))) : o2(C(n2))) : this._chM.onMessage({ head: e2.head, body: n2 })); + } }, { key: "_calcRTT", value: function(e2) { + e2 = Date.now() - e2; + this._chM.get(26).addRTT(e2); + } }, { key: "_connect", value: function() { + this._readyState !== rs && this._readyState !== ss && (this._startTs = Date.now(), this._onOpenTs = 0, this._readyState = rs, this._socket = new os(this), this._socketID = this._socket.getID(), M.l("".concat(this._n, "._connect isWorkerEnabled:").concat(this.getIsWorkerEnabled(), " socketID:").concat(this._socketID, " url:").concat(this.getURL())), new G("wsConnect").setMessage("socketID:".concat(this._socketID, " url:").concat(this.getURL())).end()); + } }, { key: "getURL", value: function() { + this._chM.isDevMode() && (this._canIUseBinaryFrame = false); + var e2 = xt(), t2 = ((ve || _e && "windows" === e2 || Ie) && (this._canIUseBinaryFrame = false), -1), n2 = ("ios" === e2 ? t2 = Le || -1 : "android" === e2 && (t2 = ke || -1), this._chM.get(12)), o2 = this._chM.getPlatform(), i2 = n2.getSDKAppID(), n2 = n2.getInstanceID(), i2 = "sdkappid=".concat(i2, "&instanceid=").concat(n2, "&random=").concat(this._getRandom(), "&platform=").concat(o2, "&host=").concat(e2) + "&version=".concat(t2, "&sdkversion=").concat("3.4.7"); + return he && (i2 += "&isminigame=1"), this._chM.canIUseInflate() && (i2 += "&compress=gzip"), (this._canIUseBinaryFrame ? "".concat(this._url, "/binfo?") : "".concat(this._url, "/info?")).concat(i2); + } }, { key: "_closeConnection", value: function(e2) { + M.l("".concat(this._n, "._closeConnection socketID:").concat(this._socketID)), this._socket && (this._socket.close(e2), this._socketID = -1, this._socket = null, this._readyState = cs); + } }, { key: "_resend", value: function() { + var i2 = this; + if (M.l("".concat(this._n, "._resend reConnectFlag:").concat(this._reConnectFlag), "promiseMap.size:".concat(this._promiseMap.size, " simpleRequestMap.size:").concat(this._simpleRequestMap.size)), 0 < this._promiseMap.size && this._promiseMap.forEach(function(e3, t3) { + var n3 = e3.uplinkData, o3 = e3.resolve, e3 = e3.reject; + -1 !== t3.indexOf(k.AV_POLLING) ? i2._promiseMap.delete(t3) : (i2._promiseMap.set(t3, { resolve: o3, reject: e3, timestamp: Date.now(), uplinkData: n3 }), i2._execute(t3, n3)); + }), 0 < this._simpleRequestMap.size) { + var e2, t2 = Z(this._simpleRequestMap); + try { + for (t2.s(); !(e2 = t2.n()).done; ) { + var n2 = Y(e2.value, 2), o2 = n2[0], a2 = n2[1]; + this._execute(o2, a2); + } + } catch (e3) { + t2.e(e3); + } finally { + t2.f(); + } + this._simpleRequestMap.clear(); + } + } }, { key: "send", value: function(n2) { + var o2 = this, i2 = (n2.head.seq = this._getSequence(), n2.head.reqtime = Math.floor(Date.now() / 1e3), n2.keyMap, K(n2, is)), a2 = this._getRequestIDFromHead(n2.head), s2 = JSON.stringify(i2); + return new Promise(function(e2, t2) { + o2._promiseMap.set(a2, { resolve: e2, reject: t2, timestamp: Date.now(), uplinkData: s2, headSeq: n2.head.seq }), M.d("".concat(o2._n, ".send uplinkData:").concat(JSON.stringify(i2), " requestID:").concat(a2, " readyState:").concat(o2._readyState)), o2._readyState !== ss ? o2._reConnect() : (o2._execute(a2, s2), o2._chM.get(26).addRequestCount()); + }); + } }, { key: "simplySend", value: function(e2) { + e2.head.seq = this._getSequence(), e2.head.reqtime = Math.floor(Date.now() / 1e3), e2.keyMap; + var t2 = K(e2, as), e2 = this._getRequestIDFromHead(e2.head), t2 = JSON.stringify(t2); + this._readyState !== ss ? (this._simpleRequestMap.size < this.MAX_SIZE ? this._simpleRequestMap.set(e2, t2) : M.l("".concat(this._n, ".simplySend. simpleRequestMap is full, drop request!")), this._reConnect()) : this._execute(e2, t2); + } }, { key: "_execute", value: function(e2, t2) { + this._socket.send({ data: t2, fail: v ? this._onSendFail.bind(this) : void 0, requestID: e2 }); + } }, { key: "_onSendFail", value: function(e2) { + M.l("".concat(this._n, "._onSendFail requestID:").concat(e2)), this._chM.onSendFail(); + } }, { key: "_getSequence", value: function() { + var e2; + if (this._startSequence < 2415919103) + return e2 = this._startSequence, this._startSequence += 1, 2415919103 === this._startSequence && (this._startSequence = ft()), e2; + } }, { key: "_getRequestIDFromHead", value: function(e2) { + return e2.servcmd + e2.seq; + } }, { key: "_getResKeyMap", value: function(e2) { + e2 = this._chM.getKeyMap(e2); + return y(y({}, Ba.res), e2.res); + } }, { key: "_reConnect", value: function() { + this._readyState !== ss && this._readyState !== rs && this.forcedReconnect(); + } }, { key: "forcedReconnect", value: function() { + var e2 = "".concat(this._n, ".forcedReconnect"); + M.l("".concat(e2, " count:").concat(this._reConnectCount, " readyState:").concat(this._readyState)), this._reConnectFlag = true, this._resetRandom(), this._reConnectCount < this.MAX_RECONNECT_COUNT ? (this._reConnectCount += 1, this._closeConnection(4001), this._initConnection()) : (this._reConnectCount = 0, this._chM.get(15).isOnline() ? (M.w("".concat(e2, " disconnected from wsserver but network is ok, continue...")), this._closeConnection(4001), this._initConnection()) : this._chM.onReconnectFailed()); + } }, { key: "getReconnectFlag", value: function() { + return this._reConnectFlag; + } }, { key: "_setNextPingTs", value: function() { + this._nextPingTs = Ie ? Date.now() + 5e3 : Date.now() + 1e4; + } }, { key: "getNextPingTs", value: function() { + return this._nextPingTs; + } }, { key: "isConnected", value: function() { + return this._readyState === ss; + } }, { key: "canIUseBinaryFrame", value: function() { + return this._canIUseBinaryFrame; + } }, { key: "getSocketID", value: function() { + return this._socketID; + } }, { key: "inflate", value: function(e2) { + if (this._chM.canIUseInflate()) + return this._chM.get(37).inflate(e2); + } }, { key: "setIsWorkerEnabled", value: function(e2) { + M.l("".concat(this._n, ".setIsWorkerEnabled flag:").concat(e2)), this._isWorkerEnabled = e2; + } }, { key: "getIsWorkerEnabled", value: function() { + return this._isWorkerEnabled && Ge; + } }, { key: "_getRandom", value: function() { + return 0 === this._random && (this._random = Math.random()), this._random; + } }, { key: "_resetRandom", value: function() { + this._random = 0; + } }, { key: "close", value: function() { + M.l("".concat(this._n, ".close")), this._closeConnection(4e3), this._promiseMap.clear(), this._startSequence = ft(), this._readyState = cs, this._simpleRequestMap.clear(), this._reConnectFlag = false, this._reConnectCount = 0, this._onOpenTs = 0, this._url = "", this._random = 0, this._canIUseBinaryFrame = true, this._isWorkerEnabled = true; + } }]), Es), ls = function(a2, s2, r2) { + return new Promise(function(t2, e2) { + var n2, o2, i2 = "application/x-www-form-urlencoded;charset=UTF-8"; + v ? I.request({ url: s2, data: r2, method: a2, timeout: 3e3, header: { "content-type": i2 }, success: function(e3) { + e3 && e3.data && e3.data.NetCheckInfo && M.l("".concat("getconninfo ok in", " miniapp. ret:"), e3.data), t2(); + }, fail: function() { + e2(new E({ code: L.NETWORK_ERROR })); + } }) : (n2 = new XMLHttpRequest(), o2 = setTimeout(function() { + n2.abort(), e2(new E({ code: L.NETWORK_TIMEOUT })); + }, 3e3), n2.onreadystatechange = function() { + 4 === n2.readyState && (clearTimeout(o2), 200 === n2.status || 304 === n2.status ? (n2.responseText && -1 < n2.responseText.indexOf("NetCheckInfo") && M.l("".concat("getconninfo ok in", " web. ret:"), JSON.parse(n2.responseText)), t2()) : e2(new E({ code: L.NETWORK_ERROR }))); + }, n2.open(a2, s2, true), n2.setRequestHeader("Content-type", i2), r2 ? n2.send(r2) : n2.send()); + }); + }, ds = (t(Ds, u), $a = n(Ds), e(Ds, [{ key: "onCheckTimer", value: function(e2) { + this._socketHandler && (this.isLoggedIn() ? (0 < this._timerForNotLoggedIn && (clearInterval(this._timerForNotLoggedIn), this._timerForNotLoggedIn = -1), this._socketHandler.onCheckTimer(e2)) : this._socketHandler.onCheckTimer(1), this._checkNextPing()); + } }, { key: "onErrorCodeNotZero", value: function(e2) { + this.get(20).onErrorCodeNotZero(e2); + } }, { key: "onMessage", value: function(e2) { + this.get(20).onMessage(e2); + } }, { key: "send", value: function(e2) { + return this._socketHandler ? this._previousState !== A.NET_STATE_CONNECTED && e2.head.servcmd.includes(k.SSO_STAT) ? (this.reConnect(), this.isPrivateNetWork() ? Promise.resolve() : this._sendLogViaHTTP(e2)) : this._socketHandler.send(e2) : Promise.reject(); + } }, { key: "_sendLogViaHTTP", value: function(e2) { + var t2 = a.HOST.CURRENT.STAT, t2 = "".concat(t2, "/v4/imopenstat/tim_web_report_v2?sdkappid=").concat(e2.head.sdkappid, "&reqtime=").concat(Date.now()), e2 = JSON.stringify(e2.body); + return ls("POST", t2, e2); + } }, { key: "simplySend", value: function(e2) { + return this._socketHandler ? this._socketHandler.simplySend(e2) : Promise.reject(); + } }, { key: "onOpen", value: function() { + this._ping(); + } }, { key: "onClose", value: function() { + this._socketHandler && this._socketHandler.getReconnectFlag() && this._emitNetStateChangeEvent(A.NET_STATE_DISCONNECTED), this.reConnect(); + } }, { key: "onError", value: function() { + v && !Ie && this.warn("DomainNameInMP"), this._emitNetStateChangeEvent(A.NET_STATE_DISCONNECTED); + } }, { key: "getKeyMap", value: function(e2) { + return this.get(20).getKeyMap(e2); + } }, { key: "onRequestTimeout", value: function() { + 3e4 <= Date.now() - this._lastDiagnoseTS && this.diagnose(); + } }, { key: "onSendFail", value: function() { + this._emitNetStateChangeEvent(A.NET_STATE_DISCONNECTED); + } }, { key: "onReconnected", value: function() { + M.l("".concat(this._n, ".onReconnected cost:").concat(nn(this._disconnectedTS, true, true))), this._m.restartTimer(), this.get(20).onReconnected(nn(this._disconnectedTS, false, false)), this._disconnectedTS = 0, this._emitNetStateChangeEvent(A.NET_STATE_CONNECTED); + } }, { key: "onReconnectFailed", value: function() { + M.l("".concat(this._n, ".onReconnectFailed")), this._emitNetStateChangeEvent(A.NET_STATE_DISCONNECTED); + } }, { key: "setIsWorkerEnabled", value: function(e2) { + this._socketHandler && this._socketHandler.setIsWorkerEnabled(false); + } }, { key: "offline", value: function() { + this._emitNetStateChangeEvent(A.NET_STATE_DISCONNECTED); + } }, { key: "reConnect", value: function() { + var e2 = 0 < arguments.length && void 0 !== arguments[0] && arguments[0], t2 = false, n2 = (this._socketHandler && (t2 = this._socketHandler.getReconnectFlag()), "forcedFlag:".concat(e2, " fatalErrorFlag:").concat(this._fatalErrorFlag, " previousState:").concat(this._previousState, " reconnectFlag:").concat(t2)); + M.l("".concat(this._n, ".reConnect ").concat(n2)), this._fatalErrorFlag || !this._socketHandler || true !== e2 && this._previousState === A.NET_STATE_CONNECTING && t2 || (this._socketHandler.forcedReconnect(), this._emitNetStateChangeEvent(A.NET_STATE_CONNECTING)); + } }, { key: "_emitNetStateChangeEvent", value: function(e2) { + this._previousState !== e2 && (M.l("".concat(this._n, "._emitNetStateChangeEvent from ").concat(this._previousState, " to ").concat(e2)), e2 === A.NET_STATE_DISCONNECTED && 0 === this._disconnectedTS && (this._disconnectedTS = Date.now(), this.diagnose()), this._previousState = e2, this.emitOEvt(h.NET_STATE_CHANGE, { state: e2 })); + } }, { key: "_ping", value: function() { + var e2, n2 = this; + true !== this._probing && (this._probing = true, e2 = this.get(20).getProtocolData({ P: k.PING }), this.send(e2).then(function() { + n2._probing = false; + }).catch(function(e3) { + n2._probing = false; + var t2 = n2.get(15).isOnline(); + M.w("".concat(n2._n, "._ping failed. bOnline:").concat(t2, " error:"), e3), e3 && 60002 === e3.code ? (new G("error").setMessage("code:".concat(e3.code, " message:").concat(e3.message)).end(), n2._fatalErrorFlag = true, n2._emitNetStateChangeEvent(A.NET_STATE_DISCONNECTED)) : t2 ? n2.reConnect() : n2._emitNetStateChangeEvent(A.NET_STATE_DISCONNECTED); + })); + } }, { key: "_checkNextPing", value: function() { + this._socketHandler && this._socketHandler.isConnected() && Date.now() >= this._socketHandler.getNextPingTs() && this._ping(); + } }, { key: "dealloc", value: function() { + this._socketHandler && (this._socketHandler.close(), this._socketHandler = null), -1 < this._timerForNotLoggedIn && clearInterval(this._timerForNotLoggedIn); + } }, { key: "onRestApiKickedOut", value: function() { + this._socketHandler && (this._socketHandler.close(), this.reConnect(true)); + } }, { key: "canIUseInflate", value: function() { + return this._m.canIUseInflate(); + } }, { key: "getSocketID", value: function() { + if (this._socketHandler) + return this._socketHandler.getSocketID(); + } }, { key: "diagnose", value: function() { + this.isPrivateNetWork() || (this._lastDiagnoseTS = Date.now(), this._diagnoseBySSO(), this._diagnoseByCDN()); + } }, { key: "_diagnoseBySSO", value: function() { + var t2 = this, e2 = this._socketHandler.getURL(), n2 = e2.split("/")[2]; + n2.startsWith("ws") && (e2 = e2.slice(e2.indexOf("info?") + 5), n2 = "https://".concat(n2, "/v3/netcheck/getconninfo?").concat(e2, "&reqtime=").concat(Date.now()), ls("GET", n2).catch(function(e3) { + M.w("".concat(t2._n, "._diagnoseBySSO failed. error:"), e3); + })); + } }, { key: "_diagnoseByCDN", value: function() { + var t2 = this, e2 = this._socketHandler.getURL(), e2 = e2.slice(e2.indexOf("info?") + 5), e2 = "https://boce-cdn.my-imcloud.com/v3/netcheck/getconninfo?".concat(e2, "&reqtime=").concat(Date.now()); + ls("GET", e2).catch(function(e3) { + M.w("".concat(t2._n, "._diagnoseByCDN failed. error:"), e3); + }); + } }, { key: "reset", value: function() { + M.l("".concat(this._n, ".reset")), this._previousState = A.NET_STATE_CONNECTED, this._probing = false, this._fatalErrorFlag = false, this._timerForNotLoggedIn = setInterval(this.onCheckTimer.bind(this), 1e3), this._disconnectedTS = 0, this._lastDiagnoseTS = 0; + } }]), Ds), ps = ["a2", "tinyid"], _s = ["a2", "tinyid"], hs = (e(Ts, [{ key: "_fillMap", value: function() { + this._map.clear(); + var e2 = this._sessionM.genCommonHead(), t2 = this._sessionM.genCosSpecifiedHead(), n2 = this._sessionM.genSSOReportHead(); + this._map.set(k.LOGIN, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.IM_OPEN_STATUS, ".").concat(k.LOGIN) }), body: { state: "Online", isWebUniapp: 0, deviceBrand: 0, customInfo: "" }, keyMap: { req: { deviceBrand: "InstType" }, res: { InstId: "instanceID", HelloInterval: "helloInterval", RichMsgAuthKey: "authKey" } } }), this._map.set(k.LOGOUT, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.IM_OPEN_STATUS, ".").concat(k.LOGOUT) }), body: { type: 0, isWebUniapp: 0 }, keyMap: { req: { type: "wslogout_type" } } }), this._map.set(k.HELLO, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.IM_OPEN_STATUS, ".").concat(k.HELLO) }), body: { isWebUniapp: 0 }, keyMap: { res: { NewInstInfo: "newInstanceInfo" } } }), this._map.set(k.KICK_OTHER, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.STAT_SERVICE, ".").concat(k.KICK_OTHER) }), body: {} }), this._map.set(k.COS_SIGN, { head: y(y({}, t2), {}, { servcmd: "".concat(a.NAME.IM_COS_SIGN, ".").concat(k.COS_SIGN) }), body: { cmd: "open_im_cos_svc", subCmd: "get_cos_token", duration: 300, version: 2 }, keyMap: { req: { userSig: "usersig", subCmd: "sub_cmd", cmd: "cmd", duration: "duration", version: "version" }, res: { expired_time: "expiredTime", bucket_name: "bucketName", session_token: "sessionToken", tmp_secret_id: "secretId", tmp_secret_key: "secretKey" } } }), this._map.set(k.COS_PRE_SIG, { head: y(y({}, t2), {}, { servcmd: "".concat(a.NAME.CUSTOM_UPLOAD, ".").concat(k.COS_PRE_SIG) }), body: { fileType: void 0, fileName: void 0, uploadMethod: 0, duration: 900 }, keyMap: { req: { userSig: "usersig", fileType: "file_type", fileName: "file_name", uploadMethod: "upload_method" }, res: { expired_time: "expiredTime", request_id: "requestId", head_url: "headUrl", upload_url: "uploadUrl", download_url: "downloadUrl", ci_url: "ciUrl", snapshot_url: "requestSnapshotUrl" } } }), this._map.set(k.SIMPLE_COS_PRE_SIG, { head: y(y({}, t2), {}, { servcmd: "".concat(a.NAME.CUSTOM_UPLOAD, ".").concat(k.SIMPLE_COS_PRE_SIG) }), body: { uploadMethod: 0, platform: 2, SDKAppID: 0, userID: "", conversationType: 1, uploadConfig: [{ fileID: 1, fileType: 1, fileName: "" }] }, keyMap: { req: { platform: "uint32_platform", SDKAppID: "uint32_sdkappid", userID: "str_user_id", uploadMethod: "uint32_upload_method", conversationType: "uint32_scene", uploadConfig: "rpt_upload_object", fileID: "uint32_file_id", fileType: "uint32_file_type", fileName: "str_file_name" }, res: { str_final_ip: "uploadIP", rpt_pre_sig: "preSig", uint32_file_id: "fileID", uint32_exist_flag: "existFlag", str_download_url: "downloadUrl", str_upload_url: "uploadUrl", str_snapshot_url: "requestSnapshotUrl", str_file_key: "fileKey" } } }), this._map.set(k.GET_IMAGE_INFO, { head: y(y({}, t2), {}, { servcmd: "".concat(a.NAME.CUSTOM_UPLOAD, ".").concat(k.GET_IMAGE_INFO) }), body: { imageUrl: "" }, keyMap: { req: { imageUrl: "str_image_url" }, res: { rpt_msg_image_info: "imageInfoArray", uint32_image_type: "type", str_url: "url", uint32_width: "width", uint32_height: "height", str_image_format: "imageFormat" } } }), this._map.set(k.GET_IP, { head: y(y({}, t2), {}, { servcmd: "".concat(a.NAME.CUSTOM_UPLOAD, ".").concat(k.GET_IP) }), body: { domainName: "" }, keyMap: { req: { domainName: "str_domain" }, res: { str_final_ip: "ip" } } }), this._map.set(k.VIDEO_COVER, { head: y(y({}, t2), {}, { servcmd: "".concat(a.NAME.CUSTOM_UPLOAD, ".").concat(k.VIDEO_COVER) }), body: { version: 1, platform: void 0, coverName: void 0, requestSnapshotUrl: void 0 }, keyMap: { req: { version: "version", platform: "platform", coverName: "cover_name", requestSnapshotUrl: "snapshot_url" }, res: { error_code: "errorCode", error_msg: "errorInfo", download_url: "snapshotUrl" } } }), this._map.set(k.FETCH_COMMERCIAL_CONFIG, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.IM_CONFIG_MANAGER, ".").concat(k.FETCH_COMMERCIAL_CONFIG) }), body: { SDKAppID: 0 }, keyMap: { req: { SDKAppID: "uint32_sdkappid" }, res: { int32_error_code: "errorCode", str_error_message: "errorMessage", str_purchase_bits: "purchaseBits", uint32_expired_time: "expiredTime" } } }), this._map.set(k.PUSHED_COMMERCIAL_CONFIG, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.IM_CONFIG_MANAGER, ".").concat(k.PUSHED_COMMERCIAL_CONFIG) }), body: {}, keyMap: { res: { int32_error_code: "errorCode", str_error_message: "errorMessage", str_purchase_bits: "purchaseBits", uint32_expired_time: "expiredTime" } } }), this._map.set(k.FETCH_CLOUD_CTRL_CONFIG, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.IM_CONFIG_MANAGER, ".").concat(k.FETCH_CLOUD_CTRL_CONFIG) }), body: { SDKAppID: 0, version: 0 }, keyMap: { req: { SDKAppID: "uint32_sdkappid", version: "uint64_version" }, res: { int32_error_code: "errorCode", str_error_message: "errorMessage", str_json_config: "cloudControlConfig", uint32_expired_time: "expiredTime", uint32_sdkappid: "SDKAppID", uint64_version: "version" } } }), this._map.set(k.PUSHED_CLOUD_CTRL_CONFIG, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.IM_CONFIG_MANAGER, ".").concat(k.PUSHED_CLOUD_CTRL_CONFIG) }), body: {}, keyMap: { res: { int32_error_code: "errorCode", str_error_message: "errorMessage", str_json_config: "cloudControlConfig", uint32_expired_time: "expiredTime", uint32_sdkappid: "SDKAppID", uint64_version: "version" } } }), this._map.set(k.OVERLOAD_NOTIFY, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.OVERLOAD_PUSH, ".").concat(k.OVERLOAD_NOTIFY) }), body: {}, keyMap: { res: { OverLoadServCmd: "overloadCommand", DelaySecs: "waitingTime" } } }), this._map.set(k.SYNC_UNREAD_MSG, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.OPEN_IM, ".").concat(k.SYNC_UNREAD_MSG) }), body: { cookie: "", syncFlag: 0, needAbstract: 1, isOnlineSync: 0, needSignaling: 1, needCachedMsg: 1 }, keyMap: { req: { fromAccount: "From_Account", toAccount: "To_Account", from: "From_Account", to: "To_Account", time: "MsgTimeStamp", sequence: "MsgSeq", random: "MsgRandom", elements: "MsgBody" }, res: { 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: "to", MsgKey: "messageKey", GroupTips: "groupTips", MsgBody: "elements", MsgType: "type", C2CRemainingUnreadCount: "C2CRemainingUnreadList", C2CPairUnreadCount: "C2CPairUnreadList" } } }), this._map.set(k.GET_PROFANITY_LIST, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.IM_MSG_AUDIT_MGR, ".").concat(k.GET_PROFANITY_LIST) }), body: { version: 0, deviceID: "", startIndex: void 0 }, keyMap: { req: { version: "uint64_version", deviceID: "str_device_id", startIndex: "uint64_start_index" }, res: { msg_cmd_error_code: "errorInfo", str_err_msg: "errorMessage", uint32_code: "errorCode", msg_scene_ctl_config: "filterConfig", uint64_c2c_custom_msg_flag: "c2c_custom_message", uint64_c2c_text_msg_flag: "c2c_text_message", uint64_group_custom_msg_flag: "group_custom_message", uint64_group_text_msg_flag: "group_text_message", uint64_group_info_flag: "group_profile", uint64_group_member_info_flag: "group_member_profile", uint64_relation_chain_flag: "sns", uint64_user_info_flag: "user_profile", rpt_msg_dirty_word: "lexicon", str_dirty_word: "profanity", str_replaced_content: "replacement", uint64_filter_type: "filterType", uint64_id: "id", uint64_word_type: "profanityType", uint64_complete_flag: "completeFlag", uint64_next_start_index: "nextStartIndex", uint64_version: "version", uint64_expired_time: "expiredTime" } } }), this._map.set(k.SEND_C2C_MSG, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.OPEN_IM, ".").concat(k.SEND_C2C_MSG) }), body: { fromAccount: "", toAccount: "", msgSeq: 0, msgRandom: 0, msgBody: [], cloudCustomData: void 0, nick: "", avatar: "", msgLifeTime: void 0, offlinePushInfo: { pushFlag: 0, title: "", desc: "", ext: "", apnsInfo: { sound: "", badgeMode: 0, isVoipPush: void 0, image: "" }, androidInfo: { sound: "", XiaoMiChannelID: "", OPPOChannelID: "", GoogleChannelID: "", VIVOClassification: 1, VIVOCategory: "", HuaWeiCategory: "", HuaWeiImage: "", HonorImage: "", GoogleImage: "" } }, messageControlInfo: void 0, clientTime: void 0, needReadReceipt: 0, isSupportExtension: 0, isRelayMessage: 0, cmConfigID: void 0 }, keyMap: { req: { 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", url: "", imageUrl: "URL", fileUrl: "Url", remoteAudioUrl: "Url", remoteVideoUrl: "VideoUrl", thumbUUID: "ThumbUUID", videoUUID: "VideoUUID", videoUrl: "", downloadFlag: "Download_Flag", nick: "From_AccountNick", avatar: "From_AccountHeadurl", from: "From_Account", time: "MsgTimeStamp", messageRandom: "MsgRandom", messageSequence: "MsgSeq", elements: "MsgBody", clientSequence: "ClientSeq", payload: "MsgContent", messageList: "MsgList", messageNumber: "MsgNum", abstractList: "AbstractList", messageBody: "MsgBody", needReadReceipt: "IsNeedReadReceipt", GoogleChannelID: "GoogleChannelID", XiaoMiChannelID: "XiaoMiChannelID" } } }), this._map.set(k.SEND_GRP_MSG, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.SEND_GRP_MSG) }), body: { fromAccount: "", groupID: "", random: 0, clientSequence: 0, priority: "", msgBody: [], cloudCustomData: void 0, onlineOnlyFlag: 0, offlinePushInfo: { pushFlag: 0, title: "", desc: "", ext: "", apnsInfo: { sound: "", badgeMode: 0, isVoipPush: void 0, image: "" }, androidInfo: { sound: "", XiaoMiChannelID: "", OPPOChannelID: "", GoogleChannelID: "", VIVOClassification: 1, VIVOCategory: "", HuaWeiCategory: "", HuaWeiImage: "", HonorImage: "", GoogleImage: "" } }, groupAtInfo: [], messageControlInfo: void 0, clientTime: void 0, needReadReceipt: 0, topicID: void 0, receiverList: void 0, isSupportExtension: 0, isRelayMessage: 0, cmConfigID: void 0 }, keyMap: { req: { 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", url: "", imageUrl: "URL", fileUrl: "Url", remoteAudioUrl: "Url", remoteVideoUrl: "VideoUrl", thumbUUID: "ThumbUUID", videoUUID: "VideoUUID", videoUrl: "", downloadFlag: "Download_Flag", clientSequence: "ClientSeq", from: "From_Account", time: "MsgTimeStamp", messageRandom: "MsgRandom", messageSequence: "MsgSeq", payload: "MsgContent", messageList: "MsgList", messageNumber: "MsgNum", abstractList: "AbstractList", messageBody: "MsgBody", needReadReceipt: "NeedReadReceipt", receiverList: "To_Account", GoogleChannelID: "GoogleChannelID", XiaoMiChannelID: "XiaoMiChannelID" }, res: { MsgTime: "time", MsgSeq: "sequence" } } }), this._map.set(k.REVOKE_C2C_MSG, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.OPEN_IM, ".").concat(k.REVOKE_C2C_MSG) }), body: { msgInfo: { fromAccount: "", toAccount: "", msgTimeStamp: 0, msgSeq: 0, msgRandom: 0 } }, keyMap: { req: { msgInfo: "MsgInfo", msgTimeStamp: "MsgTimeStamp", msgSeq: "MsgSeq", msgRandom: "MsgRandom" } } }), this._map.set(k.REVOKE_GRP_MSG, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.REVOKE_GRP_MSG) }), body: { groupID: "", msgSeqList: void 0, topicID: "" }, keyMap: { req: { msgSeqList: "MsgSeqList", msgSeq: "MsgSeq" } } }), this._map.set(k.GET_C2C_ROAMING_MSG, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.OPEN_IM, ".").concat(k.GET_C2C_ROAMING_MSG) }), body: { peerAccount: "", count: 15, lastMessageTime: 0, messageKey: "", withRecalledMessage: 1, direction: 0 }, keyMap: { req: { messageKey: "MsgKey", peerAccount: "Peer_Account", count: "MaxCnt", lastMessageTime: "LastMsgTime", withRecalledMessage: "WithRecalledMsg", direction: "GetDirection" }, res: { LastMsgTime: "lastMessageTime", IsNeedReadReceipt: "needReadReceipt", IsPeerRead: "readReceiptSentByPeer" } } }), this._map.set(k.MODIFY_C2C_MSG, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.OPEN_IM, ".").concat(k.MODIFY_C2C_MSG) }), body: { from: "", to: "", sequence: 0, random: 0, time: 0, version: 0, elements: void 0, cloudCustomData: void 0 }, keyMap: { req: { sequence: "MsgSeq", random: "MsgRandom", time: "MsgTime", version: "MsgVersion", type: "MsgType", content: "MsgContent" } } }), this._map.set(k.GET_GRP_ROAMING_MSG, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.GET_GRP_ROAMING_MSG) }), body: { withRecalledMsg: 1, groupID: "", count: 15, sequence: "", topicID: void 0 }, keyMap: { req: { sequence: "ReqMsgSeq", count: "ReqMsgNumber", withRecalledMessage: "WithRecalledMsg" }, res: { Random: "random", MsgTime: "time", MsgSeq: "sequence", ReqMsgSeq: "sequence", RspMsgList: "messageList", 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", ToTopicId: "topicID", InvisibleMsgSeq: "invisibleSequenceList", NextReqMsgSeq: "nextSequence" } } }), this._map.set(k.SET_C2C_MSG_READ, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.OPEN_IM, ".").concat(k.SET_C2C_MSG_READ) }), body: { C2CMsgReaded: void 0 }, keyMap: { req: { lastMessageTime: "LastedMsgTime" } } }), this._map.set(k.SET_C2C_PEER_MUTE_NOTIFICATIONS, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.OPEN_IM, ".").concat(k.SET_C2C_PEER_MUTE_NOTIFICATIONS) }), body: { userIDList: void 0, muteFlag: 0 }, keyMap: { req: { userIDList: "Peer_Account", muteFlag: "Mute_Notifications" } } }), this._map.set(k.GET_C2C_PEER_MUTE_NOTIFICATIONS, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.OPEN_IM, ".").concat(k.GET_C2C_PEER_MUTE_NOTIFICATIONS) }), body: { toAccount: void 0, userIDList: void 0 }, keyMap: { req: { userIDList: "Peer_Account" }, res: { MuteNotificationsList: "muteFlagList" } } }), this._map.set(k.SET_GRP_MSG_READ, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.SET_GRP_MSG_READ) }), body: { groupID: void 0, messageReadSeq: void 0, topicID: void 0 }, keyMap: { req: { messageReadSeq: "MsgReadedSeq" } } }), this._map.set(k.SET_ALL_MSG_READ, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.OPEN_IM, ".").concat(k.SET_ALL_MSG_READ) }), body: { readAllC2CMessage: 0, groupMessageReadInfoList: [] }, keyMap: { req: { readAllC2CMessage: "C2CReadAllMsg", groupMessageReadInfoList: "GroupReadInfo", messageSequence: "MsgSeq" }, res: { C2CReadAllMsg: "readAllC2CMessage", GroupReadInfoArray: "groupMessageReadInfoList" } } }), this._map.set(k.DEL_C2C_MSG, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.OPEN_IM, ".").concat(k.DEL_C2C_MSG) }), body: { fromAccount: "", to: "", keyList: void 0 }, keyMap: { req: { keyList: "MsgKeyList" } } }), this._map.set(k.DEL_GRP_MSG, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.DEL_GRP_MSG) }), body: { groupID: "", deleter: "", keyList: void 0, topicID: void 0 }, keyMap: { req: { deleter: "Deleter_Account", keyList: "Seqs" } } }), this._map.set(k.TRANSLATE_TEXT, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.IM_OPEN_TRANSLATE, ".").concat(k.TRANSLATE_TEXT) }), body: { sourceTextList: void 0, SDKAppID: 0, from: 0, source: "", target: "" }, keyMap: { req: { sourceTextList: "SourceText", SDKAppID: "SdkAppId", from: "FromAccount" }, res: { TargetText: "translatedTextList", RequestId: "requestID", CmdErrorCode: "error", ErrorCode: "code", ErrorInfo: "message" } } }), this._map.set(k.VOICE_TO_TEXT, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.IM_OPEN_SPEECH, ".").concat(k.VOICE_TO_TEXT) }), body: { url: "", SDKAppID: 0, format: "", sourceType: 0, language: "" }, keyMap: { req: { url: "BytesUrl", SDKAppID: "Uint32Sdkappid", format: "BytesVoiceFormat", sourceType: "Uint64SourceType", language: "BytesEngServiceType" }, res: { BytesRequestid: "requestID", BytesResult: "result", CmdErrorCode: "error", ErrorCode: "code", ErrorInfo: "message" } } }), this._map.set(k.MODIFY_GRP_MSG, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.OPEN_IM, ".").concat(k.MODIFY_GRP_MSG) }), body: { groupID: "", topicID: void 0, sequence: 0, version: 0, elements: void 0, cloudCustomData: void 0 }, keyMap: { req: { sequence: "MsgSeq", version: "MsgVersion", type: "MsgType", content: "MsgContent" } } }), this._map.set(k.GET_READ_RECEIPT, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.GET_READ_RECEIPT) }), body: { groupID: "", sequenceList: void 0 }, keyMap: { req: { sequence: "MsgSeq" } } }), this._map.set(k.SEND_C2C_READ_RECEIPT, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.OPEN_IM, ".").concat(k.SEND_C2C_READ_RECEIPT) }), body: { peerAccount: "", messageInfoList: void 0 }, keyMap: { req: { peerAccount: "Peer_Account", messageInfoList: "C2CMsgInfo", fromAccount: "From_Account", toAccount: "To_Account", sequence: "MsgSeq", random: "MsgRandom", time: "MsgTime", clientTime: "MsgClientTime" } } }), this._map.set(k.SEND_READ_RECEIPT, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.SEND_READ_RECEIPT) }), body: { groupID: "", sequenceList: void 0 }, keyMap: { req: { sequenceList: "MsgSeqList", sequence: "MsgSeq" } } }), this._map.set(k.GET_READ_RECEIPT_DETAIL, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.GET_READ_RECEIPT_DETAIL) }), body: { groupID: "", sequence: void 0, flag: 0, cursor: 0, count: 0 }, keyMap: { req: { sequence: "MsgSeq", count: "Num" }, res: { ReadList: "readUserIDList", Read_Account: "userID", UnreadList: "unreadUserIDList", Unread_Account: "userID", IsFinish: "isCompleted" } } }), this._map.set(k.MODIFY_C2C_MSG_EXT, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.OPEN_IM_MSG_EXT, ".").concat(k.MODIFY_C2C_MSG_EXT) }), body: { from: void 0, to: void 0, messageKey: void 0, operateType: void 0, extensionList: void 0 } }), this._map.set(k.GET_C2C_MSG_EXT, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.OPEN_IM_MSG_EXT, ".").concat(k.GET_C2C_MSG_EXT) }), body: { from: void 0, to: void 0, messageKey: void 0, startSequence: void 0 } }), this._map.set(k.MODIFY_GRP_MSG_EXT, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.OPEN_IM_MSG_EXT, ".").concat(k.MODIFY_GRP_MSG_EXT) }), body: { groupID: void 0, topicID: void 0, messageSequence: void 0, operateType: void 0, extensionList: void 0 } }), this._map.set(k.GET_GRP_MSG_EXT, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.OPEN_IM_MSG_EXT, ".").concat(k.GET_GRP_MSG_EXT) }), body: { groupID: void 0, topicID: void 0, messageSequence: void 0, startSequence: void 0 } }), this._map.set(k.MSG_CLOUD_SEARCH, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.MSG_SEARCH, ".").concat(k.MSG_CLOUD_SEARCH) }), body: { keywordList: void 0, keywordListMatchType: "or", account: void 0, groupID: void 0, count: 100, cursor: void 0, messageTypeList: void 0, senderUserIDList: void 0, startTime: void 0, endTime: void 0 }, keyMap: { req: { keywordListMatchType: "MatchType", account: "PeerAccount", groupID: "GroupID", messageTypeList: "MsgTypeList", senderUserIDList: "SendUserIDList" }, res: { GroupID: "groupID", UserID: "userID", Count: "messageCount", LastMsgTime: "lastMessageTime", ConversationMsgs: "searchResult", IsNeedReadReceipt: "needReadReceipt", IsPeerRead: "readReceiptSentByPeer", MsgSeq: "sequence", ReqMsgSeq: "sequence", IsSystemMsg: "isSystemMessage", ToGroupId: "to", EnumFrom_AccountType: "fromAccountType", EnumTo_AccountType: "toAccountType", GroupCode: "groupCode", MsgContent: "content", ClientSeq: "clientSequence", ToTopicId: "topicID", InvisibleMsgSeq: "invisibleSequenceList", ErrorCode: "code", ErrorInfo: "message" } } }), this._map.set(k.ADD_C2C_MSG_REACTION, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.OPEN_IM_MSG_EXT, ".").concat(k.ADD_C2C_MSG_REACTION) }), body: { from: void 0, to: void 0, reactionID: void 0, messageKey: void 0, userIDList: void 0 }, keyMap: { req: { userIDList: "Add_Account" } } }), this._map.set(k.RM_C2C_MSG_REACTION, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.OPEN_IM_MSG_EXT, ".").concat(k.RM_C2C_MSG_REACTION) }), body: { from: void 0, to: void 0, reactionID: void 0, messageKey: void 0, userIDList: void 0 }, keyMap: { req: { userIDList: "Del_Account" } } }), this._map.set(k.GET_C2C_MSG_REACTIONS, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.OPEN_IM_MSG_EXT, ".").concat(k.GET_C2C_MSG_REACTIONS) }), body: { from: void 0, to: void 0, messageKeyList: void 0, count: void 0 } }), this._map.set(k.GET_C2C_MSG_REACTION_USER_LIST, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.OPEN_IM_MSG_EXT, ".").concat(k.GET_C2C_MSG_REACTION_USER_LIST) }), body: { from: void 0, to: void 0, reactionID: void 0, messageKey: void 0, count: void 0 } }), this._map.set(k.ADD_GRP_MSG_REACTION, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.OPEN_IM_MSG_EXT, ".").concat(k.ADD_GRP_MSG_REACTION) }), body: { groupID: void 0, topicID: void 0, reactionID: void 0, messageSequence: void 0, userIDList: void 0 }, keyMap: { req: { userIDList: "Add_Account" } } }), this._map.set(k.RM_GRP_MSG_REACTION, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.OPEN_IM_MSG_EXT, ".").concat(k.RM_GRP_MSG_REACTION) }), body: { groupID: void 0, topicID: void 0, reactionID: void 0, messageSequence: void 0, userIDList: void 0 }, keyMap: { req: { userIDList: "Del_Account" } } }), this._map.set(k.GET_GRP_MSG_REACTIONS, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.OPEN_IM_MSG_EXT, ".").concat(k.GET_GRP_MSG_REACTIONS) }), body: { groupID: void 0, topicID: void 0, messageSequenceList: void 0, count: void 0 }, keyMap: { res: { MsgSeq: "messageSequence" } } }), this._map.set(k.GET_GRP_MSG_REACTION_USER_LIST, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.OPEN_IM_MSG_EXT, ".").concat(k.GET_GRP_MSG_REACTION_USER_LIST) }), body: { groupID: void 0, topicID: void 0, reactionID: void 0, messageSequence: void 0, nextSeq: void 0, count: void 0 } }), this._map.set(k.GET_C2C_PEER_READ_TIME, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.OPEN_IM, ".").concat(k.GET_C2C_PEER_READ_TIME) }), body: { userIDList: void 0 }, keyMap: { req: { userIDList: "To_Account" }, res: { ReadTime: "peerReadTimeList" } } }), this._map.set(k.PAGING_GET_CONV_LIST, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.RECENT_CONTACT, ".").concat(k.PAGING_GET_CONV_LIST) }), body: { fromAccount: void 0, timeStamp: void 0, startIndex: void 0, pinnedTimeStamp: void 0, pinnedStartIndex: void 0, orderType: void 0, messageAssistFlag: 15, assistFlag: 31 }, keyMap: { req: { messageAssistFlag: "MsgAssistFlags", assistFlag: "AssistFlags", pinnedTimeStamp: "TopTimeStamp", pinnedStartIndex: "TopStartIndex" }, res: { SessionItem: "conversations", ToAccount: "groupID", To_Account: "userID", UnreadMsgCount: "unreadCount", MsgGroupReadedSeq: "messageReadSeq", C2cPeerReadTime: "c2cPeerReadTime", LastMsgFlags: "lastMessageFlag", TopFlags: "isPinned", TopTimeStamp: "pinnedTimeStamp", TopStartIndex: "pinnedStartIndex", GroupId: "convGroupID", C2cRemark: "friendRemark", MsgRecvOption: "messageRemindType", GroupIgnoredUnreadSeqCount: "noUnreadCount", GroupNextMsgSeq: "nextMessageSeq" } } }), this._map.set(k.DEL_CONV, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.RECENT_CONTACT, ".").concat(k.DEL_CONV) }), body: { fromAccount: "", conversationList: void 0, clearHistoryMessage: void 0 }, keyMap: { req: { toGroupID: "ToGroupid", clearHistoryMessage: "ClearRamble", conversationList: "ContactItem" }, res: { ResultItem: "resultList", ToGroupid: "groupID", ResultCode: "code", ResultInfo: "info" } } }), this._map.set(k.CLEAR_HISTORY_MSG, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.RECENT_CONTACT, ".").concat(k.CLEAR_HISTORY_MSG) }), body: { fromAccount: "", toAccount: void 0, type: 1, toGroupID: void 0 }, keyMap: { req: { toGroupID: "ToGroupid" } } }), this._map.set(k.PIN_CONV, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.RECENT_CONTACT, ".").concat(k.PIN_CONV) }), body: { fromAccount: "", operationType: 1, itemList: void 0 }, keyMap: { req: { itemList: "RecentContactItem" } } }), this._map.set(k.DEL_GROUP_AT_TIPS, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.OPEN_IM, ".").concat(k.DEL_GROUP_AT_TIPS) }), body: { messageListToDelete: void 0 }, keyMap: { req: { messageListToDelete: "DelMsgList", messageSeq: "MsgSeq", messageRandom: "MsgRandom" } } }), this._map.set(k.SET_CONV_CUSTOM_DATA, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.RECENT_CONTACT, ".").concat(k.MARK_CONV) }), body: { fromAccount: "", itemList: void 0 }, keyMap: { req: { itemList: "MarkItem", operationType: "OptType", groupID: "ToGroupId" }, res: { ToGroupId: "groupID", OptType: "operationType" } } }), this._map.set(k.MARK_CONV, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.RECENT_CONTACT, ".").concat(k.MARK_CONV) }), body: { fromAccount: "", itemList: void 0 }, keyMap: { req: { itemList: "MarkItem", operationType: "OptType", groupID: "ToGroupId" }, res: { ToGroupId: "groupID", OptType: "operationType" } } }), this._map.set(k.CREATE_CONV_GRP, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.RECENT_CONTACT, ".").concat(k.CREATE_CONV_GRP) }), body: { fromAccount: "", itemList: void 0 }, keyMap: { req: { itemList: "GroupContactItem", groupID: "ToGroupId" }, res: { GroupId: "convGroupID", ToGroupId: "groupID", OptType: "operationType" } } }), this._map.set(k.DEL_CONV_GRP, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.RECENT_CONTACT, ".").concat(k.DEL_CONV_GRP) }), body: { fromAccount: "", groupName: void 0 }, keyMap: { res: { GroupId: "convGroupID" } } }), this._map.set(k.RENAME_CONV_GRP, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.RECENT_CONTACT, ".").concat(k.RENAME_CONV_GRP) }), body: { fromAccount: "", updateType: void 0, updateGroup: void 0 }, keyMap: { req: { oldName: "OldGroupName", newName: "NewGroupName", groupID: "ToGroupId", operationType: "ContactOptType", groupName: "OldGroupName", updateItem: "ContactUpdateItem" }, res: { ContactOptType: "operationType", ToGroupId: "groupID", GroupId: "convGroupID" } } }), this._map.set(k.ADD_CONV_TO_GRP, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.RECENT_CONTACT, ".").concat(k.RENAME_CONV_GRP) }), body: { fromAccount: "", updateType: void 0, updateGroup: { groupName: void 0, updateGroupType: void 0, updateItem: void 0 } } }), this._map.set(k.DEL_CONV_FROM_GRP, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.RECENT_CONTACT, ".").concat(k.RENAME_CONV_GRP) }), body: { fromAccount: "", updateType: void 0, updateGroup: void 0 } }), this._map.set(k.GET_CONV_GRP_LIST, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.RECENT_CONTACT, ".").concat(k.GET_CONV_GRP_LIST) }), body: { fromAccount: "", startIndex: void 0 }, keyMap: { res: { GroupId: "convGroupID", ToGroupId: "groupID", OptType: "operationType", CustomMark: "customData", ContactGroupId: "convGroupIDList" } } }), this._map.set(k.SEARCH_CONV_GRP_MARK, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.RECENT_CONTACT, ".").concat(k.SEARCH_CONV_GRP_MARK) }), body: { fromAccount: "", contactItem: void 0 }, keyMap: { req: { groupID: "ToGroupId" }, res: { GroupId: "convGroupID", ToGroupId: "groupID", OptType: "operationType", CustomMark: "customData", ContactGroupId: "convGroupIDList", ContactResultItem: "contactItem" } } }), this._map.set(k.GET_USER_PROFILE, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.PROFILE, ".").concat(k.GET_USER_PROFILE) }), body: { fromAccount: "", userItem: [] }, keyMap: { req: { toAccount: "To_Account", standardSequence: "StandardSequence", customSequence: "CustomSequence" } } }), this._map.set(k.UPDATE_MY_PROFILE, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.PROFILE, ".").concat(k.UPDATE_MY_PROFILE) }), body: { fromAccount: "", profileItem: [{ tag: g.NICK, value: "" }, { tag: g.GENDER, value: "" }, { tag: g.ALLOWTYPE, value: "" }, { tag: g.AVATAR, value: "" }] }, keyMap: { req: { toAccount: "To_Account", standardSequence: "StandardSequence", customSequence: "CustomSequence" } } }), this._map.set(k.GET_BL, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.FD, ".").concat(k.GET_BL) }), body: { fromAccount: "", startIndex: 0, maxLimited: 30, lastSequence: 0 }, keyMap: { res: { CurruentSequence: "currentSequence" } } }), this._map.set(k.ADD_TO_BL, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.FD, ".").concat(k.ADD_TO_BL) }), body: { fromAccount: "", toAccount: [] } }), this._map.set(k.RM_FROM_BL, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.FD, ".").concat(k.RM_FROM_BL) }), body: { fromAccount: "", toAccount: [] } }), this._map.set(k.SET_SELF_STATUS, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.IM_OPEN_STATUS, ".").concat(k.SET_SELF_STATUS) }), body: { customStatus: "" } }), this._map.set(k.GET_USER_STATUS, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.IM_OPEN_STATUS, ".").concat(k.GET_USER_STATUS) }), body: { userIDList: void 0 }, keyMap: { res: { UserStatusList: "successUserList", ErrorList: "failureUserList", To_Account: "userID", Invalid_Account: "invalidUserID", Status: "statusType" } } }), this._map.set(k.SUB_USER_STATUS, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.IM_OPEN_STATUS, ".").concat(k.SUB_USER_STATUS) }), body: { userIDList: void 0 }, keyMap: { res: { ErrorList: "failureUserList", To_Account: "userID", Invalid_Account: "invalidUserID" } } }), this._map.set(k.UNSUB_USER_STATUS, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.IM_OPEN_STATUS, ".").concat(k.UNSUB_USER_STATUS) }), body: { userIDList: void 0, unsubscribeAll: void 0 }, keyMap: { res: { ErrorList: "failureUserList", To_Account: "userID", Invalid_Account: "invalidUserID" } } }), this._map.set(k.GET_FD_LIST, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.FD, ".").concat(k.GET_FD_LIST) }), body: { fromAccount: "", startIndex: 0, standardSequence: 0, customSequence: 0 }, keyMap: { res: { FriendNum: "friendCount", UserDataItem: "resultList", ValueItem: "tagValueList" } } }), this._map.set(k.ADD_FD, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.FD, ".").concat(k.ADD_FD) }), body: { fromAccount: "", addFriendItem: [], type: "" }, keyMap: { req: { source: "AddSource", wording: "AddWording", type: "AddType" }, res: { ResultItem: "resultList" } } }), this._map.set(k.UPDATE_FD, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.FD, ".").concat(k.UPDATE_FD) }), body: { fromAccount: "", updateItem: void 0 }, keyMap: { req: { snsItem: "SnsItem" }, res: { ResultItem: "resultList" } } }), this._map.set(k.DEL_FD, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.FD, ".").concat(k.DEL_FD) }), body: { fromAccount: "", userIDList: [], type: "" }, keyMap: { req: { type: "DeleteType" }, res: { ResultItem: "resultList" } } }), this._map.set(k.GET_FD_PROFILE, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.FD, ".").concat(k.GET_FD_PROFILE) }), body: { fromAccount: "", userIDList: void 0 }, keyMap: { res: { InfoItem: "resultList", SnsProfileItem: "tagValueList" } } }), this._map.set(k.CHECK_FD, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.FD, ".").concat(k.CHECK_FD) }), body: { fromAccount: "", userIDList: [], type: "" }, keyMap: { req: { type: "CheckType" }, res: { InfoItem: "resultList" } } }), this._map.set(k.GET_FD_APPLICATION_LIST, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.FD, ".").concat(k.GET_FD_APPLICATION_LIST) }), body: { fromAccount: "", applicationType: "", startTime: 0, maxLimited: 0, lastSequence: 0 }, keyMap: { res: { PendencyItem: "resultList", AddSource: "source", AddTime: "time", AddWording: "wording", Image: "avatar", UnreadPendencyCount: "unreadCount", To_Account: "userID", PendencyType: "type" } } }), this._map.set(k.RESPOND_FD_APPLICATION, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.FD, ".").concat(k.RESPOND_FD_APPLICATION) }), body: { fromAccount: "", responseFriendItem: [] }, keyMap: { req: { tag: "TagName", action: "ResponseAction" }, res: { ResultItem: "resultList" } } }), this._map.set(k.DEL_FD_APPLICATION, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.FD, ".").concat(k.DEL_FD_APPLICATION) }), body: { fromAccount: "", type: "", userIDList: void 0 }, keyMap: { req: { type: "PendencyType", userIDList: "To_Account" }, res: { ResultItem: "resultList" } } }), this._map.set(k.REPORT_FD_APPLICATION, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.FD, ".").concat(k.REPORT_FD_APPLICATION) }), body: { fromAccount: "", latestTimeStamp: "" }, keyMap: { req: { latestTimeStamp: "LatestPendencyTimeStamp" } } }), this._map.set(k.CREATE_FD_GRP, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.FD, ".").concat(k.CREATE_FD_GRP) }), body: { fromAccount: "", groupName: void 0, userIDList: void 0 }, keyMap: { req: { groupName: "GroupName", userIDList: "To_Account" }, res: { ResultItem: "resultList" } } }), this._map.set(k.DEL_FD_GRP, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.FD, ".").concat(k.DEL_FD_GRP) }), body: { fromAccount: "", nameList: void 0 }, keyMap: { req: { nameList: "GroupName" } } }), this._map.set(k.GET_FD_GRP_LIST, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.FD, ".").concat(k.GET_FD_GRP_LIST) }), body: { fromAccount: "", lastSequence: 0, needFriend: "Need_Friend_Type_Yes" }, keyMap: { res: { ResultItem: "resultList", GroupName: "name", FriendNumber: "friendCount", To_Account: "userIDList" } } }), this._map.set(k.UPDATE_FD_GRP, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.FD, ".").concat(k.UPDATE_FD_GRP) }), body: { fromAccount: "", oldName: "", newName: void 0, updateGroupItem: void 0 }, keyMap: { req: { oldName: "GroupOldName", newName: "GroupNewName" }, res: { UpdateType: "type", ResultItem: "resultList" } } }), this._map.set(k.GET_GRP_LIST, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.GET_GRP_LIST) }), body: { memberAccount: "", limit: void 0, offset: void 0, groupType: void 0, responseFilter: { groupBaseInfoFilter: void 0, selfInfoFilter: void 0 }, isSupportTopic: 0, needAppDefineData: 1 }, keyMap: { req: { memberAccount: "Member_Account" }, res: { GroupIdList: "groups", MsgSeq: "readedSequence", LastRecallTime: "_lastRevokedTime", AppDefinedData: "groupCustomField" } } }), this._map.set(k.GET_GRP_PROFILE, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.GET_GRP_PROFILE) }), body: { groupIDList: void 0, responseFilter: { groupBaseInfoFilter: void 0, groupCustomFieldFilter: void 0, memberInfoFilter: void 0, memberCustomFieldFilter: void 0 } }, keyMap: { req: { groupIDList: "GroupIdList", groupCustomField: "AppDefinedData", memberCustomField: "AppMemberDefinedData", groupCustomFieldFilter: "AppDefinedDataFilter_Group", memberCustomFieldFilter: "AppDefinedDataFilter_GroupMember" }, res: { GroupIdList: "groups", AppDefinedData: "groupCustomField", AppMemberDefinedData: "memberCustomField", AppDefinedDataFilter_Group: "groupCustomFieldFilter", AppDefinedDataFilter_GroupMember: "memberCustomFieldFilter", InfoSeq: "infoSequence", MemberList: "members", GroupInfo: "groups", ShutUpUntil: "muteUntil", ShutUpAllMember: "muteAllMembers" } } }), this._map.set(k.CREATE_GRP, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.CREATE_GRP) }), body: { type: void 0, name: void 0, groupID: void 0, ownerID: void 0, introduction: void 0, notification: void 0, maxMemberNum: void 0, joinOption: void 0, memberList: void 0, groupCustomField: void 0, memberCustomField: void 0, webPushFlag: 1, avatar: "", isSupportTopic: void 0, inviteOption: void 0 }, keyMap: { req: { ownerID: "Owner_Account", userID: "Member_Account", avatar: "FaceUrl", maxMemberNum: "MaxMemberCount", joinOption: "ApplyJoinOption", groupCustomField: "AppDefinedData", memberCustomField: "AppMemberDefinedData", inviteOption: "InviteJoinOption" }, res: { HugeGroupFlag: "avChatRoomFlag", OverJoinedGroupLimit_Account: "overLimitUserIDList" } } }), this._map.set(k.DISMISS_GRP, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.DISMISS_GRP) }), body: { groupID: void 0 } }), this._map.set(k.UPDATE_GRP_PROFILE, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.UPDATE_GRP_PROFILE) }), body: { groupID: void 0, name: void 0, introduction: void 0, notification: void 0, avatar: void 0, joinOption: void 0, groupCustomField: void 0, muteAllMembers: void 0, inviteOption: void 0 }, keyMap: { req: { groupCustomField: "AppDefinedData", muteAllMembers: "ShutUpAllMember", joinOption: "ApplyJoinOption", avatar: "FaceUrl", inviteOption: "InviteJoinOption" }, res: { AppDefinedData: "groupCustomField", ShutUpAllMember: "muteAllMembers" } } }), this._map.set(k.APPLY_JOIN_GRP, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.APPLY_JOIN_GRP) }), body: { groupID: void 0, applyMessage: void 0, userDefinedField: void 0, webPushFlag: 1, historyMessageFlag: void 0 }, keyMap: { req: { applyMessage: "ApplyMsg", historyMessageFlag: "HugeGroupHistoryMsgFlag" }, res: { HugeGroupFlag: "avChatRoomFlag", AVChatRoomKey: "avChatRoomKey", RspMsgList: "messageList", ToGroupId: "to" } } }), this._map.set(k.APPLY_JOIN_GRP_NOAUTH, (e2.a2, e2.tinyid, { head: y(y({}, K(e2, ps)), {}, { servcmd: "".concat(a.NAME.BIG_GRP_NO_AUTH, ".").concat(k.APPLY_JOIN_GRP) }), body: { groupID: void 0, applyMessage: void 0, userDefinedField: void 0, webPushFlag: 1 }, keyMap: { req: { applyMessage: "ApplyMsg" }, res: { HugeGroupFlag: "avChatRoomFlag" } } })), this._map.set(k.QUIT_GRP, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.QUIT_GRP) }), body: { groupID: void 0 } }), this._map.set(k.SEARCH_GRP, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.SEARCH_GRP) }), body: { groupIDList: void 0, responseFilter: { groupBasePublicInfoFilter: ["Type", "Name", "Introduction", "Notification", "FaceUrl", "CreateTime", "Owner_Account", "LastInfoTime", "LastMsgTime", "NextMsgSeq", "MemberNum", "MaxMemberNum", "ApplyJoinOption", "InviteJoinOption"] } } }), this._map.set(k.CHANGE_GRP_OWNER, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.CHANGE_GRP_OWNER) }), body: { groupID: void 0, newOwnerID: void 0 }, keyMap: { req: { newOwnerID: "NewOwner_Account" } } }), this._map.set(k.HANDLE_GRP_APPLICATION, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.HANDLE_GRP_APPLICATION) }), body: { groupID: void 0, applicant: void 0, handleAction: void 0, handleMessage: void 0, authentication: void 0, messageKey: void 0, userDefinedField: void 0 }, keyMap: { req: { applicant: "Applicant_Account", handleAction: "HandleMsg", handleMessage: "ApprovalMsg", messageKey: "MsgKey" } } }), this._map.set(k.HANDLE_INVITE_JOIN_GRP, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.HANDLE_INVITE_JOIN_GRP) }), body: { groupID: void 0, applicant: void 0, invitee: void 0, handleAction: void 0, handleMessage: void 0, authentication: void 0, userDefinedField: void 0 }, keyMap: { req: { applicant: "Applicant_Account", invitee: "Invited_Account", handleAction: "HandleMsg", handleMessage: "ApprovalMsg" } } }), this._map.set(k.HANDLE_GRP_INVITATION, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.HANDLE_GRP_INVITATION) }), body: { groupID: void 0, inviter: void 0, handleAction: void 0, handleMessage: void 0, authentication: void 0, messageKey: void 0, userDefinedField: void 0 }, keyMap: { req: { inviter: "Inviter_Account", handleAction: "HandleMsg", handleMessage: "ApprovalMsg", messageKey: "MsgKey" } } }), this._map.set(k.GET_GRP_PENDENCY, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.GET_GRP_PENDENCY) }), body: { startTime: void 0, limit: void 0, handleAccount: void 0 }, keyMap: { req: { handleAccount: "Handle_Account" }, res: { To_Account: "userID", ApplyInviteMsg: "note" } } }), this._map.set(k.DEL_GRP_SYSTEM_NOTICE, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.OPEN_IM, ".").concat(k.DEL_GRP_SYSTEM_NOTICE) }), body: { messageListToDelete: void 0 }, keyMap: { req: { messageListToDelete: "DelMsgList", messageSeq: "MsgSeq", messageRandom: "MsgRandom" } } }), this._map.set(k.AV_POLLING, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.BIG_GRP_POLLING, ".").concat(k.AV_POLLING) }), body: { USP: 1, startSeq: 1, startBroadcastSeq: void 0, holdTime: 90, key: void 0, simplifiedMessage: void 0 }, keyMap: { req: { USP: "USP" }, res: { ToGroupId: "groupID", RspBroadcastMsgList: "broadcastMessageList", IsSystemMsg: "isSystemMessage" } } }), this._map.set(k.AV_NOAUTH_POLLING, (e2.a2, e2.tinyid, { head: y(y({}, K(e2, _s)), {}, { servcmd: "".concat(a.NAME.BIG_GRP_POLLING_NO_AUTH, ".").concat(k.AV_POLLING) }), body: { USP: 1, startSeq: 1, holdTime: 90, key: void 0, simplifiedMessage: void 0 }, keyMap: { req: { USP: "USP" }, res: { ToGroupId: "groupID", RspBroadcastMsgList: "broadcastMessageList", IsSystemMsg: "isSystemMessage" } } })), this._map.set(k.GET_ONLINE_MBR_NUM, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.GET_ONLINE_MBR_NUM) }), body: { groupID: void 0 }, keyMap: { res: { OnlineMemberNum: "memberCount" } } }), this._map.set(k.SET_GRP_ATTR, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.SET_GRP_ATTR) }), body: { groupID: void 0, groupAttributeList: void 0, mainSequence: void 0, avChatRoomKey: void 0, attributeControl: ["RaceConflict"] }, keyMap: { req: { key: "key", value: "value" } } }), this._map.set(k.MODIFY_GRP_ATTR, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.MODIFY_GRP_ATTR) }), body: { groupID: void 0, groupAttributeList: void 0, mainSequence: void 0, avChatRoomKey: void 0, attributeControl: ["RaceConflict"] }, keyMap: { req: { key: "key", value: "value" } } }), this._map.set(k.DEL_GRP_ATTR, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.DEL_GRP_ATTR) }), body: { groupID: void 0, groupAttributeList: void 0, mainSequence: void 0, avChatRoomKey: void 0, attributeControl: ["RaceConflict"] }, keyMap: { req: { key: "key" } } }), this._map.set(k.CLEAR_GRP_ATTR, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.CLEAR_GRP_ATTR) }), body: { groupID: void 0, mainSequence: void 0, avChatRoomKey: void 0, attributeControl: ["RaceConflict"] } }), this._map.set(k.GET_GRP_ATTR, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP_ATTR, ".").concat(k.GET_GRP_ATTR) }), body: { groupID: void 0, avChatRoomKey: void 0, groupType: 1 }, keyMap: { req: { avChatRoomKey: "Key", groupType: "GroupType" } } }), this._map.set(k.GET_GRP_NOTIFY, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.GET_GRP_NOTIFY) }), body: { notifyReqList: [] }, keyMap: { req: { notifyReqList: "NotifyReqList" }, res: { NextMsgTime: "nextRevokedTime", NotifyMsgList: "notifyList", NotifyRspList: "notifyRspList" } } }), this._map.set(k.UPDATE_GRP_COUNTER, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.UPDATE_GRP_COUNTER) }), body: { groupID: void 0, counterList: void 0, avChatRoomKey: void 0, mode: void 0 }, keyMap: { req: { counterList: "GroupCounter" } } }), this._map.set(k.GET_GRP_COUNTER, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.GET_GRP_COUNTER) }), body: { groupID: void 0, keyList: [], avChatRoomKey: void 0 }, keyMap: { req: { keyList: "GroupCounterKeys" } } }), this._map.set(k.CREATE_TOPIC, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP_COMMUNITY, ".").concat(k.CREATE_TOPIC) }), body: { groupID: void 0, topicName: void 0, avatar: void 0, customData: void 0, topicID: void 0, notification: void 0, introduction: void 0 }, keyMap: { req: { avatar: "FaceUrl" } } }), this._map.set(k.DEL_TOPIC, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP_COMMUNITY, ".").concat(k.DEL_TOPIC) }), body: { groupID: void 0, topicIDList: void 0 }, keyMap: { req: { topicIDList: "TopicIdList" }, res: { DestroyResultItem: "resultList" } } }), this._map.set(k.UPDATE_TOPIC_PROFILE, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP_COMMUNITY, ".").concat(k.UPDATE_TOPIC_PROFILE) }), body: { groupID: void 0, topicID: void 0, avatar: void 0, customData: void 0, notification: void 0, introduction: void 0, muteAllMembers: void 0, topicName: void 0 }, keyMap: { req: { avatar: "FaceUrl", muteAllMembers: "ShutUpAllMember" } } }), this._map.set(k.GET_TOPIC_LIST, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP_COMMUNITY, ".").concat(k.GET_TOPIC_LIST) }), body: { groupID: void 0, topicIDList: void 0, MemberInfoFilter: ["NoUnreadSeqList"] }, keyMap: { req: { topicIDList: "TopicIdList" }, res: { TopicAndSelfInfo: "topicInfoList", TopicInfo: "topic", GroupID: "groupID", ShutUpTime: "muteTime", ShutUpAllFlag: "muteAllMembers", LastMsgTime: "lastMessageTime", MsgSeq: "readedSequence", LastMsgSeq: "sequence" } } }), this._map.set(k.GET_GRP_MBR_LIST, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.GET_GRP_MBR_LIST) }), body: { groupID: void 0, limit: 0, offset: void 0, next: void 0, memberRoleFilter: void 0, memberInfoFilter: void 0, memberCustomFieldFilter: void 0 }, keyMap: { req: { memberCustomFieldFilter: "AppDefinedDataFilter_GroupMember" }, res: { AppMemberDefinedData: "memberCustomField", AppDefinedDataFilter_GroupMember: "memberCustomFieldFilter", MemberList: "members", ShutUpUntil: "muteUntil" } } }), this._map.set(k.GET_AV_MBR_LIST, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP_AV, ".").concat(k.GET_AV_MBR_LIST) }), body: { groupID: void 0, offset: void 0, filter: void 0 }, keyMap: { req: { offset: "Timestamp", filter: "Mark" }, res: { NextTimestamp: "offset" } } }), this._map.set(k.GET_GRP_MBR_PROFILE, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.GET_GRP_MBR_PROFILE) }), body: { groupID: void 0, userIDList: void 0, memberInfoFilter: void 0, memberCustomFieldFilter: void 0 }, keyMap: { req: { userIDList: "Member_List_Account", memberCustomFieldFilter: "AppDefinedDataFilter_GroupMember" }, res: { MemberList: "members", ShutUpUntil: "muteUntil", AppDefinedDataFilter_GroupMember: "memberCustomFieldFilter", AppMemberDefinedData: "memberCustomField" } } }), this._map.set(k.ADD_GRP_MBR, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.ADD_GRP_MBR) }), body: { groupID: void 0, silence: void 0, userIDList: void 0 }, keyMap: { req: { userID: "Member_Account", userIDList: "MemberList" }, res: { MemberList: "members" } } }), this._map.set(k.DEL_GRP_MBR, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.DEL_GRP_MBR) }), body: { groupID: void 0, userIDList: void 0, reason: void 0 }, keyMap: { req: { userIDList: "MemberToDel_Account" } } }), this._map.set(k.BAN_AV_MBR, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.BAN_AV_MBR) }), body: { groupID: void 0, userIDList: void 0, duration: void 0, reason: "" }, keyMap: { req: { userIDList: "Members_Account", duration: "Duration", reason: "Description" } } }), this._map.set(k.MODIFY_GRP_MBR_INFO, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP, ".").concat(k.MODIFY_GRP_MBR_INFO) }), body: { groupID: void 0, topicID: void 0, userID: void 0, messageRemindType: void 0, nameCard: void 0, role: void 0, memberCustomField: void 0, muteTime: void 0 }, keyMap: { req: { userID: "Member_Account", memberCustomField: "AppMemberDefinedData", muteTime: "ShutUpTime", messageRemindType: "MsgFlag" } } }), this._map.set(k.MARK_AV_MBR_INFO, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.GRP_AV, ".").concat(k.MARK_AV_MBR_INFO) }), body: { groupID: void 0, operationType: 1, memberList: [] }, keyMap: { req: { operationType: "CommandType", memberList: "MemberList", markType: "Marks", userID: "Member_Account" }, res: { CommandType: "operationType", Marks: "markType", Member_Account: "userID" } } }), this._map.set(k.SSO_STAT, { head: y(y({}, n2), {}, { servcmd: "".concat(a.NAME.IM_OPEN_STAT, ".").concat(k.SSO_STAT) }), body: { header: {}, event: [], quality: [] }, keyMap: { req: { SDKType: "sdk_type", SDKVersion: "sdk_version", deviceType: "device_type", platform: "platform", instanceID: "instance_id", traceID: "trace_id", SDKAppID: "sdk_app_id", userID: "user_id", tinyID: "tiny_id", extension: "extension", timestamp: "timestamp", networkType: "network_type", eventType: "event_type", code: "error_code", message: "error_message", moreMessage: "more_message", duplicate: "duplicate", costTime: "cost_time", level: "level", qualityType: "quality_type", reportIndex: "report_index", wholePeriod: "whole_period", totalCount: "total_count", rttCount: "success_count_business", successRateOfRequest: "percent_business", countLessThan1Second: "success_count_business", percentOfCountLessThan1Second: "percent_business", countLessThan3Second: "success_count_platform", percentOfCountLessThan3Second: "percent_platform", successCountOfBusiness: "success_count_business", successRateOfBusiness: "percent_business", successCountOfPlatform: "success_count_platform", successRateOfPlatform: "percent_platform", successCountOfMessageReceived: "success_count_business", successRateOfMessageReceived: "percent_business", avgRTT: "average_value", avgDelay: "average_value", avgValue: "average_value", uiPlatform: "ui_platform" } } }), this._map.set(k.PING, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.HEARTBEAT, ".").concat(k.PING) }), body: {} }), this._map.set(k.MSG_PUSH, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.IM_OPEN_PUSH, ".").concat(k.MSG_PUSH) }), body: {}, keyMap: { res: { C2cMsgArray: "C2CMessageArray", GroupMsgArray: "groupMessageArray", GroupTips: "groupTips", C2cNotifyMsgArray: "C2CNotifyMessageArray", C2cMsgInfo: "C2CReadReceiptArray", ClientSeq: "clientSequence", MsgPriority: "priority", NoticeSeq: "noticeSequence", MsgContent: "content", MsgType: "type", MsgBody: "elements", ToGroupId: "to", Desc: "description", Ext: "extension", IsSyncMsg: "isSyncMessage", Flag: "needSync", NeedAck: "needAck", PendencyAdd_Account: "userID", ProfileImNick: "nick", PendencyType: "applicationType", C2CReadAllMsg: "readAllC2CMessage", IsNeedReadReceipt: "needReadReceipt", Status: "statusType" } } }), this._map.set(k.MULTI_MSG_PUSH, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.IM_OPEN_PUSH, ".").concat(k.MULTI_MSG_PUSH) }), body: {}, keyMap: { res: { GroupMsgArray: "groupMessageArray", GroupTips: "groupTips", ClientSeq: "clientSequence", MsgPriority: "priority", NoticeSeq: "noticeSequence", MsgContent: "content", MsgType: "type", MsgBody: "elements", ToGroupId: "to", Desc: "description", Ext: "extension", IsSyncMsg: "isSyncMessage", Flag: "needSync", NeedAck: "needAck", PendencyType: "applicationType" } } }), this._map.set(k.MSG_PUSH_ACK, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.OPEN_IM, ".").concat(k.MSG_PUSH_ACK) }), body: { sessionData: void 0 }, keyMap: { req: { sessionData: "SessionData" } } }), this._map.set(k.STATUS_FORCE_OFFLINE, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.IM_OPEN_STATUS, ".").concat(k.STATUS_FORCE_OFFLINE) }), body: {}, keyMap: { res: { C2cNotifyMsgArray: "C2CNotifyMessageArray", NoticeSeq: "noticeSequence", KickoutMsgNotify: "kickoutMsgNotify", NewInstInfo: "newInstanceInfo" } } }), this._map.set(k.DOWNLOAD_MERGER_MSG, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.IM_LONG_MSG, ".").concat(k.DOWNLOAD_MERGER_MSG) }), body: { downloadKey: "" }, keyMap: { res: { Data: "data", Desc: "description", Ext: "extension", Download_Flag: "downloadFlag", ThumbUUID: "thumbUUID", VideoUUID: "videoUUID" } } }), this._map.set(k.UPLOAD_MERGER_MSG, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.IM_LONG_MSG, ".").concat(k.UPLOAD_MERGER_MSG) }), body: { messageList: [] }, keyMap: { req: { fromAccount: "From_Account", toAccount: "To_Account", msgTimeStamp: "MsgTimeStamp", msgSeq: "MsgSeq", msgRandom: "MsgRandom", msgBody: "MsgBody", type: "MsgType", content: "MsgContent", data: "Data", description: "Desc", extension: "Ext", sizeType: "Type", uuid: "UUID", url: "", imageUrl: "URL", fileUrl: "Url", remoteAudioUrl: "Url", remoteVideoUrl: "VideoUrl", thumbUUID: "ThumbUUID", videoUUID: "VideoUUID", videoUrl: "", downloadFlag: "Download_Flag", from: "From_Account", time: "MsgTimeStamp", messageRandom: "MsgRandom", messageSequence: "MsgSeq", elements: "MsgBody", clientSequence: "ClientSeq", payload: "MsgContent", messageList: "MsgList", messageNumber: "MsgNum", abstractList: "AbstractList", messageBody: "MsgBody" } } }), this._map.set(k.FOLLOW, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.FOLLOW, ".").concat(k.FOLLOW) }), body: { fromAccount: "", userIDList: [] }, keyMap: { req: { userIDList: "FollowItem" }, res: { ResultItem: "resultList", To_Account: "userID" } } }), this._map.set(k.UNFOLLOW, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.FOLLOW, ".").concat(k.UNFOLLOW) }), body: { fromAccount: "", userIDList: [] }, keyMap: { req: { userIDList: "To_Account" }, res: { ResultItem: "resultList", To_Account: "userID" } } }), this._map.set(k.GET_FOLLOW_INFO, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.FOLLOW, ".").concat(k.GET_FOLLOW_INFO) }), body: { fromAccount: "", userIDList: [] }, keyMap: { req: { userIDList: "To_Account" }, res: { FollowInfo: "followInfoList", To_Account: "userID", FollowerCount: "followersCount", FollowingCount: "followingCount", MutualFollowingCount: "mutualFollowersCount" } } }), this._map.set(k.GET_FOLLOW, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.FOLLOW, ".").concat(k.GET_FOLLOW) }), body: { fromAccount: "", type: 1, nextCursor: "", count: 500 }, keyMap: { req: { type: "FollowType", nextCursor: "StartCursor", count: "WantNum" }, res: { FollowItem: "resultList", To_Account: "userID", ProfileItem: "profileList" } } }), this._map.set(k.CHECK_FOLLOW_TYPE, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.FOLLOW, ".").concat(k.CHECK_FOLLOW_TYPE) }), body: { fromAccount: "", userIDList: [] }, keyMap: { req: { userIDList: "To_Account" }, res: { ResultItem: "resultList", To_Account: "userID" } } }), this._map.set(k.SET_TOKEN, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.IM_OPEN_STATUS, ".").concat(k.SET_TOKEN) }), body: { tokenID: "", pushMsg: 0, sdkAppID: 0, businessID: "", deviceBrand: "", deviceToken: "", isTpns: 0, isWebUniapp: 0, notificationStatus: 0, deviceModel: "", systemVersion: "", pushVersion: "" }, keyMap: { req: { tokenID: "TokenID", pushMsg: "PushMsg", sdkAppID: "EnterVersion", businessID: "BusiID", deviceBrand: "InstType", deviceToken: "VarToken", isTpns: "IsTpns", notificationStatus: "NotificationStatus", deviceModel: "DeviceModel", systemVersion: "SystemVersion", pushVersion: "PushPluginVersion" } } }), this._map.set(k.STAT_FOREGROUND, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.IM_OPEN_STATUS, ".").concat(k.STAT_FOREGROUND) }), body: { isWebUniapp: 0 } }), this._map.set(k.STAT_BACKGROUND, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.IM_OPEN_STATUS, ".").concat(k.STAT_BACKGROUND) }), body: { C2CUnread: 0, GroupUnread: 0, isWebUniapp: 0 }, keyMap: { req: { c2cUnreadCount: "C2cUnread", groupUnreadCount: "GrpUnread" } } }), this._map.set(k.PUSH_REPORT, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.OFFLINE_PUSH_REPORT, ".").concat(k.PUSH_REPORT) }), body: { eventList: [] }, keyMap: { req: { eventList: "UinappPushEvents", type: "EventType", time: "EventTime", pushId: "ClickExt" } } }), this._map.set(k.SET_ALL_RECEIVE_MSG_OPT, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.IM_MSG_LOGIC, ".").concat(k.SET_ALL_RECEIVE_MSG_OPT) }), body: { startTime: 0, endTime: 0, isRepeated: 0, messageRemindType: 0 }, keyMap: { req: { messageRemindType: "Level" } } }), this._map.set(k.GET_ALL_RECEIVE_MSG_OPT, { head: y(y({}, e2), {}, { servcmd: "".concat(a.NAME.IM_MSG_LOGIC, ".").concat(k.GET_ALL_RECEIVE_MSG_OPT) }), body: { toAccount: void 0 } }); + } }, { key: "has", value: function(e2) { + return this._map.has(e2); + } }, { key: "get", value: function(e2) { + return this._map.get(e2); + } }, { key: "update", value: function() { + this._fillMap(); + } }, { key: "getKeyMap", value: function(e2) { + return this.has(e2) ? this.get(e2).keyMap || {} : (M.w("".concat(this._n, ".getKeyMap unknown P:").concat(e2)), {}); + } }, { key: "getProtocolData", value: function(e2) { + var t2 = e2.P, n2 = e2.data, e2 = this.get(t2), t2 = null; + if (n2) { + var o2, i2 = this._simpleDeepCopy(e2), i2 = this._updateService(n2, i2), a2 = i2.body, s2 = /* @__PURE__ */ Object.create(null); + for (o2 in a2) + if (Object.prototype.hasOwnProperty.call(a2, o2)) { + if (s2[o2] = a2[o2], void 0 === n2[o2]) + continue; + s2[o2] = n2[o2]; + } + i2.body = s2, t2 = this._getUplinkData(i2); + } else + t2 = this._getUplinkData(e2); + return t2; + } }, { key: "_getUplinkData", value: function(e2) { + var e2 = this._dataCleaner(e2), t2 = Kt(e2.head), t2 = Qa(e2.body, this._getReqKeyMap(t2)); + return e2.body = t2, e2; + } }, { key: "_updateService", value: function(e2, t2) { + var n2, o2, i2 = Kt(t2.head); + return this._isFromGroupRequest(t2) && (n2 = e2.type, o2 = e2.groupID, e2 = void 0 === (e2 = e2.groupIDList) ? [] : e2, N(o2 = void 0 === o2 ? void 0 : o2) && (o2 = e2[0] || ""), Nt({ type: n2, groupID: o2 })) && (t2.head.servcmd = "".concat(a.NAME.GRP_COMMUNITY, ".").concat(i2)), t2; + } }, { key: "_isFromGroupRequest", value: function(e2) { + return e2.head.servcmd.includes(a.NAME.GRP) || e2.head.servcmd.includes(a.NAME.GRP_ATTR); + } }, { key: "_getReqKeyMap", value: function(e2) { + e2 = this.getKeyMap(e2); + return y(y({}, Ba.req), e2.req); + } }, { key: "_dataCleaner", value: function(e2) { + var t2, n2 = Array.isArray(e2) ? [] : /* @__PURE__ */ Object.create(null); + for (t2 in e2) + Object.prototype.hasOwnProperty.call(e2, t2) && pt(t2) && null !== e2[t2] && void 0 !== e2[t2] && ("object" !== b(e2[t2]) ? n2[t2] = e2[t2] : n2[t2] = this._dataCleaner.bind(this)(e2[t2])); + return n2; + } }, { key: "_simpleDeepCopy", value: function(e2) { + for (var t2, n2 = Object.keys(e2), o2 = {}, i2 = 0, a2 = n2.length; i2 < a2; i2++) + t2 = n2[i2], O(e2[t2]) ? o2[t2] = Array.from(e2[t2]) : ut(e2[t2]) ? o2[t2] = this._simpleDeepCopy(e2[t2]) : o2[t2] = e2[t2]; + return o2; + } }]), Ts), gs = [k.MSG_PUSH_ACK], fs = (e(Cs, [{ key: "_onC2CMsgArray", value: function(e2) { + var t2 = this._sessionM.get(6); + e2.dataList.forEach(function(e3) { + var t3; + 1 === e3.isSyncMessage && (t3 = e3.from, e3.from = e3.to, e3.to = t3); + }), 1 === e2.needSync && this._sessionM.get(19).syncOnNeed(), t2.onNewMessage({ dataList: e2.dataList, isInstantMessage: true }); + } }, { key: "_onC2CMsgModified", value: function(e2) { + this._sessionM.get(6).onMsgModified(e2); + } }, { key: "_onGroupMsgArray", value: function(e2) { + var t2 = this._sessionM.get(7); + t2 && t2.onNewMessage({ event: e2.event, dataList: e2.dataList, isInstantMessage: true }); + } }, { key: "_onGroupMsgModified", value: function(e2) { + var t2 = this._sessionM.get(7); + t2 && t2.onMsgModified(e2); + } }, { key: "_onGroupTips", value: function(e2) { + var t2 = this._sessionM.get(7); + if (t2) { + var n2 = e2.event, o2 = e2.dataList, i2 = e2.isInstantMessage, a2 = void 0 === i2 || i2, s2 = e2.isSyncingEnded; + switch (n2) { + case 4: + case 6: + t2.onNewGroupTips({ event: n2, dataList: o2 }); + break; + case 5: + for (var r2 = 0; r2 < o2.length; r2++) + if (O(o2[r2].elements.revokedInfos)) + t2.onMsgRevoked({ dataList: o2 }); + else if (O(o2[r2].elements.groupMessageReadNotice)) + t2.onMsgReadNotice({ dataList: o2 }); + else { + if (!O(o2[r2].elements.readReceiptList)) { + t2.onNewGroupSystemNotice({ dataList: o2, isInstantMessage: a2, isSyncingEnded: s2 }); + break; + } + t2.onReadReceiptList({ dataList: o2 }); + } + break; + case 12: + this._sessionM.get(11).onNewGroupAtTips({ dataList: o2 }); + break; + default: + M.l("".concat(this._n, "._onGroupTips unknown event:").concat(n2, " dataList:"), o2); + } + } + } }, { key: "_onC2CNotifyMsgArray", value: function(e2) { + var o2, i2 = this, a2 = e2.dataList; + O(a2) && (o2 = this._sessionM.get(6), a2.forEach(function(e3) { + var t2, n2; + f(e3) && (e3.hasOwnProperty("kickoutMsgNotify") ? (t2 = (n2 = e3.kickoutMsgNotify).kickType, n2 = void 0 === (n2 = n2.newInstanceInfo) ? {} : n2, 1 === t2 ? i2._sessionM.onMultipleAccountKickedOut(n2) : 2 === t2 ? i2._sessionM.onMultipleDeviceKickedOut(n2) : 3 === t2 && i2._sessionM.onRestApiKickedOut(n2)) : e3.hasOwnProperty("c2cMessageRevokedNotify") ? o2 && o2.onMsgRevoked({ dataList: a2 }) : e3.hasOwnProperty("c2cMessageReadReceipt") ? o2 && o2.onMsgReadReceipt({ dataList: a2 }) : e3.hasOwnProperty("c2cMessageReadNotice") ? o2 && o2.onMsgReadNotice({ dataList: a2 }) : e3.hasOwnProperty("muteNotificationsSync") && i2._sessionM.get(11).onC2CMsgRemindTypeSynced({ dataList: a2 })); + })); + } }, { key: "_onC2CReadReceiptArray", value: function(e2) { + this._sessionM.get(6).onReadReceiptList(e2); + } }, { key: "_onProfileModified", value: function(e2) { + this._sessionM.get(4).onProfileModified({ dataList: e2.dataList }); + var t2 = this._sessionM.get(8); + t2 && t2.onFriendProfileModified({ dataList: e2.dataList }); + } }, { key: "_onRelationChainModified", value: function(e2) { + this._sessionM.get(4).onRelationChainModified({ dataList: e2.dataList }); + var t2 = this._sessionM.get(8); + t2 && t2.onRelationChainModified({ dataList: e2.dataList }); + } }, { key: "_onRecentContact", value: function(e2) { + var i2, e2 = e2.dataList; + O(e2) && (i2 = this._sessionM.get(11)) && e2.forEach(function(e3) { + var t2, n2, o2 = e3.pushType; + 1 === o2 ? (t2 = e3.recentContactDeleteItem, i2.onConvDeleted(t2.recentContactList)) : 2 === o2 ? (t2 = e3.recentContactTopItem, i2.onConvPinnedStatus(t2.recentContactList, true)) : 3 === o2 ? (t2 = e3.recentContactTopItem, i2.onConvPinnedStatus(t2.recentContactList, false)) : 4 === o2 ? (t2 = e3.recentContactMarkContact, i2.onConvMarkUpdated(t2.recentContactMarkContactItem)) : 5 === o2 ? (t2 = e3.recentContactCreateContactGroup, i2.onConvGroupCreated(t2.msgContactGroupContactItem)) : 6 === o2 ? (t2 = e3.recentContactDelContactGroup, i2.onConvGroupDeleted(t2.msgGroupItem)) : 7 === o2 && (o2 = (t2 = e3.recentContactUpdateContactGroup).updateType, e3 = t2.msgUpdateGroup, t2 = t2.msgUpdateContact, 1 === o2 ? 1 === (n2 = e3.updateGroupType) ? i2.onConvGroupNameUpdated(e3) : 2 === n2 && i2.onConvInGroupUpdated(e3) : 2 === o2 && i2.onConvAddedToOrDeletedFromGroup(t2)); + }); + } }, { key: "_onAllMsgRead", value: function(e2) { + var e2 = e2.dataList, t2 = this._sessionM.get(11); + t2 && t2.onPushedAllMessageRead(e2); + } }, { key: "_onUserStatusList", value: function(e2) { + this._sessionM.get(4).onUserStatusUpdated(e2); + } }, { key: "_onMsgExtNotify", value: function(e2) { + this._sessionM.get(3).onMsgExtNotify(e2); + } }, { key: "_onMsgReactionNotifyList", value: function(e2) { + this._sessionM.get(34).onReactionNotifyList(e2); + } }, { key: "_onMsgReactionNotify", value: function(e2) { + this._sessionM.get(34).onReactionNotify(e2); + } }, { key: "_onFollowNotify", value: function(e2) { + this._sessionM.get(35).onFollowNotify(e2); + } }, { key: "_onTopicLatestMsg", value: function(e2) { + this._sessionM.get(10).onTopicLatestMsg(e2); + } }, { key: "onMessage", value: function(e2) { + var t2 = this, n2 = e2.body; + if (this._filterMsgFromIMOpenPush(e2)) { + var o2, i2 = n2.eventArray, a2 = n2.isInstantMessage, s2 = n2.isSyncingEnded, r2 = n2.needSync; + if (O(i2)) + for (var c2, u2, l2, d2 = 0, p2 = i2.length; d2 < p2; d2++) + 100 !== (l2 = (c2 = i2[d2]).event) ? 24 !== l2 ? 26 !== l2 ? (o2 = Object.keys(c2).find(function(e3) { + return -1 !== t2._keys.indexOf(e3); + })) ? (u2 = 14 === l2 ? { readAllC2CMessage: c2[o2], groupMessageReadInfoList: c2.groupMessageReadNotice || [] } : 16 === l2 ? { userID: c2.userID, timestamp: c2.timestamp, readReceiptList: c2[o2] } : c2[o2], this._eventHandlerMap.get(o2)({ event: l2, dataList: u2, isInstantMessage: a2, isSyncingEnded: s2, needSync: r2 })) : M.l("".concat(this._n, ".onMessage unknown eventItem:"), c2) : this._onTopicLatestMsg(c2) : this._onAllRcvMsgOptNotify(c2) : this._onRoomCustomData(c2.content); + } + } }, { key: "_onRoomCustomData", value: function(e2) { + this._sessionM.get(30).onRoomCustomDataReceived(e2), M.l("".concat(this._n, "._onRoomCustomData data:").concat(e2)); + } }, { key: "_onAllRcvMsgOptNotify", value: function(e2) { + this._sessionM.get(11).onAllRcvMsgOptNotify(e2); + } }, { key: "_filterMsgFromIMOpenPush", value: function(e2) { + var t2 = e2.head, e2 = e2.body, t2 = t2.servcmd, n2 = false; + return !(n2 = N(t2) ? n2 : t2.includes(a.NAME.IM_CONFIG_MANAGER) || t2.includes(a.NAME.OVERLOAD_PUSH) || t2.includes(a.NAME.STAT_SERVICE)) || (t2.includes(k.PUSHED_CLOUD_CTRL_CONFIG) ? this._sessionM.get(23).onPushedConfig(e2) : t2.includes(k.PUSHED_COMMERCIAL_CONFIG) ? this._sessionM.get(27).onPushedConfig(e2) : t2.includes(k.OVERLOAD_NOTIFY) ? this._sessionM.onPushedServerOverload(e2) : t2.includes(k.KICK_OTHER) && (n2 = Date.now(), this._sessionM.reLoginOnKickOther(), e2 = new G("kickOther"), n2 = n2 - (t2 = this._sessionM.get(1).getLastWsHelloTs()), e2.setMessage("last wshello time:".concat(t2, " diff:").concat(n2, "ms")).end()), false); + } }]), Cs), ms = [{ cmd: k.GET_GRP_PROFILE, interval: 1, count: 8 }, { cmd: k.UPDATE_GRP_PROFILE, interval: 1, count: 8 }, { cmd: k.GET_AV_MBR_LIST, interval: 3, count: 1 }, { cmd: k.GET_GRP_PENDENCY, interval: 1, count: 15 }, { cmd: k.GET_TOPIC_LIST, interval: 1, count: 10 }, { cmd: k.SET_GRP_ATTR, interval: 5, count: 10 }, { cmd: k.MODIFY_GRP_ATTR, interval: 5, count: 10 }, { cmd: k.DEL_GRP_ATTR, interval: 5, count: 10 }, { cmd: k.CLEAR_GRP_ATTR, interval: 5, count: 10 }, { cmd: k.GET_GRP_ATTR, interval: 5, count: 20 }, { cmd: k.UPDATE_GRP_COUNTER, interval: 5, count: 20 }, { cmd: k.GET_GRP_COUNTER, interval: 5, count: 20 }, { cmd: k.SET_ALL_MSG_READ, interval: 1, count: 1 }, { cmd: k.GET_USER_STATUS, interval: 5, count: 20 }, { cmd: k.SUB_USER_STATUS, interval: 5, count: 20 }, { cmd: k.UNSUB_USER_STATUS, interval: 5, count: 20 }, { cmd: k.MSG_CLOUD_SEARCH, interval: 1, count: 2 }, { cmd: k.CHECK_FOLLOW_TYPE, interval: 5, count: 20 }, { cmd: k.GET_GRP_ROAMING_MSG, interval: 1, count: 20 }, { cmd: k.GET_C2C_ROAMING_MSG, interval: 1, count: 20 }], vs = /* @__PURE__ */ new Map(), Is = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"], Ms = 0, ys = Is.length; Ms < ys; Ms++) + vs.set(Ms, Is[Ms]); + function Cs(e2) { + d(this, Cs), this._sessionM = e2, this._n = "MsgDispatcher", this._eventHandlerMap = /* @__PURE__ */ new Map(), this._eventHandlerMap.set("C2CMessageArray", this._onC2CMsgArray.bind(this)), this._eventHandlerMap.set("groupMessageArray", this._onGroupMsgArray.bind(this)), this._eventHandlerMap.set("groupTips", this._onGroupTips.bind(this)), this._eventHandlerMap.set("C2CNotifyMessageArray", this._onC2CNotifyMsgArray.bind(this)), this._eventHandlerMap.set("C2CReadReceiptArray", this._onC2CReadReceiptArray.bind(this)), this._eventHandlerMap.set("profileModify", this._onProfileModified.bind(this)), this._eventHandlerMap.set("friendListMod", this._onRelationChainModified.bind(this)), this._eventHandlerMap.set("recentContactMod", this._onRecentContact.bind(this)), this._eventHandlerMap.set("readAllC2CMessage", this._onAllMsgRead.bind(this)), this._eventHandlerMap.set("c2cMessageModified", this._onC2CMsgModified.bind(this)), this._eventHandlerMap.set("groupMessageModified", this._onGroupMsgModified.bind(this)), this._eventHandlerMap.set("userStatusList", this._onUserStatusList.bind(this)), this._eventHandlerMap.set("messageExtensionNotify", this._onMsgExtNotify.bind(this)), this._eventHandlerMap.set("messageReactionNotifyList", this._onMsgReactionNotifyList.bind(this)), this._eventHandlerMap.set("messageReactionNotify", this._onMsgReactionNotify.bind(this)), this._eventHandlerMap.set("followChangeList", this._onFollowNotify.bind(this)), this._keys = p(this._eventHandlerMap.keys()); + } + function Ts(e2) { + d(this, Ts), this._n = "PHandler", this._sessionM = e2, this._map = /* @__PURE__ */ new Map(), this._fillMap(); + } + function Ds(e2) { + return d(this, Ds), (e2 = $a.call(this, e2))._n = "ChannelModule", e2._socketHandler = new us(i(e2)), e2._probing = false, e2._isAppShowing = true, e2._previousState = A.NET_STATE_CONNECTED, e2._timerForNotLoggedIn = -1, e2._timerForNotLoggedIn = setInterval(e2.onCheckTimer.bind(i(e2)), 1e3), e2._fatalErrorFlag = false, e2._disconnectedTS = 0, e2._lastDiagnoseTS = 0, e2; + } + function Es(e2) { + d(this, Es), this._chM = e2, this._n = "SocketHandler", this._promiseMap = /* @__PURE__ */ new Map(), this._readyState = cs, this._simpleRequestMap = /* @__PURE__ */ new Map(), this.MAX_SIZE = 100, this._startSequence = ft(), this._startTs = 0, this._reConnectFlag = false, this._nextPingTs = 0, this._reConnectCount = 0, this.MAX_RECONNECT_COUNT = 3, this._socketID = -1, this._random = 0, this._socket = null, this._url = "", this._onOpenTs = 0, this._canIUseBinaryFrame = true, this._isWorkerEnabled = true, this._currentSite = se, this._setWebsocketHost(), this._initConnection(); + } + function Ls(e2) { + d(this, Ls); + var t2, i2, n2 = (this._handler = e2).getURL(); + this._socket = null, this._workerSocket = null, this._id = ft(), this._handler.getIsWorkerEnabled() ? (t2 = URL.createObjectURL(new Blob([';let _socket = null;onmessage = function(event) { if (event.data.cmd === "start") { const url = event.data.url; _socket = new WebSocket(url); _socket.binaryType = "arraybuffer"; _socket.onopen = function() { postMessage({ callback: "onOpen", extensions: _socket.extensions }); }; _socket.onclose = function(e) { postMessage({ callback: "onOpen", e: { code: e.code, reason: e.reason } }); }; _socket.onmessage = function(e) { postMessage({ callback: "onMessage", data: e.data }); }; _socket.onerror = function(e) { postMessage({ callback: "onError", e: { isTrusted: "true" } }); }; } else if (event.data.cmd === "sendMessage") { if (_socket !== null) { _socket.send(event.data.data); } } else if (event.data.cmd === "stop") { if (_socket !== null) { _socket.close(event.data.code); _socket = null; } }};'], { type: "application/javascript; charset=utf-8" })), this._workerSocket = new Worker(t2), (i2 = this)._workerSocket.onmessage = function(e3) { + var t3 = e3.data, n3 = t3.callback, o2 = t3.e, t3 = t3.extensions; + "onOpen" === n3 ? i2._onOpen(t3) : "onClose" === n3 ? i2._onClose(o2) : "onError" === n3 ? i2._onError(o2) : "onMessage" === n3 && i2._onMessage(e3.data); + }, this._workerSocket.postMessage({ cmd: "start", id: this._id, url: n2 })) : v ? ve ? (I.connectSocket({ url: n2, header: { "content-type": "application/json" } }), I.onSocketClose(this._onClose.bind(this)), I.onSocketOpen(this._onOpen.bind(this)), I.onSocketMessage(this._onMessage.bind(this)), I.onSocketError(this._onError.bind(this))) : (this._socket = I.connectSocket({ url: n2, header: { "content-type": "application/json" }, complete: function() { + } }), this._socket.onClose(this._onClose.bind(this)), this._socket.onOpen(this._onOpen.bind(this)), this._socket.onMessage(this._onMessage.bind(this)), this._socket.onError(this._onError.bind(this))) : (this._socket = new WebSocket(n2), this._socket.binaryType = "arraybuffer", this._socket.onopen = this._onOpen.bind(this, this._socket.extensions), this._socket.onmessage = this._onMessage.bind(this), this._socket.onclose = this._onClose.bind(this), this._socket.onerror = this._onError.bind(this)), this._canIUseBinaryFrame = e2.canIUseBinaryFrame(); + } + function Ss(e2) { + for (var t2, n2, o2 = e2, i2 = "", a2 = 0, s2 = (o2 = e2.length % 8 != 0 ? "0".repeat(8 - e2.length % 8) + e2 : o2).length; a2 < s2; a2 += 8) + t2 = parseInt(o2.slice(a2, a2 + 4), 2), n2 = parseInt(o2.slice(a2 + 4, a2 + 8), 2), i2 += vs.get(t2) + vs.get(n2); + return i2; + } + function ks(e2) { + var t2; + return e2 < 0 || 53 < e2 ? NaN : (t2 = 0 | 1073741824 * Math.random(), 30 < e2 ? t2 + 1073741824 * (0 | Math.random() * (1 << e2 - 30)) : t2 >>> 30 - e2); + } + function As(e2, t2) { + for (var n2 = e2.toString(16), o2 = t2 - n2.length, i2 = "0"; 0 < o2; o2 >>>= 1, i2 += i2) + 1 & o2 && (n2 = i2 + n2); + return n2; + } + t(Wr, u), xs = n(Wr), e(Wr, [{ key: "_init", value: function() { + this._updateCmdFreqLimitMap(ms); + } }, { key: "_onCloudConfig", value: function() { + var e2 = this.getCloudConfig("cmd_frequency_limit"); + N(e2) || (e2 = JSON.parse(e2), this._updateCmdFreqLimitMap(e2)); + } }, { key: "_updateCmdFreqLimitMap", value: function(e2) { + var t2 = this; + e2.forEach(function(e3) { + t2._cmdFreqLimitMap.set(e3.cmd, { interval: e3.interval, count: e3.count }); + }); + } }, { key: "updateProtocolConfig", value: function() { + this._pHandler.update(); + } }, { key: "req", value: function(e2) { + M.d("".concat(this._n, ".req options:"), e2); + var t2, n2, o2 = e2.P; + return this._pHandler.has(o2) ? (t2 = (e2 = this.getProtocolData(e2)).head.servcmd, this._isFreqOverLimit(t2) ? D({ code: n2 = L.OVER_FREQUENCY_LIMIT, message: this.getErrMsg(n2, this._getCmd(t2)) }) : this._isServerOverload(t2) ? D({ code: n2 = L.OPEN_SERVICE_OVERLOAD_ERROR, message: this.getErrMsg(n2, this._getCmd(t2)) }) : (n2 = this.get(21), gs.includes(o2) ? n2.simplySend(e2) : n2.send(e2))) : (M.w("".concat(this._n, ".req unknown P:").concat(o2)), D({ code: L.NO_PROTOCOL })); + } }, { key: "getKeyMap", value: function(e2) { + return this._pHandler.getKeyMap(e2); + } }, { key: "genCommonHead", value: function() { + var e2 = this.get(12); + return { ver: "v4", platform: this._platform, websdkappid: ae, websdkversion: oe, a2: e2.getA2Key() || void 0, tinyid: e2.getTinyID() || void 0, status_instid: e2.getStatusInstanceID(), sdkappid: e2.getSDKAppID(), contenttype: e2.getContentType(), reqtime: 0, identifier: e2.getA2Key() ? void 0 : e2.getUserID(), usersig: e2.getA2Key() ? void 0 : e2.getUserSig(), sdkability: 12775283, sdkability_ext: Ss(""), cappid: e2.getApplicationID() }; + } }, { key: "genCosSpecifiedHead", value: function() { + var e2 = this.get(12); + return { ver: "v4", platform: this._platform, websdkappid: ae, websdkversion: oe, sdkappid: e2.getSDKAppID(), contenttype: e2.getContentType(), reqtime: 0, identifier: e2.getUserID(), usersig: e2.getUserSig(), status_instid: e2.getStatusInstanceID(), sdkability: 12775283, sdkability_ext: Ss(""), cappid: e2.getApplicationID() }; + } }, { key: "genSSOReportHead", value: function() { + var e2 = this.get(12); + return { ver: "v4", platform: this._platform, websdkappid: ae, websdkversion: oe, sdkappid: e2.getSDKAppID(), contenttype: "", reqtime: 0, identifier: "", usersig: "", status_instid: e2.getStatusInstanceID(), sdkability: 12775283, sdkability_ext: Ss(""), cappid: e2.getApplicationID() }; + } }, { key: "getProtocolData", value: function(e2) { + return this._pHandler.getProtocolData(e2); + } }, { key: "trans", value: function(e2) { + var t2 = e2.servcmd, e2 = e2.data, t2 = { head: y(y({}, this.genCommonHead()), {}, { servcmd: t2 }), body: e2 }; + return this.get(21).send(t2); + } }, { key: "sendComboMessage", value: function(e2) { + var t2 = e2.servcmd, e2 = e2.data, t2 = { head: y(y({}, this.genCommonHead()), {}, { servcmd: t2 }), body: e2 }; + return this.get(21).send(t2); + } }, { key: "onErrorCodeNotZero", value: function(e2) { + var t2, n2 = e2.errorCode; + n2 === L.HELLO_ANSWER_KICKED_OUT && (t2 = e2.kickType, e2 = void 0 === (e2 = e2.newInstanceInfo) ? {} : e2, 1 === t2 ? this.onMultipleAccountKickedOut(e2) : 2 === t2 ? this.onMultipleDeviceKickedOut(e2) : 3 === t2 && this.onRestApiKickedOut(e2)), n2 !== L.MSG_A2KEY_EXPIRED && n2 !== L.ACCOUNT_A2KEY_EXPIRED || (this._onUserSigExpired(), this.get(21).reConnect()); + } }, { key: "onMessage", value: function(e2) { + var t2 = e2.body, n2 = t2.needAck, t2 = t2.sessionData; + 1 === (void 0 === n2 ? 0 : n2) && this._sendACK(t2), this._msgDispatcher.onMessage(e2); + } }, { key: "onReconnected", value: function(e2) { + this._incrementalPullContactFlag = e2 <= 300, this._reLoginOnReconnected(); + } }, { key: "reLoginOnKickOther", value: function() { + M.l("".concat(this._n, ".reLoginOnKickOther")), this._reLogin(); + } }, { key: "_reLoginOnReconnected", value: function() { + M.l("".concat(this._n, "._reLoginOnReconnected")), this._reLogin(); + } }, { key: "_reLogin", value: function() { + var e2, t2, s2, r2 = this, c2 = "".concat(this._n, "._reLogin"); + this.isLoggedIn() && (e2 = 0, (t2 = this.get(1).getPushModule()) && (e2 = t2.getUniAppPlatform()), s2 = new G("reLogin"), this.req({ P: k.LOGIN, data: { isWebUniapp: e2, customInfo: this.get(12).getCustomLoginInfo() } }).then(function(e3) { + var e3 = e3.data, t3 = e3.instanceID, e3 = e3.customStatus, n2 = r2.get(12), o2 = Wo(e3), i2 = (n2.setStatusInstanceID(t3), r2.get(21)), a2 = i2.getSocketID(), a2 = "socketID:".concat(a2, " instanceID:").concat(t3, " customStatus:").concat(o2), t3 = (s2.setMessage(a2).end(true), M.l("".concat(c2, " ok. ").concat(a2)), n2.getCustomStatus() !== o2 && r2.get(4).onUserStatusUpdated({ dataList: [{ to: r2.getMyUserID(), statusType: A.USER_STATUS_ONLINE, customStatus: e3 }] }), i2.diagnose(), r2.get(11).syncConvList(r2._incrementalPullContactFlag).then(function() { + M.l("".concat(c2, ", sync conv list ok.")), r2.get(25).start(); + }), r2.get(7)), a2 = (t3 && t3.updateLocalMainSequenceOnReconnected(), r2.get(10)), n2 = (a2.resetGetTopicTime(), a2.getTopicListOnReconnected(), r2.get(35)); + n2 && n2.clearCacheOnReconnected(); + })); + } }, { key: "onMultipleAccountKickedOut", value: function(e2) { + this.get(1).onMultipleAccountKickedOut(e2); + } }, { key: "onMultipleDeviceKickedOut", value: function(e2) { + this.get(1).onMultipleDeviceKickedOut(e2); + } }, { key: "_onUserSigExpired", value: function() { + this.get(1).onUserSigExpired(); + } }, { key: "onRestApiKickedOut", value: function(e2) { + this.get(1).onRestApiKickedOut(e2); + } }, { key: "_sendACK", value: function(e2) { + this.req({ P: k.MSG_PUSH_ACK, data: { sessionData: e2 } }); + } }, { key: "_isFreqOverLimit", value: function(e2) { + var t2, n2, o2, i2, e2 = e2.split(".")[1]; + return !!this._cmdFreqLimitMap.has(e2) && (!this._cmdReqInfoMap.has(e2) || (t2 = (n2 = this._cmdFreqLimitMap.get(e2)).count, n2 = n2.interval, o2 = (i2 = this._cmdReqInfoMap.get(e2)).startTime, i2 = i2.requestCount, Date.now() - o2 > 1e3 * n2) ? (this._cmdReqInfoMap.set(e2, { startTime: Date.now(), requestCount: 1 }), false) : (this._cmdReqInfoMap.set(e2, { startTime: o2, requestCount: i2 += 1 }), t2 < i2)); + } }, { key: "_isServerOverload", value: function(e2) { + var t2, n2; + return !!this._serverOverloadInfoMap.has(e2) && (t2 = (n2 = this._serverOverloadInfoMap.get(e2)).overloadTime, n2 = n2.waitingTime, Date.now() - t2 <= 1e3 * n2 || (this._serverOverloadInfoMap.delete(e2), false)); + } }, { key: "_getCmd", value: function(e2) { + var t2 = ""; + if (e2.includes(".")) { + var n2, o2 = e2.split(".")[1]; + for (n2 in k) + if (k[n2] === o2) { + t2 = n2; + break; + } + } + return t2; + } }, { key: "onPushedServerOverload", value: function(e2) { + var t2 = e2.overloadCommand, e2 = e2.waitingTime; + this._serverOverloadInfoMap.set(t2, { overloadTime: Date.now(), waitingTime: e2 }), M.w("".concat(this._n, ".onPushedServerOverload waitingTime:").concat(e2, "s cmd:").concat(this._getCmd(t2))); + } }, { key: "reset", value: function() { + M.l("".concat(this._n, ".reset")), this._updateCmdFreqLimitMap(ms), this._cmdReqInfoMap.clear(), this._serverOverloadInfoMap.clear(), this._incrementalPullContactFlag = true; + } }]); + var Rs, Os, Ns, Gs, Ps, Us, bs, ws, Fs, qs, xs, Vs = Wr, Hs = (t(Yr, u), qs = n(Yr), e(Yr, [{ key: "getCloudConfig", value: function(e2) { + return N(e2) ? this._cloudConfig : this._cloudConfig.has(e2) ? this._cloudConfig.get(e2) : void 0; + } }, { key: "getServerConfig", value: function(e2) { + var t2 = { code: 0, data: "" }; + return !N(e2) && this._cloudConfig.has(e2) && (t2.data = this._cloudConfig.get(e2)), Promise.resolve(t2); + } }, { key: "_canFetch", value: function() { + return this.isLoggedIn() && !this._isFetching && Date.now() >= this._expiredTime; + } }, { key: "fetchConfig", value: function() { + var o2, i2 = this, a2 = "".concat(this._n, ".fetchConfig"), e2 = this._canFetch(); + M.l("".concat(a2, " canFetch:").concat(e2)), e2 && (o2 = new G("fetchCloudCtrlConfig"), e2 = this.get(12).getSDKAppID(), this._isFetching = true, this.req({ P: k.FETCH_CLOUD_CTRL_CONFIG, data: { SDKAppID: e2, version: this._version } }).then(function(e3) { + i2._isFetching = false; + var t2 = e3.data, n2 = t2.version, t2 = t2.cloudControlConfig; + o2.setMessage("version:".concat(i2._version, " newVersion:").concat(n2, " config:").concat(t2)).end(), M.l("".concat(a2, " ok")), i2._parse(e3.data); + }).catch(function(e3) { + i2._isFetching = false, o2.setError(e3).end(), M.l("".concat(a2, " failed. error:"), e3), i2._setExpiredTime(12e4); + })); + } }, { key: "onPushedConfig", value: function(e2) { + M.l("".concat(this._n, ".onPushedConfig config:"), e2), new G("pushedCloudCtrlConfig").setMessage("newVersion:".concat(e2.version, " config:").concat(e2.cloudControlConfig)).end(), this._parse(e2); + } }, { key: "onCheckTimer", value: function(e2) { + this._canFetch() && this.fetchConfig(); + } }, { key: "_parse", value: function(e2) { + var t2 = this, n2 = "".concat(this._n, "._parse"), o2 = e2.errorCode, i2 = e2.errorMessage, a2 = e2.cloudControlConfig, s2 = e2.version, r2 = e2.expiredTime; + if (0 === o2) { + if (this._version !== s2) { + var c2 = null; + try { + c2 = JSON.parse(a2); + } catch (e3) { + this.isPrivateNetWork() || M.e("".concat(n2, " failed. config:"), a2); + } + c2 && (this._cloudConfig.clear(), Object.keys(c2).forEach(function(e3) { + t2._cloudConfig.set(e3, c2[e3]); + }), this._version = s2, this.emitIEvt(P.CLOUD_CONFIG)); + } + this._setExpiredTime(1e3 * r2); + } else + N(o2) ? (M.l("".concat(n2, " failed. Invalid message format:"), e2), this._setExpiredTime(36e5)) : (M.e("".concat(n2, " errorCode:").concat(o2, " errorMessage:").concat(i2)), this._setExpiredTime(12e4)); + } }, { key: "_setExpiredTime", value: function(e2) { + this._expiredTime = Date.now() + e2; + } }, { key: "reset", value: function() { + M.l("".concat(this._n, ".reset")), this._cloudConfig.clear(), this._expiredTime = 0, this._version = 0, this._isFetching = false; + } }]), Yr), Bs = (t(Kr, u), Fs = n(Kr), e(Kr, [{ key: "start", value: function() { + this._recoverGroupChat(), this._recoverC2CChat(); + } }, { key: "_recoverGroupChat", value: function() { + var n2, o2, i2, a2, s2 = this, e2 = this._getLocalConvList().filter(function(e3) { + return e3.type === A.CONV_GROUP && e3.groupProfile.type !== A.GRP_AVCHATROOM; + }), r2 = this.get(11), c2 = []; + e2.forEach(function(e3) { + var t2 = e3.conversationID, e3 = e3.lastMessage; + n2 = t2.replace(A.CONV_GROUP, ""), o2 = r2.getLocalLastMessage(t2), e3 && 0 !== e3.lastSequence && o2 && (i2 = e3.lastSequence, o2 = o2.sequence, a2 = i2 - o2, 0 < o2) && 1 <= a2 && a2 < 300 ? s2._recoverGroupMsg({ groupID: n2, localLastMessageSequence: o2, remoteLastMessageSequence: i2 }) : c2.push(n2); + }), this._getGroupNotice(c2); + } }, { key: "_recoverC2CChat", value: function() { + var n2, o2, i2, a2 = this, e2 = this._getLocalConvList().filter(function(e3) { + return e3.type === A.CONV_C2C; + }), s2 = this.get(11), r2 = [Promise.resolve()]; + e2.forEach(function(e3) { + var t2 = e3.conversationID, e3 = e3.lastMessage; + n2 = s2.getLocalLastMessage(t2), e3 && 0 !== e3.lastTime && n2 && (o2 = e3.lastTime, n2 = n2.time, i2 = o2 - n2, 0 < n2) && 1 <= i2 && i2 <= 600 && r2.push(a2._recoverC2CMsg({ conversationID: t2, localLastMessageTime: n2, remoteLastMessageTime: o2 })); + }), Promise.all(r2).then(function() { + M.l("".concat(a2._n, "._recoverC2CChat all done")), a2.get(19).syncOnReconnected(); + }); + } }, { key: "_getLocalConvList", value: function() { + return this.get(11).getLocalConvList(); + } }, { key: "_recoverGroupMsg", value: function(e2) { + var d2 = this, p2 = "".concat(this._n, ".").concat("_recoverGroupMsg"), _2 = (M.l("".concat(p2, " options:"), e2), e2.groupID), h2 = e2.localLastMessageSequence, g2 = e2.remoteLastMessageSequence, f2 = JSON.stringify(e2), m2 = new G("_recoverGroupMsg"); + m2.setMessage(f2), this._getGroupRoamingMsg({ groupID: _2, sequence: h2 }).then(function(e3) { + var e3 = e3.data, t2 = e3.complete, n2 = e3.messageList; + if (!N(n2)) { + var e3 = n2[0].sequence, o2 = n2.map(function(e4) { + return e4.sequence; + }), o2 = "".concat(f2, " complete:").concat(t2, " sequenceList:").concat(o2), i2 = (M.l("".concat(p2, " ").concat(o2)), e3 !== h2 && e3 < g2 && 2 !== t2 && d2._recoverGroupMsg({ groupID: _2, localLastMessageSequence: e3, remoteLastMessageSequence: g2 }), m2.setMessage(o2).end(), d2.get(7)); + 1 < n2.length && n2.sort(function(e4, t3) { + return e4.sequence - t3.sequence; + }); + for (var a2 = false, s2 = 0, r2 = n2.length; s2 < r2; s2++) + if (n2[s2].from === A.CONV_SYSTEM) { + a2 = true; + break; + } + if (a2) + for (var c2 = 0, u2 = n2.length; c2 < u2; c2++) { + var l2 = n2[c2]; + l2.from !== A.CONV_SYSTEM ? i2.onNewMessage({ dataList: [l2], isInstantMessage: false, updateUnreadCount: false }) : i2.onNewGroupTips({ event: l2.event, dataList: [l2] }); + } + else + i2.onNewMessage({ dataList: n2, isInstantMessage: false, updateUnreadCount: false }); + } + }).catch(function(e3) { + m2.setError(e3).end(), M.w("".concat(p2, " failed. error:"), e3); + }); + } }, { key: "_getGroupNotice", value: function(e2) { + var t2 = e2.length; + if (M.l("".concat(this._n, "._getGroupNotice length:").concat(t2)), 0 !== t2) { + var n2 = this.get(7); + if (t2 <= 10) + n2.getNotice(e2); + else { + var o2 = Math.floor(t2 / 10); + 5 <= o2 && (o2 = 5); + for (var i2 = 0; i2 <= o2; i2++) + n2.getNotice(e2.slice(10 * i2, 10 * (i2 + 1))); + } + } + } }, { key: "_getGroupRoamingMsg", value: function(e2) { + var t2 = e2.groupID, e2 = e2.sequence; + return this.req({ P: k.GET_GRP_ROAMING_MSG, data: { groupID: t2, count: this.PULL_LIMIT_COUNT, sequence: e2 + this.PULL_LIMIT_COUNT - 1 } }); + } }, { key: "_recoverC2CMsg", value: function(e2) { + var o2 = this, i2 = "".concat(this._n, ".").concat("_recoverC2CMsg"), a2 = (M.l("".concat(i2, " options:"), e2), e2.conversationID), t2 = e2.localLastMessageTime, s2 = e2.remoteLastMessageTime, r2 = JSON.stringify(e2), c2 = new G("_recoverC2CMsg"); + return c2.setMessage(r2), this._getC2CRoamingMsg({ conversationID: a2, time: t2 }).then(function(e3) { + var e3 = e3.data, t3 = e3.complete, e3 = e3.messageList; + if (!N(e3)) { + var n2 = e3.length, n2 = (o2.get(6).onNewMessage({ dataList: e3, isInstantMessage: true }), e3[n2 - 1].time), e3 = e3.map(function(e4) { + return e4.random; + }), e3 = "".concat(r2, " complete:").concat(t3, " randomList:").concat(e3); + if (M.l("".concat(i2, " ").concat(e3)), c2.setMessage(e3).end(), n2 < s2 && 1 !== t3) + return o2._recoverC2CMsg({ conversationID: a2, localLastMessageTime: n2, remoteLastMessageTime: s2 }); + } + }).catch(function(e3) { + c2.setError(e3).end(), M.w("".concat(i2, " failed. error:"), e3); + }); + } }, { key: "_getC2CRoamingMsg", value: function(e2) { + var t2 = e2.conversationID, e2 = e2.time; + return this.req({ P: k.GET_C2C_ROAMING_MSG, data: { peerAccount: t2.replace(A.CONV_C2C, ""), count: this.PULL_LIMIT_COUNT + 1, lastMessageTime: e2, direction: 1 } }); + } }, { key: "reset", value: function() { + M.l("".concat(this._n, ".reset")); + } }]), Kr), Ks = (e(Br, [{ key: "addMessageDelay", value: function(e2) { + e2 = Be() - e2; + 0 <= e2 && this._e2eDelayArray.push(e2); + } }, { key: "_calcAvg", value: function(e2, t2) { + var n2; + return 0 === t2 ? 0 : (n2 = 0, e2.forEach(function(e3) { + n2 += e3; + }), Yt(n2 / t2, 1)); + } }, { key: "_calcCountWithLimit", value: function(e2) { + var t2 = e2.e2eDelayArray, n2 = e2.min, o2 = e2.max; + return t2.filter(function(e3) { + return n2 <= e3 && e3 < o2; + }).length; + } }, { key: "_calcPercent", value: function(e2, t2) { + e2 = Yt(e2 / t2 * 100, 2); + return e2 = 100 < e2 ? 100 : e2; + } }, { key: "_checkE2EDelayException", value: function(e2, t2) { + var n2, o2, i2, a2 = e2.filter(function(e3) { + return t2 < e3; + }); + 0 < a2.length && (n2 = a2.length, o2 = Math.min.apply(Math, p(a2)), i2 = Math.max.apply(Math, p(a2)), a2 = this._calcAvg(a2, n2), 50 < (e2 = Yt(n2 / e2.length * 100, 2))) && new G("messageE2EDelayException").setMessage("count:".concat(n2, " min:").concat(o2, " max:").concat(i2, " avg:").concat(a2, " percent:").concat(e2)).setLevel("warning").end(); + } }, { key: "getStatResult", value: function() { + var e2, t2, n2, o2, i2, a2, s2 = this._e2eDelayArray.length; + return 0 === s2 ? null : (e2 = p(this._e2eDelayArray), t2 = this._calcCountWithLimit({ e2eDelayArray: e2, min: 0, max: 1 }), n2 = this._calcCountWithLimit({ e2eDelayArray: e2, min: 1, max: 3 }), o2 = this._calcPercent(t2, s2), i2 = this._calcPercent(n2, s2), a2 = this._calcAvg(e2, s2), this._checkE2EDelayException(e2, 3), e2.length = 0, this.reset(), { totalCount: s2, countLessThan1Second: t2, percentOfCountLessThan1Second: o2, countLessThan3Second: n2, percentOfCountLessThan3Second: i2, avgDelay: a2 }); + } }, { key: "reset", value: function() { + this._e2eDelayArray.length = 0; + } }]), Br), Ys = (e(Hr, [{ key: "addRequestCount", value: function() { + this._requestCount += 1; + } }, { key: "addRTT", value: function(e2) { + this._rttArray.push(e2); + } }, { key: "_calcTotalCount", value: function() { + return this._requestCount; + } }, { key: "_calcRTTCount", value: function(e2) { + return e2.length; + } }, { key: "_calcSuccessRateOfRequest", value: function(e2, t2) { + return 0 === t2 ? 0 : 100 < (e2 = Yt(e2 / t2 * 100, 2)) ? 100 : e2; + } }, { key: "_calcAvg", value: function(e2, t2) { + var n2; + return 0 === t2 ? 0 : (n2 = 0, e2.forEach(function(e3) { + n2 += e3; + }), parseInt(n2 / t2)); + } }, { key: "_calcMax", value: function() { + return Math.max.apply(Math, p(this._rttArray)); + } }, { key: "_calcMin", value: function() { + return Math.min.apply(Math, p(this._rttArray)); + } }, { key: "getStatResult", value: function() { + var e2, t2, n2 = this._calcTotalCount(), o2 = p(this._rttArray); + return 0 === n2 ? null : (e2 = this._calcRTTCount(o2), t2 = this._calcSuccessRateOfRequest(e2, n2), o2 = this._calcAvg(o2, e2), M.l("".concat(this._n, ".getStatResult max:").concat(this._calcMax(), " min:").concat(this._calcMin(), " avg:").concat(o2)), this.reset(), { totalCount: n2, rttCount: e2, successRateOfRequest: t2, avgRTT: o2 }); + } }, { key: "reset", value: function() { + this._requestCount = 0, this._rttArray.length = 0; + } }]), Hr), Ws = (e(Vr, [{ key: "initMap", value: function(e2) { + var t2 = this; + e2.forEach(function(e3) { + t2._map.set(e3, { totalCount: 0, successCount: 0, failedCountOfUserSide: 0, costArray: [], fileSizeArray: [] }); + }); + } }, { key: "addTotalCount", value: function(e2) { + return !(N(e2) || !this._map.has(e2) || (this._map.get(e2).totalCount += 1, 0)); + } }, { key: "addSuccessCount", value: function(e2) { + return !(N(e2) || !this._map.has(e2) || (this._map.get(e2).successCount += 1, 0)); + } }, { key: "addFailedCountOfUserSide", value: function(e2) { + return !(N(e2) || !this._map.has(e2) || (this._map.get(e2).failedCountOfUserSide += 1, 0)); + } }, { key: "addCost", value: function(e2, t2) { + return !(N(e2) || !this._map.has(e2) || (this._map.get(e2).costArray.push(t2), 0)); + } }, { key: "addFileSize", value: function(e2, t2) { + return !(N(e2) || !this._map.has(e2) || (this._map.get(e2).fileSizeArray.push(t2), 0)); + } }, { key: "_calcSuccessRateOfBusiness", value: function(e2) { + return N(e2) || !this._map.has(e2) ? -1 : 100 < (e2 = Yt((e2 = this._map.get(e2)).successCount / e2.totalCount * 100, 2)) ? 100 : e2; + } }, { key: "_calcSuccessRateOfPlatform", value: function(e2) { + var t2; + return N(e2) || !this._map.has(e2) ? -1 : (t2 = this._map.get(e2), 100 < (e2 = Yt(e2 = this._calcSuccessCountOfPlatform(e2) / t2.totalCount * 100, 2)) ? 100 : e2); + } }, { key: "_calcTotalCount", value: function(e2) { + return N(e2) || !this._map.has(e2) ? -1 : this._map.get(e2).totalCount; + } }, { key: "_calcSuccessCountOfBusiness", value: function(e2) { + return N(e2) || !this._map.has(e2) ? -1 : this._map.get(e2).successCount; + } }, { key: "_calcSuccessCountOfPlatform", value: function(e2) { + return N(e2) || !this._map.has(e2) ? -1 : (e2 = this._map.get(e2)).successCount + e2.failedCountOfUserSide; + } }, { key: "_calcAvg", value: function(e2) { + return N(e2) || !this._map.has(e2) ? -1 : e2 === Wn ? this._calcAvgSpeed(e2) : this._calcAvgCost(e2); + } }, { key: "_calcAvgCost", value: function(e2) { + var t2, n2 = this._map.get(e2).costArray.length; + return 0 === n2 ? 0 : (t2 = 0, this._map.get(e2).costArray.forEach(function(e3) { + t2 += e3; + }), parseInt(t2 / n2)); + } }, { key: "_calcAvgSpeed", value: function(e2) { + var t2 = 0, n2 = 0; + return this._map.get(e2).costArray.forEach(function(e3) { + t2 += e3; + }), this._map.get(e2).fileSizeArray.forEach(function(e3) { + n2 += e3; + }), parseInt(1e3 * n2 / t2); + } }, { key: "getStatResult", value: function(e2) { + var t2, n2, o2, i2, a2, s2 = this._calcTotalCount(e2); + return 0 === s2 ? null : (t2 = this._calcSuccessCountOfBusiness(e2), n2 = this._calcSuccessRateOfBusiness(e2), o2 = this._calcSuccessCountOfPlatform(e2), i2 = this._calcSuccessRateOfPlatform(e2), a2 = this._calcAvg(e2), this.reset(e2), { totalCount: s2, successCountOfBusiness: t2, successRateOfBusiness: n2, successCountOfPlatform: o2, successRateOfPlatform: i2, avgValue: a2 }); + } }, { key: "reset", value: function(e2) { + N(e2) ? this._map.clear() : this._map.set(e2, { totalCount: 0, successCount: 0, failedCountOfUserSide: 0, costArray: [], fileSizeArray: [] }); + } }]), Vr), js = (e(xr, [{ key: "initMap", value: function(e2) { + var t2 = this; + e2.forEach(function(e3) { + t2._lastMap.set(e3, /* @__PURE__ */ new Map()), t2._currentMap.set(e3, /* @__PURE__ */ new Map()); + }); + } }, { key: "addMessageSequence", value: function(e2) { + var t2, n2, o2, i2 = e2.key, a2 = e2.message; + return !(N(i2) || !this._lastMap.has(i2) || !this._currentMap.has(i2) || (t2 = a2.conversationID, a2 = a2.sequence, t2 = t2.replace(A.CONV_GROUP, ""), 0 !== this._lastMap.get(i2).size && this._lastMap.get(i2).has(t2) && (o2 = (n2 = this._lastMap.get(i2).get(t2)).length - 1, a2 > n2[0]) && a2 < n2[o2] ? (n2.push(a2), n2.sort(), this._lastMap.get(i2).set(t2, n2)) : this._addCurrentMap(e2), 0)); + } }, { key: "_addCurrentMap", value: function(e2) { + var t2 = e2.key, e2 = e2.message, n2 = e2.conversationID, e2 = e2.sequence, n2 = n2.replace(A.CONV_GROUP, ""); + this._currentMap.get(t2).has(n2) || this._currentMap.get(t2).set(n2, []), this._currentMap.get(t2).get(n2).push(e2); + } }, { key: "_copyData", value: function(e2) { + if (!N(e2)) { + this._lastMap.set(e2, /* @__PURE__ */ new Map()); + var t2, n2 = this._lastMap.get(e2), o2 = Z(this._currentMap.get(e2)); + try { + for (o2.s(); !(t2 = o2.n()).done; ) { + var i2 = Y(t2.value, 2), a2 = i2[0], s2 = i2[1]; + n2.set(a2, s2); + } + } catch (e3) { + o2.e(e3); + } finally { + o2.f(); + } + n2 = null, this._currentMap.set(e2, /* @__PURE__ */ new Map()); + } + } }, { key: "getStatResult", value: function(e2) { + var o2, i2, t2; + return N(this._currentMap.get(e2)) || N(this._lastMap.get(e2)) ? null : 0 === this._lastMap.get(e2).size ? (this._copyData(e2), null) : (i2 = o2 = 0, this._lastMap.get(e2).forEach(function(e3, t3) { + var e3 = p(e3.values()), n2 = e3.length, e3 = e3[n2 - 1] - e3[0] + 1; + o2 += e3, i2 += n2; + }), 0 === o2 ? null : (100 < (t2 = Yt(i2 / o2 * 100, 2)) && (t2 = 100), this._copyData(e2), { totalCount: o2, successCountOfMessageReceived: i2, successRateOfMessageReceived: t2 })); + } }, { key: "reset", value: function() { + this._currentMap.clear(), this._lastMap.clear(); + } }]), xr), Js = (t(qr, u), ws = n(qr), e(qr, [{ key: "_onLoginSuccess", value: function() { + var t2 = this, e2 = (this._rateMessageSent.initMap(this._messageSentItems), this._rateMessageReceived.initMap(this._messageReceivedItems), this.get(13)), n2 = e2.getItem(this.TAG, false); + !S(n2) && lt(n2.forEach) && (M.l("".concat(this._n, "._onLoginSuccess. logs count:").concat(n2.length)), n2.forEach(function(e3) { + t2._statInfoArr.push(e3); + }), e2.removeItem(this.TAG, false)); + } }, { key: "_onCloudConfig", value: function() { + var e2 = this.getCloudConfig("q_rpt_interval"), t2 = this.getCloudConfig("q_rpt_sdkappid_bl"), n2 = this.getCloudConfig("q_rpt_tinyid_wl"); + N(e2) || (this.REPORT_INTERVAL = Number(e2)), N(t2) || (this.REPORT_SDKAPPID_BLACKLIST = t2.split(",").map(function(e3) { + return Number(e3); + })), N(n2) || (this.REPORT_TINYID_WHITELIST = n2.split(",")); + } }, { key: "onCheckTimer", value: function(e2) { + this.isLoggedIn() && e2 % this.REPORT_INTERVAL == 0 && (this.wholePeriod = true, this._report()); + } }, { key: "addRequestCount", value: function() { + this._avgRTT.addRequestCount(); + } }, { key: "addRTT", value: function(e2) { + this._avgRTT.addRTT(e2); + } }, { key: "addMessageDelay", value: function(e2) { + this._avgE2EDelay.addMessageDelay(e2); + } }, { key: "addTotalCount", value: function(e2) { + this._rateMessageSent.addTotalCount(e2) || M.w("".concat(this._n, ".addTotalCount invalid key:"), e2); + } }, { key: "addSuccessCount", value: function(e2) { + this._rateMessageSent.addSuccessCount(e2) || M.w("".concat(this._n, ".addSuccessCount invalid key:"), e2); + } }, { key: "addFailedCountOfUserSide", value: function(e2) { + this._rateMessageSent.addFailedCountOfUserSide(e2) || M.w("".concat(this._n, ".addFailedCountOfUserSide invalid key:"), e2); + } }, { key: "addCost", value: function(e2, t2) { + this._rateMessageSent.addCost(e2, t2) || M.w("".concat(this._n, ".addCost invalid key or cost:"), e2, t2); + } }, { key: "addFileSize", value: function(e2, t2) { + this._rateMessageSent.addFileSize(e2, t2) || M.w("".concat(this._n, ".addFileSize invalid key or size:"), e2, t2); + } }, { key: "addMessageSequence", value: function(e2) { + this._rateMessageReceived.addMessageSequence(e2) || M.w("".concat(this._n, ".addMessageSequence invalid key:"), e2.key); + } }, { key: "_getQualityItem", value: function(e2) { + var t2 = {}, n2 = Qn[this.get(15).getNetworkType()], n2 = (N(n2) && (n2 = 8), { qualityType: Xn[e2], timestamp: We(), networkType: n2, extension: "" }); + switch (e2) { + case xn: + t2 = this._avgRTT.getStatResult(); + break; + case Vn: + t2 = this._avgE2EDelay.getStatResult(); + break; + case Hn: + case Bn: + case Kn: + case Yn: + case Wn: + t2 = this._rateMessageSent.getStatResult(e2); + break; + case jn: + case Jn: + case zn: + t2 = this._rateMessageReceived.getStatResult(e2); + } + return null === t2 ? null : y(y({}, n2), t2); + } }, { key: "_report", value: function(e2) { + var t2 = this, n2 = [], o2 = null, e2 = (N(e2) ? this._qualityItems.forEach(function(e3) { + null !== (o2 = t2._getQualityItem(e3)) && (o2.reportIndex = t2.reportIndex, o2.wholePeriod = t2.wholePeriod, n2.push(o2)); + }) : null !== (o2 = this._getQualityItem(e2)) && (o2.reportIndex = this.reportIndex, o2.wholePeriod = this.wholePeriod, n2.push(o2)), M.d("".concat(this._n, "._report"), n2), 0 < this._statInfoArr.length && (n2 = n2.concat(this._statInfoArr), this._statInfoArr = []), this.get(12)), i2 = e2.getSDKAppID(), e2 = e2.getTinyID(); + 0 < (n2 = Wt(this.REPORT_SDKAPPID_BLACKLIST, i2) && !jt(this.REPORT_TINYID_WHITELIST, e2) ? [] : n2).length && this._doReport(n2); + } }, { key: "_doReport", value: function(t2) { + var n2 = this, e2 = { header: aa(this), quality: t2 }; + this.req({ P: k.SSO_STAT, data: y({}, e2) }).then(function() { + n2.reportIndex++, n2.wholePeriod = false; + }).catch(function(e3) { + M.w("".concat(n2._n, "._doReport failed. error:"), e3), n2._statInfoArr = n2._statInfoArr.concat(t2), n2._flushAtOnce(); + }); + } }, { key: "_flushAtOnce", value: function() { + var e2 = this.get(13), t2 = e2.getItem(this.TAG, false), n2 = this._statInfoArr, o2 = "".concat(this._n, "._flushAtOnce"); + S(t2) ? (M.l("".concat(o2, " count:").concat(n2.length)), e2.setItem(this.TAG, n2, true, false)) : (10 < (n2 = n2.concat(t2)).length && (n2 = n2.slice(0, 10)), M.l("".concat(o2, " count:").concat(n2.length)), e2.setItem(this.TAG, n2, true, false)), this._statInfoArr = []; + } }, { key: "reset", value: function() { + M.l("".concat(this._n, ".reset")), this._report(), this.reportIndex = 0, this.wholePeriod = false, this.REPORT_SDKAPPID_BLACKLIST = [], this.REPORT_TINYID_WHITELIST = [], this._avgRTT.reset(), this._avgE2EDelay.reset(), this._rateMessageSent.reset(), this._rateMessageReceived.reset(); + } }]), qr), zs = e(function e2(t2) { + d(this, e2), S(t2) || (this.userID = t2.userID || "", this.nick = t2.nick || "", this.avatar = t2.avatar || "", this.time = t2.time || 0, this.source = t2.source || "", this.wording = t2.wording || "", this.type = t2.type || ""); + }), Xs = (e(Fr, [{ key: "getLocalApplicationList", value: function() { + return { friendApplicationList: p(this._map.values()), unreadCount: this._unreadCount }; + } }, { key: "_onApplicationListUpdated", value: function() { + this._snsM.emitOEvt(h.FRIEND_APPLICATION_LIST_UPDATED, { friendApplicationList: p(this._map.values()), unreadCount: this._unreadCount }); + } }, { key: "onApplicationRead", value: function() { + this._unreadCount = 0, this._onApplicationListUpdated(); + } }, { key: "onApplicationAdded", value: function(e2, t2) { + var n2, o2, i2 = this; + S(e2) || (n2 = "", n2 = t2 === this._snsM.getMyUserID() ? A.SNS_APPLICATION_SENT_BY_ME : A.SNS_APPLICATION_SENT_TO_ME, o2 = false, e2.forEach(function(e3) { + var t3 = "".concat(e3.userID, "_").concat(n2); + n2 !== A.SNS_APPLICATION_SENT_TO_ME || i2._map.has(t3) || (i2._unreadCount += 1), i2._map.set(t3, new zs(y(y({}, e3), {}, { type: n2 }))), o2 = true; + }), o2 && this._onApplicationListUpdated()); + } }, { key: "onApplicationDeleted", value: function(e2) { + S(e2) || (this._startTime = 0, this._currentSeq = 0, this.getApplicationList()); + } }, { key: "getApplicationList", value: function() { + var a2 = this, s2 = "".concat(this._n, ".").concat("getApplicationList"), r2 = new G("getApplicationList"); + return this._snsM.req({ P: k.GET_FD_APPLICATION_LIST, data: { applicationType: A.SNS_APPLICATION_TYPE_BOTH, fromAccount: this._snsM.getMyUserID(), maxLimited: this._maxLimited, startTime: this._startTime, lastSequence: this._currentSeq } }).then(function(e2) { + var e2 = e2.data, t2 = e2.resultList, n2 = e2.unreadCount, o2 = e2.startTime, e2 = e2.currentSequence, i2 = (a2._startTime = o2, a2._currentSeq = e2, a2._unreadCount = n2, O(t2) ? t2.length : 0), i2 = "applicationCount:".concat(i2, " unreadCount:").concat(n2, " startTime:").concat(o2, " currentSequence:").concat(e2); + r2.setMessage(i2).end(), M.i("".concat(s2, " ok. ").concat(i2)), a2._map.clear(), O(t2) && t2.forEach(function(e3) { + var t3 = e3.userID, n3 = e3.type, e3 = new zs(e3); + a2._map.set("".concat(t3, "_").concat(n3), e3); + }), a2._onApplicationListUpdated(); + }).catch(function(e2) { + return r2.setError(e2).end(), M.w("".concat(s2, " failed. error:"), e2), D(e2); + }); + } }, { key: "deleteApplication", value: function(e2) { + var i2, a2 = "".concat(this._n, ".").concat("deleteApplication"), s2 = e2.userID, r2 = e2.type; + return r2 && (r2 === A.SNS_APPLICATION_SENT_BY_ME || r2 === A.SNS_APPLICATION_SENT_TO_ME) || (r2 = A.SNS_APPLICATION_SENT_TO_ME), this._map.has("".concat(s2, "_").concat(r2)) ? ((i2 = new G("deleteApplication")).setMessage("userID:".concat(s2, " type:").concat(r2)), this._snsM.req({ P: k.DEL_FD_APPLICATION, data: { fromAccount: this._snsM.getMyUserID(), userIDList: [s2], type: r2 } }).then(function(e3) { + var e3 = e3.data.resultList, t2 = e3[0], n2 = t2.to, o2 = t2.resultCode, t2 = t2.resultInfo; + return i2.setMoreMessage("resultList:".concat(JSON.stringify(e3))).end(), M.i("".concat(a2, " ok. userID:").concat(s2, " type:").concat(r2)), 0 === o2 ? C() : D({ userID: n2, code: o2, message: t2 }); + }).catch(function(e3) { + return i2.setError(e3).end(), M.w("".concat(a2, " failed. error:"), e3), D(e3); + })) : D({ code: L.FRIEND_APPLICATION_NOT_EXIST }); + } }, { key: "acceptApplication", value: function(e2) { + var n2 = "".concat(this._n, ".").concat("acceptApplication"), o2 = e2.userID, t2 = e2.remark, i2 = e2.tag, a2 = e2.type, s2 = (a2 && (a2 === A.SNS_APPLICATION_AGREE || a2 === A.SNS_APPLICATION_AGREE_AND_ADD) || (a2 = A.SNS_APPLICATION_AGREE_AND_ADD), new G("acceptApplication")); + return s2.setMessage("userID:".concat(o2, " type:").concat(a2)), this._snsM.req({ P: k.RESPOND_FD_APPLICATION, data: { fromAccount: this._snsM.getMyUserID(), responseFriendItem: [{ userID: o2, remark: t2, tag: i2, action: a2 }] } }).then(function(e3) { + s2.end(); + var e3 = e3.data.resultList[0], t3 = e3.resultCode, e3 = e3.resultInfo; + if (0 !== t3) + return D({ code: t3, message: e3 }); + M.i("".concat(n2, " ok. userID:").concat(o2, " type:").concat(a2)); + }).catch(function(e3) { + return s2.setError(e3).end(), M.w("".concat(n2, " failed. error:"), e3), D(e3); + }); + } }, { key: "refuseApplication", value: function(e2) { + var n2 = "".concat(this._n, ".").concat("refuseApplication"), o2 = e2.userID, i2 = new G("refuseApplication"); + return i2.setMessage("userID:".concat(o2)), this._snsM.req({ P: k.RESPOND_FD_APPLICATION, data: { fromAccount: this._snsM.getMyUserID(), responseFriendItem: [{ userID: o2, action: "Response_Action_Reject" }] } }).then(function(e3) { + i2.end(); + var e3 = e3.data.resultList[0], t2 = e3.resultCode, e3 = e3.resultInfo; + if (0 !== t2) + return D({ code: t2, message: e3 }); + M.i("".concat(n2, " ok. userID:").concat(o2)); + }).catch(function(e3) { + return i2.setError(e3).end(), M.w("".concat(n2, " failed. error:"), e3), D(e3); + }); + } }, { key: "setApplicationRead", value: function() { + var t2 = this, n2 = "".concat(this._n, ".").concat("setApplicationRead"), o2 = new G("setApplicationRead"); + return this._snsM.req({ P: k.REPORT_FD_APPLICATION, data: { fromAccount: this._snsM.getMyUserID(), latestTimeStamp: Yt(We() / 1e3, 0) } }).then(function(e2) { + o2.end(), M.i("".concat(n2, " ok")), t2._unreadCount = 0; + }).catch(function(e2) { + return o2.setError(e2).end(), M.w("".concat(n2, " failed. error:"), e2), D(e2); + }); + } }, { key: "reset", value: function() { + this._maxLimited = 100, this._currentSeq = 0, this._unreadCount = 0, this._map.clear(); + } }]), Fr), Zs = (e(wr, [{ key: "validate", value: function(e2) { + var t2, n2 = true, o2 = ""; + if (S(e2)) + return { valid: false, tips: "empty options" }; + if (e2.profileCustomField) + for (var i2 = e2.profileCustomField.length, a2 = null, s2 = 0; s2 < i2; s2++) { + if (a2 = e2.profileCustomField[s2], !m(a2.key) || -1 === a2.key.indexOf("Tag_Profile_Custom")) + return { valid: false, tips: "The prefix of keys of the custom profile key-value pairs (which is profileCustomField) must be Tag_Profile_Custom" }; + if (!m(a2.value)) + return { valid: false, tips: "The type of values of the custom profile key-value pairs (which is profileCustomField) must be String" }; + } + for (t2 in e2) + if (Object.prototype.hasOwnProperty.call(e2, t2)) { + if ("profileCustomField" === t2) + continue; + if (S(e2[t2]) && !m(e2[t2]) && !R(e2[t2])) { + o2 = "key:" + t2 + ", invalid value:" + e2[t2], n2 = false; + continue; + } + switch (t2) { + case "nick": + m(e2[t2]) || (n2 = !(o2 = "nick must be a string")), 500 < gt(e2[t2]) && (o2 = "nick name limited: must less than or equal to ".concat(500, " bytes, current size: ").concat(gt(e2[t2]), " bytes"), n2 = false); + break; + case "gender": + vt(Qe, e2.gender) || (o2 = "key:gender, invalid value:" + e2.gender, n2 = false); + break; + case "birthday": + R(e2.birthday) || (n2 = !(o2 = "birthday must be a number")); + break; + case "location": + m(e2.location) || (n2 = !(o2 = "location must be a string")); + break; + case "selfSignature": + m(e2.selfSignature) || (n2 = !(o2 = "selfSignature must be a string")); + break; + case "allowType": + vt(et, e2.allowType) || (o2 = "key:allowType, invalid value:" + e2.allowType, n2 = false); + break; + case "language": + R(e2.language) || (n2 = !(o2 = "language must be a number")); + break; + case "avatar": + m(e2.avatar) || (n2 = !(o2 = "avatar must be a string")); + break; + case "messageSettings": + 0 !== e2.messageSettings && 1 !== e2.messageSettings && (n2 = !(o2 = "messageSettings must be 0 or 1")); + break; + case "adminForbidType": + vt($e, e2.adminForbidType) || (o2 = "key:adminForbidType, invalid value:" + e2.adminForbidType, n2 = false); + break; + case "level": + R(e2.level) || (n2 = !(o2 = "level must be a number")); + break; + case "role": + R(e2.role) || (n2 = !(o2 = "role must be a number")); + break; + default: + o2 = "unknown key:" + t2 + " " + e2[t2], n2 = false; + } + } + return { valid: n2, tips: o2 }; + } }, { key: "update", value: function(e2) { + var t2, n2 = "", o2 = []; + this.friendCustomField.forEach(function(e3) { + o2.push(e3.key); + }); + for (var i2 = 0, a2 = e2.length; i2 < a2; i2++) + if (n2 = e2[i2].tag, t2 = e2[i2].value, -1 < n2.indexOf("Tag_SNS_Custom")) + -1 < o2.indexOf(n2) ? this.friendCustomField.forEach(function(e3) { + e3.key === n2 && (e3.value = t2); + }) : this.friendCustomField.push({ key: n2, value: t2 }); + else if (-1 < n2.indexOf("Tag_Profile_Custom")) { + var s2 = false; + this.profile.profileCustomField.forEach(function(e3) { + e3.key === n2 && (e3.value = t2, s2 = true); + }), s2 || this.profile.profileCustomField.push({ key: n2, value: t2 }); + } else + switch (n2) { + case g.NICK: + this.profile.nick = t2; + break; + case g.GENDER: + this.profile.gender = t2; + break; + case g.BIRTHDAY: + this.profile.birthday = t2; + break; + case g.LOCATION: + this.profile.location = t2; + break; + case g.SELFSIGNATURE: + this.profile.selfSignature = t2; + break; + case g.ALLOWTYPE: + this.profile.allowType = t2; + break; + case g.LANGUAGE: + this.profile.language = t2; + break; + case g.AVATAR: + this.profile.avatar = t2; + break; + case g.MESSAGESETTINGS: + this.profile.messageSettings = t2; + break; + case g.ADMINFORBIDTYPE: + this.profile.adminForbidType = t2; + break; + case g.LEVEL: + this.profile.level = t2; + break; + case g.ROLE: + this.profile.role = t2; + break; + case Ze.REMARK: + this.remark = t2; + break; + case Ze.ADDTIME: + this.addTime = t2; + break; + case Ze.GROUP: + this.groupList = JSON.parse(JSON.stringify(t2)); + break; + case Ze.ADDSOURCE: + this.source = t2; + break; + case Ze.ADDWORDING: + break; + default: + M.d("snsProfileItem unkown tag->", e2[i2].tag); + } + this.timestamp = Date.now(), o2.length = 0; + } }, { key: "updateProfile", value: function(e2) { + this.profile = JSON.parse(JSON.stringify(e2)), this.timestamp = Date.now(); + } }, { key: "addToGroupList", value: function(e2) { + -1 === this.groupList.indexOf(e2) && (this.groupList.push(e2), this.count = this.groupList.length); + } }, { key: "removeFromGroupList", value: function(e2) { + e2 = this.groupList.indexOf(e2); + -1 < e2 && (this.groupList.splice(e2, 1), this.count = this.groupList.length); + } }]), wr), Qs = (e(br, [{ key: "getLocalFriendList", value: function() { + return p(this._map.values()); + } }, { key: "getFriendRemark", value: function(e2) { + return this._map.has(e2) ? this._map.get(e2).remark : ""; + } }, { key: "onFriendProfileModified", value: function(e2) { + var o2, i2 = this, e2 = e2.dataList; + S(e2) || (o2 = this._snsM.get(11), e2.forEach(function(e3) { + var t2, n2 = e3.userID, e3 = e3.profileList; + i2.isMyFriend(n2) && (M.l("".concat(i2._n, ".onFriendProfileModified. friend account:").concat(n2, ", profileList:").concat(JSON.stringify(e3))), (t2 = i2._map.get(n2)).update(e3), o2.modifyMessageSentByPeer({ conversationID: "".concat(A.CONV_C2C).concat(n2), latestNick: t2.profile.nick, latestAvatar: t2.profile.avatar })); + }), this._onFriendListUpdated()); + } }, { key: "onFriendAdded", value: function(t2) { + var n2 = this; + 0 !== t2.length && (M.l("".concat(this._n, ".onFriendAdded userIDList:").concat(t2)), t2.forEach(function(e2) { + n2._map.set(e2, new Zs(e2)); + }), this.getFriendProfile({ userIDList: t2 }).then(function(e2) { + t2.forEach(function(e3) { + var t3 = n2._map.get(e3); + 0 < t3.groupList.length && n2._snsM.updateWhenFriendAdded({ nameList: t3.groupList, userID: e3 }); + }), n2._onFriendListUpdated(); + })); + } }, { key: "onFriendDeleted", value: function(e2) { + var n2 = this; + 0 !== e2.length && (M.l("".concat(this._n, ".onFriendDeleted userIDList:").concat(e2)), e2.forEach(function(e3) { + var t2 = n2._map.get(e3); + 0 < t2.groupList.length && n2._snsM.updateWhenFriendDeleted({ nameList: t2.groupList, userID: e3 }), n2._map.delete(e3); + }), this._onFriendListUpdated()); + } }, { key: "_onFriendListUpdated", value: function() { + this._snsM.emitOEvt(h.FRIEND_LIST_UPDATED), this._snsM.get(11).checkAndPatchRemark(); + } }, { key: "getFriendProfile", value: function(e2) { + var t2, a2 = this, n2 = "".concat(this._n, ".").concat("getFriendProfile"), e2 = e2.userIDList, s2 = [], r2 = [], o2 = []; + return e2.forEach(function(e3) { + var t3; + a2._map.has(e3) ? (t3 = a2._map.get(e3), Date.now() - t3.timestamp < a2._expirationTime ? r2.push(t3) : o2.push(e3)) : s2.push({ userID: e3, code: L.NOT_MY_FRIEND, message: a2._snsM.getErrMsg(L.NOT_MY_FRIEND) }); + }), 0 === o2.length ? (M.i("".concat(n2, " newUserIDList is empty")), T({ friendList: r2, failureUserIDList: s2 })) : ((t2 = new G("getFriendProfile")).setMessage("userIDList:".concat(o2)), M.i("".concat(n2, " userIDList:").concat(o2)), this._snsM.req({ P: k.GET_FD_PROFILE, data: { fromAccount: this._snsM.getMyUserID(), userIDList: o2 } }).then(function(e3) { + return t2.end(), M.i("".concat(n2, " ok")), e3.data.resultList.forEach(function(e4) { + var t3, n3 = e4.to, o3 = e4.resultCode, i2 = e4.resultInfo, e4 = e4.tagValueList; + N(o3) || 0 === o3 ? (a2._map.has(n3) ? (t3 = a2._map.get(n3)).update(e4) : (t3 = new Zs(n3, e4), a2._map.set(n3, t3)), r2.push(t3)) : s2.push({ userID: n3, code: o3, message: i2 }); + }), C({ friendList: r2, failureUserIDList: s2 }); + }).catch(function(e3) { + return t2.setError(e3).end(), M.w("".concat(n2, " failed. error:"), e3), D(e3); + })); + } }, { key: "isMyFriend", value: function(e2) { + return this._map.has(e2); + } }, { key: "pagingGetFriendList", value: function() { + var s2 = this, r2 = "".concat(this._n, ".").concat("getFriendList"), c2 = new G("getFriendList"), u2 = Date.now(); + this._snsM.req({ P: k.GET_FD_LIST, data: { fromAccount: this._snsM.getMyUserID(), startIndex: this._startIdx, standardSequence: this._standardSeq, customSequence: this._customSeq } }).then(function(e2) { + var e2 = e2.data, t2 = e2.friendCount, n2 = e2.resultList, o2 = e2.nextStartIndex, i2 = e2.standardSequence, a2 = e2.customSequence, e2 = e2.completeFlag, t2 = (s2._startIdx = o2, s2._standardSeq = i2, s2._customSeq = a2, "friendCount:".concat(t2, " nextStartIndex:").concat(o2, " standardSequence:").concat(i2, " ") + "customSequence:".concat(a2, " completeFlag:").concat(e2, " cost:").concat(nn(u2))); + c2.setMessage(t2).end(), M.i("".concat(r2, " ok."), t2), S(n2) || n2.forEach(function(e3) { + var t3 = e3.to, e3 = e3.tagValueList; + s2._map.set(t3, new Zs(t3, e3)); + }), 0 === e2 ? s2.pagingGetFriendList() : (s2._snsM.emitOEvt(h.FRIEND_LIST_UPDATED), s2._pagingGetFriendProfile()); + }).catch(function(e2) { + return c2.setError(e2).end(), M.w("".concat(r2, " failed. error:"), e2), D(e2); + }); + } }, { key: "_pagingGetFriendProfile", value: function() { + var n2 = this, e2 = p(this._map.keys()), t2 = this._snsM.get(4), o2 = e2.length, i2 = o2 <= 100 ? 1 : Math.ceil(o2 / 100); + M.l("".concat(this._n, "._pagingGetFriendProfile friendCount:").concat(o2, " pageCount:").concat(i2)); + for (var a2 = 0; a2 < i2; a2++) + t2.getUserProfile({ userIDList: e2.slice(100 * a2, 100 * (a2 + 1)) }).then(function(e3) { + e3.data.forEach(function(e4) { + var t3 = n2._map.get(e4.userID); + t3 && t3.updateProfile(e4); + }), n2._onFriendListUpdated(); + }); + } }, { key: "addFriend", value: function(e2) { + var t2, n2, o2, i2, a2, s2, r2, c2 = this, u2 = "".concat(this._n, ".").concat("addFriend"); + return this._map.has(e2.to) ? D({ code: L.ALREADY_MY_FRIEND }) : e2.wording && false === this._snsM.filterProfanity("wording", e2) ? D({ code: L.PROFANITY_FOUND }) : (t2 = e2.to, n2 = e2.source, o2 = e2.type, i2 = e2.wording, a2 = e2.remark, e2 = e2.groupName, (s2 = o2) && (s2 === A.SNS_ADD_TYPE_SINGLE || s2 === A.SNS_ADD_TYPE_BOTH) || (s2 = A.SNS_ADD_TYPE_BOTH), (r2 = new G("addFriend")).setMessage("to:".concat(t2, " source:").concat(n2, " type:").concat(s2)), this._snsM.req({ P: k.ADD_FD, data: { fromAccount: this._snsM.getMyUserID(), addFriendItem: [{ to: t2, source: n2, wording: i2, remark: a2, groupName: e2 }], type: s2 } }).then(function(e3) { + var e3 = e3.data.resultList, e3 = (r2.setMoreMessage("resultList:".concat(JSON.stringify(e3))).end(), e3[0]), t3 = e3.to, n3 = e3.resultCode, e3 = e3.resultInfo; + return M.i("".concat(u2, " ok. to:").concat(t3, " type:").concat(s2, " code:").concat(n3)), N(n3) || 0 === n3 ? C({ userID: t3, code: 0 }) : 30539 === n3 ? C({ userID: t3, code: n3, message: c2._snsM.getErrMsg(n3) }) : D({ userID: t3, code: n3, message: c2._snsM.getErrMsg(n3) || e3 }); + }).catch(function(e3) { + return r2.setError(e3).end(), M.w("".concat(u2, " failed. error:"), e3), D(e3); + })); + } }, { key: "deleteFriend", value: function(e2) { + var t2, n2 = this, o2 = "".concat(this._n, ".").concat("deleteFriend"), i2 = e2.userIDList, e2 = e2.type, a2 = (1e3 < i2.length && (M.w("".concat(o2, " ").concat($t(1e3))), i2.length = 1e3), []), s2 = [], r2 = []; + return i2.forEach(function(e3) { + n2._map.has(e3) ? r2.push(e3) : a2.push({ userID: e3, code: L.NOT_MY_FRIEND, message: n2._snsM.getErrMsg(L.NOT_MY_FRIEND) }); + }), 0 === r2.length ? T({ successUserIDList: s2, failureUserIDList: a2 }) : ((i2 = e2) && (i2 === A.SNS_DELETE_TYPE_SINGLE || i2 === A.SNS_DELETE_TYPE_BOTH) || (i2 = A.SNS_DELETE_TYPE_BOTH), (t2 = new G("deleteFriend")).setMessage("userIDList:".concat(r2, " type:").concat(i2)), this._snsM.req({ P: k.DEL_FD, data: { fromAccount: this._snsM.getMyUserID(), userIDList: r2, type: i2 } }).then(function(e3) { + t2.end(), M.i("".concat(o2, " ok")); + e3 = e3.data.resultList; + return S(e3) || e3.forEach(function(e4) { + var t3 = e4.to, n3 = e4.resultCode, e4 = e4.resultInfo; + N(n3) || 0 === n3 ? s2.push({ userID: t3 }) : a2.push({ userID: t3, code: n3, message: e4 }); + }), C({ successUserIDList: s2, failureUserIDList: a2 }); + }).catch(function(e3) { + return t2.setError(e3).end(), M.w("".concat(o2, " error:"), e3), D(e3); + })); + } }, { key: "updateFriend", value: function(e2) { + var o2, i2, t2, a2 = this, n2 = e2.userID, s2 = e2.remark, r2 = e2.friendCustomField; + return this._map.has(n2) ? (o2 = "".concat(this._n, ".").concat("updateFriend"), (i2 = new G("updateFriend")).setMessage("userID:".concat(n2, " remark:").concat(s2, " friendCustomField:").concat(r2)), t2 = [], N(s2) || t2.push({ tag: Ze.REMARK, value: s2 }), O(r2) && 0 < r2.length && r2.forEach(function(e3) { + t2.push({ tag: e3.key, value: e3.value }); + }), this._snsM.req({ P: k.UPDATE_FD, data: { fromAccount: this._snsM.getMyUserID(), updateItem: [{ to: n2, snsItem: t2 }] } }).then(function(e3) { + i2.end(), M.i("".concat(o2, " ok")); + var e3 = e3.data.resultList[0], t3 = e3.to, n3 = e3.resultCode, e3 = e3.resultInfo; + return N(n3) || 0 === n3 ? ((t3 = a2._map.get(t3)) && (N(s2) || (t3.remark = s2), O(r2) && 0 < r2.length && kt(t3.friendCustomField, r2), a2._onFriendListUpdated()), C(t3)) : D({ code: n3, message: e3 }); + }).catch(function(e3) { + return i2.setError(e3).end(), M.w("".concat(o2, " failed. error:"), e3), D(e3); + })) : D({ code: L.NOT_MY_FRIEND }); + } }, { key: "checkFriend", value: function(e2) { + var t2 = "".concat(this._n, ".").concat("checkFriend"), n2 = e2.userIDList, o2 = e2.type, s2 = (o2 && (o2 === A.SNS_CHECK_TYPE_SINGLE || o2 === A.SNS_CHECK_TYPE_BOTH) || (o2 = A.SNS_CHECK_TYPE_BOTH), new G("checkFriend")); + return s2.setMessage("userIDList:".concat(n2, " type:").concat(o2)), this._snsM.req({ P: k.CHECK_FD, data: { fromAccount: this._snsM.getMyUserID(), userIDList: n2, type: o2 } }).then(function(e3) { + s2.end(), M.i("".concat(t2, " ok. userIDList:").concat(n2, " type:").concat(o2)); + var i2 = [], a2 = [], e3 = e3.data.resultList; + return O(e3) && e3.forEach(function(e4) { + var t3 = e4.to, n3 = e4.relation, o3 = e4.resultCode, e4 = e4.resultInfo; + N(o3) || 0 === o3 ? i2.push({ userID: t3, code: 0, relation: n3 }) : a2.push({ userID: t3, code: o3, message: e4 }); + }), C({ successUserIDList: i2, failureUserIDList: a2 }); + }).catch(function(e3) { + return s2.setError(e3).end(), M.w("".concat(t2, " failed. error:"), e3), D(e3); + }); + } }, { key: "onAddedToFriendGroup", value: function(e2) { + var t2 = this, n2 = e2.name, e2 = e2.userIDList; + M.l("".concat(this._n, ".onAddedToFriendGroup groupName:").concat(n2, " userIDList:").concat(e2)), n2 && !S(e2) && e2.forEach(function(e3) { + t2._map.has(e3) && t2._map.get(e3).addToGroupList(n2); + }); + } }, { key: "onRemovedFromFriendGroup", value: function(e2) { + var t2 = this, n2 = e2.name, e2 = e2.userIDList; + M.l("".concat(this._n, ".onRemovedFromFriendGroup groupName:").concat(n2, " userIDList:").concat(e2)), n2 && !S(e2) && e2.forEach(function(e3) { + t2._map.has(e3) && t2._map.get(e3).removeFromGroupList(n2); + }); + } }, { key: "reset", value: function() { + this._map.clear(), this._startIdx = 0, this._standardSeq = 0, this._customSeq = 0; + } }]), br), $s = (e(Ur, [{ key: "addToUserIDList", value: function(e2) { + -1 === this.userIDList.indexOf(e2) && (this.userIDList.push(e2), this.count = this.userIDList.length); + } }, { key: "removeFromUserIDList", value: function(e2) { + e2 = this.userIDList.indexOf(e2); + -1 < e2 && (this.userIDList.splice(e2, 1), this.count = this.userIDList.length); + } }]), Ur), er = (e(Pr, [{ key: "getLocalGroupList", value: function() { + return p(this._map.values()); + } }, { key: "_onGroupListUpdated", value: function() { + var e2 = p(this._map.values()); + this._snsM.emitOEvt(h.FRIEND_GROUP_LIST_UPDATED, e2); + } }, { key: "getGroupList", value: function() { + var n2 = this, t2 = "".concat(this._n, ".").concat("getGroupList"), o2 = new G("getGroupList"); + return this._snsM.req({ P: k.GET_FD_GRP_LIST, data: { fromAccount: this._snsM.getMyUserID() } }).then(function(e2) { + o2.end(); + e2 = e2.data.resultList; + S(e2) ? M.i("".concat(t2, " ok. count:0")) : (M.i("".concat(t2, " ok. count:").concat(e2.length)), n2._map.clear(), e2.forEach(function(e3) { + var t3 = new $s(e3); + n2._map.set(e3.name, t3); + }), n2._onGroupListUpdated()); + }).catch(function(e2) { + return o2.setError(e2).end(), M.w("".concat(t2, " error:"), e2), D(e2); + }); + } }, { key: "createGroup", value: function(e2) { + var t2, n2, o2 = this, s2 = "".concat(this._n, ".").concat("createGroup"), r2 = e2.name, e2 = e2.userIDList; + return this._map.has(r2) ? D({ code: L.FRIEND_GRP_EXISTED }) : (t2 = "name:".concat(r2, " userIDList:").concat(e2), (n2 = new G("createGroup")).setMessage(t2), this._snsM.req({ P: k.CREATE_FD_GRP, data: { fromAccount: this._snsM.getMyUserID(), groupName: [r2], userIDList: O(e2) ? e2 : void 0 } }).then(function(e3) { + n2.end(), M.l("".concat(s2, " ok. ").concat(t2)); + var e3 = e3.data.resultList, i2 = [], a2 = [], e3 = (e3 && e3.forEach(function(e4) { + var t3 = e4.to, n3 = e4.resultCode, o3 = e4.resultInfo; + N(n3) || 0 === n3 ? i2.push(t3) : (t3 = { userID: e4.to, code: n3, message: o3 }, a2.push(t3)); + }), new $s({ name: r2, userIDList: i2 })); + return o2._map.set(r2, e3), o2._snsM.onAddedToFriendGroup({ name: r2, userIDList: i2 }), o2._onGroupListUpdated(), C({ friendGroup: e3, failureUserIDList: a2 }); + }).catch(function(e3) { + return n2.setError(e3).end(), M.w("".concat(s2, " failed. error:"), e3), D(e3); + })); + } }, { key: "deleteGroup", value: function(e2) { + var n2, o2, i2 = this, a2 = "".concat(this._n, ".").concat("deleteGroup"), s2 = e2.name; + return this._map.has(s2) ? (n2 = "name:".concat(s2), (o2 = new G("deleteGroup")).setMessage(n2), this._snsM.req({ P: k.DEL_FD_GRP, data: { fromAccount: this._snsM.getMyUserID(), nameList: [s2] } }).then(function(e3) { + o2.end(), M.l("".concat(a2, " ok. ").concat(n2)); + var t2 = i2._map.get(s2); + return t2 && (i2._snsM.onRemovedFromFriendGroup({ name: s2, userIDList: t2.userIDList }), i2._map.delete(s2), t2.userIDList.length = 0), i2._onGroupListUpdated(), C(t2); + }).catch(function(e3) { + return o2.setError(e3).end(), M.w("".concat(a2, " failed. error:"), e3), D(e3); + })) : this._onGroupNotExist(); + } }, { key: "renameGroup", value: function(e2) { + var t2, n2, o2 = this, i2 = "".concat(this._n, ".").concat("renameGroup"), a2 = e2.oldName, s2 = e2.newName; + return this._map.has(a2) ? (t2 = "oldName:".concat(a2, " newName:").concat(s2), (n2 = new G("renameGroup")).setMessage(t2), this._snsM.req({ P: k.UPDATE_FD_GRP, data: { fromAccount: this._snsM.getMyUserID(), oldName: a2, newName: s2 } }).then(function() { + var e3; + return n2.end(), M.l("".concat(i2, " ok. ").concat(t2)), o2._map.has(a2) ? ((e3 = o2._map.get(a2)).name = s2, o2._map.delete(a2), o2._map.set(s2, e3), o2._snsM.onRemovedFromFriendGroup({ name: a2, userIDList: e3.userIDList }), o2._snsM.onAddedToFriendGroup({ name: s2, userIDList: e3.userIDList }), o2._onGroupListUpdated(), C(e3)) : C(); + }).catch(function(e3) { + return n2.setError(e3).end(), M.w("".concat(i2, " failed. error:"), e3), D(e3); + })) : this._onGroupNotExist(); + } }, { key: "addToGroup", value: function(e2) { + var t2, n2, o2 = this, i2 = "".concat(this._n, ".").concat("addToGroup"), a2 = e2.name, e2 = e2.userIDList; + return this._map.has(a2) ? (t2 = "name:".concat(a2, " userIDList:").concat(e2), (n2 = new G("addToGroup")).setMessage(t2), this._snsM.req({ P: k.UPDATE_FD_GRP, data: { fromAccount: this._snsM.getMyUserID(), oldName: a2, updateGroupItem: e2.filter(function(e3) { + return o2._snsM.isMyFriend(e3); + }).map(function(e3) { + return { to: e3, updateType: "Update_Type_Add" }; + }) } }).then(function(e3) { + return n2.end(), M.l("".concat(i2, " ok. ").concat(t2)), o2._onGroupUpdated(a2, e3); + }).catch(function(e3) { + return n2.setError(e3).end(), M.w("".concat(i2, " failed. error:"), e3), D(e3); + })) : this._onGroupNotExist(); + } }, { key: "removeFromGroup", value: function(e2) { + var t2, n2, o2 = this, i2 = "".concat(this._n, ".").concat("removeFromGroup"), a2 = e2.name, e2 = e2.userIDList; + return this._map.has(a2) ? (t2 = "name:".concat(a2, " userIDList:").concat(e2), (n2 = new G("removeFromGroup")).setMessage(t2), this._snsM.req({ P: k.UPDATE_FD_GRP, data: { fromAccount: this._snsM.getMyUserID(), oldName: a2, updateGroupItem: e2.filter(function(e3) { + return o2._snsM.isMyFriend(e3); + }).map(function(e3) { + return { to: e3, updateType: "Update_Type_Delete" }; + }) } }).then(function(e3) { + return n2.end(), M.l("".concat(i2, " ok. ").concat(t2)), o2._onGroupUpdated(a2, e3); + }).catch(function(e3) { + return n2.setError(e3).end(), M.w("".concat(i2, " failed. error:"), e3), D(e3); + })) : this._onGroupNotExist(); + } }, { key: "_onGroupUpdated", value: function(e2, t2) { + var t2 = t2.data.resultList, a2 = this._map.get(e2), s2 = [], r2 = [], c2 = []; + return O(t2) && t2.forEach(function(e3) { + var t3 = e3.to, n2 = e3.resultCode, o2 = e3.resultInfo, i2 = e3.type; + 0 === n2 ? "Update_Type_Add" === i2 ? a2 && (a2.addToUserIDList(t3), r2.push(t3)) : "Update_Type_Delete" === i2 && a2 && (a2.removeFromUserIDList(t3), c2.push(t3)) : s2.push({ to: e3.to, code: n2, message: o2 }); + }), M.l("".concat(this._n, "._onGroupUpdated name:").concat(e2, " userIDList:").concat(a2.userIDList)), 0 < r2.length && this._snsM.onAddedToFriendGroup({ name: e2, userIDList: r2 }), 0 < c2.length && this._snsM.onRemovedFromFriendGroup({ name: e2, userIDList: c2 }), C({ friendGroup: a2, failureUserIDList: s2 }); + } }, { key: "updateWhenFriendAdded", value: function(e2) { + var t2 = this, n2 = e2.nameList, o2 = e2.userID; + M.l("".concat(this._n, ".updateWhenFriendAdded userID:").concat(o2, " nameList:").concat(n2)), S(n2) || n2.forEach(function(e3) { + t2._map.has(e3) && t2._map.get(e3).addToUserIDList(o2); + }); + } }, { key: "updateWhenFriendDeleted", value: function(e2) { + var t2 = this, n2 = e2.nameList, o2 = e2.userID; + M.l("".concat(this._n, ".updateWhenFriendDeleted userID:").concat(o2, " nameList:").concat(n2)), S(n2) || n2.forEach(function(e3) { + t2._map.has(e3) && t2._map.get(e3).removeFromUserIDList(o2); + }); + } }, { key: "_onGroupNotExist", value: function(e2) { + return D({ code: L.FRIEND_GRP_NOT_EXIST }); + } }, { key: "reset", value: function() { + this._map.clear(); + } }]), Pr), tr = (t(Gr, u), bs = n(Gr), e(Gr, [{ key: "onContextUpdated", value: function(e2) { + this._friendHandler.pagingGetFriendList(), this._friendGroupHandler.getGroupList(), this._friendApplicationHandler.getApplicationList(); + } }, { key: "onRelationChainModified", value: function(e2) { + var n2, o2, i2, a2, s2, r2, c2 = this, e2 = e2.dataList; + S(e2) || (n2 = [], o2 = [], i2 = [], s2 = !(a2 = []), r2 = "", e2.forEach(function(e3) { + var t2; + 3 !== e3.pushType && 4 !== e3.pushType || !e3.from || (r2 = e3.from), e3.friendAddAccount && (n2.push.apply(n2, p(e3.friendAddAccount)), a2.push.apply(a2, p(e3.friendAddAccount))), e3.friendDelAccount && o2.push.apply(o2, p(e3.friendDelAccount)), e3.friendApplicationAdded && i2.push.apply(i2, p(e3.friendApplicationAdded)), e3.friendApplicationDeletedUserIDList && a2.push.apply(a2, p(e3.friendApplicationDeletedUserIDList)), e3.reportTime && 7 === e3.pushType && (s2 = true), e3.friendUpInfo && (t2 = { dataList: [] }, e3.friendUpInfo.forEach(function(e4) { + t2.dataList.push({ userID: e4.friendAccount, profileList: p(e4.sns) }); + }), c2.onFriendProfileModified(t2)); + }), s2 && this._friendApplicationHandler.onApplicationRead(), this._friendApplicationHandler.onApplicationAdded(i2, r2), this._friendApplicationHandler.onApplicationDeleted(a2), this._friendHandler.onFriendAdded(n2), this._friendHandler.onFriendDeleted(o2)); + } }, { key: "isMyFriend", value: function(e2) { + return this._friendHandler.isMyFriend(e2); + } }, { key: "filterProfanity", value: function(e2, t2) { + var n2, o2 = this.get(29); + return !o2 || (n2 = (o2 = o2.filterText(t2[e2], "sns")).isAllowedToSend, o2 = o2.modifiedText, true === n2 && (t2[e2] = o2, true)); + } }, { key: "onFriendProfileModified", value: function(e2) { + this._friendHandler.onFriendProfileModified(e2); + } }, { key: "getLocalFriendList", value: function() { + var e2 = !(0 < arguments.length && void 0 !== arguments[0]) || arguments[0], t2 = this._friendHandler.getLocalFriendList(); + return e2 ? T(t2) : t2; + } }, { key: "getFriendRemark", value: function(e2) { + return this._friendHandler.getFriendRemark(e2); + } }, { key: "getFriendList", value: function() { + return this._friendHandler.pagingGetFriendList(); + } }, { key: "addFriend", value: function(e2) { + return this._friendHandler.addFriend(e2); + } }, { key: "deleteFriend", value: function(e2) { + return this._friendHandler.deleteFriend(e2); + } }, { key: "checkFriend", value: function(e2) { + return this._friendHandler.checkFriend(e2); + } }, { key: "getFriendProfile", value: function(e2) { + return this._friendHandler.getFriendProfile(e2); + } }, { key: "updateFriend", value: function(e2) { + return this._friendHandler.updateFriend(e2); + } }, { key: "onAddedToFriendGroup", value: function(e2) { + this._friendHandler.onAddedToFriendGroup(e2); + } }, { key: "onRemovedFromFriendGroup", value: function(e2) { + this._friendHandler.onRemovedFromFriendGroup(e2); + } }, { key: "getLocalFriendApplicationList", value: function() { + var e2 = this._friendApplicationHandler.getLocalApplicationList(); + return T(e2); + } }, { key: "deleteFriendApplication", value: function(e2) { + return this._friendApplicationHandler.deleteApplication(e2); + } }, { key: "refuseFriendApplication", value: function(e2) { + return this._friendApplicationHandler.refuseApplication(e2); + } }, { key: "acceptFriendApplication", value: function(e2) { + return this._friendApplicationHandler.acceptApplication(e2); + } }, { key: "setFriendApplicationRead", value: function(e2) { + return this._friendApplicationHandler.setApplicationRead(e2); + } }, { key: "getLocalFriendGroupList", value: function() { + var e2 = this._friendGroupHandler.getLocalGroupList(); + return T(e2); + } }, { key: "createFriendGroup", value: function(e2) { + return this._friendGroupHandler.createGroup(e2); + } }, { key: "deleteFriendGroup", value: function(e2) { + return this._friendGroupHandler.deleteGroup(e2); + } }, { key: "addToFriendGroup", value: function(e2) { + return this._friendGroupHandler.addToGroup(e2); + } }, { key: "removeFromFriendGroup", value: function(e2) { + return this._friendGroupHandler.removeFromGroup(e2); + } }, { key: "renameFriendGroup", value: function(e2) { + return this._friendGroupHandler.renameGroup(e2); + } }, { key: "updateWhenFriendAdded", value: function(e2) { + this._friendGroupHandler.updateWhenFriendAdded(e2); + } }, { key: "updateWhenFriendDeleted", value: function(e2) { + this._friendGroupHandler.updateWhenFriendDeleted(e2); + } }, { key: "reset", value: function() { + M.l("".concat(this._n, ".reset")), this._friendHandler.reset(), this._friendGroupHandler.reset(), this._friendApplicationHandler.reset(); + } }]), Gr), nr = (t(Nr, u), Us = n(Nr), e(Nr, [{ key: "isWorkerEnabled", value: function() { + return this._isWorkerEnabled && Ge; + } }, { key: "startWorkerTimer", value: function() { + M.l("".concat(this._n, ".startWorkerTimer")), this._workerTimer && this._workerTimer.postMessage("start"); + } }, { key: "stopWorkerTimer", value: function() { + M.l("".concat(this._n, ".stopWorkerTimer")), this._workerTimer && this._workerTimer.postMessage("stop"); + } }, { key: "_init", value: function() { + var e2, t2; + Ge && (e2 = URL.createObjectURL(new Blob(['let interval = -1;onmessage = function(event) { if (event.data === "start") { if (interval > 0) { clearInterval(interval); } interval = setInterval(() => { postMessage(""); }, 1000); postMessage(interval); } else if (event.data === "stop") { clearInterval(interval); interval = -1; }};'], { type: "application/javascript; charset=utf-8" })), this._workerTimer = new Worker(e2), (t2 = this)._workerTimer.onmessage = function(e3) { + e3.data ? (t2._timerID = e3.data, M.l("".concat(t2._n, "._init seed:").concat(t2._timerID))) : t2._m.onCheckTimer(); + }); + } }, { key: "_onCloudConfig", value: function() { + var e2 = this.getCloudConfig("enable_worker"); + M.l("".concat(this._n, "._onCloudConfig enableWorker:").concat(e2)), N(e2) || "1" === e2 ? !this._isWorkerEnabled && Ge && (this._isWorkerEnabled = true, this.startWorkerTimer(), this._m.onWorkerTimerEnabled()) : this._isWorkerEnabled && Ge && (this._isWorkerEnabled = false, this.stopWorkerTimer(), this._m.onWorkerTimerDisabled()); + } }, { key: "terminate", value: function() { + M.l("".concat(this._n, ".terminate")), this._workerTimer && (this._workerTimer.terminate(), this._workerTimer = null, this._timerID = -1); + } }, { key: "getTimerID", value: function() { + return this._timerID; + } }, { key: "reset", value: function() { + M.l("".concat(this._n, ".reset")); + } }]), Nr), or = (e(Or, [{ key: "isValidPurchaseBits", value: function(e2) { + return e2 && "string" == typeof e2 && 1 <= e2.length && e2.length <= 64 && /[01]{1,64}/.test(e2); + } }, { key: "parsePurchaseBits", value: function(e2) { + if (this.isValidPurchaseBits(e2)) { + this._featureMap.clear(); + for (var t2, n2 = e2.length - 1, o2 = 0; 0 <= n2; n2--, o2++) + t2 = (o2 < 32 ? new ee(0, Math.pow(2, o2)) : new ee(Math.pow(2, o2 - 32), 0)).toString(), "1" === e2[n2] ? this._featureMap.set(t2, true) : this._featureMap.set(t2, false); + } else + M.w("".concat(this._n, ".parsePurchaseBits invalid purchasebits:").concat(e2)); + } }, { key: "hasPurchasedFeature", value: function(e2) { + return !!this._featureMap.get(e2); + } }, { key: "isFeatureEnabled", value: function(e2) { + for (var t2 = parseInt(e2).toString(2), n2 = void 0, o2 = true, i2 = t2.length - 1, a2 = 0; 0 <= i2; i2--, a2++) + if ("1" === t2.charAt(i2) && (n2 = (a2 < 32 ? new ee(0, Math.pow(2, a2)) : new ee(Math.pow(2, a2 - 32), 0)).toString(), !this._featureMap.get(n2))) { + o2 = false; + break; + } + return M.l("".concat(this._n, ".isFeatureEnabled decimalNumber:").concat(e2, " key:").concat(n2, " ret:").concat(o2)), T({ enabled: o2 }); + } }, { key: "isFeatureEnabledForStat", value: function(e2) { + for (var t2 = parseInt(e2).toString(2), n2 = t2.length - 1, o2 = 0; 0 <= n2; n2--, o2++) + if ("1" === t2.charAt(n2)) { + if (i2 = (o2 < 32 ? new ee(0, Math.pow(2, o2)) : new ee(Math.pow(2, o2 - 32), 0)).toString(), !this._featureMap.get(i2)) + break; + var i2, a2 = "", s2 = 0; + i2 === _.PLUGIN_TRANSLATE ? (a2 = "plugin_translate", s2 = 16) : i2 === _.PLUGIN_VOICE_TO_TEXT ? (a2 = "plugin_voice_to_text", s2 = 17) : i2 === _.PLUGIN_CS ? (a2 = "plugin_cs", s2 = 14) : i2 === _.PLUGIN_PUSH ? (a2 = "plugin_push", s2 = 13) : i2 === _.PLUGIN_BOT ? (a2 = "plugin_bot", s2 = 15) : i2 === _.MSG_REACTION && (a2 = "plugin_emoji_reaction", s2 = 18), "" !== a2 && (i2 = this._commercialConfigM.get(12).getUIPlatform(), new G(a2).setCode(s2).setUIPlatform(i2).end(), M.l("".concat(this._n, ".isFeatureEnabledForStat ").concat(a2, " code:").concat(s2, " uiPlatform:").concat(i2))); + } + } }, { key: "isSearchCloudMessagesEnabled", value: function() { + var e2; + this._isSCMReported || (e2 = this._commercialConfigM.get(12).getUIPlatform(), new G("plugin_search").setCode(6).setUIPlatform(e2).end(), this._isSCMReported = true); + } }, { key: "clear", value: function() { + this._featureMap.clear(), this._isSCMReported = false; + } }]), Or), ir = (e(Rr, [{ key: "_canFetch", value: function() { + return this.get(12).isLoggedIn() ? !this._isFetching && Date.now() >= this._expiredTime : (this._expiredTime = Date.now() + 2e3, false); + } }, { key: "onCheckTimer", value: function(e2) { + this._canFetch() && this.fetchConfig(); + } }, { key: "fetchConfig", value: function() { + var t2, e2, n2 = this, o2 = this._canFetch(), i2 = "".concat(this._n, ".fetchConfig"); + M.l("".concat(i2, " canFetch:").concat(o2)), o2 && (t2 = new G("fetchCommercialConfig"), o2 = this.get(12).getSDKAppID(), e2 = this.get(20), this._isFetching = true, e2.req({ P: k.FETCH_COMMERCIAL_CONFIG, data: { SDKAppID: o2 } }).then(function(e3) { + t2.setMessage("purchaseBits:".concat(e3.data.purchaseBits)).end(), M.l("".concat(i2, " ok.")), n2._parseConfig(e3.data), n2._isFetching = false; + }).catch(function(e3) { + t2.setError(e3).end(), n2._isFetching = false; + })); + } }, { key: "onPushedConfig", value: function(e2) { + var t2 = "".concat(this._n, ".onPushedConfig data:").concat(JSON.stringify(e2)); + M.l("".concat(t2)), new G("pushedCommercialConfig").setMessage("purchaseBits:".concat(e2.purchaseBits)).end(), this._parseConfig(e2); + } }, { key: "_parseConfig", value: function(e2) { + var t2 = "".concat(this._n, "._parseConfig"), n2 = e2.errorCode, o2 = e2.errorMessage, i2 = e2.purchaseBits, a2 = e2.expiredTime; + 0 === n2 ? (this._purchasedFeatureHandler.parsePurchaseBits(i2), this._expiredTime = Date.now() + 1e3 * a2) : N(n2) ? (M.l("".concat(t2, " failed. Invalid message format:"), e2), this._setExpiredTimeOnResponseError(36e5)) : (M.e("".concat(t2, " errorCode:").concat(n2, " errorMessage:").concat(o2)), this._setExpiredTimeOnResponseError(12e4)); + } }, { key: "_setExpiredTimeOnResponseError", value: function(e2) { + this._expiredTime = Date.now() + e2; + } }, { key: "canIUse", value: function(e2) { + return this._purchasedFeatureHandler.hasPurchasedFeature(e2); + } }, { key: "isFeatureEnabled", value: function(e2) { + return this._purchasedFeatureHandler.isFeatureEnabled(e2); + } }, { key: "isFeatureEnabledForStat", value: function(e2) { + this._purchasedFeatureHandler.isFeatureEnabledForStat(e2); + } }, { key: "isSearchCloudMessagesEnabled", value: function() { + this._purchasedFeatureHandler.isSearchCloudMessagesEnabled(); + } }, { key: "get", value: function(e2) { + return this._m.get(e2); + } }, { key: "reset", value: function() { + M.l("".concat(this._n, ".reset")), this._expiredTime = 0, this._isFetching = false, this._purchasedFeatureHandler.clear(); + } }]), Rr), ar = (t(Ar, u), Ps = n(Ar), e(Ar, [{ key: "registerPlugin", value: function(e2) { + var t2, n2, o2, i2, a2, s2, r2, c2, u2, l2, d2, p2, _2; + Ie ? (this._offlinePushPlugin = e2["tim-offline-push-plugin"], t2 = (_2 = e2.offlinePushConfig || {}).huaweiBusinessID, n2 = _2.xiaomiBusinessID, o2 = _2.xiaomiAppID, i2 = _2.xiaomiAppKey, a2 = _2.meizuBusinessID, s2 = _2.meizuAppID, r2 = _2.meizuAppKey, c2 = _2.vivoBusinessID, u2 = _2.oppoBusinessID, l2 = _2.oppoAppKey, d2 = _2.oppoAppSecret, p2 = _2.honorBusinessID, _2 = _2.iosBusinessID, this._androidPushConfig.huaweiPushBussinessId = t2, this._androidPushConfig.xiaomiPushBussinessId = n2, this._androidPushConfig.xiaomiPushAppId = o2, this._androidPushConfig.xiaomiPushAppKey = i2, this._androidPushConfig.meizuPushBussinessId = a2, this._androidPushConfig.meizuPushAppId = s2, this._androidPushConfig.meizuPushAppKey = r2, this._androidPushConfig.vivoPushBussinessId = c2, this._androidPushConfig.oppoPushBussinessId = u2, this._androidPushConfig.oppoPushAppKey = l2, this._androidPushConfig.oppoPushAppSecret = d2, this._androidPushConfig.honorPushBussinessId = p2, new G("registerPlugin").setMessage("tim-offline-push-plugin").setMoreMessage("isExist:".concat(!N(this._offlinePushPlugin))).end(true), M.l("".concat(this._n, ".").concat("registerPlugin", " ok. offlinePushConfig:").concat(JSON.stringify(e2.offlinePushConfig))), this._iosBusinessID = _2, this._setAppShowListener()) : this.warn("OfflinePushInUniapp"); + } }, { key: "init", value: function() { + this._isWebUniapp = this.getUniAppPlatform(), this._getDeviceToken(); + } }, { key: "_getDeviceToken", value: function() { + var c2, u2 = this, l2 = "".concat(this._n, ".").concat("_getDeviceToken"); + lt(this._offlinePushPlugin.getDeviceToken) ? (c2 = "androidPushConfig:".concat(JSON.stringify(this._androidPushConfig), ", iosBusinessID:").concat(this._iosBusinessID), M.l("".concat(l2, " start. ").concat(c2)), new G("_getDeviceToken").setMessage("".concat(c2)).end(true), this._offlinePushPlugin.getDeviceToken(this._androidPushConfig, function(e2) { + var t2, n2, o2, i2, a2 = new G("getDeviceTokenRes"), s2 = e2.code, r2 = e2.msg; + 0 === s2 ? (t2 = (i2 = e2.data).deviceToken, n2 = i2.deviceBrand, o2 = i2.deviceType, i2 = i2.bussinessId, u2._deviceToken = t2, u2._businessID = i2 || u2._iosBusinessID, c2 = "deviceToken:".concat(t2, ", deviceBrand:").concat(n2 || o2, ", businessID:").concat(u2._businessID), M.l("".concat(l2, " ok. ").concat(c2)), a2.setMessage(c2).end(true), u2._setToken()) : (a2.setMessage("code:".concat(s2, ", msg:").concat(r2)).end(true), M.e("".concat(l2, " failed. error:"), e2)); + })) : M.e("".concat(l2, " getDeviceToken is not a function")); + } }, { key: "canIUseOfflinePush", value: function() { + return Ie && !N(this._offlinePushPlugin); + } }, { key: "_setAppShowListener", value: function() { + var t2 = this, n2 = "".concat(this._n, ".").concat("_setAppShowListener"); + N(this._offlinePushPlugin) ? M.e("".concat(n2, " offlinePushPlugin is undefined")) : lt(this._offlinePushPlugin.setAppShowListener) ? (new G("_setAppShowListener").end(true), M.l("".concat(n2, " start")), this._offlinePushPlugin.setAppShowListener(function(e2) { + e2 = (e2 || {}).appShow; + new G("setAppShowListenerRes").setMessage("appShow:".concat(e2)).end(true), M.l("".concat(n2, " ok. appShow:").concat(e2)), t2._m.isReady() && (0 === e2 ? (t2._getConvUnreadCount(), t2._onBackground()) : 1 === e2 && t2._onForeground()); + })) : M.e("".concat(n2, " setAppShowListener is not a function")); + } }, { key: "getDeviceBrand", value: function() { + var e2; + if (!N(this._offlinePushPlugin) && lt(this._offlinePushPlugin.getDeviceType)) + return e2 = (this._offlinePushPlugin.getDeviceType() || {}).deviceType, M.l("".concat(this._n, ".getDeviceBrand ok. deviceType:").concat(e2)), e2; + } }, { key: "_setToken", value: function() { + var t2 = "".concat(this._n, "._setToken"), e2 = this.get(12), n2 = 1, o2 = "", i2 = "", a2 = (S(this._deviceToken) && (n2 = 0), this.getUniAppPlatform()), s2 = this.getDeviceBrand(), r2 = (a2 === ne.IOS || a2 === ne.IPAD || a2 === ne.MAC ? i2 = this._deviceToken : a2 === ne.ANDROID && (o2 = this._deviceToken), new G("offlinePushSetToken")), a2 = "deviceToken:".concat(i2 || o2, ", businessID:").concat(this._businessID, ", ") + "deviceBrand:".concat(s2, ", isWebUniapp:").concat(this._isWebUniapp, ", pushMsg:").concat(n2, ", platform:").concat(a2); + return r2.setMessage("".concat(a2)), M.l("".concat(t2, " ").concat(a2)), this.req({ P: k.SET_TOKEN, data: { tokenID: o2, pushMsg: n2, sdkAppID: e2.getSDKAppID(), businessID: parseInt(this._businessID), deviceBrand: s2, deviceToken: i2, isWebUniapp: this._isWebUniapp } }).then(function(e3) { + return r2.end(), M.l("".concat(t2, " ok")), e3; + }).catch(function(e3) { + return r2.setError(e3).end(), M.e("".concat(t2, " failed. error:"), e3), D(e3); + }); + } }, { key: "_getConvUnreadCount", value: function() { + var t2 = this; + this._c2cUnreadCount = 0, this._groupUnreadCount = 0, this.get(11).getLocalConvList().forEach(function(e2) { + e2.type === A.CONV_C2C && (t2._c2cUnreadCount += e2.unreadCount), e2.type === A.CONV_GROUP && (t2._groupUnreadCount += e2.unreadCount); + }); + } }, { key: "_onBackground", value: function() { + var t2 = this, n2 = "".concat(this._n, ".").concat("_onBackground"), o2 = new G("_onBackground"); + this.req({ P: k.STAT_BACKGROUND, data: { c2cUnreadCount: this._c2cUnreadCount, groupUnreadCount: this._groupUnreadCount, isWebUniapp: this._isWebUniapp } }).then(function(e2) { + return o2.setMessage("c2cUnreadCount: ".concat(t2._c2cUnreadCount, ", groupUnreadCount: ").concat(t2._groupUnreadCount)).end(), M.l("".concat(n2, " ok")), e2; + }).catch(function(e2) { + o2.setError(e2).end(), M.e("".concat(n2, " failed. error:"), e2); + }); + } }, { key: "_onForeground", value: function() { + var t2 = "".concat(this._n, ".").concat("_onForeground"), n2 = new G("_onForeground"); + this.req({ P: k.STAT_FOREGROUND, data: { isWebUniapp: this._isWebUniapp } }).then(function(e2) { + return n2.end(), M.l("".concat(t2, " ok")), e2; + }).catch(function(e2) { + n2.setError(e2).end(), M.e("".concat(t2, " failed. error:"), e2); + }); + } }, { key: "getUniAppPlatform", value: function() { + var e2 = uni.getSystemInfoSync().platform, t2 = this.getDeviceBrand(); + return "ios" === e2 ? ne.IOS : "android" === e2 ? ne.ANDROID : 1002 === t2 ? ne.IPAD : 1001 === t2 ? ne.MAC : void 0; + } }, { key: "reset", value: function() { + this._deviceToken = "", this._businessID = 0, this._c2cUnreadCount = 0, this._groupUnreadCount = 0, this._isWebUniapp = 0, M.l("".concat(this._n, ".reset")); + } }]), Ar), sr = (t(kr, u), Gs = n(kr), e(kr, [{ key: "registerPlugin", value: function(e2) { + var t2, n2, o2; + Ie ? (t2 = "".concat(this._n, ".").concat("registerPlugin"), this._pushPlugin = e2["tim-push"], this._getDeviceInfo(), n2 = (o2 = e2.pushConfig || {}).androidConfig, o2 = o2.iOSConfig, ut(n2) && (this._androidPushConfig = n2[this._deviceInfo.packageName]), n2 = (o2 || {}).iOSBusinessID, this._iOSBusinessID = n2, o2 = !N(this._pushPlugin), new G("registerPlugin").setMessage(this._pluginName).setMoreMessage("isExisted:".concat(o2)).end(true), M.l("".concat(t2, " ok. pushConfig:").concat(JSON.stringify(e2.pushConfig))), o2 ? (this._setAppShowListener(), this._setPushEventReportListener()) : M.e("".concat(t2, " ").concat(this._pluginName, " is undefined"))) : this.warn("TIMPushInUniapp"); + } }, { key: "init", value: function() { + this._isWebUniapp = this.getUniAppPlatform(), this._reportEventCacheList(), this._getDeviceToken(), this.get(27).isFeatureEnabledForStat(Math.pow(2, 41)); + } }, { key: "_reportEventCacheList", value: function() { + var a2 = this, s2 = "".concat(this._n, ".").concat("_reportEventCacheList"); + lt(this._pushPlugin.getPushEventCacheList) ? (new G("_reportEventCacheList").end(true), this._pushPlugin.getPushEventCacheList(function(e2) { + var t2 = e2.code, n2 = e2.data.eventList, o2 = new G("getPushEventCacheListRes"); + if (o2.setCode(t2), 0 !== t2) + o2.setMessage("res:".concat(JSON.stringify(e2))).end(true), M.e("".concat(s2, " failed. error:").concat(JSON.stringify(e2))); + else { + t2 = n2.length < 10 ? "eventList:".concat(JSON.stringify(n2)) : "eventList.length:".concat(n2.length); + M.l("".concat(s2, " ok. ").concat(t2)), o2.setMessage(t2).end(true); + for (var i2 = y(y({}, e2.data), {}, { eventList: [] }); 0 < n2.length; ) + i2.eventList = n2.splice(0, 40), a2._pushReport(i2); + } + })) : M.e("".concat(this._pluginName, ".getPushEventCacheList is not a function")); + } }, { key: "_getDeviceToken", value: function() { + var r2, c2 = this, u2 = "".concat(this._n, ".").concat("_getDeviceToken"); + lt(this._pushPlugin.getDeviceToken) ? (r2 = "androidPushConfig:".concat(JSON.stringify(this._androidPushConfig), " iOSBusinessID:").concat(this._iOSBusinessID), M.l("".concat(u2, " start. ").concat(r2)), new G("_getDeviceToken").setMessage("".concat(r2)).end(true), this._pushPlugin.getDeviceToken(this._androidPushConfig, function(e2) { + var t2, n2, o2, i2 = e2.code, a2 = e2.msg, s2 = new G("getDeviceTokenRes"); + s2.setCode(i2), 0 === i2 ? (t2 = (i2 = e2.data).deviceToken, n2 = i2.deviceBrand, o2 = i2.deviceType, i2 = i2.bussinessId, c2._deviceToken = t2, c2._businessID = i2 || c2._iOSBusinessID, r2 = "deviceToken:".concat(t2, " deviceBrand:").concat(n2 || o2, " businessID:").concat(c2._businessID), M.l("".concat(u2, " ok. ").concat(r2)), s2.setMessage(r2).end(true), c2._setToken()) : (s2.setMessage(a2).end(true), M.e("".concat(u2, " failed. error:").concat(JSON.stringify(e2)))); + })) : M.e("".concat(this._pluginName, ".getDeviceToken is not a function")); + } }, { key: "_getDeviceInfo", value: function() { + var e2, t2, n2, o2, i2 = "".concat(this._n, ".").concat("_getDeviceInfo"); + lt(this._pushPlugin.getDeviceInfo) ? (o2 = (e2 = this._pushPlugin.getDeviceInfo()).code, t2 = e2.data, (n2 = new G("_getDeviceInfo")).setCode(o2), 0 === o2 ? (this._deviceInfo = y(y({}, this._deviceInfo), t2), this._deviceInfo.pushVersion || (this._deviceInfo.pushVersion = "1.0.1"), o2 = "deviceInfo:".concat(JSON.stringify(this._deviceInfo)), M.l("".concat(i2, " ok. ").concat(o2)), n2.setMessage(o2).end(true)) : (n2.setMessage("deviceInfoRes:".concat(JSON.stringify(e2))).end(true), M.e("".concat(i2, " failed. error:").concat(JSON.stringify(e2))))) : M.e("".concat(this._pluginName, ".getDeviceInfo is not a function")); + } }, { key: "canIUseTIMPush", value: function() { + return Ie && !N(this._pushPlugin); + } }, { key: "_setAppShowListener", value: function() { + var t2 = this, n2 = "".concat(this._n, ".").concat("_setAppShowListener"); + lt(this._pushPlugin.setAppShowListener) ? (new G("_setAppShowListener").end(true), M.l("".concat(n2, " start")), this._pushPlugin.setAppShowListener(function(e2) { + e2 = (e2 || {}).appShow; + new G("setAppShowListenerRes").setMessage("appShow:".concat(e2)).end(true), M.l("".concat(n2, " ok. appShow:").concat(e2)), t2._m.isReady() && (0 === e2 ? (t2._getConvUnreadCount(), t2._onBackground()) : 1 === e2 && t2._onForeground()); + })) : M.e("".concat(this._pluginName, ".setAppShowListener is not a function")); + } }, { key: "_setPushEventReportListener", value: function() { + var a2 = this, s2 = "".concat(this._n, ".").concat("_setPushEventReportListener"); + lt(this._pushPlugin.setPushEventReportListener) ? (new G("_setPushEventReportListener").end(true), this._pushPlugin.setPushEventReportListener(function(e2) { + var t2 = e2.code, n2 = e2.data, o2 = n2.eventList, i2 = new G("setPushEventReportListenerRes"); + i2.setCode(t2), 0 === t2 ? (t2 = "eventList:".concat(JSON.stringify(o2)), M.l("".concat(s2, " ok. ").concat(t2)), i2.setMessage(t2).end(true), a2._m.isReady() && O(o2) && 0 < o2.length && a2._pushReport(n2)) : (i2.setMessage("res:".concat(JSON.stringify(e2))).end(true), M.e("".concat(s2, " failed. error:").concat(JSON.stringify(e2)))); + })) : M.e("".concat(this._pluginName, ".setPushEventReportListener is not a function")); + } }, { key: "getDeviceBrand", value: function() { + var e2; + if (!N(this._pushPlugin) && lt(this._pushPlugin.getDeviceType)) + return e2 = (this._pushPlugin.getDeviceType() || {}).deviceType, M.l("".concat(this._n, ".getDeviceBrand ok. deviceType:").concat(e2)), e2; + } }, { key: "_setToken", value: function() { + var t2 = "".concat(this._n, ".").concat("_setToken"), e2 = this.get(12), n2 = 1, o2 = "", i2 = "", a2 = (S(this._deviceToken) && (n2 = 0), this.getUniAppPlatform()), s2 = this.getDeviceBrand(), a2 = (a2 === ne.IOS || a2 === ne.IPAD || a2 === ne.MAC ? i2 = this._deviceToken : a2 === ne.ANDROID && (o2 = this._deviceToken), y({ tokenID: o2, pushMsg: n2, sdkAppID: e2.getSDKAppID(), businessID: parseInt(this._businessID), deviceBrand: s2, deviceToken: i2, isWebUniapp: this._isWebUniapp }, this._deviceInfo)), r2 = new G("_setToken"), o2 = "data:".concat(JSON.stringify(a2)); + r2.setMessage("".concat(o2)), M.l("".concat(t2, " ").concat(o2)), this.req({ P: k.SET_TOKEN, data: a2 }).then(function() { + r2.end(), M.w("".concat(t2, " ok")); + }).catch(function(e3) { + r2.setError(e3).end(), M.e("".concat(t2, " failed. error:"), e3), D(e3); + }); + } }, { key: "_getConvUnreadCount", value: function() { + var t2 = this; + this._c2cUnreadCount = 0, this._groupUnreadCount = 0, this.get(11).getLocalConvList().forEach(function(e2) { + e2.type === A.CONV_C2C && (t2._c2cUnreadCount += e2.unreadCount), e2.type === A.CONV_GROUP && (t2._groupUnreadCount += e2.unreadCount); + }); + } }, { key: "_onBackground", value: function() { + var e2 = this, t2 = "".concat(this._n, ".").concat("_onBackground"), n2 = new G("_onBackground"); + this.req({ P: k.STAT_BACKGROUND, data: { c2cUnreadCount: this._c2cUnreadCount, groupUnreadCount: this._groupUnreadCount, isWebUniapp: this._isWebUniapp } }).then(function() { + n2.setMessage("c2cUnreadCount:".concat(e2._c2cUnreadCount, " groupUnreadCount:").concat(e2._groupUnreadCount)).end(), M.l("".concat(t2, " ok")); + }).catch(function(e3) { + n2.setError(e3).end(), M.e("".concat(t2, " failed. error:"), e3); + }); + } }, { key: "_onForeground", value: function() { + var t2 = "".concat(this._n, ".").concat("_onForeground"), n2 = new G("_onForeground"); + this.req({ P: k.STAT_FOREGROUND, data: { isWebUniapp: this._isWebUniapp } }).then(function() { + n2.end(), M.l("".concat(t2, " ok")); + }).catch(function(e2) { + n2.setError(e2).end(), M.e("".concat(t2, " failed. error:"), e2); + }); + } }, { key: "_pushReport", value: function(e2) { + var t2 = this, n2 = "".concat(this._n, ".").concat("_pushReport"), o2 = new G("_pushReport"); + this.req({ P: k.PUSH_REPORT, data: { eventList: e2.eventList } }).then(function() { + o2.end(), t2._notifyReportSuccess(e2); + }).catch(function(e3) { + o2.setError(e3).end(), M.e("".concat(n2, " failed. error:"), e3); + }); + } }, { key: "_notifyReportSuccess", value: function(e2) { + !N(this._pushPlugin) && lt(this._pushPlugin.notifyReportSuccess) && (this._pushPlugin.notifyReportSuccess(e2), M.l("".concat(this._n, "._notifyReportSuccess ok"))); + } }, { key: "getUniAppPlatform", value: function() { + var e2 = uni.getSystemInfoSync().platform, t2 = this.getDeviceBrand(); + return "ios" === e2 ? ne.IOS : "android" === e2 ? ne.ANDROID : 1002 === t2 ? ne.IPAD : 1001 === t2 ? ne.MAC : void 0; + } }, { key: "reset", value: function() { + this._deviceToken = "", this._businessID = 0, this._c2cUnreadCount = 0, this._groupUnreadCount = 0, this._isWebUniapp = 0, M.l("".concat(this._n, ".reset")); + } }]), kr), rr = (t(Sr, u), Ns = n(Sr), e(Sr, [{ key: "init", value: function() { + var e2 = this.get(18).getPlugin("tim-profanity-filter-plugin"); + e2 && (this._plugin = new e2({ logger: M, isArray: O, isMap: st, isDevMode: this.isDevMode() }), this._getLexicon()); + } }, { key: "onCheckTimer", value: function() { + this._plugin && this._canIUseLexicon && this.isLoggedIn() && !this._isFetching && Date.now() >= this._expiredTime && this._getLexicon(); + } }, { key: "filterMessage", value: function(e2, t2) { + var n2 = true; + if (this._plugin && this._canIUseLexicon && (!t2 || !t2.messageControlInfo || true !== t2.messageControlInfo.excludedFromContentModeration)) { + var t2 = e2.type, o2 = e2.conversationType; + if (t2 === A.MSG_TEXT || t2 === A.MSG_CUSTOM) { + var i2, a2 = "".concat(this._n, ".filterMessage"); + if (M.l("".concat(a2)), t2 === A.MSG_TEXT) { + if (o2 === A.CONV_C2C ? i2 = "c2c_text_message" : o2 === A.CONV_GROUP && (i2 = "group_text_message"), !this._isConfigOn(i2)) + return n2; + var s2 = this._plugin.filter(e2.payload.text), r2 = s2.type, s2 = s2.modifiedText; + 1 === r2 ? n2 = false : 2 === r2 && (e2.payload.text = s2); + } else if (t2 === A.MSG_CUSTOM) { + if (o2 === A.CONV_C2C ? i2 = "c2c_custom_message" : o2 === A.CONV_GROUP && (i2 = "group_custom_message"), !this._isConfigOn(i2)) + return n2; + r2 = this._plugin.filter(e2.payload.data), s2 = this._plugin.filter(e2.payload.description), t2 = this._plugin.filter(e2.payload.extension); + 1 === r2.type || 1 === s2.type || 1 === t2.type ? n2 = false : (2 === r2.type && (e2.payload.data = r2.modifiedText), 2 === s2.type && (e2.payload.description = s2.modifiedText), 2 === t2.type && (e2.payload.extension = t2.modifiedText)); + } + M.l("".concat(a2, " done. isAllowedToSend:").concat(n2)); + } + } + return n2; + } }, { key: "filterText", value: function(e2, t2) { + var n2 = "".concat(this._n, ".filterText"), o2 = { isAllowedToSend: true, modifiedText: e2 }; + return this._plugin && this._canIUseLexicon && this._isConfigOn(t2) && (M.l("".concat(n2)), e2 = (t2 = this._plugin.filter(e2)).type, t2 = t2.modifiedText, 1 === e2 ? o2.isAllowedToSend = false : 2 === e2 && (o2.modifiedText = t2), M.l("".concat(n2, " done. ret:"), o2)), o2; + } }, { key: "_getLexicon", value: function() { + var l2 = this, d2 = new G("profanityFilter"), p2 = "".concat(this._n, "._getLexicon"); + this._isFetching = true, this.req({ P: k.GET_PROFANITY_LIST, data: { startIndex: this._startIndex, version: this._version } }).then(function(e2) { + var e2 = e2.data, t2 = e2.errorInfo, n2 = e2.filterConfig, o2 = e2.lexicon, i2 = e2.strToken, a2 = e2.completeFlag, s2 = e2.nextStartIndex, r2 = e2.version, e2 = e2.expiredTime, c2 = t2.errorCode, u2 = t2.errorMessage; + return 0 !== c2 ? (l2._isFetching = false, M.w("".concat(p2, " failed. error:"), t2), void d2.setCode(c2).setMessage(u2).end()) : (l2._onFilterConfig(n2), l2._getToken(i2), 1 === a2 ? (M.l("".concat(p2, " done. version:").concat(r2, " expiredTime:").concat(e2)), l2._version = r2, l2._canIUseLexicon = true, l2._isFetching = false, l2._expiredTime = Date.now() + 1e3 * e2, void l2._plugin.onLexiconCompleted(o2)) : (l2._startIndex = s2, l2._plugin.onLexiconSliced(o2), void l2._getLexicon())); + }).catch(function(e2) { + d2.setError(e2).end(), l2._isFetching = false, M.l("".concat(p2, " failed. error:"), e2); + }); + } }, { key: "_onFilterConfig", value: function(t2) { + var n2 = this; + S(t2) || (this._filterConfigMap.clear(), Object.keys(t2).forEach(function(e2) { + n2._filterConfigMap.set(e2, t2[e2]); + }), M.l("".concat(this._n, "._onFilterConfig. keys:").concat(Array.from(this._filterConfigMap.keys()), " values:").concat(Array.from(this._filterConfigMap.values())))); + } }, { key: "_isConfigOn", value: function(e2) { + return 1 === this._filterConfigMap.get(e2); + } }, { key: "_getToken", value: function(e2) { + if (m(e2)) { + var t2 = e2.length, n2 = ""; + if (t2 % 2 == 0) + for (var o2 = 0; o2 <= t2 - 1; o2 += 2) + n2 = (n2 += e2[o2 + 1]) + e2[o2]; + else { + for (var i2 = 0; i2 < t2 - 1; i2 += 2) + n2 = (n2 += e2[i2 + 1]) + e2[i2]; + n2 += e2[t2 - 1]; + } + this._plugin.onToken(n2); + } + } }, { key: "reset", value: function() { + M.l("".concat(this._n, ".reset")), this._plugin && (this._plugin.reset(), this._plugin = null), this._filterConfigMap.clear(), this._startIndex = 0, this._version = 0, this._canIUseLexicon = false, this._isFetching = false, this._expiredTime = 0; + } }]), Sr), cr = (e(Lr, [{ key: "_onCloudConfig", value: function() { + var t2 = this, e2 = this._m.get(23).getCloudConfig("rtc_cmd"); + N(e2) || ((e2 = JSON.parse(e2)).forEach(function(e3) { + t2._TRTCCommandList.includes(e3) || t2._TRTCCommandList.push(e3); + }), this._setTRTCCommandMap()); + } }, { key: "_setTRTCCommandMap", value: function() { + for (var e2, t2 = 0, n2 = this._TRTCCommandList.length; t2 < n2; t2++) + e2 = this._TRTCCommandList[t2].split(".")[0], this._TRTCCommandMap.set(e2, 1); + } }, { key: "onRoomCustomDataReceived", value: function(e2) { + this._m.getOEmitInst().emit(h.ROOM_CUSTOM_DATA_RECEIVED, e2); + } }, { key: "sendTRTCCustomData", value: function(e2) { + var t2 = e2.serviceCommand, e2 = e2.data, n2 = "".concat(a.NAME.TUIROOM_SVR, ".*"); + return N(t2) || (n2 = t2), this._isValidServiceCommand(n2) ? this._trans({ servcmd: n2, data: e2 }) : D({ code: L.INVALID_TRTC_CMD }); + } }, { key: "_trans", value: function(e2) { + M.d("".concat(this._n, "._trans. options:").concat(JSON.stringify(e2))); + var t2 = e2.servcmd, e2 = e2.data; + return this._m.get(20).trans({ servcmd: t2, data: m(e2) ? JSON.parse(e2) : e2 }); + } }, { key: "_isValidServiceCommand", value: function(e2) { + return e2.endsWith(".*") ? this._TRTCCommandList.includes(e2) : (e2 = e2.split(".")[0], this._TRTCCommandMap.has(e2)); + } }, { key: "isTRTCCommand", value: function(e2) { + e2 = e2.split(".")[0]; + return this._TRTCCommandMap.has(e2); + } }, { key: "reset", value: function() { + M.l("".concat(this._n, ".reset")); + } }]), Lr), ur = (e(Er, [{ key: "_init", value: function() { + var e2, t2 = this._getStorageModule().getItem(this.TIM_ERROR_ASSISTANCE, false); + if (t2) { + try { + e2 = JSON.parse(t2); + } catch (e3) { + this._getStorageModule().removeItem(this.TIM_ERROR_ASSISTANCE, false), M.w("".concat(this._n, "._init error:"), e3); + } + e2 && (this._needToUpdate(e2) ? this._fetch() : this._fillMap(e2.message)); + } else + this._fetch(); + } }, { key: "_needToUpdate", value: function(e2) { + var t2 = e2.localSavedTime, e2 = e2.localSavedVersion, t2 = t2 && (/* @__PURE__ */ new Date()).getTime() - t2 >= this.STORAGE_EXPIRES_TIME, e2 = !e2 || "3.4.7" !== e2; + return M.l("".concat(this._n, "._needToUpdate isTimeout:").concat(t2, " isDifferentVersion:").concat(e2)), t2 || e2; + } }, { key: "_fetch", value: function() { + var e2, t2, n2, o2, i2, a2; + this._m.get(12).isPrivateNetWork() || (e2 = "https://web.sdk.qcloud.com/im/download/error-message/v3/0.0.6/tim-error-message.txt", t2 = "application/x-www-form-urlencoded;charset=UTF-8", n2 = "".concat(this._n, "._fetch ok in"), o2 = this, v ? I.request({ url: e2, method: "GET", timeout: 3e3, header: { "content-type": t2 }, dataType: "text", success: function(e3) { + o2._fillAndSave(e3.data), M.l("".concat(n2, " mini program")); + }, fail: function() { + } }) : (i2 = new XMLHttpRequest(), a2 = setTimeout(function() { + i2.abort(); + }, 3e3), i2.onreadystatechange = function() { + 4 === i2.readyState && (clearTimeout(a2), 200 !== i2.status && 304 !== i2.status || (M.l("".concat(n2, " browser")), o2._fillAndSave(i2.responseText))); + }, i2.open("GET", e2, true), i2.setRequestHeader("Content-type", t2), i2.send())); + } }, { key: "_fillAndSave", value: function(e2) { + this._fillMap(e2), this._getStorageModule().setItem(this.TIM_ERROR_ASSISTANCE, JSON.stringify({ message: e2, localSavedTime: (/* @__PURE__ */ new Date()).getTime(), localSavedVersion: "3.4.7" }), true, false); + } }, { key: "_getStorageModule", value: function() { + return this._m.get(13); + } }, { key: "_fillMap", value: function(e2) { + this._map.clear(); + for (var t2, n2, o2 = e2.split(";\n"), i2 = o2.length, a2 = new RegExp(/'/g), s2 = 0; s2 < i2; s2++) + if (n2 = o2[s2].indexOf(":"), t2 = o2[s2].slice(0, n2), n2 = o2[s2].slice(n2 + 1, o2[s2].length), !t2.startsWith("//")) { + if (N(n2)) + continue; + this._map.set(t2, n2.replace(a2, "")); + } + } }, { key: "get", value: function(e2) { + var t2 = e2.isIntl, n2 = e2.key, o2 = e2.replacement1, e2 = e2.replacement2, t2 = "".concat(n2, t2 ? "_en" : "_cn"), n2 = (!this._map.has(t2) && this._map.has(n2) && (t2 = n2), ""); + return this._map.has(t2) && (n2 = this._map.get(t2), N(o2) || (n2 = n2.replace("$replacement1", o2)), N(e2) || (n2 = n2.replace("$replacement2", e2))), n2; + } }, { key: "reset", value: function() { + M.l("".concat(this._n, ".reset")); + } }]), Er), lr = (e(Dr, [{ key: "onNewMessageList", value: function(e2) { + var n2 = this; + e2.forEach(function(e3) { + var t2 = n2.getPayloadData(e3); + t2 && n2._handleActionType(t2, e3); + }); + } }, { key: "onMessageModified", value: function(e2) { + var n2 = this; + e2.forEach(function(e3) { + var t2 = n2.getPayloadData(e3); + t2 && n2._onInvitationModified(t2, e3); + }); + } }, { key: "getPayloadData", value: function(t2) { + var n2 = "".concat(this._n, ".getPayloadData"), t2 = t2.payload.data; + try { + return JSON.parse(t2); + } catch (e2) { + return M.e("".concat(n2, " JSON parse error. signalingData:").concat(t2)), null; + } + } }, { key: "_handleActionType", value: function(e2, t2) { + switch (e2.actionType) { + case Q.ACTION_TYPE_INVITE: + this._onNewInvitationReceived(e2, t2); + break; + case Q.ACTION_TYPE_REJECT_INVITE: + this._onInviteeRejected(e2); + break; + case Q.ACTION_TYPE_ACCEPT_INVITE: + this._onInviteeAccepted(e2); + break; + case Q.ACTION_TYPE_CANCEL_INVITE: + this._onInvitationCancelled(e2); + break; + case Q.ACTION_TYPE_INVITE_TIMEOUT: + this._onInvitationTimeout(e2); + } + } }, { key: "_genBaseEmitData", value: function(e2) { + return { inviteID: e2.inviteID, inviter: e2.inviter, groupID: e2.groupID, data: e2.data || "" }; + } }, { key: "_onNewInvitationReceived", value: function(e2, t2) { + var n2 = "".concat(this._n, "._onNewInvitationReceived"), o2 = e2.inviteID, i2 = e2.inviteeList, a2 = e2.groupID, s2 = e2.inviter, r2 = this._sigM.getMyUserID(), c2 = i2.includes(r2), u2 = e2.timeout, l2 = (Ve().getTime() - 1e3 * t2.time) / 1e3, n2 = (0 < u2 && 0 < l2 && l2 < u2 && (u2 -= l2), "".concat(n2, " myselfIncluded:").concat(c2, " groupID:").concat(a2, " signalObj:").concat(JSON.stringify(e2))); + M.l("".concat(n2, " timeout:").concat(u2, "s delta:").concat(l2, "s")), !(a2 && c2 || !a2) || (n2 = this._sigM.getInviteInfo(o2)) && n2 === e2 || (n2 || this._sigM.setInviteInfo(o2, y(y({}, e2), {}, { message: t2 })), this._sigM.emitEvent(Q.NEW_INVITATION_RECEIVED, y(y({}, this._genBaseEmitData(e2)), {}, { inviteeList: i2 })), s2 !== r2 && this._sigM.startTimer(y(y({}, e2), {}, { timeout: u2 }))); + } }, { key: "_onInviteeRejected", value: function(e2) { + var t2 = "".concat(this._n, "._onInviteeRejected"), n2 = e2.inviteID, o2 = e2.inviter, i2 = e2.groupID, a2 = this._sigM.hasInviteInfo(n2); + M.l("".concat(t2, " inviteID:").concat(n2, " hasInviteID:").concat(a2, " inviter:").concat(o2, " groupID:").concat(i2)), a2 && (this._sigM.updateInviteInfo(e2), this._sigM.emitEvent(Q.INVITEE_REJECTED, y(y({}, this._genBaseEmitData(e2)), {}, { invitee: e2.inviteeList[0] }))); + } }, { key: "_onInviteeAccepted", value: function(e2) { + var t2 = "".concat(this._n, "._onInviteeAccepted"), n2 = e2.inviteID, o2 = e2.inviter, i2 = e2.groupID, a2 = this._sigM.hasInviteInfo(n2); + M.l("".concat(t2, " inviteID:").concat(n2, " hasInviteID:").concat(a2, " inviter:").concat(o2, " groupID:").concat(i2)), a2 && (this._sigM.updateInviteInfo(e2), this._sigM.emitEvent(Q.INVITEE_ACCEPTED, y(y({}, this._genBaseEmitData(e2)), {}, { invitee: e2.inviteeList[0] }))); + } }, { key: "_onInvitationCancelled", value: function(e2) { + var t2 = "".concat(this._n, "._onInvitationCancelled"), n2 = e2.inviteID, o2 = e2.inviter, i2 = e2.groupID, a2 = this._sigM.hasInviteInfo(n2); + M.l("".concat(t2, " inviteID:").concat(n2, " hasInviteID:").concat(a2, " inviter:").concat(o2, " groupID:").concat(i2)), a2 && (this._sigM.deleteInviteInfo(n2), this._sigM.emitEvent(Q.INVITATION_CANCELLED, this._genBaseEmitData(e2))); + } }, { key: "_onInvitationTimeout", value: function(e2) { + var t2 = "".concat(this._n, "._onInvitationTimeout"), n2 = e2.inviteID, o2 = e2.inviter, i2 = e2.groupID, a2 = e2.inviteeList, s2 = this._sigM.hasInviteInfo(n2); + M.l("".concat(t2, " inviteID:").concat(n2, " hasInviteID:").concat(s2, " inviter:").concat(o2, " groupID:").concat(i2, " data:").concat(e2.data)), s2 && (this._sigM.updateInviteInfo(e2), this._sigM.emitEvent(Q.INVITATION_TIMEOUT, y(y({}, this._genBaseEmitData(e2)), {}, { inviteeList: a2, isSelfTimeout: false }))); + } }, { key: "_onInvitationModified", value: function(e2, t2) { + var n2 = "".concat(this._n, "._onInvitationModified"), o2 = e2.inviteID, i2 = e2.data; + M.l("".concat(n2, " inviteID:").concat(o2, " data:").concat(i2)), this._sigM.setInviteInfo(o2, y(y({}, e2), {}, { message: t2 })), this._sigM.emitEvent(Q.INVITATION_MODIFIED, { inviteID: o2, data: i2 }); + } }]), Dr), dr = (e(Tr, [{ key: "generateInviteID", value: function() { + var e2, t2 = (t2 = As)((e2 = ks)(32), 8) + "-" + t2(e2(16), 4) + "-" + t2(16384 | e2(12), 4) + "-" + t2(32768 | e2(14), 4) + "-" + t2(e2(48), 12); + return M.l("".concat(this._n, ".generateInviteID inviteID:").concat(t2)), t2; + } }, { key: "createInviteInfo", value: function(e2) { + var t2 = this.generateInviteID(), e2 = this.createInviteCustomData(y(y({}, e2), {}, { inviteID: t2 })), n2 = e2.groupID, o2 = e2.inviteeList, n2 = n2 || o2[0]; + return { customData: e2, message: this._sigM.createSignaling(e2, n2), inviteID: t2 }; + } }, { key: "_genBaseCustomData", value: function(e2) { + var t2 = e2.data, n2 = e2.inviteID, e2 = e2.groupID; + return { businessID: 1, timeout: 0, data: void 0 === t2 ? "" : t2, inviteID: void 0 === n2 ? "" : n2, groupID: void 0 === e2 ? "" : e2 }; + } }, { key: "createInviteCustomData", value: function(e2) { + var t2 = e2.userID, n2 = e2.timeout, n2 = void 0 === n2 ? 0 : n2, o2 = e2.groupID, o2 = void 0 === o2 ? "" : o2, i2 = this._sigM.getMyUserID(), i2 = y(y({}, this._genBaseCustomData(e2)), {}, { actionType: Q.ACTION_TYPE_INVITE, inviter: i2, inviteeList: o2 ? e2.inviteeList : [t2], timeout: n2 }); + return M.l("".concat(this._n, ".createInviteCustomData customData:"), i2), i2; + } }, { key: "createCancelCustomData", value: function(e2) { + var t2, n2 = "".concat(this._n, ".createCancelCustomData"), o2 = e2.inviteID, i2 = this._sigM.getMyUserID(), o2 = this._sigM.getInviteInfo(o2), a2 = o2.inviteeList, s2 = o2.groupID, o2 = o2.inviter; + return o2 === i2 ? t2 = y(y({}, this._genBaseCustomData(e2)), {}, { actionType: Q.ACTION_TYPE_CANCEL_INVITE, groupID: s2, inviter: i2, inviteeList: a2 }) : M.e("".concat(n2, " unmatched inviter:").concat(o2, " and my userID:").concat(i2)), M.l("".concat(n2, " customData:"), t2), t2; + } }, { key: "createAcceptCustomData", value: function(e2) { + var t2, n2 = "".concat(this._n, ".createAcceptCustomData"), o2 = e2.inviteID, i2 = this._sigM.getMyUserID(), a2 = this._sigM.getInviteInfo(o2), s2 = a2.inviter, r2 = a2.groupID; + return a2.inviteeList.includes(i2) ? t2 = y(y({}, this._genBaseCustomData(e2)), {}, { actionType: Q.ACTION_TYPE_ACCEPT_INVITE, groupID: r2, inviter: s2, inviteeList: [i2] }) : M.e("".concat(n2, " userID:").concat(i2, " not in inviteeList. inviteID:").concat(o2, " groupID:").concat(r2)), M.l("".concat(n2, " customData:"), t2), t2; + } }, { key: "createRejectCustomData", value: function(e2) { + var t2, n2 = "".concat(this._n, ".createRejectCustomData"), o2 = e2.inviteID, i2 = this._sigM.getMyUserID(), a2 = this._sigM.getInviteInfo(o2), s2 = a2.inviter, r2 = a2.groupID; + return a2.inviteeList.includes(i2) ? t2 = y(y({}, this._genBaseCustomData(e2)), {}, { actionType: Q.ACTION_TYPE_REJECT_INVITE, groupID: r2, inviter: s2, inviteeList: [i2] }) : M.e("".concat(n2, " userID:").concat(i2, " not in inviteeList. inviteID:").concat(o2, " groupID:").concat(r2)), M.l("".concat(n2, " customData:"), t2), t2; + } }, { key: "createTimeoutCustomData", value: function(e2) { + var t2 = "".concat(this._n, ".createTimeoutCustomData"), n2 = e2.inviteeList, o2 = e2.inviter, i2 = e2.isInviter, i2 = void 0 !== i2 && i2, a2 = this._sigM.getMyUserID(), e2 = y(y({}, this._genBaseCustomData(e2)), {}, { actionType: Q.ACTION_TYPE_INVITE_TIMEOUT, inviter: o2, inviteeList: i2 ? n2 : [a2] }); + return M.l("".concat(t2, " customData:"), e2), e2; + } }]), Tr), pr = (e(Cr, [{ key: "setCloudConfig", value: function() { + var e2 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : 20, t2 = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : 300; + this.COUNT = e2, this.EXPIRED_TIME = t2, M.l("".concat(this._n, ".setCloudConfig count:").concat(e2, ", time:").concat(t2)); + } }, { key: "getHistorySignaling", value: function() { + var t2 = this, e2 = this._sigM.get(11).getLocalConvList(); + S(e2) || (this._getC2CSignalingList(), e2 = this._getValidGroupConvList(e2), this._getGroupSignalingList(e2).then(function(e3) { + t2._handleSignalingList(e3); + })); + } }, { key: "_getC2CSignalingList", value: function() { + var e2 = this._sigM.get(6).getMessageListFromUnreadDB(), e2 = this._sigM.filterMessageList(e2); + this._getRelatedToMeMap(e2); + } }, { key: "_getGroupSignalingList", value: function(e2) { + var n2 = this, e2 = this._createPromiseList(e2); + return 0 === e2.length ? Promise.resolve(this._sortSignaling(this._relatedToMeMap)) : this._concurrentGetMessageList(e2).then(function(e3) { + var t2 = /* @__PURE__ */ new Map(); + return e3.forEach(function(e4) { + e4 = e4.list, e4 = n2._getRelatedToMeMap(e4); + t2 = new Map([].concat(p(t2), p(e4))); + }), n2._sortSignaling(t2); + }); + } }, { key: "_handleSignalingList", value: function(e2) { + S(e2) || this._sigM.onNewMessageList(e2); + } }, { key: "_getValidGroupConvList", value: function(e2) { + for (var t2 = [], n2 = 0, o2 = e2.length; n2 < o2; n2++) { + var i2 = e2[n2], a2 = i2.type, s2 = i2.unreadCount, i2 = i2.lastMessage, a2 = a2 === A.CONV_GROUP, i2 = this._isNotExpired(i2); + a2 && s2 && i2 && t2.push(e2[n2]); + } + return t2; + } }, { key: "_isNotExpired", value: function(e2) { + return !(!e2 || !e2.lastTime) && e2.lastTime > Be() - this.EXPIRED_TIME; + } }, { key: "_createPromiseList", value: function(e2) { + for (var t2 = [], n2 = 0; n2 < e2.length; n2++) { + var o2 = e2[n2], i2 = o2.conversationID, o2 = o2.unreadCount, o2 = o2 < this.COUNT ? o2 : this.COUNT, o2 = (this._map.set(i2, { msgCount: o2, list: [] }), this._sigM.get(11).getMessageList({ conversationID: i2 })); + t2.push(o2); + } + return t2; + } }, { key: "_concurrentGetMessageList", value: function(e2) { + var i2 = this, a2 = []; + return Promise.all(e2).then(function(e3) { + for (var t2 = 0; t2 < e3.length; t2++) { + var n2 = e3[t2], o2 = n2.code, n2 = n2.data; + 0 === o2 && 0 !== n2.messageList.length && (i2._handleMessageList(n2.messageList), o2 = i2._relayGetMessageList(n2)) && a2.push(o2); + } + return 0 < a2.length ? i2._concurrentGetMessageList(a2) : i2._map; + }); + } }, { key: "_relayGetMessageList", value: function(e2) { + var t2, n2 = e2.messageList, o2 = e2.nextReqMessageID, e2 = e2.isCompleted; + return 0 === n2.length || (n2 = n2[0].conversationID, 0 === (t2 = this._map.get(n2).msgCount)) || e2 ? null : this._sigM.get(11).getMessageList({ conversationID: n2, nextReqMessageID: o2, count: t2 }); + } }, { key: "_handleMessageList", value: function(e2) { + var t2 = e2.length, n2 = e2[0].conversationID, o2 = this._map.get(n2), i2 = o2.msgCount, o2 = o2.list; + this._map.set(n2, { msgCount: 0 < i2 - t2 ? i2 - t2 : 0, list: o2.concat(this._sigM.filterMessageList(e2)) }); + } }, { key: "_getRelatedToMeMap", value: function(e2) { + for (var t2 = 0; t2 < e2.length; t2++) { + var n2 = e2[t2]; + this._saveRelatedToMe(n2); + } + return this._relatedToMeMap; + } }, { key: "_saveRelatedToMe", value: function(e2) { + var t2 = this._sigM.getPayloadData(e2) || {}, n2 = t2.actionType, t2 = t2.inviteID, o2 = void 0 === t2 ? "" : t2; + switch (void 0 === n2 ? "" : n2) { + case Q.ACTION_TYPE_INVITE: + this._setHistoryInvite(e2); + break; + case Q.ACTION_TYPE_REJECT_INVITE: + case Q.ACTION_TYPE_ACCEPT_INVITE: + this._updateHistoryInvite(e2); + break; + case Q.ACTION_TYPE_CANCEL_INVITE: + this._delHistoryInvite(o2); + break; + case Q.ACTION_TYPE_INVITE_TIMEOUT: + this._updateHistoryInvite(e2); + } + } }, { key: "_setHistoryInvite", value: function(e2) { + var t2 = this._sigM.getPayloadData(e2) || {}, n2 = t2.inviteID, n2 = void 0 === n2 ? "" : n2, o2 = t2.inviteeList, o2 = void 0 === o2 ? [] : o2, i2 = t2.timeout, i2 = void 0 === i2 ? 0 : i2, a2 = this._sigM.getMyUserID(); + o2.includes(a2) && (o2 = Be() - e2.time, 0 < i2 && i2 < o2 && 0 !== i2 || this._relatedToMeMap.set(n2, y(y({}, t2), {}, { messageList: [e2] }))); + } }, { key: "_delHistoryInvite", value: function(e2) { + this._relatedToMeMap.has(e2) && this._relatedToMeMap.delete(e2); + } }, { key: "_updateHistoryInvite", value: function(e2) { + var t2 = this._sigM.getPayloadData(e2) || {}, n2 = t2.inviteID, n2 = void 0 === n2 ? "" : n2, t2 = t2.inviteeList, o2 = void 0 === t2 ? [] : t2; + if (this._relatedToMeMap.has(n2)) { + for (var t2 = this._relatedToMeMap.get(n2), i2 = t2.inviteeList, t2 = t2.messageList, a2 = 0; a2 < o2.length; a2++) { + var s2 = o2[a2]; + i2.includes(s2) && i2.splice(i2.indexOf(s2), 1); + } + 0 === i2.length ? this._delHistoryInvite(n2) : t2.push(e2); + } else + this._delHistoryInvite(n2); + } }, { key: "_sortSignaling", value: function(e2) { + var t2 = []; + return e2.forEach(function(e3) { + t2 = [].concat(p(t2), p(e3.messageList)); + }), t2.sort(function(e3, t3) { + return e3.time - t3.time; + }); + } }, { key: "reset", value: function() { + this._map.clear(), this._relatedToMeMap.clear(); + } }]), Cr), _r = e(function e2(t2, n2) { + d(this, e2), this.businessID = t2.businessID || 1, this.inviteID = t2.inviteID, this.groupID = t2.groupID || "", this.inviter = t2.inviter || "", this.inviteeList = t2.inviteeList || [], this.data = t2.data || "", this.actionType = t2.actionType || Q.ACTION_TYPE_INVITE, this.timeout = t2.timeout || 0; + }), hr = ["message"], gr = ["message"], fr = (t(yr, u), Os = n(yr), e(yr, [{ key: "onC2CUnreadHandleCompleted", value: function() { + this._isC2CUnreadHandleCompleted = true, this._isCloudConfigCompleted && this._isConvSyncCompleted && !this._isSyncCompleted && this.onReady(); + } }, { key: "onConvSyncCompleted", value: function() { + this._isConvSyncCompleted = true, this._isC2CUnreadHandleCompleted && this._isCloudConfigCompleted && !this._isSyncCompleted && this.onReady(); + } }, { key: "onCloudConfig", value: function() { + this._isCloudConfigCompleted = true; + var e2 = this.getCloudConfig("history_s_count"), t2 = this.getCloudConfig("history_s_time"); + N(e2) || (e2 = Number(e2)), N(t2) || (t2 = Number(t2)), this._historySignalingHandler.setCloudConfig(e2, t2), this._isC2CUnreadHandleCompleted && this._isConvSyncCompleted && !this._isSyncCompleted && this.onReady(); + } }, { key: "_isListenerExisted", value: function() { + return -1 < this._m.getOEmitInst().eventNames().indexOf(Q.NEW_INVITATION_RECEIVED); + } }, { key: "onReady", value: function() { + this._isSyncCompleted = true; + var e2 = this._isListenerExisted(); + M.l("".concat(this._n, ".onReady. isListenerExisted: ").concat(e2)), e2 && this._historySignalingHandler.getHistorySignaling(); + } }, { key: "onNewMessageList", value: function(e2) { + e2 = this.filterMessageList(e2); + if (0 < e2.length) + return this._remoteSignalingHandler.onNewMessageList(e2); + } }, { key: "onMessageModified", value: function(e2) { + e2 = this.filterMessageList(e2); + if (0 < e2.length) + return this._remoteSignalingHandler.onMessageModified(e2); + } }, { key: "hasInviteInfo", value: function(e2) { + return this._inviteInfoMap.has(e2); + } }, { key: "getInviteInfo", value: function(e2) { + return this._inviteInfoMap.get(e2); + } }, { key: "setInviteInfo", value: function(e2, t2) { + var n2 = t2.message, t2 = K(t2, hr); + M.l("".concat(this._n, ".setInviteInfo inviteID:").concat(e2, " data:"), t2), this._inviteInfoMap.set(e2, y(y({}, t2), {}, { message: n2 })); + } }, { key: "deleteInviteInfo", value: function(e2) { + this.hasInviteInfo(e2) && (M.l("".concat(this._n, ".deleteInviteInfo inviteID:").concat(e2, ".")), this._inviteInfoMap.delete(e2)); + } }, { key: "updateInviteInfo", value: function(e2) { + var t2 = "".concat(this._n, ".updateInviteInfo"), n2 = e2.inviteID, o2 = e2.inviter, i2 = e2.inviteeList, e2 = e2.groupID; + M.l("".concat(t2, " inviteID:").concat(n2, " inviter:").concat(o2, " groupID:").concat(e2)), e2 && this.hasInviteInfo(n2) && (o2 = i2[0], (e2 = this.getInviteInfo(n2).inviteeList).includes(o2) && (e2.splice(e2.indexOf(o2), 1), M.l("".concat(t2, " remove ").concat(o2, ". localInviteeList.length:").concat(e2.length))), 0 !== e2.length) || this.deleteInviteInfo(n2); + } }, { key: "canIUseSignaling", value: function() { + return this._canIUseSignaling; + } }, { key: "emitEvent", value: function(e2, t2) { + this.emitOEvt(e2, t2); + } }, { key: "addSignalingListener", value: function(e2, t2, n2) { + this._canIUseSignaling || (this._canIUseSignaling = true), this._m.getOEmitInst().on(e2, t2, n2); + } }, { key: "removeSignalingListener", value: function(e2, t2, n2) { + this._m.getOEmitInst().off(e2, t2, n2), this._isListenerExisted() || (this._canIUseSignaling = false); + } }, { key: "invite", value: function(e2) { + var t2 = this, n2 = "".concat(this._n, ".").concat("invite"), o2 = this._localSignalingHandler.createInviteInfo(e2), i2 = o2.message, a2 = o2.customData, s2 = o2.inviteID; + return M.l("".concat(n2, " options:").concat(JSON.stringify(e2), " inviteID:").concat(s2)), this.sendSignaling(i2, e2).then(function(e3) { + return e3 && 0 === e3.code ? (t2.setInviteInfo(s2, y(y({}, a2), {}, { message: i2 })), t2.startTimer(y(y({}, a2), {}, { inviteID: s2 })), y(y({}, e3), {}, { inviteID: s2 })) : e3; + }).catch(function(e3) { + return D(e3); + }); + } }, { key: "inviteSync", value: function(e2, t2, n2) { + var o2 = this, i2 = "".concat(this._n, ".").concat("inviteSync"), a2 = this._localSignalingHandler.createInviteInfo(e2), s2 = a2.message, r2 = a2.customData, c2 = a2.inviteID; + return M.l("".concat(i2, " options:").concat(JSON.stringify(e2), " inviteID:").concat(c2)), this.sendSignaling(s2, e2).then(function(e3) { + if (e3 && 0 === e3.code) + return o2.setInviteInfo(c2, y(y({}, r2), {}, { message: s2 })), o2.startTimer(y(y({}, r2), {}, { inviteID: c2 })), t2 && t2({ inviteID: c2 }), { inviteID: c2 }; + n2 && n2(0 === e3.code, e3.message || ""); + }).catch(function(e3) { + return n2 && n2(e3.code, e3.message), D(e3); + }), c2; + } }, { key: "_handleImResponse", value: function(e2, t2, n2) { + t2 && 0 === t2.code && (this._isHandling = false, n2 ? this.deleteInviteInfo(e2.inviteID) : this.updateInviteInfo(e2)); + } }, { key: "cancel", value: function(t2) { + var n2 = this, e2 = "".concat(this._n, ".").concat("cancel"); + if (M.l("".concat(e2, " options:").concat(JSON.stringify(t2))), !this.hasInviteInfo(t2.inviteID) || this._isHandling) + return D({ code: L.INVALID_CANCEL_MESSAGE }); + this._isHandling = true; + var o2, i2 = this._localSignalingHandler.createCancelCustomData(t2); + return i2 ? (e2 = i2.groupID, o2 = i2.inviteeList, e2 = e2 || o2[0], o2 = this.createSignaling(i2, e2), this.sendSignaling(o2, t2).then(function(e3) { + return n2._handleImResponse(i2, e3, true), 0 === e3.code ? y(y({}, e3), {}, { inviteID: t2.inviteID }) : e3; + }).catch(function(e3) { + return D(e3); + })) : (this._isHandling = false, D({ code: L.SIGNALING_NO_PERMISSION })); + } }, { key: "accept", value: function(t2) { + var n2 = this, e2 = "".concat(this._n, ".").concat("accept"); + if (M.l("".concat(e2, " options:").concat(JSON.stringify(t2))), !this.hasInviteInfo(t2.inviteID) || this._isHandling) + return D({ code: L.SIGNALING_INVALID_INVITE_ID }); + this._isHandling = true; + var o2 = this._localSignalingHandler.createAcceptCustomData(t2); + return o2 ? (e2 = this.createSignaling(o2), this.sendSignaling(e2, t2).then(function(e3) { + return n2._handleImResponse(o2, e3), 0 === e3.code ? y(y({}, e3), {}, { inviteID: t2.inviteID }) : e3; + }).catch(function(e3) { + return D(e3); + })) : (this._isHandling = false, D({ code: L.SIGNALING_NO_PERMISSION })); + } }, { key: "reject", value: function(t2) { + var n2 = this, e2 = "".concat(this._n, ".").concat("reject"); + if (M.l("".concat(e2, " options:").concat(JSON.stringify(t2))), !this.hasInviteInfo(t2.inviteID) || this._isHandling) + return D({ code: L.SIGNALING_INVALID_INVITE_ID }); + this._isHandling = true; + var o2 = this._localSignalingHandler.createRejectCustomData(t2); + return o2 ? (e2 = this.createSignaling(o2), this.sendSignaling(e2, t2).then(function(e3) { + return n2._handleImResponse(o2, e3, true), 0 === e3.code ? y(y({}, e3), {}, { inviteID: t2.inviteID }) : e3; + }).catch(function(e3) { + return D(e3); + })) : (this._isHandling = false, D({ code: L.SIGNALING_NO_PERMISSION })); + } }, { key: "getSignalingInfo", value: function(e2) { + var t2 = "".concat(this._n, ".getSignalingInfo"), n2 = e2.ID, o2 = e2.from, i2 = e2.to, a2 = this._filterSignaling(e2), s2 = null, e2 = (a2 && (e2 = this.getPayloadData(e2), s2 = new _r(e2)), a2 ? "actionType:".concat(s2.actionType) : ""); + return M.l("".concat(t2, " messageID:").concat(n2, " from:").concat(o2, " to:").concat(i2, " ") + "".concat(e2, " isSignaling:").concat(a2)), s2; + } }, { key: "modifyInvitation", value: function(e2) { + var t2 = this, n2 = e2.inviteID, o2 = e2.data; + if (!this.hasInviteInfo(e2.inviteID) || this._isHandling) + return D({ code: L.SIGNALING_INVALID_INVITE_ID }); + this._isHandling = true; + var e2 = this.getInviteInfo(n2), i2 = e2.message, a2 = K(e2, gr), s2 = i2.payload.data; + return a2.data = o2, i2.payload.data = JSON.stringify(a2), this.get(2).modifyRemoteMessage(i2).then(function(e3) { + return t2.setInviteInfo(n2, y(y({}, a2), {}, { message: i2 })), t2._isHandling = false, e3; + }).catch(function(e3) { + return t2._isHandling = false, i2.payload.data = s2, D(e3); + }); + } }, { key: "_genMsgCtrlInfo", value: function() { + var e2 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {}, t2 = e2.data, t2 = void 0 === t2 ? "" : t2, n2 = e2.onlineUserOnly, o2 = e2.inviteID, o2 = void 0 === o2 ? "" : o2, i2 = e2.offlinePushInfo, e2 = e2.actionType, a2 = { _onlineOnlyFlag: false }, o2 = { onlineUserOnly: (a2 = o2 && this.getInviteInfo(o2) ? this.getInviteInfo(o2).message : a2)._onlineOnlyFlag || n2 || false, offlinePushInfo: i2, messageControlInfo: { excludedFromContentModeration: true, excludedFromUnreadCount: false, excludedFromLastMessage: false } }; + return e2 === Q.ACTION_TYPE_INVITE_TIMEOUT ? (a2 = !!t2.match(/excludeTimeoutSignalingFromHistoryMessage/), o2.messageControlInfo.excludedFromUnreadCount = a2, o2.messageControlInfo.excludedFromLastMessage = a2) : (n2 = !!t2.match(/excludeFromHistoryMessage/), i2 = !!t2.match(/excludeOriginalSignalingFromHistoryMessage/), o2.messageControlInfo.excludedFromUnreadCount = n2 || i2, o2.messageControlInfo.excludedFromLastMessage = n2 || i2), o2; + } }, { key: "sendSignaling", value: function(e2, t2) { + var n2 = this; + return this.get(2).sendMessageInstance(e2, this._genMsgCtrlInfo(t2)).catch(function(e3) { + return n2._isHandling = false, D(e3); + }); + } }, { key: "filterMessageList", value: function(e2) { + var t2 = this; + return e2.filter(function(e3) { + return t2._filterSignaling(e3); + }); + } }, { key: "getPayloadData", value: function(e2) { + return this._remoteSignalingHandler.getPayloadData(e2); + } }, { key: "createSignaling", value: function(e2, t2) { + var n2 = e2.groupID, o2 = e2.inviter, t2 = { to: t2 || n2 || o2, conversationType: n2 ? A.CONV_GROUP : A.CONV_C2C, priority: A.MSG_PRIORITY_HIGH, payload: { data: JSON.stringify(e2) } }, o2 = this.get(2).createCustomMessage(t2); + return M.l("".concat(this._n, ".createSignaling. message:"), o2), o2; + } }, { key: "_filterSignaling", value: function(e2) { + var t2, n2, o2 = false; + return e2.type && e2.type === A.MSG_CUSTOM && (t2 = e2.cloudCustomData, e2 = void 0 === (e2 = e2.payload.data) ? "" : e2, t2 = (void 0 === t2 ? "" : t2).match(/"type":"tsignaling"/), n2 = e2.match(/inviteID/), e2 = e2.match(/actionType/), o2 = t2 || n2 && e2), !!o2; + } }, { key: "startTimer", value: function(t2) { + var n2, o2, i2, a2 = this, s2 = "".concat(this._n, ".startTimer"), e2 = t2.timeout, r2 = t2.inviteID, c2 = t2.inviter, u2 = t2.groupID, l2 = c2 === this.getMyUserID(); + M.l("".concat(s2, " timeout:").concat(e2, " isInviter:").concat(l2, " groupID:").concat(u2)), e2 <= 0 || (n2 = l2 ? e2 + 5 : e2, o2 = 1, i2 = setInterval(function() { + var e3 = a2._hasLocalInviteInfo(t2, l2); + o2 < n2 && e3 ? ++o2 : (e3 && a2._sendTimeoutNotice(r2, l2), M.l("".concat(s2, " end.")), clearInterval(i2)); + }, 1e3)); + } }, { key: "_hasLocalInviteInfo", value: function(e2, t2) { + var n2, o2, i2 = e2.inviteID, e2 = e2.groupID; + return !!this.hasInviteInfo(i2) && (n2 = "".concat(this._n, "._hasLocalInviteInfo"), o2 = this.getInviteInfo(i2).inviteeList, M.l("".concat(n2, " inviteID:").concat(i2, " inviteeList:").concat(o2, " groupID:").concat(e2)), !e2 || (t2 ? 0 < o2.length : 0 < o2.length && o2.includes(this.getMyUserID()))); + } }, { key: "_getReceiver", value: function(e2, t2) { + var n2 = t2.groupID, o2 = t2.inviteeList, t2 = t2.inviter; + return e2 ? n2 || o2[0] : n2 || t2; + } }, { key: "_sendTimeoutNotice", value: function(i2, a2) { + var s2 = this, e2 = this.getInviteInfo(i2), t2 = this._getReceiver(a2, e2), r2 = (M.l("".concat(this._n, "._sendTimeoutNotice inviteID:").concat(i2, " to:").concat(t2, " isInviter:").concat(a2)), this._localSignalingHandler.createTimeoutCustomData(y(y({}, e2), {}, { isInviter: a2 }))), c2 = this.createSignaling(r2, t2); + return this.sendSignaling(c2, r2).then(function(e3) { + var t3, n2, o2; + e3 && 0 === e3.code && (e3 = r2.data, t3 = r2.groupID, n2 = r2.inviteeList, o2 = r2.inviter, s2.emitEvent(Q.INVITATION_TIMEOUT, { data: e3, groupID: t3, inviteID: i2, inviteeList: n2, inviter: o2, isSelfTimeout: true, message: c2 }), a2 ? s2.deleteInviteInfo(i2) : s2.updateInviteInfo(r2)); + }); + } }, { key: "reset", value: function() { + M.l("".concat(this._n, ".reset")), this._inviteInfoMap.clear(), this._canIUseSignaling = false, this._isHandling = false, this._historySignalingHandler.reset(), this._isC2CUnreadHandleCompleted = false, this._isConvSyncCompleted = false, this._isSyncCompleted = false, this._isCloudConfigCompleted = false; + } }]), yr), mr = ["followDiffList"], vr = { NONE: 0, FOLLOWERS: 1, FOLLOWING: 2, MUTUAL: 3 }, Ir = (t(Mr, u), Rs = n(Mr), e(Mr, [{ key: "_onCloudConfig", value: function() { + var e2 = this.getCloudConfig("follow_req_count"); + N(e2) || (e2 = Number(e2), this.DEFAULT_COUNT = e2 > this.MAX_COUNT ? this.MAX_COUNT : e2, this._clearFollowList()); + } }, { key: "clearCacheOnReconnected", value: function() { + this._clearFollowList(), this._followType.clear(); + } }, { key: "onFollowNotify", value: function(e2) { + var i2 = this, e2 = e2.dataList || []; + M.l("".concat(this._n, ".onFollowNotify followChangeList:").concat(e2.length)), e2.forEach(function(e3) { + var t2 = e3.followDiffList, t2 = void 0 === t2 ? [] : t2, o2 = K(e3, mr); + t2.forEach(function(e4) { + var t3 = e4.isAdd, e4 = e4.followType, e4 = void 0 === e4 ? [] : e4, n2 = i2._initFollowInfo(); + n2[e4].userInfoList.push(o2), n2[e4].isAdd = 1 === t3, i2._emitEvent(n2); + }); + }); + } }, { key: "_initFollowInfo", value: function() { + var t2 = {}; + return Object.values(vr).forEach(function(e2) { + e2 !== vr.NONE && (t2[e2] = { userInfoList: [], isAdd: false }); + }), t2; + } }, { key: "_emitEvent", value: function(n2) { + var o2 = this; + Object.keys(n2).forEach(function(e2) { + var e2 = Number(e2), t2 = n2[e2]; + 0 < t2.userInfoList.length && (e2 === vr.FOLLOWERS && (o2._clearFollowList(vr.FOLLOWERS), o2.emitOEvt(h.MY_FOLLOWERS_LIST_UPDATED, t2)), e2 === vr.FOLLOWING && (o2._clearFollowList(vr.FOLLOWING), o2.emitOEvt(h.MY_FOLLOWING_LIST_UPDATED, t2)), e2 === vr.MUTUAL) && (o2._clearFollowList(vr.MUTUAL), o2.emitOEvt(h.MUTUAL_FOLLOWERS_LIST_UPDATED, t2)); + }); + } }, { key: "followUser", value: function(e2) { + var t2, n2, o2; + return this.canIUse(_.FOLLOW) ? (t2 = "".concat(this._n, ".").concat("followUser"), n2 = "userIDList:".concat(e2.length), (o2 = new G("followUser")).setMessage(n2), M.l("".concat(t2, " ").concat(n2)), this.req({ P: k.FOLLOW, data: { fromAccount: this.getMyUserID(), userIDList: e2.map(function(e3) { + return { userID: e3 }; + }) } }).then(function(e3) { + return o2.end(), M.l("".concat(t2, " ok.")), C(e3.data.resultList); + }).catch(function(e3) { + return o2.setError(e3).end(), M.e("".concat(t2, " failed. error:"), e3), D(e3); + })) : this.noUse("followUser"); + } }, { key: "unfollowUser", value: function(e2) { + var t2, n2, o2; + return this.canIUse(_.FOLLOW) ? (t2 = "".concat(this._n, ".").concat("unfollowUser"), n2 = "userIDList:".concat(e2.length), (o2 = new G("unfollowUser")).setMessage(n2), M.l("".concat(t2, " ").concat(n2)), this.req({ P: k.UNFOLLOW, data: { fromAccount: this.getMyUserID(), userIDList: e2 } }).then(function(e3) { + return o2.end(), M.l("".concat(t2, " ok.")), C(e3.data.resultList); + }).catch(function(e3) { + return o2.setError(e3).end(), M.e("".concat(t2, " failed. error:"), e3), D(e3); + })) : this.noUse("unfollowUser"); + } }, { key: "getMyFollowersList", value: function() { + var t2 = this, n2 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : "", o2 = "getMyFollowersList"; + if (!this.canIUse(_.FOLLOW)) + return this.noUse(o2); + var i2 = n2 || this.FIRST_PAGE_INDEX; + if (this._myFollowersList.has(i2)) { + var e2 = this._myFollowersList.get(i2), a2 = e2.resultList, s2 = e2.nextCursor, e2 = e2.lastUpdateTime; + if (Date.now() - e2 < this.MAX_CATCH_TIME && 0 < a2.length) + return M.l("".concat(this._n, ".").concat(o2, " nextCursor:").concat(n2, " from local.")), T({ resultList: a2, nextCursor: s2 }); + } + return this._getFollowList(n2, vr.FOLLOWERS).then(function(e3) { + return t2._myFollowersList.set(i2, y(y({}, e3), {}, { lastUpdateTime: Date.now() })), M.l("".concat(t2._n, ".").concat(o2, " nextCursor:").concat(n2, " from remote.")), C(e3); + }); + } }, { key: "getMyFollowingList", value: function() { + var t2 = this, n2 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : "", o2 = "getMyFollowingList"; + if (!this.canIUse(_.FOLLOW)) + return this.noUse(o2); + var i2 = n2 || this.FIRST_PAGE_INDEX; + if (this._myFollowingList.has(i2)) { + var e2 = this._myFollowingList.get(i2), a2 = e2.resultList, s2 = e2.nextCursor, e2 = e2.lastUpdateTime; + if (Date.now() - e2 < this.MAX_CATCH_TIME && 0 < a2.length) + return M.l("".concat(this._n, ".").concat(o2, " nextCursor:").concat(n2, " from local.")), T({ resultList: a2, nextCursor: s2 }); + } + return this._getFollowList(n2, vr.FOLLOWING).then(function(e3) { + return t2._myFollowingList.set(i2, y(y({}, e3), {}, { lastUpdateTime: Date.now() })), M.l("".concat(t2._n, ".").concat(o2, " nextCursor:").concat(n2, " from remote.")), C(e3); + }); + } }, { key: "getMutualFollowersList", value: function() { + var t2 = this, n2 = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : "", o2 = "getMutualFollowersList"; + if (!this.canIUse(_.FOLLOW)) + return this.noUse(o2); + var i2 = n2 || this.FIRST_PAGE_INDEX; + if (this._myMutualFollowersList.has(i2)) { + var e2 = this._myMutualFollowersList.get(i2), a2 = e2.resultList, s2 = e2.nextCursor, e2 = e2.lastUpdateTime; + if (Date.now() - e2 < this.MAX_CATCH_TIME && 0 < a2.length) + return M.l("".concat(this._n, ".").concat(o2, " nextCursor:").concat(n2, " from local.")), T({ resultList: a2, nextCursor: s2 }); + } + return this._getFollowList(n2, vr.MUTUAL).then(function(e3) { + return t2._myMutualFollowersList.set(i2, y(y({}, e3), {}, { lastUpdateTime: Date.now() })), M.l("".concat(t2._n, ".").concat(o2, " nextCursor:").concat(n2, " from remote.")), C(e3); + }); + } }, { key: "_getFollowList", value: function(e2, t2) { + var i2 = this, n2 = new G("_getFollowList"); + return n2.setMessage("nextCursor:".concat(e2, " type:").concat(t2)), this.req({ P: k.GET_FOLLOW, data: { fromAccount: this.getMyUserID(), count: this.DEFAULT_COUNT, nextCursor: e2, type: t2 } }).then(function(e3) { + n2.end(); + var e3 = e3.data, t3 = e3.resultList, t3 = void 0 === t3 ? [] : t3, e3 = e3.nextCursor, e3 = void 0 === e3 ? "" : e3, o2 = []; + return t3.forEach(function(e4) { + var t4 = e4.userID, n3 = e4.followTime, e4 = e4.profileList; + o2.push(y({ userID: t4, followTime: n3 }, i2._handleProfileItem(void 0 === e4 ? [] : e4))); + }), { resultList: o2, nextCursor: e3 }; + }).catch(function(e3) { + return n2.setError(e3).end(), M.e("".concat(i2._n, "._getFollowList failed. error:"), e3), D(e3); + }); + } }, { key: "_handleProfileItem", value: function(e2) { + var t2 = {}; + return e2.forEach(function(e3) { + switch (e3.tag) { + case g.NICK: + t2.nick = e3.value; + break; + case g.GENDER: + t2.gender = e3.value; + break; + case g.BIRTHDAY: + t2.birthday = e3.value; + break; + case g.LOCATION: + t2.location = e3.value; + break; + case g.SELFSIGNATURE: + t2.selfSignature = e3.value; + break; + case g.ALLOWTYPE: + t2.allowType = e3.value; + break; + case g.LANGUAGE: + t2.language = e3.value; + break; + case g.AVATAR: + t2.avatar = e3.value; + break; + case g.MESSAGESETTINGS: + t2.messageSettings = e3.value; + break; + case g.ADMINFORBIDTYPE: + t2.adminForbidType = e3.value; + break; + case g.LEVEL: + t2.level = e3.value; + break; + case g.ROLE: + t2.role = e3.value; + break; + default: + t2[e3.tag] = e3.value; + } + }), t2; + } }, { key: "getUserFollowInfo", value: function(e2) { + var t2, n2, i2; + return this.canIUse(_.FOLLOW) ? (n2 = false, N(e2 = e2) && (e2 = [this.getMyUserID()], n2 = true), t2 = "".concat(this._n, ".").concat("getUserFollowInfo"), n2 = "userIDList:".concat(e2.length, " isGetMyFollowInfo:").concat(n2), (i2 = new G("getUserFollowInfo")).setMessage(n2), M.l("".concat(t2, " ").concat(n2)), this.req({ P: k.GET_FOLLOW_INFO, data: { fromAccount: this.getMyUserID(), userIDList: e2 } }).then(function(e3) { + i2.end(), M.l("".concat(t2, " ok.")); + var e3 = e3.data.followInfoList, o2 = []; + return (void 0 === e3 ? [] : e3).forEach(function(e4) { + var t3 = e4.followersCount, n3 = e4.followingCount, e4 = e4.mutualFollowersCount; + o2.push({ followersCount: t3, followingCount: n3, mutualFollowersCount: e4 }); + }), C(o2); + }).catch(function(e3) { + return i2.setError(e3).end(), M.e("".concat(t2, " failed. error:"), e3), D(e3); + })) : this.noUse("getUserFollowInfo"); + } }, { key: "checkFollowType", value: function(e2) { + var n2 = this; + if (!this.canIUse(_.FOLLOW)) + return this.noUse("checkFollowType"); + 100 < e2.length && (e2 = e2.slice(0, 100), M.w("".concat(t2, " ").concat($t(100)))); + var t2 = "".concat(this._n, ".").concat("checkFollowType"), o2 = "userIDList length:".concat(e2.length, " "), i2 = new G("checkFollowType"), a2 = (i2.setMessage(o2), M.l("".concat(t2, " ").concat(o2)), []), s2 = []; + return e2.forEach(function(e3) { + var t3; + n2._followType.has(e3) ? (t3 = n2._followType.get(e3), a2.push({ userID: e3, followType: t3 })) : s2.push(e3); + }), M.l("".concat(t2, " from local count:").concat(a2.length, ", from remote count:").concat(s2.length, ".")), 0 === s2.length ? T(a2) : this.req({ P: k.CHECK_FOLLOW_TYPE, data: { fromAccount: this.getMyUserID(), userIDList: s2 } }).then(function(e3) { + i2.end(), M.l("".concat(t2, " ok.")); + e3 = e3.data.resultList; + return (void 0 === e3 ? [] : e3).forEach(function(e4) { + var t3 = e4.userID, e4 = e4.followType; + n2._setFollowType(t3, e4), a2.push({ userID: t3, followType: e4 }); + }), C(a2); + }).catch(function(e3) { + return i2.setError(e3).end(), M.e("".concat(t2, " failed. error:"), e3), D(e3); + }); + } }, { key: "_setFollowType", value: function(e2, t2) { + this._followType.set(e2, t2); + } }, { key: "_clearFollowList", value: function(e2) { + N(e2) ? (this._myFollowersList.clear(), this._myFollowingList.clear(), this._myMutualFollowersList.clear()) : e2 !== vr.FOLLOWERS ? e2 !== vr.FOLLOWING ? e2 === vr.MUTUAL && this._myMutualFollowersList.clear() : this._myFollowingList.clear() : this._myFollowersList.clear(); + } }, { key: "reset", value: function() { + M.l("".concat(this._n, ".reset")), this._clearFollowList(), this._followType.clear(); + } }]), Mr), ie = ma(function(e2, t2) { + var n2 = "undefined" != typeof Uint8Array && "undefined" != typeof Uint16Array && "undefined" != typeof Int32Array; + t2.assign = function(e3) { + for (var t3, n3, o3 = Array.prototype.slice.call(arguments, 1); o3.length; ) { + var i3 = o3.shift(); + if (i3) { + if ("object" !== b(i3)) + throw new TypeError(i3 + "must be non-object"); + for (var a2 in i3) + t3 = i3, n3 = a2, Object.prototype.hasOwnProperty.call(t3, n3) && (e3[a2] = i3[a2]); + } + } + return e3; + }, t2.shrinkBuf = function(e3, t3) { + return e3.length === t3 ? e3 : e3.subarray ? e3.subarray(0, t3) : (e3.length = t3, e3); + }; + var o2 = { arraySet: function(e3, t3, n3, o3, i3) { + if (t3.subarray && e3.subarray) + e3.set(t3.subarray(n3, n3 + o3), i3); + else + for (var a2 = 0; a2 < o3; a2++) + e3[i3 + a2] = t3[n3 + a2]; + }, flattenChunks: function(e3) { + for (var t3, n3, o3, i3 = 0, a2 = 0, s2 = e3.length; a2 < s2; a2++) + i3 += e3[a2].length; + for (o3 = new Uint8Array(i3), a2 = t3 = 0, s2 = e3.length; a2 < s2; a2++) + n3 = e3[a2], o3.set(n3, t3), t3 += n3.length; + return o3; + } }, i2 = { arraySet: function(e3, t3, n3, o3, i3) { + for (var a2 = 0; a2 < o3; a2++) + e3[i3 + a2] = t3[n3 + a2]; + }, flattenChunks: function(e3) { + return [].concat.apply([], e3); + } }; + t2.setTyped = function(e3) { + e3 ? (t2.Buf8 = Uint8Array, t2.Buf16 = Uint16Array, t2.Buf32 = Int32Array, t2.assign(t2, o2)) : (t2.Buf8 = Array, t2.Buf16 = Array, t2.Buf32 = Array, t2.assign(t2, i2)); + }, t2.setTyped(n2); + }); + function Mr(e2) { + return d(this, Mr), (e2 = Rs.call(this, e2))._n = "FollowModule", e2._myFollowersList = /* @__PURE__ */ new Map(), e2._myFollowingList = /* @__PURE__ */ new Map(), e2._myMutualFollowersList = /* @__PURE__ */ new Map(), e2._followType = /* @__PURE__ */ new Map(), e2.MAX_CATCH_TIME = 6e5, e2.FIRST_PAGE_INDEX = mt(), e2.DEFAULT_COUNT = 500, e2.MAX_COUNT = 1e3, e2.getIEmitInst().on(P.CLOUD_CONFIG, e2._onCloudConfig, i(e2)), e2; + } + function yr(e2) { + d(this, yr), (e2 = Os.call(this, e2))._n = "SignalingModule", e2._inviteInfoMap = /* @__PURE__ */ new Map(), e2._canIUseSignaling = false, e2._isHandling = false, e2._remoteSignalingHandler = new lr(i(e2)), e2._localSignalingHandler = new dr(i(e2)), e2._historySignalingHandler = new pr(i(e2)), e2._isC2CUnreadHandleCompleted = false, e2._isConvSyncCompleted = false, e2._isSyncCompleted = false, e2._isCloudConfigCompleted = false; + var t2 = e2.getIEmitInst(); + return t2.on(P.C2C_UNREAD_HANDLE_COMPLETED, e2.onC2CUnreadHandleCompleted, i(e2)), t2.on(P.CONV_SYNC_COMPLETED, e2.onConvSyncCompleted, i(e2)), t2.on(P.CLOUD_CONFIG, e2.onCloudConfig, i(e2)), e2; + } + function Cr(e2) { + d(this, Cr), this._n = "HistorySignalingHandler", this._sigM = e2, this.COUNT = 20, this.EXPIRED_TIME = 300, this._map = /* @__PURE__ */ new Map(), this._relatedToMeMap = /* @__PURE__ */ new Map(); + } + function Tr(e2) { + d(this, Tr), this._n = "LocalSignalingHandler", this._sigM = e2; + } + function Dr(e2) { + d(this, Dr), this._n = "RemoteSignalingHandler", this._sigM = e2; + } + function Er(e2) { + d(this, Er), this._m = e2, this._n = "ErrMsgModule", this.TIM_ERROR_ASSISTANCE = "tim_error_assistance", this.STORAGE_EXPIRES_TIME = 6048e5, this._map = /* @__PURE__ */ new Map(), this._init(); + } + function Lr(e2) { + d(this, Lr), this._m = e2, this._n = "TransCmdModule", this._TRTCCommandList = ["tui_room_svr.*", "callkit_records_svr.*", "room_engine_srv.*", "room_engine_http_srv.*", "room_engine_mic.*", "live_engine_srv.*", "live_engine_http_srv.*", "live_engine_pk.*", "trtc_ai_service.*"], this._TRTCCommandMap = /* @__PURE__ */ new Map(), this._setTRTCCommandMap(), this._m.getIEmitInst().on(P.CLOUD_CONFIG, this._onCloudConfig, this); + } + function Sr(e2) { + return d(this, Sr), (e2 = Ns.call(this, e2))._n = "ProfanityFilterModule", e2._plugin = null, e2._filterConfigMap = /* @__PURE__ */ new Map(), e2._startIndex = 0, e2._version = 0, e2._canIUseLexicon = false, e2._isFetching = false, e2._expiredTime = 0, e2; + } + function kr(e2) { + var t2; + return d(this, kr), (t2 = Gs.call(this, e2))._m = e2, t2._n = "TIMPushModule", t2._pluginName = "TIMPush", t2._pushPlugin = void 0, t2._androidPushConfig = {}, t2._deviceToken = "", t2._businessID = 0, t2._iOSBusinessID = 0, t2._c2cUnreadCount = 0, t2._groupUnreadCount = 0, t2._isWebUniapp = 0, t2._deviceInfo = { notificationStatus: 0, deviceModel: "", systemVersion: "", pushVersion: "1.0.1", packageName: "" }, t2; + } + function Ar(e2) { + var t2; + return d(this, Ar), (t2 = Ps.call(this, e2))._m = e2, t2._n = "OfflinePushModule", t2._offlinePushPlugin = void 0, t2._androidPushConfig = { huaweiPushBussinessId: "", xiaomiPushBussinessId: "", xiaomiPushAppId: "", xiaomiPushAppKey: "", meizuPushBussinessId: "", meizuPushAppId: "", meizuPushAppKey: "", vivoPushBussinessId: "", fcmPushBussinessId: "", oppoPushBussinessId: "", oppoPushAppKey: "", oppoPushAppSecret: "", honorPushBussinessId: "" }, t2._deviceToken = "", t2._businessID = 0, t2._iosBusinessID = 0, t2._c2cUnreadCount = 0, t2._groupUnreadCount = 0, t2._isWebUniapp = 0, t2; + } + function Rr(e2) { + d(this, Rr), this._m = e2, this._n = "CommercialConfigModule", this._expiredTime = 0, this._isFetching = false, this._purchasedFeatureHandler = new or(this); + } + function Or(e2) { + d(this, Or), this._commercialConfigM = e2, this._n = "PurchasedFeatureHandler", this._isSCMReported = false, this._featureMap = /* @__PURE__ */ new Map(); + } + function Nr(e2) { + return d(this, Nr), (e2 = Us.call(this, e2))._n = "WorkerTimerModule", e2._isWorkerEnabled = true, e2._workerTimer = null, e2._timerID = -1, e2._init(), e2.getIEmitInst().on(P.CLOUD_CONFIG, e2._onCloudConfig, i(e2)), e2; + } + function Gr(e2) { + return d(this, Gr), (e2 = bs.call(this, e2))._n = "SnsModule", e2._friendHandler = new Qs(i(e2)), e2._friendApplicationHandler = new Xs(i(e2)), e2._friendGroupHandler = new er(i(e2)), e2.getIEmitInst().on(P.A2KEY_AND_TINYID_UPDATED, e2.onContextUpdated, i(e2)), e2; + } + function Pr(e2) { + d(this, Pr), this._snsM = e2, this._n = "FriendGroupHandler", this._map = /* @__PURE__ */ new Map(); + } + function Ur(e2) { + d(this, Ur), S(e2) || (this.name = e2.name || "", this.userIDList = e2.userIDList || [], this.count = this.userIDList.length || 0); + } + function br(e2) { + d(this, br), this._snsM = e2, this._n = "FriendHandler", this._map = /* @__PURE__ */ new Map(), this._startIdx = 0, this._standardSeq = 0, this._customSeq = 0, this._expirationTime = 18e4; + } + function wr(e2, t2) { + d(this, wr), this.userID = e2, this.remark = "", this.groupList = [], this.source = "", this.addTime = 0, this.friendCustomField = [], this.timestamp = 0; + var n2 = {}, o2 = []; + if (n2.userID = e2, !S(t2)) + for (var i2, a2 = "", s2 = 0, r2 = t2.length; s2 < r2; s2++) + if (a2 = t2[s2].tag, i2 = t2[s2].value, -1 < a2.indexOf("Tag_SNS_Custom")) + this.friendCustomField.push({ key: a2, value: i2 }); + else if (-1 < a2.indexOf("Tag_Profile_Custom")) + o2.push({ key: a2, value: i2 }); + else + switch (a2) { + case g.NICK: + n2.nick = i2; + break; + case g.GENDER: + n2.gender = i2; + break; + case g.BIRTHDAY: + n2.birthday = i2; + break; + case g.LOCATION: + n2.location = i2; + break; + case g.SELFSIGNATURE: + n2.selfSignature = i2; + break; + case g.ALLOWTYPE: + n2.allowType = i2; + break; + case g.LANGUAGE: + n2.language = i2; + break; + case g.AVATAR: + n2.avatar = i2; + break; + case g.MESSAGESETTINGS: + n2.messageSettings = i2; + break; + case g.ADMINFORBIDTYPE: + n2.adminForbidType = i2; + break; + case g.LEVEL: + n2.level = i2; + break; + case g.ROLE: + n2.role = i2; + break; + case Ze.REMARK: + this.remark = i2; + break; + case Ze.ADDTIME: + this.addTime = i2; + break; + case Ze.GROUP: + this.groupList = JSON.parse(JSON.stringify(i2)); + break; + case Ze.ADDSOURCE: + this.source = i2; + break; + case Ze.ADDWORDING: + break; + default: + M.l("snsProfileItem unknown tag->", t2[s2].tag); + } + this.profile = new ei(y(y({}, n2), {}, { profileCustomField: o2 })); + } + function Fr(e2) { + d(this, Fr), this._snsM = e2, this._n = "FriendApplicationHandler", this._startTime = 0, this._maxLimited = 100, this._currentSeq = 0, this._map = /* @__PURE__ */ new Map(), this._unreadCount = 0; + } + function qr(e2) { + d(this, qr), (e2 = ws.call(this, e2))._n = "QualityStatModule", e2.TAG = "im-ssolog-quality-stat", e2.reportIndex = 0, e2.wholePeriod = false, e2._qualityItems = [xn, Vn, Hn, Bn, Kn, Yn, Wn, jn, Jn, zn], e2._messageSentItems = [Hn, Bn, Kn, Yn, Wn], e2._messageReceivedItems = [jn, Jn, zn], e2.REPORT_INTERVAL = 120, e2.REPORT_SDKAPPID_BLACKLIST = [], e2.REPORT_TINYID_WHITELIST = [], e2._statInfoArr = [], e2._avgRTT = new Ys(), e2._avgE2EDelay = new Ks(), e2._rateMessageSent = new Ws(), e2._rateMessageReceived = new js(); + var t2 = e2.getIEmitInst(); + return t2.on(P.A2KEY_AND_TINYID_UPDATED, e2._onLoginSuccess, i(e2)), t2.on(P.CLOUD_CONFIG, e2._onCloudConfig, i(e2)), e2; + } + function xr() { + d(this, xr), this._lastMap = /* @__PURE__ */ new Map(), this._currentMap = /* @__PURE__ */ new Map(); + } + function Vr() { + d(this, Vr), this._map = /* @__PURE__ */ new Map(); + } + function Hr() { + d(this, Hr), this._n = "AvgRTT", this._requestCount = 0, this._rttArray = []; + } + function Br() { + d(this, Br), this._n = "AvgE2EDelay", this._e2eDelayArray = []; + } + function Kr(e2) { + return d(this, Kr), (e2 = Fs.call(this, e2))._n = "RecoverMsgModule", e2.PULL_LIMIT_COUNT = 15, e2; + } + function Yr(e2) { + return d(this, Yr), (e2 = qs.call(this, e2))._n = "CloudControlModule", e2._cloudConfig = /* @__PURE__ */ new Map(), e2._expiredTime = 0, e2._version = 0, e2._isFetching = false, e2; + } + function Wr(e2) { + return d(this, Wr), (e2 = xs.call(this, e2))._n = "SessionModule", e2._platform = e2.getPlatform(), e2._pHandler = new hs(i(e2)), e2._msgDispatcher = new fs(i(e2)), e2._cmdFreqLimitMap = /* @__PURE__ */ new Map(), e2._cmdReqInfoMap = /* @__PURE__ */ new Map(), e2._serverOverloadInfoMap = /* @__PURE__ */ new Map(), e2._incrementalPullContactFlag = true, e2._init(), e2.getIEmitInst().on(P.CLOUD_CONFIG, e2._onCloudConfig, i(e2)), e2; + } + ie.assign, ie.shrinkBuf, ie.setTyped, ie.Buf8, ie.Buf16, ie.Buf32; + function jr(e2, t2, n2, o2) { + for (var i2 = 65535 & e2 | 0, a2 = e2 >>> 16 & 65535 | 0, s2 = 0; 0 !== n2; ) { + for (n2 -= s2 = 2e3 < n2 ? 2e3 : n2; a2 = a2 + (i2 = i2 + t2[o2++] | 0) | 0, --s2; ) + ; + i2 %= 65521, a2 %= 65521; + } + return i2 | a2 << 16 | 0; + } + function Jr(e2, t2, n2, o2) { + var i2 = Xr, a2 = o2 + n2; + e2 ^= -1; + for (var s2 = o2; s2 < a2; s2++) + e2 = e2 >>> 8 ^ i2[255 & (e2 ^ t2[s2])]; + return -1 ^ e2; + } + function zr(e2, t2, n2, o2, i2, a2, s2, r2) { + for (var c2, u2, l2, d2, p2, _2, h2, g2, f2, m2 = r2.bits, v2 = 0, I2 = 0, M2 = 0, y2 = 0, C2 = 0, T2 = 0, D2 = 0, E2 = 0, L2 = 0, S2 = 0, k2 = null, A2 = 0, R2 = new ie.Buf16(16), O2 = new ie.Buf16(16), N2 = null, G2 = 0, v2 = 0; v2 <= 15; v2++) + R2[v2] = 0; + for (I2 = 0; I2 < o2; I2++) + R2[t2[n2 + I2]]++; + for (C2 = m2, y2 = 15; 1 <= y2 && 0 === R2[y2]; y2--) + ; + if (y2 < C2 && (C2 = y2), 0 === y2) + i2[a2++] = 20971520, i2[a2++] = 20971520, r2.bits = 1; + else { + for (M2 = 1; M2 < y2 && 0 === R2[M2]; M2++) + ; + for (C2 < M2 && (C2 = M2), v2 = E2 = 1; v2 <= 15; v2++) + if ((E2 = (E2 << 1) - R2[v2]) < 0) + return -1; + if (0 < E2 && (0 === e2 || 1 !== y2)) + return -1; + for (O2[1] = 0, v2 = 1; v2 < 15; v2++) + O2[v2 + 1] = O2[v2] + R2[v2]; + for (I2 = 0; I2 < o2; I2++) + 0 !== t2[n2 + I2] && (s2[O2[t2[n2 + I2]]++] = I2); + if (_2 = 0 === e2 ? (k2 = N2 = s2, 19) : 1 === e2 ? (k2 = Zr, A2 -= 257, N2 = Qr, G2 -= 257, 256) : (k2 = $r, N2 = ec, -1), v2 = M2, p2 = a2, D2 = I2 = S2 = 0, l2 = -1, d2 = (L2 = 1 << (T2 = C2)) - 1, 1 === e2 && 852 < L2 || 2 === e2 && 592 < L2) + return 1; + for (; ; ) { + for (f2 = s2[I2] < _2 ? (g2 = 0, s2[I2]) : s2[I2] > _2 ? (g2 = N2[G2 + s2[I2]], k2[A2 + s2[I2]]) : (g2 = 96, 0), c2 = 1 << (h2 = v2 - D2), M2 = u2 = 1 << T2; i2[p2 + (S2 >> D2) + (u2 -= c2)] = h2 << 24 | g2 << 16 | f2 | 0, 0 !== u2; ) + ; + for (c2 = 1 << v2 - 1; S2 & c2; ) + c2 >>= 1; + if (0 !== c2 ? S2 = (S2 & c2 - 1) + c2 : S2 = 0, I2++, 0 == --R2[v2]) { + if (v2 === y2) + break; + v2 = t2[n2 + s2[I2]]; + } + if (C2 < v2 && (S2 & d2) !== l2) { + for (p2 += M2, E2 = 1 << (T2 = v2 - (D2 = 0 === D2 ? C2 : D2)); T2 + D2 < y2 && !((E2 -= R2[T2 + D2]) <= 0); ) + T2++, E2 <<= 1; + if (L2 += 1 << T2, 1 === e2 && 852 < L2 || 2 === e2 && 592 < L2) + return 1; + i2[l2 = S2 & d2] = C2 << 24 | T2 << 16 | p2 - a2 | 0; + } + } + 0 !== S2 && (i2[p2 + S2] = v2 - D2 << 24 | 64 << 16 | 0), r2.bits = C2; + } + return 0; + } + var Xr = function() { + for (var e2 = [], t2 = 0; t2 < 256; t2++) { + for (var n2 = t2, o2 = 0; o2 < 8; o2++) + n2 = 1 & n2 ? 3988292384 ^ n2 >>> 1 : n2 >>> 1; + e2[t2] = n2; + } + return e2; + }(), Zr = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0], Qr = [16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78], $r = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0], ec = [16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 64, 64]; + function tc(e2) { + return (e2 >>> 24 & 255) + (e2 >>> 8 & 65280) + ((65280 & e2) << 8) + ((255 & e2) << 24); + } + function nc() { + this.mode = 0, this.last = false, this.wrap = 0, this.havedict = false, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new ie.Buf16(320), this.work = new ie.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0; + } + function oc(e2) { + var t2; + return e2 && e2.state ? (t2 = e2.state, e2.total_in = e2.total_out = t2.total = 0, e2.msg = "", t2.wrap && (e2.adler = 1 & t2.wrap), t2.mode = 1, t2.last = 0, t2.havedict = 0, t2.dmax = 32768, t2.head = null, t2.hold = 0, t2.bits = 0, t2.lencode = t2.lendyn = new ie.Buf32(852), t2.distcode = t2.distdyn = new ie.Buf32(592), t2.sane = 1, t2.back = -1, 0) : -2; + } + function ic(e2) { + var t2; + return e2 && e2.state ? ((t2 = e2.state).wsize = 0, t2.whave = 0, t2.wnext = 0, oc(e2)) : -2; + } + function ac(e2, t2) { + var n2, o2; + return !e2 || !e2.state || (o2 = e2.state, t2 < 0 ? (n2 = 0, t2 = -t2) : (n2 = 1 + (t2 >> 4), t2 < 48 && (t2 &= 15)), t2 && (t2 < 8 || 15 < t2)) ? -2 : (null !== o2.window && o2.wbits !== t2 && (o2.window = null), o2.wrap = n2, o2.wbits = t2, ic(e2)); + } + function sc(e2, t2) { + var n2; + return e2 ? (n2 = new nc(), (e2.state = n2).window = null, 0 !== (n2 = ac(e2, t2)) && (e2.state = null), n2) : -2; + } + var rc, cc, uc = true; + function lc(e2, t2, n2, o2) { + var i2, e2 = e2.state; + return null === e2.window && (e2.wsize = 1 << e2.wbits, e2.wnext = 0, e2.whave = 0, e2.window = new ie.Buf8(e2.wsize)), o2 >= e2.wsize ? (ie.arraySet(e2.window, t2, n2 - e2.wsize, e2.wsize, 0), e2.wnext = 0, e2.whave = e2.wsize) : ((i2 = e2.wsize - e2.wnext) > o2 && (i2 = o2), ie.arraySet(e2.window, t2, n2 - o2, i2, e2.wnext), (o2 -= i2) ? (ie.arraySet(e2.window, t2, n2 - o2, o2, 0), e2.wnext = o2, e2.whave = e2.wsize) : (e2.wnext += i2, e2.wnext === e2.wsize && (e2.wnext = 0), e2.whave < e2.wsize && (e2.whave += i2))), 0; + } + var dc = { inflateReset: ic, inflateReset2: ac, inflateResetKeep: oc, inflateInit: function(e2) { + return sc(e2, 15); + }, inflateInit2: sc, inflate: function(e2, b2) { + var t2, n2, w2, o2, i2, a2, s2, r2, c2, F2, u2, l2, q2, x2, d2, p2, _2, h2, V2, H2, g2, f2, m2, v2, I2 = 0, M2 = new ie.Buf8(4), B2 = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]; + if (!e2 || !e2.state || !e2.output || !e2.input && 0 !== e2.avail_in) + return -2; + 12 === (t2 = e2.state).mode && (t2.mode = 13), i2 = e2.next_out, w2 = e2.output, s2 = e2.avail_out, o2 = e2.next_in, n2 = e2.input, a2 = e2.avail_in, r2 = t2.hold, c2 = t2.bits, F2 = a2, u2 = s2, f2 = 0; + e: + for (; ; ) + switch (t2.mode) { + case 1: + if (0 === t2.wrap) + t2.mode = 13; + else { + for (; c2 < 16; ) { + if (0 === a2) + break e; + a2--, r2 += n2[o2++] << c2, c2 += 8; + } + if (2 & t2.wrap && 35615 === r2) + M2[t2.check = 0] = 255 & r2, M2[1] = r2 >>> 8 & 255, t2.check = Jr(t2.check, M2, 2, 0), c2 = r2 = 0, t2.mode = 2; + else if (t2.flags = 0, t2.head && (t2.head.done = false), !(1 & t2.wrap) || (((255 & r2) << 8) + (r2 >> 8)) % 31) + e2.msg = "incorrect header check", t2.mode = 30; + else if (8 != (15 & r2)) + e2.msg = "unknown compression method", t2.mode = 30; + else { + if (c2 -= 4, g2 = 8 + (15 & (r2 >>>= 4)), 0 === t2.wbits) + t2.wbits = g2; + else if (g2 > t2.wbits) { + e2.msg = "invalid window size", t2.mode = 30; + break; + } + t2.dmax = 1 << g2, e2.adler = t2.check = 1, t2.mode = 512 & r2 ? 10 : 12, c2 = r2 = 0; + } + } + break; + case 2: + for (; c2 < 16; ) { + if (0 === a2) + break e; + a2--, r2 += n2[o2++] << c2, c2 += 8; + } + if (t2.flags = r2, 8 != (255 & t2.flags)) { + e2.msg = "unknown compression method", t2.mode = 30; + break; + } + if (57344 & t2.flags) { + e2.msg = "unknown header flags set", t2.mode = 30; + break; + } + t2.head && (t2.head.text = r2 >> 8 & 1), 512 & t2.flags && (M2[0] = 255 & r2, M2[1] = r2 >>> 8 & 255, t2.check = Jr(t2.check, M2, 2, 0)), c2 = r2 = 0, t2.mode = 3; + case 3: + for (; c2 < 32; ) { + if (0 === a2) + break e; + a2--, r2 += n2[o2++] << c2, c2 += 8; + } + t2.head && (t2.head.time = r2), 512 & t2.flags && (M2[0] = 255 & r2, M2[1] = r2 >>> 8 & 255, M2[2] = r2 >>> 16 & 255, M2[3] = r2 >>> 24 & 255, t2.check = Jr(t2.check, M2, 4, 0)), c2 = r2 = 0, t2.mode = 4; + case 4: + for (; c2 < 16; ) { + if (0 === a2) + break e; + a2--, r2 += n2[o2++] << c2, c2 += 8; + } + t2.head && (t2.head.xflags = 255 & r2, t2.head.os = r2 >> 8), 512 & t2.flags && (M2[0] = 255 & r2, M2[1] = r2 >>> 8 & 255, t2.check = Jr(t2.check, M2, 2, 0)), c2 = r2 = 0, t2.mode = 5; + case 5: + if (1024 & t2.flags) { + for (; c2 < 16; ) { + if (0 === a2) + break e; + a2--, r2 += n2[o2++] << c2, c2 += 8; + } + t2.length = r2, t2.head && (t2.head.extra_len = r2), 512 & t2.flags && (M2[0] = 255 & r2, M2[1] = r2 >>> 8 & 255, t2.check = Jr(t2.check, M2, 2, 0)), c2 = r2 = 0; + } else + t2.head && (t2.head.extra = null); + t2.mode = 6; + case 6: + if (1024 & t2.flags && ((l2 = (l2 = t2.length) > a2 ? a2 : l2) && (t2.head && (g2 = t2.head.extra_len - t2.length, t2.head.extra || (t2.head.extra = new Array(t2.head.extra_len)), ie.arraySet(t2.head.extra, n2, o2, l2, g2)), 512 & t2.flags && (t2.check = Jr(t2.check, n2, l2, o2)), a2 -= l2, o2 += l2, t2.length -= l2), t2.length)) + break e; + t2.length = 0, t2.mode = 7; + case 7: + if (2048 & t2.flags) { + if (0 === a2) + break e; + for (l2 = 0; g2 = n2[o2 + l2++], t2.head && g2 && t2.length < 65536 && (t2.head.name += String.fromCharCode(g2)), g2 && l2 < a2; ) + ; + if (512 & t2.flags && (t2.check = Jr(t2.check, n2, l2, o2)), a2 -= l2, o2 += l2, g2) + break e; + } else + t2.head && (t2.head.name = null); + t2.length = 0, t2.mode = 8; + case 8: + if (4096 & t2.flags) { + if (0 === a2) + break e; + for (l2 = 0; g2 = n2[o2 + l2++], t2.head && g2 && t2.length < 65536 && (t2.head.comment += String.fromCharCode(g2)), g2 && l2 < a2; ) + ; + if (512 & t2.flags && (t2.check = Jr(t2.check, n2, l2, o2)), a2 -= l2, o2 += l2, g2) + break e; + } else + t2.head && (t2.head.comment = null); + t2.mode = 9; + case 9: + if (512 & t2.flags) { + for (; c2 < 16; ) { + if (0 === a2) + break e; + a2--, r2 += n2[o2++] << c2, c2 += 8; + } + if (r2 !== (65535 & t2.check)) { + e2.msg = "header crc mismatch", t2.mode = 30; + break; + } + c2 = r2 = 0; + } + t2.head && (t2.head.hcrc = t2.flags >> 9 & 1, t2.head.done = true), e2.adler = t2.check = 0, t2.mode = 12; + break; + case 10: + for (; c2 < 32; ) { + if (0 === a2) + break e; + a2--, r2 += n2[o2++] << c2, c2 += 8; + } + e2.adler = t2.check = tc(r2), c2 = r2 = 0, t2.mode = 11; + case 11: + if (0 === t2.havedict) + return e2.next_out = i2, e2.avail_out = s2, e2.next_in = o2, e2.avail_in = a2, t2.hold = r2, t2.bits = c2, 2; + e2.adler = t2.check = 1, t2.mode = 12; + case 12: + if (5 === b2 || 6 === b2) + break e; + case 13: + if (t2.last) + r2 >>>= 7 & c2, c2 -= 7 & c2, t2.mode = 27; + else { + for (; c2 < 3; ) { + if (0 === a2) + break e; + a2--, r2 += n2[o2++] << c2, c2 += 8; + } + switch (t2.last = 1 & r2, --c2, 3 & (r2 >>>= 1)) { + case 0: + t2.mode = 14; + break; + case 1: + y2 = C2 = void 0; + var y2, C2 = t2; + if (uc) { + for (rc = new ie.Buf32(512), cc = new ie.Buf32(32), y2 = 0; y2 < 144; ) + C2.lens[y2++] = 8; + for (; y2 < 256; ) + C2.lens[y2++] = 9; + for (; y2 < 280; ) + C2.lens[y2++] = 7; + for (; y2 < 288; ) + C2.lens[y2++] = 8; + for (zr(1, C2.lens, 0, 288, rc, 0, C2.work, { bits: 9 }), y2 = 0; y2 < 32; ) + C2.lens[y2++] = 5; + zr(2, C2.lens, 0, 32, cc, 0, C2.work, { bits: 5 }), uc = false; + } + if (C2.lencode = rc, C2.lenbits = 9, C2.distcode = cc, C2.distbits = 5, t2.mode = 20, 6 !== b2) + break; + r2 >>>= 2, c2 -= 2; + break e; + case 2: + t2.mode = 17; + break; + case 3: + e2.msg = "invalid block type", t2.mode = 30; + } + r2 >>>= 2, c2 -= 2; + } + break; + case 14: + for (r2 >>>= 7 & c2, c2 -= 7 & c2; c2 < 32; ) { + if (0 === a2) + break e; + a2--, r2 += n2[o2++] << c2, c2 += 8; + } + if ((65535 & r2) != (r2 >>> 16 ^ 65535)) { + e2.msg = "invalid stored block lengths", t2.mode = 30; + break; + } + if (t2.length = 65535 & r2, c2 = r2 = 0, t2.mode = 15, 6 === b2) + break e; + case 15: + t2.mode = 16; + case 16: + if (l2 = t2.length) { + if (0 === (l2 = s2 < (l2 = a2 < l2 ? a2 : l2) ? s2 : l2)) + break e; + ie.arraySet(w2, n2, o2, l2, i2), a2 -= l2, o2 += l2, s2 -= l2, i2 += l2, t2.length -= l2; + } else + t2.mode = 12; + break; + case 17: + for (; c2 < 14; ) { + if (0 === a2) + break e; + a2--, r2 += n2[o2++] << c2, c2 += 8; + } + if (t2.nlen = 257 + (31 & r2), r2 >>>= 5, c2 -= 5, t2.ndist = 1 + (31 & r2), r2 >>>= 5, c2 -= 5, t2.ncode = 4 + (15 & r2), r2 >>>= 4, c2 -= 4, 286 < t2.nlen || 30 < t2.ndist) { + e2.msg = "too many length or distance symbols", t2.mode = 30; + break; + } + t2.have = 0, t2.mode = 18; + case 18: + for (; t2.have < t2.ncode; ) { + for (; c2 < 3; ) { + if (0 === a2) + break e; + a2--, r2 += n2[o2++] << c2, c2 += 8; + } + t2.lens[B2[t2.have++]] = 7 & r2, r2 >>>= 3, c2 -= 3; + } + for (; t2.have < 19; ) + t2.lens[B2[t2.have++]] = 0; + if (t2.lencode = t2.lendyn, t2.lenbits = 7, m2 = { bits: t2.lenbits }, f2 = zr(0, t2.lens, 0, 19, t2.lencode, 0, t2.work, m2), t2.lenbits = m2.bits, f2) { + e2.msg = "invalid code lengths set", t2.mode = 30; + break; + } + t2.have = 0, t2.mode = 19; + case 19: + for (; t2.have < t2.nlen + t2.ndist; ) { + for (; p2 = (I2 = t2.lencode[r2 & (1 << t2.lenbits) - 1]) >>> 16 & 255, _2 = 65535 & I2, !((d2 = I2 >>> 24) <= c2); ) { + if (0 === a2) + break e; + a2--, r2 += n2[o2++] << c2, c2 += 8; + } + if (_2 < 16) + r2 >>>= d2, c2 -= d2, t2.lens[t2.have++] = _2; + else { + if (16 === _2) { + for (v2 = d2 + 2; c2 < v2; ) { + if (0 === a2) + break e; + a2--, r2 += n2[o2++] << c2, c2 += 8; + } + if (r2 >>>= d2, c2 -= d2, 0 === t2.have) { + e2.msg = "invalid bit length repeat", t2.mode = 30; + break; + } + g2 = t2.lens[t2.have - 1], l2 = 3 + (3 & r2), r2 >>>= 2, c2 -= 2; + } else if (17 === _2) { + for (v2 = d2 + 3; c2 < v2; ) { + if (0 === a2) + break e; + a2--, r2 += n2[o2++] << c2, c2 += 8; + } + g2 = 0, l2 = 3 + (7 & (r2 >>>= d2)), r2 >>>= 3, c2 = c2 - d2 - 3; + } else { + for (v2 = d2 + 7; c2 < v2; ) { + if (0 === a2) + break e; + a2--, r2 += n2[o2++] << c2, c2 += 8; + } + g2 = 0, l2 = 11 + (127 & (r2 >>>= d2)), r2 >>>= 7, c2 = c2 - d2 - 7; + } + if (t2.have + l2 > t2.nlen + t2.ndist) { + e2.msg = "invalid bit length repeat", t2.mode = 30; + break; + } + for (; l2--; ) + t2.lens[t2.have++] = g2; + } + } + if (30 === t2.mode) + break; + if (0 === t2.lens[256]) { + e2.msg = "invalid code -- missing end-of-block", t2.mode = 30; + break; + } + if (t2.lenbits = 9, m2 = { bits: t2.lenbits }, f2 = zr(1, t2.lens, 0, t2.nlen, t2.lencode, 0, t2.work, m2), t2.lenbits = m2.bits, f2) { + e2.msg = "invalid literal/lengths set", t2.mode = 30; + break; + } + if (t2.distbits = 6, t2.distcode = t2.distdyn, m2 = { bits: t2.distbits }, f2 = zr(2, t2.lens, t2.nlen, t2.ndist, t2.distcode, 0, t2.work, m2), t2.distbits = m2.bits, f2) { + e2.msg = "invalid distances set", t2.mode = 30; + break; + } + if (t2.mode = 20, 6 === b2) + break e; + case 20: + t2.mode = 21; + case 21: + if (6 <= a2 && 258 <= s2) { + e2.next_out = i2, e2.avail_out = s2, e2.next_in = o2, e2.avail_in = a2, t2.hold = r2, t2.bits = c2, G2 = Y2 = k2 = S2 = L2 = E2 = D2 = T2 = oe2 = ne2 = te2 = ee2 = U2 = P2 = $2 = Q2 = Z2 = X2 = z2 = J2 = j2 = N2 = W2 = O2 = R2 = void 0; + var T2, D2, E2, L2, S2, k2, A2 = e2, K2 = u2, R2 = A2.state, O2 = A2.next_in, Y2 = A2.input, W2 = O2 + (A2.avail_in - 5), N2 = A2.next_out, G2 = A2.output, j2 = N2 - (K2 - A2.avail_out), J2 = N2 + (A2.avail_out - 257), z2 = R2.dmax, X2 = R2.wsize, Z2 = R2.whave, Q2 = R2.wnext, $2 = R2.window, P2 = R2.hold, U2 = R2.bits, ee2 = R2.lencode, te2 = R2.distcode, ne2 = (1 << R2.lenbits) - 1, oe2 = (1 << R2.distbits) - 1; + t: + do { + for (U2 < 15 && (P2 += Y2[O2++] << U2, U2 += 8, P2 += Y2[O2++] << U2, U2 += 8), T2 = ee2[P2 & ne2]; ; ) { + if (P2 >>>= D2 = T2 >>> 24, U2 -= D2, 0 == (D2 = T2 >>> 16 & 255)) + G2[N2++] = 65535 & T2; + else { + if (!(16 & D2)) { + if (0 == (64 & D2)) { + T2 = ee2[(65535 & T2) + (P2 & (1 << D2) - 1)]; + continue; + } + if (32 & D2) { + R2.mode = 12; + break t; + } + A2.msg = "invalid literal/length code", R2.mode = 30; + break t; + } + for (E2 = 65535 & T2, (D2 &= 15) && (U2 < D2 && (P2 += Y2[O2++] << U2, U2 += 8), E2 += P2 & (1 << D2) - 1, P2 >>>= D2, U2 -= D2), U2 < 15 && (P2 += Y2[O2++] << U2, U2 += 8, P2 += Y2[O2++] << U2, U2 += 8), T2 = te2[P2 & oe2]; ; ) { + if (P2 >>>= D2 = T2 >>> 24, U2 -= D2, !(16 & (D2 = T2 >>> 16 & 255))) { + if (0 == (64 & D2)) { + T2 = te2[(65535 & T2) + (P2 & (1 << D2) - 1)]; + continue; + } + A2.msg = "invalid distance code", R2.mode = 30; + break t; + } + if (L2 = 65535 & T2, U2 < (D2 &= 15) && (P2 += Y2[O2++] << U2, (U2 += 8) < D2) && (P2 += Y2[O2++] << U2, U2 += 8), (L2 += P2 & (1 << D2) - 1) > z2) { + A2.msg = "invalid distance too far back", R2.mode = 30; + break t; + } + if (P2 >>>= D2, U2 -= D2, L2 > (D2 = N2 - j2)) { + if ((D2 = L2 - D2) > Z2 && R2.sane) { + A2.msg = "invalid distance too far back", R2.mode = 30; + break t; + } + if (k2 = $2, (S2 = 0) === Q2) { + if (S2 += X2 - D2, D2 < E2) { + for (E2 -= D2; G2[N2++] = $2[S2++], --D2; ) + ; + S2 = N2 - L2, k2 = G2; + } + } else if (Q2 < D2) { + if (S2 += X2 + Q2 - D2, (D2 -= Q2) < E2) { + for (E2 -= D2; G2[N2++] = $2[S2++], --D2; ) + ; + if (S2 = 0, Q2 < E2) { + for (E2 -= D2 = Q2; G2[N2++] = $2[S2++], --D2; ) + ; + S2 = N2 - L2, k2 = G2; + } + } + } else if (S2 += Q2 - D2, D2 < E2) { + for (E2 -= D2; G2[N2++] = $2[S2++], --D2; ) + ; + S2 = N2 - L2, k2 = G2; + } + for (; 2 < E2; ) + G2[N2++] = k2[S2++], G2[N2++] = k2[S2++], G2[N2++] = k2[S2++], E2 -= 3; + E2 && (G2[N2++] = k2[S2++], 1 < E2) && (G2[N2++] = k2[S2++]); + } else { + for (S2 = N2 - L2; G2[N2++] = G2[S2++], G2[N2++] = G2[S2++], G2[N2++] = G2[S2++], 2 < (E2 -= 3); ) + ; + E2 && (G2[N2++] = G2[S2++], 1 < E2) && (G2[N2++] = G2[S2++]); + } + break; + } + } + break; + } + } while (O2 < W2 && N2 < J2); + O2 -= E2 = U2 >> 3, P2 &= (1 << (U2 -= E2 << 3)) - 1, A2.next_in = O2, A2.next_out = N2, A2.avail_in = O2 < W2 ? W2 - O2 + 5 : 5 - (O2 - W2), A2.avail_out = N2 < J2 ? J2 - N2 + 257 : 257 - (N2 - J2), R2.hold = P2, R2.bits = U2, i2 = e2.next_out, w2 = e2.output, s2 = e2.avail_out, o2 = e2.next_in, n2 = e2.input, a2 = e2.avail_in, r2 = t2.hold, c2 = t2.bits, 12 === t2.mode && (t2.back = -1); + break; + } + for (t2.back = 0; p2 = (I2 = t2.lencode[r2 & (1 << t2.lenbits) - 1]) >>> 16 & 255, _2 = 65535 & I2, !((d2 = I2 >>> 24) <= c2); ) { + if (0 === a2) + break e; + a2--, r2 += n2[o2++] << c2, c2 += 8; + } + if (p2 && 0 == (240 & p2)) { + for (h2 = d2, V2 = p2, H2 = _2; p2 = (I2 = t2.lencode[H2 + ((r2 & (1 << h2 + V2) - 1) >> h2)]) >>> 16 & 255, _2 = 65535 & I2, !(h2 + (d2 = I2 >>> 24) <= c2); ) { + if (0 === a2) + break e; + a2--, r2 += n2[o2++] << c2, c2 += 8; + } + r2 >>>= h2, c2 -= h2, t2.back += h2; + } + if (r2 >>>= d2, c2 -= d2, t2.back += d2, t2.length = _2, 0 === p2) { + t2.mode = 26; + break; + } + if (32 & p2) { + t2.back = -1, t2.mode = 12; + break; + } + if (64 & p2) { + e2.msg = "invalid literal/length code", t2.mode = 30; + break; + } + t2.extra = 15 & p2, t2.mode = 22; + case 22: + if (t2.extra) { + for (v2 = t2.extra; c2 < v2; ) { + if (0 === a2) + break e; + a2--, r2 += n2[o2++] << c2, c2 += 8; + } + t2.length += r2 & (1 << t2.extra) - 1, r2 >>>= t2.extra, c2 -= t2.extra, t2.back += t2.extra; + } + t2.was = t2.length, t2.mode = 23; + case 23: + for (; p2 = (I2 = t2.distcode[r2 & (1 << t2.distbits) - 1]) >>> 16 & 255, _2 = 65535 & I2, !((d2 = I2 >>> 24) <= c2); ) { + if (0 === a2) + break e; + a2--, r2 += n2[o2++] << c2, c2 += 8; + } + if (0 == (240 & p2)) { + for (h2 = d2, V2 = p2, H2 = _2; p2 = (I2 = t2.distcode[H2 + ((r2 & (1 << h2 + V2) - 1) >> h2)]) >>> 16 & 255, _2 = 65535 & I2, !(h2 + (d2 = I2 >>> 24) <= c2); ) { + if (0 === a2) + break e; + a2--, r2 += n2[o2++] << c2, c2 += 8; + } + r2 >>>= h2, c2 -= h2, t2.back += h2; + } + if (r2 >>>= d2, c2 -= d2, t2.back += d2, 64 & p2) { + e2.msg = "invalid distance code", t2.mode = 30; + break; + } + t2.offset = _2, t2.extra = 15 & p2, t2.mode = 24; + case 24: + if (t2.extra) { + for (v2 = t2.extra; c2 < v2; ) { + if (0 === a2) + break e; + a2--, r2 += n2[o2++] << c2, c2 += 8; + } + t2.offset += r2 & (1 << t2.extra) - 1, r2 >>>= t2.extra, c2 -= t2.extra, t2.back += t2.extra; + } + if (t2.offset > t2.dmax) { + e2.msg = "invalid distance too far back", t2.mode = 30; + break; + } + t2.mode = 25; + case 25: + if (0 === s2) + break e; + if (t2.offset > (l2 = u2 - s2)) { + if ((l2 = t2.offset - l2) > t2.whave && t2.sane) { + e2.msg = "invalid distance too far back", t2.mode = 30; + break; + } + q2 = l2 > t2.wnext ? (l2 -= t2.wnext, t2.wsize - l2) : t2.wnext - l2, l2 > t2.length && (l2 = t2.length), x2 = t2.window; + } else + x2 = w2, q2 = i2 - t2.offset, l2 = t2.length; + for (s2 -= l2 = s2 < l2 ? s2 : l2, t2.length -= l2; w2[i2++] = x2[q2++], --l2; ) + ; + 0 === t2.length && (t2.mode = 21); + break; + case 26: + if (0 === s2) + break e; + w2[i2++] = t2.length, s2--, t2.mode = 21; + break; + case 27: + if (t2.wrap) { + for (; c2 < 32; ) { + if (0 === a2) + break e; + a2--, r2 |= n2[o2++] << c2, c2 += 8; + } + if (u2 -= s2, e2.total_out += u2, t2.total += u2, u2 && (e2.adler = t2.check = (t2.flags ? Jr : jr)(t2.check, w2, u2, i2 - u2)), u2 = s2, (t2.flags ? r2 : tc(r2)) !== t2.check) { + e2.msg = "incorrect data check", t2.mode = 30; + break; + } + c2 = r2 = 0; + } + t2.mode = 28; + case 28: + if (t2.wrap && t2.flags) { + for (; c2 < 32; ) { + if (0 === a2) + break e; + a2--, r2 += n2[o2++] << c2, c2 += 8; + } + if (r2 !== (4294967295 & t2.total)) { + e2.msg = "incorrect length check", t2.mode = 30; + break; + } + c2 = r2 = 0; + } + t2.mode = 29; + case 29: + f2 = 1; + break e; + case 30: + f2 = -3; + break e; + case 31: + return -4; + default: + return -2; + } + return e2.next_out = i2, e2.avail_out = s2, e2.next_in = o2, e2.avail_in = a2, t2.hold = r2, t2.bits = c2, (t2.wsize || u2 !== e2.avail_out && t2.mode < 30 && (t2.mode < 27 || 4 !== b2)) && lc(e2, e2.output, e2.next_out, u2 - e2.avail_out), F2 -= e2.avail_in, u2 -= e2.avail_out, e2.total_in += F2, e2.total_out += u2, t2.total += u2, t2.wrap && u2 && (e2.adler = t2.check = (t2.flags ? Jr : jr)(t2.check, w2, u2, e2.next_out - u2)), e2.data_type = t2.bits + (t2.last ? 64 : 0) + (12 === t2.mode ? 128 : 0) + (20 === t2.mode || 15 === t2.mode ? 256 : 0), f2 = (0 == F2 && 0 === u2 || 4 === b2) && 0 === f2 ? -5 : f2; + }, inflateEnd: function(e2) { + var t2; + return e2 && e2.state ? ((t2 = e2.state).window && (t2.window = null), e2.state = null, 0) : -2; + }, inflateGetHeader: function(e2, t2) { + return !e2 || !e2.state || 0 == (2 & (e2 = e2.state).wrap) ? -2 : ((e2.head = t2).done = false, 0); + }, inflateSetDictionary: function(e2, t2) { + var n2, o2 = t2.length; + return !e2 || !e2.state || 0 !== (n2 = e2.state).wrap && 11 !== n2.mode ? -2 : 11 === n2.mode && jr(1, t2, o2, 0) !== n2.check ? -3 : lc(e2, t2, o2, o2) ? (n2.mode = 31, -4) : (n2.havedict = 1, 0); + }, inflateInfo: "pako inflate (from Nodeca project)" }, pc = true, _c = true; + try { + String.fromCharCode.apply(null, [0]); + } catch (e2) { + pc = false; + } + try { + String.fromCharCode.apply(null, new Uint8Array(1)); + } catch (e2) { + _c = false; + } + for (var hc = new ie.Buf8(256), gc = 0; gc < 256; gc++) + hc[gc] = 252 <= gc ? 6 : 248 <= gc ? 5 : 240 <= gc ? 4 : 224 <= gc ? 3 : 192 <= gc ? 2 : 1; + hc[254] = hc[254] = 1; + function fc(e2, t2) { + for (var n2, o2, i2 = t2 || e2.length, a2 = new Array(2 * i2), s2 = 0, r2 = 0; r2 < i2; ) + if ((n2 = e2[r2++]) < 128) + a2[s2++] = n2; + else if (4 < (o2 = hc[n2])) + a2[s2++] = 65533, r2 += o2 - 1; + else { + for (n2 &= 2 === o2 ? 31 : 3 === o2 ? 15 : 7; 1 < o2 && r2 < i2; ) + n2 = n2 << 6 | 63 & e2[r2++], o2--; + 1 < o2 ? a2[s2++] = 65533 : n2 < 65536 ? a2[s2++] = n2 : (n2 -= 65536, a2[s2++] = 55296 | n2 >> 10 & 1023, a2[s2++] = 56320 | 1023 & n2); + } + var c2 = a2, u2 = s2; + if (u2 < 65534 && (c2.subarray && _c || !c2.subarray && pc)) + return String.fromCharCode.apply(null, ie.shrinkBuf(c2, u2)); + for (var l2 = "", d2 = 0; d2 < u2; d2++) + l2 += String.fromCharCode(c2[d2]); + return l2; + } + function mc() { + this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = "", this.state = null, this.data_type = 2, this.adler = 0; + } + function vc() { + this.text = 0, this.time = 0, this.xflags = 0, this.os = 0, this.extra = null, this.extra_len = 0, this.name = "", this.comment = "", this.hcrc = 0, this.done = false; + } + var Ic = { Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, Z_SYNC_FLUSH: 2, Z_FULL_FLUSH: 3, Z_FINISH: 4, Z_BLOCK: 5, Z_TREES: 6, Z_OK: 0, Z_STREAM_END: 1, Z_NEED_DICT: 2, Z_ERRNO: -1, Z_STREAM_ERROR: -2, Z_DATA_ERROR: -3, Z_BUF_ERROR: -5, Z_NO_COMPRESSION: 0, Z_BEST_SPEED: 1, Z_BEST_COMPRESSION: 9, Z_DEFAULT_COMPRESSION: -1, Z_FILTERED: 1, Z_HUFFMAN_ONLY: 2, Z_RLE: 3, Z_FIXED: 4, Z_DEFAULT_STRATEGY: 0, Z_BINARY: 0, Z_TEXT: 1, Z_UNKNOWN: 2, Z_DEFLATED: 8 }, Mc = { 2: "need dictionary", 1: "stream end", 0: "", "-1": "file error", "-2": "stream error", "-3": "data error", "-4": "insufficient memory", "-5": "buffer error", "-6": "incompatible version" }, yc = Object.prototype.toString; + function Cc(e2) { + if (!(this instanceof Cc)) + return new Cc(e2); + this.options = ie.assign({ chunkSize: 16384, windowBits: 0, to: "" }, e2 || {}); + var t2 = this.options, e2 = (t2.raw && 0 <= t2.windowBits && t2.windowBits < 16 && (t2.windowBits = -t2.windowBits, 0 === t2.windowBits) && (t2.windowBits = -15), !(0 <= t2.windowBits && t2.windowBits < 16) || e2 && e2.windowBits || (t2.windowBits += 32), 15 < t2.windowBits && t2.windowBits < 48 && 0 == (15 & t2.windowBits) && (t2.windowBits |= 15), this.err = 0, this.msg = "", this.ended = false, this.chunks = [], this.strm = new mc(), this.strm.avail_out = 0, dc.inflateInit2(this.strm, t2.windowBits)); + if (e2 !== Ic.Z_OK) + throw new Error(Mc[e2]); + if (this.header = new vc(), dc.inflateGetHeader(this.strm, this.header), t2.dictionary && ("string" == typeof t2.dictionary ? t2.dictionary = function(e3) { + for (var t3, n2, o2, i2, a2 = e3.length, s2 = 0, r2 = 0; r2 < a2; r2++) + 55296 == (64512 & (n2 = e3.charCodeAt(r2))) && r2 + 1 < a2 && 56320 == (64512 & (o2 = e3.charCodeAt(r2 + 1))) && (n2 = 65536 + (n2 - 55296 << 10) + (o2 - 56320), r2++), s2 += n2 < 128 ? 1 : n2 < 2048 ? 2 : n2 < 65536 ? 3 : 4; + for (t3 = new ie.Buf8(s2), r2 = i2 = 0; i2 < s2; r2++) + 55296 == (64512 & (n2 = e3.charCodeAt(r2))) && r2 + 1 < a2 && 56320 == (64512 & (o2 = e3.charCodeAt(r2 + 1))) && (n2 = 65536 + (n2 - 55296 << 10) + (o2 - 56320), r2++), n2 < 128 ? t3[i2++] = n2 : (n2 < 2048 ? t3[i2++] = 192 | n2 >>> 6 : (n2 < 65536 ? t3[i2++] = 224 | n2 >>> 12 : (t3[i2++] = 240 | n2 >>> 18, t3[i2++] = 128 | n2 >>> 12 & 63), t3[i2++] = 128 | n2 >>> 6 & 63), t3[i2++] = 128 | 63 & n2); + return t3; + }(t2.dictionary) : "[object ArrayBuffer]" === yc.call(t2.dictionary) && (t2.dictionary = new Uint8Array(t2.dictionary)), t2.raw) && (e2 = dc.inflateSetDictionary(this.strm, t2.dictionary)) !== Ic.Z_OK) + throw new Error(Mc[e2]); + } + function Tc(e2, t2) { + t2 = new Cc(t2); + if (t2.push(e2, true), t2.err) + throw t2.msg || Mc[t2.err]; + return t2.result; + } + Cc.prototype.push = function(e2, t2) { + var n2, o2, i2, a2, s2, r2 = this.strm, c2 = this.options.chunkSize, u2 = this.options.dictionary, l2 = false; + if (this.ended) + return false; + o2 = t2 === ~~t2 ? t2 : true === t2 ? Ic.Z_FINISH : Ic.Z_NO_FLUSH, "string" == typeof e2 ? r2.input = function(e3) { + for (var t3 = new ie.Buf8(e3.length), n3 = 0, o3 = t3.length; n3 < o3; n3++) + t3[n3] = e3.charCodeAt(n3); + return t3; + }(e2) : "[object ArrayBuffer]" === yc.call(e2) ? r2.input = new Uint8Array(e2) : r2.input = e2, r2.next_in = 0, r2.avail_in = r2.input.length; + do { + if (0 === r2.avail_out && (r2.output = new ie.Buf8(c2), r2.next_out = 0, r2.avail_out = c2), (n2 = (n2 = dc.inflate(r2, Ic.Z_NO_FLUSH)) === Ic.Z_NEED_DICT && u2 ? dc.inflateSetDictionary(this.strm, u2) : n2) === Ic.Z_BUF_ERROR && true === l2 && (n2 = Ic.Z_OK, l2 = false), n2 !== Ic.Z_STREAM_END && n2 !== Ic.Z_OK) + return this.onEnd(n2), !(this.ended = true); + !r2.next_out || 0 !== r2.avail_out && n2 !== Ic.Z_STREAM_END && (0 !== r2.avail_in || o2 !== Ic.Z_FINISH && o2 !== Ic.Z_SYNC_FLUSH) || ("string" === this.options.to ? (i2 = function(e3, t3) { + for (var n3 = (t3 = (t3 = t3 || e3.length) > e3.length ? e3.length : t3) - 1; 0 <= n3 && 128 == (192 & e3[n3]); ) + n3--; + return !(n3 < 0 || 0 === n3) && n3 + hc[e3[n3]] > t3 ? n3 : t3; + }(r2.output, r2.next_out), a2 = r2.next_out - i2, s2 = fc(r2.output, i2), r2.next_out = a2, r2.avail_out = c2 - a2, a2 && ie.arraySet(r2.output, r2.output, i2, a2, 0), this.onData(s2)) : this.onData(ie.shrinkBuf(r2.output, r2.next_out))), 0 === r2.avail_in && 0 === r2.avail_out && (l2 = true); + } while ((0 < r2.avail_in || 0 === r2.avail_out) && n2 !== Ic.Z_STREAM_END); + return (o2 = n2 === Ic.Z_STREAM_END ? Ic.Z_FINISH : o2) === Ic.Z_FINISH ? (n2 = dc.inflateEnd(this.strm), this.onEnd(n2), this.ended = true, n2 === Ic.Z_OK) : o2 !== Ic.Z_SYNC_FLUSH || (this.onEnd(Ic.Z_OK), !(r2.avail_out = 0)); + }, Cc.prototype.onData = function(e2) { + this.chunks.push(e2); + }, Cc.prototype.onEnd = function(e2) { + e2 === Ic.Z_OK && ("string" === this.options.to ? this.result = this.chunks.join("") : this.result = ie.flattenChunks(this.chunks)), this.chunks = [], this.err = e2, this.msg = this.strm.msg; + }; + var s = {}, Dc = ((0, ie.assign)(s, { Inflate: Cc, inflate: Tc, inflateRaw: function(e2, t2) { + return (t2 = t2 || {}).raw = true, Tc(e2, t2); + }, ungzip: Tc }, Ic), s), Ec = (e(Gc, [{ key: "inflate", value: function(e2) { + var t2, e2 = new Uint8Array(e2).slice(4), n2 = Date.now(); + try { + t2 = Dc.inflate(e2, { to: "string" }), this._bLogForInflateOK || (this._bLogForInflateOK = true, new G("inflateOK").end()); + } catch (e3) { + return this._bLogForInflateError ? void 0 : (this._bLogForInflateError = true, void new G("inflateError").setMessage(e3).end()); + } + var e2 = e2.length + 4, o2 = t2.length; + return M.d("inflate ok. zipped:".concat(e2, " unzipped:").concat(o2) + " compression ratio:".concat(Math.round(100 * (o2 - e2) / o2), "% cost:").concat(Date.now() - n2)), t2; + } }, { key: "reset", value: function() { + M.l("".concat(this._n, ".reset")), this._bLogForInflateOK = false, this._bLogForInflateError = false; + } }]), Gc), Lc = (e(Nc, [{ key: "_startTimer", value: function() { + var e2 = this._map.get(24), t2 = e2.isWorkerEnabled(); + M.l("".concat(this._n, ".startTimer isWorkerEnabled:").concat(t2, " seed:").concat(this._checkTimer)), t2 ? e2.startWorkerTimer() : this._startMainThreadTimer(); + } }, { key: "_startMainThreadTimer", value: function() { + this._checkTimer < 0 && (this._checkTimer = setInterval(this.onCheckTimer.bind(this), 1e3)), M.l("".concat(this._n, "._startMainThreadTimer seed:").concat(this._checkTimer)); + } }, { key: "stopTimer", value: function() { + var e2 = this._map.get(24), t2 = e2.isWorkerEnabled(); + M.l("".concat(this._n, ".stopTimer isWorkerEnabled:").concat(t2, " seed:").concat(this._checkTimer)), t2 ? e2.stopWorkerTimer() : this._stopMainThreadTimer(); + } }, { key: "_stopMainThreadTimer", value: function() { + M.l("".concat(this._n, "._stopMainThreadTimer")), 0 < this._checkTimer && (clearInterval(this._checkTimer), this._checkTimer = -1, this._checkCount = 0); + } }, { key: "_stopMainThreadSocket", value: function() { + M.l("".concat(this._n, "._stopMainThreadSocket")); + var e2 = this._map.get(21); + e2.setIsWorkerEnabled(true), e2.reConnect(); + } }, { key: "_startMainThreadSocket", value: function() { + M.l("".concat(this._n, "._startMainThreadSocket")); + var e2 = this._map.get(21); + e2.setIsWorkerEnabled(false), e2.reConnect(); + } }, { key: "onWorkerTimerEnabled", value: function() { + M.l("".concat(this._n, ".onWorkerTimerEnabled, disable main thread timer and socket")), this._stopMainThreadTimer(), this._stopMainThreadSocket(); + } }, { key: "onWorkerTimerDisabled", value: function() { + M.l("".concat(this._n, ".onWorkerTimerDisabled, enable main thread timer and socket")), this._startMainThreadTimer(), this._startMainThreadSocket(); + } }, { key: "onCheckTimer", value: function() { + this._checkCount += 1; + var e2, t2 = Z(this._map); + try { + for (t2.s(); !(e2 = t2.n()).done; ) { + var n2 = Y(e2.value, 2)[1]; + n2.onCheckTimer && n2.onCheckTimer(this._checkCount); + } + } catch (e3) { + t2.e(e3); + } finally { + t2.f(); + } + } }, { key: "_initReadyList", value: function() { + var t2 = this; + this._readyList = [this._map.get(1)], this._readyList.forEach(function(e2) { + e2.ready(function() { + return t2._onModuleReady(); + }); + }); + } }, { key: "_onModuleReady", value: function() { + var e2, t2, n2 = true; + this._readyList.forEach(function(e3) { + e3.isReady() || (n2 = false); + }), n2 && !this._isReady && (this._isReady = true, this._oEmitter.emit(h.SDK_READY), e2 = Date.now() - this._startLoginTs, M.w("SDK is ready. cost ".concat(e2, " ms")), this._startLoginTs = Date.now(), t2 = this._ssoLogForReady.getStartTs() + Ye, this._ssoLogForReady.setMessage(e2).start(t2).end()); + } }, { key: "login", value: function() { + 0 === this._startLoginTs && (He(), this._startLoginTs = Date.now(), this._startTimer(), this._map.get(15).start(), this._ssoLogForReady = new G("sdkReady"), this._reason = L.LOGGING_IN); + } }, { key: "onLoginFailed", value: function() { + this._startLoginTs = 0; + } }, { key: "getOEmitInst", value: function() { + return null === this._oEmitter && (this._oEmitter = new Ia(), e2 = this._oEmitter, qn = e2, this._oEmitter._emit = this._oEmitter.emit, this._oEmitter.emit = (function(e3, t2) { + var n2, o2, i2 = this; + this._canIUseSignaling() && (e3 === h.MESSAGE_RECEIVED && this.get(33).onNewMessageList(t2), e3 === h.MESSAGE_MODIFIED) && this.get(33).onMessageModified(t2), e3 === h.CONVERSATION_LIST_UPDATED || e3 === h.FRIEND_LIST_UPDATED || e3 === h.GROUP_LIST_UPDATED || e3 === h.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED ? false !== this._eventThrottling ? this._eventThrottleMap.has(e3) ? (n2 = Date.now()) - (o2 = this._eventThrottleMap.get(e3)).last <= 1e3 ? (o2.timeoutID && clearTimeout(o2.timeoutID), o2.timeoutID = setTimeout(function() { + o2.last = Date.now(), i2._oEmitter._emit.apply(i2._oEmitter, [e3, { name: e3, data: i2._getEventData(e3) }]); + }, 1e3)) : (o2.last = n2, this._oEmitter._emit.apply(this._oEmitter, [e3, { name: e3, data: this._getEventData(e3) }])) : (this._eventThrottleMap.set(e3, { last: Date.now(), timeoutID: -1 }), this._oEmitter._emit.apply(this._oEmitter, [e3, { name: e3, data: this._getEventData(e3) }])) : this._oEmitter._emit.apply(this._oEmitter, [e3, { name: e3, data: this._getEventData(e3) }]) : this._oEmitter._emit.apply(this._oEmitter, [e3, { name: e3, data: t2 }]); + }).bind(this)), this._oEmitter; + var e2; + } }, { key: "_canIUseSignaling", value: function() { + var e2 = this.get(33); + return !!e2 && e2.canIUseSignaling(); + } }, { key: "_getEventData", value: function(e2) { + return e2 === h.CONVERSATION_LIST_UPDATED ? this._map.get(12).isPartialUpdatedConvs() ? this._map.get(11).getPartialUpdatedConvs() : this._map.get(11).getLocalConvList() : e2 === h.FRIEND_LIST_UPDATED ? this._map.get(8).getLocalFriendList(false) : e2 === h.GROUP_LIST_UPDATED ? this._map.get(7).getLocalGroupList() : e2 === h.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED ? this._map.get(11).getTotalUnreadCount() : e2 === h.CONVERSATION_ID_LIST_UPDATED ? this._map.get(11).getUpdatedConvIDList() : void 0; + } }, { key: "getIEmitInst", value: function() { + return null === this._iEmitter && (this._iEmitter = new Ia(), this._iEmitter._emit = this._iEmitter.emit, this._iEmitter.emit = (function(e2, t2) { + e2 = f(t2) && t2.data ? [e2, { name: e2, data: t2.data }] : [e2, { name: e2, data: t2 }]; + this._iEmitter._emit.apply(this._iEmitter, e2); + }).bind(this)), this._iEmitter; + } }, { key: "hasModule", value: function(e2) { + return this._map.has(e2); + } }, { key: "get", value: function(e2) { + return this._map.get(e2); + } }, { key: "canIUseModule", value: function(e2) { + return !this._map.get(12).isUsingChatCore() || this._optionalModuleMap.has(e2); + } }, { key: "canIUseInflate", value: function() { + return !!this._map.get(37); + } }, { key: "isReady", value: function() { + return this._isReady; + } }, { key: "isIntl", value: function() { + return this.get(12).isIntl(); + } }, { key: "getNotReadyReason", value: function() { + return this._reason; + } }, { key: "setNotReadyReason", value: function(e2) { + this._reason = e2; + } }, { key: "getErrMsg", value: function(e2, t2, n2) { + return this._map.get(32).get({ key: e2, replacement1: t2, replacement2: n2, isIntl: this.isIntl() }); + } }, { key: "warn", value: function(e2, t2, n2) { + e2 = this.getErrMsg(e2, t2, n2); + e2 && M.w(e2); + } }, { key: "onError", value: function(e2) { + var t2 = "code:".concat(e2.code, " message:").concat(e2.message); + M.w("Oops! ".concat(t2)), new G("error").setMessage(t2).setLevel("error").end(), this.getOEmitInst().emit(h.ERROR, e2); + } }, { key: "restartTimer", value: function() { + M.l("".concat(this._n, ".restartTimer")), this.stopTimer(), this._startTimer(); + var e2 = this.get(7); + e2 && e2.restartPolling(); + } }, { key: "getTimerID", value: function() { + var e2 = this._map.get(24); + return e2.isWorkerEnabled() ? e2.getTimerID() : this._checkTimer; + } }, { key: "getPollingTimerID", value: function(e2) { + return this._map.get(7).getPollingTimerID(e2); + } }, { key: "reset", value: function() { + M.l("".concat(this._n, ".reset")), He(); + var e2, t2 = Z(this._map); + try { + for (t2.s(); !(e2 = t2.n()).done; ) { + var n2 = Y(e2.value, 2)[1]; + n2.reset && n2.reset(); + } + } catch (e3) { + t2.e(e3); + } finally { + t2.f(); + } + this._startLoginTs = 0, this._initReadyList(), this._isReady = false, this.stopTimer(), this._oEmitter.emit(h.SDK_NOT_READY); + var o2, i2 = Z(this._eventThrottleMap); + try { + for (i2.s(); !(o2 = i2.n()).done; ) { + var a2 = Y(o2.value, 2)[1]; + a2.timeoutID && clearTimeout(a2.timeoutID); + } + } catch (e3) { + i2.e(e3); + } finally { + i2.f(); + } + this._eventThrottleMap.clear(); + } }]), Nc), Sc = (e(Oc, [{ key: "defense", value: function(e2, t2) { + var n2 = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : void 0; + if ("string" != typeof e2) + return null; + if (0 === e2.length) + return null; + if ("function" != typeof t2) + return null; + if (this._funcMap.has(e2) && this._funcMap.get(e2).has(t2)) + return this._funcMap.get(e2).get(t2); + this._funcMap.has(e2) || this._funcMap.set(e2, /* @__PURE__ */ new Map()); + var o2 = null; + return this._funcMap.get(e2).has(t2) ? o2 = this._funcMap.get(e2).get(t2) : (o2 = this._pack(e2, t2, n2), this._funcMap.get(e2).set(t2, o2)), o2; + } }, { key: "defenseOnce", value: function(e2, t2) { + return "function" != typeof t2 ? null : this._pack(e2, t2, 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : void 0); + } }, { key: "find", value: function(e2, t2) { + return "string" != typeof e2 || 0 === e2.length || "function" != typeof t2 ? null : this._funcMap.has(e2) && this._funcMap.get(e2).has(t2) ? this._funcMap.get(e2).get(t2) : (this._m.warn("ListenerFnNotFound", e2), null); + } }, { key: "delete", value: function(e2, t2) { + return "function" == typeof t2 && !!this._funcMap.has(e2) && !!this._funcMap.get(e2).has(t2) && (this._funcMap.get(e2).delete(t2), 0 === this._funcMap.get(e2).size && this._funcMap.delete(e2), true); + } }, { key: "_pack", value: function(o2, e2, i2) { + var a2 = this; + return function() { + try { + e2.apply(i2, Array.from(arguments)); + } catch (e3) { + var t2 = Object.values(h).indexOf(o2), n2 = "CallbackError"; + -1 !== t2 && (t2 = Object.keys(h)[t2], a2._m.warn(n2, t2, e3)), a2._reportCount < 5 && (new G(n2).setMessage("eventName:".concat(o2)).setMoreMessage(e3.message).end(), a2._reportCount += 1); + } + }; + } }, { key: "destroy", value: function() { + this._funcMap.clear(); + } }, { key: "reset", value: function() { + M.l("".concat(this._n, ".reset")), this._reportCount = 0; + } }]), Oc), kc = (e(Rc, [{ key: "onError", value: function(e2) { + this._m.onError(e2); + } }, { key: "login", value: function(e2) { + return this._m.login(), this._get(1).login(e2); + } }, { key: "logout", value: function() { + var t2 = this; + return this._get(1).logout().then(function(e2) { + return t2._safetyCallbackFactory.reset(), t2._m.reset(), e2; + }); + } }, { key: "getLoginUser", value: function() { + return this._get(1).getLoginUser(); + } }, { key: "getServerTime", value: function() { + return We(); + } }, { key: "isReady", value: function() { + return this._m.isReady(); + } }, { key: "isIntl", value: function() { + return this._m.isIntl(); + } }, { key: "getNotReadyReason", value: function() { + return this._m.getNotReadyReason(); + } }, { key: "getErrMsg", value: function(e2, t2, n2) { + return this._m.getErrMsg(e2, t2, n2); + } }, { key: "_get", value: function(e2) { + return this._m.get(e2); + } }, { key: "destroy", value: function() { + var e2 = this, t2 = this._get(12), n2 = t2.getSDKAppID(); + return M.w("destroy ".concat(n2, " ").concat(t2.getInstanceID())), this.logout().finally(function() { + e2._safetyCallbackFactory.destroy(), e2._m.stopTimer(), e2._get(24).terminate(), e2._get(21).dealloc(), e2._m.getOEmitInst().emit(h.SDK_DESTROY, { SDKAppID: n2 }); + }); + } }, { key: "on", value: function(e2, t2, n2) { + M.d("on", "eventName:".concat(e2)), this._m.getOEmitInst().on(e2, this._safetyCallbackFactory.defense(e2, t2, n2), n2); + } }, { key: "once", value: function(e2, t2, n2) { + M.d("once", "eventName:".concat(e2)), this._m.getOEmitInst().once(e2, this._safetyCallbackFactory.defenseOnce(e2, t2, n2), n2 || this); + } }, { key: "off", value: function(e2, t2, n2, o2) { + M.d("off", "eventName:".concat(e2)); + var i2 = this._safetyCallbackFactory.find(e2, t2); + null !== i2 && (this._m.getOEmitInst().off(e2, i2, n2, o2), this._safetyCallbackFactory.delete(e2, t2)); + } }, { key: "registerPlugin", value: function(e2) { + (N(e2["tim-push"]) ? N(e2["tim-offline-push-plugin"]) ? this._get(18) : this._get(28) : this._get(36)).registerPlugin(e2); + } }, { key: "setLogLevel", value: function(e2) { + var t2; + e2 <= 0 && ((t2 = this.getErrMsg("TIM_ASCII_ART")) && console.log(t2), (t2 = this.getErrMsg("API_REFER")) && (Qt() ? console.log("%c ".concat("IM SDK API ->", " %c"), "background:#ff9d00; padding:1px; border-radius:3px; color: #fff", "background:transparent", t2) : console.log("IM SDK API ->", t2)), (t2 = this.getErrMsg("DOCS_GUIDE")) && console.log(t2), t2 = this.getErrMsg("IOS_WEBVIEW_WARNING"), be) && t2 && console.warn(t2), M.setLevel(e2); + } }, { key: "createTextMessage", value: function(e2) { + return this._get(2).createTextMessage(e2); + } }, { key: "createTextAtMessage", value: function(e2) { + return this._get(2).createTextMessage(e2); + } }, { key: "createImageMessage", value: function(e2) { + return this._get(2).createImageMessage(e2); + } }, { key: "createAudioMessage", value: function(e2) { + return this._get(2).createAudioMessage(e2); + } }, { key: "createVideoMessage", value: function(e2) { + return this._get(2).createVideoMessage(e2); + } }, { key: "createCustomMessage", value: function(e2) { + return this._get(2).createCustomMessage(e2); + } }, { key: "createFaceMessage", value: function(e2) { + return this._get(2).createFaceMessage(e2); + } }, { key: "createFileMessage", value: function(e2) { + return this._get(2).createFileMessage(e2); + } }, { key: "createLocationMessage", value: function(e2) { + return this._get(2).createLocationMessage(e2); + } }, { key: "createMergerMessage", value: function(e2) { + return this._get(2).createMergerMessage(e2); + } }, { key: "downloadMergerMessage", value: function(e2) { + return e2.type !== A.MSG_MERGER ? D({ code: L.MSG_MERGER_TYPE_INVALID }) : S(e2.payload.downloadKey) ? D({ code: L.MSG_MERGER_KEY_INVALID }) : this._get(2).downloadMergerMessage(e2).catch(function(e3) { + return D({ code: L.MSG_MERGER_DOWNLOAD_FAIL }); + }); + } }, { key: "createForwardMessage", value: function(e2) { + return this._get(2).createForwardMessage(e2); + } }, { key: "sendMessage", value: function(e2, t2) { + return e2 instanceof Do ? this._get(2).sendMessageInstance(e2, t2) : D({ code: L.MSG_INSTANCE_REQUIRED }); + } }, { key: "searchCloudMessages", value: function(e2) { + return this._get(2).searchCloudMessages(e2); + } }, { key: "callExperimentalAPI", value: function(e2, t2) { + return "sendComboMessage" === e2 ? this._get(31).sendMessage(t2) : "handleGroupInvitation" === e2 ? this._get(7).handleGroupInvitation(t2) : "isCommercialAbilityEnabled" === e2 ? this._get(27).isFeatureEnabled(t2) : "isFeatureEnabledForStat" === e2 ? this._get(27).isFeatureEnabledForStat(t2) : "isIntl" === e2 ? this.isIntl() : "sendTRTCCustomData" === e2 || "sendRoomCustomData" === e2 ? this._get(30).sendTRTCCustomData(t2) : "getTimerID" === e2 ? this._m.getTimerID() : "getPollingTimerID" === e2 ? this._m.getPollingTimerID(t2) : "setApplicationID" === e2 ? (this._get(12).setApplicationID(t2), void this._get(20).updateProtocolConfig()) : "getServerConfig" === e2 ? this._get(23).getServerConfig(t2) : "canIUseModule" === e2 ? this._m.canIUseModule(t2) : "startMessageLongPolling" === e2 ? this._get(7).startMessageLongPolling(t2) : "stopMessageLongPolling" === e2 ? this._get(7).stopMessageLongPolling(t2) : "disableMessagePullOnInvite" === e2 ? this._get(11).disableMsgPullOnInvite(t2) : "clearLocalMessage" === e2 ? this._get(11).clearMemMsg(t2, false) : "setCustomLoginInfo" === e2 ? this._get(12).setCustomLoginInfo(t2) : D({ code: L.INVALID_OPERATION }); + } }, { key: "revokeMessage", value: function(e2) { + return this._get(2).revokeMessage(e2); + } }, { key: "resendMessage", value: function(e2, t2) { + return e2 instanceof Do ? this._get(2).resendMessage(e2, t2) : D({ code: L.MSG_INSTANCE_REQUIRED }); + } }, { key: "deleteMessage", value: function(e2) { + return this._get(2).deleteMessage(e2); + } }, { key: "translateText", value: function(e2) { + return this._get(2).translateText(e2); + } }, { key: "convertVoiceToText", value: function(e2) { + return this._get(2).convertVoiceToText(e2); + } }, { key: "setMessageExtensions", value: function(e2, t2) { + return this._get(3).setMessageExtensions(e2, t2); + } }, { key: "getMessageExtensions", value: function(e2) { + return this._get(3).getMessageExtensions(e2); + } }, { key: "deleteMessageExtensions", value: function(e2, t2) { + return this._get(3).deleteMessageExtensions(e2, t2); + } }, { key: "addMessageReaction", value: function(e2, t2) { + return this._get(34).addMessageReaction(e2, t2); + } }, { key: "removeMessageReaction", value: function(e2, t2) { + return this._get(34).removeMessageReaction(e2, t2); + } }, { key: "getMessageReactions", value: function(e2) { + return this._get(34).getMessageReactions(e2); + } }, { key: "getAllUserListOfMessageReaction", value: function(e2) { + return this._get(34).getAllUserListOfMessageReaction(e2); + } }, { key: "modifyMessage", value: function(e2) { + return this._get(2).modifyRemoteMessage(e2); + } }, { key: "getMessageList", value: function(e2) { + return this._get(11).getMessageList(e2); + } }, { key: "getMessageListHopping", value: function(e2) { + return this._get(11).getMessageListHopping(e2); + } }, { key: "sendMessageReadReceipt", value: function(e2) { + return this._get(11).sendReadReceipt(e2); + } }, { key: "getMessageReadReceiptList", value: function(e2) { + return this._get(11).getReadReceiptList(e2); + } }, { key: "getGroupMessageReadMemberList", value: function(e2) { + var t2 = this._get(7); + return t2 ? t2.getReadReceiptDetail(e2) : D({ code: L.NO_MODULE }); + } }, { key: "findMessage", value: function(e2) { + return this._get(11).findMessage(e2); + } }, { key: "setMessageRead", value: function(e2) { + return this._get(11).setMessageRead(e2); + } }, { key: "getConversationList", value: function(e2) { + return this._get(11).getConvList(e2); + } }, { key: "getConversationProfile", value: function(e2) { + return this._get(11).getConversationProfile(e2); + } }, { key: "deleteConversation", value: function(e2) { + return this._get(11).deleteConversation(e2); + } }, { key: "setConversationDraft", value: function(e2) { + return this._get(11).setConvDraft(e2); + } }, { key: "clearHistoryMessage", value: function(e2) { + return this._get(11).clearHistoryMessage(e2); + } }, { key: "pinConversation", value: function(e2) { + return this._get(11).pinConversation(e2); + } }, { key: "setAllMessageRead", value: function(e2) { + return this._get(11).setAllMessageRead(e2); + } }, { key: "setMessageRemindType", value: function(e2) { + return this._get(11).setMessageRemindType(e2); + } }, { key: "setAllReceiveMessageOpt", value: function(e2) { + return this._get(11).setAllRcvMsgOpt(e2); + } }, { key: "getAllReceiveMessageOpt", value: function() { + return this._get(11).getAllRcvMsgOpt(); + } }, { key: "getTotalUnreadMessageCount", value: function() { + return this._get(11).getTotalUnreadCount(); + } }, { key: "setConversationCustomData", value: function(e2) { + return this._get(11).setConvCustomData(e2); + } }, { key: "markConversation", value: function(e2) { + return this._get(11).markConv(e2); + } }, { key: "getConversationGroupList", value: function() { + return this._get(11).getConvGroupList(); + } }, { key: "createConversationGroup", value: function(e2) { + return this._get(11).createConvGroup(e2); + } }, { key: "deleteConversationGroup", value: function(e2) { + return this._get(11).deleteConvGroup(e2); + } }, { key: "renameConversationGroup", value: function(e2) { + return this._get(11).renameConvGroup(e2); + } }, { key: "addConversationsToGroup", value: function(e2) { + return this._get(11).addConvsToGroup(e2); + } }, { key: "deleteConversationsFromGroup", value: function(e2) { + return this._get(11).deleteConvsFromGroup(e2); + } }, { key: "getMyProfile", value: function() { + return this._get(4).getMyProfile(); + } }, { key: "getUserProfile", value: function(e2) { + return this._get(4).getUserProfile(e2); + } }, { key: "updateMyProfile", value: function(e2) { + return this._get(4).updateMyProfile(e2); + } }, { key: "getBlacklist", value: function() { + return this._get(4).getLocalBlacklist(); + } }, { key: "addToBlacklist", value: function(e2) { + return this._get(4).addBlacklist(e2); + } }, { key: "removeFromBlacklist", value: function(e2) { + return this._get(4).deleteBlacklist(e2); + } }, { key: "setSelfStatus", value: function(e2) { + return this._get(4).setSelfStatus(e2); + } }, { key: "getUserStatus", value: function(e2) { + return this._get(4).getUserStatus(e2); + } }, { key: "subscribeUserStatus", value: function(e2) { + return this._get(4).subscribeUserStatus(e2); + } }, { key: "unsubscribeUserStatus", value: function(e2) { + return this._get(4).unsubscribeUserStatus(e2); + } }, { key: "getFriendList", value: function() { + var e2 = this._get(8); + return e2 ? e2.getLocalFriendList() : D({ code: L.NO_MODULE }); + } }, { key: "addFriend", value: function(e2) { + var t2 = this._get(8); + return t2 ? t2.addFriend(e2) : D({ code: L.NO_MODULE }); + } }, { key: "deleteFriend", value: function(e2) { + var t2 = this._get(8); + return t2 ? t2.deleteFriend(e2) : D({ code: L.NO_MODULE }); + } }, { key: "checkFriend", value: function(e2) { + var t2 = this._get(8); + return t2 ? t2.checkFriend(e2) : D({ code: L.NO_MODULE }); + } }, { key: "getFriendProfile", value: function(e2) { + var t2 = this._get(8); + return t2 ? t2.getFriendProfile(e2) : D({ code: L.NO_MODULE }); + } }, { key: "updateFriend", value: function(e2) { + var t2 = this._get(8); + return t2 ? t2.updateFriend(e2) : D({ code: L.NO_MODULE }); + } }, { key: "getFriendApplicationList", value: function() { + var e2 = this._get(8); + return e2 ? e2.getLocalFriendApplicationList() : D({ code: L.NO_MODULE }); + } }, { key: "acceptFriendApplication", value: function(e2) { + var t2 = this._get(8); + return t2 ? t2.acceptFriendApplication(e2) : D({ code: L.NO_MODULE }); + } }, { key: "refuseFriendApplication", value: function(e2) { + var t2 = this._get(8); + return t2 ? t2.refuseFriendApplication(e2) : D({ code: L.NO_MODULE }); + } }, { key: "deleteFriendApplication", value: function(e2) { + var t2 = this._get(8); + return t2 ? t2.deleteFriendApplication(e2) : D({ code: L.NO_MODULE }); + } }, { key: "setFriendApplicationRead", value: function() { + var e2 = this._get(8); + return e2 ? e2.setFriendApplicationRead() : D({ code: L.NO_MODULE }); + } }, { key: "getFriendGroupList", value: function() { + var e2 = this._get(8); + return e2 ? e2.getLocalFriendGroupList() : D({ code: L.NO_MODULE }); + } }, { key: "createFriendGroup", value: function(e2) { + var t2 = this._get(8); + return t2 ? t2.createFriendGroup(e2) : D({ code: L.NO_MODULE }); + } }, { key: "deleteFriendGroup", value: function(e2) { + var t2 = this._get(8); + return t2 ? t2.deleteFriendGroup(e2) : D({ code: L.NO_MODULE }); + } }, { key: "addToFriendGroup", value: function(e2) { + var t2 = this._get(8); + return t2 ? t2.addToFriendGroup(e2) : D({ code: L.NO_MODULE }); + } }, { key: "removeFromFriendGroup", value: function(e2) { + var t2 = this._get(8); + return t2 ? t2.removeFromFriendGroup(e2) : D({ code: L.NO_MODULE }); + } }, { key: "renameFriendGroup", value: function(e2) { + var t2 = this._get(8); + return t2 ? t2.renameFriendGroup(e2) : D({ code: L.NO_MODULE }); + } }, { key: "followUser", value: function(e2) { + var t2 = this._get(35); + return t2 ? t2.followUser(e2) : D({ code: L.NO_MODULE }); + } }, { key: "unfollowUser", value: function(e2) { + var t2 = this._get(35); + return t2 ? t2.unfollowUser(e2) : D({ code: L.NO_MODULE }); + } }, { key: "getMyFollowersList", value: function(e2) { + var t2 = this._get(35); + return t2 ? t2.getMyFollowersList(e2) : D({ code: L.NO_MODULE }); + } }, { key: "getMyFollowingList", value: function(e2) { + var t2 = this._get(35); + return t2 ? t2.getMyFollowingList(e2) : D({ code: L.NO_MODULE }); + } }, { key: "getMutualFollowersList", value: function(e2) { + var t2 = this._get(35); + return t2 ? t2.getMutualFollowersList(e2) : D({ code: L.NO_MODULE }); + } }, { key: "getUserFollowInfo", value: function(e2) { + var t2 = this._get(35); + return t2 ? t2.getUserFollowInfo(e2) : D({ code: L.NO_MODULE }); + } }, { key: "checkFollowType", value: function(e2) { + var t2 = this._get(35); + return t2 ? t2.checkFollowType(e2) : D({ code: L.NO_MODULE }); + } }, { key: "getGroupList", value: function() { + var e2 = this._get(7); + return e2 ? e2.getGroupList() : D({ code: L.NO_MODULE }); + } }, { key: "getGroupProfile", value: function(e2) { + var t2 = this._get(7); + return t2 ? t2.getGroupProfile(e2) : D({ code: L.NO_MODULE }); + } }, { key: "createGroup", value: function(e2) { + var t2 = this._get(7); + return t2 ? t2.createGroup(e2) : D({ code: L.NO_MODULE }); + } }, { key: "dismissGroup", value: function(e2) { + var t2 = this._get(7); + return t2 ? t2.dismissGroup(e2) : D({ code: L.NO_MODULE }); + } }, { key: "updateGroupProfile", value: function(e2) { + var t2 = this._get(7); + return t2 ? t2.updateGroupProfile(e2) : D({ code: L.NO_MODULE }); + } }, { key: "joinGroup", value: function(e2) { + var t2 = this._get(7); + return t2 ? t2.joinGroup(e2) : D({ code: L.NO_MODULE }); + } }, { key: "quitGroup", value: function(e2) { + var t2 = this._get(7); + return t2 ? t2.quitGroup(e2) : D({ code: L.NO_MODULE }); + } }, { key: "searchGroupByID", value: function(e2) { + var t2 = this._get(7); + return t2 ? t2.searchGroupByID(e2) : D({ code: L.NO_MODULE }); + } }, { key: "getGroupOnlineMemberCount", value: function(e2) { + var t2 = this._get(7); + return t2 ? t2.getGroupOnlineMemberCount(e2) : D({ code: L.NO_MODULE }); + } }, { key: "changeGroupOwner", value: function(e2) { + var t2 = this._get(7); + return t2 ? t2.changeGroupOwner(e2) : D({ code: L.NO_MODULE }); + } }, { key: "getGroupApplicationList", value: function() { + var e2 = this._get(7); + return e2 ? e2.getGroupApplicationList() : D({ code: L.NO_MODULE }); + } }, { key: "handleGroupApplication", value: function(e2) { + var t2 = this._get(7); + return t2 ? t2.handleGroupApplication(e2) : D({ code: L.NO_MODULE }); + } }, { key: "initGroupAttributes", value: function(e2) { + var t2 = this._get(7); + return t2 ? t2.initGroupAttributes(e2) : D({ code: L.NO_MODULE }); + } }, { key: "setGroupAttributes", value: function(e2) { + var t2 = this._get(7); + return t2 ? t2.setGroupAttributes(e2) : D({ code: L.NO_MODULE }); + } }, { key: "deleteGroupAttributes", value: function(e2) { + var t2 = this._get(7); + return t2 ? t2.deleteGroupAttributes(e2) : D({ code: L.NO_MODULE }); + } }, { key: "getGroupAttributes", value: function(e2) { + var t2 = this._get(7); + return t2 ? t2.getGroupAttributes(e2) : D({ code: L.NO_MODULE }); + } }, { key: "setGroupCounters", value: function(e2) { + var t2 = this._get(7); + return t2 ? t2.setGroupCounters(e2) : D({ code: L.NO_MODULE }); + } }, { key: "increaseGroupCounter", value: function(e2) { + var t2 = this._get(7); + return t2 ? t2.increaseGroupCounter(e2) : D({ code: L.NO_MODULE }); + } }, { key: "decreaseGroupCounter", value: function(e2) { + var t2 = this._get(7); + return t2 ? t2.decreaseGroupCounter(e2) : D({ code: L.NO_MODULE }); + } }, { key: "getGroupCounters", value: function(e2) { + var t2 = this._get(7); + return t2 ? t2.getGroupCounters(e2) : D({ code: L.NO_MODULE }); + } }, { key: "getGroupMemberList", value: function(e2) { + var t2 = this._get(7); + return t2 ? t2.getGroupMemberList(e2) : D({ code: L.NO_MODULE }); + } }, { key: "getGroupMemberProfile", value: function(e2) { + var t2 = this._get(7); + return t2 ? t2.getGroupMemberProfile(e2) : D({ code: L.NO_MODULE }); + } }, { key: "addGroupMember", value: function(e2) { + var t2 = this._get(7); + return t2 ? t2.addGroupMember(e2) : D({ code: L.NO_MODULE }); + } }, { key: "deleteGroupMember", value: function(e2) { + var t2 = this._get(7); + return t2 ? t2.deleteGroupMember(e2) : D({ code: L.NO_MODULE }); + } }, { key: "setGroupMemberMuteTime", value: function(e2) { + var t2 = this._get(7); + return t2 ? t2.setGroupMemberMuteTime(e2) : D({ code: L.NO_MODULE }); + } }, { key: "setGroupMemberRole", value: function(e2) { + var t2 = this._get(7); + return t2 ? t2.setGroupMemberRole(e2) : D({ code: L.NO_MODULE }); + } }, { key: "setGroupMemberNameCard", value: function(e2) { + var t2 = this._get(7); + return t2 ? t2.setGroupMemberNameCard(e2) : D({ code: L.NO_MODULE }); + } }, { key: "setGroupMemberCustomField", value: function(e2) { + var t2 = this._get(7); + return t2 ? t2.setGroupMemberCustomField(e2) : D({ code: L.NO_MODULE }); + } }, { key: "markGroupMemberList", value: function(e2) { + var t2 = this._get(7); + return t2 ? t2.markGroupMemberList(e2) : D({ code: L.NO_MODULE }); + } }, { key: "getJoinedCommunityList", value: function() { + return this._get(10).getJoinedCommunityList(); + } }, { key: "createTopicInCommunity", value: function(e2) { + return this._get(10).createTopicInCommunity(e2); + } }, { key: "deleteTopicFromCommunity", value: function(e2) { + return this._get(10).deleteTopicFromCommunity(e2); + } }, { key: "updateTopicProfile", value: function(e2) { + return this._get(10).updateTopicProfile(e2); + } }, { key: "getTopicList", value: function(e2) { + return this._get(10).getTopicList(e2); + } }, { key: "addSignalingListener", value: function(e2, t2, n2) { + var o2 = this._get(33); + o2 && o2.addSignalingListener(e2, this._safetyCallbackFactory.defense(e2, t2, n2), n2); + } }, { key: "removeSignalingListener", value: function(e2, t2, n2) { + var o2, i2 = this._safetyCallbackFactory.find(e2, t2); + null !== i2 && (o2 = this._get(33)) && (o2.removeSignalingListener(e2, i2, n2), this._safetyCallbackFactory.delete(e2, t2)); + } }, { key: "invite", value: function(e2) { + var t2 = this._get(33); + return t2 ? t2.invite(e2) : D({ code: L.NO_MODULE }); + } }, { key: "inviteSync", value: function(e2, t2, n2) { + var o2 = this._get(33); + return o2 ? o2.inviteSync(e2, t2, n2) : ""; + } }, { key: "inviteInGroup", value: function(e2) { + var t2 = this._get(33); + return t2 ? t2.invite(e2) : D({ code: L.NO_MODULE }); + } }, { key: "inviteInGroupSync", value: function(e2, t2, n2) { + var o2 = this._get(33); + return o2 ? o2.inviteSync(e2, t2, n2) : ""; + } }, { key: "cancel", value: function(e2) { + var t2 = this._get(33); + return t2 ? t2.cancel(e2) : D({ code: L.NO_MODULE }); + } }, { key: "accept", value: function(e2) { + var t2 = this._get(33); + return t2 ? t2.accept(e2) : D({ code: L.NO_MODULE }); + } }, { key: "reject", value: function(e2) { + var t2 = this._get(33); + return t2 ? t2.reject(e2) : D({ code: L.NO_MODULE }); + } }, { key: "getSignalingInfo", value: function(e2) { + var t2 = this._get(33); + return t2 ? t2.getSignalingInfo(e2) : null; + } }, { key: "modifyInvitation", value: function(e2) { + var t2 = this._get(33); + return t2 ? t2.modifyInvitation(e2) : D({ code: L.NO_MODULE }); + } }]), Rc), Ac = { login: 1, logout: 1, getLoginUser: 1, destroy: 1, on: 1, off: 1, ready: 1, setLogLevel: 1, joinGroup: 1, quitGroup: 1, registerPlugin: 1, getGroupOnlineMemberCount: 1, isReady: 1, addSignalingListener: 1, removeSignalingListener: 1, callExperimentalAPI: 1 }; + function Rc(e2) { + d(this, Rc); + e2 = { SDKAppID: e2.SDKAppID, unlimitedAVChatRoom: e2.unlimitedAVChatRoom || false, scene: e2.scene || "", oversea: e2.oversea || false, instanceID: qt(), devMode: e2.devMode || false, testEnv: e2.testEnv || false, proxyServer: e2.proxyServer || void 0, fileUploadProxy: e2.fileUploadProxy || void 0, fileDownloadProxy: e2.fileDownloadProxy || e2.fileUploadProxy || void 0, eventThrottling: false !== e2.eventThrottling, partialUpdatedConversations: true === e2.partialUpdatedConversations, modules: e2.modules || void 0 }; + this._m = new Lc(e2), this._safetyCallbackFactory = new Sc(this._m); + } + function Oc(e2) { + d(this, Oc), this._funcMap = /* @__PURE__ */ new Map(), this._m = e2, this._n = "SafetyCallback", this._reportCount = 0; + } + function Nc(t2) { + var n2 = this; + d(this, Nc); + var o2, e2 = new G("sdkConstruct"), i2 = (this._n = "ModuleManager", this._isReady = false, this._reason = L.USER_NOT_LOGGED_IN, this._startLoginTs = 0, this._map = /* @__PURE__ */ new Map(), this._optionalModuleMap = /* @__PURE__ */ new Map(), this._iEmitter = null, this._oEmitter = null, this._checkCount = 0, this._checkTimer = -1, this._map.set(12, new Ri(this, t2)), this._map.set(37, new Ec(this)), this._map.set(15, new pa(this)), this._map.set(27, new ir(this)), this._map.set(23, new Hs(this)), this._map.set(24, new nr(this)), this._map.set(26, new Js(this)), this._map.set(21, new ds(this)), this._map.set(20, new Vs(this)), this._map.set(1, new Ni(this)), this._map.set(2, new wa(this)), this._map.set(3, new Fa(this)), this._map.set(34, new qa(this)), this._map.set(31, new xa(this)), this._map.set(4, new Ai(this)), this._map.set(6, new qo(this)), this._map.set(11, new ci(this)), this._map.set(7, new yi(this)), this._map.set(10, new Di(this)), this._map.set(13, new ra(this)), this._map.set(32, new ur(this)), this._map.set(14, new ua(this)), this._map.set(17, new Ca(this)), this._map.set(18, new Va(this)), this._map.set(19, new Ha(this)), this._map.set(25, new Bs(this)), this._map.set(8, new tr(this)), this._map.set(28, new ar(this)), this._map.set(36, new sr(this)), this._map.set(29, new rr(this)), this._map.set(30, new cr(this)), this._map.set(33, new fr(this)), this._map.set(35, new Ir(this)), this._eventThrottleMap = /* @__PURE__ */ new Map(), this._eventThrottling = t2.eventThrottling, this._map.get(12).isPartialUpdatedConvs() && (this._eventThrottling = false), f(t2.modules) ? (Object.keys(t2.modules).forEach(function(e3) { + o2 = t2.modules[e3], "group-module" === e3 ? n2._map.set(7, new o2(n2)) : "relationship-module" === e3 ? n2._map.set(8, new o2(n2)) : "signaling-module" === e3 ? n2._map.set(33, new o2(n2)) : "follow-module" === e3 && n2._map.set(35, new o2(n2)), n2._optionalModuleMap.set(e3, 1); + }), this._map.get(12).setUsingChatCore(true)) : this._map.has(7) || this._map.get(12).setUsingChatCore(true), t2.instanceID), a2 = t2.SDKAppID, s2 = this._map.get(12).isIntl(), r2 = this._map.get(12).isUsingChatCore(), i2 = "instanceID:".concat(i2, " SDKAppID:").concat(a2, " isIntl:").concat(s2, " isUsingChatCore:").concat(r2, " host:").concat(xt()) + " isIOSWebView:".concat(be, " platform:").concat(De, " canIUseInflate:").concat(this.canIUseInflate()) + " workerAvailable:".concat(Ge, " eventThrottling:").concat(this._eventThrottling, " UserAgent:").concat(Te); + G.bindEventStatModule(this._map.get(14)), G.bindNetMonitorModule(this._map.get(15)), e2.setMessage("".concat(i2, " ").concat(function() { + var t3 = ""; + if (v) + try { + var e3 = I.getSystemInfoSync(), n3 = e3.model, o3 = e3.version, i3 = e3.system, a3 = e3.platform, s3 = e3.SDKVersion, t3 = "model:".concat(n3, " version:").concat(o3, " system:").concat(i3, " platform:").concat(a3, " SDKVersion:").concat(s3); + } catch (e4) { + t3 = ""; + } + return t3; + }())).end(), M.i("SDK ".concat(i2)), E.prototype._getErrMsg = this.getErrMsg.bind(this), this._readyList = void 0, this._ssoLogForReady = null, this._initReadyList(); + } + function Gc(e2) { + d(this, Gc), this._m = e2, this._n = "InflateModule", this._bLogForInflateOK = false, this._bLogForInflateError = false; + } + var Pc = {}, o = {}; + return o.create = function(e2) { + var t2 = "TencentCloudChat.create", n2 = 0, o2 = e2.SDKAppID; + if (R(o2)) + n2 = o2; + else if (n2 = parseInt(o2), isNaN(o2)) + return M.e("".concat(t2, " failed. Failed to parse the SDKAppID, please check the arguments")), null; + if (n2 && Pc[n2]) + return Pc[n2]; + M.l("".concat(t2)); + var s2, i2, o2 = new kc(y(y({}, e2), {}, { SDKAppID: n2 })), e2 = (o2.on(h.SDK_DESTROY, function(e3) { + Pc[e3.data.SDKAppID] = null, delete Pc[e3.data.SDKAppID]; + }), s2 = o2, i2 = /* @__PURE__ */ Object.create(null), Object.keys(Fn).forEach(function(a2) { + var t3; + s2[a2] && (t3 = new $(), i2[a2] = function() { + var e3 = Array.from(arguments); + return t3.use(function(e4, t4) { + i3 = a2; + var n3, o3, i3 = !(!(n3 = s2).isReady() && 1 !== Ac[i3]) || (o3 = { code: o3 = n3.getNotReadyReason(), message: "".concat(n3.getErrMsg(o3), " | ").concat(i3, " | ").concat(n3.getErrMsg(L.SDK_IS_NOT_READY)) }, n3.onError(o3), o3); + return true === i3 ? t4() : D(i3); + }).use(function(e4, t4) { + if (true === function(n3, o3, i3) { + if (void 0 === o3) + return true; + var a3 = true; + if (f(o3)) + Object.keys(o3).forEach(function(e6) { + var t5 = 1 === n3.length ? n3[0][e6] : void 0; + a3 = !!an(t5, o3[e6], i3, e6) && a3; + }); + else if (O(o3)) + for (var e5 = 0; e5 < o3.length; e5++) + a3 = !!an(n3[e5], o3[e5], i3, o3[e5].name) && a3; + if (a3) + return a3; + throw new Error("Params validate failed."); + }(e4, wn[a2], a2)) + return t4(); + }).use(function(e4, t4) { + return s2[a2].apply(s2, e4); + }), t3.run(e3); + }); + }), i2); + return Pc[n2] = e2, wn.hookGetAPITips(o2.getErrMsg.bind(o2)), M.l("".concat(t2, " ok")), e2; + }, o.TYPES = A, o.EVENT = h, o.TSignaling = Q, o.VERSION = "3.4.7", M.l("TencentCloudChat.VERSION:".concat(o.VERSION)), o; + }); + } +}); +export default require_chat(); +//# sourceMappingURL=@tencentcloud_chat.js.map diff --git a/jiuyi2/unpackage/dist/cache/.vite/deps/@tencentcloud_chat_modules_group-module__js.js b/jiuyi2/unpackage/dist/cache/.vite/deps/@tencentcloud_chat_modules_group-module__js.js new file mode 100644 index 00000000..5abcf0f2 --- /dev/null +++ b/jiuyi2/unpackage/dist/cache/.vite/deps/@tencentcloud_chat_modules_group-module__js.js @@ -0,0 +1,3339 @@ +import "./chunk-TDUMLE5V.js"; + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/@tencentcloud/chat/modules/group-module.js +var e = 2; +var t = 4; +var s = 10; +var o = 11; +var r = 12; +var i = 14; +var n = 17; +var a = 20; +var u = 23; +var p = 26; +var l = 27; +var c = 29; +var h = 30; +var g = 34; +var m = class { + constructor(e2 = 0, t2 = 0) { + this.high = e2, this.low = t2; + } + equal(e2) { + return null !== e2 && this.low === e2.low && this.high === e2.high; + } + toString() { + var e2 = Number(this.high).toString(16); + let t2 = Number(this.low).toString(16); + if (t2.length < 8) { + let e3 = 8 - t2.length; + for (; e3; ) + t2 = "0" + t2, e3--; + } + return e2 + t2; + } +}; +var d = { TEST: { CHINA: { DEFAULT: "wss://wss-dev.tim.qq.com" }, OVERSEA: { DEFAULT: "wss://wss-dev.tim.qq.com" }, SINGAPORE: { DEFAULT: "wss://wsssgp-dev.im.qcloud.com" }, KOREA: { DEFAULT: "wss://wsskr-dev.im.qcloud.com" }, GERMANY: { DEFAULT: "wss://wssger-dev.im.qcloud.com" }, IND: { DEFAULT: "wss://wssind-dev.im.qcloud.com" }, JPN: { DEFAULT: "wss://wssjpn-dev.im.qcloud.com" }, USA: { DEFAULT: "wss://wssusa-dev.im.qcloud.com" }, INDONESIA: { DEFAULT: "wss://wssidn-dev.im.qcloud.com" } }, PRODUCTION: { CHINA: { DEFAULT0: "wss://*w4c.my-imcloud.com", DEFAULT: "wss://wss.im.qcloud.com", BACKUP: "wss://wss.tim.qq.com", STAT: "https://events.im.qcloud.com", ANYCAST: "wss://162.14.13.203" }, OVERSEA: { DEFAULT0: "wss://*w4c.my-imcloud.com", DEFAULT: "wss://wss.im.qcloud.com", BACKUP: "wss://wss.my-imcloud.com", STAT: "https://api.my-imcloud.com" }, SINGAPORE: { DEFAULT0: "wss://*w4s.my-imcloud.com", DEFAULT: "wss://wsssgp.im.qcloud.com", BACKUP: "wss://wsssgp.my-imcloud.com", STAT: "https://apisgp.my-imcloud.com", ANYCAST: "wss://162.14.19.159" }, KOREA: { DEFAULT0: "wss://*w4k.my-imcloud.com", DEFAULT: "wss://wsskr.im.qcloud.com", BACKUP: "wss://wsskr.my-imcloud.com", STAT: "https://apikr.my-imcloud.com", ANYCAST: "wss://162.14.13.104" }, GERMANY: { DEFAULT0: "wss://*w4g.my-imcloud.com", DEFAULT: "wss://wssger.im.qcloud.com", BACKUP: "wss://wssger.my-imcloud.com", STAT: "https://apiger.my-imcloud.com", ANYCAST: "wss://162.14.3.17" }, IND: { DEFAULT0: "wss://*w4i.my-imcloud.com", DEFAULT: "wss://wssind.my-imcloud.com", BACKUP: "wss://wssind.im.qcloud.com", STAT: "https://apiind.my-imcloud.com", ANYCAST: "wss://162.14.18.188" }, JPN: { DEFAULT0: "wss://*w4j.my-imcloud.com", DEFAULT: "wss://wssjpn.im.qcloud.com", BACKUP: "wss://wssjpn.my-imcloud.com", STAT: "https://apijpn.my-imcloud.com" }, USA: { DEFAULT0: "wss://*w4u.my-imcloud.com", DEFAULT: "wss://wssusa.im.qcloud.com", BACKUP: "wss://wssusa.my-imcloud.com", STAT: "https://apiusa.my-imcloud.com", ANYCAST: "wss://162.14.10.42" }, INDONESIA: { DEFAULT0: "wss://*w4y.my-imcloud.com", DEFAULT: "wss://wssidn.im.qcloud.com", BACKUP: "wss://wssidn.my-imcloud.com", STAT: "https://apiidn.my-imcloud.com", ANYCAST: "wss://43.129.34.169" } } }; +var _ = { ANDROID: 2, IOS: 3, MAC: 4, WEB: 7, WX_MP: 8, QQ_MP: 9, TT_MP: 10, BAIDU_MP: 11, ALI_MP: 12, IPAD: 13, UNI_NATIVE_APP: 15, DONUT_NATIVE_APP: 19, NS_NATIVE_APP: 20, RN_NATIVE_APP: 21 }; +var f = "CHINA"; +var M = { HOST: { CURRENT: { DEFAULT: "wss://wss.im.qcloud.com", STAT: "https://events.im.qcloud.com" }, setCurrent(e2 = f) { + this.CURRENT = d.PRODUCTION[e2]; +} }, NAME: { OPEN_IM: "openim", OPEN_IM_MSG_EXT: "openim_msg_ext_http_svc", GRP: "group_open_http_svc", GRP_AV: "group_open_avchatroom_http_svc", GRP_COMMUNITY: "million_group_open_http_svc", GRP_ATTR: "group_open_attr_http_svc", FD: "sns", PROFILE: "profile", RECENT_CONTACT: "recentcontact", PIC: "openpic", BIG_GRP_NO_AUTH: "group_open_http_noauth_svc", BIG_GRP_POLLING: "group_open_long_polling_http_svc", BIG_GRP_POLLING_NO_AUTH: "group_open_long_polling_http_noauth_svc", IM_OPEN_STAT: "imopenstat", WEB_IM: "webim", IM_COS_SIGN: "im_cos_sign_svr", CUSTOM_UPLOAD: "im_cos_msg", HEARTBEAT: "heartbeat", IM_OPEN_PUSH: "im_open_push", IM_OPEN_STATUS: "im_open_status", IM_LONG_MSG: "im_long_msg", IM_CONFIG_MANAGER: "im_sdk_config_mgr", STAT_SERVICE: "StatSvc", OVERLOAD_PUSH: "OverLoadPush", IM_MSG_AUDIT_MGR: "im_msg_audit_mgr", TUIROOM_SVR: "tui_room_svr", IM_OPEN_TRANSLATE: "im_open_translate", IM_OPEN_SPEECH: "im_open_speech", MSG_SEARCH: "message_search", FOLLOW: "follow", OFFLINE_PUSH_REPORT: "offline_push_report", IM_MSG_LOGIC: "im_msg_db_logic" } }; +var I = { SEARCH_GRP_SNS: new m(0, Math.pow(2, 1)).toString(), AV_HISTORY_MSG: new m(0, Math.pow(2, 2)).toString(), GRP_COMMUNITY: new m(0, Math.pow(2, 3)).toString(), MSG_TO_SPECIFIED_GRP_MBR: new m(0, Math.pow(2, 4)).toString(), AV_MBR_LIST: new m(0, Math.pow(2, 6)).toString(), USER_STATUS: new m(0, Math.pow(2, 7)).toString(), CONV_MARK: new m(0, Math.pow(2, 9)).toString(), CONV_GROUP: new m(0, Math.pow(2, 10)).toString(), AV_BAN_MBR: new m(0, Math.pow(2, 11)).toString(), MSG_EXT: new m(0, Math.pow(2, 13)).toString(), GRP_COUNTER: new m(0, Math.pow(2, 15)).toString(), PLUGIN_TRANSLATE: new m(Math.pow(2, 6)).toString(), PLUGIN_VOICE_TO_TEXT: new m(Math.pow(2, 7)).toString(), PLUGIN_CS: new m(Math.pow(2, 8)).toString(), PLUGIN_PUSH: new m(Math.pow(2, 9)).toString(), PLUGIN_BOT: new m(Math.pow(2, 10)).toString(), MSG_REACTION: new m(Math.pow(2, 16)).toString(), FOLLOW: new m(Math.pow(2, 20)).toString() }; +var y = "group_profile"; +var D = "group_member_profile"; +var L = ["Type", "Name", "Introduction", "Notification", "FaceUrl", "Owner_Account", "CreateTime", "InfoSeq", "LastInfoTime", "LastMsgTime", "MemberNum", "MaxMemberNum", "ApplyJoinOption", "NextMsgSeq", "ShutUpAllMember", "InviteJoinOption"]; +var C = ["Role", "JoinTime", "MsgSeq", "MsgFlag"]; +var G = (M.HOST.setCurrent(f), "undefined" != typeof wx && "function" == typeof wx.getSystemInfoSync && Boolean(wx.getSystemInfoSync().fontSizeSetting)); +var b = (G && wx.createGamePortal, "undefined" != typeof qq && "function" == typeof qq.getSystemInfoSync && Boolean(qq.getSystemInfoSync().fontSizeSetting)); +var A = "undefined" != typeof tt && "function" == typeof tt.getSystemInfoSync && Boolean(tt.getSystemInfoSync().fontSizeSetting); +var T = "undefined" != typeof swan && "function" == typeof swan.getSystemInfoSync && Boolean(swan.getSystemInfoSync().fontSizeSetting); +var S = "undefined" != typeof my && "function" == typeof my.getSystemInfoSync && Boolean(my.getSystemInfoSync().fontSizeSetting); +var v = "undefined" != typeof jd && "function" == typeof jd.getSystemInfoSync; +var P = "undefined" != typeof uni && "undefined" == typeof window && "function" == typeof uni.requireNativePlugin; +var R = G && "object" == typeof wx.miniapp; +var $ = G || b || A || T || S || P || v; +var E = "undefined" == typeof window && !$ && "undefined" != typeof global && void 0 !== global.NativeScriptGlobals; +var w = "undefined" != typeof global && (void 0 !== global.nativeModuleProxy || void 0 !== global.ReactNative); +var U = "undefined" != typeof uni ? !$ : "undefined" != typeof window && !$ && !w; +var N = (b ? qq : A ? tt : T ? swan : S ? my : G ? wx : P ? uni : v && jd, U && window && window.navigator && window.navigator.userAgent || ""); +var q = /(micromessenger|webbrowser)/i.test(N); +var k = function() { + let e2 = "WEB"; + return q ? e2 = "WEB" : b ? e2 = "QQ_MP" : A ? e2 = "TT_MP" : T ? e2 = "BAIDU_MP" : S ? e2 = "ALI_MP" : G ? e2 = R ? "DONUT_NATIVE_APP" : "WX_MP" : P ? e2 = "UNI_NATIVE_APP" : E ? e2 = "NS_NATIVE_APP" : w && (e2 = "RN_NATIVE_APP"), _[e2]; +}(); +var O = (!function() { + var e2 = N.match(/OS (\d+)_/i); + e2 && e2[1] && e2[1]; +}(), function() { + var e2, t2, s2 = N.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i); + s2 && (e2 = s2[1] && parseFloat(s2[1]), t2 = s2[2] && parseFloat(s2[2]), e2) && t2 && parseFloat(s2[1] + "." + s2[2]); +}(), /MSIE/.test(N) || -1 < N.indexOf("Trident") && -1 < N.indexOf("rv:11.0")); +var F; +var x; +!function() { + var e2 = /MSIE\s(\d+)\.\d/.exec(N), e2 = e2 && parseFloat(e2[1]); + !e2 && /Trident\/7.0/i.test(N) && /rv:11.0/.test(N); +}(), F = "undefined" != typeof console ? console : "undefined" != typeof global && global.console ? global.console : "undefined" != typeof window && window.console ? window.console : {}; +var V = function() { +}; +var H = ["assert", "clear", "count", "debug", "dir", "dirxml", "error", "group", "groupCollapsed", "groupEnd", "info", "log", "profile", "profileEnd", "table", "time", "timeEnd", "timeStamp", "trace", "warn"]; +var j = H.length; +for (; j--; ) + x = H[j], console[x] || (F[x] = V); +var K = F; +var B = "TIMTextElem"; +var J = "TIMImageElem"; +var W = "TIMSoundElem"; +var z = "TIMFileElem"; +var X = "TIMFaceElem"; +var Y = "TIMVideoFileElem"; +var Q = "TIMLocationElem"; +var Z = "TIMGroupTipElem"; +var ee = "TIMGroupSystemNoticeElem"; +var te = "TIMCustomElem"; +var se = "TIMRelayElem"; +var oe = "High"; +var re = "Normal"; +var ie = "Low"; +var ne = "Lowest"; +var ae = "C2C"; +var ue = "GROUP"; +var pe = "TOPIC"; +var le = "@TIM#SYSTEM"; +var ce = "Private"; +var he = "Public"; +var ge = "ChatRoom"; +var me = "AVChatRoom"; +var de = "Community"; +var _e = "Room"; +var fe = "Live"; +var Me = "Owner"; +var Ie = "Admin"; +var ye = "Member"; +var De = "Custom"; +var Le = 1; +var Ce = 3; +var Ge = 4; +var be = 5; +var Ae = "AcceptAndNotify"; +var Te = "AlreadyInGroup"; +var Se = "__kImSDK_MesssageAtALL__"; +var ve = function() { + return (/* @__PURE__ */ new Date()).getTime() + 0; +}; +var Pe = { JPG: 1, JPEG: 1, GIF: 2, PNG: 3, BMP: 4, UNKNOWN: 255 }; +var Re = { 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 $e = "JoinedSuccess"; +var Ee = "WaitAdminApproval"; +var we = "@TGS#_"; +var Ue = "@TOPIC#_"; +var Ne = Object.prototype.hasOwnProperty; +function qe(e2) { + if (null == e2) + return true; + if ("boolean" == typeof e2) + return false; + if ("number" == typeof e2) + return 0 === e2; + if ("string" == typeof e2) + return 0 === e2.length; + if ("function" == typeof e2) + return 0 === e2.length; + if (Array.isArray(e2)) + return 0 === e2.length; + if (e2 instanceof Error) + return "" === e2.message; + if (He(e2)) { + for (const t2 in e2) + if (Ne.call(e2, t2)) + return false; + return true; + } + return !!(ke(e2) || Oe(e2) || Fe(e2)) && 0 === e2.size; +} +var ke = function(e2) { + return "map" === Je(e2); +}; +var Oe = function(e2) { + return "set" === Je(e2); +}; +var Fe = function(e2) { + return "file" === Je(e2); +}; +var xe = function(e2) { + return null !== e2 && ("number" == typeof e2 && !isNaN(+e2) || "object" == typeof e2 && e2.constructor === Number); +}; +var Ve = function(e2) { + return "string" == typeof e2; +}; +var He = function(e2) { + if ("object" != typeof e2 || null === e2) + return false; + e2 = Object.getPrototypeOf(e2); + if (null === e2) + return true; + let t2 = e2; + for (; null !== Object.getPrototypeOf(t2); ) + t2 = Object.getPrototypeOf(t2); + return e2 === t2; +}; +var je = function(e2) { + return "function" == typeof Array.isArray ? Array.isArray(e2) : "array" === Je(e2); +}; +var Ke = function(e2) { + return void 0 === e2; +}; +var Be = function(e2) { + return je(e2) || null !== e2 && "object" == typeof e2; +}; +var Je = function(e2) { + return Object.prototype.toString.call(e2).match(/^\[object (.*)\]$/)[1].toLowerCase(); +}; +var We = (Date.now || (Date.now = function() { + return (/* @__PURE__ */ new Date()).getTime(); +}), function(s2, o2, r2, i2) { + if (!Be(s2) || !Be(o2)) + return 0; + let n2 = 0; + var a2, u2 = Object.keys(o2); + for (let e2 = 0, t2 = u2.length; e2 < t2; e2++) + if (a2 = u2[e2], !(Ke(o2[a2]) || r2 && r2.includes(a2))) + if (Be(s2[a2]) && Be(o2[a2])) + n2 += We(s2[a2], o2[a2], r2, i2); + else { + if (i2 && i2.includes(o2[a2])) + continue; + s2[a2] !== o2[a2] && (s2[a2] = o2[a2], n2 += 1); + } + return n2; +}); +var ze = function(e2) { + e2 = e2 || 99999999; + return Math.round(Math.random() * e2); +}; +var Xe = {}; +var Ye = function(e2) { + if (0 === Object.getOwnPropertyNames(e2).length) + return /* @__PURE__ */ Object.create(null); + var t2, s2 = Array.isArray(e2) ? [] : /* @__PURE__ */ Object.create(null); + for (const o2 in e2) + null !== e2[o2] ? void 0 !== e2[o2] ? (t2 = typeof e2[o2], 0 <= ["string", "number", "function", "boolean"].indexOf(t2) ? s2[o2] = e2[o2] : s2[o2] = Ye(e2[o2])) : s2[o2] = void 0 : s2[o2] = null; + return s2; +}; +function Qe(o2, e2) { + if (!je(o2) || !je(e2)) + return false; + let r2 = false; + return e2.forEach(({ key: t2, value: e3 }) => { + var s2 = o2.find((e4) => e4.key === t2); + s2 ? s2.value !== e3 && (s2.value = e3, r2 = true) : (o2.push({ key: t2, value: e3 }), r2 = true); + }), r2; +} +function Ze(e2) { + return qe(e2) ? [] : e2.filter((e3) => true === e3.isModified); +} +function et(e2) { + return qe(e2) ? [] : e2.filter((e3) => false === e3.isModified); +} +var st = (e2) => e2 === me; +var ot = ({ type: e2, groupID: t2 }) => e2 === de || ("" + t2).startsWith(we) && !("" + t2).includes(Ue); +var rt = (e2) => ("" + e2).startsWith(we) && ("" + e2).includes(Ue); +function it(e2) { + return e2.split(Ue)[0]; +} +function nt() { + return !O && !$; +} +function at(e2, t2 = true, s2 = true) { + var o2 = Date.now(); + return t2 ? s2 ? o2 - e2 + " ms" : Math.round((o2 - e2) / 1e3) + " s" : s2 ? o2 - e2 : Math.round((o2 - e2) / 1e3); +} +var ut = 0; +function pt() { + return nt() ? "%c Chat %c" : "Chat"; +} +function lt() { + (e2 = /* @__PURE__ */ new Date()).setTime(ve()); + var e2; + return e2.toLocaleTimeString("en-US", { hour12: false }) + "." + function(e3) { + let t2; + switch (e3.toString().length) { + case 1: + t2 = "00" + e3; + break; + case 2: + t2 = "0" + e3; + break; + default: + t2 = e3; + } + return t2; + }(e2.getMilliseconds()); +} +var ct = { arguments2String(s2) { + let o2 = ""; + if (1 === s2.length) + o2 = s2[0]; + else + for (let e2 = 0, t2 = s2.length; e2 < t2; e2++) { + if (Be(s2[e2])) + try { + o2 += s2[e2] instanceof Error ? JSON.stringify(s2[e2], ["message", "code"]) : JSON.stringify(s2[e2]); + } catch (e3) { + o2 += e3 ? e3.message : ""; + break; + } + else + o2 += s2[e2]; + o2 += " "; + } + return o2; +}, _exec(e2, t2) { + nt() ? K[e2](pt(), "background:#0abf5b; padding:1px; border-radius:3px; color: #fff", "background:transparent", lt(), t2) : K[e2](`${pt()} ${lt()} ` + t2); +}, d: function() { + var e2; + ut <= -1 && (e2 = this.arguments2String(arguments), this._exec("debug", e2)); +}, l: function() { + var e2; + ut <= 0 && (e2 = this.arguments2String(arguments), this._exec("log", e2)); +}, log: function() { + var e2; + ut <= 0 && (e2 = this.arguments2String(arguments), this._exec("log", e2)); +}, i: function() { + var e2; + ut <= 1 && (e2 = this.arguments2String(arguments), this._exec("info", e2)); +}, w: function() { + var e2; + ut <= 2 && (e2 = this.arguments2String(arguments), this._exec("warn", e2)); +}, e: function() { + var e2; + ut <= 3 && (e2 = this.arguments2String(arguments), this._exec("error", e2)); +}, setLevel: function(e2) { + e2 < 4 && this._exec("log", "set level from " + ut + " to " + e2), ut = e2; +}, getLevel: function() { + return ut; +} }; +var ht = function(e2) { + return { code: 0, data: e2 || {} }; +}; +var gt = class extends Error { + constructor(e2) { + super(); + var { code: e2, message: t2, data: s2 } = e2; + this.code = e2, t2 ? this.message = t2 : this._getErrMsg && (this.message = this._getErrMsg(this.code)), this.data = s2 || {}; + } +}; +var mt = 2101; +var dt = 2114; +var _t = 2600; +var ft = 2602; +var Mt = 2603; +var It = 2620; +var yt = 2621; +var Dt = 2623; +var Lt = 2660; +var Ct = 2661; +var Gt = 2662; +var bt = 2681; +var At = 2683; +var Tt = 2684; +var St = 2685; +var vt = 2686; +var Pt = 2687; +var Rt = 2805; +var $t = 2903; +var Et = 3122; +var wt = 3123; +var Ut = "onMessageReceived"; +var Nt = "onMessageModified"; +var qt = "onMessageRevoked"; +var kt = "onGroupListUpdated"; +var Ot = "groupAttributesUpdated"; +var Ft = "onGroupCounterUpdated"; +var xt = "onTopicUpdated"; +var Vt = "error"; +var Ht = null; +var jt = function(e2) { + return Promise.resolve(ht(e2)); +}; +var Kt = function(e2, t2 = false) { + if (e2 instanceof gt) + return t2 && null !== Ht && Ht.emit(Vt, e2), Promise.reject(e2); + if (e2 instanceof Error) { + const e3 = new gt({ code: $t }); + return t2 && null !== Ht && Ht.emit(Vt, e3), Promise.reject(e3); + } + return Ke(e2) || Ke(e2.code) ? Promise.reject(new gt({ code: $t })) : (e2 = new gt(e2), t2 && null !== Ht && Ht.emit(Vt, e2), Promise.reject(e2)); +}; +var Bt = { A2KEY_AND_TINYID_UPDATED: "_inner1", CLOUD_CONFIG: "_inner2", PROFILE_UPDATED: "_inner3", CONV_SYNC_COMPLETED: "_inner4", C2C_UNREAD_HANDLE_COMPLETED: "_inner5" }; +var Jt = "messageReceivedGroup"; +var Wt = "messageReceivedGroupAVPush"; +var zt = "messageReceivedGroupAVPull"; +var Xt = { info: 4, warning: 5, error: 6 }; +var Yt = { wifi: 1, "2g": 2, "3g": 3, "4g": 4, "5g": 5, unknown: 6, none: 7, online: 8 }; +var Qt = { login: 4, plugin_search: 16, plugin_translate: 16, plugin_voice_to_text: 16, plugin_cs: 16, plugin_push: 16, plugin_bot: 16, plugin_emoji_reaction: 16 }; +var Zt = class _Zt { + constructor(e2) { + this._n = "SSOLogData", this.eventType = Qt[e2] || 0, this.timestamp = 0, this.networkType = 8, this.code = 0, this.message = "", this.moreMessage = "", this.extension = e2, this.costTime = 0, this.duplicate = false, this.level = 4, this.uiPlatform = void 0, this._sentFlag = false, this._startts = ve(); + } + static bindEventStatModule(e2) { + _Zt.prototype._eventStatModule = e2; + } + static bindNetMonitorModule(e2) { + _Zt.prototype._netMonitorModule = e2; + } + updateTimeStamp() { + this.timestamp = ve(); + } + start(e2) { + return this._startts = e2, this; + } + end(e2 = false) { + if (!this._sentFlag) { + if (this._netMonitorModule) { + const e3 = this._netMonitorModule.getNetworkType(); + this.setNetworkType(e3); + } + var t2 = ve(); + 0 === this.costTime && (this.costTime = t2 - this._startts), this.setMoreMessage(`startts:${this._startts} endts:` + t2), e2 ? (this._sentFlag = true, this._eventStatModule && this._eventStatModule.pushIn(this)) : setTimeout(() => { + this._sentFlag = true, this._eventStatModule && this._eventStatModule.pushIn(this); + }, 0); + } + } + setError(t2) { + if (t2 instanceof Error) { + if (!this._sentFlag) { + let e2 = true; + if (e2 = this._netMonitorModule ? this._netMonitorModule.isOnline() : e2) + t2.code && this.setCode(t2.code), t2.message && this.setMoreMessage(t2.message); + else { + const t3 = Rt; + this.setCode(t3); + } + this.setLevel("error"); + } + } else + ct.w(this._n + ".setError value not instanceof Error, please check!"); + return this; + } + setCode(e2) { + return Ke(e2) || this._sentFlag || ("ECONNABORTED" === e2 && (this.code = 103), xe(e2) ? this.code = e2 : ct.w(this._n + ".setCode value not a number, please check!", e2, typeof e2)), this; + } + setMessage(e2) { + return Ke(e2) || this._sentFlag || (xe(e2) && (this.message = e2.toString()), Ve(e2) && (this.message = e2)), this; + } + setCostTime(e2) { + return this.costTime = e2, this; + } + setLevel(e2) { + return Ke(e2) || this._sentFlag || (this.level = Xt[e2]), this; + } + setMoreMessage(e2) { + return qe(this.moreMessage) ? this.moreMessage = "" + e2 : this.moreMessage += " " + e2, this; + } + setNetworkType(e2) { + return Ke(e2) ? ct.w(this._n + ".setNetworkType value is undefined, please check!") : (e2 = Yt[e2.toLowerCase()], Ke(e2) || (this.networkType = e2)), this; + } + getStartTs() { + return this._startts; + } + setUIPlatform(e2) { + return this.uiPlatform = e2, this; + } + setExtension(e2) { + return this.extension = e2, this; + } + setEventType(e2) { + return this.eventType = e2, this; + } +}; +var es = "send_group_msg"; +var ts = "get_joined_group_list"; +var ss = "get_group_self_member_info"; +var os = "create_group"; +var rs = "destroy_group"; +var is = "modify_group_base_info"; +var ns = "apply_join_group"; +var as = "apply_join_group_noauth"; +var us = "quit_group"; +var ps = "get_group_public_info"; +var ls = "change_group_owner"; +var cs = "handle_apply_join_group"; +var hs = "handle_invite_join_permission_group"; +var gs = "handle_invite_join_group"; +var ms = "group_msg_recall"; +var ds = "msg_read_report"; +var _s = "group_msg_get"; +var fs = "get_group_msg_receipt"; +var Ms = "group_msg_receipt"; +var Is = "get_group_msg_receipt_detail"; +var ys = "get_pendency"; +var Ds = "deletemsg"; +var Ls = "get_msg"; +var Cs = "get_msg_noauth"; +var Gs = "get_online_member_num"; +var bs = "delete_group_ramble_msg_by_seq"; +var As = "modify_group_msg"; +var Ts = "set_group_attr"; +var Ss = "modify_group_attr"; +var vs = "delete_group_attr"; +var Ps = "clear_group_attr"; +var Rs = "get_group_attr"; +var $s = "group_set_key_values"; +var Es = "group_get_key_values"; +var ws = "batch_get_group_notify"; +var Us = "update_group_counter"; +var Ns = "get_group_counter"; +var qs = "get_group_member_info"; +var ks = "get_members"; +var Os = "get_specified_group_member_info"; +var Fs = "add_group_member"; +var xs = "delete_group_member"; +var Vs = "ban_group_member"; +var Hs = "modify_group_member_info"; +var js = "modify_user_info"; +var Ks = "unSend"; +var Bs = "success"; +var Js = "notStart"; +var Ws = "resolved"; +var zs = "rejected"; +var Xs = class { + constructor(e2) { + this.type = B, this.content = { text: e2.text || "" }; + } + setText(e2) { + this.content.text = e2; + } + sendable() { + return 0 !== this.content.text.length; + } +}; +function Ys(t2, s2, o2, r2 = []) { + if (t2) { + let e2 = t2; + return s2 && (t2.startsWith("http://") ? e2 = t2.replace(/^http:\/\/[^/]+/, s2) : t2.startsWith("https://") && (e2 = t2.replace(/^https:\/\/[^/]+/, s2))), e2 = o2 && -1 === e2.indexOf("authKey=") && eo(e2, r2) ? -1 < e2.indexOf("?") ? e2 + "&authKey=" + o2 : e2 + "?authKey=" + o2 : e2; + } +} +function Qs(e2, t2, s2 = []) { + if (e2 === Y) + eo((t2[0].content || t2[0].payload).snapshotUrl, s2) && (t2[0].content ? (t2[0].content.snapshotUrl = Zs(t2[0].content.snapshotUrl), t2[0].content.thumbUrl = Zs(t2[0].content.thumbUrl)) : (t2[0].payload.snapshotUrl = Zs(t2[0].payload.snapshotUrl), t2[0].payload.thumbUrl = Zs(t2[0].payload.thumbUrl))); + else if (e2 === z) + eo((t2[0].content || t2[0].payload).fileUrl, s2) && (t2[0].content ? t2[0].content.fileUrl = Zs(t2[0].content.fileUrl) : t2[0].payload.fileUrl = Zs(t2[0].payload.fileUrl)); + else if (e2 === se) { + const { downloadKey: e3 = "", messageList: s3 = [] } = t2[0].content || t2[0].payload; + qe(e3) && s3.forEach((e4) => { + Qs(e4.messageBody[0].type, e4.messageBody); + }); + } + return t2; +} +function Zs(e2) { + if (!e2) + return e2; + if (-1 === e2.indexOf("authKey=")) + return e2; + var e2 = e2.split("?"), t2 = e2[1].split("&"); + let s2 = 0; + for (let e3 = 0; e3 < t2.length; e3++) + if (-1 < t2[e3].indexOf("authKey=")) { + s2 = e3; + break; + } + return t2.splice(s2, 1), 0 < t2.length ? e2[0] + "?" + t2.join("&") : e2[0]; +} +function eo(e2, t2) { + let s2 = false; + if (e2) { + var e2 = e2.match(/:\/\/([0-9]?\.)?(.[^/:]+)/), o2 = e2 && e2[2] || ""; + if (o2.includes("rich-dev")) + return true; + for (let e3 = 0; e3 < t2.length; e3++) + if (o2.endsWith(t2[e3])) { + s2 = true; + break; + } + } + return s2; +} +var to = class { + constructor(e2, t2, s2, o2) { + this._imageMemoryURL = "", this._fileDownloadProxy = t2, this._authKey = s2, this._fileDNList = o2, $ || w ? this.createImageDataASURL(e2.file) : this.createImageDataASURLInWeb(e2.file), this._initImageInfoModel(), this.type = J, this._percent = 0, this.content = { imageFormat: e2.imageFormat || Pe.UNKNOWN, uuid: e2.uuid, imageInfoArray: [] }, this.initImageInfoArray(e2.imageInfoArray), this._autoFixUrl(); + } + _initImageInfoModel() { + const t2 = this; + this._ImageInfoModel = function(e2) { + this.instanceID = ze(9999999), this.sizeType = e2.type || 0, this.type = 0, this.size = e2.size || 0, this.width = e2.width || 0, this.height = e2.height || 0, this.imageUrl = e2.imageUrl || e2.url || "", this.url = Ys(e2.url || t2._imageMemoryURL, t2._fileDownloadProxy, t2._authKey, t2._fileDNList); + }, this._ImageInfoModel.prototype = { setSizeType(e2) { + this.sizeType = e2; + }, setType(e2) { + this.type = e2; + }, setImageUrl(e2) { + e2 && (this.imageUrl = e2); + }, getImageUrl() { + return this.imageUrl; + } }; + } + initImageInfoArray(e2) { + let t2 = 0, s2 = null, o2; + for (; t2 <= 2; ) + o2 = Ke(e2) || Ke(e2[t2]) ? { type: 0, size: 0, width: 0, height: 0, url: "" } : e2[t2], (s2 = new this._ImageInfoModel(o2)).setSizeType(t2 + 1), s2.setType(t2), this.addImageInfo(s2), t2++; + this.updateAccessSideImageInfoArray(); + } + updateImageInfoArray(t2) { + var s2, o2 = this.content.imageInfoArray.length; + for (let e2 = 0; e2 < o2; e2++) + s2 = this.content.imageInfoArray[e2], t2[e2].size && (s2.size = t2[e2].size), t2[e2].url && s2.setImageUrl(t2[e2].url), t2[e2].width && (s2.width = t2[e2].width), t2[e2].height && (s2.height = t2[e2].height); + } + _autoFixUrl() { + var t2 = this.content.imageInfoArray.length; + let s2 = "", o2 = ""; + var r2 = ["http", "https"], i2 = null; + for (let e2 = 0; e2 < t2; e2++) + this.content.imageInfoArray[e2].url && "" !== (i2 = this.content.imageInfoArray[e2]).imageUrl && (o2 = i2.imageUrl.slice(0, i2.imageUrl.indexOf("://") + 1), s2 = i2.imageUrl.slice(i2.imageUrl.indexOf("://") + 1), r2.indexOf(o2) < 0 && (o2 = "https:"), this.content.imageInfoArray[e2].setImageUrl([o2, s2].join(""))); + } + updatePercent(e2) { + this._percent = e2, 1 < this._percent && (this._percent = 1); + } + updateImageFormat(e2) { + this.content.imageFormat = Pe[e2.toUpperCase()] || Pe.UNKNOWN; + } + createImageDataASURLInWeb(e2) { + void 0 !== e2 && 0 < e2.files.length && (this._imageMemoryURL = window.URL.createObjectURL(e2.files[0])); + } + createImageDataASURL(e2) { + e2 && e2.url && (this._imageMemoryURL = e2.url); + } + replaceImageInfo(e2, t2) { + this.content.imageInfoArray[t2] instanceof this._ImageInfoModel || (this.content.imageInfoArray[t2] = e2); + } + addImageInfo(e2) { + 3 <= this.content.imageInfoArray.length || this.content.imageInfoArray.push(e2); + } + updateAccessSideImageInfoArray() { + var e2 = this.content.imageInfoArray, { width: t2 = 0, height: s2 = 0 } = e2[0]; + if (0 !== t2 && 0 !== s2) { + var o2 = e2, r2 = o2[2]; + o2[2] = o2[1], o2[1] = r2; + for (let e3 = 0; e3 < o2.length; e3++) + o2[e3].setType(e3); + Object.assign(e2[2], function(e3) { + const { originUrl: t3, originWidth: s3, originHeight: o3, min: r3 = 198 } = e3, i2 = parseInt(s3), n2 = parseInt(o3), a2 = { url: void 0, width: 0, height: 0 }; + if ((i2 <= n2 ? i2 : n2) <= r3) + a2.url = t3, a2.width = i2, a2.height = n2; + else { + n2 <= i2 ? (a2.width = Math.ceil(i2 * r3 / n2), a2.height = r3) : (a2.width = r3, a2.height = Math.ceil(n2 * r3 / i2)); + const e4 = t3 && -1 < t3.indexOf("?") ? t3 + "&" : t3 + "?"; + a2.url = 198 === r3 ? e4 + "imageView2/3/w/198/h/198" : e4 + "imageView2/3/w/720/h/720"; + } + if (Ke(t3)) { + const { url: e4, ...t4 } = a2; + return t4; + } + return a2; + }({ originWidth: t2, originHeight: s2, min: 720 })); + } + } + sendable() { + return 0 !== this.content.imageInfoArray.length && "" !== this.content.imageInfoArray[0].imageUrl && 0 !== this.content.imageInfoArray[0].size; + } +}; +var so = class { + constructor(e2) { + this.type = X, this.content = e2 || null; + } + sendable() { + return null !== this.content; + } +}; +var oo = class { + constructor(e2, t2, s2, o2) { + this.type = W, this._percent = 0, this.content = { downloadFlag: 2, second: e2.second, size: e2.size, url: Ys(e2.url, t2, s2, o2), remoteAudioUrl: e2.url || "", uuid: e2.uuid }; + } + updatePercent(e2) { + this._percent = e2, 1 < this._percent && (this._percent = 1); + } + updateAudioUrl(e2) { + this.content.remoteAudioUrl = e2; + } + sendable() { + return "" !== this.content.remoteAudioUrl; + } +}; +var ro = { from: true, groupID: true, groupName: true, to: true }; +var io = class { + constructor(e2) { + this.type = Z, this.content = {}, this._initContent(e2); + } + _initContent(t2) { + Object.keys(t2).forEach((e2) => { + switch (e2) { + case "remarkInfo": + break; + case "groupProfile": + this.content.groupProfile = {}, this._initGroupProfile(t2[e2]); + break; + case "operatorInfo": + this.content.operatorInfo = {}, this._initOperatorInfo(t2[e2]); + break; + case "memberInfoList": + case "msgMemberInfo": + this._updateMemberList(t2[e2]); + break; + case "memberExtraInfo": + case "onlineMemberInfo": + break; + case "memberNum": + this.content[e2] = t2[e2], this.content.memberCount = t2[e2]; + break; + case "newGroupProfile": + this.content.newGroupProfile = {}, this._initNewGroupProfile(t2[e2]); + break; + default: + this.content[e2] = t2[e2]; + } + }), this.content.userIDList || (this.content.userIDList = [this.content.operatorID]); + } + _initGroupProfile(t2) { + var s2 = Object.keys(t2); + for (let e2 = 0; e2 < s2.length; e2++) { + var o2 = s2[e2]; + ro[o2] && (this.content.groupProfile[o2] = t2[o2]); + } + } + _initOperatorInfo(t2) { + var s2 = Object.keys(t2); + for (let e2 = 0; e2 < s2.length; e2++) { + var o2 = s2[e2]; + this.content.operatorInfo[o2] = t2[o2]; + } + } + _updateMemberList(e2) { + qe(this.content.memberList) ? this.content.memberList = e2 : this.content.memberList.forEach((t2) => { + e2.forEach((e3) => { + t2.userID === e3.userID && Object.assign(t2, e3); + }); + }); + } + _initNewGroupProfile(t2) { + var s2 = Object.keys(t2); + for (let e2 = 0; e2 < s2.length; e2++) { + var o2 = s2[e2]; + this.content.newGroupProfile[o2] = "muteAllMembers" !== o2 ? t2[o2] : 1 === t2[o2]; + } + } +}; +var no = { from: true, groupID: true, groupName: true, to: true, groupType: true }; +var ao = class { + constructor(e2) { + this.type = ee, this.content = {}, this._initContent(e2); + } + _initContent(t2) { + Object.keys(t2).forEach((e2) => { + switch (e2) { + case "memberInfoList": + break; + case "remarkInfo": + this.content.handleMessage = t2[e2]; + break; + case "groupProfile": + this.content.groupProfile = {}, this._initGroupProfile(t2[e2]); + break; + default: + this.content[e2] = t2[e2]; + } + }); + } + _initGroupProfile(t2) { + var s2 = Object.keys(t2); + for (let e2 = 0; e2 < s2.length; e2++) { + var o2 = s2[e2]; + no[o2] && ("groupName" === o2 ? this.content.groupProfile.name = t2[o2] : this.content.groupProfile[o2] = t2[o2]); + } + } +}; +var uo = class { + constructor(e2, t2, s2, o2) { + this.type = z, this._percent = 0; + var r2 = this._getFileInfo(e2); + this.content = { downloadFlag: 2, fileUrl: Ys(e2.url || e2.fileUrl, t2, s2, o2) || "", uuid: e2.uuid, fileName: r2.name || "", fileSize: r2.size || 0 }; + } + _getFileInfo(e2) { + if (!Ke(e2.fileName) && !Ke(e2.fileSize)) + return { size: e2.fileSize, name: e2.fileName }; + var t2 = e2.file.files[0]; + if (P) { + if (t2.path && -1 !== t2.path.indexOf(".")) { + const e3 = t2.path.slice(t2.path.lastIndexOf(".") + 1).toLowerCase(); + t2.type = e3, t2.name || (t2.name = ze(999999) + "." + e3); + } + t2.name || (t2.type = "", t2.name = t2.path.slice(t2.path.lastIndexOf("/") + 1).toLowerCase()), t2.suffix && (t2.type = t2.suffix), t2.url || (t2.url = t2.path); + } + return { size: t2.size, name: t2.name }; + } + updatePercent(e2) { + this._percent = e2, 1 < this._percent && (this._percent = 1); + } + updateFileUrl(e2) { + this.content.fileUrl = e2; + } + sendable() { + return "" !== this.content.fileUrl && "" !== this.content.fileName && 0 !== this.content.fileSize; + } +}; +var po = class { + constructor(e2) { + this.type = te, this.content = { data: e2.data || "", description: e2.description || "", extension: e2.extension || "" }; + } + setData(e2) { + return this.content.data = e2, this; + } + setDescription(e2) { + return this.content.description = e2, this; + } + setExtension(e2) { + return this.content.extension = e2, this; + } + sendable() { + return 0 !== this.content.data.length || 0 !== this.content.description.length || 0 !== this.content.extension.length; + } +}; +var lo = class { + constructor(e2, t2, s2, o2) { + this.type = Y, this._percent = 0, this.content = { remoteVideoUrl: e2.remoteVideoUrl || e2.videoUrl || "", videoFormat: e2.videoFormat, videoSecond: parseInt(e2.videoSecond, 10), videoSize: e2.videoSize, videoUrl: Ys(e2.videoUrl, t2, s2, o2), videoDownloadFlag: 2, videoUUID: e2.videoUUID, thumbUUID: e2.thumbUUID, thumbFormat: e2.thumbFormat, thumbWidth: e2.thumbWidth, snapshotWidth: e2.thumbWidth, thumbHeight: e2.thumbHeight, snapshotHeight: e2.thumbHeight, thumbSize: e2.thumbSize, snapshotSize: e2.thumbSize, thumbDownloadFlag: 2, thumbUrl: Ys(e2.thumbUrl, t2, s2, o2), snapshotUrl: Ys(e2.thumbUrl, t2, s2, o2) }; + } + updatePercent(e2) { + this._percent = e2, 1 < this._percent && (this._percent = 1); + } + updateVideoUrl(e2) { + e2 && (this.content.remoteVideoUrl = e2); + } + updateSnapshotInfo(e2) { + var { snapshotUrl: e2, snapshotWidth: t2, snapshotHeight: s2 } = e2; + qe(e2) || (this.content.thumbUrl = this.content.snapshotUrl = e2), qe(t2) || (this.content.thumbWidth = this.content.snapshotWidth = Number(t2)), qe(s2) || (this.content.thumbHeight = this.content.snapshotHeight = Number(s2)); + } + sendable() { + return "" !== this.content.remoteVideoUrl; + } +}; +var co = class { + constructor(e2) { + this.type = Q; + var { description: e2, longitude: t2, latitude: s2 } = e2; + this.content = { description: e2, longitude: t2, latitude: s2 }; + } + sendable() { + return true; + } +}; +var ho = class { + constructor(e2, t2, s2, o2) { + var r2, i2; + this.from = e2.from, this.messageSender = e2.from, this.time = e2.time, this.messageSequence = e2.sequence, this.clientSequence = e2.clientSequence || e2.sequence, this.messageRandom = e2.random, this.cloudCustomData = e2.cloudCustomData || "", this.clientTime = e2.clientTime || void 0, e2.ID ? (this.ID = e2.ID || "", this.nick = e2.nick || "", this.avatar = e2.avatar || "", e2.messageBody ? this.messageBody = JSON.parse(JSON.stringify(e2.messageBody)) : this.messageBody = [{ type: e2.type, payload: e2.payload }], e2.conversationType ? e2.conversationType.startsWith(ae) ? this.receiverUserID = e2.to : e2.conversationType.startsWith(ue) && (this.receiverGroupID = e2.to) : e2.receiverGroupID ? this.receiverGroupID = e2.receiverGroupID : e2.receiverUserID && (this.receiverUserID = e2.receiverUserID), this.messageReceiver = e2.to || e2.messageReceiver) : (this.nick = e2.nick || "", this.avatar = e2.avatar || "", this.messageBody = [], r2 = e2.elements[0].type, i2 = e2.elements[0].content, this._patchRichMediaPayload(r2, i2), this._updateRichMediaDownloadUrl(r2, i2, t2, s2, o2), r2 === se ? this.messageBody.push({ type: r2, payload: new go(i2, t2, s2, o2).content }) : this.messageBody.push({ type: r2, payload: i2 }), e2.groupID && (this.receiverGroupID = e2.groupID, this.messageReceiver = e2.groupID), e2.to && (this.receiverUserID = e2.to, this.messageReceiver = e2.to), this.ID = `${e2.tinyID}-${e2.clientTime}-` + e2.random); + } + _patchRichMediaPayload(e2, t2) { + e2 === J ? t2.imageInfoArray.forEach((e3) => { + !e3.imageUrl && e3.url && (e3.imageUrl = e3.url, e3.sizeType = e3.type, 1 === e3.type ? e3.type = 0 : 3 === e3.type && (e3.type = 1)); + }) : e2 === Y ? !t2.remoteVideoUrl && t2.videoUrl && (t2.remoteVideoUrl = t2.videoUrl) : e2 === W ? !t2.remoteAudioUrl && t2.url && (t2.remoteAudioUrl = t2.url) : e2 === z && !t2.fileUrl && t2.url && (t2.fileUrl = t2.url, t2.url = void 0); + } + _updateRichMediaDownloadUrl(e2, t2, s2, o2, r2) { + (s2 || o2) && (e2 === J ? t2.imageInfoArray.forEach((e3) => { + e3.url = Ys(e3.url, s2, o2, r2); + }) : e2 === Y ? (t2.videoUrl = Ys(t2.videoUrl, s2, o2, r2), t2.snapshotUrl = Ys(t2.thumbUrl, s2, o2, r2), t2.snapshotHeight = t2.thumbHeight, t2.snapshotWidth = t2.thumbWidth) : e2 === W ? t2.url = Ys(t2.url, s2, o2, r2) : e2 === z && (t2.fileUrl = Ys(t2.fileUrl, s2, o2, r2))); + } +}; +var go = class { + constructor(e2, t2, s2, o2) { + if (this.type = se, this.content = { downloadKey: "", pbDownloadKey: "", messageList: [], title: "", abstractList: [], compatibleText: "", version: 0, layersOverLimit: false }, e2.downloadKey) { + const { downloadKey: t3, pbDownloadKey: s3, title: o3, abstractList: r2, compatibleText: i2, version: n2 } = e2; + this.content.downloadKey = t3, this.content.pbDownloadKey = s3, this.content.title = o3, this.content.abstractList = r2, this.content.compatibleText = i2, this.content.version = n2 || 0; + } else if (qe(e2.messageList)) + 1 === e2.layersOverLimit && (this.content.layersOverLimit = true); + else { + const { messageList: a2, title: u2, abstractList: p2, compatibleText: l2, version: h2 } = e2, c2 = []; + a2.forEach((e3) => { + qe(e3) || (e3 = new ho(e3, t2, s2, o2), c2.push(e3)); + }), this.content.messageList = c2, this.content.title = u2, this.content.abstractList = p2, this.content.compatibleText = l2, this.content.version = h2 || 0; + } + } + sendable() { + return !qe(this.content.messageList) || !qe(this.content.downloadKey); + } +}; +var mo = { 1: oe, 2: re, 3: ie, 4: ne }; +var _o = class { + constructor(e2) { + this.ID = "", this.conversationID = e2.conversationID || null, this.conversationType = e2.conversationType || ae, this.conversationSubType = e2.conversationSubType, this.time = e2.time || Math.ceil(Date.now() / 1e3), this.sequence = e2.sequence || 0, this.clientSequence = e2.clientSequence || e2.sequence || 0, this.random = e2.random || 0 === e2.random ? e2.random : ze(), this.priority = this._computePriority(e2.priority), this.nick = e2.nick || "", this.avatar = e2.avatar || "", this.isPeerRead = false, this.nameCard = "", this.hasRiskContent = function(e3) { + let t2 = e3 && 1 < e3 ? true : false; + return t2; + }(e2.checkResult), this._elements = [], this.isPlaceMessage = e2.isPlaceMessage || 0, this.isRevoked = 2 === e2.isPlaceMessage || 8 === e2.msgFlagBits, this.from = e2.from || null, this.to = e2.to || null, this.flow = "", this.isSystemMessage = e2.isSystemMessage || false, this.protocol = e2.protocol || "JSON", this.isResend = false, this.isRead = false, this.status = e2.status || Bs, this._onlineOnlyFlag = false, this._groupAtInfoList = [], this._relayFlag = false, this.atUserList = [], this.cloudCustomData = e2.cloudCustomData || "", this.isDeleted = false, this.isModified = !!e2.messageVersion, this._isExcludedFromUnreadCount = !(!e2.messageControlInfo || 1 !== e2.messageControlInfo.excludedFromUnreadCount), this._isExcludedFromLastMessage = !(!e2.messageControlInfo || 1 !== e2.messageControlInfo.excludedFromLastMessage), this.clientTime = e2.clientTime || Math.floor(ve() / 1e3) || 0, this.senderTinyID = e2.senderTinyID || e2.tinyID || "", this.readReceiptInfo = e2.readReceiptInfo || { readCount: void 0, unreadCount: void 0, isPeerRead: void 0, timestamp: 0 }, this.needReadReceipt = true === e2.needReadReceipt || 1 === e2.needReadReceipt, this.version = e2.messageVersion || 0, this.isBroadcastMessage = e2.isBroadcastMessage || false, this._receiverList = e2.receiverList || void 0, this.isSupportExtension = true === e2.isSupportExtension || 1 === e2.isSupportExtension, this._cmConfigID = e2.customModerationConfigurationID, this.revoker = e2.revokerInfo && e2.revokerInfo.revoker || "", this.revokerInfo = e2.revokerInfo || { userID: "", nick: "", avatar: "" }, this.revokeReason = e2.revokeReason || "", this.reInitialize(e2.currentUser), this.extractGroupInfo(e2.groupProfile || null), this.handleGroupAtInfo(e2), this.initC2CReadReceiptInfo(e2); + } + get elements() { + return this._elements; + } + getElements() { + return this._elements; + } + extractGroupInfo(e2) { + null !== e2 && (Ve(e2.nick) && (this.nick = e2.nick), Ve(e2.avatar) && (this.avatar = e2.avatar), e2 = e2.messageFromAccountExtraInformation, He(e2)) && Ve(e2.nameCard) && (this.nameCard = e2.nameCard); + } + handleGroupAtInfo(e2) { + e2.payload && e2.payload.atUserList && e2.payload.atUserList.forEach((e3) => { + e3 !== Se ? (this._groupAtInfoList.push({ groupAtAllFlag: 0, groupAtUserID: e3 }), this.atUserList.push(e3)) : (this._groupAtInfoList.push({ groupAtAllFlag: 1 }), this.atUserList.push(Se)); + }), je(e2.groupAtInfo) && e2.groupAtInfo.forEach((e3) => { + 0 === e3.groupAtAllFlag ? this.atUserList.push(e3.groupAtUserID) : 1 === e3.groupAtAllFlag && this.atUserList.push(Se); + }); + } + getGroupAtInfoList() { + return this._groupAtInfoList; + } + _initProxy() { + this._elements[0] && (this.payload = this._elements[0].content, this.type = this._elements[0].type); + } + reInitialize(e2) { + e2 && (this.status = this.from ? Bs : Ks, !this.from) && (this.from = e2), this._initFlow(e2), this._initSequence(e2), this._concatConversationID(e2), this.generateMessageID(); + } + isSendable() { + return 0 !== this._elements.length && (true === this._relayFlag || "function" == typeof this._elements[0].sendable && this._elements[0].sendable()); + } + _initTo(e2) { + this.conversationType === ue && (this.to = e2.groupID); + } + _initSequence(e2) { + 0 === this.clientSequence && e2 && (this.clientSequence = function(o2) { + if (!o2) + return false; + if (void 0 === Xe[o2]) { + var r2 = /* @__PURE__ */ new Date(); + let e3 = ("3" + r2.getHours()).slice(-2), t2 = ("0" + r2.getMinutes()).slice(-2), s2 = ("0" + r2.getSeconds()).slice(-2); + Xe[o2] = parseInt([e3, t2, s2, "0001"].join("")), e3 = null, t2 = null, s2 = null, ct.l("autoIncrementIndex start index:" + Xe[o2]); + } + return Xe[o2]++; + }(e2)), 0 === this.sequence && this.conversationType === ae && (this.sequence = this.clientSequence); + } + generateMessageID() { + this.from === le && (this.senderTinyID = "144115198244471703"), this.ID = `${this.senderTinyID}-${this.clientTime}-` + this.random; + } + _initFlow(e2) { + "" !== e2 && (e2 === this.from ? (this.flow = "out", this.isRead = true) : this.flow = "in"); + } + _concatConversationID(e2) { + var t2 = this["to"], s2 = this.conversationType; + s2 !== le ? (e2 = s2 === ae ? e2 === this.from ? t2 : this.from : this.to, this.conversationID = e2 ? "" + s2 + e2 : null) : this.conversationID = le; + } + isElement(e2) { + return e2 instanceof Xs || e2 instanceof to || e2 instanceof so || e2 instanceof oo || e2 instanceof uo || e2 instanceof lo || e2 instanceof io || e2 instanceof ao || e2 instanceof po || e2 instanceof co || e2 instanceof go; + } + setElement(t2, s2, o2, r2) { + if (this.isElement(t2)) + this._elements = [t2]; + else { + var i2 = (e2) => { + if (e2.type && e2.content) + switch (e2.type) { + case B: + this.setTextElement(e2.content); + break; + case J: + this.setImageElement(e2.content, s2, o2, r2); + break; + case W: + this.setAudioElement(e2.content, s2, o2, r2); + break; + case z: + this.setFileElement(e2.content, s2, o2, r2); + break; + case Y: + this.setVideoElement(e2.content, s2, o2, r2); + break; + case te: + this.setCustomElement(e2.content); + break; + case Q: + this.setLocationElement(e2.content); + break; + case Z: + this.setGroupTipElement(e2.content); + break; + case ee: + this.setGroupSystemNoticeElement(e2.content); + break; + case X: + this.setFaceElement(e2.content); + break; + case se: + this.setMergerElement(e2.content, s2, o2, r2); + } + }; + if (je(t2)) + for (let e2 = 0; e2 < t2.length; e2++) + i2(t2[e2]); + else + i2(t2); + } + this._initProxy(); + } + clearElement() { + this._elements.length = 0; + } + setTextElement(e2) { + e2 = "string" == typeof e2 ? e2 : e2.text, e2 = new Xs({ text: e2 }); + this._elements.push(e2); + } + setImageElement(e2, t2, s2, o2) { + e2 = new to(e2, t2, s2, o2); + this._elements.push(e2); + } + setAudioElement(e2, t2, s2, o2) { + e2 = new oo(e2, t2, s2, o2); + this._elements.push(e2); + } + setFileElement(e2, t2, s2, o2) { + e2 = new uo(e2, t2, s2, o2); + this._elements.push(e2); + } + setVideoElement(e2, t2, s2, o2) { + e2 = new lo(e2, t2, s2, o2); + this._elements.push(e2); + } + setLocationElement(e2) { + e2 = new co(e2); + this._elements.push(e2); + } + setCustomElement(e2) { + e2 = new po(e2); + this._elements.push(e2); + } + setGroupTipElement(e2) { + let t2 = {}; + var s2 = e2.operationType; + if (qe(e2.memberInfoList) ? e2.operatorInfo && (t2 = e2.operatorInfo) : s2 !== Le && s2 !== Ce && s2 !== Ge && s2 !== be || (t2 = e2.memberInfoList[0]), !qe(e2.memberExtraInfo)) { + const t3 = e2.memberExtraInfo["reason"]; + e2.msgMemberInfo.forEach((e3) => { + e3.reason = t3; + }); + } + var { nick: s2, avatar: o2 } = t2, s2 = (Ve(s2) && (this.nick = s2), Ve(o2) && (this.avatar = o2), new io(e2)); + this._elements.push(s2); + } + setGroupSystemNoticeElement(e2) { + e2 = new ao(e2); + this._elements.push(e2); + } + setFaceElement(e2) { + e2 = new so(e2); + this._elements.push(e2); + } + setMergerElement(e2, t2, s2, o2) { + e2 = new go(e2, t2, s2, o2); + this._elements.push(e2); + } + setIsRead(e2) { + this.isRead = e2; + } + setRelayFlag(e2) { + this._relayFlag = e2; + } + _computePriority(e2) { + if (!Ke(e2)) { + if (Ve(e2) && -1 !== Object.values(mo).indexOf(e2)) + return e2; + if (xe(e2)) { + e2 = "" + e2; + if (-1 !== Object.keys(mo).indexOf(e2)) + return mo[e2]; + } + } + return re; + } + setNickAndAvatar(e2) { + var { nick: e2, avatar: t2 } = e2; + Ve(e2) && (this.nick = e2), Ve(t2) && (this.avatar = t2); + } + setNameCard(e2) { + Ve(e2) && (this.nameCard = e2); + } + initC2CReadReceiptInfo(e2) { + var { readReceiptSentByPeer: e2, timestamp: t2 = 0 } = e2; + this.conversationType === ae && true === this.needReadReceipt && (this.readReceiptInfo.isPeerRead = 1 === e2, this.readReceiptInfo.timestamp = t2); + } +}; +var fo = class { + constructor(e2) { + this._grpM = e2, this._n = "GroupTipsHandler", this._cachedGroupTipsMap = /* @__PURE__ */ new Map(), this._checkCountMap = /* @__PURE__ */ new Map(), this.MAX_CHECK_COUNT = 4; + } + onCheckTimer(e2) { + e2 % 1 == 0 && 0 < this._cachedGroupTipsMap.size && this._check(); + } + _check() { + this._cachedGroupTipsMap.forEach((e2, t2) => { + var s2 = this._checkCountMap.get(t2), o2 = this._grpM.hasLocalGroup(t2); + ct.l(this._n + `._check groupID:${t2} hasLocalGroup:${o2} checkCount:` + s2), o2 ? (this._notifyCachedGroupTips(t2), this._checkCountMap.delete(t2), this._grpM.deleteUnjoinedAVChatRoom(t2)) : s2 >= this.MAX_CHECK_COUNT ? (this._deleteCachedGroupTips(t2), this._checkCountMap.delete(t2)) : this._checkCountMap.set(t2, ++s2); + }); + } + onNewGroupTips(e2) { + ct.l(this._n + ".onNewGroupTips options:" + JSON.stringify(e2.dataList)); + var { eventDataList: e2, result: t2, AVChatRoomMessageList: s2 } = this._assembly(e2); + 0 < s2.length && this._grpM.onAVChatRoomMessage(s2), 0 < t2.length && (this._grpM.emitOEvt(Ut, t2), this._handleTips(t2)), 0 < e2.length && (this._grpM.updateNextMessageSeq(e2), this._grpM.get(o).onNewMessage({ conversationOptionsList: e2, isInstantMessage: true })); + } + _assembly(s2) { + var { event: r2, dataList: i2 } = s2, n2 = null, a2 = [], u2 = [], p2 = {}, l2 = []; + for (let e2 = 0, t2 = i2.length; e2 < t2; e2++) { + const s3 = Ye(i2[e2]); + if (6 === r2) { + if (this._grpM.isGroupAttributesUpdatedNotice(s3)) + continue; + if (this._grpM.isGroupCountersNotice(s3)) + continue; + } + var { groupProfile: { groupID: h2, communityType: c2 = 0, topicID: g2, invisible: m2, groupType: d2 } } = s3; + let t3 = void 0; + var _2 = this._grpM.isMessageFromTopic(c2, g2), f2 = (_2 && (t3 = pe, s3.to = g2), this._grpM.hasLocalGroup(h2)); + if (f2 || !this._grpM.isUnjoinedAVChatRoom(h2)) + if (f2 || _2) + if (this._grpM.isMessageFromOrToAVChatroom(h2)) + s3.event = r2, l2.push(s3); + else if (s3.currentUser = this._grpM.getMyUserID(), s3.conversationType = ue, (n2 = new _o(s3)).setElement({ type: Z, content: { ...s3.elements, groupProfile: s3.groupProfile } }), n2.isSystemMessage = false, 1 === m2) + this._qualityStat(n2); + else { + var f2 = this._grpM.get(o), { conversationID: _2, sequence: m2 } = n2; + if (6 === r2) + n2._onlineOnlyFlag = true, u2.push(n2); + else if (!f2.pushIntoNoticeResult(u2, n2)) + continue; + if (!(this._grpM.isMessageFromCommunityOfTopic(c2, g2) || 6 === r2 && f2.getLocalConversation(_2))) { + 6 !== r2 && this._qualityStat(n2); + c2 = f2.isRemoteRead({ conversationID: _2, sequence: m2 }); + if (Ke(p2[_2])) { + let e3 = 0; + "in" !== n2.flow || n2._isExcludedFromUnreadCount || n2._onlineOnlyFlag || c2 || (e3 = 1), p2[_2] = a2.push({ conversationID: _2, unreadCount: e3, type: Ke(t3) ? n2.conversationType : t3, subType: n2.conversationSubType, lastMessage: n2._isExcludedFromLastMessage ? "" : n2 }) - 1; + } else { + const s4 = p2[_2]; + a2[s4].type = n2.conversationType, a2[s4].subType = n2.conversationSubType, a2[s4].lastMessage = n2._isExcludedFromLastMessage ? "" : n2, "in" !== n2.flow || n2._isExcludedFromUnreadCount || n2._onlineOnlyFlag || c2 || a2[s4].unreadCount++; + } + } + } + else + this._cacheAndCompare({ groupID: h2, event: r2, item: s3, groupType: d2 }); + } + return { eventDataList: a2, result: u2, AVChatRoomMessageList: l2 }; + } + _qualityStat(e2) { + this._grpM.get(p).addMessageSequence({ key: Jt, message: e2 }); + } + _handleTips(e2) { + e2.forEach((e3) => { + switch (e3.payload.operationType) { + case 1: + this._onNewMemberComeIn(e3); + break; + case 2: + this._onMemberQuit(e3); + break; + case 3: + this._onMemberKickedOut(e3); + break; + case 4: + this._onMemberSetAdmin(e3); + break; + case 5: + this._onMemberCancelledAdmin(e3); + break; + case 6: + this._onGroupProfileModified(e3); + break; + case 7: + this._onMemberInfoModified(e3); + break; + case 8: + this._onTopicProfileUpdated(e3); + break; + default: + ct.w(this._n + "._handleTips unknown operationType:" + e3.payload.operationType); + } + }); + } + _onNewMemberComeIn(e2) { + var { memberNum: e2, groupProfile: { groupID: t2 } } = e2.payload, t2 = this._grpM.getLocalGroupProfile(t2); + t2 && xe(e2) && t2.memberCount !== e2 && (t2.memberCount = e2, this._updateConvGroupProfile(t2)); + } + _onMemberQuit(e2) { + var { memberNum: t2, groupProfile: { groupID: s2 } } = e2.payload, o2 = this._grpM.getLocalGroupProfile(s2); + o2 && xe(t2) && o2.memberCount !== t2 && (o2.memberCount = t2, this._updateConvGroupProfile(o2)), this._grpM.getGroupMemberHandler().deleteLocalGroupMembers(s2, e2.payload.userIDList); + } + _onMemberKickedOut(e2) { + var { memberNum: t2, groupProfile: { groupID: s2 } } = e2.payload, o2 = this._grpM.getLocalGroupProfile(s2); + o2 && xe(t2) && o2.memberCount !== t2 && (o2.memberCount = t2, this._updateConvGroupProfile(o2)), this._grpM.getGroupMemberHandler().deleteLocalGroupMembers(s2, e2.payload.userIDList); + } + _updateConvGroupProfile(e2) { + this._grpM.get(o).updateConvGroupProfile([e2]); + } + _onMemberSetAdmin(e2) { + const t2 = e2.payload.groupProfile.groupID, s2 = e2.payload.userIDList, o2 = this._grpM.getGroupMemberHandler(); + s2.forEach((e3) => { + e3 = o2.getLocalGroupMemberInfo(t2, e3); + e3 && e3.updateRole(Ie); + }); + } + _onMemberCancelledAdmin(e2) { + const t2 = e2.payload.groupProfile.groupID, s2 = e2.payload.userIDList, o2 = this._grpM.getGroupMemberHandler(); + s2.forEach((e3) => { + e3 = o2.getLocalGroupMemberInfo(t2, e3); + e3 && e3.updateRole(ye); + }); + } + _onGroupProfileModified(e2) { + const { newGroupProfile: t2, groupProfile: s2, operatorInfo: o2 } = e2.payload, r2 = s2["groupID"], i2 = this._grpM.getLocalGroupProfile(r2); + Object.keys(t2).forEach((e3) => { + switch (e3) { + case "ownerID": + this._ownerChanged(i2, t2); + break; + case "groupName": + i2.name = t2[e3]; + break; + default: + i2[e3] = t2[e3]; + } + }), Ke(o2) || Object.keys(o2).forEach((e3) => { + "nameCard" === e3 ? i2.updateSelfInfo({ nameCard: o2[e3] }) : "role" === e3 && i2.updateSelfInfo({ role: o2[e3] }); + }); + e2 = !i2.isSupportTopic; + this._grpM.emitGroupListUpdate(true, e2); + } + _ownerChanged({ groupID: e2 }, t2) { + var s2 = this._grpM.getLocalGroupProfile(e2), o2 = this._grpM.getMyUserID(); + if (o2 === t2.ownerID) { + s2.updateGroup({ selfInfo: { role: Me } }); + const t3 = this._grpM.getGroupMemberHandler(), r2 = t3.getLocalGroupMemberInfo(e2, o2), i2 = this._grpM.getLocalGroupProfile(e2).ownerID, n2 = t3.getLocalGroupMemberInfo(e2, i2); + r2 && r2.updateRole(Me), n2 && n2.updateRole(ye); + } + } + _onMemberInfoModified(e2) { + const { to: t2, payload: { groupProfile: s2, memberList: o2 } } = e2, r2 = s2.groupID, i2 = (rt(t2) && this._updateTopicMuteTime(e2), this._grpM.getGroupMemberHandler()); + o2.forEach((e3) => { + var t3 = i2.getLocalGroupMemberInfo(r2, e3.userID); + t3 && xe(e3.muteTime) && t3.updateMuteUntil(e3.muteTime); + }); + } + _updateTopicMuteTime(e2) { + var { to: e2, payload: { groupProfile: o2, memberList: r2 = [] } } = e2, o2 = o2["groupID"], i2 = this._grpM.get(s).getLocalTopic(o2, e2); + if (i2) { + let t2 = false; + for (let e3 = 0; e3 < r2.length; e3++) { + const s2 = r2[e3]; + if (s2.userID === this._grpM.getMyUserID() && 0 <= s2.muteTime) { + i2.updateSelfInfo({ muteTime: s2.muteTime }), t2 = true; + break; + } + } + t2 && this._grpM.emitOEvt(xt, { groupID: o2, topic: i2 }); + } + } + _onTopicProfileUpdated(e2) { + var { groupProfile: { groupID: t2 }, newTopicInfo: o2 } = e2.payload; + this._grpM.get(s).onTopicProfileUpdated({ groupID: t2, topicID: e2.to, ...o2 }); + } + _cacheGroupTips(e2, t2) { + this._cachedGroupTipsMap.has(e2) || this._cachedGroupTipsMap.set(e2, []), this._cachedGroupTipsMap.get(e2).push(t2); + } + _deleteCachedGroupTips(e2) { + this._cachedGroupTipsMap.has(e2) && this._cachedGroupTipsMap.delete(e2); + } + _notifyCachedGroupTips(e2, t2) { + var s2 = this._cachedGroupTipsMap.get(e2) || []; + ct.l(this._n + `._notifyCachedGroupTips groupID:${e2} groupType:${t2} count:` + s2.length), s2.forEach((e3) => { + this.onNewGroupTips(e3); + }), this._deleteCachedGroupTips(e2); + } + _cacheAndCompare(e2) { + var { groupID: e2, event: t2, item: s2, groupType: o2 } = e2, t2 = (ct.l(this._n + `._cacheAndCompare groupID:${e2} groupType:` + o2), this._cacheGroupTips(e2, { event: t2, dataList: [s2] }), { groupID: e2, type: o2 }); + o2 === me ? this._grpM.hasLocalGroup(e2) ? this._notifyCachedGroupTips(e2, o2) : this._grpM.setUnjoinedAVChatRoom(e2) : (this._grpM.updateGroupMap([t2]), this._notifyCachedGroupTips(e2, o2)), this._checkCountMap.has(e2) || this._checkCountMap.set(e2, 0); + } + reset() { + this._cachedGroupTipsMap.clear(), this._checkCountMap.clear(); + } +}; +var Mo = class { + constructor(e2) { + this._grpM = e2, this._n = "CommonGroupHandler", this.tempConversationList = null, this._cachedGroupMessageMap = /* @__PURE__ */ new Map(), this._checkCountMap = /* @__PURE__ */ new Map(), this.MAX_CHECK_COUNT = 4, this.PAGING_GRP_COUNT_LIMIT = 200, this._pagingStatus = Js, this._pagingGetCostList = [], e2.getIEmitInst().on(Bt.A2KEY_AND_TINYID_UPDATED, this.syncGroupList, this); + } + onCheckTimer(e2) { + e2 % 1 == 0 && 0 < this._cachedGroupMessageMap.size && this._check(); + } + _check() { + this._cachedGroupMessageMap.forEach((e2, t2) => { + var s2 = this._checkCountMap.get(t2), o2 = this._grpM.hasLocalGroup(t2); + ct.l(this._n + `._check groupID:${t2} hasLocalGroup:${o2} checkCount:` + s2), o2 ? (this._notifyCachedGroupMessage(t2), this._checkCountMap.delete(t2), this._grpM.deleteUnjoinedAVChatRoom(t2)) : s2 >= this.MAX_CHECK_COUNT ? (this._deleteCachedGroupMessage(t2), this._checkCountMap.delete(t2)) : this._checkCountMap.set(t2, ++s2); + }); + } + updateLastMsg(i2) { + var e2 = this._n + ".updateLastMsg"; + if (0 === this._grpM.getGroupMap().size) + this.tempConversationList = i2; + else { + let t2, s2, o2, r2 = false; + var n2, a2, u2 = i2.length; + for (let e3 = 0; e3 < u2; e3++) + (t2 = i2[e3]).type === ue && 0 !== t2.lastMessage.lastSequence && null !== t2.lastMessage.payload && (s2 = t2.conversationID.split(/^GROUP/)[1], o2 = this._grpM.getLocalGroupProfile(s2)) && (n2 = o2.lastMessage, a2 = t2.lastMessage, JSON.stringify(n2) !== JSON.stringify(a2)) && (o2.lastMessage = { ...t2.lastMessage }, r2 = true); + ct.l(e2 + ` convCount:${u2} groupCount:${this._grpM.getLocalGroupList().length} isUpdated:` + r2), r2 && (this._grpM.sortLocalGroupList(), this._grpM.emitGroupListUpdate(true, false)); + } + } + onNewMessage(e2) { + var { conversationOptionsList: t2, messageList: s2, AVChatRoomMessageList: r2 } = this._assembly(e2), r2 = (0 < r2.length && this._grpM.onAVChatRoomMessage(r2), Ze(s2)), r2 = (0 < r2.length && this._grpM.emitOEvt(Nt, r2), 0 < t2.length && (this._grpM.get(o).onNewMessage({ conversationOptionsList: t2, isInstantMessage: false !== e2.isInstantMessage, updateUnreadCount: false !== e2.updateUnreadCount }), this._grpM.updateNextMessageSeq(t2)), et(s2)); + 0 < r2.length && this._grpM.emitOEvt(Ut, r2), s2.length = 0; + } + _assembly(i2) { + const { dataList: a2, event: e2, isInstantMessage: u2 } = i2; + var p2 = null; + const l2 = [], h2 = [], c2 = [], g2 = {}, m2 = this._grpM.getFileDownloadProxy(), d2 = this._grpM.getDowloadFileAuthKey(), _2 = this._grpM.get(n).getFileDNList(), f2 = a2.length; + 1 < f2 && a2.sort((e3, t2) => e3.sequence - t2.sequence); + var M2 = this._grpM.get(o), I2 = this._grpM.get(t); + for (let r2 = 0; r2 < f2; r2++) { + const i3 = Ye(a2[r2]), { groupProfile: { groupID: o2, communityType: n2 = 0, topicID: f3, invisible: L2, groupType: C2 } } = i3; + let s2 = void 0; + var y2 = this._grpM.isMessageFromTopic(n2, f3), D2 = (y2 && (s2 = pe, i3.to = f3), this._grpM.hasLocalGroup(o2)); + if (D2 || !this._grpM.isUnjoinedAVChatRoom(o2)) + if (D2 || y2) + if (this._grpM.isMessageFromOrToAVChatroom(o2)) + i3.event = e2, c2.push(i3); + else if (i3.currentUser = this._grpM.getMyUserID(), i3.conversationType = ue, i3.isSystemMessage = !!i3.isSystemMessage, (p2 = new _o(i3)).setElement(i3.elements, m2, d2, _2), 1 === L2) + this._qualityStat(u2, p2); + else { + let e3 = 1 === a2[r2].isModified; + if (M2.isMessageSentByCurrentInstance(p2) ? p2.isModified = e3 : e3 = false, 1 === i3.onlineOnlyFlag) + p2._onlineOnlyFlag = true, M2.isMessageSentByCurrentInstance(p2) || h2.push(p2); + else { + if (this._grpM.isMessageFromCommunityOfTopic(n2, f3)) { + h2.push(p2); + continue; + } + if (p2.from === this._grpM.getMyUserID()) { + const t3 = M2.getLatestMessageSentByMe(p2.conversationID); + if (t3) { + const { nick: a4, avatar: o3 } = t3; + a4 === p2.nick && o3 === p2.avatar || (M2.modifyMessageSentByMe({ conversationID: i4, latestNick: p2.nick, latestAvatar: p2.avatar }), I2.mockOnNickAvatarModified(p2.nick, p2.avatar)); + } + } + if (!M2.pushIntoMessageList(h2, p2, e3)) + continue; + this._qualityStat(u2, p2); + const { conversationID: i4, sequence: t2 } = p2, a3 = M2.isRemoteRead({ conversationID: i4, sequence: t2 }); + if (Ke(g2[i4])) { + let e4 = 0; + "in" !== p2.flow || p2._isExcludedFromUnreadCount || a3 || (e4 = 1), g2[i4] = l2.push({ conversationID: i4, unreadCount: e4, type: Ke(s2) ? p2.conversationType : s2, subType: p2.conversationSubType, lastMessage: p2._isExcludedFromLastMessage ? "" : p2 }) - 1; + } else { + const t3 = g2[i4]; + l2[t3].type = Ke(s2) ? p2.conversationType : s2, l2[t3].subType = p2.conversationSubType, l2[t3].lastMessage = p2._isExcludedFromLastMessage ? "" : p2, "in" !== p2.flow || p2._isExcludedFromUnreadCount || a3 || l2[t3].unreadCount++; + } + } + } + else + this._cacheAndCompare({ groupID: o2, event: e2, item: i3, groupType: C2 }); + } + return { conversationOptionsList: l2, messageList: h2, AVChatRoomMessageList: c2 }; + } + _qualityStat(e2, t2) { + var s2 = this._grpM.get(p); + s2.addMessageSequence({ key: Jt, message: t2 }), e2 && 0 < t2.clientTime && s2.addMessageDelay(t2.clientTime); + } + onMsgRevoked(e2, t2) { + const p2 = this._grpM.get(o), l2 = [], h2 = []; + e2.dataList.forEach((e3) => { + const t3 = e3.elements["revokedInfos"], { revokerInfo: n2, groupProfile: a2 } = e3; + let u2 = false; + a2 && (u2 = ot({ groupID: a2.groupID }) || !qe(a2.topicID)), Ke(t3) || t3.forEach((e4) => { + var t4 = qe(e4.topicID) ? "GROUP" + e4.groupID : "GROUP" + e4.topicID, s2 = p2.getLocalConversation(t4), o2 = e4.revokerInfo && e4.revokerInfo.revoker || n2 && n2.revoker, r2 = n2 && n2.reason || ""; + let i2; + if (s2 && st(s2.type)) + i2 = { conversationID: t4, sequence: e4.sequence, ID: `${e4.tinyID}-${e4.clientTime}-` + e4.random }; + else { + const n3 = p2.revoke(t4, e4.sequence, e4.random); + n3 ? i2 = n3 : (i2 = { conversationID: t4, sequence: e4.sequence }, e4.tinyID && e4.clientTime && e4.random && (i2.ID = `${e4.tinyID}-${e4.clientTime}-` + e4.random), e4.time && (i2.time = e4.time)); + } + i2 && (i2.revoker = o2, i2.revokeReason = r2, i2.revokerInfo = { userID: o2, nick: "", avatar: "" }, (u2 ? (i2.revokerInfo.nick = a2.nick, i2.revokerInfo.avatar = a2.avatar, l2) : h2).push(i2)); + }); + }), 0 === h2.length && 0 === l2.length || (p2.onMessageRevoked([...l2, ...h2], t2), 0 < l2.length && this._grpM.emitOEvt(qt, l2), 0 < h2.length && p2.updateRevokerInfo(h2).then((e3) => { + this._grpM.emitOEvt(qt, e3); + })); + } + _groupListTreeShaking(s2) { + const o2 = new Map([...this._grpM.getGroupMap()]); + for (let e2 = 0, t2 = s2.length; e2 < t2; e2++) + o2.delete(s2[e2].groupID); + this._grpM.hasJoinedAVChatRoom() && this._grpM.getJoinedAVChatRoom().forEach((e2) => { + o2.delete(e2); + }), this._grpM.getGroupMap().forEach((e2, t2) => { + e2.isSupportTopic && o2.delete(t2); + }); + var r2 = [...o2.keys()]; + for (let e2 = 0, t2 = r2.length; e2 < t2; e2++) + this._grpM.deleteGroup(r2[e2]); + } + syncGroupList(e2 = false) { + this._pagingStatus === Js && this._grpM.clearGroupMap(); + const t2 = [...L], s2 = this.PAGING_GRP_COUNT_LIMIT, o2 = []; + if (true === e2) + return this._pagingGetGroupListWithTopic({ limit: s2, offset: 0, groupBaseInfoFilter: t2, groupList: o2 }); + const r2 = this._n + ".syncGroupList", i2 = new Zt("syncGroupList"); + return this._pagingGetGroupList({ limit: s2, offset: 0, groupBaseInfoFilter: t2, groupList: o2 }).then(() => { + var e3 = function(e4) { + if (je(e4) && 0 !== e4.length) { + let t4 = 0; + return e4.forEach((e5) => { + t4 += e5; + }), (t4 / e4.length).toFixed(0); + } + }(this._pagingGetCostList), t3 = function(e4) { + if (je(e4) && 0 !== e4.length) { + let t4 = 0; + return e4.forEach((e5) => { + t4 += e5; + }), t4.toFixed(0); + } + }(this._pagingGetCostList), t3 = (this._pagingGetCostList.length = 0, this._pagingStatus = Ws, this._groupListTreeShaking(o2), this._grpM.updateGroupMap(o2), `count:${this._grpM.getLocalGroupList().length} sum:${t3} avg:` + e3); + return ct.l(r2 + " ok. " + t3), i2.setMessage(t3).end(), this.tempConversationList && (this.updateLastMsg(this.tempConversationList), this.tempConversationList = null), this._grpM.emitGroupListUpdate(true, true), ht({ groupList: this._grpM.getLocalGroupList() }); + }).catch((e3) => (this._pagingStatus = zs, i2.setError(e3).end(), ct.e(r2 + " failed. error:", e3), Kt(e3))); + } + getGroupList() { + const t2 = this._n + ".getGroupList"; + var e2; + return ct.l(t2 + " pagingStatus:" + this._pagingStatus), this._pagingStatus === zs || this._pagingStatus === Js ? this.syncGroupList().then(() => { + var e3 = this._grpM.getLocalGroupList(); + return ht({ groupList: e3, isSyncCompleted: this.isPagingGetCompleted() }); + }).catch((e3) => (ct.e(t2 + " failed. error:", e3), Kt(e3))) : (e2 = this._grpM.getLocalGroupList(), ct.l(t2 + ". returned group count:" + e2.length), jt({ groupList: e2, isSyncCompleted: this.isPagingGetCompleted() })); + } + isPagingGetCompleted() { + return this._pagingStatus === Ws; + } + _pagingGetGroupList(e2) { + const o2 = this._n + "._pagingGetGroupList"; + let { isCommunityRelay: r2 = false, limit: i2, offset: n2, groupBaseInfoFilter: a2, groupList: u2 } = e2; + const p2 = Date.now(); + return this._grpM.req({ P: ts, data: { type: r2 ? de : void 0, memberAccount: this._grpM.getMyUserID(), limit: i2, offset: n2, responseFilter: { groupBaseInfoFilter: a2, selfInfoFilter: ["Role", "JoinTime", "MsgFlag", "MsgSeq"] } } }).then((e3) => { + var { groups: e3 = [], totalCount: t2 } = e3.data, e3 = (u2.push(...e3), this._handleGroupAtInfoWithoutTopic(r2, e3), n2 + i2), s2 = !(e3 < t2), t2 = `offset:${n2} limit:${i2} total:${t2} isCompleted:${s2} current:${u2.length} isCommunityRelay:` + r2; + return this._pagingGetCostList.push(at(p2, false)), ct.l(o2 + ` ok. ${t2} cost:` + at(p2)), r2 || s2 ? !r2 && s2 ? (ct.l(o2 + " start to get community list"), n2 = 0, this._pagingGetGroupList({ limit: i2, offset: n2, groupBaseInfoFilter: a2, groupList: u2, isCommunityRelay: true })) : r2 && !s2 ? (n2 = e3, this._pagingGetGroupList({ limit: i2, offset: n2, groupBaseInfoFilter: a2, groupList: u2, isCommunityRelay: true })) : ht({ groupList: u2 }) : (n2 = e3, this._pagingGetGroupList({ limit: i2, offset: n2, groupBaseInfoFilter: a2, groupList: u2 })); + }).catch((e3) => 10018 === e3.code ? (ct.w(this.logPrefix + " response size exceeds the limit, request count:" + i2), i2 = 50, this._pagingGetGroupList({ limit: i2, offset: n2, groupBaseInfoFilter: a2, groupList: u2, isCommunityRelay: r2 })) : r2 ? (11e3 === e3.code && ct.l(o2 + " ok. community unavailable"), jt({ groupList: u2 })) : Kt(e3)); + } + _pagingGetGroupListWithTopic(e2) { + const o2 = this._n + "._pagingGetGroupListWithTopic"; + let { limit: r2, offset: i2, groupBaseInfoFilter: n2, groupList: a2 } = e2; + const u2 = Date.now(); + return this._grpM.req({ P: ts, data: { type: de, memberAccount: this._grpM.getMyUserID(), limit: r2, offset: i2, responseFilter: { groupBaseInfoFilter: n2, selfInfoFilter: [...C] }, isSupportTopic: 1, needAppDefineData: 1 } }).then((e3) => { + var { groups: e3 = [], totalCount: t2 } = e3.data, e3 = (a2.push(...e3), i2 + r2), s2 = !(e3 < t2); + if (ct.l(o2 + ` ok. offset:${i2} limit:${r2} totalCount:${t2} isCompleted:${s2} currentCount:${a2.length} cost:` + at(u2)), !s2) + return i2 = e3, this._pagingGetGroupListWithTopic({ limit: r2, offset: i2, groupBaseInfoFilter: n2, groupList: a2 }); + this._grpM.updateGroupMap(a2), this._grpM.emitGroupListUpdate(true, false); + t2 = this._grpM.getLocalGroupList().filter((e4) => true === e4.isSupportTopic); + return ht({ groupList: t2 }); + }).catch((e3) => 10018 === e3.code ? (ct.w(this.logPrefix + " response size exceeds the limit, request count:" + r2), r2 = 50, this._pagingGetGroupListWithTopic({ limit: r2, offset: i2, groupBaseInfoFilter: n2, groupList: a2 })) : Kt(e3)); + } + _cacheGroupMessage(e2, t2) { + this._cachedGroupMessageMap.has(e2) || this._cachedGroupMessageMap.set(e2, []), this._cachedGroupMessageMap.get(e2).push(t2); + } + _deleteCachedGroupMessage(e2) { + this._cachedGroupMessageMap.has(e2) && this._cachedGroupMessageMap.delete(e2); + } + _notifyCachedGroupMessage(e2, t2) { + var s2 = this._cachedGroupMessageMap.get(e2) || []; + ct.l(this._n + `._notifyCachedGroupMessage groupID:${e2} groupType:${t2} count:` + s2.length), s2.forEach((e3) => { + this.onNewMessage(e3); + }), this._deleteCachedGroupMessage(e2); + } + _cacheAndCompare(e2) { + var { groupID: e2, event: t2, item: s2, groupType: o2 } = e2, t2 = (ct.l(this._n + `._cacheAndCompare groupID:${e2} groupType:` + o2), this._cacheGroupMessage(e2, { event: t2, dataList: [s2] }), { groupID: e2, type: o2 }); + o2 === me ? this._grpM.hasLocalGroup(e2) ? this._notifyCachedGroupMessage(e2, o2) : this._grpM.setUnjoinedAVChatRoom(e2) : (this._grpM.updateGroupMap([t2]), this._notifyCachedGroupMessage(e2, o2)), this._checkCountMap.has(e2) || this._checkCountMap.set(e2, 0); + } + _handleGroupAtInfoWithoutTopic(e2, t2) { + e2 && 0 !== t2.length && t2.forEach((e3) => { + const { groupID: t3, groupAtInfoList: s2 } = e3, r2 = []; + Ke(s2) || (s2.forEach((e4) => { + r2.push({ ...e4, groupID: t3 }); + }), this._grpM.get(o).onNewGroupAtTips({ dataList: r2 })); + }); + } + setPagingGroupCount(e2) { + Ke(e2) || (this.PAGING_GRP_COUNT_LIMIT = parseInt(e2, 10)); + } + reset() { + this.PAGING_GRP_COUNT_LIMIT = 200, this._cachedGroupMessageMap.clear(), this._checkCountMap.clear(), this._pagingStatus = Js, this._pagingGetCostList = []; + } +}; +var Io = 1; +var yo = 2; +var Do = 3; +var Lo = 4; +var Co = 5; +var Go = class { + constructor(e2) { + this._grpM = e2, this._n = "GroupAttributesHandler", this._groupAttributesMap = /* @__PURE__ */ new Map(), this._groupAttributesCopy = {}, this.CACHE_EXPIRE_TIME = 3e4, this._grpM.getIEmitInst().on(Bt.CLOUD_CONFIG, this._onCloudConfig, this); + } + _onCloudConfig() { + var e2 = this._grpM.getCloudConfig("grp_attr_cache_time"); + Ke(e2) || (this.CACHE_EXPIRE_TIME = Number(e2)); + } + updateLocalMainSequenceOnReconnected() { + this._groupAttributesMap.forEach((e2) => { + e2.localMainSequence = 0; + }); + } + isGroupAttributesUpdatedNotice(e2) { + var { to: e2, elements: { newGroupProfile: t2 } } = e2, s2 = !Ke(t2) && !qe(t2.groupAttributeOption); + return s2 && this._onGroupAttributesUpdated({ groupID: e2, groupAttributeOption: t2.groupAttributeOption }), s2; + } + _onGroupAttributesUpdated(e2) { + const { groupID: t2, groupAttributeOption: s2 } = e2, { mainSequence: o2, isWithChangedAttributeInfo: r2, groupAttributeList: i2 = [], operationType: n2 } = s2; + if (ct.l(this._n + `.onGroupAttributesUpdated. groupID:${t2} isWithChangedAttributeInfo:${r2} operationType:` + n2), !Ke(n2)) { + this._groupAttributesCopy = this._getCachedAttributes({ groupID: t2 }); + e2 = this._getLocalGroupAttributes(t2)["localMainSequence"], e2 = o2 - e2; + if (0 != e2) { + if (1 === r2 && 1 == e2) + this._refreshCachedGroupAttributes({ groupID: t2, remoteMainSequence: o2, groupAttributeList: i2, operationType: n2 }), this._emitGroupAttributesUpdated(t2); + else if (this._hasLocalGroupAttributes(t2)) { + const e3 = this._getLocalGroupAttributes(t2)["avChatRoomKey"]; + this._getGroupAttributes({ groupID: t2, avChatRoomKey: e3 }).then(() => { + this._emitGroupAttributesUpdated(t2); + }); + } + } + } + } + initGroupAttributesCache(e2) { + var { groupID: e2, avChatRoomKey: t2 } = e2; + this._groupAttributesMap.set(e2, { lastUpdateTime: 0, localMainSequence: 0, remoteMainSequence: 0, attributes: /* @__PURE__ */ new Map(), avChatRoomKey: t2 }), ct.l(this._n + `.initGroupAttributesCache groupID:${e2} avChatRoomKey:` + t2); + } + initGroupAttributes(e2) { + const { groupID: s2, groupAttributes: o2 } = e2, { remoteMainSequence: t2, avChatRoomKey: r2 } = this._getLocalGroupAttributes(s2), i2 = new Zt("initGroupAttributes"); + return i2.setMessage(`groupID:${s2} avChatRoomKey:${r2} mainSequence:` + t2), this._grpM.req({ P: Ts, data: { groupID: s2, avChatRoomKey: r2, mainSequence: t2, groupAttributeList: this._transformGroupAttributes(o2) } }).then((e3) => { + ct.l(this._n + ".initGroupAttributes ok. groupID:" + s2); + var { mainSequence: e3, groupAttributeList: t3 } = e3.data, t3 = [...t3]; + return t3.forEach((e4) => { + e4.value = o2[e4.key]; + }), this._groupAttributesCopy = this._getCachedAttributes({ groupID: s2 }), this._refreshCachedGroupAttributes({ groupID: s2, remoteMainSequence: e3, groupAttributeList: t3, operationType: Io }), this._emitGroupAttributesUpdated(s2), i2.end(), ht({ groupAttributes: o2 }); + }).catch((e3) => (i2.setError(e3).end(), Kt(e3))); + } + setGroupAttributes(e2) { + const s2 = this._n + ".setGroupAttributes", { groupID: o2, groupAttributes: r2 } = e2, { remoteMainSequence: t2, avChatRoomKey: i2, attributes: n2 } = this._getLocalGroupAttributes(o2), a2 = this._transformGroupAttributes(r2), u2 = (a2.forEach((e3) => { + var t3 = e3["key"]; + e3.sequence = 0, n2.has(t3) && (e3.sequence = n2.get(t3).sequence); + }), new Zt("setGroupAttributes")); + return u2.setMessage(`groupID:${o2} groupAttributes:` + JSON.stringify(r2)), ct.l(s2 + `. groupID:${o2} mainSequence:` + t2), this._grpM.req({ P: Ss, data: { groupID: o2, avChatRoomKey: i2, mainSequence: t2, groupAttributeList: a2 } }).then((e3) => { + ct.l(s2 + " ok."); + var { mainSequence: e3, groupAttributeList: t3 } = e3.data, t3 = [...t3]; + return t3.forEach((e4) => { + e4.value = r2[e4.key]; + }), this._groupAttributesCopy = this._getCachedAttributes({ groupID: o2 }), this._refreshCachedGroupAttributes({ groupID: o2, remoteMainSequence: e3, groupAttributeList: t3, operationType: yo }), this._emitGroupAttributesUpdated(o2), u2.end(), ht({ groupAttributes: r2 }); + }).catch((e3) => (u2.setError(e3).end(), Kt(e3))); + } + deleteGroupAttributes(e2) { + const { groupID: t2, keyList: s2 = [] } = e2, { remoteMainSequence: o2, avChatRoomKey: r2, attributes: i2 } = this._getLocalGroupAttributes(t2); + let n2 = [...i2.keys()], a2 = Ps, u2 = Do; + const p2 = { groupID: t2, avChatRoomKey: r2, mainSequence: o2 }, l2 = [], h2 = (0 < s2.length && (n2 = [], a2 = vs, u2 = Lo, s2.forEach((e3) => { + let t3 = 0; + i2.has(e3) && (t3 = i2.get(e3).sequence, n2.push(e3)), l2.push({ key: e3, sequence: t3 }); + }), p2.groupAttributeList = l2), new Zt("deleteGroupAttributes")); + return h2.setMessage(`groupID:${t2} mainSequence:${o2} keyList:${s2} proto:` + a2), this._grpM.req({ P: a2, data: p2 }).then((e3) => { + ct.l(this._n + ".deleteGroupAttributes ok. groupID:" + t2); + e3 = e3.data.mainSequence; + return this._groupAttributesCopy = this._getCachedAttributes({ groupID: t2 }), this._refreshCachedGroupAttributes({ groupID: t2, remoteMainSequence: e3, groupAttributeList: l2, operationType: u2 }), this._emitGroupAttributesUpdated(t2), h2.end(), ht({ keyList: n2 }); + }).catch((e3) => (h2.setError(e3).end(), Kt(e3))); + } + getGroupAttributes(t2) { + const s2 = this._n + ".getGroupAttributes", o2 = t2["groupID"], { avChatRoomKey: e2, lastUpdateTime: r2, localMainSequence: i2, remoteMainSequence: n2 } = this._getLocalGroupAttributes(o2), a2 = new Zt("getGroupAttributes"); + if (a2.setMessage(`groupID:${o2} localMainSequence:${i2} remoteMainSequence:${n2} keyList:` + t2.keyList), Date.now() - r2 >= this.CACHE_EXPIRE_TIME || i2 < n2) + return this._getGroupAttributes({ groupID: o2, avChatRoomKey: e2 }).then((e3) => { + a2.setMoreMessage("get attributes from remote. count:" + e3.length).end(), ct.l(s2 + " from remote. groupID:" + o2); + e3 = this._getCachedAttributes(t2); + return ht({ groupAttributes: e3 }); + }).catch((e3) => (a2.setError(e3).end(), Kt(e3))); + a2.setMoreMessage("get attributes from cache").end(), ct.l(s2 + " from cache. groupID:" + o2); + var u2 = this._getCachedAttributes(t2); + return jt({ groupAttributes: u2 }); + } + _getGroupAttributes(o2) { + let e2 = 0; + return Ke(o2.avChatRoomKey) || (e2 = 1), this._grpM.req({ P: Rs, data: { ...o2, groupType: e2 } }).then((e3) => { + ct.l(this._n + "._getGroupAttributes ok. groupID:" + o2.groupID); + var { mainSequence: e3, groupAttributeList: t2 } = e3.data, s2 = [...t2]; + return Ke(e3) || this._refreshCachedGroupAttributes({ groupID: o2.groupID, remoteMainSequence: e3, groupAttributeList: s2, operationType: Co }), t2; + }).catch((e3) => Kt(e3)); + } + _refreshCachedGroupAttributes(e2) { + var { groupID: t2, remoteMainSequence: s2, groupAttributeList: o2, operationType: r2 } = e2; + if (this._hasLocalGroupAttributes(t2)) { + const e3 = this._getLocalGroupAttributes(t2), i2 = e3["localMainSequence"]; + if (r2 === Co || s2 - i2 == 1) + e3.remoteMainSequence = s2, e3.localMainSequence = s2, e3.lastUpdateTime = Date.now(), this._updateCachedAttributes({ groupAttributes: e3, groupAttributeList: o2, operationType: r2 }); + else { + if (i2 === s2) + return; + e3.remoteMainSequence = s2; + } + this._groupAttributesMap.set(t2, e3); + o2 = `operationType:${r2} localMainSequence:${i2} remoteMainSequence:` + s2; + ct.l(this._n + "._refreshCachedGroupAttributes. " + o2); + } + } + _getCachedAttributes(t2) { + const { groupID: e2, keyList: s2 = [] } = t2, o2 = {}; + if (this._hasLocalGroupAttributes(e2)) { + const t3 = this._getLocalGroupAttributes(e2)["attributes"]; + if (0 < s2.length) + s2.forEach((e3) => { + t3.has(e3) && (o2[e3] = t3.get(e3).value); + }); + else + for (const e3 of t3.keys()) + o2[e3] = t3.get(e3).value; + } + return o2; + } + _updateCachedAttributes(e2) { + const { groupAttributes: o2, groupAttributeList: t2, operationType: s2 } = e2; + s2 !== Do ? s2 !== Lo ? (s2 === Io && o2.attributes.clear(), t2.forEach((e3) => { + var { key: e3, value: t3, sequence: s3 } = e3; + o2.attributes.set(e3, { value: t3, sequence: s3 }); + })) : t2.forEach((e3) => { + o2.attributes.delete(e3.key); + }) : o2.attributes.clear(); + } + _hasLocalGroupAttributes(e2) { + return this._groupAttributesMap.has(e2); + } + _getLocalGroupAttributes(e2) { + return this._hasLocalGroupAttributes(e2) || this.initGroupAttributesCache({ groupID: e2 }), this._groupAttributesMap.get(e2); + } + _transformGroupAttributes(t2) { + const s2 = []; + return Object.keys(t2).forEach((e2) => { + s2.push({ key: e2, value: t2[e2] }); + }), s2; + } + _emitGroupAttributesUpdated(e2) { + var t2 = this._getCachedAttributes({ groupID: e2 }), { updatedKeyList: s2, deletedKeyList: o2 } = this._computeAttrChangedInfo(t2); + ct.l(`${this._n}._emitGroupAttributesUpdated update:${s2.length}, delete:` + o2.length), 0 === s2.length && 0 === o2.length || this._grpM.emitOEvt(Ot, { groupID: e2, groupAttributes: t2, updatedKeyList: s2, deletedKeyList: o2 }); + } + _computeAttrChangedInfo(t2) { + const s2 = [], o2 = []; + return Object.keys(t2).forEach((e2) => { + t2[e2] !== this._groupAttributesCopy[e2] && s2.push(e2); + }), Object.keys(this._groupAttributesCopy).forEach((e2) => { + Ke(t2[e2]) && o2.push(e2); + }), this._groupAttributesCopy = {}, { updatedKeyList: s2, deletedKeyList: o2 }; + } + deleteLocalGroupAttributes(e2) { + this._hasLocalGroupAttributes(e2) && this._groupAttributesMap.delete(e2); + } + reset() { + this._groupAttributesMap.clear(), this._groupAttributesCopy = {}, this.CACHE_EXPIRE_TIME = 3e4; + } +}; +var bo = "Set"; +var Ao = "Increase"; +var To = "Decrease"; +var So = class { + constructor(e2) { + this._grpM = e2, this._n = "GroupCountersHandler", this._groupCountersMap = /* @__PURE__ */ new Map(), this.EXPIRE_TIME = 3e4, this._grpM.getIEmitInst().on(Bt.CLOUD_CONFIG, this._onCloudConfig, this); + } + _onCloudConfig() { + var e2 = this._grpM.getCloudConfig("grp_counter_expire_time"); + Ke(e2) || (this.EXPIRE_TIME = Number(e2)); + } + isGroupCountersNotice(e2) { + var { to: e2, elements: { groupCounterInfo: t2 } } = e2; + let s2 = false; + return qe(t2) || (this._onGroupCountersUpdated({ groupID: e2, groupCounterInfo: t2 }), s2 = true), s2; + } + _onGroupCountersUpdated(e2) { + const { groupID: o2, groupCounterInfo: t2 } = e2; + t2.forEach((e3) => { + var { type: e3, groupCounterSeq: t3, counterList: s2 = [] } = e3; + 0 !== e3 && 2 !== e3 || (this._updateLocalGroupCounters({ groupID: o2, groupCounterSeq: t3, counterList: s2 }), s2.forEach((e4) => { + this._grpM.emitOEvt(Ft, { groupID: o2, key: e4.key, value: e4.value }); + })), 1 === e3 && this._deleteLocalGroupCounters({ groupID: o2, groupCounterSeq: t3, counterList: s2 }); + }), ct.l(this._n + "._onGroupCountersUpdated groupID:" + o2); + } + initGroupCountersCache(e2) { + var { groupID: e2, avChatRoomKey: t2 } = e2; + this._groupCountersMap.set(e2, { lastUpdateTime: 0, groupCounterSeq: 0, counters: /* @__PURE__ */ new Map(), avChatRoomKey: t2 }), ct.l(this._n + `.initGroupCountersCache groupID:${e2} avChatRoomKey:` + t2); + } + setGroupCounters(e2) { + if (!this._grpM.canIUse(I.GRP_COUNTER)) + return this._grpM.noUse("setGroupCounters"); + const t2 = this._n + ".setGroupCounters", { groupID: s2, counters: o2 } = e2, r2 = this._convertObjectToList(o2), i2 = this._getLocalGroupCounters(s2)["avChatRoomKey"], n2 = `groupID:${s2} count:` + r2.length, a2 = new Zt("setGroupCounters"); + return a2.setMessage(n2), ct.l(t2 + ". " + n2), this._updateGroupCounters({ groupID: s2, counterList: r2, avChatRoomKey: i2, mode: bo }).then((e3) => (a2.end(), ct.l(t2 + " ok."), ht({ counters: e3 }))).catch((e3) => (a2.setError(e3).end(), ct.e(t2 + " failed. error:", e3), Kt(e3))); + } + increaseGroupCounter(e2) { + var t2 = "increaseGroupCounter"; + if (!this._grpM.canIUse(I.GRP_COUNTER)) + return this._grpM.noUse(t2); + const s2 = this._n + "." + t2, { groupID: o2, key: r2, value: i2 } = e2, n2 = this._getLocalGroupCounters(o2)["avChatRoomKey"], a2 = `groupID:${o2} key:${r2} value:` + i2, u2 = new Zt(t2); + return u2.setMessage(a2), ct.l(s2 + ". " + a2), this._updateGroupCounters({ groupID: o2, counterList: [{ key: r2, value: i2 }], avChatRoomKey: n2, mode: Ao }).then((e3) => (u2.end(), ct.l(s2 + " ok."), ht({ counters: e3 }))).catch((e3) => (u2.setError(e3).end(), ct.e(s2 + " failed. error:", e3), Kt(e3))); + } + decreaseGroupCounter(e2) { + var t2 = "decreaseGroupCounter"; + if (!this._grpM.canIUse(I.GRP_COUNTER)) + return this._grpM.noUse(t2); + const s2 = this._n + "." + t2, { groupID: o2, key: r2, value: i2 } = e2, n2 = this._getLocalGroupCounters(o2)["avChatRoomKey"], a2 = `groupID:${o2} key:${r2} value:` + i2, u2 = new Zt(t2); + return u2.setMessage(a2), ct.l(s2 + ". " + a2), this._updateGroupCounters({ groupID: o2, counterList: [{ key: r2, value: i2 }], avChatRoomKey: n2, mode: To }).then((e3) => (u2.end(), ct.l(s2 + " ok."), ht({ counters: e3 }))).catch((e3) => (u2.setError(e3).end(), ct.e(s2 + " failed. error:", e3), Kt(e3))); + } + getGroupCounters(e2) { + if (!this._grpM.canIUse(I.GRP_COUNTER)) + return this._grpM.noUse("getGroupCounters"); + const t2 = this._n + ".getGroupCounters", { groupID: s2, keyList: o2 = [] } = e2, { avChatRoomKey: r2, lastUpdateTime: i2 } = this._getLocalGroupCounters(s2), n2 = new Zt("getGroupCounters"); + if (n2.setMessage("groupID:" + s2), Date.now() - i2 >= this.EXPIRE_TIME) + return this._getRemoteGroupCounters({ groupID: s2, avChatRoomKey: r2 }).then((e3) => { + n2.setMoreMessage("from remote. count:" + e3.length).end(), ct.l(t2 + " from remote. groupID:" + s2); + e3 = this._getLocalCounters(s2, o2); + return ht({ counters: e3 }); + }).catch((e3) => (n2.setError(e3).end(), Kt(e3))); + n2.setMoreMessage("from cache").end(), ct.l(t2 + " from cache. groupID:" + s2); + e2 = this._getLocalCounters(s2, o2); + return jt({ counters: e2 }); + } + _getRemoteGroupCounters(s2) { + return this._grpM.req({ P: Ns, data: { ...s2 } }).then((e2) => { + var { counterList: e2 = [], groupCounterSeq: t2 } = e2.data; + return this._updateLocalGroupCounters({ groupID: s2.groupID, counterList: e2, groupCounterSeq: t2 }), ct.l(this._n + "._getRemoteGroupCounters ok. groupID:" + s2.groupID), e2; + }).catch((e2) => Kt(e2)); + } + _convertObjectToList(t2) { + const s2 = []; + return Object.keys(t2).forEach((e2) => { + s2.push({ key: e2, value: t2[e2] }); + }), s2; + } + _updateGroupCounters(e2) { + const o2 = this._n + "._updateGroupCounters", { groupID: t2, avChatRoomKey: s2, mode: r2 } = e2; + return ct.l(o2 + `. groupID:${t2} avChatRoomKey:${s2} mode:` + r2), this._grpM.req({ P: Us, data: { ...e2 } }).then((e3) => { + ct.l(o2 + " ok."); + const { counterList: t3 = [] } = e3.data, s3 = {}; + return t3.forEach((e4) => { + var { key: e4, value: t4 } = e4; + s3[e4] = t4; + }), s3; + }).catch((e3) => Kt(e3)); + } + _hasLocalGroupCounters(e2) { + return this._groupCountersMap.has(e2); + } + _getLocalGroupCounters(e2) { + return this._hasLocalGroupCounters(e2) || this.initGroupCountersCache({ groupID: e2 }), this._groupCountersMap.get(e2); + } + _updateLocalGroupCounters(s2) { + var { groupID: e2, counterList: t2 = [], groupCounterSeq: o2 } = s2; + if (this._hasLocalGroupCounters(e2)) { + const { counters: s3, avChatRoomKey: r2, groupCounterSeq: i2 } = this._getLocalGroupCounters(e2); + 0 < o2 && o2 < i2 || (t2.forEach((e3) => { + var { key: e3, value: t3 } = e3; + s3.set(e3, t3); + }), this._groupCountersMap.set(e2, { lastUpdateTime: Date.now(), groupCounterSeq: o2, counters: s3, avChatRoomKey: r2 })); + } + } + _deleteLocalGroupCounters(t2) { + var { groupID: e2, counterList: s2 = [], groupCounterSeq: o2 } = t2; + if (this._hasLocalGroupCounters(e2)) { + const { counters: t3, avChatRoomKey: r2 } = this._getLocalGroupCounters(e2); + s2.forEach((e3) => { + t3.delete(e3.key); + }), this._groupCountersMap.set(e2, { lastUpdateTime: Date.now(), groupCounterSeq: o2, counters: t3, avChatRoomKey: r2 }); + } + } + _getLocalCounters(e2, t2) { + const s2 = {}; + if (this._hasLocalGroupCounters(e2)) { + const o2 = this._getLocalGroupCounters(e2)["counters"]; + if (0 < t2.length) + t2.forEach((e3) => { + o2.has(e3) && (s2[e3] = o2.get(e3)); + }); + else + for (const r2 of o2.keys()) + s2[r2] = o2.get(r2); + } + return s2; + } + reset() { + this._groupCountersMap.clear(), this.EXPIRE_TIME = 3e4; + } +}; +var vo = class { + constructor(e2) { + var { manager: e2, groupID: t2, onInit: s2, onSuccess: o2, onFail: r2 } = e2; + this._n = "Polling", this._manager = e2, this._grpM = e2._grpM, this._onInit = s2, this._onSuccess = o2, this._onFail = r2, this._groupID = t2, this._timeoutID = -1, this._isRunning = false, this._proto = Ls; + } + start() { + var e2 = this._grpM.isLoggedIn(); + e2 || (this._proto = Cs), ct.l(`${this._n}.start pollingInterval:${this._manager.getPollingInterval()} isLoggedIn:` + e2), this._isRunning = true, this._request(); + } + isRunning() { + return this._isRunning; + } + _request() { + var e2 = this._onInit(this._groupID); + this._grpM.req({ P: this._proto, data: e2 }).then((e3) => { + this._onSuccess(this._groupID, e3), this.isRunning() && (clearTimeout(this._timeoutID), this._timeoutID = setTimeout(this._request.bind(this), this._manager.getPollingInterval())); + }).catch((e3) => { + this._onFail(this._groupID, e3), this.isRunning() && (clearTimeout(this._timeoutID), this._timeoutID = setTimeout(this._request.bind(this), this._manager.MAX_POLLING_INTERVAL)); + }); + } + stop() { + ct.l(this._n + ".stop"), 0 < this._timeoutID && (clearTimeout(this._timeoutID), this._timeoutID = -1), this._isRunning = false; + } + getPollingTimerID() { + return this._timeoutID; + } +}; +var Po = class { + constructor(e2) { + this.MAX_LENGTH = e2, this.map = /* @__PURE__ */ new Map(); + } + set(e2) { + if (this.map.size >= this.MAX_LENGTH) { + const e3 = this.map.entries().next().value[0]; + this.map.delete(e3); + } + this.map.set(e2, 1); + } + has(e2) { + return this.map.has(e2); + } + delete(e2) { + this.has(e2) && this.map.delete(e2); + } + reset() { + this.map.clear(); + } +}; +var Ro = ["groupID", "name", "avatar", "type", "introduction", "notification", "ownerID", "selfInfo", "createTime", "infoSequence", "lastInfoTime", "lastMessage", "nextMessageSeq", "memberNum", "maxMemberNum", "memberList", "joinOption", "groupCustomField", "muteAllMembers", "isSupportTopic", "inviteOption", "_lastRevokedTime"]; +var $o = class { + constructor(e2) { + 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: "", userID: "", memberCustomField: void 0, readedSequence: 0, excludedUnreadSequenceList: void 0 }, this.lastMessage = { lastTime: "", lastSequence: "", fromAccount: "", messageForShow: "" }, this.nextMessageSeq = "", this.memberNum = "", this.memberCount = "", this.maxMemberNum = "", this.maxMemberCount = "", this.joinOption = "", this.inviteOption = "", this.groupCustomField = [], this.muteAllMembers = false, this.isSupportTopic = false, this._lastRevokedTime = 0, this._initGroup(e2); + } + set memberNum(e2) { + } + set maxMemberNum(e2) { + } + get memberNum() { + return this.memberCount; + } + get maxMemberNum() { + return this.maxMemberCount; + } + _initGroup(e2) { + for (const t2 in e2) + Ro.indexOf(t2) < 0 || ("selfInfo" !== t2 ? ("memberNum" === t2 && (this.memberCount = e2[t2]), "maxMemberNum" === t2 && (this.maxMemberCount = e2[t2]), "isSupportTopic" !== t2 ? this[t2] = e2[t2] : this.isSupportTopic = 1 === e2[t2]) : this.updateSelfInfo(e2[t2])); + } + updateGroup(e2) { + e2.appid = void 0, e2.grossTopicNextMsgSeq = void 0, e2.selfInfo && (e2.selfInfo.grossTopicReadSeq = void 0); + e2 = JSON.parse(JSON.stringify(e2)); + e2.lastMsgTime && (this.lastMessage.lastTime = e2.lastMsgTime), Ke(e2.muteAllMembers) || ("On" === e2.muteAllMembers ? e2.muteAllMembers = true : e2.muteAllMembers = false), e2.groupCustomField && Qe(this.groupCustomField, e2.groupCustomField), Ke(e2.memberNum) || (this.memberCount = e2.memberNum), Ke(e2.maxMemberNum) || (this.maxMemberCount = e2.maxMemberNum), Ke(e2.isSupportTopic) || (this.isSupportTopic = xe(e2.isSupportTopic) ? 1 === e2.isSupportTopic : e2.isSupportTopic), We(this, e2, ["members", "errorCode", "lastMsgTime", "groupCustomField", "memberNum", "maxMemberNum", "isSupportTopic"]), je(e2.members) && 0 < e2.members.length && e2.members.forEach((e3) => { + e3.userID === this.selfInfo.userID && We(this.selfInfo, e3, ["sequence"]); + }); + } + updateSelfInfo({ nameCard: e2, joinTime: t2, role: s2, messageRemindType: o2, readedSequence: r2, excludedUnreadSequenceList: i2 }) { + e2 = { nameCard: e2, joinTime: t2, role: s2, messageRemindType: o2, readedSequence: r2, excludedUnreadSequenceList: i2 }; + We(this.selfInfo, { ...e2 }, [], ["", null, void 0, 0, NaN]); + } + setSelfNameCard(e2) { + this.selfInfo.nameCard = e2; + } +}; +var Eo = { 3: true, 4: true, 5: true, 6: true, 17: true, 20: true, 21: true, 100: true }; +var wo = class { + constructor(e2) { + this._grpM = e2, this._n = "AVChatRoomHandler", this._joinedGroupMap = /* @__PURE__ */ new Map(), this._pollingRequestInfoMap = /* @__PURE__ */ new Map(), this._pollingInstanceMap = /* @__PURE__ */ new Map(), this._seqSll = new Po(200), this._IDSll = new Po(100), this._reportMessageStackedCount = 0, this._onlineMemberCountMap = /* @__PURE__ */ new Map(), this.DEFAULT_EXPIRE_TIME = 60, this.DEFAULT_POLLING_INTERVAL = 300, this.MAX_POLLING_INTERVAL = 2e3, this._pollingInterval = this.DEFAULT_POLLING_INTERVAL, this.DEFAULT_POLLING_NO_MESSAGE_COUNT = 20, this.DEFAULT_POLLING_INTERVAL_PLUS = 2e3, this._pollingNoMessageCount = 0, this._startBroadcastSeq = 1, this._broadcastMessageIDMap = /* @__PURE__ */ new Map(), this.DEFAULT_POLLING_SIMPLIFIED_MSG = 0; + } + hasJoinedAVChatRoom() { + let e2 = []; + return 0 < (e2 = 0 < this._joinedGroupMap.size ? [...this._joinedGroupMap.values()].filter((e3) => e3.type === me) : e2).length; + } + getJoinedLiveList() { + let e2 = []; + return e2 = 0 < this._joinedGroupMap.size ? [...this._joinedGroupMap.values()].filter((e3) => e3.type === fe) : e2; + } + checkJoinedAVChatRoomByID(e2) { + return this._joinedGroupMap.has(e2); + } + getJoinedAVChatRoom() { + return 0 < this._joinedGroupMap.size ? [...this._joinedGroupMap.keys()] : []; + } + _updatedata(e2) { + var t2 = this._pollingRequestInfoMap.get(e2); + return e2 === [...this._pollingInstanceMap.keys()][0] ? { ...t2, startBroadcastSeq: this._startBroadcastSeq, simplifiedMessage: this.DEFAULT_POLLING_SIMPLIFIED_MSG } : { ...t2, simplifiedMessage: this.DEFAULT_POLLING_SIMPLIFIED_MSG }; + } + _handleSuccess(e2, t2) { + const { key: s2, nextSeq: o2, rspMsgList: r2, errorCode: i2, nextBroadcastSeq: n2, broadcastMessageList: a2 } = t2.data; + if (0 !== i2) { + const s3 = this._pollingRequestInfoMap.get(e2), o3 = new Zt("longPollingAVError"), r3 = s3 ? s3.key + "-" + s3.startSeq : "requestInfo is undefined"; + o3.setMessage(`${e2}-${r3}-` + t2.errorInfo).setCode(t2.errorCode).end(true); + } else + this.checkJoinedAVChatRoomByID(e2) && (Ve(s2) && xe(o2) && this._pollingRequestInfoMap.set(e2, { key: s2, startSeq: o2 }), xe(n2) && n2 > this._startBroadcastSeq && (this._startBroadcastSeq = n2), je(r2) && 0 < r2.length ? (r2.forEach((e3) => { + e3.to = e3.groupID; + }), this.onMessage(r2, e2)) : (this._pollingNoMessageCount += 1, this._pollingNoMessageCount === this.DEFAULT_POLLING_NO_MESSAGE_COUNT && (this._pollingInterval = this.DEFAULT_POLLING_INTERVAL + this.DEFAULT_POLLING_INTERVAL_PLUS)), this._onBroadcastMessage(a2)); + } + _handleFailure(e2, t2) { + } + onMessage(i2, n2) { + if (je(i2) && 0 !== i2.length) { + let t2 = this._n + ".onMessage"; + n2 && (t2 += " groupID:" + n2), 0 !== this._pollingNoMessageCount && (this._pollingNoMessageCount = 0, this._pollingInterval = this.DEFAULT_POLLING_INTERVAL); + var a2 = null, u2 = [], l2 = this._get(o), h2 = this._get(p), c2 = i2.length, m2 = (1 < c2 && i2.sort((e2, t3) => e2.sequence - t3.sequence), this._get(r).isUnlimitedAVChatRoom()); + let s2 = false; + if (ct.getLevel() <= 0) { + const n3 = i2.map((e2) => e2.sequence); + ct.l(`${t2} count:${n3.length} sequenceList:` + n3), n3.length = 0; + } + for (let e2 = 0; e2 < c2; e2++) { + const n3 = this.restoreMessageFromSimplified(i2[e2]); + if (Eo[n3.event]) { + if (6 === n3.event) { + if (this._grpM.isGroupAttributesUpdatedNotice(n3)) + continue; + if (this._grpM.isGroupCountersNotice(n3)) + continue; + } + if (20 === n3.event) + this.handleMessageRevokedNotice(n3); + else if (21 === n3.event) + this._get(g).onMessageReactionNotify({ event: 21, dataList: n3.elements.messageReactionNotifyList }); + else if (100 === n3.event) + this.onRoomCustomData(n3); + else { + a2 = this.packMessage(n3, n3.event); + const r2 = 1 === n3.isModified; + if (s2 = 1 === n3.isHistoryMessage, !m2) { + if (this._seqSll.has(a2.sequence)) + continue; + this._seqSll.set(a2.sequence); + } + const p2 = this._IDSll.has(a2.ID); + if (p2) + ct.w(`${t2} ID:${a2.ID} has:` + p2); + else { + this._IDSll.set(a2.ID); + let e3 = false; + if (!s2 && this._isMessageSentByCurrentInstance(a2) ? r2 && (e3 = true, a2.isModified = r2, l2.updateMsgIsModifiedProp(a2)) : e3 = true, e3) { + if (a2.conversationType === le && 5 === a2.payload.operationType && this._onGroupDismissed(a2.payload.groupProfile.groupID), !s2 && a2.conversationType !== le) { + const i3 = a2.conversationID.replace(ue, ""); + this._pollingInstanceMap.has(i3) ? this._grpM.isLoggedIn() && h2.addMessageSequence({ key: zt, message: a2 }) : (a2.type !== Z && 0 < a2.clientTime && h2.addMessageDelay(a2.clientTime), h2.addMessageSequence({ key: Wt, message: a2 })); + } + u2.push(a2); + } + } + } + } else + ct.w(t2 + ". unknown event:" + n3.event); + } + if (0 !== u2.length) { + n2 = Ze(u2); + if (0 < n2.length && this._grpM.emitOEvt(Nt, n2), !s2) { + const i3 = this.packConversationOption(u2); + 0 < i3.length && l2.onNewMessage({ conversationOptionsList: i3, isInstantMessage: true }); + } + this._checkMessageStacked(u2); + n2 = et(u2); + 0 < n2.length && this._grpM.emitOEvt(Ut, n2), u2.length = 0; + } + } + } + handleMessageRevokedNotice(e2) { + const { groupID: r2, elements: { revokeMsgList: t2 }, revokerInfo: i2 } = e2, n2 = []; + t2.forEach((e3) => { + var { tinyID: e3, clientTime: t3, random: s2, sequence: o2 } = e3, e3 = { conversationID: "" + ue + r2, ID: e3 + `-${t3}-` + s2, revoker: i2.revoker, revokeReason: i2.reason || "", revokerInfo: { userID: i2.revoker, nick: "", avatar: "" }, sequence: o2 }; + n2.push(e3); + }), 0 !== n2.length && this._get(o).updateRevokerInfo(n2).then((e3) => { + this._grpM.emitOEvt(qt, e3); + }); + } + isBroadcastOrNormal(e2) { + return 3 === e2 || 17 === e2; + } + isGroupTip(e2) { + return 4 === e2 || 6 === e2; + } + isGroupSystemNotice(e2) { + return 5 === e2; + } + restoreGroupTipElements(e2 = {}) { + var { operatorInfo: t2 = {}, operatorID: s2, userIDList: o2 = [], operationType: r2 } = e2, { userID: r2 = s2, avatar: t2 = "", nick: s2 = "" } = (xe(e2.groupJoinType) || 1 !== r2 && 2 !== r2 || (e2.groupJoinType = 2 === r2 ? 0 : 1), t2), r2 = (e2.operatorInfo = { userID: r2, avatar: t2, nick: s2 }, o2.map((e3) => ({ userID: e3 }))); + return e2.memberInfoList = e2.memberInfoList || r2, e2; + } + restoreMessageFromSimplified(s2) { + const e2 = s2["event"]; + if (this.isBroadcastOrNormal(e2) && (s2.cloudCustomData = s2.cloudCustomData || "", s2.elements = s2.elements.map((e3) => { + var t2; + return e3.type === te && ({ content: t2 = {} } = e3, e3.content = { data: "", description: "", extension: "", ...t2 }), e3; + })), (this.isGroupTip(e2) || this.isGroupSystemNotice(e2)) && (s2.from = s2.from || "@TIM#SYSTEM"), this.isGroupTip(e2)) { + s2.elements = this.restoreGroupTipElements(s2.elements); + const { elements: e3 = {} } = s2, { operationType: t2, operatorInfo: r2 = {} } = e3; + if (1 === t2) { + const s3 = [{ userID: r2.userID }]; + e3.memberInfoList = e3.memberInfoList || s3; + } + } + if (this.isGroupSystemNotice(e2)) { + let { memberInfoList: e3, operatorInfo: t2 = {} } = s2.elements; + e3 = e3 || t2, s2.elements.memberInfoList = { userID: s2.elements.operatorID, avatar: "", nick: "", ...e3 }, s2.elements = { authentication: "", remarkInfo: "", messageKey: 1e3 * s2.time, ...s2.elements }; + var o2 = Object.keys(s2.elements).filter((e4) => "operatorInfo" !== e4).reduce((e4, t3) => ({ ...e4, [t3]: s2.elements[t3] }), {}); + s2.elements = o2; + } + return s2; + } + _onGroupDismissed(e2) { + ct.l(this._n + "._onGroupDismissed groupID:" + e2), this._grpM.deleteLocalGroupAndConversation(e2), this.reset(e2); + } + _checkMessageStacked(e2) { + var t2 = "MessageStacked", e2 = e2.length; + 100 <= e2 && (this._grpM.warn(t2, e2), this._reportMessageStackedCount < 5) && (new Zt(t2).setMessage(`count:${e2} groupID:` + [...this._joinedGroupMap.keys()]).setLevel("warning").end(), this._reportMessageStackedCount += 1); + } + _isMessageSentByCurrentInstance(e2) { + return !!this._get(o).isMessageSentByCurrentInstance(e2); + } + packMessage(e2, t2) { + e2.currentUser = this._grpM.getMyUserID(), e2.conversationType = 5 === t2 ? le : ue, e2.isSystemMessage = !!e2.isSystemMessage; + var s2 = new _o(e2), e2 = this.packElements(e2, t2), t2 = this._grpM.getFileDownloadProxy(), o2 = this._grpM.getDowloadFileAuthKey(), r2 = this._get(n).getFileDNList(); + return s2.setElement(e2, t2, o2, r2), s2; + } + packElements(e2, t2) { + return 4 === t2 || 6 === t2 ? (this._updateMemberCountByGroupTips(e2), { type: Z, content: { ...e2.elements, groupProfile: e2.groupProfile } }) : 5 === t2 ? { type: ee, content: { ...e2.elements, groupProfile: { ...e2.groupProfile, groupID: e2.groupID } } } : e2.elements; + } + packConversationOption(t2) { + var s2 = /* @__PURE__ */ new Map(); + for (let e2 = 0; e2 < t2.length; e2++) { + var o2 = t2[e2], r2 = o2.conversationID; + if (s2.has(r2)) { + const t3 = s2.get(r2); + "in" === (t3.lastMessage = o2).flow && t3.unreadCount++; + } else + s2.set(r2, { conversationID: o2.conversationID, unreadCount: "out" === o2.flow ? 0 : 1, type: o2.conversationType, subType: o2.conversationSubType, lastMessage: o2 }); + } + return [...s2.values()]; + } + _updateMemberCountByGroupTips(e2) { + var t2, s2, o2, { groupProfile: { groupID: e2 }, elements: { onlineMemberInfo: r2 } } = e2; + qe(r2) || ({ onlineMemberNum: r2 = 0, expireTime: t2 = this.DEFAULT_EXPIRE_TIME } = r2, s2 = this._onlineMemberCountMap.get(e2) || {}, o2 = Date.now(), qe(s2) ? Object.assign(s2, { lastReqTime: 0, lastSyncTime: 0, latestUpdateTime: o2, memberCount: r2, expireTime: t2 }) : (s2.latestUpdateTime = o2, s2.memberCount = r2), this._onlineMemberCountMap.set(e2, s2)); + } + _onBroadcastMessage(t2) { + if (!qe(t2)) { + const o2 = [], r2 = t2.length; + var s2 = null; + for (let e2 = 0; e2 < r2; e2++) { + const r3 = this.restoreMessageFromSimplified(t2[e2]); + Eo[r3.event] ? ((s2 = this.packMessage(r3, r3.event)).isBroadcastMessage = true, this._broadcastMessageIDMap.has(s2.ID) || (o2.push(s2), this._broadcastMessageIDMap.set(s2.ID, 1))) : ct.w(this._n + "._onBroadcastMessage unknown event:" + r3.event); + } + 0 < o2.length && this._grpM.emitOEvt(Ut, o2); + } + } + start(e2) { + if (this._pollingInstanceMap.has(e2)) { + const t2 = this._pollingInstanceMap.get(e2); + void (t2.isRunning() || t2.start()); + } else { + const t2 = new vo({ manager: this, groupID: e2, onInit: this._updatedata.bind(this), onSuccess: this._handleSuccess.bind(this), onFail: this._handleFailure.bind(this) }); + t2.start(), this._pollingInstanceMap.set(e2, t2), ct.l(this._n + ".start groupID:" + e2); + } + } + handleJoinResult(o2) { + return this._preCheck(o2.group).then(() => { + var { longPollingKey: e2, group: t2 } = o2, s2 = t2.groupID; + return this._joinedGroupMap.set(s2, t2), this._grpM.updateGroupMap([t2]), this._grpM.deleteUnjoinedAVChatRoom(s2), this._grpM.emitGroupListUpdate(true, false), Ke(e2) ? jt({ status: $e, group: t2 }) : Promise.resolve(); + }); + } + startRunLoop(r2) { + return this.handleJoinResult(r2).then(() => { + var { longPollingKey: e2, group: t2, startSeq: s2 = 0 } = r2, o2 = t2.groupID; + return this._pollingRequestInfoMap.set(o2, { key: e2, startSeq: s2 }), this.start(o2), this._grpM.isLoggedIn() ? jt({ status: $e, group: t2 }) : jt({ status: $e }); + }); + } + _preCheck(e2) { + if (!this._get(r).isUnlimitedAVChatRoom() && this.hasJoinedAVChatRoom() && e2.type !== fe) { + var [e2, t2] = this._joinedGroupMap.entries().next().value; + if (this._grpM.isLoggedIn() && t2.selfInfo.role !== Me && t2.ownerID !== this._grpM.getMyUserID()) + return this._grpM.quitGroup(e2); + this._grpM.deleteLocalGroupAndConversation(e2), this.reset(e2); + } + return Promise.resolve(); + } + joinWithoutAuth(e2) { + const s2 = e2["groupID"], r2 = this._n + ".joinWithoutAuth", n2 = new Zt("joinWithoutAuth"); + return this._grpM.req({ P: as, data: e2 }).then(({ data: { longPollingKey: e3 } }) => { + if (n2.setMessage(`groupID:${s2} longPollingKey:` + e3).end(true), Ke(e3)) + return Kt({ code: Gt }); + ct.l(r2 + " ok. groupID:" + s2), this._get(o).setCompleted("" + ue + s2); + var t2 = new $o({ groupID: s2 }); + return this.startRunLoop({ group: t2, longPollingKey: e3 }), ht({ status: $e }); + }).catch((e3) => (ct.e(r2 + ` failed. groupID:${s2} error:`, e3), n2.setError(e3).setMessage("groupID:" + s2).end(true), Kt(e3))).finally(() => { + this._grpM.get(i).reportAtOnce(); + }); + } + getGroupOnlineMemberCount(e2) { + var t2 = this._onlineMemberCountMap.get(e2) || {}, s2 = Date.now(); + return qe(t2) || s2 - t2.lastSyncTime > 1e3 * t2.expireTime && 1e4 < s2 - t2.latestUpdateTime && 3e3 < s2 - t2.lastReqTime ? (t2.lastReqTime = s2, this._onlineMemberCountMap.set(e2, t2), this._getGroupOnlineMemberCount(e2).then((e3) => ht({ memberCount: e3.memberCount })).catch((e3) => Kt(e3))) : jt({ memberCount: t2.memberCount }); + } + _getGroupOnlineMemberCount(r2) { + const i2 = this._n + "._getGroupOnlineMemberCount", t2 = new Zt("_getGroupOnlineMemberCount"); + return this._grpM.requestOnlineCount(r2).then((e2) => { + var t3 = this._onlineMemberCountMap.get(r2) || {}, { memberCount: e2 = 0, expireTime: s2 = this.DEFAULT_EXPIRE_TIME } = e2.data, o2 = (ct.l(i2 + ` ok. groupID:${r2} memberCount:${e2} expireTime:` + s2), Date.now()); + return qe(t3) && (t3.lastReqTime = o2), this._onlineMemberCountMap.set(r2, Object.assign(t3, { lastSyncTime: o2, latestUpdateTime: o2, memberCount: e2, expireTime: s2 })), { memberCount: e2 }; + }).catch((e2) => (ct.w(i2 + " failed. error:", e2), t2.setCode(e2.code).setMessage(`groupID:${r2} error:` + JSON.stringify(e2)).end(), Promise.reject(e2))); + } + _get(e2) { + return this._grpM.get(e2); + } + setPollingInterval(e2) { + Ke(e2) || (xe(e2) ? this._pollingInterval = this.DEFAULT_POLLING_INTERVAL = e2 : this._pollingInterval = this.DEFAULT_POLLING_INTERVAL = parseInt(e2, 10)); + } + setPollingIntervalPlus(e2) { + Ke(e2) || (xe(e2) ? this.DEFAULT_POLLING_INTERVAL_PLUS = e2 : this.DEFAULT_POLLING_INTERVAL_PLUS = parseInt(e2, 10)); + } + setPollingNoMessageCount(e2) { + Ke(e2) || (xe(e2) ? this.DEFAULT_POLLING_NO_MESSAGE_COUNT = e2 : this.DEFAULT_POLLING_NO_MESSAGE_COUNT = parseInt(e2, 10)); + } + setPollingSimplifiedMessage(e2) { + Ke(e2) || "0" !== e2 && "1" !== e2 || (this.DEFAULT_POLLING_SIMPLIFIED_MSG = parseInt(e2, 10)); + } + getPollingInterval() { + return this._pollingInterval; + } + onAVChatRoomMemberBanned(e2) { + e2 = e2.payload.groupProfile.groupID; + ct.l(this._n + ".onAVChatRoomMemberBanned groupID:" + e2), this._grpM.deleteLocalGroupAndConversation(e2), this.reset(e2); + } + restartPolling() { + ct.l(this._n + ".restartPolling count:" + this._pollingInstanceMap.size); + for (const e2 of this._pollingInstanceMap.values()) + e2.stop(), e2.start(); + } + getPollingTimerID(e2) { + var t2; + return this._pollingInstanceMap.has(e2) ? (t2 = this._pollingInstanceMap.get(e2).getPollingTimerID(), ct.l(this._n + `.getPollingTimerID groupID:${e2} timerID:` + t2), t2) : -1; + } + hasPollingInstance(e2) { + return this._pollingInstanceMap.has(e2); + } + onRoomCustomData(e2) { + var { groupID: e2, sequence: t2, time: s2, elements: o2 } = e2, o2 = o2 && o2.content; + this._get(h).onRoomCustomDataReceived(o2), ct.l(this._n + `.onRoomCustomData groupID:${e2} sequence:${t2} time:${s2} data:` + o2); + } + reset(e2) { + if (e2) { + ct.l(this._n + ".reset groupID:" + e2); + var t2 = this._pollingInstanceMap.get(e2); + t2 && t2.stop(), this._pollingInstanceMap.delete(e2), this._joinedGroupMap.delete(e2), this._pollingRequestInfoMap.delete(e2), this._onlineMemberCountMap.delete(e2); + } else { + ct.l(this._n + ".reset all"); + for (const e3 of this._pollingInstanceMap.values()) + e3.stop(); + this._pollingInstanceMap.clear(), this._joinedGroupMap.clear(), this._pollingRequestInfoMap.clear(), this._onlineMemberCountMap.clear(), this._broadcastMessageIDMap.clear(); + } + this._seqSll.reset(), this._IDSll.reset(), this._reportMessageStackedCount = 0, this._pollingInterval = this.DEFAULT_POLLING_INTERVAL = 300, this.DEFAULT_POLLING_NO_MESSAGE_COUNT = 20, this.DEFAULT_POLLING_INTERVAL_PLUS = 2e3, this._pollingNoMessageCount = 0; + } +}; +var Uo = class { + constructor(e2) { + this.userID = "", this.avatar = "", this.nick = "", this.role = "", this.joinTime = "", this.lastSendMsgTime = "", this.nameCard = "", this.muteUntil = 0, this.memberCustomField = [], this.isOnline = false, this.updateMember(e2); + } + updateMember(e2) { + Ke(e2.onlineStatus) || (this.isOnline = "Online" === e2.onlineStatus); + var t2 = [null, void 0, "", 0, NaN]; + e2.memberCustomField && Qe(this.memberCustomField, e2.memberCustomField), We(this, e2, ["memberCustomField", "marks", "onlineStatus"], t2); + } + updateRole(e2) { + ["Owner", "Admin", "Member"].indexOf(e2) < 0 || (this.role = e2); + } + updateMuteUntil(e2) { + Ke(e2) || (this.muteUntil = Math.floor((Date.now() + 1e3 * e2) / 1e3)); + } + updateNameCard(e2) { + Ke(e2) || (this.nameCard = e2); + } + updateMemberCustomField(e2) { + e2 && Qe(this.memberCustomField, e2); + } +}; +var No = class { + constructor(e2) { + this._grpM = e2, this._n = "GroupMemberHandler", this.groupMemberListMap = /* @__PURE__ */ new Map(), this.DEFAULT_MEMBER_INFO_FILTER = ["Role", "JoinTime", "NameCard", "ShutUpUntil", "OnlineStatus"], this._grpM.getIEmitInst().on(Bt.PROFILE_UPDATED, this._onProfileUpdated, this); + } + _onProfileUpdated({ data: t2 }) { + for (let e2 = 0; e2 < t2.length; e2++) { + const s2 = t2[e2]; + this.groupMemberListMap.forEach((e3) => { + e3.has(s2.userID) && e3.get(s2.userID).updateMember({ nick: s2.nick, avatar: s2.avatar }); + }); + } + } + deleteGroupMemberList(e2) { + this.groupMemberListMap.delete(e2); + } + getGroupMemberList({ groupID: r2, role: e2, offset: s2 = 0, count: o2 = 15, filter: i2 }) { + const n2 = this._n + ".getGroupMemberList", a2 = this._grpM.hasLocalGroup(r2); + if (ct.l(n2 + ` groupID:${r2} role:${e2} offset:${s2} count:${o2} hasLocalGroup:` + a2), !a2) + return jt({ memberList: [], offset: 0 }); + if (this._grpM.getLocalGroupProfile(r2).type === me) { + if (this._grpM.canIUse(I.AV_MBR_LIST)) + return this._getAVChatRoomMemberList({ groupID: r2, offset: s2, filter: i2 }); + this._grpM.warn("LiveOnlineMember"); + } + let u2; + e2 !== Ie && e2 !== Me && e2 !== ye || (u2 = e2); + const p2 = new Zt("getGroupMemberList"); + let l2 = 0; + i2 = { groupID: r2, limit: 100 < o2 ? 100 : o2, memberRoleFilter: u2 ? [u2] : void 0, memberInfoFilter: this.DEFAULT_MEMBER_INFO_FILTER }; + ot({ groupID: r2 }) ? i2.next = "" + s2 : (i2.offset = s2, l2 = s2 + o2); + let h2 = []; + return this._grpM.req({ P: qs, data: i2 }).then(({ data: { members: e3, memberNum: s3, next: o3 } }) => (Ke(o3) || (l2 = qe(o3) ? 0 : o3), je(e3) && 0 !== e3.length ? (this._grpM.hasLocalGroup(r2) && (this._grpM.getLocalGroupProfile(r2).memberNum = s3), h2 = this._updateLocalGroupMemberMap(r2, e3), this._grpM.get(t).getUserProfile({ userIDList: e3.map((e4) => e4.userID), tagList: [Re.NICK, Re.AVATAR] })) : (l2 = 0, Promise.resolve([])))).then((e3) => { + var e3 = e3["data"]; + return je(e3) && 0 !== e3.length ? (e3 = e3.map((e4) => ({ userID: e4.userID, nick: e4.nick, avatar: e4.avatar })), this._updateLocalGroupMemberMap(r2, e3), h2.length < o2 && (l2 = 0), p2.setMessage(`groupID:${r2} offset:${s2} count:` + o2).end(), ct.l(n2 + " ok."), ht({ memberList: h2, offset: l2 })) : jt({ memberList: [], offset: l2 }); + }).catch((e3) => (p2.setError(e3).end(), ct.e(n2 + " failed. error:", e3), Kt(e3))); + } + _getAVChatRoomMemberList({ groupID: s2, offset: e2, filter: t2 }) { + const o2 = this._n + "._getAVChatRoomMemberList", r2 = new Zt("_getAVChatRoomMemberList"); + return r2.setMessage(`groupID:${s2} offset:${e2} filter:` + t2), this._grpM.req({ P: ks, data: { groupID: s2, offset: e2, filter: t2 } }).then((e3) => { + var { memberList: e3 = [], offset: t3 = 0 } = e3.data, e3 = (r2.end(), ct.l(o2 + ` ok. member count:${e3.length}, next request timestamp:` + t3), e3.map((e4) => ({ ...e4, onlineStatus: "Online" }))), e3 = this._updateLocalGroupMemberMap(s2, e3); + return ht({ memberList: e3, offset: t3 }); + }).catch((e3) => (r2.setError(e3).end(), ct.e(o2 + " failed. error:", e3), Kt(e3))); + } + getGroupMemberProfile(e2) { + var s2 = "getGroupMemberProfile", o2 = this._n + "." + s2; + let r2 = "groupID:" + e2.groupID; + 5 < e2.userIDList.length ? r2 += " userIDList.length:" + e2.userIDList.length : r2 += " userIDList:" + e2.userIDList, ct.l(o2 + " " + r2), 50 < e2.userIDList.length && (e2.userIDList = e2.userIDList.slice(0, 50)); + const { groupID: i2, userIDList: n2 } = e2, a2 = this._grpM.getLocalGroupProfile(i2); + if (a2 && st(a2.type)) { + const e3 = Pt; + return Kt({ code: e3, message: this._grpM.getErrMsg(e3, s2) }); + } + const u2 = new Zt(s2); + return u2.setMessage(r2), this._getGroupMemberProfileAdvance({ ...e2, userIDList: n2 }).then((e3) => { + e3 = e3.data.members; + return je(e3) && 0 !== e3.length ? (this._updateLocalGroupMemberMap(i2, e3), this._grpM.get(t).getUserProfile({ userIDList: e3.map(({ userID: e4 }) => e4), tagList: [Re.NICK, Re.AVATAR] })) : jt([]); + }).then((e3) => { + e3 = e3.data.map(({ userID: e4, nick: t2, avatar: s3 }) => ({ userID: e4, nick: t2, avatar: s3 })), this._updateLocalGroupMemberMap(i2, e3), e3 = n2.filter((e4) => this.hasLocalGroupMember(i2, e4)).map((e4) => this.getLocalGroupMemberInfo(i2, e4)); + return u2.end(), ht({ memberList: e3 }); + }); + } + addGroupMember(i2) { + const n2 = this._n + ".addGroupMember", e2 = i2["groupID"], a2 = this._grpM.getLocalGroupProfile(e2), t2 = a2["type"], u2 = new Zt("addGroupMember"); + if (u2.setMessage(`groupID:${e2} groupType:` + t2), st(t2)) { + const i3 = new gt({ code: Ct }); + return u2.setError(i3).end(), Kt(i3); + } + return i2.userIDList = i2.userIDList.map((e3) => ({ userID: e3 })), ct.l(n2 + " groupID:" + e2), this._grpM.req({ P: Fs, data: i2 }).then(({ data: { members: e3 } }) => { + ct.l(n2 + " ok"); + var t3 = e3.filter((e4) => 1 === e4.result).map((e4) => e4.userID), s2 = e3.filter((e4) => 0 === e4.result).map((e4) => e4.userID), o2 = e3.filter((e4) => 2 === e4.result).map((e4) => e4.userID), e3 = e3.filter((e4) => 4 === e4.result).map((e4) => e4.userID), r2 = `groupID:${i2.groupID}, successUserIDList:${t3}, failureUserIDList:${s2}, existedUserIDList:${o2}, overLimitUserIDList:` + e3; + return u2.setMoreMessage(r2).end(), 0 === t3.length ? ht({ successUserIDList: t3, failureUserIDList: s2, existedUserIDList: o2, overLimitUserIDList: e3 }) : (this._updateConvGroupProfile(a2), ht({ successUserIDList: t3, failureUserIDList: s2, existedUserIDList: o2, overLimitUserIDList: e3, group: a2 })); + }).catch((e3) => (u2.setError(e3).end(), ct.e(n2 + " failed. error:", e3), Kt(e3))); + } + deleteGroupMember(e2) { + const t2 = this._n + ".deleteGroupMember", { groupID: s2, userIDList: o2 } = e2, r2 = this._grpM.getLocalGroupProfile(s2); + if (Ke(r2)) + return Kt({ code: Mt }); + if (st(r2.type)) + return this._grpM.canIUse(I.AV_BAN_MBR) ? this._banAVChatRoomMember(e2) : this._grpM.noUse("deleteGroupMember"); + var i2 = `groupID:${s2} ` + (5 < o2.length ? "userIDList.length:" + o2.length : "userIDList:" + o2); + ct.l(t2 + ` groupID:${s2} userIDList:`, o2); + const n2 = new Zt("deleteGroupMember"); + return n2.setMessage(i2), this._grpM.req({ P: xs, data: e2 }).then(() => (n2.end(), ct.l(t2 + " ok"), this._updateConvGroupProfile(r2), this.deleteLocalGroupMembers(s2, o2), ht({ group: r2, userIDList: o2 }))).catch((e3) => (n2.setError(e3).end(), ct.e(t2 + " failed. error:", e3), Kt(e3))); + } + _updateConvGroupProfile(e2) { + this._grpM.get(o).updateConvGroupProfile([e2]); + } + _banAVChatRoomMember(e2) { + const t2 = this._n + "._banAVChatRoomMember", { groupID: s2, userIDList: o2 } = e2, r2 = `groupID:${s2} ` + (5 < o2.length ? "userIDList.length:" + o2.length : "userIDList:" + o2), i2 = new Zt("_banAVChatRoomMember"), n2 = (i2.setMessage(r2), ct.l(t2 + ` groupID:${s2} userIDList:`, o2), this._grpM.getLocalGroupProfile(s2)); + return Ke(e2.duration) || 0 === e2.duration ? Kt({ code: vt }) : this._grpM.req({ P: Vs, data: e2 }).then(() => (i2.end(), ct.l(t2 + " ok"), this.deleteLocalGroupMembers(s2, o2), ht({ group: n2, userIDList: o2 }))).catch((e3) => (i2.setError(e3).end(), ct.e(t2 + " failed. error:", e3), Kt(e3))); + } + setGroupMemberMuteTime(e2) { + const { groupID: s2, userID: t2, muteTime: o2 } = e2, r2 = this._n + ".setGroupMemberMuteTime"; + if (t2 === this._grpM.getMyUserID()) + return Kt({ code: St }); + e2 = `groupID:${s2} userID:${t2} muteTime:` + o2; + ct.l(r2 + " " + e2); + const i2 = new Zt("setGroupMemberMuteTime"); + return i2.setMessage(e2), this.modifyGroupMemberInfo({ groupID: s2, userID: t2, muteTime: o2 }).then((e3) => { + i2.end(), ct.l(r2 + " ok"); + var t3 = this._grpM.getLocalGroupProfile(s2); + return ht({ group: t3, member: e3 }); + }).catch((e3) => (i2.setError(e3).end(), ct.e(r2 + " failed. error:", e3), Kt(e3))); + } + setGroupMemberRole(e2) { + const t2 = this._n + ".setGroupMemberRole", { groupID: s2, userID: o2, role: r2 } = e2, i2 = `groupID:${s2} userID:${o2} role:` + r2, n2 = this._grpM.getLocalGroupProfile(s2); + if (n2 && n2.selfInfo.role !== Me) + return Kt({ code: bt }); + e2 = [Ie, ye]; + if (ot({ groupID: s2 }) && e2.push(De), e2.indexOf(r2) < 0) + return Kt({ code: At }); + if (o2 === this._grpM.getMyUserID()) + return Kt({ code: Tt }); + const a2 = new Zt("setGroupMemberRole"); + return a2.setMessage(i2), ct.l(t2 + " " + i2), this.modifyGroupMemberInfo({ groupID: s2, userID: o2, role: r2 }).then((e3) => (a2.end(), ct.l(t2 + " ok"), ht({ group: n2, member: e3 }))).catch((e3) => (a2.setError(e3).end(), ct.e(t2 + " failed. error:", e3), Kt(e3))); + } + _filterProfanity(e2, t2) { + var s2, o2 = this._grpM.get(c); + return !o2 || ({ isAllowedToSend: o2, modifiedText: s2 } = o2.filterText(t2[e2], D), true === o2 && (t2[e2] = s2, true)); + } + setGroupMemberNameCard(e2) { + const t2 = "setGroupMemberNameCard", s2 = this._n + "." + t2; + if (e2.nameCard && false === this._filterProfanity("nameCard", e2)) + return Kt({ code: wt }); + const { groupID: o2, userID: r2 = this._grpM.getMyUserID(), nameCard: i2 } = e2, n2 = `groupID:${o2} userID:${r2} nameCard:` + i2; + ct.l(s2 + " " + n2); + e2 = this._grpM.getLocalGroupProfile(o2); + if (e2 && st(e2.type)) { + const e3 = Pt; + return Kt({ code: e3, message: this._grpM.getErrMsg(e3, t2) }); + } + const a2 = new Zt(t2); + return a2.setMessage(n2), this.modifyGroupMemberInfo({ groupID: o2, userID: r2, nameCard: i2 }).then((e3) => { + ct.l(s2 + " ok"), a2.end(); + var t3 = this._grpM.getLocalGroupProfile(o2); + return r2 === this._grpM.getMyUserID() && t3 && t3.setSelfNameCard(i2), ht({ group: t3, member: e3 }); + }).catch((e3) => (a2.setError(e3).end(), ct.e(s2 + " failed. error:", e3), Kt(e3))); + } + setGroupMemberCustomField(e2) { + const t2 = "setGroupMemberCustomField", s2 = this._n + "." + t2, { groupID: o2, userID: r2 = this._grpM.getMyUserID(), memberCustomField: i2 } = e2, n2 = `groupID:${o2} userID:${r2} memberCustomField:` + JSON.stringify(i2); + ct.l(s2 + " " + n2); + e2 = this._grpM.getLocalGroupProfile(o2); + if (e2 && st(e2.type)) { + const e3 = Pt; + return Kt({ code: e3, message: this._grpM.getErrMsg(e3, t2) }); + } + const a2 = new Zt(t2); + return a2.setMessage(n2), this.modifyGroupMemberInfo({ groupID: o2, userID: r2, memberCustomField: i2 }).then((e3) => { + a2.end(), ct.l(s2 + " ok"); + var t3 = this._grpM.getLocalGroupProfile(o2); + return ht({ group: t3, member: e3 }); + }).catch((e3) => (a2.setError(e3).end(), ct.e(s2 + " failed. error:", e3), Kt(e3))); + } + modifyGroupMemberInfo(t2) { + let { groupID: s2, userID: o2 } = t2, e2 = void 0; + return rt(s2) && (s2 = it(e2 = s2)), this._grpM.req({ P: Hs, data: { ...t2, groupID: s2, topicID: e2 } }).then(() => { + if (this.hasLocalGroupMember(s2, o2)) { + const e4 = this.getLocalGroupMemberInfo(s2, o2); + return Ke(t2.muteTime) || e4.updateMuteUntil(t2.muteTime), Ke(t2.role) || e4.updateRole(t2.role), Ke(t2.nameCard) || e4.updateNameCard(t2.nameCard), Ke(t2.memberCustomField) || e4.updateMemberCustomField(t2.memberCustomField), e4; + } + const e3 = this._grpM.getLocalGroupProfile(s2); + if (e3 && !st(e3.type)) + return this.getGroupMemberProfile({ groupID: s2, userIDList: [o2] }).then(({ data: { memberList: [e4] } }) => e4); + }); + } + markGroupMemberList(e2) { + const r2 = this._n + ".markGroupMemberList", { groupID: t2, markType: s2, enableMark: o2, userIDList: i2 = [] } = e2, n2 = `groupID:${t2} markType:${s2} enableMark:${o2} userIDList count:` + i2.length; + ct.l(r2 + " " + n2); + let a2 = 2; + const u2 = []; + true === o2 && (a2 = 1); + let p2 = [...i2]; + 500 < i2.length && (p2 = i2.slice(0, 500), ct.w(r2 + " the length of userIDList cannot exceed 500")), p2.forEach((e3) => { + u2.push({ userID: e3, markType: [s2] }); + }), p2 = null; + const l2 = new Zt("markGroupMemberList"); + return l2.setMessage(n2), this._grpM.req({ P: js, data: { groupID: t2, operationType: a2, memberList: u2 } }).then((e3) => { + const { memberList: t3 = [] } = e3.data, s3 = [], o3 = []; + t3.length === i2.length ? s3.push(...i2) : (t3.forEach((e4) => { + s3.push(e4.userID); + }), i2.forEach((e4) => { + s3.includes(e4) || o3.push(e4); + })); + e3 = `success count:${s3.length} fail count:` + o3.length; + return l2.setMessage(e3).end(), ct.l(r2 + " ok. " + e3), ht({ successUserIDList: s3, failureUserIDList: o3 }); + }).catch((e3) => (l2.setError(e3).end(), ct.e(r2 + " failed. error:", e3), Kt(e3))); + } + _getGroupMemberProfileAdvance(e2) { + return this._grpM.req({ P: Os, data: { ...e2, memberInfoFilter: e2.memberInfoFilter || this.DEFAULT_MEMBER_INFO_FILTER } }); + } + _updateLocalGroupMemberMap(t2, e2) { + return je(e2) && 0 !== e2.length ? e2.map((e3) => (this.hasLocalGroupMember(t2, e3.userID) ? this.getLocalGroupMemberInfo(t2, e3.userID).updateMember(e3) : this.setLocalGroupMember(t2, new Uo(e3)), this.getLocalGroupMemberInfo(t2, e3.userID))) : []; + } + deleteLocalGroupMembers(e2, t2) { + const s2 = this.groupMemberListMap.get(e2); + s2 && t2.forEach((e3) => { + s2.delete(e3); + }); + } + getLocalGroupMemberInfo(e2, t2) { + return this.groupMemberListMap.has(e2) ? this.groupMemberListMap.get(e2).get(t2) : null; + } + setLocalGroupMember(e2, t2) { + this.groupMemberListMap.has(e2) ? this.groupMemberListMap.get(e2).set(t2.userID, t2) : (t2 = (/* @__PURE__ */ new Map()).set(t2.userID, t2), this.groupMemberListMap.set(e2, t2)); + } + getLocalGroupMemberList(e2) { + return this.groupMemberListMap.get(e2); + } + hasLocalGroupMember(e2, t2) { + return this.groupMemberListMap.has(e2) && this.groupMemberListMap.get(e2).has(t2); + } + hasLocalGroupMemberMap(e2) { + return this.groupMemberListMap.has(e2); + } + reset() { + this.groupMemberListMap.clear(); + } +}; +function qo(e2) { + var t2 = e2.lastIndexOf("."); + return -1 === t2 ? e2 : e2.slice(0, t2); +} +function ko(e2) { + var { androidInfo: e2 = {}, androidOPPOChannelID: t2 = "" } = e2, t2 = e2.OPPOChannelID || t2; + return { ...e2, Sound: qo(e2.sound || ""), OPPOChannelID: t2, GoogleChannelID: e2.FCMChannelID || "" }; +} +function Oo(e2) { + var { apnsInfo: e2 = {}, ignoreIOSBadge: t2 = false, disableVoipPush: s2 } = e2, t2 = true === e2.ignoreIOSBadge || true === t2 ? 1 : 0; + let o2 = void 0; + return Ke(s2) || (o2 = false === s2 ? 1 : 0), Ke(e2.disableVoipPush) || (o2 = false === e2.disableVoipPush ? 1 : 0), { ...e2, badgeMode: t2, isVoipPush: o2 }; +} +function Fo(e2) { + if (He(e2)) + return { pushFlag: true === e2.disablePush ? 1 : 0, title: e2.title || "", desc: e2.description || "", ext: e2.extension || "", apnsInfo: Oo(e2), androidInfo: ko(e2) }; +} +var xo = 1; +var Vo = 15; +var Ho = [17, 18, 20]; +var jo = class { + constructor(e2) { + this._grpM = e2, this._n = "GroupSystemNoticeHandler", this.pendencyMap = /* @__PURE__ */ new Map(); + } + onNewGroupSystemNotice(e2) { + var { dataList: e2, isSyncingEnded: t2, isInstantMessage: s2 } = e2, { eventDataList: e2, result: r2 } = (ct.d(this._n + ".onReceiveSystemNotice count:" + e2.length), this._assembly({ notifiesList: e2, isInstantMessage: s2 })); + 0 < e2.length && (this._grpM.get(o).onNewMessage({ conversationOptionsList: e2, isInstantMessage: s2 }), this._onReceivedGroupSystemNotice({ result: r2, isInstantMessage: s2 })), s2 ? 0 < r2.length && this._grpM.emitOEvt(Ut, r2) : true === t2 && this._clearGroupSystemNotice(); + } + _assembly({ notifiesList: e2, isInstantMessage: t2 }) { + var s2 = null; + const r2 = e2.length; + let i2 = 0; + var n2 = [], a2 = { conversationID: le, unreadCount: 0, type: le, subType: null, lastMessage: null }; + for (i2 = 0; i2 < r2; i2++) { + const r3 = e2[i2], { groupProfile: { communityType: u2 = 0, topicID: p2 }, elements: { topicIDList: l2, operationType: h2 } } = r3; + if (!(2 !== u2 || qe(p2) && qe(l2))) { + if (Ho.includes(h2)) { + this._handleTopicSystemNotice(r3); + continue; + } + qe(p2) || (r3.to = p2); + } + r3.elements.operationType !== Vo && (r3.currentUser = this._grpM.getMyUserID(), r3.conversationType = le, r3.conversationID = le, (s2 = new _o(r3)).setElement({ type: ee, content: { ...r3.elements, groupProfile: { ...r3.groupProfile } } }), s2.isSystemMessage = true, (1 === s2.sequence && 1 === s2.random || 2 === s2.sequence && 2 === s2.random) && (s2.sequence = ze(), s2.random = ze(), s2.generateMessageID(), ct.l(this._n + "._assembly regenerate ID:" + s2.ID)), this._grpM.get(o).pushIntoNoticeResult(n2, s2)) && (t2 ? a2.unreadCount++ : s2.setIsRead(true), a2.subType = s2.conversationSubType); + } + return a2.lastMessage = n2[n2.length - 1], { eventDataList: 0 < n2.length ? [a2] : [], result: n2 }; + } + _clearGroupSystemNotice() { + this._getPendencyList().then((e2) => { + e2.forEach((e3) => { + this.pendencyMap.set(`${e3.from}_${e3.groupID}_` + e3.to, e3); + }); + const t2 = this._grpM.get(o).getLocalMessageList(le), i2 = []; + t2.forEach((e3) => { + const { operatorID: t3, operationType: s2, groupProfile: o2 } = e3.payload; + if (s2 === xo) { + const s3 = `${t3}_${o2.groupID}_` + o2.to, r2 = this.pendencyMap.get(s3); + r2 && xe(r2.handled) && 0 !== r2.handled && i2.push(e3); + } + }), this.deleteGroupSystemNotice({ messageList: i2 }); + }); + } + deleteGroupSystemNotice(e2) { + const s2 = this._n + ".deleteGroupSystemNotice"; + return je(e2.messageList) && 0 !== e2.messageList.length ? (ct.l(s2 + " " + e2.messageList.map((e3) => e3.ID)), this._grpM.req({ P: Ds, data: { messageListToDelete: e2.messageList.map((e3) => ({ from: le, messageSeq: e3.clientSequence, messageRandom: e3.random })) } }).then(() => { + ct.l(s2 + " ok"); + const t2 = this._grpM.get(o); + return e2.messageList.forEach((e3) => { + t2.deleteLocalMessage(e3); + }), ht(); + }).catch((e3) => (ct.e(s2 + " error:", e3), Kt(e3)))) : jt(); + } + _getPendencyList(e2 = {}) { + var { type: e2, startTime: t2 = 0, limit: s2 = 20 } = e2; + return this._grpM.req({ P: ys, data: { type: e2, startTime: t2, limit: s2, handleAccount: this._grpM.getMyUserID() } }).then((e3) => { + const t3 = e3.data.pendencyList; + return 0 !== e3.data.nextStartTime ? this._getPendencyList({ startTime: e3.data.nextStartTime }).then((e4) => [...t3, ...e4]) : t3; + }); + } + getGroupApplicationList() { + return this._getPendencyList().then((t2) => this._getPendencyList({ type: de }).then((e2) => (t2.push(...e2), this._handlePendencyResult(t2))).catch((e2) => this._handlePendencyResult(t2))); + } + _handlePendencyResult(e2) { + const t2 = []; + return e2.forEach((e3) => { + this.pendencyMap.set(`${e3.from}_${e3.groupID}_` + e3.to, e3), 0 === e3.handled && t2.push({ applicant: e3.from, applicantNick: e3.fromUserNickName, groupName: e3.groupName, groupID: e3.groupID, authentication: e3.authentication, messageKey: e3.time, applicationType: e3.applicationType, userID: e3.userID, note: e3.note }); + }), jt({ applicationList: t2 }); + } + _onReceivedGroupSystemNotice({ result: e2, isInstantMessage: t2 }) { + t2 && e2.forEach((e3) => { + switch (e3.payload.operationType) { + case 1: + break; + case 2: + this._onApplyJoinGroup(e3); + break; + case 3: + break; + case 4: + this._onMemberKicked(e3); + break; + case 5: + this._onGroupDismissed(e3); + break; + case 6: + break; + case 7: + this._onInviteGroup(e3); + break; + case 8: + this._onQuitGroup(e3); + break; + case 9: + this._onSetManager(e3); + break; + case 10: + this._onDeleteManager(e3); + break; + case 11: + case 12: + case 15: + break; + case 20: + this._onMessageRemindTypeSynced(e3); + break; + case 21: + this._grpM.onAVChatRoomMemberBanned(e3); + } + }); + } + _onApplyJoinGroup(e2) { + var { groupID: e2, groupType: t2 } = e2.payload.groupProfile, s2 = this._grpM.hasLocalGroup(e2); + ct.l(this._n + `._onApplyJoinGroup groupID:${e2} groupType:${t2} hasGroup:` + s2), s2 || st(t2) || this._grpM.getGroupProfile({ groupID: e2 }).then(({ data: { group: e3 } }) => { + e3 && (this._grpM.updateGroupMap([e3]), e3 = !e3.isSupportTopic, this._grpM.emitGroupListUpdate(true, e3)); + }); + } + _onMemberKicked(e2) { + e2 = e2.payload.groupProfile.groupID; + this._grpM.hasLocalGroup(e2) && this._grpM.deleteLocalGroupAndConversation(e2); + } + _onGroupDismissed(e2) { + var e2 = e2.payload.groupProfile.groupID, t2 = (this._grpM.hasLocalGroup(e2) && this._grpM.deleteLocalGroupAndConversation(e2), this._grpM)["_AVChatRoomHandler"]; + t2 && t2.checkJoinedAVChatRoomByID(e2) && t2.reset(e2); + } + _onInviteGroup(e2) { + const t2 = e2.payload.groupProfile.groupID, s2 = this._grpM.hasLocalGroup(t2); + ct.l(`${this._n}._onInviteGroup groupID:${t2} hasGroup:` + s2), this._grpM.getGroupProfile({ groupID: t2 }).then(() => { + this._grpM.emitGroupListUpdate(), this._grpM.get(o).pullMsgOnInvite("" + ue + t2); + }); + } + _onQuitGroup(e2) { + var { groupID: e2, groupType: t2 } = e2.payload.groupProfile, s2 = this._grpM.hasLocalGroup(e2); + ct.l(this._n + `._onQuitGroup groupID:${e2} groupType:${t2} hasGroup:` + s2), s2 && this._grpM.deleteLocalGroupAndConversation(e2); + } + _onSetManager(e2) { + var { to: e2, groupID: t2 } = e2.payload.groupProfile, t2 = this._grpM.getGroupMemberHandler().getLocalGroupMemberInfo(t2, e2); + t2 && t2.updateRole(Ie); + } + _onDeleteManager(e2) { + var { to: e2, groupID: t2 } = e2.payload.groupProfile, t2 = this._grpM.getGroupMemberHandler().getLocalGroupMemberInfo(t2, e2); + t2 && t2.updateRole(ye); + } + _onMessageRemindTypeSynced(e2) { + var t2 = e2.payload.groupProfile["groupID"], e2 = e2.payload.messageRemindType; + this._grpM.get(o).onGroupMsgRemindTypeUpdated({ groupID: t2, messageRemindType: e2 }); + } + _handleTopicSystemNotice(e2) { + var { groupProfile: { groupID: e2, topicID: t2 }, elements: { operationType: o2, topicIDList: r2, messageRemindType: i2 } } = e2, n2 = this._grpM.get(s); + 17 === o2 ? n2.onTopicCreated({ groupID: e2, topicID: t2 }) : 18 === o2 ? n2.onTopicDeleted({ groupID: e2, topicIDList: r2 }) : 20 === o2 && n2.onMessageRemindTypeUpdated({ groupID: e2, topicID: t2, messageRemindType: i2 }); + } + reset() { + this.pendencyMap.clear(); + } +}; +var Ko = class extends class { + constructor(e2) { + this._m = e2, this._n = ""; + } + isLoggedIn() { + return this._m.get(r).isLoggedIn(); + } + isOversea() { + return this._m.get(r).isOversea(); + } + isPrivateNetWork() { + var e2 = this._m.get(r); + return e2.isPrivateNetWork() && !e2.getFileDownloadProxy(); + } + getFileDownloadProxy() { + return this._m.get(r).getFileDownloadProxy(); + } + getDowloadFileAuthKey() { + return this._m.get(r).getDowloadFileAuthKey(); + } + getMyUserID() { + return this._m.get(r).getUserID(); + } + getMyTinyID() { + return this._m.get(r).getTinyID(); + } + getSDKAppID() { + return this._m.get(r).getSDKAppID(); + } + isIntl() { + return this._m.get(r).isIntl(); + } + isUsingChatCore() { + return this._m.get(r).isUsingChatCore(); + } + isDevMode() { + return this._m.get(r).isDevMode(); + } + get(e2) { + return this._m.get(e2); + } + getPlatform() { + return k; + } + getCloudConfig(e2) { + return this._m.get(u).getCloudConfig(e2); + } + emitOEvt(e2, t2) { + this._m.getOEmitInst().emit(e2, t2); + } + emitIEvt(e2, t2) { + this._m.getIEmitInst().emit(e2, t2); + } + getIEmitInst() { + return this._m.getIEmitInst(); + } + req(e2) { + return this._m.get(a).req(e2); + } + canIUse(e2) { + return this._m.get(l).canIUse(e2); + } + getErrMsg(e2, t2, s2) { + return this._m.getErrMsg(e2, t2, s2); + } + warn(e2, t2, s2) { + e2 = this.getErrMsg(e2, t2, s2); + e2 && ct.w(e2); + } + noUse(e2) { + var t2 = Et; + return Kt({ code: t2, message: this.getErrMsg(t2, e2) }); + } +} { + constructor(e2) { + super(e2), this._n = "GroupModule", this._commonGroupHandler = new Mo(this), this._groupAttributesHandler = new Go(this), this._groupCountersHandler = new So(this), this._AVChatRoomHandler = new wo(this), this._groupTipsHandler = new fo(this), this._groupSystemNoticeHandler = new jo(this), this._groupMemberHandler = new No(this), this.groupMap = /* @__PURE__ */ new Map(), this._unjoinedAVChatRoomList = /* @__PURE__ */ new Map(), this._receiptDetailCompleteMap = /* @__PURE__ */ new Map(), this._onlineMemberCountMap = /* @__PURE__ */ new Map(), this._timeoutIDs = [], this.getIEmitInst().on(Bt.CLOUD_CONFIG, this._onCloudConfig, this); + } + _onCloudConfig() { + var e2 = this.getCloudConfig("polling_interval"), t2 = this.getCloudConfig("polling_interval_plus"), s2 = this.getCloudConfig("polling_no_msg_count"), o2 = this.getCloudConfig("polling_simplified_msg"), r2 = this.getCloudConfig("paging_grp_count"); + ct.l(this._n + `._onCloudConfig pollingInterval:${e2} pollingIntervalPlus:${t2} pollingNoMessageCount:${s2} pollingSimplifiedMessage:${o2} pagingGroupCount:` + r2), this._AVChatRoomHandler.setPollingInterval(e2), this._AVChatRoomHandler.setPollingIntervalPlus(t2), this._AVChatRoomHandler.setPollingNoMessageCount(s2), this._AVChatRoomHandler.setPollingSimplifiedMessage(o2), this._commonGroupHandler.setPagingGroupCount(r2); + } + onCheckTimer(e2) { + this.isLoggedIn() && (this._commonGroupHandler.onCheckTimer(e2), this._groupTipsHandler.onCheckTimer(e2)); + } + guardForAVChatRoom(t2) { + if (t2.conversationType !== ue) + return jt(); + { + const s2 = rt(t2.to) ? it(t2.to) : t2.to; + return this.hasLocalGroup(s2) ? jt() : this.getGroupProfile({ groupID: s2 }).then((e2) => { + e2 = e2.data.group.type; + if (ct.l(`${this._n}.guardForAVChatRoom. groupID:${s2} type:` + e2), e2 !== me) + return jt(); + { + const e3 = mt; + return Kt(new gt({ code: e3, message: this.getErrMsg(e3, t2.from, s2), data: { message: t2 } })); + } + }); + } + } + checkJoinedAVChatRoomByID(e2) { + return this._AVChatRoomHandler.checkJoinedAVChatRoomByID(e2); + } + onNewMessage(e2) { + this._commonGroupHandler.onNewMessage(e2); + } + updateNextMessageSeq(e2) { + if (je(e2)) { + const o2 = this.get(s); + e2.forEach((e3) => { + var t2 = e3.conversationID.replace(ue, ""); + rt(t2) && o2.updateUnreadCountAndLastMsg(t2, e3.lastMessage), this.groupMap.has(t2) && (this.groupMap.get(t2).nextMessageSeq = e3.lastMessage.sequence + 1); + }); + } + } + onNewGroupTips(e2) { + this._groupTipsHandler.onNewGroupTips(e2); + } + onMsgRevoked(e2, t2 = true) { + this._commonGroupHandler.onMsgRevoked(e2, t2); + } + onNewGroupSystemNotice(e2) { + this._groupSystemNoticeHandler.onNewGroupSystemNotice(e2); + } + onMsgReadNotice(e2) { + e2.dataList.forEach((i2) => { + var e3 = i2.elements["groupMessageReadNotice"]; + if (!Ke(e3)) { + const i3 = this.get(o); + e3.forEach((e4) => { + var { groupID: e4, topicID: t2, lastMessageSeq: s2 } = e4; + ct.l(this._n + `.onMsgReadNotice groupID:${e4} lastMessageSeq:` + s2); + let o2 = "" + ue + e4, r2 = true; + qe(t2) || (o2 = "" + ue + t2, r2 = false), i3.updateIsReadAfterReadReport({ conversationID: o2, lastMessageSeq: s2 }), i3.updateUnreadCount(o2, r2), i3.clearGroupAtInfoList(o2, r2); + }); + } + }); + } + onReadReceiptList(e2) { + ct.l(this._n + ".onReadReceiptList options:", e2), e2.dataList.forEach((e3) => { + var { groupProfile: e3, elements: t2 } = e3, e3 = e3["groupID"], t2 = t2["readReceiptList"]; + this.get(o).updateReadReceiptInfo({ groupID: e3, readReceiptList: t2 }); + }); + } + onMsgModified(e2) { + ct.l(this._n + ".onMsgModified options:", e2); + const t2 = this.get(o); + e2.dataList.forEach((e3) => { + t2.onMessageModified({ ...e3, conversationType: ue, to: e3.topicID || e3.groupID }); + }); + } + deleteGroupSystemNotice(e2) { + this._groupSystemNoticeHandler.deleteGroupSystemNotice(e2); + } + initGroupMap(e2) { + this.groupMap.set(e2.groupID, new $o(e2)); + } + clearGroupMap() { + this.groupMap.clear(); + } + deleteGroup(e2) { + this.groupMap.delete(e2); + } + updateGroupMap(e2) { + const t2 = this.get(o); + let s2; + e2.forEach((e3) => { + s2 = e3.groupID, this.groupMap.has(s2) ? this.groupMap.get(s2).updateGroup(e3) : (this.groupMap.set(s2, new $o(e3)), t2.deleteGroupRoamingInfo(s2)); + }); + var r2 = this.getMyUserID(); + for (const [, o2] of this.groupMap) + o2.selfInfo.userID = r2, "Owner" === o2.selfInfo.role && (o2.ownerID = r2); + } + getGroupMap() { + return this.groupMap; + } + getLocalGroupList() { + return [...this.groupMap.values()].filter((e2) => e2.type !== _e && e2.type !== fe); + } + getLocalGroupProfile(e2) { + return this.groupMap.get(e2); + } + sortLocalGroupList() { + var e2 = [...this.groupMap].filter(([, e3]) => !qe(e3.lastMessage)); + e2.sort((e3, t2) => t2[1].lastMessage.lastTime - e3[1].lastMessage.lastTime), this.groupMap = new Map([...e2]); + } + updateGroupLastMessage(e2) { + this._commonGroupHandler.updateLastMsg(e2); + } + emitGroupListUpdate(e2 = true, t2 = true) { + var s2 = this.getLocalGroupList(); + if (e2 && this.emitOEvt(kt), t2) { + const e3 = JSON.parse(JSON.stringify(s2)); + this.get(o).updateConvGroupProfile(e3); + } + } + getMyNameCardByGroupID(e2) { + e2 = this.getLocalGroupProfile(e2); + return e2 ? e2.selfInfo.nameCard : ""; + } + isPagingGetCompleted() { + return this._commonGroupHandler.isPagingGetCompleted(); + } + getMsgRemindType(e2) { + return !je(e2) || 0 === e2.length || 0 === (e2 = e2.filter((e3) => !st(this.getLocalGroupProfile(e3).type))).length ? Promise.resolve() : (ct.l(this._n + ".getMsgRemindType groupIDList:" + e2), this.getGroupProfileAdvance({ groupIDList: e2, responseFilter: { memberInfoFilter: ["MsgFlag"] } }).then((e3) => { + const t2 = e3.data["successGroupList"], s2 = this.get(o); + t2.forEach((e4) => { + s2.onGroupMsgRemindTypeUpdated({ groupID: e4.groupID, messageRemindType: je(e4.members) ? e4.members[0].messageRemindType : "" }); + }); + })); + } + getGroupList() { + return this._commonGroupHandler.getGroupList(); + } + syncCommunityWithTopic() { + return this._commonGroupHandler.syncGroupList(true); + } + getGroupProfile(t2) { + const r2 = this._n + ".getGroupProfile", i2 = new Zt("getGroupProfile"), { groupID: n2, groupCustomFieldFilter: e2 } = t2; + ct.l(r2 + " groupID:" + n2); + var s2 = { groupIDList: [n2], responseFilter: { groupBaseInfoFilter: [...L], groupCustomFieldFilter: e2, memberInfoFilter: [...C, "NameCard"] } }; + return this.getGroupProfileAdvance(s2).then(({ data: { successGroupList: e3, failureGroupList: t3 } }) => { + if (ct.l(r2 + " ok"), 0 < t3.length) + return Kt(t3[0]); + let s3; + return (s3 = st(e3[0].type) && !this.hasLocalGroup(n2) ? new $o(e3[0]) : (this.updateGroupMap(e3), this.getLocalGroupProfile(n2))).isSupportTopic || this.get(o).updateConvGroupProfile([s3]), i2.setMessage(`groupID:${n2} type:${s3.type} muteAllMembers:${s3.muteAllMembers} ownerID:` + s3.ownerID).end(), ht({ group: s3 }); + }).catch((e3) => (i2.setError(e3).setMessage("groupID:" + t2.groupID).end(), ct.e(r2 + " failed. error:", e3), Kt(e3))); + } + getGroupProfileAdvance(e2) { + const t2 = this._n + ".getGroupProfileAdvance", s2 = e2["groupIDList"], o2 = (je(s2) && 50 < s2.length && (this.warn("GetGroupProfileLimit"), s2.length = 50), []), r2 = []; + s2.forEach((e3) => { + (ot({ groupID: e3 }) ? r2 : o2).push(e3); + }); + var i2 = []; + if (0 < o2.length) { + const t3 = this._getGroupProfileAdvance({ ...e2, groupIDList: o2 }); + i2.push(t3); + } + if (0 < r2.length) { + const t3 = this._getGroupProfileAdvance({ ...e2, groupIDList: r2, relayFlag: 0 < o2.length }); + i2.push(t3); + } + return Promise.all(i2).then((e3) => { + const t3 = [], s3 = []; + return e3.forEach((e4) => { + t3.push(...e4.successGroupList), s3.push(...e4.failureGroupList); + }), ht({ successGroupList: t3, failureGroupList: s3 }); + }).catch((e3) => (ct.e(t2 + " failed. error:", e3), Kt(e3))); + } + _getGroupProfileAdvance(t2) { + const { relayFlag: s2 = false, ...o2 } = t2; + return this.req({ P: ss, data: o2 }).then((e2) => { + ct.l(this._n + "._getGroupProfileAdvance ok. options:", o2); + e2 = e2.data.groups; + return { successGroupList: e2.filter((e3) => Ke(e3.errorCode) || 0 === e3.errorCode), failureGroupList: e2.filter((e3) => e3.errorCode && 0 !== e3.errorCode).map((e3) => new gt({ code: e3.errorCode, message: e3.errorInfo, data: { groupID: e3.groupID } })) }; + }).catch((e2) => s2 && ot({ groupID: t2.groupIDList[0] }) ? { successGroupList: [], failureGroupList: [] } : Kt(e2)); + } + createGroup(u2) { + const s2 = [he, ce, ge, me, de], o2 = this._n + ".createGroup", { type: r2, groupID: i2 } = u2; + if (u2.name && false === this._filterProfanity("name", u2)) + return Kt({ code: wt }); + if (u2.introduction && false === this._filterProfanity("introduction", u2)) + return Kt({ code: wt }); + if (u2.notification && false === this._filterProfanity("notification", u2)) + return Kt({ code: wt }); + if (!s2.includes(r2)) + return Kt({ code: _t }); + if (!ot({ type: r2 })) { + if (!qe(i2) && ot({ groupID: i2 })) + return Kt({ code: ft }); + u2.isSupportTopic = void 0; + } + if (st(r2) && !Ke(u2.memberList) && 0 < u2.memberList.length && (u2.memberList = void 0), this._canIUseJoinOption(r2) || Ke(u2.joinOption) || (u2.joinOption = void 0), ot({ type: r2 })) { + if (!qe(i2) && !ot({ groupID: i2 })) + return Kt({ code: ft }); + u2.isSupportTopic = true === u2.isSupportTopic ? 1 : 0; + } + const p2 = new Zt("createGroup"); + ct.l(o2 + " options:", u2); + let l2 = null, h2 = []; + return this.req({ P: os, data: { ...u2, ownerID: this.getMyUserID(), webPushFlag: 1 } }).then((r3) => { + const { groupID: i3, overLimitUserIDList: n2 = [] } = r3.data; + l2 = i3, h2 = n2; + r3 = `groupType:${u2.type} groupID:${i3} overLimitUserIDList:` + n2; + if (p2.setMessage(r3).end(), ct.l(o2 + " ok. " + r3), u2.type !== me && (u2.type !== de || 1 !== u2.isSupportTopic)) { + qe(u2.memberList) || qe(n2) || (u2.memberList = u2.memberList.filter((e2) => -1 === n2.indexOf(e2.userID))), this.updateGroupMap([{ ...u2, groupID: i3 }]); + r3 = this.get(e); + let s3 = "", o3 = 0; + u2.type === de ? (s3 = this.isIntl() ? "Create Community" : "创建社群", o3 = 1) : s3 = this.isIntl() ? "Create Group" : "创建群组"; + var a2 = this.get(t).getMyNick(), a2 = r3.createCustomMessage({ to: i3, conversationType: ue, payload: { data: JSON.stringify({ businessID: "group_create", content: s3, cmd: o3, opUser: a2 || this.getMyUserID(), version: 4 }) } }); + r3.sendMessageInstance(a2), this.emitGroupListUpdate(); + } + return this.getGroupProfile({ groupID: i3 }); + }).then((e2) => { + var e2 = e2.data["group"], { nameCard: t2, joinTime: s3 } = e2.selfInfo; + return e2.updateSelfInfo({ nameCard: t2, joinTime: s3, messageRemindType: Ae, role: Me }), ht({ group: e2, overLimitUserIDList: h2 }); + }).catch((e2) => { + var t2; + return p2.setMessage("groupType:" + u2.type).setError(e2).end(), 10010 === e2.code || 10007 === e2.code ? (this._silentlyGetGroupProfile(e2.code, l2), this.updateGroupMap([{ ...u2, groupID: l2 }]), (t2 = this.getLocalGroupProfile(l2)).selfInfo.role = Me, ht({ group: t2, overLimitUserIDList: h2 })) : (ct.e(o2 + " failed. error:", e2), Kt(e2)); + }); + } + dismissGroup(e2) { + const t2 = this._n + ".dismissGroup", s2 = "groupID:" + e2, o2 = new Zt("dismissGroup"); + return o2.setMessage(s2), ct.l(t2 + " " + s2), this.req({ P: rs, data: { groupID: e2 } }).then(() => (o2.end(), ct.l(t2 + " ok"), this.deleteLocalGroupAndConversation(e2), this.checkJoinedAVChatRoomByID(e2) && this._AVChatRoomHandler.reset(e2), this._groupAttributesHandler.deleteLocalGroupAttributes(e2), ht({ groupID: e2 }))).catch((e3) => (o2.setError(e3).end(), ct.e(t2 + " failed. error:", e3), Kt(e3))); + } + updateGroupProfile(e2) { + const t2 = this._n + ".updateGroupProfile"; + if (this.hasLocalGroup(e2.groupID)) { + const s3 = this.getLocalGroupProfile(e2.groupID).type; + this._canIUseJoinOption(s3) || Ke(e2.joinOption) || (ct.w(t2 + " joinOption is unavailable for Work/Meeting/AVChatRoom"), e2.joinOption = void 0); + } + if (Ke(e2.muteAllMembers) || (e2.muteAllMembers ? e2.muteAllMembers = "On" : e2.muteAllMembers = "Off"), e2.name && false === this._filterProfanity("name", e2)) + return Kt({ code: wt }); + if (e2.introduction && false === this._filterProfanity("introduction", e2)) + return Kt({ code: wt }); + if (e2.notification && false === this._filterProfanity("notification", e2)) + return Kt({ code: wt }); + const s2 = new Zt("updateGroupProfile"); + return s2.setMessage(JSON.stringify(e2)), ct.l(t2 + " groupID:" + e2.groupID), this.req({ P: is, data: e2 }).then(() => (s2.end(), ct.l(t2 + " ok"), this.hasLocalGroup(e2.groupID) && this.groupMap.get(e2.groupID).updateGroup(e2), ht({ group: this.groupMap.get(e2.groupID) }))).catch((e3) => (s2.setError(e3).end(), ct.l(t2 + " failed. error:", e3), Kt(e3))); + } + _filterProfanity(e2, t2) { + var s2, o2 = this.get(c); + return !o2 || ({ isAllowedToSend: o2, modifiedText: s2 } = o2.filterText(t2[e2], y), true === o2 && (t2[e2] = s2, true)); + } + joinGroup(t2) { + const s2 = t2["groupID"], o2 = this._n + ".joinGroup"; + if (this.deleteUnjoinedAVChatRoom(s2), this.hasLocalGroup(s2)) { + if (!this.isLoggedIn()) + return jt({ status: Te }); + const r2 = new Zt("applyJoinGroup"); + return this.getGroupProfile({ groupID: s2 }).then(() => (r2.setMessage(`groupID:${s2} joinedStatus:` + Te).end(), jt({ status: Te }))).catch((e2) => (r2.setMessage(`groupID:${s2} unjoined`).end(), ct.w(o2 + ` ${s2} was unjoined, now join!`), this.groupMap.delete(s2), this.applyJoinGroup(t2))); + } + return ct.l(o2 + " groupID:" + s2), this.isLoggedIn() ? this.applyJoinGroup(t2) : this._AVChatRoomHandler.joinWithoutAuth(t2); + } + applyJoinGroup(e2) { + const a2 = this._n + ".applyJoinGroup", { groupID: u2, applyMessage: t2 } = e2; + if (!qe(t2) && false === this._filterProfanity("applyMessage", e2)) + return Kt({ code: wt }); + const p2 = new Zt("applyJoinGroup"), s2 = { ...e2 }, l2 = this.canIUse(I.AV_HISTORY_MSG); + return l2 && (s2.historyMessageFlag = 1), this.get(o).deleteTopicRoamingInfo(u2), this.req({ P: ns, data: s2 }).then(({ data: { joinedStatus: e3, longPollingKey: t3, startSeq: s3, avChatRoomFlag: o2, avChatRoomKey: r2, messageList: i2 } }) => { + var n2 = `groupID:${u2} joinedStatus:${e3} longPollingKey:${t3} startSeq:${s3} avChatRoomFlag:${o2} canGetAVChatRoomHistoryMsg:${l2}, historyMsgCount:` + (qe(i2) ? 0 : i2.length); + switch (p2.setMessage(n2).end(), ct.l(a2 + " ok. " + n2), e3) { + case Ee: + return ht({ status: Ee }); + case $e: + return this.getGroupProfile({ groupID: u2 }).then(({ data: { group: e4 } }) => this._handleJoinResult({ group: e4, avChatRoomFlag: o2, longPollingKey: t3, startSeq: s3, avChatRoomKey: r2, messageList: i2 })).catch((e4) => { + if (10010 !== e4.code && 10007 !== e4.code) + return ct.e(a2 + " failed. error:", e4), Kt(e4); + { + this._silentlyGetGroupProfile(e4.code, u2); + const a3 = new $o({ groupID: u2 }); + return this.updateGroupMap([a3]), this._handleJoinResult({ group: a3, avChatRoomFlag: o2, longPollingKey: t3, startSeq: s3, avChatRoomKey: r2, messageList: i2 }); + } + }); + default: { + const e4 = new gt({ code: Lt }); + return ct.e(a2 + " failed. error:", e4), Kt(e4); + } + } + }).catch((e3) => (p2.setMessage("groupID:" + u2).setError(e3).end(), ct.e(a2 + " failed. error:", e3), Kt(e3))); + } + _handleJoinResult(e2) { + const { group: t2, avChatRoomFlag: s2, longPollingKey: r2, startSeq: i2, avChatRoomKey: n2, messageList: a2 } = e2, u2 = t2["groupID"]; + return 1 === s2 ? (this.get(o).setCompleted("" + ue + u2), this._groupAttributesHandler.initGroupAttributesCache({ groupID: u2, avChatRoomKey: n2 }), this._groupCountersHandler.initGroupCountersCache({ groupID: u2, avChatRoomKey: n2 }), (e2 = Ke(r2) ? this._AVChatRoomHandler.handleJoinResult({ group: t2 }) : this._AVChatRoomHandler.startRunLoop({ group: t2, longPollingKey: r2, startSeq: i2 })).then(() => { + this._onAVChatRoomHistoryMessage(a2, u2); + }), e2) : (this.emitGroupListUpdate(true, false), ht({ status: $e, group: t2 })); + } + quitGroup(e2) { + const t2 = this._n + ".quitGroup", s2 = "groupID:" + e2, o2 = (ct.l(t2 + " " + s2), this.checkJoinedAVChatRoomByID(e2)); + if (!o2 && !this.hasLocalGroup(e2)) + return Kt({ code: Dt }); + if (o2 && !this.isLoggedIn()) + return ct.l(t2 + " anonymously ok. " + s2), this.deleteLocalGroupAndConversation(e2), this._AVChatRoomHandler.reset(e2), jt({ groupID: e2 }); + const r2 = new Zt("quitGroup"); + return r2.setMessage(s2), this.req({ P: us, data: { groupID: e2 } }).then(() => (r2.end(), ct.l(t2 + " ok"), this.deleteLocalGroupAndConversation(e2), o2 && this._AVChatRoomHandler.reset(e2), this._groupAttributesHandler.deleteLocalGroupAttributes(e2), ht({ groupID: e2 }))).catch((e3) => (r2.setError(e3).end(), ct.e(t2 + " failed. error:", e3), Kt(e3))); + } + searchGroupByID(e2) { + const t2 = this._n + ".searchGroupByID", s2 = { groupIDList: [e2] }, o2 = new Zt("searchGroupByID"); + return o2.setMessage("groupID:" + e2), ct.l(t2 + " groupID:" + e2), this.req({ P: ps, data: s2 }).then(({ data: { groupProfile: e3 } }) => { + if (0 !== e3[0].errorCode) + throw new gt({ code: e3[0].errorCode, message: e3[0].errorInfo }); + return o2.end(), ct.l(t2 + " ok"), ht({ group: new $o(e3[0]) }); + }).catch((e3) => (o2.setError(e3).end(), ct.w(t2 + " failed. error:", e3), Kt(e3))); + } + changeGroupOwner(o2) { + const r2 = this._n + ".changeGroupOwner"; + if (this.hasLocalGroup(o2.groupID) && this.getLocalGroupProfile(o2.groupID).type === me) + return Kt({ code: It }); + if (o2.newOwnerID === this.getMyUserID()) + return Kt({ code: yt }); + const i2 = new Zt("changeGroupOwner"); + return i2.setMessage(`groupID:${o2.groupID} newOwnerID:` + o2.newOwnerID), ct.l(r2 + " groupID:" + o2.groupID), this.req({ P: ls, data: o2 }).then(() => { + i2.end(), ct.l(r2 + " ok"); + var { groupID: e2, newOwnerID: t2 } = o2, s2 = (this.groupMap.get(e2).ownerID = t2, this._groupMemberHandler.getLocalGroupMemberList(e2)); + if (s2 instanceof Map) { + const o3 = s2.get(this.getMyUserID()), r3 = (Ke(o3) || (o3.updateRole("Member"), this.groupMap.get(e2).selfInfo.role = "Member"), s2.get(t2)); + Ke(r3) || r3.updateRole("Owner"); + } + return this.emitGroupListUpdate(true, false), ht({ group: this.groupMap.get(e2) }); + }).catch((e2) => (i2.setError(e2).end(), ct.e(r2 + " failed. error:", e2), Kt(e2))); + } + getGroupApplicationList() { + return this._groupSystemNoticeHandler.getGroupApplicationList(); + } + handleGroupApplication(e2) { + const t2 = this._n + ".handleGroupApplication", { handleAction: s2, handleMessage: o2, message: r2, application: i2 } = e2; + let n2, a2, u2, p2, l2, h2 = (r2 ? (n2 = r2.payload.operatorID, a2 = r2.payload.groupProfile.groupID, u2 = r2.payload.authentication, p2 = r2.payload.messageKey) : i2 && (n2 = i2.applicant, a2 = i2.groupID, u2 = i2.authentication, p2 = i2.messageKey), cs); + i2 && 2 === i2.applicationType && (h2 = hs, l2 = i2.userID); + const c2 = new Zt("handleGroupApplication"); + return c2.setMessage("groupID:" + a2), ct.l(t2 + " groupID:" + a2), this.req({ P: h2, data: { handleAction: s2, handleMessage: o2, applicant: n2, invitee: l2, groupID: a2, authentication: u2, messageKey: p2 } }).then(() => (c2.end(), ct.l(t2 + " ok"), r2 && this._groupSystemNoticeHandler.deleteGroupSystemNotice({ messageList: [e2.message] }), ht({ group: this.getLocalGroupProfile(a2) }))).catch((e3) => (c2.setError(e3).end(), ct.e(t2 + " failed. error", e3), Kt(e3))); + } + handleGroupInvitation(e2) { + const t2 = this._n + ".handleGroupInvitation", { groupProfile: { groupID: s2 }, authentication: o2, messageKey: r2, operatorID: i2 } = e2.message.payload, n2 = e2["handleAction"], a2 = new Zt("handleGroupInvitation"); + return a2.setMessage(`groupID:${s2} inviter:${i2} handleAction:` + n2), ct.l(t2 + ` groupID:${s2} inviter:${i2} handleAction:` + n2), this.req({ P: gs, data: { ...e2, inviter: i2, groupID: s2, authentication: o2, messageKey: r2 } }).then(() => (a2.end(), ct.l(t2 + " ok"), this._groupSystemNoticeHandler.deleteGroupSystemNotice({ messageList: [e2.message] }), ht({ group: this.getLocalGroupProfile(s2) }))).catch((e3) => (a2.setError(e3).end(), ct.e(t2 + " failed. error", e3), Kt(e3))); + } + getGroupOnlineMemberCount(t2) { + const s2 = this._n + ".getGroupOnlineMemberCount", e2 = this._AVChatRoomHandler.checkJoinedAVChatRoomByID(t2), o2 = this.hasLocalGroup(t2); + if (ct.l(s2 + ` groupID:${t2} isAVChatRoom:${e2} has:` + o2), e2) + return this._AVChatRoomHandler.getGroupOnlineMemberCount(t2); + if (!o2) + return jt({ memberCount: 0 }); + var r2 = Date.now(); + if (this._onlineMemberCountMap.has(t2)) { + const s3 = this._onlineMemberCountMap.get(t2); + if (r2 - s3.lastReqTime <= 6e4) + return jt({ memberCount: s3.memberCount }); + s3.lastReqTime = r2; + } + return this.requestOnlineCount(t2).then((e3) => { + var { memberCount: e3 = 0 } = e3.data; + return this._onlineMemberCountMap.set(t2, { lastReqTime: Date.now(), memberCount: e3 }), ct.l(s2 + ` ok. groupID:${t2} memberCount:` + e3), jt({ memberCount: e3 }); + }).catch((e3) => (ct.w(s2 + " failed. error:", e3), Promise.reject(e3))); + } + requestOnlineCount(e2) { + return this.req({ P: Gs, data: { groupID: e2 } }); + } + hasLocalGroup(e2) { + return this.groupMap.has(e2); + } + deleteLocalGroupAndConversation(e2) { + const t2 = this.checkJoinedAVChatRoomByID(e2); + ct.l(this._n + `.deleteLocalGroupAndConversation groupID:${e2} isJoinedAVChatRoom:` + t2); + var r2 = this.get(o), i2 = "" + ue + e2; + if (t2 && (this.stopMessageLongPolling({ groupID: e2 }), r2.deleteLocalConv(i2)), ot({ groupID: e2 })) { + const t3 = this.getLocalGroupProfile(e2); + t3 && true === t3.isSupportTopic && this.get(s).deleteTopicListInCommunity(e2); + } + r2.clearUnreadCount(i2), r2.setCompleted(i2), this._deleteLocalGroup(e2), this._onlineMemberCountMap.delete(e2), this.emitGroupListUpdate(true, false); + } + _deleteLocalGroup(e2) { + this.groupMap.delete(e2), this._groupMemberHandler.deleteGroupMemberList(e2); + } + sendMessage(e2, t2) { + return je(e2._receiverList) && 0 < e2._receiverList.length && !this.canIUse(I.MSG_TO_SPECIFIED_GRP_MBR) ? this.noUse("Targeted Group Message") : (e2 = this.createGroupMessagePack(e2, t2), this.req(e2)); + } + createGroupMessagePack(e2, t2) { + let s2 = null, o2 = (t2 && t2.offlinePushInfo && (s2 = t2.offlinePushInfo), ""); + Ve(e2.cloudCustomData) && 0 < e2.cloudCustomData.length && (o2 = e2.cloudCustomData); + var r2 = []; + if (He(t2) && He(t2.messageControlInfo)) { + const { excludedFromUnreadCount: e3, excludedFromLastMessage: s3, excludedFromContentModeration: o3 } = t2.messageControlInfo; + true === e3 && r2.push("NoUnread"), true === s3 && r2.push("NoLastMsg"), true === o3 && r2.push("NoMsgCheck"); + } + let i2 = void 0; + je(e2._receiverList) && 0 < e2._receiverList.length && (i2 = e2._receiverList, 50 < e2._receiverList.length) && (i2 = e2._receiverList.slice(0, 50), this.warn("ReceiverListLimit")); + var t2 = this.isOnlineMessage(e2, t2) ? 1 : 0, a2 = JSON.parse(JSON.stringify(e2.getElements())), u2 = this.get(n).getFileDNList(), p2 = e2.getGroupAtInfoList(), a2 = { fromAccount: this.getMyUserID(), groupID: e2.to, msgBody: Qs(e2.type, a2, u2), cloudCustomData: o2, random: e2.random, priority: e2.priority, clientSequence: e2.clientSequence, groupAtInfo: e2.type !== B || qe(p2) ? void 0 : p2, onlineOnlyFlag: t2, clientTime: e2.clientTime, offlinePushInfo: Fo(s2), messageControlInfo: 0 == t2 ? r2 : void 0, needReadReceipt: true !== e2.needReadReceipt || this.isMessageFromOrToAVChatroom(e2.to) ? 0 : 1, receiverList: i2, isSupportExtension: true === e2.isSupportExtension ? 1 : 0, isRelayMessage: true === e2._relayFlag ? 1 : 0, cmConfigID: e2._cmConfigID }; + return rt(e2.to) && (a2.groupID = it(e2.to), a2.topicID = e2.to), { P: es, data: a2 }; + } + revokeMessage(e2) { + var t2 = { groupID: e2.to, msgSeqList: [{ msgSeq: e2.sequence }] }; + return rt(e2.to) && (t2.groupID = it(e2.to), t2.topicID = e2.to), this.req({ P: ms, data: t2 }); + } + deleteMessage(e2) { + var { to: e2, keyList: t2 } = e2, t2 = (ct.l(this._n + `.deleteMessage groupID:${e2} count:` + t2.length), { groupID: e2, deleter: this.getMyUserID(), keyList: t2 }); + return rt(e2) && (t2.groupID = it(e2), t2.topicID = e2), this.req({ P: bs, data: t2 }); + } + modifyRemoteMessage(e2) { + var { to: e2, sequence: t2, payload: s2, type: o2, version: r2 = 0, cloudCustomData: i2, _elements: n2 } = e2; + let a2 = e2, u2 = void 0, p2 = (rt(e2) && (a2 = it(e2), u2 = e2), void 0); + return (e2 = o2) !== B && e2 !== te && e2 !== Q && e2 !== X || (1 < n2.length && n2.splice(0, 1, { type: o2, content: s2 }), p2 = n2), this.req({ P: As, data: { groupID: a2, topicID: u2, sequence: t2, version: r2, elements: p2, cloudCustomData: i2 } }); + } + getRoamingMessage(e2) { + const u2 = this._n + ".getRoamingMessage"; + let { conversationID: p2, groupID: l2, sequence: t2 } = e2; + const h2 = new Zt("getRoamingMessage"); + let c2 = 0, g2 = void 0; + return rt(l2) && (l2 = it(g2 = l2)), this._computeLastSequence({ groupID: l2, topicID: g2, sequence: t2 }).then((e3) => (c2 = e3, ct.l(u2 + ` groupID:${l2} startSequence:` + c2), this.req({ P: _s, data: { groupID: l2, count: 21, sequence: c2, topicID: g2 } }))).then((e3) => { + var { messageList: t3, complete: s2, invisibleSequenceList: r2 = [] } = e3.data; + let { nextSequence: i2 = 0 } = e3.data; + Ke(t3) ? ct.l(u2 + ` ok. complete:${s2} nextSequence:${i2} but messageList is undefined!`) : ct.l(u2 + ` ok. complete:${s2} nextSequence:${i2} count:` + t3.length), h2.setMessage(`groupID:${l2} topicID:${g2} startSequence:${c2} complete:${s2} nextSequence:` + i2).end(); + e3 = this.get(o); + let n2 = []; + var a2 = [], t3 = (qe(t3) || (n2 = e3.onRoamingMessage(t3, p2, true, a2), e3.updateIsRead(p2), e3.patchConvLastMessage(p2)), 2 === s2 || i2 < 1); + return t3 && (e3.setCompleted(p2), i2 = ""), ct.l(u2 + ` isPullingCompleted:${t3} nextReqID:${i2} storedMsgCount:${n2.length} invisibleSeqCount:` + r2.length), { nextReqID: i2 + "", storedMessageList: n2, assembledMessageList: a2, isPullingCompleted: t3 }; + }).catch((e3) => (h2.setError(e3).setMessage(`groupID:${l2} topicID:${g2} startSequence:` + c2).end(), ct.w(u2 + " failed. error:", e3), Kt(e3))); + } + _getGroupIDOfMessage(e2) { + return e2.conversationID.replace(ue, ""); + } + getReadReceiptList(s2) { + const t2 = this._n + ".getReadReceiptList", e2 = this._getGroupIDOfMessage(s2[0]), o2 = this.getMyUserID(), r2 = s2.filter((e3) => e3.from === o2 && true === e3.needReadReceipt).map((e3) => ({ sequence: e3.sequence })); + if (ct.l(t2 + ` groupID:${e2} sequenceList:` + JSON.stringify(r2)), 0 === r2.length) + return jt({ messageList: s2 }); + const i2 = new Zt("getReadReceiptList"); + return i2.setMessage("groupID:" + e2), this.req({ P: fs, data: { groupID: e2, sequenceList: r2 } }).then((e3) => { + i2.end(), ct.l(t2 + " ok"); + e3 = e3.data.readReceiptList; + return je(e3) && e3.forEach((t3) => { + s2.forEach((e4) => { + 0 === t3.code && t3.sequence === e4.sequence && (e4.readReceiptInfo.readCount = t3.readCount, e4.readReceiptInfo.unreadCount = t3.unreadCount); + }); + }), ht({ messageList: s2 }); + }).catch((e3) => (i2.setError(e3).end(), ct.w(t2 + " failed. error:", e3), Kt(e3))); + } + sendReadReceipt(e2) { + const t2 = this._n + ".sendReadReceipt", s2 = this._getGroupIDOfMessage(e2[0]), o2 = new Zt("sendReadReceipt"), r2 = (o2.setMessage("groupID:" + s2), this.getMyUserID()), i2 = e2.filter((e3) => e3.from !== r2 && true === e3.needReadReceipt).map((e3) => ({ sequence: e3.sequence })); + return 0 === i2.length ? Kt({ code: dt }) : (ct.l(t2 + ". sequenceList:" + JSON.stringify(i2)), this.req({ P: Ms, data: { groupID: s2, sequenceList: i2 } }).then((e3) => (o2.end(), ct.l(t2 + " ok"), ht())).catch((e3) => (o2.setError(e3).end(), ct.w(t2 + " failed. error:", e3), Kt(e3)))); + } + getReadReceiptDetail(e2) { + const { message: t2, filter: s2, cursor: o2, count: r2 } = e2, i2 = this._getGroupIDOfMessage(t2), n2 = t2.ID, a2 = t2.sequence, u2 = this._n + ".getReadReceiptDetail", p2 = this._receiptDetailCompleteMap.get(n2) || false, l2 = 0 !== s2 && 1 !== s2 ? 0 : s2, h2 = Ve(o2) ? o2 : "", c2 = !xe(r2) || r2 <= 0 || 100 <= r2 ? 100 : r2, g2 = `groupID:${i2} sequence:${a2} cursor:${h2} filter:${l2} completeFlag:` + p2, m2 = (ct.l(u2 + " " + g2), { cursor: "", isCompleted: false, messageID: n2, unreadUserIDList: [], readUserIDList: [] }), d2 = new Zt("getReadReceiptDetail"); + return d2.setMessage(g2), this.req({ P: Is, data: { groupID: i2, sequence: a2, flag: l2, cursor: h2, count: c2 } }).then((e3) => { + d2.end(); + var { cursor: e3, isCompleted: t3, unreadUserIDList: s3, readUserIDList: o3 } = e3.data; + return m2.cursor = e3, 1 === t3 && (m2.isCompleted = true, this._receiptDetailCompleteMap.set(n2, true)), 0 === l2 ? m2.readUserIDList = o3.map((e4) => e4.userID) : 1 === l2 && (m2.unreadUserIDList = s3.map((e4) => e4.userID)), ct.l(u2 + " ok"), ht(m2); + }).catch((e3) => (d2.setError(e3).end(), ct.w(u2 + " failed. error:", e3), Kt(e3))); + } + getRoamingMessagesHopping(p2) { + const l2 = this._n + ".getRoamingMessagesHopping"; + let { groupID: t2, count: s2, sequence: h2, direction: c2 } = p2, r2 = void 0; + return Ke(h2) && 1 === c2 ? jt({ messageList: [], isCompleted: true, nextMessageSeq: "" }) : (rt(t2) && (t2 = it(r2 = t2)), this._computeReqSeqHopping({ groupID: t2, topicID: r2, sequence: h2 }).then((e2) => { + Ke(h2) || 1 !== c2 || (e2 = h2 + s2 - 1); + const a2 = `${r2 ? "topicID:" + r2 : "groupID:" + t2} sequence:${h2} reqSeq:${e2} direction:` + c2, u2 = (ct.l(l2 + " " + a2), new Zt("getRoamingMessagesHopping")); + return this.req({ P: _s, data: { groupID: t2, topicID: r2, count: s2, sequence: e2 } }).then((e3) => { + var { messageList: e3 = [], complete: t3, nextSequence: s3 = 0, invisibleSequenceList: r3 = [] } = e3.data, i2 = `complete:${t3} nextSequence:${s3} remoteMsgCount:${e3.length} invisibleSequenceList:` + r3, i2 = (u2.setMessage(a2 + " " + i2).end(), ct.l(l2 + " ok. " + i2), "" + ue + p2.groupID), n2 = this.get(o), i2 = n2.onRoamingMessage(e3, i2, false), e3 = this._computeResult({ groupID: p2.groupID, direction: c2, sequence: h2, remoteMessageList: e3, processedMessageList: i2, complete: t3, nextSequence: s3, invisibleSequenceList: r3 }); + return n2.storeHoppingMessageList(e3.messageList), ht(e3); + }).catch((e3) => (u2.setError(e3).setMessage(`groupID:${t2} sequence:${h2} count:` + s2).end(), ct.w(l2 + " failed. error:", e3), Kt(e3))); + })); + } + _computeReqSeqHopping(e2) { + const { groupID: s2, topicID: t2, sequence: o2 } = e2; + return 0 < o2 ? Promise.resolve(o2) : Ke(t2) ? this.getGroupProfileAdvance({ groupIDList: [s2], responseFilter: { groupBaseInfoFilter: ["NextMsgSeq"] } }).then(({ data: { successGroupList: e3 } }) => { + let t3 = 0; + return qe(e3) || (t3 = e3[0].nextMessageSeq - 1), ct.l(`${this._n}._computeReqSeqHopping groupID:${s2} lastSequence:${t3} from remote`), t3; + }).catch((e3) => Kt(e3)) : Promise.resolve(0); + } + _computeResult(e2) { + const t2 = { messageList: [], isCompleted: false, nextMessageSeq: "" }, { groupID: s2, direction: o2, sequence: r2, remoteMessageList: i2 = [], processedMessageList: n2 = [], complete: a2, nextSequence: u2, invisibleSequenceList: p2 } = e2; + if (0 === o2) + return t2.nextMessageSeq = u2, (2 === a2 || u2 < 1) && (t2.isCompleted = true, t2.nextMessageSeq = ""), t2.messageList = n2, t2; + if (1 === o2) { + if (qe(i2)) { + if (qe(p2)) + return t2.isCompleted = true, t2.nextMessageSeq = "", t2; + t2.nextMessageSeq = p2[0] + 1; + } else { + const e3 = i2[0].sequence, s3 = p2[0] || 0; + t2.nextMessageSeq = e3 > s3 ? e3 + 1 : s3 + 1; + } + return n2.forEach((e3) => { + e3.sequence >= r2 && t2.messageList.push(e3); + }), (ot({ groupID: s2 }) || rt(s2)) && 0 === t2.messageList.length && i2[0].sequence < r2 && (t2.isCompleted = true, t2.nextMessageSeq = ""), t2; + } + } + setMessageRead({ conversationID: r2, lastMessageSeq: i2 }) { + const n2 = this._n + ".setMessageRead", e2 = `convID:${r2} lastMessageSeq:` + i2, a2 = (ct.l(n2 + " " + e2), xe(i2) || this.warn("DoNotModifyLastSeq"), new Zt("setMessageRead")); + a2.setMessage(e2); + let u2 = r2.replace(ue, ""), p2 = void 0; + return rt(u2) && (u2 = it(p2 = u2)), this.req({ P: ds, data: { groupID: u2, topicID: p2, messageReadSeq: i2 } }).then(() => { + a2.end(), ct.l(n2 + " ok"); + var e3 = this.get(o); + e3.updateIsReadAfterReadReport({ conversationID: r2, lastMessageSeq: i2 }); + let t2 = true; + if (!Ke(p2)) { + t2 = false; + const r3 = this.get(s).getLocalTopic(u2, p2); + r3 && r3.updateSelfInfo({ readedSequence: i2 }); + } + return e3.updateUnreadCount(r2, t2), ht(); + }).catch((e3) => (a2.setError(e3).end(), ct.l(n2 + " failed. error:", e3), Kt(e3))); + } + _computeLastSequence(e2) { + var { groupID: e2, topicID: t2, sequence: s2 } = e2; + return 0 < s2 ? Promise.resolve(s2) : Ke(t2) ? this.getGroupLastSequence(e2) : Promise.resolve(0); + } + getGroupLastSequence(e2) { + const t2 = this._n + ".getGroupLastSequence", s2 = new Zt("getGroupLastSequence"); + let r2 = 0, i2 = ""; + const n2 = "groupID:" + e2; + if (this.hasLocalGroup(e2)) { + const o2 = this.getLocalGroupProfile(e2), a3 = o2.lastMessage; + if (0 < a3.lastSequence && false === a3.onlineOnlyFlag) + return r2 = a3.lastSequence, i2 = n2 + `, ${r2} from group.lastMessage.lastSequence`, ct.l(t2 + " " + i2), s2.setMessage(i2).end(), Promise.resolve(r2); + if (1 < o2.nextMessageSeq) + return r2 = o2.nextMessageSeq - 1, i2 = n2 + `, ${r2} from group.nextMessageSeq`, ct.l(t2 + " " + i2), s2.setMessage(i2).end(), Promise.resolve(r2); + } + const a2 = this.get(o).getLocalConversation("GROUP" + e2); + return a2 && a2.lastMessage.lastSequence && false === a2.lastMessage.onlineOnlyFlag ? (r2 = a2.lastMessage.lastSequence, i2 = n2 + `, ${r2} from conversation.lastMessage.lastSequence`, ct.l(t2 + " " + i2), s2.setMessage(i2).end(), Promise.resolve(r2)) : this.getGroupProfileAdvance({ groupIDList: [e2], responseFilter: { groupBaseInfoFilter: ["NextMsgSeq"] } }).then(({ data: { successGroupList: e3 } }) => (qe(e3) ? ct.w(t2 + ` ${n2}, empty successGroupList`) : (r2 = e3[0].nextMessageSeq - 1, i2 = n2 + `, ${r2} from remote`, ct.l(t2 + " " + i2)), s2.setMessage(i2).end(), r2)).catch((e3) => (s2.setError(e3).setMessage(n2).end(), ct.w(t2 + " failed. error:", e3), Kt(e3))); + } + isMessageFromOrToAVChatroom(e2) { + return this._AVChatRoomHandler.checkJoinedAVChatRoomByID(e2); + } + hasJoinedAVChatRoom() { + return this._AVChatRoomHandler.hasJoinedAVChatRoom(); + } + getJoinedAVChatRoom() { + return this._AVChatRoomHandler.getJoinedAVChatRoom(); + } + getGroupRemoteLastSeq(e2) { + e2 = this.getLocalGroupProfile(e2); + return e2 ? e2.nextMessageSeq - 1 : 1; + } + isOnlineMessage(e2, t2) { + return !(!this._canIUseOnlineOnlyFlag(e2) || !t2 || true !== t2.onlineUserOnly); + } + _canIUseOnlineOnlyFlag(e2) { + var t2 = this.getJoinedAVChatRoom(); + return !t2 || !t2.includes(e2.to) || e2.conversationType !== ue; + } + _onAVChatRoomHistoryMessage(e2, t2) { + if (!qe(e2)) { + ct.l(this._n + `._onAVChatRoomHistoryMessage groupID:${t2} count:` + e2.length); + const s2 = []; + e2.forEach((e3) => { + s2.push({ ...e3, isHistoryMessage: 1 }); + }), this.onAVChatRoomMessage(s2, t2); + } + } + onAVChatRoomMessage(e2, t2 = "") { + this._AVChatRoomHandler.onMessage(e2, t2); + } + onAVChatRoomMemberBanned(e2) { + this._AVChatRoomHandler.onAVChatRoomMemberBanned(e2); + } + setUnjoinedAVChatRoom(e2) { + this._unjoinedAVChatRoomList.set(e2, 1); + } + deleteUnjoinedAVChatRoom(e2) { + this._unjoinedAVChatRoomList.has(e2) && this._unjoinedAVChatRoomList.delete(e2); + } + isUnjoinedAVChatRoom(e2) { + return this._unjoinedAVChatRoomList.has(e2); + } + isGroupAttributesUpdatedNotice(e2) { + return this._groupAttributesHandler.isGroupAttributesUpdatedNotice(e2); + } + updateLocalMainSequenceOnReconnected() { + this._groupAttributesHandler.updateLocalMainSequenceOnReconnected(); + } + initGroupAttributes(e2) { + return this._groupAttributesHandler.initGroupAttributes(e2); + } + setGroupAttributes(e2) { + return this._groupAttributesHandler.setGroupAttributes(e2); + } + deleteGroupAttributes(e2) { + return this._groupAttributesHandler.deleteGroupAttributes(e2); + } + getGroupAttributes(e2) { + return this._groupAttributesHandler.getGroupAttributes(e2); + } + isMessageFromTopic(e2, t2) { + return 2 === e2 && !qe(t2); + } + isMessageFromCommunityOfTopic(e2, t2) { + return 2 === e2 && qe(t2); + } + getMessageExtensions(e2, t2) { + return ct.l(this._n + ".getMessageExtensions startSequence:" + t2), this.req({ P: Es, data: { groupID: e2.to, messageSequence: e2.sequence, startSequence: t2 } }); + } + modifyMsgExts(e2, t2, s2 = 1) { + return ct.l(this._n + ".modifyMsgExts operateType:" + s2), this.req({ P: $s, data: { groupID: e2.to, messageSequence: e2.sequence, extensionList: t2, operateType: s2 } }); + } + _genNotifyReqList(s2) { + var o2, r2, i2, n2, a2 = []; + for (let e2 = 0, t2 = s2.length; e2 < t2; e2++) + o2 = s2[e2], n2 = this.getLocalGroupProfile(o2).type, r2 = this._getGroupLastRevokedTime(o2), i2 = 1e3 * ve(), n2 = { notifyType: 1, limit: 20, type: ot({ type: n2, groupID: o2 }) ? de : void 0, groupID: o2, beginTime: r2, endTime: i2 }, a2.push(n2); + return a2; + } + getNotice(e2) { + const t2 = this._n + ".getNotice", s2 = e2.filter((e3) => { + var t3; + return !!this.hasLocalGroup(e3) && ({ type: e3, isSupportTopic: t3 } = this.getLocalGroupProfile(e3), !st(e3)) && !t3; + }); + 0 !== s2.length && (ct.l(t2 + " list:" + s2), this.req({ P: ws, data: { notifyReqList: this._genNotifyReqList(s2) } }).then((i2) => { + const e3 = i2.data["notifyRspList"], n2 = []; + if (je(e3)) { + const i3 = { dataList: [] }; + let r2 = t2 + " ok."; + e3.forEach((e4) => { + var { nextRevokedTime: t3, groupID: s3, notifyList: o2 } = e4; + r2 += ` groupID:${s3} nextRevokedTime:${t3} count:${o2.length} +`, i3.dataList.push({ elements: { revokedInfos: this._genRevokedInfos(e4) } }), 0 !== t3 ? (this._setGroupLastRevokedTime(s3, t3), n2.push(s3)) : this._setGroupLastRevokedTime(s3, 1e3 * ve()); + }), ct.l(r2), this.onMsgRevoked(i3, false); + } + 0 < n2.length && this.getNotice(n2); + }).catch((e3) => { + ct.e(t2 + " failed. error:", e3); + })); + } + _genRevokedInfos(e2) { + const { notifyList: t2, groupID: s2 } = e2, o2 = []; + return je(t2) && t2.forEach((e3) => { + o2.push({ groupID: s2, sequence: e3.sequence, random: e3.random, revokerInfo: { ...e3.revokerInfo } }); + }), o2; + } + _getGroupLastRevokedTime(e2) { + return this.hasLocalGroup(e2) ? this.getLocalGroupProfile(e2)._lastRevokedTime : 0; + } + _setGroupLastRevokedTime(e2, t2) { + this.hasLocalGroup(e2) && (this.getLocalGroupProfile(e2)._lastRevokedTime = t2); + } + isGroupCountersNotice(e2) { + return this._groupCountersHandler.isGroupCountersNotice(e2); + } + setGroupCounters(e2) { + return this._groupCountersHandler.setGroupCounters(e2); + } + increaseGroupCounter(e2) { + return this._groupCountersHandler.increaseGroupCounter(e2); + } + decreaseGroupCounter(e2) { + return this._groupCountersHandler.decreaseGroupCounter(e2); + } + getGroupCounters(e2) { + return this._groupCountersHandler.getGroupCounters(e2); + } + getGroupMemberHandler() { + return this._groupMemberHandler; + } + getGroupMemberList(e2) { + return this._groupMemberHandler.getGroupMemberList(e2); + } + getGroupMemberProfile(e2) { + return this._groupMemberHandler.getGroupMemberProfile(e2); + } + addGroupMember(e2) { + return this._groupMemberHandler.addGroupMember(e2); + } + deleteGroupMember(e2) { + return this._groupMemberHandler.deleteGroupMember(e2); + } + setGroupMemberMuteTime(e2) { + return this._groupMemberHandler.setGroupMemberMuteTime(e2); + } + setGroupMemberRole(e2) { + return this._groupMemberHandler.setGroupMemberRole(e2); + } + setGroupMemberNameCard(e2) { + return this._groupMemberHandler.setGroupMemberNameCard(e2); + } + setGroupMemberCustomField(e2) { + return this._groupMemberHandler.setGroupMemberCustomField(e2); + } + markGroupMemberList(e2) { + return this._groupMemberHandler.markGroupMemberList(e2); + } + modifyGroupMemberInfo(e2) { + return this._groupMemberHandler.modifyGroupMemberInfo(e2); + } + restartPolling() { + this._AVChatRoomHandler.restartPolling(); + } + getPollingTimerID(e2) { + var t2; + return e2 && (t2 = this.getLocalGroupProfile(e2)) && st(t2.type) ? this._AVChatRoomHandler.getPollingTimerID(e2) : -1; + } + _canIUseJoinOption(e2) { + return e2 === he || ot({ type: e2 }); + } + _silentlyGetGroupProfile(e2, t2) { + var s2 = setTimeout(this.getGroupProfile.bind(this, { groupID: t2 }), 3e3); + this._timeoutIDs.push(s2), ct.l(this._n + `._silentlyGetGroupProfile errorCode:${e2} groupID:${t2} timeoutIDs:` + this._timeoutIDs); + } + _clearTimeoutIDs() { + this._timeoutIDs.forEach((e2) => { + clearTimeout(e2); + }), this._timeoutIDs = []; + } + startMessageLongPolling(e2) { + var { groupID: e2, longPollingKey: t2, longPollingSequence: s2 = 1 } = e2, o2 = this.get(r).isUnlimitedAVChatRoom(), i2 = (this._AVChatRoomHandler.hasPollingInstance(e2) && this.stopMessageLongPolling({ groupID: e2 }), this._AVChatRoomHandler.getJoinedLiveList()), o2 = (!o2 && 0 < i2.length && this.stopMessageLongPolling({ groupID: i2[0] }), new $o({ groupID: e2, type: fe })); + return ct.l(this._n + `.startMessageLongPolling groupID:${e2} longPollingKey:${t2} longPollingSequence:` + s2), this._AVChatRoomHandler.startRunLoop({ group: o2, longPollingKey: t2, startSeq: s2 }); + } + stopMessageLongPolling(e2) { + var e2 = e2["groupID"], t2 = this.get(o); + return this._AVChatRoomHandler.reset(e2), this._deleteLocalGroup(e2), t2.deleteLocalConv("" + ue + e2), ct.l(this._n + ".stopMessageLongPolling ok, groupID:" + e2), jt({ groupID: e2 }); + } + reset() { + this.groupMap.clear(), this._unjoinedAVChatRoomList.clear(), this._receiptDetailCompleteMap.clear(), this._onlineMemberCountMap.clear(), this._commonGroupHandler.reset(), this._groupSystemNoticeHandler.reset(), this._groupTipsHandler.reset(), this._groupAttributesHandler.reset(), this._groupCountersHandler.reset(), this._AVChatRoomHandler.reset(), this._groupMemberHandler.reset(), this._clearTimeoutIDs(); + } +}; +export { + Ko as default +}; +//# sourceMappingURL=@tencentcloud_chat_modules_group-module__js.js.map diff --git a/jiuyi2/unpackage/dist/cache/.vite/deps/@tencentcloud_chat_modules_group-module__js.js.map b/jiuyi2/unpackage/dist/cache/.vite/deps/@tencentcloud_chat_modules_group-module__js.js.map new file mode 100644 index 00000000..1c60a267 --- /dev/null +++ b/jiuyi2/unpackage/dist/cache/.vite/deps/@tencentcloud_chat_modules_group-module__js.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../../../../node_modules/@tencentcloud/chat/modules/group-module.js"], + "sourcesContent": ["\"use strict\";const e=2,t=4,s=10,o=11,r=12,i=14,n=17,a=20,u=23,p=26,l=27,c=29,h=30,g=34;class m{constructor(e=0,t=0){this.high=e,this.low=t}equal(e){return null!==e&&this.low===e.low&&this.high===e.high}toString(){var e=Number(this.high).toString(16);let t=Number(this.low).toString(16);if(t.length<8){let e=8-t.length;for(;e;)t=\"0\"+t,e--}return e+t}}const d={TEST:{CHINA:{DEFAULT:\"wss://wss-dev.tim.qq.com\"},OVERSEA:{DEFAULT:\"wss://wss-dev.tim.qq.com\"},SINGAPORE:{DEFAULT:\"wss://wsssgp-dev.im.qcloud.com\"},KOREA:{DEFAULT:\"wss://wsskr-dev.im.qcloud.com\"},GERMANY:{DEFAULT:\"wss://wssger-dev.im.qcloud.com\"},IND:{DEFAULT:\"wss://wssind-dev.im.qcloud.com\"},JPN:{DEFAULT:\"wss://wssjpn-dev.im.qcloud.com\"},USA:{DEFAULT:\"wss://wssusa-dev.im.qcloud.com\"},INDONESIA:{DEFAULT:\"wss://wssidn-dev.im.qcloud.com\"}},PRODUCTION:{CHINA:{DEFAULT0:\"wss://*w4c.my-imcloud.com\",DEFAULT:\"wss://wss.im.qcloud.com\",BACKUP:\"wss://wss.tim.qq.com\",STAT:\"https://events.im.qcloud.com\",ANYCAST:\"wss://162.14.13.203\"},OVERSEA:{DEFAULT0:\"wss://*w4c.my-imcloud.com\",DEFAULT:\"wss://wss.im.qcloud.com\",BACKUP:\"wss://wss.my-imcloud.com\",STAT:\"https://api.my-imcloud.com\"},SINGAPORE:{DEFAULT0:\"wss://*w4s.my-imcloud.com\",DEFAULT:\"wss://wsssgp.im.qcloud.com\",BACKUP:\"wss://wsssgp.my-imcloud.com\",STAT:\"https://apisgp.my-imcloud.com\",ANYCAST:\"wss://162.14.19.159\"},KOREA:{DEFAULT0:\"wss://*w4k.my-imcloud.com\",DEFAULT:\"wss://wsskr.im.qcloud.com\",BACKUP:\"wss://wsskr.my-imcloud.com\",STAT:\"https://apikr.my-imcloud.com\",ANYCAST:\"wss://162.14.13.104\"},GERMANY:{DEFAULT0:\"wss://*w4g.my-imcloud.com\",DEFAULT:\"wss://wssger.im.qcloud.com\",BACKUP:\"wss://wssger.my-imcloud.com\",STAT:\"https://apiger.my-imcloud.com\",ANYCAST:\"wss://162.14.3.17\"},IND:{DEFAULT0:\"wss://*w4i.my-imcloud.com\",DEFAULT:\"wss://wssind.my-imcloud.com\",BACKUP:\"wss://wssind.im.qcloud.com\",STAT:\"https://apiind.my-imcloud.com\",ANYCAST:\"wss://162.14.18.188\"},JPN:{DEFAULT0:\"wss://*w4j.my-imcloud.com\",DEFAULT:\"wss://wssjpn.im.qcloud.com\",BACKUP:\"wss://wssjpn.my-imcloud.com\",STAT:\"https://apijpn.my-imcloud.com\"},USA:{DEFAULT0:\"wss://*w4u.my-imcloud.com\",DEFAULT:\"wss://wssusa.im.qcloud.com\",BACKUP:\"wss://wssusa.my-imcloud.com\",STAT:\"https://apiusa.my-imcloud.com\",ANYCAST:\"wss://162.14.10.42\"},INDONESIA:{DEFAULT0:\"wss://*w4y.my-imcloud.com\",DEFAULT:\"wss://wssidn.im.qcloud.com\",BACKUP:\"wss://wssidn.my-imcloud.com\",STAT:\"https://apiidn.my-imcloud.com\",ANYCAST:\"wss://43.129.34.169\"}}},_={ANDROID:2,IOS:3,MAC:4,WEB:7,WX_MP:8,QQ_MP:9,TT_MP:10,BAIDU_MP:11,ALI_MP:12,IPAD:13,UNI_NATIVE_APP:15,DONUT_NATIVE_APP:19,NS_NATIVE_APP:20,RN_NATIVE_APP:21},f=\"CHINA\",M={HOST:{CURRENT:{DEFAULT:\"wss://wss.im.qcloud.com\",STAT:\"https://events.im.qcloud.com\"},setCurrent(e=f){this.CURRENT=d.PRODUCTION[e]}},NAME:{OPEN_IM:\"openim\",OPEN_IM_MSG_EXT:\"openim_msg_ext_http_svc\",GRP:\"group_open_http_svc\",GRP_AV:\"group_open_avchatroom_http_svc\",GRP_COMMUNITY:\"million_group_open_http_svc\",GRP_ATTR:\"group_open_attr_http_svc\",FD:\"sns\",PROFILE:\"profile\",RECENT_CONTACT:\"recentcontact\",PIC:\"openpic\",BIG_GRP_NO_AUTH:\"group_open_http_noauth_svc\",BIG_GRP_POLLING:\"group_open_long_polling_http_svc\",BIG_GRP_POLLING_NO_AUTH:\"group_open_long_polling_http_noauth_svc\",IM_OPEN_STAT:\"imopenstat\",WEB_IM:\"webim\",IM_COS_SIGN:\"im_cos_sign_svr\",CUSTOM_UPLOAD:\"im_cos_msg\",HEARTBEAT:\"heartbeat\",IM_OPEN_PUSH:\"im_open_push\",IM_OPEN_STATUS:\"im_open_status\",IM_LONG_MSG:\"im_long_msg\",IM_CONFIG_MANAGER:\"im_sdk_config_mgr\",STAT_SERVICE:\"StatSvc\",OVERLOAD_PUSH:\"OverLoadPush\",IM_MSG_AUDIT_MGR:\"im_msg_audit_mgr\",TUIROOM_SVR:\"tui_room_svr\",IM_OPEN_TRANSLATE:\"im_open_translate\",IM_OPEN_SPEECH:\"im_open_speech\",MSG_SEARCH:\"message_search\",FOLLOW:\"follow\",OFFLINE_PUSH_REPORT:\"offline_push_report\",IM_MSG_LOGIC:\"im_msg_db_logic\"}},I={SEARCH_GRP_SNS:new m(0,Math.pow(2,1)).toString(),AV_HISTORY_MSG:new m(0,Math.pow(2,2)).toString(),GRP_COMMUNITY:new m(0,Math.pow(2,3)).toString(),MSG_TO_SPECIFIED_GRP_MBR:new m(0,Math.pow(2,4)).toString(),AV_MBR_LIST:new m(0,Math.pow(2,6)).toString(),USER_STATUS:new m(0,Math.pow(2,7)).toString(),CONV_MARK:new m(0,Math.pow(2,9)).toString(),CONV_GROUP:new m(0,Math.pow(2,10)).toString(),AV_BAN_MBR:new m(0,Math.pow(2,11)).toString(),MSG_EXT:new m(0,Math.pow(2,13)).toString(),GRP_COUNTER:new m(0,Math.pow(2,15)).toString(),PLUGIN_TRANSLATE:new m(Math.pow(2,6)).toString(),PLUGIN_VOICE_TO_TEXT:new m(Math.pow(2,7)).toString(),PLUGIN_CS:new m(Math.pow(2,8)).toString(),PLUGIN_PUSH:new m(Math.pow(2,9)).toString(),PLUGIN_BOT:new m(Math.pow(2,10)).toString(),MSG_REACTION:new m(Math.pow(2,16)).toString(),FOLLOW:new m(Math.pow(2,20)).toString()},y=\"group_profile\",D=\"group_member_profile\",L=[\"Type\",\"Name\",\"Introduction\",\"Notification\",\"FaceUrl\",\"Owner_Account\",\"CreateTime\",\"InfoSeq\",\"LastInfoTime\",\"LastMsgTime\",\"MemberNum\",\"MaxMemberNum\",\"ApplyJoinOption\",\"NextMsgSeq\",\"ShutUpAllMember\",\"InviteJoinOption\"],C=[\"Role\",\"JoinTime\",\"MsgSeq\",\"MsgFlag\"],G=(M.HOST.setCurrent(f),\"undefined\"!=typeof wx&&\"function\"==typeof wx.getSystemInfoSync&&Boolean(wx.getSystemInfoSync().fontSizeSetting)),b=(G&&wx.createGamePortal,\"undefined\"!=typeof qq&&\"function\"==typeof qq.getSystemInfoSync&&Boolean(qq.getSystemInfoSync().fontSizeSetting)),A=\"undefined\"!=typeof tt&&\"function\"==typeof tt.getSystemInfoSync&&Boolean(tt.getSystemInfoSync().fontSizeSetting),T=\"undefined\"!=typeof swan&&\"function\"==typeof swan.getSystemInfoSync&&Boolean(swan.getSystemInfoSync().fontSizeSetting),S=\"undefined\"!=typeof my&&\"function\"==typeof my.getSystemInfoSync&&Boolean(my.getSystemInfoSync().fontSizeSetting),v=\"undefined\"!=typeof jd&&\"function\"==typeof jd.getSystemInfoSync,P=\"undefined\"!=typeof uni&&\"undefined\"==typeof window&&\"function\"==typeof uni.requireNativePlugin,R=G&&\"object\"==typeof wx.miniapp,$=G||b||A||T||S||P||v,E=\"undefined\"==typeof window&&!$&&\"undefined\"!=typeof global&&void 0!==global.NativeScriptGlobals,w=\"undefined\"!=typeof global&&(void 0!==global.nativeModuleProxy||void 0!==global.ReactNative),U=\"undefined\"!=typeof uni?!$:\"undefined\"!=typeof window&&!$&&!w,N=(b?qq:A?tt:T?swan:S?my:G?wx:P?uni:v&&jd,U&&window&&window.navigator&&window.navigator.userAgent||\"\"),q=/(micromessenger|webbrowser)/i.test(N),k=function(){let e=\"WEB\";return q?e=\"WEB\":b?e=\"QQ_MP\":A?e=\"TT_MP\":T?e=\"BAIDU_MP\":S?e=\"ALI_MP\":G?e=R?\"DONUT_NATIVE_APP\":\"WX_MP\":P?e=\"UNI_NATIVE_APP\":E?e=\"NS_NATIVE_APP\":w&&(e=\"RN_NATIVE_APP\"),_[e]}(),O=(!function(){var e=N.match(/OS (\\d+)_/i);e&&e[1]&&e[1]}(),function(){var e,t,s=N.match(/Android (\\d+)(?:\\.(\\d+))?(?:\\.(\\d+))*/i);s&&(e=s[1]&&parseFloat(s[1]),t=s[2]&&parseFloat(s[2]),e)&&t&&parseFloat(s[1]+\".\"+s[2])}(),/MSIE/.test(N)||-1{var s=o.find(e=>e.key===t);s?s.value!==e&&(s.value=e,r=!0):(o.push({key:t,value:e}),r=!0)}),r}function Ze(e){return qe(e)?[]:e.filter(e=>!0===e.isModified)}function et(e){return qe(e)?[]:e.filter(e=>!1===e.isModified)}const st=e=>e===me,ot=({type:e,groupID:t})=>e===de||(\"\"+t).startsWith(we)&&!(\"\"+t).includes(Ue),rt=e=>(\"\"+e).startsWith(we)&&(\"\"+e).includes(Ue);function it(e){return e.split(Ue)[0]}function nt(){return!O&&!$}function at(e,t=!0,s=!0){var o=Date.now();return t?s?o-e+\" ms\":Math.round((o-e)/1e3)+\" s\":s?o-e:Math.round((o-e)/1e3)}let ut=0;function pt(){return nt()?\"%c Chat %c\":\"Chat\"}function lt(){(e=new Date).setTime(ve());var e;return e.toLocaleTimeString(\"en-US\",{hour12:!1})+\".\"+function(e){let t;switch(e.toString().length){case 1:t=\"00\"+e;break;case 2:t=\"0\"+e;break;default:t=e}return t}(e.getMilliseconds())}const ct={arguments2String(s){let o=\"\";if(1===s.length)o=s[0];else for(let e=0,t=s.length;e{this._sentFlag=!0,this._eventStatModule&&this._eventStatModule.pushIn(this)},0)}}setError(t){if(t instanceof Error){if(!this._sentFlag){let e=!0;if(e=this._netMonitorModule?this._netMonitorModule.isOnline():e)t.code&&this.setCode(t.code),t.message&&this.setMoreMessage(t.message);else{const t=Rt;this.setCode(t)}this.setLevel(\"error\")}}else ct.w(this._n+\".setError value not instanceof Error, please check!\");return this}setCode(e){return Ke(e)||this._sentFlag||(\"ECONNABORTED\"===e&&(this.code=103),xe(e)?this.code=e:ct.w(this._n+\".setCode value not a number, please check!\",e,typeof e)),this}setMessage(e){return Ke(e)||this._sentFlag||(xe(e)&&(this.message=e.toString()),Ve(e)&&(this.message=e)),this}setCostTime(e){return this.costTime=e,this}setLevel(e){return Ke(e)||this._sentFlag||(this.level=Xt[e]),this}setMoreMessage(e){return qe(this.moreMessage)?this.moreMessage=\"\"+e:this.moreMessage+=\" \"+e,this}setNetworkType(e){return Ke(e)?ct.w(this._n+\".setNetworkType value is undefined, please check!\"):(e=Yt[e.toLowerCase()],Ke(e)||(this.networkType=e)),this}getStartTs(){return this._startts}setUIPlatform(e){return this.uiPlatform=e,this}setExtension(e){return this.extension=e,this}setEventType(e){return this.eventType=e,this}}const es=\"send_group_msg\",ts=\"get_joined_group_list\",ss=\"get_group_self_member_info\",os=\"create_group\",rs=\"destroy_group\",is=\"modify_group_base_info\",ns=\"apply_join_group\",as=\"apply_join_group_noauth\",us=\"quit_group\",ps=\"get_group_public_info\",ls=\"change_group_owner\",cs=\"handle_apply_join_group\",hs=\"handle_invite_join_permission_group\",gs=\"handle_invite_join_group\",ms=\"group_msg_recall\",ds=\"msg_read_report\",_s=\"group_msg_get\",fs=\"get_group_msg_receipt\",Ms=\"group_msg_receipt\",Is=\"get_group_msg_receipt_detail\",ys=\"get_pendency\",Ds=\"deletemsg\",Ls=\"get_msg\",Cs=\"get_msg_noauth\",Gs=\"get_online_member_num\",bs=\"delete_group_ramble_msg_by_seq\",As=\"modify_group_msg\",Ts=\"set_group_attr\",Ss=\"modify_group_attr\",vs=\"delete_group_attr\",Ps=\"clear_group_attr\",Rs=\"get_group_attr\",$s=\"group_set_key_values\",Es=\"group_get_key_values\",ws=\"batch_get_group_notify\",Us=\"update_group_counter\",Ns=\"get_group_counter\",qs=\"get_group_member_info\",ks=\"get_members\",Os=\"get_specified_group_member_info\",Fs=\"add_group_member\",xs=\"delete_group_member\",Vs=\"ban_group_member\",Hs=\"modify_group_member_info\",js=\"modify_user_info\",Ks=\"unSend\",Bs=\"success\",Js=\"notStart\",Ws=\"resolved\",zs=\"rejected\";class Xs{constructor(e){this.type=B,this.content={text:e.text||\"\"}}setText(e){this.content.text=e}sendable(){return 0!==this.content.text.length}}function Ys(t,s,o,r=[]){if(t){let e=t;return s&&(t.startsWith(\"http://\")?e=t.replace(/^http:\\/\\/[^/]+/,s):t.startsWith(\"https://\")&&(e=t.replace(/^https:\\/\\/[^/]+/,s))),e=o&&-1===e.indexOf(\"authKey=\")&&eo(e,r)?-1{Qs(e.messageBody[0].type,e.messageBody)})}return t}function Zs(e){if(!e)return e;if(-1===e.indexOf(\"authKey=\"))return e;var e=e.split(\"?\"),t=e[1].split(\"&\");let s=0;for(let e=0;e{switch(e){case\"remarkInfo\":break;case\"groupProfile\":this.content.groupProfile={},this._initGroupProfile(t[e]);break;case\"operatorInfo\":this.content.operatorInfo={},this._initOperatorInfo(t[e]);break;case\"memberInfoList\":case\"msgMemberInfo\":this._updateMemberList(t[e]);break;case\"memberExtraInfo\":case\"onlineMemberInfo\":break;case\"memberNum\":this.content[e]=t[e],this.content.memberCount=t[e];break;case\"newGroupProfile\":this.content.newGroupProfile={},this._initNewGroupProfile(t[e]);break;default:this.content[e]=t[e]}}),this.content.userIDList||(this.content.userIDList=[this.content.operatorID])}_initGroupProfile(t){var s=Object.keys(t);for(let e=0;e{e.forEach(e=>{t.userID===e.userID&&Object.assign(t,e)})})}_initNewGroupProfile(t){var s=Object.keys(t);for(let e=0;e{switch(e){case\"memberInfoList\":break;case\"remarkInfo\":this.content.handleMessage=t[e];break;case\"groupProfile\":this.content.groupProfile={},this._initGroupProfile(t[e]);break;default:this.content[e]=t[e]}})}_initGroupProfile(t){var s=Object.keys(t);for(let e=0;e{!e.imageUrl&&e.url&&(e.imageUrl=e.url,e.sizeType=e.type,1===e.type?e.type=0:3===e.type&&(e.type=1))}):e===Y?!t.remoteVideoUrl&&t.videoUrl&&(t.remoteVideoUrl=t.videoUrl):e===W?!t.remoteAudioUrl&&t.url&&(t.remoteAudioUrl=t.url):e===z&&!t.fileUrl&&t.url&&(t.fileUrl=t.url,t.url=void 0)}_updateRichMediaDownloadUrl(e,t,s,o,r){(s||o)&&(e===J?t.imageInfoArray.forEach(e=>{e.url=Ys(e.url,s,o,r)}):e===Y?(t.videoUrl=Ys(t.videoUrl,s,o,r),t.snapshotUrl=Ys(t.thumbUrl,s,o,r),t.snapshotHeight=t.thumbHeight,t.snapshotWidth=t.thumbWidth):e===W?t.url=Ys(t.url,s,o,r):e===z&&(t.fileUrl=Ys(t.fileUrl,s,o,r)))}}var go=class{constructor(e,t,s,o){if(this.type=se,this.content={downloadKey:\"\",pbDownloadKey:\"\",messageList:[],title:\"\",abstractList:[],compatibleText:\"\",version:0,layersOverLimit:!1},e.downloadKey){const{downloadKey:t,pbDownloadKey:s,title:o,abstractList:r,compatibleText:i,version:n}=e;this.content.downloadKey=t,this.content.pbDownloadKey=s,this.content.title=o,this.content.abstractList=r,this.content.compatibleText=i,this.content.version=n||0}else if(qe(e.messageList))1===e.layersOverLimit&&(this.content.layersOverLimit=!0);else{const{messageList:a,title:u,abstractList:p,compatibleText:l,version:h}=e,c=[];a.forEach(e=>{qe(e)||(e=new ho(e,t,s,o),c.push(e))}),this.content.messageList=c,this.content.title=u,this.content.abstractList=p,this.content.compatibleText=l,this.content.version=h||0}}sendable(){return!qe(this.content.messageList)||!qe(this.content.downloadKey)}};const mo={1:oe,2:re,3:ie,4:ne};class _o{constructor(e){this.ID=\"\",this.conversationID=e.conversationID||null,this.conversationType=e.conversationType||ae,this.conversationSubType=e.conversationSubType,this.time=e.time||Math.ceil(Date.now()/1e3),this.sequence=e.sequence||0,this.clientSequence=e.clientSequence||e.sequence||0,this.random=e.random||0===e.random?e.random:ze(),this.priority=this._computePriority(e.priority),this.nick=e.nick||\"\",this.avatar=e.avatar||\"\",this.isPeerRead=!1,this.nameCard=\"\",this.hasRiskContent=function(e){let t=e&&1{e!==Se?(this._groupAtInfoList.push({groupAtAllFlag:0,groupAtUserID:e}),this.atUserList.push(e)):(this._groupAtInfoList.push({groupAtAllFlag:1}),this.atUserList.push(Se))}),je(e.groupAtInfo)&&e.groupAtInfo.forEach(e=>{0===e.groupAtAllFlag?this.atUserList.push(e.groupAtUserID):1===e.groupAtAllFlag&&this.atUserList.push(Se)})}getGroupAtInfoList(){return this._groupAtInfoList}_initProxy(){this._elements[0]&&(this.payload=this._elements[0].content,this.type=this._elements[0].type)}reInitialize(e){e&&(this.status=this.from?Bs:Ks,!this.from)&&(this.from=e),this._initFlow(e),this._initSequence(e),this._concatConversationID(e),this.generateMessageID()}isSendable(){return 0!==this._elements.length&&(!0===this._relayFlag||\"function\"==typeof this._elements[0].sendable&&this._elements[0].sendable())}_initTo(e){this.conversationType===ue&&(this.to=e.groupID)}_initSequence(e){0===this.clientSequence&&e&&(this.clientSequence=function(o){if(!o)return!1;if(void 0===Xe[o]){var r=new Date;let e=(\"3\"+r.getHours()).slice(-2),t=(\"0\"+r.getMinutes()).slice(-2),s=(\"0\"+r.getSeconds()).slice(-2);Xe[o]=parseInt([e,t,s,\"0001\"].join(\"\")),e=null,t=null,s=null,ct.l(\"autoIncrementIndex start index:\"+Xe[o])}return Xe[o]++}(e)),0===this.sequence&&this.conversationType===ae&&(this.sequence=this.clientSequence)}generateMessageID(){this.from===le&&(this.senderTinyID=\"144115198244471703\"),this.ID=`${this.senderTinyID}-${this.clientTime}-`+this.random}_initFlow(e){\"\"!==e&&(e===this.from?(this.flow=\"out\",this.isRead=!0):this.flow=\"in\")}_concatConversationID(e){var t=this[\"to\"],s=this.conversationType;s!==le?(e=s===ae?e===this.from?t:this.from:this.to,this.conversationID=e?\"\"+s+e:null):this.conversationID=le}isElement(e){return e instanceof Xs||e instanceof to||e instanceof so||e instanceof oo||e instanceof uo||e instanceof lo||e instanceof io||e instanceof ao||e instanceof po||e instanceof co||e instanceof go}setElement(t,s,o,r){if(this.isElement(t))this._elements=[t];else{var i=e=>{if(e.type&&e.content)switch(e.type){case B:this.setTextElement(e.content);break;case J:this.setImageElement(e.content,s,o,r);break;case W:this.setAudioElement(e.content,s,o,r);break;case z:this.setFileElement(e.content,s,o,r);break;case Y:this.setVideoElement(e.content,s,o,r);break;case te:this.setCustomElement(e.content);break;case Q:this.setLocationElement(e.content);break;case Z:this.setGroupTipElement(e.content);break;case ee:this.setGroupSystemNoticeElement(e.content);break;case X:this.setFaceElement(e.content);break;case se:this.setMergerElement(e.content,s,o,r)}};if(je(t))for(let e=0;e{e.reason=t})}var{nick:s,avatar:o}=t,s=(Ve(s)&&(this.nick=s),Ve(o)&&(this.avatar=o),new io(e));this._elements.push(s)}setGroupSystemNoticeElement(e){e=new ao(e);this._elements.push(e)}setFaceElement(e){e=new so(e);this._elements.push(e)}setMergerElement(e,t,s,o){e=new go(e,t,s,o);this._elements.push(e)}setIsRead(e){this.isRead=e}setRelayFlag(e){this._relayFlag=e}_computePriority(e){if(!Ke(e)){if(Ve(e)&&-1!==Object.values(mo).indexOf(e))return e;if(xe(e)){e=\"\"+e;if(-1!==Object.keys(mo).indexOf(e))return mo[e]}}return re}setNickAndAvatar(e){var{nick:e,avatar:t}=e;Ve(e)&&(this.nick=e),Ve(t)&&(this.avatar=t)}setNameCard(e){Ve(e)&&(this.nameCard=e)}initC2CReadReceiptInfo(e){var{readReceiptSentByPeer:e,timestamp:t=0}=e;this.conversationType===ae&&!0===this.needReadReceipt&&(this.readReceiptInfo.isPeerRead=1===e,this.readReceiptInfo.timestamp=t)}}class fo{constructor(e){this._grpM=e,this._n=\"GroupTipsHandler\",this._cachedGroupTipsMap=new Map,this._checkCountMap=new Map,this.MAX_CHECK_COUNT=4}onCheckTimer(e){e%1==0&&0{var s=this._checkCountMap.get(t),o=this._grpM.hasLocalGroup(t);ct.l(this._n+`._check groupID:${t} hasLocalGroup:${o} checkCount:`+s),o?(this._notifyCachedGroupTips(t),this._checkCountMap.delete(t),this._grpM.deleteUnjoinedAVChatRoom(t)):s>=this.MAX_CHECK_COUNT?(this._deleteCachedGroupTips(t),this._checkCountMap.delete(t)):this._checkCountMap.set(t,++s)})}onNewGroupTips(e){ct.l(this._n+\".onNewGroupTips options:\"+JSON.stringify(e.dataList));var{eventDataList:e,result:t,AVChatRoomMessageList:s}=this._assembly(e);0{switch(e.payload.operationType){case 1:this._onNewMemberComeIn(e);break;case 2:this._onMemberQuit(e);break;case 3:this._onMemberKickedOut(e);break;case 4:this._onMemberSetAdmin(e);break;case 5:this._onMemberCancelledAdmin(e);break;case 6:this._onGroupProfileModified(e);break;case 7:this._onMemberInfoModified(e);break;case 8:this._onTopicProfileUpdated(e);break;default:ct.w(this._n+\"._handleTips unknown operationType:\"+e.payload.operationType)}})}_onNewMemberComeIn(e){var{memberNum:e,groupProfile:{groupID:t}}=e.payload,t=this._grpM.getLocalGroupProfile(t);t&&xe(e)&&t.memberCount!==e&&(t.memberCount=e,this._updateConvGroupProfile(t))}_onMemberQuit(e){var{memberNum:t,groupProfile:{groupID:s}}=e.payload,o=this._grpM.getLocalGroupProfile(s);o&&xe(t)&&o.memberCount!==t&&(o.memberCount=t,this._updateConvGroupProfile(o)),this._grpM.getGroupMemberHandler().deleteLocalGroupMembers(s,e.payload.userIDList)}_onMemberKickedOut(e){var{memberNum:t,groupProfile:{groupID:s}}=e.payload,o=this._grpM.getLocalGroupProfile(s);o&&xe(t)&&o.memberCount!==t&&(o.memberCount=t,this._updateConvGroupProfile(o)),this._grpM.getGroupMemberHandler().deleteLocalGroupMembers(s,e.payload.userIDList)}_updateConvGroupProfile(e){this._grpM.get(o).updateConvGroupProfile([e])}_onMemberSetAdmin(e){const t=e.payload.groupProfile.groupID,s=e.payload.userIDList,o=this._grpM.getGroupMemberHandler();s.forEach(e=>{e=o.getLocalGroupMemberInfo(t,e);e&&e.updateRole(Ie)})}_onMemberCancelledAdmin(e){const t=e.payload.groupProfile.groupID,s=e.payload.userIDList,o=this._grpM.getGroupMemberHandler();s.forEach(e=>{e=o.getLocalGroupMemberInfo(t,e);e&&e.updateRole(ye)})}_onGroupProfileModified(e){const{newGroupProfile:t,groupProfile:s,operatorInfo:o}=e.payload,r=s[\"groupID\"],i=this._grpM.getLocalGroupProfile(r);Object.keys(t).forEach(e=>{switch(e){case\"ownerID\":this._ownerChanged(i,t);break;case\"groupName\":i.name=t[e];break;default:i[e]=t[e]}}),Ke(o)||Object.keys(o).forEach(e=>{\"nameCard\"===e?i.updateSelfInfo({nameCard:o[e]}):\"role\"===e&&i.updateSelfInfo({role:o[e]})});e=!i.isSupportTopic;this._grpM.emitGroupListUpdate(!0,e)}_ownerChanged({groupID:e},t){var s=this._grpM.getLocalGroupProfile(e),o=this._grpM.getMyUserID();if(o===t.ownerID){s.updateGroup({selfInfo:{role:Me}});const t=this._grpM.getGroupMemberHandler(),r=t.getLocalGroupMemberInfo(e,o),i=this._grpM.getLocalGroupProfile(e).ownerID,n=t.getLocalGroupMemberInfo(e,i);r&&r.updateRole(Me),n&&n.updateRole(ye)}}_onMemberInfoModified(e){const{to:t,payload:{groupProfile:s,memberList:o}}=e,r=s.groupID,i=(rt(t)&&this._updateTopicMuteTime(e),this._grpM.getGroupMemberHandler());o.forEach(e=>{var t=i.getLocalGroupMemberInfo(r,e.userID);t&&xe(e.muteTime)&&t.updateMuteUntil(e.muteTime)})}_updateTopicMuteTime(e){var{to:e,payload:{groupProfile:o,memberList:r=[]}}=e,o=o[\"groupID\"],i=this._grpM.get(s).getLocalTopic(o,e);if(i){let t=!1;for(let e=0;e{this.onNewGroupTips(e)}),this._deleteCachedGroupTips(e)}_cacheAndCompare(e){var{groupID:e,event:t,item:s,groupType:o}=e,t=(ct.l(this._n+`._cacheAndCompare groupID:${e} groupType:`+o),this._cacheGroupTips(e,{event:t,dataList:[s]}),{groupID:e,type:o});o===me?this._grpM.hasLocalGroup(e)?this._notifyCachedGroupTips(e,o):this._grpM.setUnjoinedAVChatRoom(e):(this._grpM.updateGroupMap([t]),this._notifyCachedGroupTips(e,o)),this._checkCountMap.has(e)||this._checkCountMap.set(e,0)}reset(){this._cachedGroupTipsMap.clear(),this._checkCountMap.clear()}}class Mo{constructor(e){this._grpM=e,this._n=\"CommonGroupHandler\",this.tempConversationList=null,this._cachedGroupMessageMap=new Map,this._checkCountMap=new Map,this.MAX_CHECK_COUNT=4,this.PAGING_GRP_COUNT_LIMIT=200,this._pagingStatus=Js,this._pagingGetCostList=[],e.getIEmitInst().on(Bt.A2KEY_AND_TINYID_UPDATED,this.syncGroupList,this)}onCheckTimer(e){e%1==0&&0{var s=this._checkCountMap.get(t),o=this._grpM.hasLocalGroup(t);ct.l(this._n+`._check groupID:${t} hasLocalGroup:${o} checkCount:`+s),o?(this._notifyCachedGroupMessage(t),this._checkCountMap.delete(t),this._grpM.deleteUnjoinedAVChatRoom(t)):s>=this.MAX_CHECK_COUNT?(this._deleteCachedGroupMessage(t),this._checkCountMap.delete(t)):this._checkCountMap.set(t,++s)})}updateLastMsg(i){var e=this._n+\".updateLastMsg\";if(0===this._grpM.getGroupMap().size)this.tempConversationList=i;else{let t,s,o,r=!1;var n,a,u=i.length;for(let e=0;ee.sequence-t.sequence);var M=this._grpM.get(o),I=this._grpM.get(t);for(let r=0;r{const t=e.elements[\"revokedInfos\"],{revokerInfo:n,groupProfile:a}=e;let u=!1;a&&(u=ot({groupID:a.groupID})||!qe(a.topicID)),Ke(t)||t.forEach(e=>{var t=qe(e.topicID)?\"GROUP\"+e.groupID:\"GROUP\"+e.topicID,s=p.getLocalConversation(t),o=e.revokerInfo&&e.revokerInfo.revoker||n&&n.revoker,r=n&&n.reason||\"\";let i;if(s&&st(s.type))i={conversationID:t,sequence:e.sequence,ID:`${e.tinyID}-${e.clientTime}-`+e.random};else{const n=p.revoke(t,e.sequence,e.random);n?i=n:(i={conversationID:t,sequence:e.sequence},e.tinyID&&e.clientTime&&e.random&&(i.ID=`${e.tinyID}-${e.clientTime}-`+e.random),e.time&&(i.time=e.time))}i&&(i.revoker=o,i.revokeReason=r,i.revokerInfo={userID:o,nick:\"\",avatar:\"\"},(u?(i.revokerInfo.nick=a.nick,i.revokerInfo.avatar=a.avatar,l):h).push(i))})}),0===h.length&&0===l.length||(p.onMessageRevoked([...l,...h],t),0{this._grpM.emitOEvt(qt,e)}))}_groupListTreeShaking(s){const o=new Map([...this._grpM.getGroupMap()]);for(let e=0,t=s.length;e{o.delete(e)}),this._grpM.getGroupMap().forEach((e,t)=>{e.isSupportTopic&&o.delete(t)});var r=[...o.keys()];for(let e=0,t=r.length;e{var e=function(e){if(je(e)&&0!==e.length){let t=0;return e.forEach(e=>{t+=e}),(t/e.length).toFixed(0)}}(this._pagingGetCostList),t=function(e){if(je(e)&&0!==e.length){let t=0;return e.forEach(e=>{t+=e}),t.toFixed(0)}}(this._pagingGetCostList),t=(this._pagingGetCostList.length=0,this._pagingStatus=Ws,this._groupListTreeShaking(o),this._grpM.updateGroupMap(o),`count:${this._grpM.getLocalGroupList().length} sum:${t} avg:`+e);return ct.l(r+\" ok. \"+t),i.setMessage(t).end(),this.tempConversationList&&(this.updateLastMsg(this.tempConversationList),this.tempConversationList=null),this._grpM.emitGroupListUpdate(!0,!0),ht({groupList:this._grpM.getLocalGroupList()})}).catch(e=>(this._pagingStatus=zs,i.setError(e).end(),ct.e(r+\" failed. error:\",e),Kt(e)))}getGroupList(){const t=this._n+\".getGroupList\";var e;return ct.l(t+\" pagingStatus:\"+this._pagingStatus),this._pagingStatus===zs||this._pagingStatus===Js?this.syncGroupList().then(()=>{var e=this._grpM.getLocalGroupList();return ht({groupList:e,isSyncCompleted:this.isPagingGetCompleted()})}).catch(e=>(ct.e(t+\" failed. error:\",e),Kt(e))):(e=this._grpM.getLocalGroupList(),ct.l(t+\". returned group count:\"+e.length),jt({groupList:e,isSyncCompleted:this.isPagingGetCompleted()}))}isPagingGetCompleted(){return this._pagingStatus===Ws}_pagingGetGroupList(e){const o=this._n+\"._pagingGetGroupList\";let{isCommunityRelay:r=!1,limit:i,offset:n,groupBaseInfoFilter:a,groupList:u}=e;const p=Date.now();return this._grpM.req({P:ts,data:{type:r?de:void 0,memberAccount:this._grpM.getMyUserID(),limit:i,offset:n,responseFilter:{groupBaseInfoFilter:a,selfInfoFilter:[\"Role\",\"JoinTime\",\"MsgFlag\",\"MsgSeq\"]}}}).then(e=>{var{groups:e=[],totalCount:t}=e.data,e=(u.push(...e),this._handleGroupAtInfoWithoutTopic(r,e),n+i),s=!(e10018===e.code?(ct.w(this.logPrefix+\" response size exceeds the limit, request count:\"+i),i=50,this._pagingGetGroupList({limit:i,offset:n,groupBaseInfoFilter:a,groupList:u,isCommunityRelay:r})):r?(11e3===e.code&&ct.l(o+\" ok. community unavailable\"),jt({groupList:u})):Kt(e))}_pagingGetGroupListWithTopic(e){const o=this._n+\"._pagingGetGroupListWithTopic\";let{limit:r,offset:i,groupBaseInfoFilter:n,groupList:a}=e;const u=Date.now();return this._grpM.req({P:ts,data:{type:de,memberAccount:this._grpM.getMyUserID(),limit:r,offset:i,responseFilter:{groupBaseInfoFilter:n,selfInfoFilter:[...C]},isSupportTopic:1,needAppDefineData:1}}).then(e=>{var{groups:e=[],totalCount:t}=e.data,e=(a.push(...e),i+r),s=!(e!0===e.isSupportTopic);return ht({groupList:t})}).catch(e=>10018===e.code?(ct.w(this.logPrefix+\" response size exceeds the limit, request count:\"+r),r=50,this._pagingGetGroupListWithTopic({limit:r,offset:i,groupBaseInfoFilter:n,groupList:a})):Kt(e))}_cacheGroupMessage(e,t){this._cachedGroupMessageMap.has(e)||this._cachedGroupMessageMap.set(e,[]),this._cachedGroupMessageMap.get(e).push(t)}_deleteCachedGroupMessage(e){this._cachedGroupMessageMap.has(e)&&this._cachedGroupMessageMap.delete(e)}_notifyCachedGroupMessage(e,t){var s=this._cachedGroupMessageMap.get(e)||[];ct.l(this._n+`._notifyCachedGroupMessage groupID:${e} groupType:${t} count:`+s.length),s.forEach(e=>{this.onNewMessage(e)}),this._deleteCachedGroupMessage(e)}_cacheAndCompare(e){var{groupID:e,event:t,item:s,groupType:o}=e,t=(ct.l(this._n+`._cacheAndCompare groupID:${e} groupType:`+o),this._cacheGroupMessage(e,{event:t,dataList:[s]}),{groupID:e,type:o});o===me?this._grpM.hasLocalGroup(e)?this._notifyCachedGroupMessage(e,o):this._grpM.setUnjoinedAVChatRoom(e):(this._grpM.updateGroupMap([t]),this._notifyCachedGroupMessage(e,o)),this._checkCountMap.has(e)||this._checkCountMap.set(e,0)}_handleGroupAtInfoWithoutTopic(e,t){e&&0!==t.length&&t.forEach(e=>{const{groupID:t,groupAtInfoList:s}=e,r=[];Ke(s)||(s.forEach(e=>{r.push({...e,groupID:t})}),this._grpM.get(o).onNewGroupAtTips({dataList:r}))})}setPagingGroupCount(e){Ke(e)||(this.PAGING_GRP_COUNT_LIMIT=parseInt(e,10))}reset(){this.PAGING_GRP_COUNT_LIMIT=200,this._cachedGroupMessageMap.clear(),this._checkCountMap.clear(),this._pagingStatus=Js,this._pagingGetCostList=[]}}const Io=1,yo=2,Do=3,Lo=4,Co=5;class Go{constructor(e){this._grpM=e,this._n=\"GroupAttributesHandler\",this._groupAttributesMap=new Map,this._groupAttributesCopy={},this.CACHE_EXPIRE_TIME=3e4,this._grpM.getIEmitInst().on(Bt.CLOUD_CONFIG,this._onCloudConfig,this)}_onCloudConfig(){var e=this._grpM.getCloudConfig(\"grp_attr_cache_time\");Ke(e)||(this.CACHE_EXPIRE_TIME=Number(e))}updateLocalMainSequenceOnReconnected(){this._groupAttributesMap.forEach(e=>{e.localMainSequence=0})}isGroupAttributesUpdatedNotice(e){var{to:e,elements:{newGroupProfile:t}}=e,s=!Ke(t)&&!qe(t.groupAttributeOption);return s&&this._onGroupAttributesUpdated({groupID:e,groupAttributeOption:t.groupAttributeOption}),s}_onGroupAttributesUpdated(e){const{groupID:t,groupAttributeOption:s}=e,{mainSequence:o,isWithChangedAttributeInfo:r,groupAttributeList:i=[],operationType:n}=s;if(ct.l(this._n+\".onGroupAttributesUpdated. \"+`groupID:${t} isWithChangedAttributeInfo:${r} operationType:`+n),!Ke(n)){this._groupAttributesCopy=this._getCachedAttributes({groupID:t});e=this._getLocalGroupAttributes(t)[\"localMainSequence\"],e=o-e;if(0!=e)if(1===r&&1==e)this._refreshCachedGroupAttributes({groupID:t,remoteMainSequence:o,groupAttributeList:i,operationType:n}),this._emitGroupAttributesUpdated(t);else if(this._hasLocalGroupAttributes(t)){const e=this._getLocalGroupAttributes(t)[\"avChatRoomKey\"];this._getGroupAttributes({groupID:t,avChatRoomKey:e}).then(()=>{this._emitGroupAttributesUpdated(t)})}}}initGroupAttributesCache(e){var{groupID:e,avChatRoomKey:t}=e;this._groupAttributesMap.set(e,{lastUpdateTime:0,localMainSequence:0,remoteMainSequence:0,attributes:new Map,avChatRoomKey:t}),ct.l(this._n+`.initGroupAttributesCache groupID:${e} avChatRoomKey:`+t)}initGroupAttributes(e){const{groupID:s,groupAttributes:o}=e,{remoteMainSequence:t,avChatRoomKey:r}=this._getLocalGroupAttributes(s),i=new Zt(\"initGroupAttributes\");return i.setMessage(`groupID:${s} avChatRoomKey:${r} mainSequence:`+t),this._grpM.req({P:Ts,data:{groupID:s,avChatRoomKey:r,mainSequence:t,groupAttributeList:this._transformGroupAttributes(o)}}).then(e=>{ct.l(this._n+\".initGroupAttributes ok. groupID:\"+s);var{mainSequence:e,groupAttributeList:t}=e.data,t=[...t];return t.forEach(e=>{e.value=o[e.key]}),this._groupAttributesCopy=this._getCachedAttributes({groupID:s}),this._refreshCachedGroupAttributes({groupID:s,remoteMainSequence:e,groupAttributeList:t,operationType:Io}),this._emitGroupAttributesUpdated(s),i.end(),ht({groupAttributes:o})}).catch(e=>(i.setError(e).end(),Kt(e)))}setGroupAttributes(e){const s=this._n+\".setGroupAttributes\",{groupID:o,groupAttributes:r}=e,{remoteMainSequence:t,avChatRoomKey:i,attributes:n}=this._getLocalGroupAttributes(o),a=this._transformGroupAttributes(r),u=(a.forEach(e=>{var t=e[\"key\"];e.sequence=0,n.has(t)&&(e.sequence=n.get(t).sequence)}),new Zt(\"setGroupAttributes\"));return u.setMessage(`groupID:${o} groupAttributes:`+JSON.stringify(r)),ct.l(s+`. groupID:${o} mainSequence:`+t),this._grpM.req({P:Ss,data:{groupID:o,avChatRoomKey:i,mainSequence:t,groupAttributeList:a}}).then(e=>{ct.l(s+\" ok.\");var{mainSequence:e,groupAttributeList:t}=e.data,t=[...t];return t.forEach(e=>{e.value=r[e.key]}),this._groupAttributesCopy=this._getCachedAttributes({groupID:o}),this._refreshCachedGroupAttributes({groupID:o,remoteMainSequence:e,groupAttributeList:t,operationType:yo}),this._emitGroupAttributesUpdated(o),u.end(),ht({groupAttributes:r})}).catch(e=>(u.setError(e).end(),Kt(e)))}deleteGroupAttributes(e){const{groupID:t,keyList:s=[]}=e,{remoteMainSequence:o,avChatRoomKey:r,attributes:i}=this._getLocalGroupAttributes(t);let n=[...i.keys()],a=Ps,u=Do;const p={groupID:t,avChatRoomKey:r,mainSequence:o},l=[],h=(0{let t=0;i.has(e)&&(t=i.get(e).sequence,n.push(e)),l.push({key:e,sequence:t})}),p.groupAttributeList=l),new Zt(\"deleteGroupAttributes\"));return h.setMessage(`groupID:${t} mainSequence:${o} keyList:${s} proto:`+a),this._grpM.req({P:a,data:p}).then(e=>{ct.l(this._n+\".deleteGroupAttributes ok. groupID:\"+t);e=e.data.mainSequence;return this._groupAttributesCopy=this._getCachedAttributes({groupID:t}),this._refreshCachedGroupAttributes({groupID:t,remoteMainSequence:e,groupAttributeList:l,operationType:u}),this._emitGroupAttributesUpdated(t),h.end(),ht({keyList:n})}).catch(e=>(h.setError(e).end(),Kt(e)))}getGroupAttributes(t){const s=this._n+\".getGroupAttributes\",o=t[\"groupID\"],{avChatRoomKey:e,lastUpdateTime:r,localMainSequence:i,remoteMainSequence:n}=this._getLocalGroupAttributes(o),a=new Zt(\"getGroupAttributes\");if(a.setMessage(`groupID:${o} localMainSequence:${i} remoteMainSequence:${n} keyList:`+t.keyList),Date.now()-r>=this.CACHE_EXPIRE_TIME||i{a.setMoreMessage(\"get attributes from remote. count:\"+e.length).end(),ct.l(s+\" from remote. groupID:\"+o);e=this._getCachedAttributes(t);return ht({groupAttributes:e})}).catch(e=>(a.setError(e).end(),Kt(e)));a.setMoreMessage(\"get attributes from cache\").end(),ct.l(s+\" from cache. groupID:\"+o);var u=this._getCachedAttributes(t);return jt({groupAttributes:u})}_getGroupAttributes(o){let e=0;return Ke(o.avChatRoomKey)||(e=1),this._grpM.req({P:Rs,data:{...o,groupType:e}}).then(e=>{ct.l(this._n+\"._getGroupAttributes ok. groupID:\"+o.groupID);var{mainSequence:e,groupAttributeList:t}=e.data,s=[...t];return Ke(e)||this._refreshCachedGroupAttributes({groupID:o.groupID,remoteMainSequence:e,groupAttributeList:s,operationType:Co}),t}).catch(e=>Kt(e))}_refreshCachedGroupAttributes(e){var{groupID:t,remoteMainSequence:s,groupAttributeList:o,operationType:r}=e;if(this._hasLocalGroupAttributes(t)){const e=this._getLocalGroupAttributes(t),i=e[\"localMainSequence\"];if(r===Co||s-i==1)e.remoteMainSequence=s,e.localMainSequence=s,e.lastUpdateTime=Date.now(),this._updateCachedAttributes({groupAttributes:e,groupAttributeList:o,operationType:r});else{if(i===s)return;e.remoteMainSequence=s}this._groupAttributesMap.set(t,e);o=`operationType:${r} localMainSequence:${i} remoteMainSequence:`+s;ct.l(this._n+\"._refreshCachedGroupAttributes. \"+o)}}_getCachedAttributes(t){const{groupID:e,keyList:s=[]}=t,o={};if(this._hasLocalGroupAttributes(e)){const t=this._getLocalGroupAttributes(e)[\"attributes\"];if(0{t.has(e)&&(o[e]=t.get(e).value)});else for(const e of t.keys())o[e]=t.get(e).value}return o}_updateCachedAttributes(e){const{groupAttributes:o,groupAttributeList:t,operationType:s}=e;s!==Do?s!==Lo?(s===Io&&o.attributes.clear(),t.forEach(e=>{var{key:e,value:t,sequence:s}=e;o.attributes.set(e,{value:t,sequence:s})})):t.forEach(e=>{o.attributes.delete(e.key)}):o.attributes.clear()}_hasLocalGroupAttributes(e){return this._groupAttributesMap.has(e)}_getLocalGroupAttributes(e){return this._hasLocalGroupAttributes(e)||this.initGroupAttributesCache({groupID:e}),this._groupAttributesMap.get(e)}_transformGroupAttributes(t){const s=[];return Object.keys(t).forEach(e=>{s.push({key:e,value:t[e]})}),s}_emitGroupAttributesUpdated(e){var t=this._getCachedAttributes({groupID:e}),{updatedKeyList:s,deletedKeyList:o}=this._computeAttrChangedInfo(t);ct.l(`${this._n}._emitGroupAttributesUpdated update:${s.length}, delete:`+o.length),0===s.length&&0===o.length||this._grpM.emitOEvt(Ot,{groupID:e,groupAttributes:t,updatedKeyList:s,deletedKeyList:o})}_computeAttrChangedInfo(t){const s=[],o=[];return Object.keys(t).forEach(e=>{t[e]!==this._groupAttributesCopy[e]&&s.push(e)}),Object.keys(this._groupAttributesCopy).forEach(e=>{Ke(t[e])&&o.push(e)}),this._groupAttributesCopy={},{updatedKeyList:s,deletedKeyList:o}}deleteLocalGroupAttributes(e){this._hasLocalGroupAttributes(e)&&this._groupAttributesMap.delete(e)}reset(){this._groupAttributesMap.clear(),this._groupAttributesCopy={},this.CACHE_EXPIRE_TIME=3e4}}const bo=\"Set\",Ao=\"Increase\",To=\"Decrease\";class So{constructor(e){this._grpM=e,this._n=\"GroupCountersHandler\",this._groupCountersMap=new Map,this.EXPIRE_TIME=3e4,this._grpM.getIEmitInst().on(Bt.CLOUD_CONFIG,this._onCloudConfig,this)}_onCloudConfig(){var e=this._grpM.getCloudConfig(\"grp_counter_expire_time\");Ke(e)||(this.EXPIRE_TIME=Number(e))}isGroupCountersNotice(e){var{to:e,elements:{groupCounterInfo:t}}=e;let s=!1;return qe(t)||(this._onGroupCountersUpdated({groupID:e,groupCounterInfo:t}),s=!0),s}_onGroupCountersUpdated(e){const{groupID:o,groupCounterInfo:t}=e;t.forEach(e=>{var{type:e,groupCounterSeq:t,counterList:s=[]}=e;0!==e&&2!==e||(this._updateLocalGroupCounters({groupID:o,groupCounterSeq:t,counterList:s}),s.forEach(e=>{this._grpM.emitOEvt(Ft,{groupID:o,key:e.key,value:e.value})})),1===e&&this._deleteLocalGroupCounters({groupID:o,groupCounterSeq:t,counterList:s})}),ct.l(this._n+\"._onGroupCountersUpdated groupID:\"+o)}initGroupCountersCache(e){var{groupID:e,avChatRoomKey:t}=e;this._groupCountersMap.set(e,{lastUpdateTime:0,groupCounterSeq:0,counters:new Map,avChatRoomKey:t}),ct.l(this._n+`.initGroupCountersCache groupID:${e} avChatRoomKey:`+t)}setGroupCounters(e){if(!this._grpM.canIUse(I.GRP_COUNTER))return this._grpM.noUse(\"setGroupCounters\");const t=this._n+\".setGroupCounters\",{groupID:s,counters:o}=e,r=this._convertObjectToList(o),i=this._getLocalGroupCounters(s)[\"avChatRoomKey\"],n=`groupID:${s} count:`+r.length,a=new Zt(\"setGroupCounters\");return a.setMessage(n),ct.l(t+\". \"+n),this._updateGroupCounters({groupID:s,counterList:r,avChatRoomKey:i,mode:bo}).then(e=>(a.end(),ct.l(t+\" ok.\"),ht({counters:e}))).catch(e=>(a.setError(e).end(),ct.e(t+\" failed. error:\",e),Kt(e)))}increaseGroupCounter(e){var t=\"increaseGroupCounter\";if(!this._grpM.canIUse(I.GRP_COUNTER))return this._grpM.noUse(t);const s=this._n+\".\"+t,{groupID:o,key:r,value:i}=e,n=this._getLocalGroupCounters(o)[\"avChatRoomKey\"],a=`groupID:${o} key:${r} value:`+i,u=new Zt(t);return u.setMessage(a),ct.l(s+\". \"+a),this._updateGroupCounters({groupID:o,counterList:[{key:r,value:i}],avChatRoomKey:n,mode:Ao}).then(e=>(u.end(),ct.l(s+\" ok.\"),ht({counters:e}))).catch(e=>(u.setError(e).end(),ct.e(s+\" failed. error:\",e),Kt(e)))}decreaseGroupCounter(e){var t=\"decreaseGroupCounter\";if(!this._grpM.canIUse(I.GRP_COUNTER))return this._grpM.noUse(t);const s=this._n+\".\"+t,{groupID:o,key:r,value:i}=e,n=this._getLocalGroupCounters(o)[\"avChatRoomKey\"],a=`groupID:${o} key:${r} value:`+i,u=new Zt(t);return u.setMessage(a),ct.l(s+\". \"+a),this._updateGroupCounters({groupID:o,counterList:[{key:r,value:i}],avChatRoomKey:n,mode:To}).then(e=>(u.end(),ct.l(s+\" ok.\"),ht({counters:e}))).catch(e=>(u.setError(e).end(),ct.e(s+\" failed. error:\",e),Kt(e)))}getGroupCounters(e){if(!this._grpM.canIUse(I.GRP_COUNTER))return this._grpM.noUse(\"getGroupCounters\");const t=this._n+\".getGroupCounters\",{groupID:s,keyList:o=[]}=e,{avChatRoomKey:r,lastUpdateTime:i}=this._getLocalGroupCounters(s),n=new Zt(\"getGroupCounters\");if(n.setMessage(\"groupID:\"+s),Date.now()-i>=this.EXPIRE_TIME)return this._getRemoteGroupCounters({groupID:s,avChatRoomKey:r}).then(e=>{n.setMoreMessage(\"from remote. count:\"+e.length).end(),ct.l(t+\" from remote. groupID:\"+s);e=this._getLocalCounters(s,o);return ht({counters:e})}).catch(e=>(n.setError(e).end(),Kt(e)));n.setMoreMessage(\"from cache\").end(),ct.l(t+\" from cache. groupID:\"+s);e=this._getLocalCounters(s,o);return jt({counters:e})}_getRemoteGroupCounters(s){return this._grpM.req({P:Ns,data:{...s}}).then(e=>{var{counterList:e=[],groupCounterSeq:t}=e.data;return this._updateLocalGroupCounters({groupID:s.groupID,counterList:e,groupCounterSeq:t}),ct.l(this._n+\"._getRemoteGroupCounters ok. groupID:\"+s.groupID),e}).catch(e=>Kt(e))}_convertObjectToList(t){const s=[];return Object.keys(t).forEach(e=>{s.push({key:e,value:t[e]})}),s}_updateGroupCounters(e){const o=this._n+\"._updateGroupCounters\",{groupID:t,avChatRoomKey:s,mode:r}=e;return ct.l(o+`. groupID:${t} avChatRoomKey:${s} mode:`+r),this._grpM.req({P:Us,data:{...e}}).then(e=>{ct.l(o+\" ok.\");const{counterList:t=[]}=e.data,s={};return t.forEach(e=>{var{key:e,value:t}=e;s[e]=t}),s}).catch(e=>Kt(e))}_hasLocalGroupCounters(e){return this._groupCountersMap.has(e)}_getLocalGroupCounters(e){return this._hasLocalGroupCounters(e)||this.initGroupCountersCache({groupID:e}),this._groupCountersMap.get(e)}_updateLocalGroupCounters(s){var{groupID:e,counterList:t=[],groupCounterSeq:o}=s;if(this._hasLocalGroupCounters(e)){const{counters:s,avChatRoomKey:r,groupCounterSeq:i}=this._getLocalGroupCounters(e);0{var{key:e,value:t}=e;s.set(e,t)}),this._groupCountersMap.set(e,{lastUpdateTime:Date.now(),groupCounterSeq:o,counters:s,avChatRoomKey:r}))}}_deleteLocalGroupCounters(t){var{groupID:e,counterList:s=[],groupCounterSeq:o}=t;if(this._hasLocalGroupCounters(e)){const{counters:t,avChatRoomKey:r}=this._getLocalGroupCounters(e);s.forEach(e=>{t.delete(e.key)}),this._groupCountersMap.set(e,{lastUpdateTime:Date.now(),groupCounterSeq:o,counters:t,avChatRoomKey:r})}}_getLocalCounters(e,t){const s={};if(this._hasLocalGroupCounters(e)){const o=this._getLocalGroupCounters(e)[\"counters\"];if(0{o.has(e)&&(s[e]=o.get(e))});else for(const r of o.keys())s[r]=o.get(r)}return s}reset(){this._groupCountersMap.clear(),this.EXPIRE_TIME=3e4}}class vo{constructor(e){var{manager:e,groupID:t,onInit:s,onSuccess:o,onFail:r}=e;this._n=\"Polling\",this._manager=e,this._grpM=e._grpM,this._onInit=s,this._onSuccess=o,this._onFail=r,this._groupID=t,this._timeoutID=-1,this._isRunning=!1,this._proto=Ls}start(){var e=this._grpM.isLoggedIn();e||(this._proto=Cs),ct.l(`${this._n}.start pollingInterval:${this._manager.getPollingInterval()} isLoggedIn:`+e),this._isRunning=!0,this._request()}isRunning(){return this._isRunning}_request(){var e=this._onInit(this._groupID);this._grpM.req({P:this._proto,data:e}).then(e=>{this._onSuccess(this._groupID,e),this.isRunning()&&(clearTimeout(this._timeoutID),this._timeoutID=setTimeout(this._request.bind(this),this._manager.getPollingInterval()))}).catch(e=>{this._onFail(this._groupID,e),this.isRunning()&&(clearTimeout(this._timeoutID),this._timeoutID=setTimeout(this._request.bind(this),this._manager.MAX_POLLING_INTERVAL))})}stop(){ct.l(this._n+\".stop\"),0=this.MAX_LENGTH){const e=this.map.entries().next().value[0];this.map.delete(e)}this.map.set(e,1)}has(e){return this.map.has(e)}delete(e){this.has(e)&&this.map.delete(e)}reset(){this.map.clear()}}const Ro=[\"groupID\",\"name\",\"avatar\",\"type\",\"introduction\",\"notification\",\"ownerID\",\"selfInfo\",\"createTime\",\"infoSequence\",\"lastInfoTime\",\"lastMessage\",\"nextMessageSeq\",\"memberNum\",\"maxMemberNum\",\"memberList\",\"joinOption\",\"groupCustomField\",\"muteAllMembers\",\"isSupportTopic\",\"inviteOption\",\"_lastRevokedTime\"];class $o{constructor(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:\"\",userID:\"\",memberCustomField:void 0,readedSequence:0,excludedUnreadSequenceList:void 0},this.lastMessage={lastTime:\"\",lastSequence:\"\",fromAccount:\"\",messageForShow:\"\"},this.nextMessageSeq=\"\",this.memberNum=\"\",this.memberCount=\"\",this.maxMemberNum=\"\",this.maxMemberCount=\"\",this.joinOption=\"\",this.inviteOption=\"\",this.groupCustomField=[],this.muteAllMembers=!1,this.isSupportTopic=!1,this._lastRevokedTime=0,this._initGroup(e)}set memberNum(e){}set maxMemberNum(e){}get memberNum(){return this.memberCount}get maxMemberNum(){return this.maxMemberCount}_initGroup(e){for(const t in e)Ro.indexOf(t)<0||(\"selfInfo\"!==t?(\"memberNum\"===t&&(this.memberCount=e[t]),\"maxMemberNum\"===t&&(this.maxMemberCount=e[t]),\"isSupportTopic\"!==t?this[t]=e[t]:this.isSupportTopic=1===e[t]):this.updateSelfInfo(e[t]))}updateGroup(e){e.appid=void 0,e.grossTopicNextMsgSeq=void 0,e.selfInfo&&(e.selfInfo.grossTopicReadSeq=void 0);e=JSON.parse(JSON.stringify(e));e.lastMsgTime&&(this.lastMessage.lastTime=e.lastMsgTime),Ke(e.muteAllMembers)||(\"On\"===e.muteAllMembers?e.muteAllMembers=!0:e.muteAllMembers=!1),e.groupCustomField&&Qe(this.groupCustomField,e.groupCustomField),Ke(e.memberNum)||(this.memberCount=e.memberNum),Ke(e.maxMemberNum)||(this.maxMemberCount=e.maxMemberNum),Ke(e.isSupportTopic)||(this.isSupportTopic=xe(e.isSupportTopic)?1===e.isSupportTopic:e.isSupportTopic),We(this,e,[\"members\",\"errorCode\",\"lastMsgTime\",\"groupCustomField\",\"memberNum\",\"maxMemberNum\",\"isSupportTopic\"]),je(e.members)&&0{e.userID===this.selfInfo.userID&&We(this.selfInfo,e,[\"sequence\"])})}updateSelfInfo({nameCard:e,joinTime:t,role:s,messageRemindType:o,readedSequence:r,excludedUnreadSequenceList:i}){e={nameCard:e,joinTime:t,role:s,messageRemindType:o,readedSequence:r,excludedUnreadSequenceList:i};We(this.selfInfo,{...e},[],[\"\",null,void 0,0,NaN])}setSelfNameCard(e){this.selfInfo.nameCard=e}}const Eo={3:!0,4:!0,5:!0,6:!0,17:!0,20:!0,21:!0,100:!0};class wo{constructor(e){this._grpM=e,this._n=\"AVChatRoomHandler\",this._joinedGroupMap=new Map,this._pollingRequestInfoMap=new Map,this._pollingInstanceMap=new Map,this._seqSll=new Po(200),this._IDSll=new Po(100),this._reportMessageStackedCount=0,this._onlineMemberCountMap=new Map,this.DEFAULT_EXPIRE_TIME=60,this.DEFAULT_POLLING_INTERVAL=300,this.MAX_POLLING_INTERVAL=2e3,this._pollingInterval=this.DEFAULT_POLLING_INTERVAL,this.DEFAULT_POLLING_NO_MESSAGE_COUNT=20,this.DEFAULT_POLLING_INTERVAL_PLUS=2e3,this._pollingNoMessageCount=0,this._startBroadcastSeq=1,this._broadcastMessageIDMap=new Map,this.DEFAULT_POLLING_SIMPLIFIED_MSG=0}hasJoinedAVChatRoom(){let e=[];return 0<(e=0e.type===me):e).length}getJoinedLiveList(){let e=[];return e=0e.type===fe):e}checkJoinedAVChatRoomByID(e){return this._joinedGroupMap.has(e)}getJoinedAVChatRoom(){return 0this._startBroadcastSeq&&(this._startBroadcastSeq=n),je(r)&&0{e.to=e.groupID}),this.onMessage(r,e)):(this._pollingNoMessageCount+=1,this._pollingNoMessageCount===this.DEFAULT_POLLING_NO_MESSAGE_COUNT&&(this._pollingInterval=this.DEFAULT_POLLING_INTERVAL+this.DEFAULT_POLLING_INTERVAL_PLUS)),this._onBroadcastMessage(a))}_handleFailure(e,t){}onMessage(i,n){if(je(i)&&0!==i.length){let t=this._n+\".onMessage\";n&&(t+=\" groupID:\"+n),0!==this._pollingNoMessageCount&&(this._pollingNoMessageCount=0,this._pollingInterval=this.DEFAULT_POLLING_INTERVAL);var a=null,u=[],l=this._get(o),h=this._get(p),c=i.length,m=(1e.sequence-t.sequence),this._get(r).isUnlimitedAVChatRoom());let s=!1;if(ct.getLevel()<=0){const n=i.map(e=>e.sequence);ct.l(`${t} count:${n.length} sequenceList:`+n),n.length=0}for(let e=0;e{var{tinyID:e,clientTime:t,random:s,sequence:o}=e,e={conversationID:\"\"+ue+r,ID:e+`-${t}-`+s,revoker:i.revoker,revokeReason:i.reason||\"\",revokerInfo:{userID:i.revoker,nick:\"\",avatar:\"\"},sequence:o};n.push(e)}),0!==n.length&&this._get(o).updateRevokerInfo(n).then(e=>{this._grpM.emitOEvt(qt,e)})}isBroadcastOrNormal(e){return 3===e||17===e}isGroupTip(e){return 4===e||6===e}isGroupSystemNotice(e){return 5===e}restoreGroupTipElements(e={}){var{operatorInfo:t={},operatorID:s,userIDList:o=[],operationType:r}=e,{userID:r=s,avatar:t=\"\",nick:s=\"\"}=(xe(e.groupJoinType)||1!==r&&2!==r||(e.groupJoinType=2===r?0:1),t),r=(e.operatorInfo={userID:r,avatar:t,nick:s},o.map(e=>({userID:e})));return e.memberInfoList=e.memberInfoList||r,e}restoreMessageFromSimplified(s){const e=s[\"event\"];if(this.isBroadcastOrNormal(e)&&(s.cloudCustomData=s.cloudCustomData||\"\",s.elements=s.elements.map(e=>{var t;return e.type===te&&({content:t={}}=e,e.content={data:\"\",description:\"\",extension:\"\",...t}),e})),(this.isGroupTip(e)||this.isGroupSystemNotice(e))&&(s.from=s.from||\"@TIM#SYSTEM\"),this.isGroupTip(e)){s.elements=this.restoreGroupTipElements(s.elements);const{elements:e={}}=s,{operationType:t,operatorInfo:r={}}=e;if(1===t){const s=[{userID:r.userID}];e.memberInfoList=e.memberInfoList||s}}if(this.isGroupSystemNotice(e)){let{memberInfoList:e,operatorInfo:t={}}=s.elements;e=e||t,s.elements.memberInfoList={userID:s.elements.operatorID,avatar:\"\",nick:\"\",...e},s.elements={authentication:\"\",remarkInfo:\"\",messageKey:1e3*s.time,...s.elements};var o=Object.keys(s.elements).filter(e=>\"operatorInfo\"!==e).reduce((e,t)=>({...e,[t]:s.elements[t]}),{});s.elements=o}return s}_onGroupDismissed(e){ct.l(this._n+\"._onGroupDismissed groupID:\"+e),this._grpM.deleteLocalGroupAndConversation(e),this.reset(e)}_checkMessageStacked(e){var t=\"MessageStacked\",e=e.length;100<=e&&(this._grpM.warn(t,e),this._reportMessageStackedCount<5)&&(new Zt(t).setMessage(`count:${e} groupID:`+[...this._joinedGroupMap.keys()]).setLevel(\"warning\").end(),this._reportMessageStackedCount+=1)}_isMessageSentByCurrentInstance(e){return!!this._get(o).isMessageSentByCurrentInstance(e)}packMessage(e,t){e.currentUser=this._grpM.getMyUserID(),e.conversationType=5===t?le:ue,e.isSystemMessage=!!e.isSystemMessage;var s=new _o(e),e=this.packElements(e,t),t=this._grpM.getFileDownloadProxy(),o=this._grpM.getDowloadFileAuthKey(),r=this._get(n).getFileDNList();return s.setElement(e,t,o,r),s}packElements(e,t){return 4===t||6===t?(this._updateMemberCountByGroupTips(e),{type:Z,content:{...e.elements,groupProfile:e.groupProfile}}):5===t?{type:ee,content:{...e.elements,groupProfile:{...e.groupProfile,groupID:e.groupID}}}:e.elements}packConversationOption(t){var s=new Map;for(let e=0;e{var{longPollingKey:e,group:t}=o,s=t.groupID;return this._joinedGroupMap.set(s,t),this._grpM.updateGroupMap([t]),this._grpM.deleteUnjoinedAVChatRoom(s),this._grpM.emitGroupListUpdate(!0,!1),Ke(e)?jt({status:$e,group:t}):Promise.resolve()})}startRunLoop(r){return this.handleJoinResult(r).then(()=>{var{longPollingKey:e,group:t,startSeq:s=0}=r,o=t.groupID;return this._pollingRequestInfoMap.set(o,{key:e,startSeq:s}),this.start(o),this._grpM.isLoggedIn()?jt({status:$e,group:t}):jt({status:$e})})}_preCheck(e){if(!this._get(r).isUnlimitedAVChatRoom()&&this.hasJoinedAVChatRoom()&&e.type!==fe){var[e,t]=this._joinedGroupMap.entries().next().value;if(this._grpM.isLoggedIn()&&t.selfInfo.role!==Me&&t.ownerID!==this._grpM.getMyUserID())return this._grpM.quitGroup(e);this._grpM.deleteLocalGroupAndConversation(e),this.reset(e)}return Promise.resolve()}joinWithoutAuth(e){const s=e[\"groupID\"],r=this._n+\".joinWithoutAuth\",n=new Zt(\"joinWithoutAuth\");return this._grpM.req({P:as,data:e}).then(({data:{longPollingKey:e}})=>{if(n.setMessage(`groupID:${s} longPollingKey:`+e).end(!0),Ke(e))return Kt({code:Gt});ct.l(r+\" ok. groupID:\"+s),this._get(o).setCompleted(\"\"+ue+s);var t=new $o({groupID:s});return this.startRunLoop({group:t,longPollingKey:e}),ht({status:$e})}).catch(e=>(ct.e(r+` failed. groupID:${s} error:`,e),n.setError(e).setMessage(\"groupID:\"+s).end(!0),Kt(e))).finally(()=>{this._grpM.get(i).reportAtOnce()})}getGroupOnlineMemberCount(e){var t=this._onlineMemberCountMap.get(e)||{},s=Date.now();return qe(t)||s-t.lastSyncTime>1e3*t.expireTime&&1e4ht({memberCount:e.memberCount})).catch(e=>Kt(e))):jt({memberCount:t.memberCount})}_getGroupOnlineMemberCount(r){const i=this._n+\"._getGroupOnlineMemberCount\",t=new Zt(\"_getGroupOnlineMemberCount\");return this._grpM.requestOnlineCount(r).then(e=>{var t=this._onlineMemberCountMap.get(r)||{},{memberCount:e=0,expireTime:s=this.DEFAULT_EXPIRE_TIME}=e.data,o=(ct.l(i+` ok. groupID:${r} memberCount:${e} expireTime:`+s),Date.now());return qe(t)&&(t.lastReqTime=o),this._onlineMemberCountMap.set(r,Object.assign(t,{lastSyncTime:o,latestUpdateTime:o,memberCount:e,expireTime:s})),{memberCount:e}}).catch(e=>(ct.w(i+\" failed. error:\",e),t.setCode(e.code).setMessage(`groupID:${r} error:`+JSON.stringify(e)).end(),Promise.reject(e)))}_get(e){return this._grpM.get(e)}setPollingInterval(e){Ke(e)||(xe(e)?this._pollingInterval=this.DEFAULT_POLLING_INTERVAL=e:this._pollingInterval=this.DEFAULT_POLLING_INTERVAL=parseInt(e,10))}setPollingIntervalPlus(e){Ke(e)||(xe(e)?this.DEFAULT_POLLING_INTERVAL_PLUS=e:this.DEFAULT_POLLING_INTERVAL_PLUS=parseInt(e,10))}setPollingNoMessageCount(e){Ke(e)||(xe(e)?this.DEFAULT_POLLING_NO_MESSAGE_COUNT=e:this.DEFAULT_POLLING_NO_MESSAGE_COUNT=parseInt(e,10))}setPollingSimplifiedMessage(e){Ke(e)||\"0\"!==e&&\"1\"!==e||(this.DEFAULT_POLLING_SIMPLIFIED_MSG=parseInt(e,10))}getPollingInterval(){return this._pollingInterval}onAVChatRoomMemberBanned(e){e=e.payload.groupProfile.groupID;ct.l(this._n+\".onAVChatRoomMemberBanned groupID:\"+e),this._grpM.deleteLocalGroupAndConversation(e),this.reset(e)}restartPolling(){ct.l(this._n+\".restartPolling count:\"+this._pollingInstanceMap.size);for(const e of this._pollingInstanceMap.values())e.stop(),e.start()}getPollingTimerID(e){var t;return this._pollingInstanceMap.has(e)?(t=this._pollingInstanceMap.get(e).getPollingTimerID(),ct.l(this._n+`.getPollingTimerID groupID:${e} timerID:`+t),t):-1}hasPollingInstance(e){return this._pollingInstanceMap.has(e)}onRoomCustomData(e){var{groupID:e,sequence:t,time:s,elements:o}=e,o=o&&o.content;this._get(h).onRoomCustomDataReceived(o),ct.l(this._n+`.onRoomCustomData groupID:${e} sequence:${t} time:${s} data:`+o)}reset(e){if(e){ct.l(this._n+\".reset groupID:\"+e);var t=this._pollingInstanceMap.get(e);t&&t.stop(),this._pollingInstanceMap.delete(e),this._joinedGroupMap.delete(e),this._pollingRequestInfoMap.delete(e),this._onlineMemberCountMap.delete(e)}else{ct.l(this._n+\".reset all\");for(const e of this._pollingInstanceMap.values())e.stop();this._pollingInstanceMap.clear(),this._joinedGroupMap.clear(),this._pollingRequestInfoMap.clear(),this._onlineMemberCountMap.clear(),this._broadcastMessageIDMap.clear()}this._seqSll.reset(),this._IDSll.reset(),this._reportMessageStackedCount=0,this._pollingInterval=this.DEFAULT_POLLING_INTERVAL=300,this.DEFAULT_POLLING_NO_MESSAGE_COUNT=20,this.DEFAULT_POLLING_INTERVAL_PLUS=2e3,this._pollingNoMessageCount=0}}class Uo{constructor(e){this.userID=\"\",this.avatar=\"\",this.nick=\"\",this.role=\"\",this.joinTime=\"\",this.lastSendMsgTime=\"\",this.nameCard=\"\",this.muteUntil=0,this.memberCustomField=[],this.isOnline=!1,this.updateMember(e)}updateMember(e){Ke(e.onlineStatus)||(this.isOnline=\"Online\"===e.onlineStatus);var t=[null,void 0,\"\",0,NaN];e.memberCustomField&&Qe(this.memberCustomField,e.memberCustomField),We(this,e,[\"memberCustomField\",\"marks\",\"onlineStatus\"],t)}updateRole(e){[\"Owner\",\"Admin\",\"Member\"].indexOf(e)<0||(this.role=e)}updateMuteUntil(e){Ke(e)||(this.muteUntil=Math.floor((Date.now()+1e3*e)/1e3))}updateNameCard(e){Ke(e)||(this.nameCard=e)}updateMemberCustomField(e){e&&Qe(this.memberCustomField,e)}}class No{constructor(e){this._grpM=e,this._n=\"GroupMemberHandler\",this.groupMemberListMap=new Map,this.DEFAULT_MEMBER_INFO_FILTER=[\"Role\",\"JoinTime\",\"NameCard\",\"ShutUpUntil\",\"OnlineStatus\"],this._grpM.getIEmitInst().on(Bt.PROFILE_UPDATED,this._onProfileUpdated,this)}_onProfileUpdated({data:t}){for(let e=0;e{e.has(s.userID)&&e.get(s.userID).updateMember({nick:s.nick,avatar:s.avatar})})}}deleteGroupMemberList(e){this.groupMemberListMap.delete(e)}getGroupMemberList({groupID:r,role:e,offset:s=0,count:o=15,filter:i}){const n=this._n+\".getGroupMemberList\",a=this._grpM.hasLocalGroup(r);if(ct.l(n+` groupID:${r} role:${e} offset:${s} count:${o} hasLocalGroup:`+a),!a)return jt({memberList:[],offset:0});if(this._grpM.getLocalGroupProfile(r).type===me){if(this._grpM.canIUse(I.AV_MBR_LIST))return this._getAVChatRoomMemberList({groupID:r,offset:s,filter:i});this._grpM.warn(\"LiveOnlineMember\")}let u;e!==Ie&&e!==Me&&e!==ye||(u=e);const p=new Zt(\"getGroupMemberList\");let l=0;i={groupID:r,limit:100(Ke(o)||(l=qe(o)?0:o),je(e)&&0!==e.length?(this._grpM.hasLocalGroup(r)&&(this._grpM.getLocalGroupProfile(r).memberNum=s),h=this._updateLocalGroupMemberMap(r,e),this._grpM.get(t).getUserProfile({userIDList:e.map(e=>e.userID),tagList:[Re.NICK,Re.AVATAR]})):(l=0,Promise.resolve([])))).then(e=>{var e=e[\"data\"];return je(e)&&0!==e.length?(e=e.map(e=>({userID:e.userID,nick:e.nick,avatar:e.avatar})),this._updateLocalGroupMemberMap(r,e),h.length(p.setError(e).end(),ct.e(n+\" failed. error:\",e),Kt(e)))}_getAVChatRoomMemberList({groupID:s,offset:e,filter:t}){const o=this._n+\"._getAVChatRoomMemberList\",r=new Zt(\"_getAVChatRoomMemberList\");return r.setMessage(`groupID:${s} offset:${e} filter:`+t),this._grpM.req({P:ks,data:{groupID:s,offset:e,filter:t}}).then(e=>{var{memberList:e=[],offset:t=0}=e.data,e=(r.end(),ct.l(o+` ok. member count:${e.length}, next request timestamp:`+t),e.map(e=>({...e,onlineStatus:\"Online\"}))),e=this._updateLocalGroupMemberMap(s,e);return ht({memberList:e,offset:t})}).catch(e=>(r.setError(e).end(),ct.e(o+\" failed. error:\",e),Kt(e)))}getGroupMemberProfile(e){var s=\"getGroupMemberProfile\",o=this._n+\".\"+s;let r=\"groupID:\"+e.groupID;5{e=e.data.members;return je(e)&&0!==e.length?(this._updateLocalGroupMemberMap(i,e),this._grpM.get(t).getUserProfile({userIDList:e.map(({userID:e})=>e),tagList:[Re.NICK,Re.AVATAR]})):jt([])}).then(e=>{e=e.data.map(({userID:e,nick:t,avatar:s})=>({userID:e,nick:t,avatar:s})),this._updateLocalGroupMemberMap(i,e),e=n.filter(e=>this.hasLocalGroupMember(i,e)).map(e=>this.getLocalGroupMemberInfo(i,e));return u.end(),ht({memberList:e})})}addGroupMember(i){const n=this._n+\".addGroupMember\",e=i[\"groupID\"],a=this._grpM.getLocalGroupProfile(e),t=a[\"type\"],u=new Zt(\"addGroupMember\");if(u.setMessage(`groupID:${e} groupType:`+t),st(t)){const i=new gt({code:Ct});return u.setError(i).end(),Kt(i)}return i.userIDList=i.userIDList.map(e=>({userID:e})),ct.l(n+\" groupID:\"+e),this._grpM.req({P:Fs,data:i}).then(({data:{members:e}})=>{ct.l(n+\" ok\");var t=e.filter(e=>1===e.result).map(e=>e.userID),s=e.filter(e=>0===e.result).map(e=>e.userID),o=e.filter(e=>2===e.result).map(e=>e.userID),e=e.filter(e=>4===e.result).map(e=>e.userID),r=`groupID:${i.groupID}, successUserIDList:${t}, failureUserIDList:${s}, existedUserIDList:${o}, overLimitUserIDList:`+e;return u.setMoreMessage(r).end(),0===t.length?ht({successUserIDList:t,failureUserIDList:s,existedUserIDList:o,overLimitUserIDList:e}):(this._updateConvGroupProfile(a),ht({successUserIDList:t,failureUserIDList:s,existedUserIDList:o,overLimitUserIDList:e,group:a}))}).catch(e=>(u.setError(e).end(),ct.e(n+\" failed. error:\",e),Kt(e)))}deleteGroupMember(e){const t=this._n+\".deleteGroupMember\",{groupID:s,userIDList:o}=e,r=this._grpM.getLocalGroupProfile(s);if(Ke(r))return Kt({code:Mt});if(st(r.type))return this._grpM.canIUse(I.AV_BAN_MBR)?this._banAVChatRoomMember(e):this._grpM.noUse(\"deleteGroupMember\");var i=`groupID:${s} `+(5(n.end(),ct.l(t+\" ok\"),this._updateConvGroupProfile(r),this.deleteLocalGroupMembers(s,o),ht({group:r,userIDList:o}))).catch(e=>(n.setError(e).end(),ct.e(t+\" failed. error:\",e),Kt(e)))}_updateConvGroupProfile(e){this._grpM.get(o).updateConvGroupProfile([e])}_banAVChatRoomMember(e){const t=this._n+\"._banAVChatRoomMember\",{groupID:s,userIDList:o}=e,r=`groupID:${s} `+(5(i.end(),ct.l(t+\" ok\"),this.deleteLocalGroupMembers(s,o),ht({group:n,userIDList:o}))).catch(e=>(i.setError(e).end(),ct.e(t+\" failed. error:\",e),Kt(e)))}setGroupMemberMuteTime(e){const{groupID:s,userID:t,muteTime:o}=e,r=this._n+\".setGroupMemberMuteTime\";if(t===this._grpM.getMyUserID())return Kt({code:St});e=`groupID:${s} userID:${t} muteTime:`+o;ct.l(r+\" \"+e);const i=new Zt(\"setGroupMemberMuteTime\");return i.setMessage(e),this.modifyGroupMemberInfo({groupID:s,userID:t,muteTime:o}).then(e=>{i.end(),ct.l(r+\" ok\");var t=this._grpM.getLocalGroupProfile(s);return ht({group:t,member:e})}).catch(e=>(i.setError(e).end(),ct.e(r+\" failed. error:\",e),Kt(e)))}setGroupMemberRole(e){const t=this._n+\".setGroupMemberRole\",{groupID:s,userID:o,role:r}=e,i=`groupID:${s} userID:${o} role:`+r,n=this._grpM.getLocalGroupProfile(s);if(n&&n.selfInfo.role!==Me)return Kt({code:bt});e=[Ie,ye];if(ot({groupID:s})&&e.push(De),e.indexOf(r)<0)return Kt({code:At});if(o===this._grpM.getMyUserID())return Kt({code:Tt});const a=new Zt(\"setGroupMemberRole\");return a.setMessage(i),ct.l(t+\" \"+i),this.modifyGroupMemberInfo({groupID:s,userID:o,role:r}).then(e=>(a.end(),ct.l(t+\" ok\"),ht({group:n,member:e}))).catch(e=>(a.setError(e).end(),ct.e(t+\" failed. error:\",e),Kt(e)))}_filterProfanity(e,t){var s,o=this._grpM.get(c);return!o||({isAllowedToSend:o,modifiedText:s}=o.filterText(t[e],D),!0===o&&(t[e]=s,!0))}setGroupMemberNameCard(e){const t=\"setGroupMemberNameCard\",s=this._n+\".\"+t;if(e.nameCard&&!1===this._filterProfanity(\"nameCard\",e))return Kt({code:wt});const{groupID:o,userID:r=this._grpM.getMyUserID(),nameCard:i}=e,n=`groupID:${o} userID:${r} nameCard:`+i;ct.l(s+\" \"+n);e=this._grpM.getLocalGroupProfile(o);if(e&&st(e.type)){const e=Pt;return Kt({code:e,message:this._grpM.getErrMsg(e,t)})}const a=new Zt(t);return a.setMessage(n),this.modifyGroupMemberInfo({groupID:o,userID:r,nameCard:i}).then(e=>{ct.l(s+\" ok\"),a.end();var t=this._grpM.getLocalGroupProfile(o);return r===this._grpM.getMyUserID()&&t&&t.setSelfNameCard(i),ht({group:t,member:e})}).catch(e=>(a.setError(e).end(),ct.e(s+\" failed. error:\",e),Kt(e)))}setGroupMemberCustomField(e){const t=\"setGroupMemberCustomField\",s=this._n+\".\"+t,{groupID:o,userID:r=this._grpM.getMyUserID(),memberCustomField:i}=e,n=`groupID:${o} userID:${r} memberCustomField:`+JSON.stringify(i);ct.l(s+\" \"+n);e=this._grpM.getLocalGroupProfile(o);if(e&&st(e.type)){const e=Pt;return Kt({code:e,message:this._grpM.getErrMsg(e,t)})}const a=new Zt(t);return a.setMessage(n),this.modifyGroupMemberInfo({groupID:o,userID:r,memberCustomField:i}).then(e=>{a.end(),ct.l(s+\" ok\");var t=this._grpM.getLocalGroupProfile(o);return ht({group:t,member:e})}).catch(e=>(a.setError(e).end(),ct.e(s+\" failed. error:\",e),Kt(e)))}modifyGroupMemberInfo(t){let{groupID:s,userID:o}=t,e=void 0;return rt(s)&&(s=it(e=s)),this._grpM.req({P:Hs,data:{...t,groupID:s,topicID:e}}).then(()=>{if(this.hasLocalGroupMember(s,o)){const e=this.getLocalGroupMemberInfo(s,o);return Ke(t.muteTime)||e.updateMuteUntil(t.muteTime),Ke(t.role)||e.updateRole(t.role),Ke(t.nameCard)||e.updateNameCard(t.nameCard),Ke(t.memberCustomField)||e.updateMemberCustomField(t.memberCustomField),e}const e=this._grpM.getLocalGroupProfile(s);if(e&&!st(e.type))return this.getGroupMemberProfile({groupID:s,userIDList:[o]}).then(({data:{memberList:[e]}})=>e)})}markGroupMemberList(e){const r=this._n+\".markGroupMemberList\",{groupID:t,markType:s,enableMark:o,userIDList:i=[]}=e,n=`groupID:${t} markType:${s} enableMark:${o} userIDList count:`+i.length;ct.l(r+\" \"+n);let a=2;const u=[];!0===o&&(a=1);let p=[...i];500{u.push({userID:e,markType:[s]})}),p=null;const l=new Zt(\"markGroupMemberList\");return l.setMessage(n),this._grpM.req({P:js,data:{groupID:t,operationType:a,memberList:u}}).then(e=>{const{memberList:t=[]}=e.data,s=[],o=[];t.length===i.length?s.push(...i):(t.forEach(e=>{s.push(e.userID)}),i.forEach(e=>{s.includes(e)||o.push(e)}));e=`success count:${s.length} fail count:`+o.length;return l.setMessage(e).end(),ct.l(r+\" ok. \"+e),ht({successUserIDList:s,failureUserIDList:o})}).catch(e=>(l.setError(e).end(),ct.e(r+\" failed. error:\",e),Kt(e)))}_getGroupMemberProfileAdvance(e){return this._grpM.req({P:Os,data:{...e,memberInfoFilter:e.memberInfoFilter||this.DEFAULT_MEMBER_INFO_FILTER}})}_updateLocalGroupMemberMap(t,e){return je(e)&&0!==e.length?e.map(e=>(this.hasLocalGroupMember(t,e.userID)?this.getLocalGroupMemberInfo(t,e.userID).updateMember(e):this.setLocalGroupMember(t,new Uo(e)),this.getLocalGroupMemberInfo(t,e.userID))):[]}deleteLocalGroupMembers(e,t){const s=this.groupMemberListMap.get(e);s&&t.forEach(e=>{s.delete(e)})}getLocalGroupMemberInfo(e,t){return this.groupMemberListMap.has(e)?this.groupMemberListMap.get(e).get(t):null}setLocalGroupMember(e,t){this.groupMemberListMap.has(e)?this.groupMemberListMap.get(e).set(t.userID,t):(t=(new Map).set(t.userID,t),this.groupMemberListMap.set(e,t))}getLocalGroupMemberList(e){return this.groupMemberListMap.get(e)}hasLocalGroupMember(e,t){return this.groupMemberListMap.has(e)&&this.groupMemberListMap.get(e).has(t)}hasLocalGroupMemberMap(e){return this.groupMemberListMap.has(e)}reset(){this.groupMemberListMap.clear()}}function qo(e){var t=e.lastIndexOf(\".\");return-1===t?e:e.slice(0,t)}function ko(e){var{androidInfo:e={},androidOPPOChannelID:t=\"\"}=e,t=e.OPPOChannelID||t;return{...e,Sound:qo(e.sound||\"\"),OPPOChannelID:t,GoogleChannelID:e.FCMChannelID||\"\"}}function Oo(e){var{apnsInfo:e={},ignoreIOSBadge:t=!1,disableVoipPush:s}=e,t=!0===e.ignoreIOSBadge||!0===t?1:0;let o=void 0;return Ke(s)||(o=!1===s?1:0),Ke(e.disableVoipPush)||(o=!1===e.disableVoipPush?1:0),{...e,badgeMode:t,isVoipPush:o}}function Fo(e){if(He(e))return{pushFlag:!0===e.disablePush?1:0,title:e.title||\"\",desc:e.description||\"\",ext:e.extension||\"\",apnsInfo:Oo(e),androidInfo:ko(e)}}const xo=1,Vo=15,Ho=[17,18,20];class jo{constructor(e){this._grpM=e,this._n=\"GroupSystemNoticeHandler\",this.pendencyMap=new Map}onNewGroupSystemNotice(e){var{dataList:e,isSyncingEnded:t,isInstantMessage:s}=e,{eventDataList:e,result:r}=(ct.d(this._n+\".onReceiveSystemNotice count:\"+e.length),this._assembly({notifiesList:e,isInstantMessage:s}));0{e.forEach(e=>{this.pendencyMap.set(`${e.from}_${e.groupID}_`+e.to,e)});const t=this._grpM.get(o).getLocalMessageList(le),i=[];t.forEach(e=>{const{operatorID:t,operationType:s,groupProfile:o}=e.payload;if(s===xo){const s=`${t}_${o.groupID}_`+o.to,r=this.pendencyMap.get(s);r&&xe(r.handled)&&0!==r.handled&&i.push(e)}}),this.deleteGroupSystemNotice({messageList:i})})}deleteGroupSystemNotice(e){const s=this._n+\".deleteGroupSystemNotice\";return je(e.messageList)&&0!==e.messageList.length?(ct.l(s+\" \"+e.messageList.map(e=>e.ID)),this._grpM.req({P:Ds,data:{messageListToDelete:e.messageList.map(e=>({from:le,messageSeq:e.clientSequence,messageRandom:e.random}))}}).then(()=>{ct.l(s+\" ok\");const t=this._grpM.get(o);return e.messageList.forEach(e=>{t.deleteLocalMessage(e)}),ht()}).catch(e=>(ct.e(s+\" error:\",e),Kt(e)))):jt()}_getPendencyList(e={}){var{type:e,startTime:t=0,limit:s=20}=e;return this._grpM.req({P:ys,data:{type:e,startTime:t,limit:s,handleAccount:this._grpM.getMyUserID()}}).then(e=>{const t=e.data.pendencyList;return 0!==e.data.nextStartTime?this._getPendencyList({startTime:e.data.nextStartTime}).then(e=>[...t,...e]):t})}getGroupApplicationList(){return this._getPendencyList().then(t=>this._getPendencyList({type:de}).then(e=>(t.push(...e),this._handlePendencyResult(t))).catch(e=>this._handlePendencyResult(t)))}_handlePendencyResult(e){const t=[];return e.forEach(e=>{this.pendencyMap.set(`${e.from}_${e.groupID}_`+e.to,e),0===e.handled&&t.push({applicant:e.from,applicantNick:e.fromUserNickName,groupName:e.groupName,groupID:e.groupID,authentication:e.authentication,messageKey:e.time,applicationType:e.applicationType,userID:e.userID,note:e.note})}),jt({applicationList:t})}_onReceivedGroupSystemNotice({result:e,isInstantMessage:t}){t&&e.forEach(e=>{switch(e.payload.operationType){case 1:break;case 2:this._onApplyJoinGroup(e);break;case 3:break;case 4:this._onMemberKicked(e);break;case 5:this._onGroupDismissed(e);break;case 6:break;case 7:this._onInviteGroup(e);break;case 8:this._onQuitGroup(e);break;case 9:this._onSetManager(e);break;case 10:this._onDeleteManager(e);break;case 11:case 12:case 15:break;case 20:this._onMessageRemindTypeSynced(e);break;case 21:this._grpM.onAVChatRoomMemberBanned(e)}})}_onApplyJoinGroup(e){var{groupID:e,groupType:t}=e.payload.groupProfile,s=this._grpM.hasLocalGroup(e);ct.l(this._n+`._onApplyJoinGroup groupID:${e} groupType:${t} hasGroup:`+s),s||st(t)||this._grpM.getGroupProfile({groupID:e}).then(({data:{group:e}})=>{e&&(this._grpM.updateGroupMap([e]),e=!e.isSupportTopic,this._grpM.emitGroupListUpdate(!0,e))})}_onMemberKicked(e){e=e.payload.groupProfile.groupID;this._grpM.hasLocalGroup(e)&&this._grpM.deleteLocalGroupAndConversation(e)}_onGroupDismissed(e){var e=e.payload.groupProfile.groupID,t=(this._grpM.hasLocalGroup(e)&&this._grpM.deleteLocalGroupAndConversation(e),this._grpM)[\"_AVChatRoomHandler\"];t&&t.checkJoinedAVChatRoomByID(e)&&t.reset(e)}_onInviteGroup(e){const t=e.payload.groupProfile.groupID,s=this._grpM.hasLocalGroup(t);ct.l(`${this._n}._onInviteGroup groupID:${t} hasGroup:`+s),this._grpM.getGroupProfile({groupID:t}).then(()=>{this._grpM.emitGroupListUpdate(),this._grpM.get(o).pullMsgOnInvite(\"\"+ue+t)})}_onQuitGroup(e){var{groupID:e,groupType:t}=e.payload.groupProfile,s=this._grpM.hasLocalGroup(e);ct.l(this._n+`._onQuitGroup groupID:${e} groupType:${t} hasGroup:`+s),s&&this._grpM.deleteLocalGroupAndConversation(e)}_onSetManager(e){var{to:e,groupID:t}=e.payload.groupProfile,t=this._grpM.getGroupMemberHandler().getLocalGroupMemberInfo(t,e);t&&t.updateRole(Ie)}_onDeleteManager(e){var{to:e,groupID:t}=e.payload.groupProfile,t=this._grpM.getGroupMemberHandler().getLocalGroupMemberInfo(t,e);t&&t.updateRole(ye)}_onMessageRemindTypeSynced(e){var t=e.payload.groupProfile[\"groupID\"],e=e.payload.messageRemindType;this._grpM.get(o).onGroupMsgRemindTypeUpdated({groupID:t,messageRemindType:e})}_handleTopicSystemNotice(e){var{groupProfile:{groupID:e,topicID:t},elements:{operationType:o,topicIDList:r,messageRemindType:i}}=e,n=this._grpM.get(s);17===o?n.onTopicCreated({groupID:e,topicID:t}):18===o?n.onTopicDeleted({groupID:e,topicIDList:r}):20===o&&n.onMessageRemindTypeUpdated({groupID:e,topicID:t,messageRemindType:i})}reset(){this.pendencyMap.clear()}}class Ko extends class{constructor(e){this._m=e,this._n=\"\"}isLoggedIn(){return this._m.get(r).isLoggedIn()}isOversea(){return this._m.get(r).isOversea()}isPrivateNetWork(){var e=this._m.get(r);return e.isPrivateNetWork()&&!e.getFileDownloadProxy()}getFileDownloadProxy(){return this._m.get(r).getFileDownloadProxy()}getDowloadFileAuthKey(){return this._m.get(r).getDowloadFileAuthKey()}getMyUserID(){return this._m.get(r).getUserID()}getMyTinyID(){return this._m.get(r).getTinyID()}getSDKAppID(){return this._m.get(r).getSDKAppID()}isIntl(){return this._m.get(r).isIntl()}isUsingChatCore(){return this._m.get(r).isUsingChatCore()}isDevMode(){return this._m.get(r).isDevMode()}get(e){return this._m.get(e)}getPlatform(){return k}getCloudConfig(e){return this._m.get(u).getCloudConfig(e)}emitOEvt(e,t){this._m.getOEmitInst().emit(e,t)}emitIEvt(e,t){this._m.getIEmitInst().emit(e,t)}getIEmitInst(){return this._m.getIEmitInst()}req(e){return this._m.get(a).req(e)}canIUse(e){return this._m.get(l).canIUse(e)}getErrMsg(e,t,s){return this._m.getErrMsg(e,t,s)}warn(e,t,s){e=this.getErrMsg(e,t,s);e&&ct.w(e)}noUse(e){var t=Et;return Kt({code:t,message:this.getErrMsg(t,e)})}}{constructor(e){super(e),this._n=\"GroupModule\",this._commonGroupHandler=new Mo(this),this._groupAttributesHandler=new Go(this),this._groupCountersHandler=new So(this),this._AVChatRoomHandler=new wo(this),this._groupTipsHandler=new fo(this),this._groupSystemNoticeHandler=new jo(this),this._groupMemberHandler=new No(this),this.groupMap=new Map,this._unjoinedAVChatRoomList=new Map,this._receiptDetailCompleteMap=new Map,this._onlineMemberCountMap=new Map,this._timeoutIDs=[],this.getIEmitInst().on(Bt.CLOUD_CONFIG,this._onCloudConfig,this)}_onCloudConfig(){var e=this.getCloudConfig(\"polling_interval\"),t=this.getCloudConfig(\"polling_interval_plus\"),s=this.getCloudConfig(\"polling_no_msg_count\"),o=this.getCloudConfig(\"polling_simplified_msg\"),r=this.getCloudConfig(\"paging_grp_count\");ct.l(this._n+`._onCloudConfig pollingInterval:${e} pollingIntervalPlus:${t} pollingNoMessageCount:${s} pollingSimplifiedMessage:${o} pagingGroupCount:`+r),this._AVChatRoomHandler.setPollingInterval(e),this._AVChatRoomHandler.setPollingIntervalPlus(t),this._AVChatRoomHandler.setPollingNoMessageCount(s),this._AVChatRoomHandler.setPollingSimplifiedMessage(o),this._commonGroupHandler.setPagingGroupCount(r)}onCheckTimer(e){this.isLoggedIn()&&(this._commonGroupHandler.onCheckTimer(e),this._groupTipsHandler.onCheckTimer(e))}guardForAVChatRoom(t){if(t.conversationType!==ue)return jt();{const s=rt(t.to)?it(t.to):t.to;return this.hasLocalGroup(s)?jt():this.getGroupProfile({groupID:s}).then(e=>{e=e.data.group.type;if(ct.l(`${this._n}.guardForAVChatRoom. groupID:${s} type:`+e),e!==me)return jt();{const e=mt;return Kt(new gt({code:e,message:this.getErrMsg(e,t.from,s),data:{message:t}}))}})}}checkJoinedAVChatRoomByID(e){return this._AVChatRoomHandler.checkJoinedAVChatRoomByID(e)}onNewMessage(e){this._commonGroupHandler.onNewMessage(e)}updateNextMessageSeq(e){if(je(e)){const o=this.get(s);e.forEach(e=>{var t=e.conversationID.replace(ue,\"\");rt(t)&&o.updateUnreadCountAndLastMsg(t,e.lastMessage),this.groupMap.has(t)&&(this.groupMap.get(t).nextMessageSeq=e.lastMessage.sequence+1)})}}onNewGroupTips(e){this._groupTipsHandler.onNewGroupTips(e)}onMsgRevoked(e,t=!0){this._commonGroupHandler.onMsgRevoked(e,t)}onNewGroupSystemNotice(e){this._groupSystemNoticeHandler.onNewGroupSystemNotice(e)}onMsgReadNotice(e){e.dataList.forEach(i=>{var e=i.elements[\"groupMessageReadNotice\"];if(!Ke(e)){const i=this.get(o);e.forEach(e=>{var{groupID:e,topicID:t,lastMessageSeq:s}=e;ct.l(this._n+`.onMsgReadNotice groupID:${e} lastMessageSeq:`+s);let o=\"\"+ue+e,r=!0;qe(t)||(o=\"\"+ue+t,r=!1),i.updateIsReadAfterReadReport({conversationID:o,lastMessageSeq:s}),i.updateUnreadCount(o,r),i.clearGroupAtInfoList(o,r)})}})}onReadReceiptList(e){ct.l(this._n+\".onReadReceiptList options:\",e),e.dataList.forEach(e=>{var{groupProfile:e,elements:t}=e,e=e[\"groupID\"],t=t[\"readReceiptList\"];this.get(o).updateReadReceiptInfo({groupID:e,readReceiptList:t})})}onMsgModified(e){ct.l(this._n+\".onMsgModified options:\",e);const t=this.get(o);e.dataList.forEach(e=>{t.onMessageModified({...e,conversationType:ue,to:e.topicID||e.groupID})})}deleteGroupSystemNotice(e){this._groupSystemNoticeHandler.deleteGroupSystemNotice(e)}initGroupMap(e){this.groupMap.set(e.groupID,new $o(e))}clearGroupMap(){this.groupMap.clear()}deleteGroup(e){this.groupMap.delete(e)}updateGroupMap(e){const t=this.get(o);let s;e.forEach(e=>{s=e.groupID,this.groupMap.has(s)?this.groupMap.get(s).updateGroup(e):(this.groupMap.set(s,new $o(e)),t.deleteGroupRoamingInfo(s))});var r=this.getMyUserID();for(const[,o]of this.groupMap)o.selfInfo.userID=r,\"Owner\"===o.selfInfo.role&&(o.ownerID=r)}getGroupMap(){return this.groupMap}getLocalGroupList(){return[...this.groupMap.values()].filter(e=>e.type!==_e&&e.type!==fe)}getLocalGroupProfile(e){return this.groupMap.get(e)}sortLocalGroupList(){var e=[...this.groupMap].filter(([,e])=>!qe(e.lastMessage));e.sort((e,t)=>t[1].lastMessage.lastTime-e[1].lastMessage.lastTime),this.groupMap=new Map([...e])}updateGroupLastMessage(e){this._commonGroupHandler.updateLastMsg(e)}emitGroupListUpdate(e=!0,t=!0){var s=this.getLocalGroupList();if(e&&this.emitOEvt(kt),t){const e=JSON.parse(JSON.stringify(s));this.get(o).updateConvGroupProfile(e)}}getMyNameCardByGroupID(e){e=this.getLocalGroupProfile(e);return e?e.selfInfo.nameCard:\"\"}isPagingGetCompleted(){return this._commonGroupHandler.isPagingGetCompleted()}getMsgRemindType(e){return!je(e)||0===e.length||0===(e=e.filter(e=>!st(this.getLocalGroupProfile(e).type))).length?Promise.resolve():(ct.l(this._n+\".getMsgRemindType groupIDList:\"+e),this.getGroupProfileAdvance({groupIDList:e,responseFilter:{memberInfoFilter:[\"MsgFlag\"]}}).then(e=>{const t=e.data[\"successGroupList\"],s=this.get(o);t.forEach(e=>{s.onGroupMsgRemindTypeUpdated({groupID:e.groupID,messageRemindType:je(e.members)?e.members[0].messageRemindType:\"\"})})}))}getGroupList(){return this._commonGroupHandler.getGroupList()}syncCommunityWithTopic(){return this._commonGroupHandler.syncGroupList(!0)}getGroupProfile(t){const r=this._n+\".getGroupProfile\",i=new Zt(\"getGroupProfile\"),{groupID:n,groupCustomFieldFilter:e}=t;ct.l(r+\" groupID:\"+n);var s={groupIDList:[n],responseFilter:{groupBaseInfoFilter:[...L],groupCustomFieldFilter:e,memberInfoFilter:[...C,\"NameCard\"]}};return this.getGroupProfileAdvance(s).then(({data:{successGroupList:e,failureGroupList:t}})=>{if(ct.l(r+\" ok\"),0(i.setError(e).setMessage(\"groupID:\"+t.groupID).end(),ct.e(r+\" failed. error:\",e),Kt(e)))}getGroupProfileAdvance(e){const t=this._n+\".getGroupProfileAdvance\",s=e[\"groupIDList\"],o=(je(s)&&50{(ot({groupID:e})?r:o).push(e)});var i=[];if(0{const t=[],s=[];return e.forEach(e=>{t.push(...e.successGroupList),s.push(...e.failureGroupList)}),ht({successGroupList:t,failureGroupList:s})}).catch(e=>(ct.e(t+\" failed. error:\",e),Kt(e)))}_getGroupProfileAdvance(t){const{relayFlag:s=!1,...o}=t;return this.req({P:ss,data:o}).then(e=>{ct.l(this._n+\"._getGroupProfileAdvance ok. options:\",o);e=e.data.groups;return{successGroupList:e.filter(e=>Ke(e.errorCode)||0===e.errorCode),failureGroupList:e.filter(e=>e.errorCode&&0!==e.errorCode).map(e=>new gt({code:e.errorCode,message:e.errorInfo,data:{groupID:e.groupID}}))}}).catch(e=>s&&ot({groupID:t.groupIDList[0]})?{successGroupList:[],failureGroupList:[]}:Kt(e))}createGroup(u){const s=[he,ce,ge,me,de],o=this._n+\".createGroup\",{type:r,groupID:i}=u;if(u.name&&!1===this._filterProfanity(\"name\",u))return Kt({code:wt});if(u.introduction&&!1===this._filterProfanity(\"introduction\",u))return Kt({code:wt});if(u.notification&&!1===this._filterProfanity(\"notification\",u))return Kt({code:wt});if(!s.includes(r))return Kt({code:_t});if(!ot({type:r})){if(!qe(i)&&ot({groupID:i}))return Kt({code:ft});u.isSupportTopic=void 0}if(st(r)&&!Ke(u.memberList)&&0{const{groupID:i,overLimitUserIDList:n=[]}=r.data;l=i,h=n;r=`groupType:${u.type} groupID:${i} overLimitUserIDList:`+n;if(p.setMessage(r).end(),ct.l(o+\" ok. \"+r),u.type!==me&&(u.type!==de||1!==u.isSupportTopic)){qe(u.memberList)||qe(n)||(u.memberList=u.memberList.filter(e=>-1===n.indexOf(e.userID))),this.updateGroupMap([{...u,groupID:i}]);r=this.get(e);let s=\"\",o=0;u.type===de?(s=this.isIntl()?\"Create Community\":\"创建社群\",o=1):s=this.isIntl()?\"Create Group\":\"创建群组\";var a=this.get(t).getMyNick(),a=r.createCustomMessage({to:i,conversationType:ue,payload:{data:JSON.stringify({businessID:\"group_create\",content:s,cmd:o,opUser:a||this.getMyUserID(),version:4})}});r.sendMessageInstance(a),this.emitGroupListUpdate()}return this.getGroupProfile({groupID:i})}).then(e=>{var e=e.data[\"group\"],{nameCard:t,joinTime:s}=e.selfInfo;return e.updateSelfInfo({nameCard:t,joinTime:s,messageRemindType:Ae,role:Me}),ht({group:e,overLimitUserIDList:h})}).catch(e=>{var t;return p.setMessage(\"groupType:\"+u.type).setError(e).end(),10010===e.code||10007===e.code?(this._silentlyGetGroupProfile(e.code,l),this.updateGroupMap([{...u,groupID:l}]),(t=this.getLocalGroupProfile(l)).selfInfo.role=Me,ht({group:t,overLimitUserIDList:h})):(ct.e(o+\" failed. error:\",e),Kt(e))})}dismissGroup(e){const t=this._n+\".dismissGroup\",s=\"groupID:\"+e,o=new Zt(\"dismissGroup\");return o.setMessage(s),ct.l(t+\" \"+s),this.req({P:rs,data:{groupID:e}}).then(()=>(o.end(),ct.l(t+\" ok\"),this.deleteLocalGroupAndConversation(e),this.checkJoinedAVChatRoomByID(e)&&this._AVChatRoomHandler.reset(e),this._groupAttributesHandler.deleteLocalGroupAttributes(e),ht({groupID:e}))).catch(e=>(o.setError(e).end(),ct.e(t+\" failed. error:\",e),Kt(e)))}updateGroupProfile(e){const t=this._n+\".updateGroupProfile\";if(this.hasLocalGroup(e.groupID)){const s=this.getLocalGroupProfile(e.groupID).type;this._canIUseJoinOption(s)||Ke(e.joinOption)||(ct.w(t+\" joinOption is unavailable for Work/Meeting/AVChatRoom\"),e.joinOption=void 0)}if(Ke(e.muteAllMembers)||(e.muteAllMembers?e.muteAllMembers=\"On\":e.muteAllMembers=\"Off\"),e.name&&!1===this._filterProfanity(\"name\",e))return Kt({code:wt});if(e.introduction&&!1===this._filterProfanity(\"introduction\",e))return Kt({code:wt});if(e.notification&&!1===this._filterProfanity(\"notification\",e))return Kt({code:wt});const s=new Zt(\"updateGroupProfile\");return s.setMessage(JSON.stringify(e)),ct.l(t+\" groupID:\"+e.groupID),this.req({P:is,data:e}).then(()=>(s.end(),ct.l(t+\" ok\"),this.hasLocalGroup(e.groupID)&&this.groupMap.get(e.groupID).updateGroup(e),ht({group:this.groupMap.get(e.groupID)}))).catch(e=>(s.setError(e).end(),ct.l(t+\" failed. error:\",e),Kt(e)))}_filterProfanity(e,t){var s,o=this.get(c);return!o||({isAllowedToSend:o,modifiedText:s}=o.filterText(t[e],y),!0===o&&(t[e]=s,!0))}joinGroup(t){const s=t[\"groupID\"],o=this._n+\".joinGroup\";if(this.deleteUnjoinedAVChatRoom(s),this.hasLocalGroup(s)){if(!this.isLoggedIn())return jt({status:Te});const r=new Zt(\"applyJoinGroup\");return this.getGroupProfile({groupID:s}).then(()=>(r.setMessage(`groupID:${s} joinedStatus:`+Te).end(),jt({status:Te}))).catch(e=>(r.setMessage(`groupID:${s} unjoined`).end(),ct.w(o+` ${s} was unjoined, now join!`),this.groupMap.delete(s),this.applyJoinGroup(t)))}return ct.l(o+\" groupID:\"+s),this.isLoggedIn()?this.applyJoinGroup(t):this._AVChatRoomHandler.joinWithoutAuth(t)}applyJoinGroup(e){const a=this._n+\".applyJoinGroup\",{groupID:u,applyMessage:t}=e;if(!qe(t)&&!1===this._filterProfanity(\"applyMessage\",e))return Kt({code:wt});const p=new Zt(\"applyJoinGroup\"),s={...e},l=this.canIUse(I.AV_HISTORY_MSG);return l&&(s.historyMessageFlag=1),this.get(o).deleteTopicRoamingInfo(u),this.req({P:ns,data:s}).then(({data:{joinedStatus:e,longPollingKey:t,startSeq:s,avChatRoomFlag:o,avChatRoomKey:r,messageList:i}})=>{var n=`groupID:${u} joinedStatus:${e} longPollingKey:${t} startSeq:${s} avChatRoomFlag:${o} canGetAVChatRoomHistoryMsg:${l}, historyMsgCount:`+(qe(i)?0:i.length);switch(p.setMessage(n).end(),ct.l(a+\" ok. \"+n),e){case Ee:return ht({status:Ee});case $e:return this.getGroupProfile({groupID:u}).then(({data:{group:e}})=>this._handleJoinResult({group:e,avChatRoomFlag:o,longPollingKey:t,startSeq:s,avChatRoomKey:r,messageList:i})).catch(e=>{if(10010!==e.code&&10007!==e.code)return ct.e(a+\" failed. error:\",e),Kt(e);{this._silentlyGetGroupProfile(e.code,u);const a=new $o({groupID:u});return this.updateGroupMap([a]),this._handleJoinResult({group:a,avChatRoomFlag:o,longPollingKey:t,startSeq:s,avChatRoomKey:r,messageList:i})}});default:{const e=new gt({code:Lt});return ct.e(a+\" failed. error:\",e),Kt(e)}}}).catch(e=>(p.setMessage(\"groupID:\"+u).setError(e).end(),ct.e(a+\" failed. error:\",e),Kt(e)))}_handleJoinResult(e){const{group:t,avChatRoomFlag:s,longPollingKey:r,startSeq:i,avChatRoomKey:n,messageList:a}=e,u=t[\"groupID\"];return 1===s?(this.get(o).setCompleted(\"\"+ue+u),this._groupAttributesHandler.initGroupAttributesCache({groupID:u,avChatRoomKey:n}),this._groupCountersHandler.initGroupCountersCache({groupID:u,avChatRoomKey:n}),(e=Ke(r)?this._AVChatRoomHandler.handleJoinResult({group:t}):this._AVChatRoomHandler.startRunLoop({group:t,longPollingKey:r,startSeq:i})).then(()=>{this._onAVChatRoomHistoryMessage(a,u)}),e):(this.emitGroupListUpdate(!0,!1),ht({status:$e,group:t}))}quitGroup(e){const t=this._n+\".quitGroup\",s=\"groupID:\"+e,o=(ct.l(t+\" \"+s),this.checkJoinedAVChatRoomByID(e));if(!o&&!this.hasLocalGroup(e))return Kt({code:Dt});if(o&&!this.isLoggedIn())return ct.l(t+\" anonymously ok. \"+s),this.deleteLocalGroupAndConversation(e),this._AVChatRoomHandler.reset(e),jt({groupID:e});const r=new Zt(\"quitGroup\");return r.setMessage(s),this.req({P:us,data:{groupID:e}}).then(()=>(r.end(),ct.l(t+\" ok\"),this.deleteLocalGroupAndConversation(e),o&&this._AVChatRoomHandler.reset(e),this._groupAttributesHandler.deleteLocalGroupAttributes(e),ht({groupID:e}))).catch(e=>(r.setError(e).end(),ct.e(t+\" failed. error:\",e),Kt(e)))}searchGroupByID(e){const t=this._n+\".searchGroupByID\",s={groupIDList:[e]},o=new Zt(\"searchGroupByID\");return o.setMessage(\"groupID:\"+e),ct.l(t+\" groupID:\"+e),this.req({P:ps,data:s}).then(({data:{groupProfile:e}})=>{if(0!==e[0].errorCode)throw new gt({code:e[0].errorCode,message:e[0].errorInfo});return o.end(),ct.l(t+\" ok\"),ht({group:new $o(e[0])})}).catch(e=>(o.setError(e).end(),ct.w(t+\" failed. error:\",e),Kt(e)))}changeGroupOwner(o){const r=this._n+\".changeGroupOwner\";if(this.hasLocalGroup(o.groupID)&&this.getLocalGroupProfile(o.groupID).type===me)return Kt({code:It});if(o.newOwnerID===this.getMyUserID())return Kt({code:yt});const i=new Zt(\"changeGroupOwner\");return i.setMessage(`groupID:${o.groupID} newOwnerID:`+o.newOwnerID),ct.l(r+\" groupID:\"+o.groupID),this.req({P:ls,data:o}).then(()=>{i.end(),ct.l(r+\" ok\");var{groupID:e,newOwnerID:t}=o,s=(this.groupMap.get(e).ownerID=t,this._groupMemberHandler.getLocalGroupMemberList(e));if(s instanceof Map){const o=s.get(this.getMyUserID()),r=(Ke(o)||(o.updateRole(\"Member\"),this.groupMap.get(e).selfInfo.role=\"Member\"),s.get(t));Ke(r)||r.updateRole(\"Owner\")}return this.emitGroupListUpdate(!0,!1),ht({group:this.groupMap.get(e)})}).catch(e=>(i.setError(e).end(),ct.e(r+\" failed. error:\",e),Kt(e)))}getGroupApplicationList(){return this._groupSystemNoticeHandler.getGroupApplicationList()}handleGroupApplication(e){const t=this._n+\".handleGroupApplication\",{handleAction:s,handleMessage:o,message:r,application:i}=e;let n,a,u,p,l,h=(r?(n=r.payload.operatorID,a=r.payload.groupProfile.groupID,u=r.payload.authentication,p=r.payload.messageKey):i&&(n=i.applicant,a=i.groupID,u=i.authentication,p=i.messageKey),cs);i&&2===i.applicationType&&(h=hs,l=i.userID);const c=new Zt(\"handleGroupApplication\");return c.setMessage(\"groupID:\"+a),ct.l(t+\" groupID:\"+a),this.req({P:h,data:{handleAction:s,handleMessage:o,applicant:n,invitee:l,groupID:a,authentication:u,messageKey:p}}).then(()=>(c.end(),ct.l(t+\" ok\"),r&&this._groupSystemNoticeHandler.deleteGroupSystemNotice({messageList:[e.message]}),ht({group:this.getLocalGroupProfile(a)}))).catch(e=>(c.setError(e).end(),ct.e(t+\" failed. error\",e),Kt(e)))}handleGroupInvitation(e){const t=this._n+\".handleGroupInvitation\",{groupProfile:{groupID:s},authentication:o,messageKey:r,operatorID:i}=e.message.payload,n=e[\"handleAction\"],a=new Zt(\"handleGroupInvitation\");return a.setMessage(`groupID:${s} inviter:${i} handleAction:`+n),ct.l(t+` groupID:${s} inviter:${i} handleAction:`+n),this.req({P:gs,data:{...e,inviter:i,groupID:s,authentication:o,messageKey:r}}).then(()=>(a.end(),ct.l(t+\" ok\"),this._groupSystemNoticeHandler.deleteGroupSystemNotice({messageList:[e.message]}),ht({group:this.getLocalGroupProfile(s)}))).catch(e=>(a.setError(e).end(),ct.e(t+\" failed. error\",e),Kt(e)))}getGroupOnlineMemberCount(t){const s=this._n+\".getGroupOnlineMemberCount\",e=this._AVChatRoomHandler.checkJoinedAVChatRoomByID(t),o=this.hasLocalGroup(t);if(ct.l(s+` groupID:${t} isAVChatRoom:${e} has:`+o),e)return this._AVChatRoomHandler.getGroupOnlineMemberCount(t);if(!o)return jt({memberCount:0});var r=Date.now();if(this._onlineMemberCountMap.has(t)){const s=this._onlineMemberCountMap.get(t);if(r-s.lastReqTime<=6e4)return jt({memberCount:s.memberCount});s.lastReqTime=r}return this.requestOnlineCount(t).then(e=>{var{memberCount:e=0}=e.data;return this._onlineMemberCountMap.set(t,{lastReqTime:Date.now(),memberCount:e}),ct.l(s+` ok. groupID:${t} memberCount:`+e),jt({memberCount:e})}).catch(e=>(ct.w(s+\" failed. error:\",e),Promise.reject(e)))}requestOnlineCount(e){return this.req({P:Gs,data:{groupID:e}})}hasLocalGroup(e){return this.groupMap.has(e)}deleteLocalGroupAndConversation(e){const t=this.checkJoinedAVChatRoomByID(e);ct.l(this._n+`.deleteLocalGroupAndConversation groupID:${e} isJoinedAVChatRoom:`+t);var r=this.get(o),i=\"\"+ue+e;if(t&&(this.stopMessageLongPolling({groupID:e}),r.deleteLocalConv(i)),ot({groupID:e})){const t=this.getLocalGroupProfile(e);t&&!0===t.isSupportTopic&&this.get(s).deleteTopicListInCommunity(e)}r.clearUnreadCount(i),r.setCompleted(i),this._deleteLocalGroup(e),this._onlineMemberCountMap.delete(e),this.emitGroupListUpdate(!0,!1)}_deleteLocalGroup(e){this.groupMap.delete(e),this._groupMemberHandler.deleteGroupMemberList(e)}sendMessage(e,t){return je(e._receiverList)&&0(c=e,ct.l(u+` groupID:${l} startSequence:`+c),this.req({P:_s,data:{groupID:l,count:21,sequence:c,topicID:g}}))).then(e=>{var{messageList:t,complete:s,invisibleSequenceList:r=[]}=e.data;let{nextSequence:i=0}=e.data;Ke(t)?ct.l(u+` ok. complete:${s} nextSequence:${i} but messageList is undefined!`):ct.l(u+` ok. complete:${s} nextSequence:${i} count:`+t.length),h.setMessage(`groupID:${l} topicID:${g} startSequence:${c} complete:${s} nextSequence:`+i).end();e=this.get(o);let n=[];var a=[],t=(qe(t)||(n=e.onRoamingMessage(t,p,!0,a),e.updateIsRead(p),e.patchConvLastMessage(p)),2===s||i<1);return t&&(e.setCompleted(p),i=\"\"),ct.l(u+` isPullingCompleted:${t} nextReqID:${i} storedMsgCount:${n.length} invisibleSeqCount:`+r.length),{nextReqID:i+\"\",storedMessageList:n,assembledMessageList:a,isPullingCompleted:t}}).catch(e=>(h.setError(e).setMessage(`groupID:${l} topicID:${g} startSequence:`+c).end(),ct.w(u+\" failed. error:\",e),Kt(e)))}_getGroupIDOfMessage(e){return e.conversationID.replace(ue,\"\")}getReadReceiptList(s){const t=this._n+\".getReadReceiptList\",e=this._getGroupIDOfMessage(s[0]),o=this.getMyUserID(),r=s.filter(e=>e.from===o&&!0===e.needReadReceipt).map(e=>({sequence:e.sequence}));if(ct.l(t+` groupID:${e} sequenceList:`+JSON.stringify(r)),0===r.length)return jt({messageList:s});const i=new Zt(\"getReadReceiptList\");return i.setMessage(\"groupID:\"+e),this.req({P:fs,data:{groupID:e,sequenceList:r}}).then(e=>{i.end(),ct.l(t+\" ok\");e=e.data.readReceiptList;return je(e)&&e.forEach(t=>{s.forEach(e=>{0===t.code&&t.sequence===e.sequence&&(e.readReceiptInfo.readCount=t.readCount,e.readReceiptInfo.unreadCount=t.unreadCount)})}),ht({messageList:s})}).catch(e=>(i.setError(e).end(),ct.w(t+\" failed. error:\",e),Kt(e)))}sendReadReceipt(e){const t=this._n+\".sendReadReceipt\",s=this._getGroupIDOfMessage(e[0]),o=new Zt(\"sendReadReceipt\"),r=(o.setMessage(\"groupID:\"+s),this.getMyUserID()),i=e.filter(e=>e.from!==r&&!0===e.needReadReceipt).map(e=>({sequence:e.sequence}));return 0===i.length?Kt({code:dt}):(ct.l(t+\". sequenceList:\"+JSON.stringify(i)),this.req({P:Ms,data:{groupID:s,sequenceList:i}}).then(e=>(o.end(),ct.l(t+\" ok\"),ht())).catch(e=>(o.setError(e).end(),ct.w(t+\" failed. error:\",e),Kt(e))))}getReadReceiptDetail(e){const{message:t,filter:s,cursor:o,count:r}=e,i=this._getGroupIDOfMessage(t),n=t.ID,a=t.sequence,u=this._n+\".getReadReceiptDetail\",p=this._receiptDetailCompleteMap.get(n)||!1,l=0!==s&&1!==s?0:s,h=Ve(o)?o:\"\",c=!xe(r)||r<=0||100<=r?100:r,g=`groupID:${i} sequence:${a} cursor:${h} filter:${l} completeFlag:`+p,m=(ct.l(u+\" \"+g),{cursor:\"\",isCompleted:!1,messageID:n,unreadUserIDList:[],readUserIDList:[]}),d=new Zt(\"getReadReceiptDetail\");return d.setMessage(g),this.req({P:Is,data:{groupID:i,sequence:a,flag:l,cursor:h,count:c}}).then(e=>{d.end();var{cursor:e,isCompleted:t,unreadUserIDList:s,readUserIDList:o}=e.data;return m.cursor=e,1===t&&(m.isCompleted=!0,this._receiptDetailCompleteMap.set(n,!0)),0===l?m.readUserIDList=o.map(e=>e.userID):1===l&&(m.unreadUserIDList=s.map(e=>e.userID)),ct.l(u+\" ok\"),ht(m)}).catch(e=>(d.setError(e).end(),ct.w(u+\" failed. error:\",e),Kt(e)))}getRoamingMessagesHopping(p){const l=this._n+\".getRoamingMessagesHopping\";let{groupID:t,count:s,sequence:h,direction:c}=p,r=void 0;return Ke(h)&&1===c?jt({messageList:[],isCompleted:!0,nextMessageSeq:\"\"}):(rt(t)&&(t=it(r=t)),this._computeReqSeqHopping({groupID:t,topicID:r,sequence:h}).then(e=>{Ke(h)||1!==c||(e=h+s-1);const a=`${r?\"topicID:\"+r:\"groupID:\"+t} sequence:${h} reqSeq:${e} direction:`+c,u=(ct.l(l+\" \"+a),new Zt(\"getRoamingMessagesHopping\"));return this.req({P:_s,data:{groupID:t,topicID:r,count:s,sequence:e}}).then(e=>{var{messageList:e=[],complete:t,nextSequence:s=0,invisibleSequenceList:r=[]}=e.data,i=`complete:${t} nextSequence:${s} remoteMsgCount:${e.length} invisibleSequenceList:`+r,i=(u.setMessage(a+\" \"+i).end(),ct.l(l+\" ok. \"+i),\"\"+ue+p.groupID),n=this.get(o),i=n.onRoamingMessage(e,i,!1),e=this._computeResult({groupID:p.groupID,direction:c,sequence:h,remoteMessageList:e,processedMessageList:i,complete:t,nextSequence:s,invisibleSequenceList:r});return n.storeHoppingMessageList(e.messageList),ht(e)}).catch(e=>(u.setError(e).setMessage(`groupID:${t} sequence:${h} count:`+s).end(),ct.w(l+\" failed. error:\",e),Kt(e)))}))}_computeReqSeqHopping(e){const{groupID:s,topicID:t,sequence:o}=e;return 0{let t=0;return qe(e)||(t=e[0].nextMessageSeq-1),ct.l(`${this._n}._computeReqSeqHopping groupID:${s} lastSequence:${t} from remote`),t}).catch(e=>Kt(e)):Promise.resolve(0)}_computeResult(e){const t={messageList:[],isCompleted:!1,nextMessageSeq:\"\"},{groupID:s,direction:o,sequence:r,remoteMessageList:i=[],processedMessageList:n=[],complete:a,nextSequence:u,invisibleSequenceList:p}=e;if(0===o)return t.nextMessageSeq=u,(2===a||u<1)&&(t.isCompleted=!0,t.nextMessageSeq=\"\"),t.messageList=n,t;if(1===o){if(qe(i)){if(qe(p))return t.isCompleted=!0,t.nextMessageSeq=\"\",t;t.nextMessageSeq=p[0]+1}else{const e=i[0].sequence,s=p[0]||0;t.nextMessageSeq=e>s?e+1:s+1}return n.forEach(e=>{e.sequence>=r&&t.messageList.push(e)}),(ot({groupID:s})||rt(s))&&0===t.messageList.length&&i[0].sequence{a.end(),ct.l(n+\" ok\");var e=this.get(o);e.updateIsReadAfterReadReport({conversationID:r,lastMessageSeq:i});let t=!0;if(!Ke(p)){t=!1;const r=this.get(s).getLocalTopic(u,p);r&&r.updateSelfInfo({readedSequence:i})}return e.updateUnreadCount(r,t),ht()}).catch(e=>(a.setError(e).end(),ct.l(n+\" failed. error:\",e),Kt(e)))}_computeLastSequence(e){var{groupID:e,topicID:t,sequence:s}=e;return 0(qe(e)?ct.w(t+` ${n}, empty successGroupList`):(r=e[0].nextMessageSeq-1,i=n+`, ${r} from remote`,ct.l(t+\" \"+i)),s.setMessage(i).end(),r)).catch(e=>(s.setError(e).setMessage(n).end(),ct.w(t+\" failed. error:\",e),Kt(e)))}isMessageFromOrToAVChatroom(e){return this._AVChatRoomHandler.checkJoinedAVChatRoomByID(e)}hasJoinedAVChatRoom(){return this._AVChatRoomHandler.hasJoinedAVChatRoom()}getJoinedAVChatRoom(){return this._AVChatRoomHandler.getJoinedAVChatRoom()}getGroupRemoteLastSeq(e){e=this.getLocalGroupProfile(e);return e?e.nextMessageSeq-1:1}isOnlineMessage(e,t){return!(!this._canIUseOnlineOnlyFlag(e)||!t||!0!==t.onlineUserOnly)}_canIUseOnlineOnlyFlag(e){var t=this.getJoinedAVChatRoom();return!t||!t.includes(e.to)||e.conversationType!==ue}_onAVChatRoomHistoryMessage(e,t){if(!qe(e)){ct.l(this._n+`._onAVChatRoomHistoryMessage groupID:${t} count:`+e.length);const s=[];e.forEach(e=>{s.push({...e,isHistoryMessage:1})}),this.onAVChatRoomMessage(s,t)}}onAVChatRoomMessage(e,t=\"\"){this._AVChatRoomHandler.onMessage(e,t)}onAVChatRoomMemberBanned(e){this._AVChatRoomHandler.onAVChatRoomMemberBanned(e)}setUnjoinedAVChatRoom(e){this._unjoinedAVChatRoomList.set(e,1)}deleteUnjoinedAVChatRoom(e){this._unjoinedAVChatRoomList.has(e)&&this._unjoinedAVChatRoomList.delete(e)}isUnjoinedAVChatRoom(e){return this._unjoinedAVChatRoomList.has(e)}isGroupAttributesUpdatedNotice(e){return this._groupAttributesHandler.isGroupAttributesUpdatedNotice(e)}updateLocalMainSequenceOnReconnected(){this._groupAttributesHandler.updateLocalMainSequenceOnReconnected()}initGroupAttributes(e){return this._groupAttributesHandler.initGroupAttributes(e)}setGroupAttributes(e){return this._groupAttributesHandler.setGroupAttributes(e)}deleteGroupAttributes(e){return this._groupAttributesHandler.deleteGroupAttributes(e)}getGroupAttributes(e){return this._groupAttributesHandler.getGroupAttributes(e)}isMessageFromTopic(e,t){return 2===e&&!qe(t)}isMessageFromCommunityOfTopic(e,t){return 2===e&&qe(t)}getMessageExtensions(e,t){return ct.l(this._n+\".getMessageExtensions startSequence:\"+t),this.req({P:Es,data:{groupID:e.to,messageSequence:e.sequence,startSequence:t}})}modifyMsgExts(e,t,s=1){return ct.l(this._n+\".modifyMsgExts operateType:\"+s),this.req({P:$s,data:{groupID:e.to,messageSequence:e.sequence,extensionList:t,operateType:s}})}_genNotifyReqList(s){var o,r,i,n,a=[];for(let e=0,t=s.length;e{var t;return!!this.hasLocalGroup(e)&&({type:e,isSupportTopic:t}=this.getLocalGroupProfile(e),!st(e))&&!t});0!==s.length&&(ct.l(t+\" list:\"+s),this.req({P:ws,data:{notifyReqList:this._genNotifyReqList(s)}}).then(i=>{const e=i.data[\"notifyRspList\"],n=[];if(je(e)){const i={dataList:[]};let r=t+\" ok.\";e.forEach(e=>{var{nextRevokedTime:t,groupID:s,notifyList:o}=e;r+=` groupID:${s} nextRevokedTime:${t} count:${o.length}\n`,i.dataList.push({elements:{revokedInfos:this._genRevokedInfos(e)}}),0!==t?(this._setGroupLastRevokedTime(s,t),n.push(s)):this._setGroupLastRevokedTime(s,1e3*ve())}),ct.l(r),this.onMsgRevoked(i,!1)}0{ct.e(t+\" failed. error:\",e)}))}_genRevokedInfos(e){const{notifyList:t,groupID:s}=e,o=[];return je(t)&&t.forEach(e=>{o.push({groupID:s,sequence:e.sequence,random:e.random,revokerInfo:{...e.revokerInfo}})}),o}_getGroupLastRevokedTime(e){return this.hasLocalGroup(e)?this.getLocalGroupProfile(e)._lastRevokedTime:0}_setGroupLastRevokedTime(e,t){this.hasLocalGroup(e)&&(this.getLocalGroupProfile(e)._lastRevokedTime=t)}isGroupCountersNotice(e){return this._groupCountersHandler.isGroupCountersNotice(e)}setGroupCounters(e){return this._groupCountersHandler.setGroupCounters(e)}increaseGroupCounter(e){return this._groupCountersHandler.increaseGroupCounter(e)}decreaseGroupCounter(e){return this._groupCountersHandler.decreaseGroupCounter(e)}getGroupCounters(e){return this._groupCountersHandler.getGroupCounters(e)}getGroupMemberHandler(){return this._groupMemberHandler}getGroupMemberList(e){return this._groupMemberHandler.getGroupMemberList(e)}getGroupMemberProfile(e){return this._groupMemberHandler.getGroupMemberProfile(e)}addGroupMember(e){return this._groupMemberHandler.addGroupMember(e)}deleteGroupMember(e){return this._groupMemberHandler.deleteGroupMember(e)}setGroupMemberMuteTime(e){return this._groupMemberHandler.setGroupMemberMuteTime(e)}setGroupMemberRole(e){return this._groupMemberHandler.setGroupMemberRole(e)}setGroupMemberNameCard(e){return this._groupMemberHandler.setGroupMemberNameCard(e)}setGroupMemberCustomField(e){return this._groupMemberHandler.setGroupMemberCustomField(e)}markGroupMemberList(e){return this._groupMemberHandler.markGroupMemberList(e)}modifyGroupMemberInfo(e){return this._groupMemberHandler.modifyGroupMemberInfo(e)}restartPolling(){this._AVChatRoomHandler.restartPolling()}getPollingTimerID(e){var t;return e&&(t=this.getLocalGroupProfile(e))&&st(t.type)?this._AVChatRoomHandler.getPollingTimerID(e):-1}_canIUseJoinOption(e){return e===he||ot({type:e})}_silentlyGetGroupProfile(e,t){var s=setTimeout(this.getGroupProfile.bind(this,{groupID:t}),3e3);this._timeoutIDs.push(s),ct.l(this._n+`._silentlyGetGroupProfile errorCode:${e} groupID:${t} timeoutIDs:`+this._timeoutIDs)}_clearTimeoutIDs(){this._timeoutIDs.forEach(e=>{clearTimeout(e)}),this._timeoutIDs=[]}startMessageLongPolling(e){var{groupID:e,longPollingKey:t,longPollingSequence:s=1}=e,o=this.get(r).isUnlimitedAVChatRoom(),i=(this._AVChatRoomHandler.hasPollingInstance(e)&&this.stopMessageLongPolling({groupID:e}),this._AVChatRoomHandler.getJoinedLiveList()),o=(!o&&0>> 2] >>> 24 - i % 4 * 8 & 255; + thisWords[thisSigBytes + i >>> 2] |= thatByte << 24 - (thisSigBytes + i) % 4 * 8; + } + } else { + for (var j = 0; j < thatSigBytes; j += 4) { + thisWords[thisSigBytes + j >>> 2] = thatWords[j >>> 2]; + } + } + this.sigBytes += thatSigBytes; + return this; + }, + /** + * Removes insignificant bits. + * + * @example + * + * wordArray.clamp(); + */ + clamp: function() { + var words = this.words; + var sigBytes = this.sigBytes; + words[sigBytes >>> 2] &= 4294967295 << 32 - sigBytes % 4 * 8; + words.length = Math2.ceil(sigBytes / 4); + }, + /** + * Creates a copy of this word array. + * + * @return {WordArray} The clone. + * + * @example + * + * var clone = wordArray.clone(); + */ + clone: function() { + var clone = Base.clone.call(this); + clone.words = this.words.slice(0); + return clone; + }, + /** + * Creates a word array filled with random bytes. + * + * @param {number} nBytes The number of random bytes to generate. + * + * @return {WordArray} The random word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.lib.WordArray.random(16); + */ + random: function(nBytes) { + var words = []; + for (var i = 0; i < nBytes; i += 4) { + words.push(cryptoSecureRandomInt()); + } + return new WordArray.init(words, nBytes); + } + }); + var C_enc = C.enc = {}; + var Hex = C_enc.Hex = { + /** + * Converts a word array to a hex string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The hex string. + * + * @static + * + * @example + * + * var hexString = CryptoJS.enc.Hex.stringify(wordArray); + */ + stringify: function(wordArray) { + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + var hexChars = []; + for (var i = 0; i < sigBytes; i++) { + var bite = words[i >>> 2] >>> 24 - i % 4 * 8 & 255; + hexChars.push((bite >>> 4).toString(16)); + hexChars.push((bite & 15).toString(16)); + } + return hexChars.join(""); + }, + /** + * Converts a hex string to a word array. + * + * @param {string} hexStr The hex string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Hex.parse(hexString); + */ + parse: function(hexStr) { + var hexStrLength = hexStr.length; + var words = []; + for (var i = 0; i < hexStrLength; i += 2) { + words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << 24 - i % 8 * 4; + } + return new WordArray.init(words, hexStrLength / 2); + } + }; + var Latin1 = C_enc.Latin1 = { + /** + * Converts a word array to a Latin1 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The Latin1 string. + * + * @static + * + * @example + * + * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray); + */ + stringify: function(wordArray) { + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + var latin1Chars = []; + for (var i = 0; i < sigBytes; i++) { + var bite = words[i >>> 2] >>> 24 - i % 4 * 8 & 255; + latin1Chars.push(String.fromCharCode(bite)); + } + return latin1Chars.join(""); + }, + /** + * Converts a Latin1 string to a word array. + * + * @param {string} latin1Str The Latin1 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Latin1.parse(latin1String); + */ + parse: function(latin1Str) { + var latin1StrLength = latin1Str.length; + var words = []; + for (var i = 0; i < latin1StrLength; i++) { + words[i >>> 2] |= (latin1Str.charCodeAt(i) & 255) << 24 - i % 4 * 8; + } + return new WordArray.init(words, latin1StrLength); + } + }; + var Utf8 = C_enc.Utf8 = { + /** + * Converts a word array to a UTF-8 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The UTF-8 string. + * + * @static + * + * @example + * + * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray); + */ + stringify: function(wordArray) { + try { + return decodeURIComponent(escape(Latin1.stringify(wordArray))); + } catch (e) { + throw new Error("Malformed UTF-8 data"); + } + }, + /** + * Converts a UTF-8 string to a word array. + * + * @param {string} utf8Str The UTF-8 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Utf8.parse(utf8String); + */ + parse: function(utf8Str) { + return Latin1.parse(unescape(encodeURIComponent(utf8Str))); + } + }; + var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({ + /** + * Resets this block algorithm's data buffer to its initial state. + * + * @example + * + * bufferedBlockAlgorithm.reset(); + */ + reset: function() { + this._data = new WordArray.init(); + this._nDataBytes = 0; + }, + /** + * Adds new data to this block algorithm's buffer. + * + * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8. + * + * @example + * + * bufferedBlockAlgorithm._append('data'); + * bufferedBlockAlgorithm._append(wordArray); + */ + _append: function(data) { + if (typeof data == "string") { + data = Utf8.parse(data); + } + this._data.concat(data); + this._nDataBytes += data.sigBytes; + }, + /** + * Processes available data blocks. + * + * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype. + * + * @param {boolean} doFlush Whether all blocks and partial blocks should be processed. + * + * @return {WordArray} The processed data. + * + * @example + * + * var processedData = bufferedBlockAlgorithm._process(); + * var processedData = bufferedBlockAlgorithm._process(!!'flush'); + */ + _process: function(doFlush) { + var processedWords; + var data = this._data; + var dataWords = data.words; + var dataSigBytes = data.sigBytes; + var blockSize = this.blockSize; + var blockSizeBytes = blockSize * 4; + var nBlocksReady = dataSigBytes / blockSizeBytes; + if (doFlush) { + nBlocksReady = Math2.ceil(nBlocksReady); + } else { + nBlocksReady = Math2.max((nBlocksReady | 0) - this._minBufferSize, 0); + } + var nWordsReady = nBlocksReady * blockSize; + var nBytesReady = Math2.min(nWordsReady * 4, dataSigBytes); + if (nWordsReady) { + for (var offset = 0; offset < nWordsReady; offset += blockSize) { + this._doProcessBlock(dataWords, offset); + } + processedWords = dataWords.splice(0, nWordsReady); + data.sigBytes -= nBytesReady; + } + return new WordArray.init(processedWords, nBytesReady); + }, + /** + * Creates a copy of this object. + * + * @return {Object} The clone. + * + * @example + * + * var clone = bufferedBlockAlgorithm.clone(); + */ + clone: function() { + var clone = Base.clone.call(this); + clone._data = this._data.clone(); + return clone; + }, + _minBufferSize: 0 + }); + var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({ + /** + * Configuration options. + */ + cfg: Base.extend(), + /** + * Initializes a newly created hasher. + * + * @param {Object} cfg (Optional) The configuration options to use for this hash computation. + * + * @example + * + * var hasher = CryptoJS.algo.SHA256.create(); + */ + init: function(cfg) { + this.cfg = this.cfg.extend(cfg); + this.reset(); + }, + /** + * Resets this hasher to its initial state. + * + * @example + * + * hasher.reset(); + */ + reset: function() { + BufferedBlockAlgorithm.reset.call(this); + this._doReset(); + }, + /** + * Updates this hasher with a message. + * + * @param {WordArray|string} messageUpdate The message to append. + * + * @return {Hasher} This hasher. + * + * @example + * + * hasher.update('message'); + * hasher.update(wordArray); + */ + update: function(messageUpdate) { + this._append(messageUpdate); + this._process(); + return this; + }, + /** + * Finalizes the hash computation. + * Note that the finalize operation is effectively a destructive, read-once operation. + * + * @param {WordArray|string} messageUpdate (Optional) A final message update. + * + * @return {WordArray} The hash. + * + * @example + * + * var hash = hasher.finalize(); + * var hash = hasher.finalize('message'); + * var hash = hasher.finalize(wordArray); + */ + finalize: function(messageUpdate) { + if (messageUpdate) { + this._append(messageUpdate); + } + var hash = this._doFinalize(); + return hash; + }, + blockSize: 512 / 32, + /** + * Creates a shortcut function to a hasher's object interface. + * + * @param {Hasher} hasher The hasher to create a helper for. + * + * @return {Function} The shortcut function. + * + * @static + * + * @example + * + * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256); + */ + _createHelper: function(hasher) { + return function(message, cfg) { + return new hasher.init(cfg).finalize(message); + }; + }, + /** + * Creates a shortcut function to the HMAC's object interface. + * + * @param {Hasher} hasher The hasher to use in this HMAC helper. + * + * @return {Function} The shortcut function. + * + * @static + * + * @example + * + * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256); + */ + _createHmacHelper: function(hasher) { + return function(message, key) { + return new C_algo.HMAC.init(hasher, key).finalize(message); + }; + } + }); + var C_algo = C.algo = {}; + return C; + }(Math); + return CryptoJS; + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/x64-core.js +var require_x64_core = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/x64-core.js"(exports, module) { + (function(root, factory) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core()); + } else if (typeof define === "function" && define.amd) { + define(["./core"], factory); + } else { + factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + (function(undefined2) { + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var X32WordArray = C_lib.WordArray; + var C_x64 = C.x64 = {}; + var X64Word = C_x64.Word = Base.extend({ + /** + * Initializes a newly created 64-bit word. + * + * @param {number} high The high 32 bits. + * @param {number} low The low 32 bits. + * + * @example + * + * var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607); + */ + init: function(high, low) { + this.high = high; + this.low = low; + } + /** + * Bitwise NOTs this word. + * + * @return {X64Word} A new x64-Word object after negating. + * + * @example + * + * var negated = x64Word.not(); + */ + // not: function () { + // var high = ~this.high; + // var low = ~this.low; + // return X64Word.create(high, low); + // }, + /** + * Bitwise ANDs this word with the passed word. + * + * @param {X64Word} word The x64-Word to AND with this word. + * + * @return {X64Word} A new x64-Word object after ANDing. + * + * @example + * + * var anded = x64Word.and(anotherX64Word); + */ + // and: function (word) { + // var high = this.high & word.high; + // var low = this.low & word.low; + // return X64Word.create(high, low); + // }, + /** + * Bitwise ORs this word with the passed word. + * + * @param {X64Word} word The x64-Word to OR with this word. + * + * @return {X64Word} A new x64-Word object after ORing. + * + * @example + * + * var ored = x64Word.or(anotherX64Word); + */ + // or: function (word) { + // var high = this.high | word.high; + // var low = this.low | word.low; + // return X64Word.create(high, low); + // }, + /** + * Bitwise XORs this word with the passed word. + * + * @param {X64Word} word The x64-Word to XOR with this word. + * + * @return {X64Word} A new x64-Word object after XORing. + * + * @example + * + * var xored = x64Word.xor(anotherX64Word); + */ + // xor: function (word) { + // var high = this.high ^ word.high; + // var low = this.low ^ word.low; + // return X64Word.create(high, low); + // }, + /** + * Shifts this word n bits to the left. + * + * @param {number} n The number of bits to shift. + * + * @return {X64Word} A new x64-Word object after shifting. + * + * @example + * + * var shifted = x64Word.shiftL(25); + */ + // shiftL: function (n) { + // if (n < 32) { + // var high = (this.high << n) | (this.low >>> (32 - n)); + // var low = this.low << n; + // } else { + // var high = this.low << (n - 32); + // var low = 0; + // } + // return X64Word.create(high, low); + // }, + /** + * Shifts this word n bits to the right. + * + * @param {number} n The number of bits to shift. + * + * @return {X64Word} A new x64-Word object after shifting. + * + * @example + * + * var shifted = x64Word.shiftR(7); + */ + // shiftR: function (n) { + // if (n < 32) { + // var low = (this.low >>> n) | (this.high << (32 - n)); + // var high = this.high >>> n; + // } else { + // var low = this.high >>> (n - 32); + // var high = 0; + // } + // return X64Word.create(high, low); + // }, + /** + * Rotates this word n bits to the left. + * + * @param {number} n The number of bits to rotate. + * + * @return {X64Word} A new x64-Word object after rotating. + * + * @example + * + * var rotated = x64Word.rotL(25); + */ + // rotL: function (n) { + // return this.shiftL(n).or(this.shiftR(64 - n)); + // }, + /** + * Rotates this word n bits to the right. + * + * @param {number} n The number of bits to rotate. + * + * @return {X64Word} A new x64-Word object after rotating. + * + * @example + * + * var rotated = x64Word.rotR(7); + */ + // rotR: function (n) { + // return this.shiftR(n).or(this.shiftL(64 - n)); + // }, + /** + * Adds this word with the passed word. + * + * @param {X64Word} word The x64-Word to add with this word. + * + * @return {X64Word} A new x64-Word object after adding. + * + * @example + * + * var added = x64Word.add(anotherX64Word); + */ + // add: function (word) { + // var low = (this.low + word.low) | 0; + // var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0; + // var high = (this.high + word.high + carry) | 0; + // return X64Word.create(high, low); + // } + }); + var X64WordArray = C_x64.WordArray = Base.extend({ + /** + * Initializes a newly created word array. + * + * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects. + * @param {number} sigBytes (Optional) The number of significant bytes in the words. + * + * @example + * + * var wordArray = CryptoJS.x64.WordArray.create(); + * + * var wordArray = CryptoJS.x64.WordArray.create([ + * CryptoJS.x64.Word.create(0x00010203, 0x04050607), + * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) + * ]); + * + * var wordArray = CryptoJS.x64.WordArray.create([ + * CryptoJS.x64.Word.create(0x00010203, 0x04050607), + * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) + * ], 10); + */ + init: function(words, sigBytes) { + words = this.words = words || []; + if (sigBytes != undefined2) { + this.sigBytes = sigBytes; + } else { + this.sigBytes = words.length * 8; + } + }, + /** + * Converts this 64-bit word array to a 32-bit word array. + * + * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array. + * + * @example + * + * var x32WordArray = x64WordArray.toX32(); + */ + toX32: function() { + var x64Words = this.words; + var x64WordsLength = x64Words.length; + var x32Words = []; + for (var i = 0; i < x64WordsLength; i++) { + var x64Word = x64Words[i]; + x32Words.push(x64Word.high); + x32Words.push(x64Word.low); + } + return X32WordArray.create(x32Words, this.sigBytes); + }, + /** + * Creates a copy of this word array. + * + * @return {X64WordArray} The clone. + * + * @example + * + * var clone = x64WordArray.clone(); + */ + clone: function() { + var clone = Base.clone.call(this); + var words = clone.words = this.words.slice(0); + var wordsLength = words.length; + for (var i = 0; i < wordsLength; i++) { + words[i] = words[i].clone(); + } + return clone; + } + }); + })(); + return CryptoJS; + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/lib-typedarrays.js +var require_lib_typedarrays = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/lib-typedarrays.js"(exports, module) { + (function(root, factory) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core()); + } else if (typeof define === "function" && define.amd) { + define(["./core"], factory); + } else { + factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + (function() { + if (typeof ArrayBuffer != "function") { + return; + } + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var superInit = WordArray.init; + var subInit = WordArray.init = function(typedArray) { + if (typedArray instanceof ArrayBuffer) { + typedArray = new Uint8Array(typedArray); + } + if (typedArray instanceof Int8Array || typeof Uint8ClampedArray !== "undefined" && typedArray instanceof Uint8ClampedArray || typedArray instanceof Int16Array || typedArray instanceof Uint16Array || typedArray instanceof Int32Array || typedArray instanceof Uint32Array || typedArray instanceof Float32Array || typedArray instanceof Float64Array) { + typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength); + } + if (typedArray instanceof Uint8Array) { + var typedArrayByteLength = typedArray.byteLength; + var words = []; + for (var i = 0; i < typedArrayByteLength; i++) { + words[i >>> 2] |= typedArray[i] << 24 - i % 4 * 8; + } + superInit.call(this, words, typedArrayByteLength); + } else { + superInit.apply(this, arguments); + } + }; + subInit.prototype = WordArray; + })(); + return CryptoJS.lib.WordArray; + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/enc-utf16.js +var require_enc_utf16 = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/enc-utf16.js"(exports, module) { + (function(root, factory) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core()); + } else if (typeof define === "function" && define.amd) { + define(["./core"], factory); + } else { + factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + (function() { + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var C_enc = C.enc; + var Utf16BE = C_enc.Utf16 = C_enc.Utf16BE = { + /** + * Converts a word array to a UTF-16 BE string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The UTF-16 BE string. + * + * @static + * + * @example + * + * var utf16String = CryptoJS.enc.Utf16.stringify(wordArray); + */ + stringify: function(wordArray) { + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + var utf16Chars = []; + for (var i = 0; i < sigBytes; i += 2) { + var codePoint = words[i >>> 2] >>> 16 - i % 4 * 8 & 65535; + utf16Chars.push(String.fromCharCode(codePoint)); + } + return utf16Chars.join(""); + }, + /** + * Converts a UTF-16 BE string to a word array. + * + * @param {string} utf16Str The UTF-16 BE string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Utf16.parse(utf16String); + */ + parse: function(utf16Str) { + var utf16StrLength = utf16Str.length; + var words = []; + for (var i = 0; i < utf16StrLength; i++) { + words[i >>> 1] |= utf16Str.charCodeAt(i) << 16 - i % 2 * 16; + } + return WordArray.create(words, utf16StrLength * 2); + } + }; + C_enc.Utf16LE = { + /** + * Converts a word array to a UTF-16 LE string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The UTF-16 LE string. + * + * @static + * + * @example + * + * var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray); + */ + stringify: function(wordArray) { + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + var utf16Chars = []; + for (var i = 0; i < sigBytes; i += 2) { + var codePoint = swapEndian(words[i >>> 2] >>> 16 - i % 4 * 8 & 65535); + utf16Chars.push(String.fromCharCode(codePoint)); + } + return utf16Chars.join(""); + }, + /** + * Converts a UTF-16 LE string to a word array. + * + * @param {string} utf16Str The UTF-16 LE string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str); + */ + parse: function(utf16Str) { + var utf16StrLength = utf16Str.length; + var words = []; + for (var i = 0; i < utf16StrLength; i++) { + words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << 16 - i % 2 * 16); + } + return WordArray.create(words, utf16StrLength * 2); + } + }; + function swapEndian(word) { + return word << 8 & 4278255360 | word >>> 8 & 16711935; + } + })(); + return CryptoJS.enc.Utf16; + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/enc-base64.js +var require_enc_base64 = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/enc-base64.js"(exports, module) { + (function(root, factory) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core()); + } else if (typeof define === "function" && define.amd) { + define(["./core"], factory); + } else { + factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + (function() { + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var C_enc = C.enc; + var Base64 = C_enc.Base64 = { + /** + * Converts a word array to a Base64 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The Base64 string. + * + * @static + * + * @example + * + * var base64String = CryptoJS.enc.Base64.stringify(wordArray); + */ + stringify: function(wordArray) { + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + var map = this._map; + wordArray.clamp(); + var base64Chars = []; + for (var i = 0; i < sigBytes; i += 3) { + var byte1 = words[i >>> 2] >>> 24 - i % 4 * 8 & 255; + var byte2 = words[i + 1 >>> 2] >>> 24 - (i + 1) % 4 * 8 & 255; + var byte3 = words[i + 2 >>> 2] >>> 24 - (i + 2) % 4 * 8 & 255; + var triplet = byte1 << 16 | byte2 << 8 | byte3; + for (var j = 0; j < 4 && i + j * 0.75 < sigBytes; j++) { + base64Chars.push(map.charAt(triplet >>> 6 * (3 - j) & 63)); + } + } + var paddingChar = map.charAt(64); + if (paddingChar) { + while (base64Chars.length % 4) { + base64Chars.push(paddingChar); + } + } + return base64Chars.join(""); + }, + /** + * Converts a Base64 string to a word array. + * + * @param {string} base64Str The Base64 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Base64.parse(base64String); + */ + parse: function(base64Str) { + var base64StrLength = base64Str.length; + var map = this._map; + var reverseMap = this._reverseMap; + if (!reverseMap) { + reverseMap = this._reverseMap = []; + for (var j = 0; j < map.length; j++) { + reverseMap[map.charCodeAt(j)] = j; + } + } + var paddingChar = map.charAt(64); + if (paddingChar) { + var paddingIndex = base64Str.indexOf(paddingChar); + if (paddingIndex !== -1) { + base64StrLength = paddingIndex; + } + } + return parseLoop(base64Str, base64StrLength, reverseMap); + }, + _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" + }; + function parseLoop(base64Str, base64StrLength, reverseMap) { + var words = []; + var nBytes = 0; + for (var i = 0; i < base64StrLength; i++) { + if (i % 4) { + var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << i % 4 * 2; + var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> 6 - i % 4 * 2; + var bitsCombined = bits1 | bits2; + words[nBytes >>> 2] |= bitsCombined << 24 - nBytes % 4 * 8; + nBytes++; + } + } + return WordArray.create(words, nBytes); + } + })(); + return CryptoJS.enc.Base64; + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/enc-base64url.js +var require_enc_base64url = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/enc-base64url.js"(exports, module) { + (function(root, factory) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core()); + } else if (typeof define === "function" && define.amd) { + define(["./core"], factory); + } else { + factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + (function() { + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var C_enc = C.enc; + var Base64url = C_enc.Base64url = { + /** + * Converts a word array to a Base64url string. + * + * @param {WordArray} wordArray The word array. + * + * @param {boolean} urlSafe Whether to use url safe + * + * @return {string} The Base64url string. + * + * @static + * + * @example + * + * var base64String = CryptoJS.enc.Base64url.stringify(wordArray); + */ + stringify: function(wordArray, urlSafe) { + if (urlSafe === void 0) { + urlSafe = true; + } + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + var map = urlSafe ? this._safe_map : this._map; + wordArray.clamp(); + var base64Chars = []; + for (var i = 0; i < sigBytes; i += 3) { + var byte1 = words[i >>> 2] >>> 24 - i % 4 * 8 & 255; + var byte2 = words[i + 1 >>> 2] >>> 24 - (i + 1) % 4 * 8 & 255; + var byte3 = words[i + 2 >>> 2] >>> 24 - (i + 2) % 4 * 8 & 255; + var triplet = byte1 << 16 | byte2 << 8 | byte3; + for (var j = 0; j < 4 && i + j * 0.75 < sigBytes; j++) { + base64Chars.push(map.charAt(triplet >>> 6 * (3 - j) & 63)); + } + } + var paddingChar = map.charAt(64); + if (paddingChar) { + while (base64Chars.length % 4) { + base64Chars.push(paddingChar); + } + } + return base64Chars.join(""); + }, + /** + * Converts a Base64url string to a word array. + * + * @param {string} base64Str The Base64url string. + * + * @param {boolean} urlSafe Whether to use url safe + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Base64url.parse(base64String); + */ + parse: function(base64Str, urlSafe) { + if (urlSafe === void 0) { + urlSafe = true; + } + var base64StrLength = base64Str.length; + var map = urlSafe ? this._safe_map : this._map; + var reverseMap = this._reverseMap; + if (!reverseMap) { + reverseMap = this._reverseMap = []; + for (var j = 0; j < map.length; j++) { + reverseMap[map.charCodeAt(j)] = j; + } + } + var paddingChar = map.charAt(64); + if (paddingChar) { + var paddingIndex = base64Str.indexOf(paddingChar); + if (paddingIndex !== -1) { + base64StrLength = paddingIndex; + } + } + return parseLoop(base64Str, base64StrLength, reverseMap); + }, + _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", + _safe_map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_" + }; + function parseLoop(base64Str, base64StrLength, reverseMap) { + var words = []; + var nBytes = 0; + for (var i = 0; i < base64StrLength; i++) { + if (i % 4) { + var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << i % 4 * 2; + var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> 6 - i % 4 * 2; + var bitsCombined = bits1 | bits2; + words[nBytes >>> 2] |= bitsCombined << 24 - nBytes % 4 * 8; + nBytes++; + } + } + return WordArray.create(words, nBytes); + } + })(); + return CryptoJS.enc.Base64url; + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/md5.js +var require_md5 = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/md5.js"(exports, module) { + (function(root, factory) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core()); + } else if (typeof define === "function" && define.amd) { + define(["./core"], factory); + } else { + factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + (function(Math2) { + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + var T = []; + (function() { + for (var i = 0; i < 64; i++) { + T[i] = Math2.abs(Math2.sin(i + 1)) * 4294967296 | 0; + } + })(); + var MD5 = C_algo.MD5 = Hasher.extend({ + _doReset: function() { + this._hash = new WordArray.init([ + 1732584193, + 4023233417, + 2562383102, + 271733878 + ]); + }, + _doProcessBlock: function(M, offset) { + for (var i = 0; i < 16; i++) { + var offset_i = offset + i; + var M_offset_i = M[offset_i]; + M[offset_i] = (M_offset_i << 8 | M_offset_i >>> 24) & 16711935 | (M_offset_i << 24 | M_offset_i >>> 8) & 4278255360; + } + var H = this._hash.words; + var M_offset_0 = M[offset + 0]; + var M_offset_1 = M[offset + 1]; + var M_offset_2 = M[offset + 2]; + var M_offset_3 = M[offset + 3]; + var M_offset_4 = M[offset + 4]; + var M_offset_5 = M[offset + 5]; + var M_offset_6 = M[offset + 6]; + var M_offset_7 = M[offset + 7]; + var M_offset_8 = M[offset + 8]; + var M_offset_9 = M[offset + 9]; + var M_offset_10 = M[offset + 10]; + var M_offset_11 = M[offset + 11]; + var M_offset_12 = M[offset + 12]; + var M_offset_13 = M[offset + 13]; + var M_offset_14 = M[offset + 14]; + var M_offset_15 = M[offset + 15]; + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; + a = FF(a, b, c, d, M_offset_0, 7, T[0]); + d = FF(d, a, b, c, M_offset_1, 12, T[1]); + c = FF(c, d, a, b, M_offset_2, 17, T[2]); + b = FF(b, c, d, a, M_offset_3, 22, T[3]); + a = FF(a, b, c, d, M_offset_4, 7, T[4]); + d = FF(d, a, b, c, M_offset_5, 12, T[5]); + c = FF(c, d, a, b, M_offset_6, 17, T[6]); + b = FF(b, c, d, a, M_offset_7, 22, T[7]); + a = FF(a, b, c, d, M_offset_8, 7, T[8]); + d = FF(d, a, b, c, M_offset_9, 12, T[9]); + c = FF(c, d, a, b, M_offset_10, 17, T[10]); + b = FF(b, c, d, a, M_offset_11, 22, T[11]); + a = FF(a, b, c, d, M_offset_12, 7, T[12]); + d = FF(d, a, b, c, M_offset_13, 12, T[13]); + c = FF(c, d, a, b, M_offset_14, 17, T[14]); + b = FF(b, c, d, a, M_offset_15, 22, T[15]); + a = GG(a, b, c, d, M_offset_1, 5, T[16]); + d = GG(d, a, b, c, M_offset_6, 9, T[17]); + c = GG(c, d, a, b, M_offset_11, 14, T[18]); + b = GG(b, c, d, a, M_offset_0, 20, T[19]); + a = GG(a, b, c, d, M_offset_5, 5, T[20]); + d = GG(d, a, b, c, M_offset_10, 9, T[21]); + c = GG(c, d, a, b, M_offset_15, 14, T[22]); + b = GG(b, c, d, a, M_offset_4, 20, T[23]); + a = GG(a, b, c, d, M_offset_9, 5, T[24]); + d = GG(d, a, b, c, M_offset_14, 9, T[25]); + c = GG(c, d, a, b, M_offset_3, 14, T[26]); + b = GG(b, c, d, a, M_offset_8, 20, T[27]); + a = GG(a, b, c, d, M_offset_13, 5, T[28]); + d = GG(d, a, b, c, M_offset_2, 9, T[29]); + c = GG(c, d, a, b, M_offset_7, 14, T[30]); + b = GG(b, c, d, a, M_offset_12, 20, T[31]); + a = HH(a, b, c, d, M_offset_5, 4, T[32]); + d = HH(d, a, b, c, M_offset_8, 11, T[33]); + c = HH(c, d, a, b, M_offset_11, 16, T[34]); + b = HH(b, c, d, a, M_offset_14, 23, T[35]); + a = HH(a, b, c, d, M_offset_1, 4, T[36]); + d = HH(d, a, b, c, M_offset_4, 11, T[37]); + c = HH(c, d, a, b, M_offset_7, 16, T[38]); + b = HH(b, c, d, a, M_offset_10, 23, T[39]); + a = HH(a, b, c, d, M_offset_13, 4, T[40]); + d = HH(d, a, b, c, M_offset_0, 11, T[41]); + c = HH(c, d, a, b, M_offset_3, 16, T[42]); + b = HH(b, c, d, a, M_offset_6, 23, T[43]); + a = HH(a, b, c, d, M_offset_9, 4, T[44]); + d = HH(d, a, b, c, M_offset_12, 11, T[45]); + c = HH(c, d, a, b, M_offset_15, 16, T[46]); + b = HH(b, c, d, a, M_offset_2, 23, T[47]); + a = II(a, b, c, d, M_offset_0, 6, T[48]); + d = II(d, a, b, c, M_offset_7, 10, T[49]); + c = II(c, d, a, b, M_offset_14, 15, T[50]); + b = II(b, c, d, a, M_offset_5, 21, T[51]); + a = II(a, b, c, d, M_offset_12, 6, T[52]); + d = II(d, a, b, c, M_offset_3, 10, T[53]); + c = II(c, d, a, b, M_offset_10, 15, T[54]); + b = II(b, c, d, a, M_offset_1, 21, T[55]); + a = II(a, b, c, d, M_offset_8, 6, T[56]); + d = II(d, a, b, c, M_offset_15, 10, T[57]); + c = II(c, d, a, b, M_offset_6, 15, T[58]); + b = II(b, c, d, a, M_offset_13, 21, T[59]); + a = II(a, b, c, d, M_offset_4, 6, T[60]); + d = II(d, a, b, c, M_offset_11, 10, T[61]); + c = II(c, d, a, b, M_offset_2, 15, T[62]); + b = II(b, c, d, a, M_offset_9, 21, T[63]); + H[0] = H[0] + a | 0; + H[1] = H[1] + b | 0; + H[2] = H[2] + c | 0; + H[3] = H[3] + d | 0; + }, + _doFinalize: function() { + var data = this._data; + var dataWords = data.words; + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + dataWords[nBitsLeft >>> 5] |= 128 << 24 - nBitsLeft % 32; + var nBitsTotalH = Math2.floor(nBitsTotal / 4294967296); + var nBitsTotalL = nBitsTotal; + dataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = (nBitsTotalH << 8 | nBitsTotalH >>> 24) & 16711935 | (nBitsTotalH << 24 | nBitsTotalH >>> 8) & 4278255360; + dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = (nBitsTotalL << 8 | nBitsTotalL >>> 24) & 16711935 | (nBitsTotalL << 24 | nBitsTotalL >>> 8) & 4278255360; + data.sigBytes = (dataWords.length + 1) * 4; + this._process(); + var hash = this._hash; + var H = hash.words; + for (var i = 0; i < 4; i++) { + var H_i = H[i]; + H[i] = (H_i << 8 | H_i >>> 24) & 16711935 | (H_i << 24 | H_i >>> 8) & 4278255360; + } + return hash; + }, + clone: function() { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + return clone; + } + }); + function FF(a, b, c, d, x, s, t) { + var n = a + (b & c | ~b & d) + x + t; + return (n << s | n >>> 32 - s) + b; + } + function GG(a, b, c, d, x, s, t) { + var n = a + (b & d | c & ~d) + x + t; + return (n << s | n >>> 32 - s) + b; + } + function HH(a, b, c, d, x, s, t) { + var n = a + (b ^ c ^ d) + x + t; + return (n << s | n >>> 32 - s) + b; + } + function II(a, b, c, d, x, s, t) { + var n = a + (c ^ (b | ~d)) + x + t; + return (n << s | n >>> 32 - s) + b; + } + C.MD5 = Hasher._createHelper(MD5); + C.HmacMD5 = Hasher._createHmacHelper(MD5); + })(Math); + return CryptoJS.MD5; + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/sha1.js +var require_sha1 = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/sha1.js"(exports, module) { + (function(root, factory) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core()); + } else if (typeof define === "function" && define.amd) { + define(["./core"], factory); + } else { + factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + (function() { + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + var W = []; + var SHA1 = C_algo.SHA1 = Hasher.extend({ + _doReset: function() { + this._hash = new WordArray.init([ + 1732584193, + 4023233417, + 2562383102, + 271733878, + 3285377520 + ]); + }, + _doProcessBlock: function(M, offset) { + var H = this._hash.words; + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; + var e = H[4]; + for (var i = 0; i < 80; i++) { + if (i < 16) { + W[i] = M[offset + i] | 0; + } else { + var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]; + W[i] = n << 1 | n >>> 31; + } + var t = (a << 5 | a >>> 27) + e + W[i]; + if (i < 20) { + t += (b & c | ~b & d) + 1518500249; + } else if (i < 40) { + t += (b ^ c ^ d) + 1859775393; + } else if (i < 60) { + t += (b & c | b & d | c & d) - 1894007588; + } else { + t += (b ^ c ^ d) - 899497514; + } + e = d; + d = c; + c = b << 30 | b >>> 2; + b = a; + a = t; + } + H[0] = H[0] + a | 0; + H[1] = H[1] + b | 0; + H[2] = H[2] + c | 0; + H[3] = H[3] + d | 0; + H[4] = H[4] + e | 0; + }, + _doFinalize: function() { + var data = this._data; + var dataWords = data.words; + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + dataWords[nBitsLeft >>> 5] |= 128 << 24 - nBitsLeft % 32; + dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = Math.floor(nBitsTotal / 4294967296); + dataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = nBitsTotal; + data.sigBytes = dataWords.length * 4; + this._process(); + return this._hash; + }, + clone: function() { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + return clone; + } + }); + C.SHA1 = Hasher._createHelper(SHA1); + C.HmacSHA1 = Hasher._createHmacHelper(SHA1); + })(); + return CryptoJS.SHA1; + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/sha256.js +var require_sha256 = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/sha256.js"(exports, module) { + (function(root, factory) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core()); + } else if (typeof define === "function" && define.amd) { + define(["./core"], factory); + } else { + factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + (function(Math2) { + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + var H = []; + var K = []; + (function() { + function isPrime(n2) { + var sqrtN = Math2.sqrt(n2); + for (var factor = 2; factor <= sqrtN; factor++) { + if (!(n2 % factor)) { + return false; + } + } + return true; + } + function getFractionalBits(n2) { + return (n2 - (n2 | 0)) * 4294967296 | 0; + } + var n = 2; + var nPrime = 0; + while (nPrime < 64) { + if (isPrime(n)) { + if (nPrime < 8) { + H[nPrime] = getFractionalBits(Math2.pow(n, 1 / 2)); + } + K[nPrime] = getFractionalBits(Math2.pow(n, 1 / 3)); + nPrime++; + } + n++; + } + })(); + var W = []; + var SHA256 = C_algo.SHA256 = Hasher.extend({ + _doReset: function() { + this._hash = new WordArray.init(H.slice(0)); + }, + _doProcessBlock: function(M, offset) { + var H2 = this._hash.words; + var a = H2[0]; + var b = H2[1]; + var c = H2[2]; + var d = H2[3]; + var e = H2[4]; + var f = H2[5]; + var g = H2[6]; + var h = H2[7]; + for (var i = 0; i < 64; i++) { + if (i < 16) { + W[i] = M[offset + i] | 0; + } else { + var gamma0x = W[i - 15]; + var gamma0 = (gamma0x << 25 | gamma0x >>> 7) ^ (gamma0x << 14 | gamma0x >>> 18) ^ gamma0x >>> 3; + var gamma1x = W[i - 2]; + var gamma1 = (gamma1x << 15 | gamma1x >>> 17) ^ (gamma1x << 13 | gamma1x >>> 19) ^ gamma1x >>> 10; + W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]; + } + var ch = e & f ^ ~e & g; + var maj = a & b ^ a & c ^ b & c; + var sigma0 = (a << 30 | a >>> 2) ^ (a << 19 | a >>> 13) ^ (a << 10 | a >>> 22); + var sigma1 = (e << 26 | e >>> 6) ^ (e << 21 | e >>> 11) ^ (e << 7 | e >>> 25); + var t1 = h + sigma1 + ch + K[i] + W[i]; + var t2 = sigma0 + maj; + h = g; + g = f; + f = e; + e = d + t1 | 0; + d = c; + c = b; + b = a; + a = t1 + t2 | 0; + } + H2[0] = H2[0] + a | 0; + H2[1] = H2[1] + b | 0; + H2[2] = H2[2] + c | 0; + H2[3] = H2[3] + d | 0; + H2[4] = H2[4] + e | 0; + H2[5] = H2[5] + f | 0; + H2[6] = H2[6] + g | 0; + H2[7] = H2[7] + h | 0; + }, + _doFinalize: function() { + var data = this._data; + var dataWords = data.words; + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + dataWords[nBitsLeft >>> 5] |= 128 << 24 - nBitsLeft % 32; + dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = Math2.floor(nBitsTotal / 4294967296); + dataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = nBitsTotal; + data.sigBytes = dataWords.length * 4; + this._process(); + return this._hash; + }, + clone: function() { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + return clone; + } + }); + C.SHA256 = Hasher._createHelper(SHA256); + C.HmacSHA256 = Hasher._createHmacHelper(SHA256); + })(Math); + return CryptoJS.SHA256; + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/sha224.js +var require_sha224 = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/sha224.js"(exports, module) { + (function(root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core(), require_sha256()); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./sha256"], factory); + } else { + factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + (function() { + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var C_algo = C.algo; + var SHA256 = C_algo.SHA256; + var SHA224 = C_algo.SHA224 = SHA256.extend({ + _doReset: function() { + this._hash = new WordArray.init([ + 3238371032, + 914150663, + 812702999, + 4144912697, + 4290775857, + 1750603025, + 1694076839, + 3204075428 + ]); + }, + _doFinalize: function() { + var hash = SHA256._doFinalize.call(this); + hash.sigBytes -= 4; + return hash; + } + }); + C.SHA224 = SHA256._createHelper(SHA224); + C.HmacSHA224 = SHA256._createHmacHelper(SHA224); + })(); + return CryptoJS.SHA224; + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/sha512.js +var require_sha512 = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/sha512.js"(exports, module) { + (function(root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core(), require_x64_core()); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./x64-core"], factory); + } else { + factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + (function() { + var C = CryptoJS; + var C_lib = C.lib; + var Hasher = C_lib.Hasher; + var C_x64 = C.x64; + var X64Word = C_x64.Word; + var X64WordArray = C_x64.WordArray; + var C_algo = C.algo; + function X64Word_create() { + return X64Word.create.apply(X64Word, arguments); + } + var K = [ + X64Word_create(1116352408, 3609767458), + X64Word_create(1899447441, 602891725), + X64Word_create(3049323471, 3964484399), + X64Word_create(3921009573, 2173295548), + X64Word_create(961987163, 4081628472), + X64Word_create(1508970993, 3053834265), + X64Word_create(2453635748, 2937671579), + X64Word_create(2870763221, 3664609560), + X64Word_create(3624381080, 2734883394), + X64Word_create(310598401, 1164996542), + X64Word_create(607225278, 1323610764), + X64Word_create(1426881987, 3590304994), + X64Word_create(1925078388, 4068182383), + X64Word_create(2162078206, 991336113), + X64Word_create(2614888103, 633803317), + X64Word_create(3248222580, 3479774868), + X64Word_create(3835390401, 2666613458), + X64Word_create(4022224774, 944711139), + X64Word_create(264347078, 2341262773), + X64Word_create(604807628, 2007800933), + X64Word_create(770255983, 1495990901), + X64Word_create(1249150122, 1856431235), + X64Word_create(1555081692, 3175218132), + X64Word_create(1996064986, 2198950837), + X64Word_create(2554220882, 3999719339), + X64Word_create(2821834349, 766784016), + X64Word_create(2952996808, 2566594879), + X64Word_create(3210313671, 3203337956), + X64Word_create(3336571891, 1034457026), + X64Word_create(3584528711, 2466948901), + X64Word_create(113926993, 3758326383), + X64Word_create(338241895, 168717936), + X64Word_create(666307205, 1188179964), + X64Word_create(773529912, 1546045734), + X64Word_create(1294757372, 1522805485), + X64Word_create(1396182291, 2643833823), + X64Word_create(1695183700, 2343527390), + X64Word_create(1986661051, 1014477480), + X64Word_create(2177026350, 1206759142), + X64Word_create(2456956037, 344077627), + X64Word_create(2730485921, 1290863460), + X64Word_create(2820302411, 3158454273), + X64Word_create(3259730800, 3505952657), + X64Word_create(3345764771, 106217008), + X64Word_create(3516065817, 3606008344), + X64Word_create(3600352804, 1432725776), + X64Word_create(4094571909, 1467031594), + X64Word_create(275423344, 851169720), + X64Word_create(430227734, 3100823752), + X64Word_create(506948616, 1363258195), + X64Word_create(659060556, 3750685593), + X64Word_create(883997877, 3785050280), + X64Word_create(958139571, 3318307427), + X64Word_create(1322822218, 3812723403), + X64Word_create(1537002063, 2003034995), + X64Word_create(1747873779, 3602036899), + X64Word_create(1955562222, 1575990012), + X64Word_create(2024104815, 1125592928), + X64Word_create(2227730452, 2716904306), + X64Word_create(2361852424, 442776044), + X64Word_create(2428436474, 593698344), + X64Word_create(2756734187, 3733110249), + X64Word_create(3204031479, 2999351573), + X64Word_create(3329325298, 3815920427), + X64Word_create(3391569614, 3928383900), + X64Word_create(3515267271, 566280711), + X64Word_create(3940187606, 3454069534), + X64Word_create(4118630271, 4000239992), + X64Word_create(116418474, 1914138554), + X64Word_create(174292421, 2731055270), + X64Word_create(289380356, 3203993006), + X64Word_create(460393269, 320620315), + X64Word_create(685471733, 587496836), + X64Word_create(852142971, 1086792851), + X64Word_create(1017036298, 365543100), + X64Word_create(1126000580, 2618297676), + X64Word_create(1288033470, 3409855158), + X64Word_create(1501505948, 4234509866), + X64Word_create(1607167915, 987167468), + X64Word_create(1816402316, 1246189591) + ]; + var W = []; + (function() { + for (var i = 0; i < 80; i++) { + W[i] = X64Word_create(); + } + })(); + var SHA512 = C_algo.SHA512 = Hasher.extend({ + _doReset: function() { + this._hash = new X64WordArray.init([ + new X64Word.init(1779033703, 4089235720), + new X64Word.init(3144134277, 2227873595), + new X64Word.init(1013904242, 4271175723), + new X64Word.init(2773480762, 1595750129), + new X64Word.init(1359893119, 2917565137), + new X64Word.init(2600822924, 725511199), + new X64Word.init(528734635, 4215389547), + new X64Word.init(1541459225, 327033209) + ]); + }, + _doProcessBlock: function(M, offset) { + var H = this._hash.words; + var H0 = H[0]; + var H1 = H[1]; + var H2 = H[2]; + var H3 = H[3]; + var H4 = H[4]; + var H5 = H[5]; + var H6 = H[6]; + var H7 = H[7]; + var H0h = H0.high; + var H0l = H0.low; + var H1h = H1.high; + var H1l = H1.low; + var H2h = H2.high; + var H2l = H2.low; + var H3h = H3.high; + var H3l = H3.low; + var H4h = H4.high; + var H4l = H4.low; + var H5h = H5.high; + var H5l = H5.low; + var H6h = H6.high; + var H6l = H6.low; + var H7h = H7.high; + var H7l = H7.low; + var ah = H0h; + var al = H0l; + var bh = H1h; + var bl = H1l; + var ch = H2h; + var cl = H2l; + var dh = H3h; + var dl = H3l; + var eh = H4h; + var el = H4l; + var fh = H5h; + var fl = H5l; + var gh = H6h; + var gl = H6l; + var hh = H7h; + var hl = H7l; + for (var i = 0; i < 80; i++) { + var Wil; + var Wih; + var Wi = W[i]; + if (i < 16) { + Wih = Wi.high = M[offset + i * 2] | 0; + Wil = Wi.low = M[offset + i * 2 + 1] | 0; + } else { + var gamma0x = W[i - 15]; + var gamma0xh = gamma0x.high; + var gamma0xl = gamma0x.low; + var gamma0h = (gamma0xh >>> 1 | gamma0xl << 31) ^ (gamma0xh >>> 8 | gamma0xl << 24) ^ gamma0xh >>> 7; + var gamma0l = (gamma0xl >>> 1 | gamma0xh << 31) ^ (gamma0xl >>> 8 | gamma0xh << 24) ^ (gamma0xl >>> 7 | gamma0xh << 25); + var gamma1x = W[i - 2]; + var gamma1xh = gamma1x.high; + var gamma1xl = gamma1x.low; + var gamma1h = (gamma1xh >>> 19 | gamma1xl << 13) ^ (gamma1xh << 3 | gamma1xl >>> 29) ^ gamma1xh >>> 6; + var gamma1l = (gamma1xl >>> 19 | gamma1xh << 13) ^ (gamma1xl << 3 | gamma1xh >>> 29) ^ (gamma1xl >>> 6 | gamma1xh << 26); + var Wi7 = W[i - 7]; + var Wi7h = Wi7.high; + var Wi7l = Wi7.low; + var Wi16 = W[i - 16]; + var Wi16h = Wi16.high; + var Wi16l = Wi16.low; + Wil = gamma0l + Wi7l; + Wih = gamma0h + Wi7h + (Wil >>> 0 < gamma0l >>> 0 ? 1 : 0); + Wil = Wil + gamma1l; + Wih = Wih + gamma1h + (Wil >>> 0 < gamma1l >>> 0 ? 1 : 0); + Wil = Wil + Wi16l; + Wih = Wih + Wi16h + (Wil >>> 0 < Wi16l >>> 0 ? 1 : 0); + Wi.high = Wih; + Wi.low = Wil; + } + var chh = eh & fh ^ ~eh & gh; + var chl = el & fl ^ ~el & gl; + var majh = ah & bh ^ ah & ch ^ bh & ch; + var majl = al & bl ^ al & cl ^ bl & cl; + var sigma0h = (ah >>> 28 | al << 4) ^ (ah << 30 | al >>> 2) ^ (ah << 25 | al >>> 7); + var sigma0l = (al >>> 28 | ah << 4) ^ (al << 30 | ah >>> 2) ^ (al << 25 | ah >>> 7); + var sigma1h = (eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9); + var sigma1l = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9); + var Ki = K[i]; + var Kih = Ki.high; + var Kil = Ki.low; + var t1l = hl + sigma1l; + var t1h = hh + sigma1h + (t1l >>> 0 < hl >>> 0 ? 1 : 0); + var t1l = t1l + chl; + var t1h = t1h + chh + (t1l >>> 0 < chl >>> 0 ? 1 : 0); + var t1l = t1l + Kil; + var t1h = t1h + Kih + (t1l >>> 0 < Kil >>> 0 ? 1 : 0); + var t1l = t1l + Wil; + var t1h = t1h + Wih + (t1l >>> 0 < Wil >>> 0 ? 1 : 0); + var t2l = sigma0l + majl; + var t2h = sigma0h + majh + (t2l >>> 0 < sigma0l >>> 0 ? 1 : 0); + hh = gh; + hl = gl; + gh = fh; + gl = fl; + fh = eh; + fl = el; + el = dl + t1l | 0; + eh = dh + t1h + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; + dh = ch; + dl = cl; + ch = bh; + cl = bl; + bh = ah; + bl = al; + al = t1l + t2l | 0; + ah = t1h + t2h + (al >>> 0 < t1l >>> 0 ? 1 : 0) | 0; + } + H0l = H0.low = H0l + al; + H0.high = H0h + ah + (H0l >>> 0 < al >>> 0 ? 1 : 0); + H1l = H1.low = H1l + bl; + H1.high = H1h + bh + (H1l >>> 0 < bl >>> 0 ? 1 : 0); + H2l = H2.low = H2l + cl; + H2.high = H2h + ch + (H2l >>> 0 < cl >>> 0 ? 1 : 0); + H3l = H3.low = H3l + dl; + H3.high = H3h + dh + (H3l >>> 0 < dl >>> 0 ? 1 : 0); + H4l = H4.low = H4l + el; + H4.high = H4h + eh + (H4l >>> 0 < el >>> 0 ? 1 : 0); + H5l = H5.low = H5l + fl; + H5.high = H5h + fh + (H5l >>> 0 < fl >>> 0 ? 1 : 0); + H6l = H6.low = H6l + gl; + H6.high = H6h + gh + (H6l >>> 0 < gl >>> 0 ? 1 : 0); + H7l = H7.low = H7l + hl; + H7.high = H7h + hh + (H7l >>> 0 < hl >>> 0 ? 1 : 0); + }, + _doFinalize: function() { + var data = this._data; + var dataWords = data.words; + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + dataWords[nBitsLeft >>> 5] |= 128 << 24 - nBitsLeft % 32; + dataWords[(nBitsLeft + 128 >>> 10 << 5) + 30] = Math.floor(nBitsTotal / 4294967296); + dataWords[(nBitsLeft + 128 >>> 10 << 5) + 31] = nBitsTotal; + data.sigBytes = dataWords.length * 4; + this._process(); + var hash = this._hash.toX32(); + return hash; + }, + clone: function() { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + return clone; + }, + blockSize: 1024 / 32 + }); + C.SHA512 = Hasher._createHelper(SHA512); + C.HmacSHA512 = Hasher._createHmacHelper(SHA512); + })(); + return CryptoJS.SHA512; + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/sha384.js +var require_sha384 = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/sha384.js"(exports, module) { + (function(root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core(), require_x64_core(), require_sha512()); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./x64-core", "./sha512"], factory); + } else { + factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + (function() { + var C = CryptoJS; + var C_x64 = C.x64; + var X64Word = C_x64.Word; + var X64WordArray = C_x64.WordArray; + var C_algo = C.algo; + var SHA512 = C_algo.SHA512; + var SHA384 = C_algo.SHA384 = SHA512.extend({ + _doReset: function() { + this._hash = new X64WordArray.init([ + new X64Word.init(3418070365, 3238371032), + new X64Word.init(1654270250, 914150663), + new X64Word.init(2438529370, 812702999), + new X64Word.init(355462360, 4144912697), + new X64Word.init(1731405415, 4290775857), + new X64Word.init(2394180231, 1750603025), + new X64Word.init(3675008525, 1694076839), + new X64Word.init(1203062813, 3204075428) + ]); + }, + _doFinalize: function() { + var hash = SHA512._doFinalize.call(this); + hash.sigBytes -= 16; + return hash; + } + }); + C.SHA384 = SHA512._createHelper(SHA384); + C.HmacSHA384 = SHA512._createHmacHelper(SHA384); + })(); + return CryptoJS.SHA384; + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/sha3.js +var require_sha3 = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/sha3.js"(exports, module) { + (function(root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core(), require_x64_core()); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./x64-core"], factory); + } else { + factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + (function(Math2) { + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_x64 = C.x64; + var X64Word = C_x64.Word; + var C_algo = C.algo; + var RHO_OFFSETS = []; + var PI_INDEXES = []; + var ROUND_CONSTANTS = []; + (function() { + var x = 1, y = 0; + for (var t = 0; t < 24; t++) { + RHO_OFFSETS[x + 5 * y] = (t + 1) * (t + 2) / 2 % 64; + var newX = y % 5; + var newY = (2 * x + 3 * y) % 5; + x = newX; + y = newY; + } + for (var x = 0; x < 5; x++) { + for (var y = 0; y < 5; y++) { + PI_INDEXES[x + 5 * y] = y + (2 * x + 3 * y) % 5 * 5; + } + } + var LFSR = 1; + for (var i = 0; i < 24; i++) { + var roundConstantMsw = 0; + var roundConstantLsw = 0; + for (var j = 0; j < 7; j++) { + if (LFSR & 1) { + var bitPosition = (1 << j) - 1; + if (bitPosition < 32) { + roundConstantLsw ^= 1 << bitPosition; + } else { + roundConstantMsw ^= 1 << bitPosition - 32; + } + } + if (LFSR & 128) { + LFSR = LFSR << 1 ^ 113; + } else { + LFSR <<= 1; + } + } + ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw); + } + })(); + var T = []; + (function() { + for (var i = 0; i < 25; i++) { + T[i] = X64Word.create(); + } + })(); + var SHA3 = C_algo.SHA3 = Hasher.extend({ + /** + * Configuration options. + * + * @property {number} outputLength + * The desired number of bits in the output hash. + * Only values permitted are: 224, 256, 384, 512. + * Default: 512 + */ + cfg: Hasher.cfg.extend({ + outputLength: 512 + }), + _doReset: function() { + var state = this._state = []; + for (var i = 0; i < 25; i++) { + state[i] = new X64Word.init(); + } + this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32; + }, + _doProcessBlock: function(M, offset) { + var state = this._state; + var nBlockSizeLanes = this.blockSize / 2; + for (var i = 0; i < nBlockSizeLanes; i++) { + var M2i = M[offset + 2 * i]; + var M2i1 = M[offset + 2 * i + 1]; + M2i = (M2i << 8 | M2i >>> 24) & 16711935 | (M2i << 24 | M2i >>> 8) & 4278255360; + M2i1 = (M2i1 << 8 | M2i1 >>> 24) & 16711935 | (M2i1 << 24 | M2i1 >>> 8) & 4278255360; + var lane = state[i]; + lane.high ^= M2i1; + lane.low ^= M2i; + } + for (var round = 0; round < 24; round++) { + for (var x = 0; x < 5; x++) { + var tMsw = 0, tLsw = 0; + for (var y = 0; y < 5; y++) { + var lane = state[x + 5 * y]; + tMsw ^= lane.high; + tLsw ^= lane.low; + } + var Tx = T[x]; + Tx.high = tMsw; + Tx.low = tLsw; + } + for (var x = 0; x < 5; x++) { + var Tx4 = T[(x + 4) % 5]; + var Tx1 = T[(x + 1) % 5]; + var Tx1Msw = Tx1.high; + var Tx1Lsw = Tx1.low; + var tMsw = Tx4.high ^ (Tx1Msw << 1 | Tx1Lsw >>> 31); + var tLsw = Tx4.low ^ (Tx1Lsw << 1 | Tx1Msw >>> 31); + for (var y = 0; y < 5; y++) { + var lane = state[x + 5 * y]; + lane.high ^= tMsw; + lane.low ^= tLsw; + } + } + for (var laneIndex = 1; laneIndex < 25; laneIndex++) { + var tMsw; + var tLsw; + var lane = state[laneIndex]; + var laneMsw = lane.high; + var laneLsw = lane.low; + var rhoOffset = RHO_OFFSETS[laneIndex]; + if (rhoOffset < 32) { + tMsw = laneMsw << rhoOffset | laneLsw >>> 32 - rhoOffset; + tLsw = laneLsw << rhoOffset | laneMsw >>> 32 - rhoOffset; + } else { + tMsw = laneLsw << rhoOffset - 32 | laneMsw >>> 64 - rhoOffset; + tLsw = laneMsw << rhoOffset - 32 | laneLsw >>> 64 - rhoOffset; + } + var TPiLane = T[PI_INDEXES[laneIndex]]; + TPiLane.high = tMsw; + TPiLane.low = tLsw; + } + var T0 = T[0]; + var state0 = state[0]; + T0.high = state0.high; + T0.low = state0.low; + for (var x = 0; x < 5; x++) { + for (var y = 0; y < 5; y++) { + var laneIndex = x + 5 * y; + var lane = state[laneIndex]; + var TLane = T[laneIndex]; + var Tx1Lane = T[(x + 1) % 5 + 5 * y]; + var Tx2Lane = T[(x + 2) % 5 + 5 * y]; + lane.high = TLane.high ^ ~Tx1Lane.high & Tx2Lane.high; + lane.low = TLane.low ^ ~Tx1Lane.low & Tx2Lane.low; + } + } + var lane = state[0]; + var roundConstant = ROUND_CONSTANTS[round]; + lane.high ^= roundConstant.high; + lane.low ^= roundConstant.low; + } + }, + _doFinalize: function() { + var data = this._data; + var dataWords = data.words; + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + var blockSizeBits = this.blockSize * 32; + dataWords[nBitsLeft >>> 5] |= 1 << 24 - nBitsLeft % 32; + dataWords[(Math2.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits >>> 5) - 1] |= 128; + data.sigBytes = dataWords.length * 4; + this._process(); + var state = this._state; + var outputLengthBytes = this.cfg.outputLength / 8; + var outputLengthLanes = outputLengthBytes / 8; + var hashWords = []; + for (var i = 0; i < outputLengthLanes; i++) { + var lane = state[i]; + var laneMsw = lane.high; + var laneLsw = lane.low; + laneMsw = (laneMsw << 8 | laneMsw >>> 24) & 16711935 | (laneMsw << 24 | laneMsw >>> 8) & 4278255360; + laneLsw = (laneLsw << 8 | laneLsw >>> 24) & 16711935 | (laneLsw << 24 | laneLsw >>> 8) & 4278255360; + hashWords.push(laneLsw); + hashWords.push(laneMsw); + } + return new WordArray.init(hashWords, outputLengthBytes); + }, + clone: function() { + var clone = Hasher.clone.call(this); + var state = clone._state = this._state.slice(0); + for (var i = 0; i < 25; i++) { + state[i] = state[i].clone(); + } + return clone; + } + }); + C.SHA3 = Hasher._createHelper(SHA3); + C.HmacSHA3 = Hasher._createHmacHelper(SHA3); + })(Math); + return CryptoJS.SHA3; + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/ripemd160.js +var require_ripemd160 = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/ripemd160.js"(exports, module) { + (function(root, factory) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core()); + } else if (typeof define === "function" && define.amd) { + define(["./core"], factory); + } else { + factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + (function(Math2) { + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + var _zl = WordArray.create([ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 7, + 4, + 13, + 1, + 10, + 6, + 15, + 3, + 12, + 0, + 9, + 5, + 2, + 14, + 11, + 8, + 3, + 10, + 14, + 4, + 9, + 15, + 8, + 1, + 2, + 7, + 0, + 6, + 13, + 11, + 5, + 12, + 1, + 9, + 11, + 10, + 0, + 8, + 12, + 4, + 13, + 3, + 7, + 15, + 14, + 5, + 6, + 2, + 4, + 0, + 5, + 9, + 7, + 12, + 2, + 10, + 14, + 1, + 3, + 8, + 11, + 6, + 15, + 13 + ]); + var _zr = WordArray.create([ + 5, + 14, + 7, + 0, + 9, + 2, + 11, + 4, + 13, + 6, + 15, + 8, + 1, + 10, + 3, + 12, + 6, + 11, + 3, + 7, + 0, + 13, + 5, + 10, + 14, + 15, + 8, + 12, + 4, + 9, + 1, + 2, + 15, + 5, + 1, + 3, + 7, + 14, + 6, + 9, + 11, + 8, + 12, + 2, + 10, + 0, + 4, + 13, + 8, + 6, + 4, + 1, + 3, + 11, + 15, + 0, + 5, + 12, + 2, + 13, + 9, + 7, + 10, + 14, + 12, + 15, + 10, + 4, + 1, + 5, + 8, + 7, + 6, + 2, + 13, + 14, + 0, + 3, + 9, + 11 + ]); + var _sl = WordArray.create([ + 11, + 14, + 15, + 12, + 5, + 8, + 7, + 9, + 11, + 13, + 14, + 15, + 6, + 7, + 9, + 8, + 7, + 6, + 8, + 13, + 11, + 9, + 7, + 15, + 7, + 12, + 15, + 9, + 11, + 7, + 13, + 12, + 11, + 13, + 6, + 7, + 14, + 9, + 13, + 15, + 14, + 8, + 13, + 6, + 5, + 12, + 7, + 5, + 11, + 12, + 14, + 15, + 14, + 15, + 9, + 8, + 9, + 14, + 5, + 6, + 8, + 6, + 5, + 12, + 9, + 15, + 5, + 11, + 6, + 8, + 13, + 12, + 5, + 12, + 13, + 14, + 11, + 8, + 5, + 6 + ]); + var _sr = WordArray.create([ + 8, + 9, + 9, + 11, + 13, + 15, + 15, + 5, + 7, + 7, + 8, + 11, + 14, + 14, + 12, + 6, + 9, + 13, + 15, + 7, + 12, + 8, + 9, + 11, + 7, + 7, + 12, + 7, + 6, + 15, + 13, + 11, + 9, + 7, + 15, + 11, + 8, + 6, + 6, + 14, + 12, + 13, + 5, + 14, + 13, + 13, + 7, + 5, + 15, + 5, + 8, + 11, + 14, + 14, + 6, + 14, + 6, + 9, + 12, + 9, + 12, + 5, + 15, + 8, + 8, + 5, + 12, + 9, + 12, + 5, + 14, + 6, + 8, + 13, + 6, + 5, + 15, + 13, + 11, + 11 + ]); + var _hl = WordArray.create([0, 1518500249, 1859775393, 2400959708, 2840853838]); + var _hr = WordArray.create([1352829926, 1548603684, 1836072691, 2053994217, 0]); + var RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({ + _doReset: function() { + this._hash = WordArray.create([1732584193, 4023233417, 2562383102, 271733878, 3285377520]); + }, + _doProcessBlock: function(M, offset) { + for (var i = 0; i < 16; i++) { + var offset_i = offset + i; + var M_offset_i = M[offset_i]; + M[offset_i] = (M_offset_i << 8 | M_offset_i >>> 24) & 16711935 | (M_offset_i << 24 | M_offset_i >>> 8) & 4278255360; + } + var H = this._hash.words; + var hl = _hl.words; + var hr = _hr.words; + var zl = _zl.words; + var zr = _zr.words; + var sl = _sl.words; + var sr = _sr.words; + var al, bl, cl, dl, el; + var ar, br, cr, dr, er; + ar = al = H[0]; + br = bl = H[1]; + cr = cl = H[2]; + dr = dl = H[3]; + er = el = H[4]; + var t; + for (var i = 0; i < 80; i += 1) { + t = al + M[offset + zl[i]] | 0; + if (i < 16) { + t += f1(bl, cl, dl) + hl[0]; + } else if (i < 32) { + t += f2(bl, cl, dl) + hl[1]; + } else if (i < 48) { + t += f3(bl, cl, dl) + hl[2]; + } else if (i < 64) { + t += f4(bl, cl, dl) + hl[3]; + } else { + t += f5(bl, cl, dl) + hl[4]; + } + t = t | 0; + t = rotl(t, sl[i]); + t = t + el | 0; + al = el; + el = dl; + dl = rotl(cl, 10); + cl = bl; + bl = t; + t = ar + M[offset + zr[i]] | 0; + if (i < 16) { + t += f5(br, cr, dr) + hr[0]; + } else if (i < 32) { + t += f4(br, cr, dr) + hr[1]; + } else if (i < 48) { + t += f3(br, cr, dr) + hr[2]; + } else if (i < 64) { + t += f2(br, cr, dr) + hr[3]; + } else { + t += f1(br, cr, dr) + hr[4]; + } + t = t | 0; + t = rotl(t, sr[i]); + t = t + er | 0; + ar = er; + er = dr; + dr = rotl(cr, 10); + cr = br; + br = t; + } + t = H[1] + cl + dr | 0; + H[1] = H[2] + dl + er | 0; + H[2] = H[3] + el + ar | 0; + H[3] = H[4] + al + br | 0; + H[4] = H[0] + bl + cr | 0; + H[0] = t; + }, + _doFinalize: function() { + var data = this._data; + var dataWords = data.words; + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + dataWords[nBitsLeft >>> 5] |= 128 << 24 - nBitsLeft % 32; + dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = (nBitsTotal << 8 | nBitsTotal >>> 24) & 16711935 | (nBitsTotal << 24 | nBitsTotal >>> 8) & 4278255360; + data.sigBytes = (dataWords.length + 1) * 4; + this._process(); + var hash = this._hash; + var H = hash.words; + for (var i = 0; i < 5; i++) { + var H_i = H[i]; + H[i] = (H_i << 8 | H_i >>> 24) & 16711935 | (H_i << 24 | H_i >>> 8) & 4278255360; + } + return hash; + }, + clone: function() { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + return clone; + } + }); + function f1(x, y, z) { + return x ^ y ^ z; + } + function f2(x, y, z) { + return x & y | ~x & z; + } + function f3(x, y, z) { + return (x | ~y) ^ z; + } + function f4(x, y, z) { + return x & z | y & ~z; + } + function f5(x, y, z) { + return x ^ (y | ~z); + } + function rotl(x, n) { + return x << n | x >>> 32 - n; + } + C.RIPEMD160 = Hasher._createHelper(RIPEMD160); + C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160); + })(Math); + return CryptoJS.RIPEMD160; + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/hmac.js +var require_hmac = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/hmac.js"(exports, module) { + (function(root, factory) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core()); + } else if (typeof define === "function" && define.amd) { + define(["./core"], factory); + } else { + factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + (function() { + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var C_enc = C.enc; + var Utf8 = C_enc.Utf8; + var C_algo = C.algo; + var HMAC = C_algo.HMAC = Base.extend({ + /** + * Initializes a newly created HMAC. + * + * @param {Hasher} hasher The hash algorithm to use. + * @param {WordArray|string} key The secret key. + * + * @example + * + * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key); + */ + init: function(hasher, key) { + hasher = this._hasher = new hasher.init(); + if (typeof key == "string") { + key = Utf8.parse(key); + } + var hasherBlockSize = hasher.blockSize; + var hasherBlockSizeBytes = hasherBlockSize * 4; + if (key.sigBytes > hasherBlockSizeBytes) { + key = hasher.finalize(key); + } + key.clamp(); + var oKey = this._oKey = key.clone(); + var iKey = this._iKey = key.clone(); + var oKeyWords = oKey.words; + var iKeyWords = iKey.words; + for (var i = 0; i < hasherBlockSize; i++) { + oKeyWords[i] ^= 1549556828; + iKeyWords[i] ^= 909522486; + } + oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes; + this.reset(); + }, + /** + * Resets this HMAC to its initial state. + * + * @example + * + * hmacHasher.reset(); + */ + reset: function() { + var hasher = this._hasher; + hasher.reset(); + hasher.update(this._iKey); + }, + /** + * Updates this HMAC with a message. + * + * @param {WordArray|string} messageUpdate The message to append. + * + * @return {HMAC} This HMAC instance. + * + * @example + * + * hmacHasher.update('message'); + * hmacHasher.update(wordArray); + */ + update: function(messageUpdate) { + this._hasher.update(messageUpdate); + return this; + }, + /** + * Finalizes the HMAC computation. + * Note that the finalize operation is effectively a destructive, read-once operation. + * + * @param {WordArray|string} messageUpdate (Optional) A final message update. + * + * @return {WordArray} The HMAC. + * + * @example + * + * var hmac = hmacHasher.finalize(); + * var hmac = hmacHasher.finalize('message'); + * var hmac = hmacHasher.finalize(wordArray); + */ + finalize: function(messageUpdate) { + var hasher = this._hasher; + var innerHash = hasher.finalize(messageUpdate); + hasher.reset(); + var hmac = hasher.finalize(this._oKey.clone().concat(innerHash)); + return hmac; + } + }); + })(); + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/pbkdf2.js +var require_pbkdf2 = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/pbkdf2.js"(exports, module) { + (function(root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core(), require_sha256(), require_hmac()); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./sha256", "./hmac"], factory); + } else { + factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + (function() { + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var WordArray = C_lib.WordArray; + var C_algo = C.algo; + var SHA256 = C_algo.SHA256; + var HMAC = C_algo.HMAC; + var PBKDF2 = C_algo.PBKDF2 = Base.extend({ + /** + * Configuration options. + * + * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) + * @property {Hasher} hasher The hasher to use. Default: SHA256 + * @property {number} iterations The number of iterations to perform. Default: 250000 + */ + cfg: Base.extend({ + keySize: 128 / 32, + hasher: SHA256, + iterations: 25e4 + }), + /** + * Initializes a newly created key derivation function. + * + * @param {Object} cfg (Optional) The configuration options to use for the derivation. + * + * @example + * + * var kdf = CryptoJS.algo.PBKDF2.create(); + * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 }); + * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 }); + */ + init: function(cfg) { + this.cfg = this.cfg.extend(cfg); + }, + /** + * Computes the Password-Based Key Derivation Function 2. + * + * @param {WordArray|string} password The password. + * @param {WordArray|string} salt A salt. + * + * @return {WordArray} The derived key. + * + * @example + * + * var key = kdf.compute(password, salt); + */ + compute: function(password, salt) { + var cfg = this.cfg; + var hmac = HMAC.create(cfg.hasher, password); + var derivedKey = WordArray.create(); + var blockIndex = WordArray.create([1]); + var derivedKeyWords = derivedKey.words; + var blockIndexWords = blockIndex.words; + var keySize = cfg.keySize; + var iterations = cfg.iterations; + while (derivedKeyWords.length < keySize) { + var block = hmac.update(salt).finalize(blockIndex); + hmac.reset(); + var blockWords = block.words; + var blockWordsLength = blockWords.length; + var intermediate = block; + for (var i = 1; i < iterations; i++) { + intermediate = hmac.finalize(intermediate); + hmac.reset(); + var intermediateWords = intermediate.words; + for (var j = 0; j < blockWordsLength; j++) { + blockWords[j] ^= intermediateWords[j]; + } + } + derivedKey.concat(block); + blockIndexWords[0]++; + } + derivedKey.sigBytes = keySize * 4; + return derivedKey; + } + }); + C.PBKDF2 = function(password, salt, cfg) { + return PBKDF2.create(cfg).compute(password, salt); + }; + })(); + return CryptoJS.PBKDF2; + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/evpkdf.js +var require_evpkdf = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/evpkdf.js"(exports, module) { + (function(root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core(), require_sha1(), require_hmac()); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./sha1", "./hmac"], factory); + } else { + factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + (function() { + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var WordArray = C_lib.WordArray; + var C_algo = C.algo; + var MD5 = C_algo.MD5; + var EvpKDF = C_algo.EvpKDF = Base.extend({ + /** + * Configuration options. + * + * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) + * @property {Hasher} hasher The hash algorithm to use. Default: MD5 + * @property {number} iterations The number of iterations to perform. Default: 1 + */ + cfg: Base.extend({ + keySize: 128 / 32, + hasher: MD5, + iterations: 1 + }), + /** + * Initializes a newly created key derivation function. + * + * @param {Object} cfg (Optional) The configuration options to use for the derivation. + * + * @example + * + * var kdf = CryptoJS.algo.EvpKDF.create(); + * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 }); + * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 }); + */ + init: function(cfg) { + this.cfg = this.cfg.extend(cfg); + }, + /** + * Derives a key from a password. + * + * @param {WordArray|string} password The password. + * @param {WordArray|string} salt A salt. + * + * @return {WordArray} The derived key. + * + * @example + * + * var key = kdf.compute(password, salt); + */ + compute: function(password, salt) { + var block; + var cfg = this.cfg; + var hasher = cfg.hasher.create(); + var derivedKey = WordArray.create(); + var derivedKeyWords = derivedKey.words; + var keySize = cfg.keySize; + var iterations = cfg.iterations; + while (derivedKeyWords.length < keySize) { + if (block) { + hasher.update(block); + } + block = hasher.update(password).finalize(salt); + hasher.reset(); + for (var i = 1; i < iterations; i++) { + block = hasher.finalize(block); + hasher.reset(); + } + derivedKey.concat(block); + } + derivedKey.sigBytes = keySize * 4; + return derivedKey; + } + }); + C.EvpKDF = function(password, salt, cfg) { + return EvpKDF.create(cfg).compute(password, salt); + }; + })(); + return CryptoJS.EvpKDF; + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/cipher-core.js +var require_cipher_core = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/cipher-core.js"(exports, module) { + (function(root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core(), require_evpkdf()); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./evpkdf"], factory); + } else { + factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + CryptoJS.lib.Cipher || function(undefined2) { + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var WordArray = C_lib.WordArray; + var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm; + var C_enc = C.enc; + var Utf8 = C_enc.Utf8; + var Base64 = C_enc.Base64; + var C_algo = C.algo; + var EvpKDF = C_algo.EvpKDF; + var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({ + /** + * Configuration options. + * + * @property {WordArray} iv The IV to use for this operation. + */ + cfg: Base.extend(), + /** + * Creates this cipher in encryption mode. + * + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {Cipher} A cipher instance. + * + * @static + * + * @example + * + * var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray }); + */ + createEncryptor: function(key, cfg) { + return this.create(this._ENC_XFORM_MODE, key, cfg); + }, + /** + * Creates this cipher in decryption mode. + * + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {Cipher} A cipher instance. + * + * @static + * + * @example + * + * var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray }); + */ + createDecryptor: function(key, cfg) { + return this.create(this._DEC_XFORM_MODE, key, cfg); + }, + /** + * Initializes a newly created cipher. + * + * @param {number} xformMode Either the encryption or decryption transormation mode constant. + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @example + * + * var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray }); + */ + init: function(xformMode, key, cfg) { + this.cfg = this.cfg.extend(cfg); + this._xformMode = xformMode; + this._key = key; + this.reset(); + }, + /** + * Resets this cipher to its initial state. + * + * @example + * + * cipher.reset(); + */ + reset: function() { + BufferedBlockAlgorithm.reset.call(this); + this._doReset(); + }, + /** + * Adds data to be encrypted or decrypted. + * + * @param {WordArray|string} dataUpdate The data to encrypt or decrypt. + * + * @return {WordArray} The data after processing. + * + * @example + * + * var encrypted = cipher.process('data'); + * var encrypted = cipher.process(wordArray); + */ + process: function(dataUpdate) { + this._append(dataUpdate); + return this._process(); + }, + /** + * Finalizes the encryption or decryption process. + * Note that the finalize operation is effectively a destructive, read-once operation. + * + * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt. + * + * @return {WordArray} The data after final processing. + * + * @example + * + * var encrypted = cipher.finalize(); + * var encrypted = cipher.finalize('data'); + * var encrypted = cipher.finalize(wordArray); + */ + finalize: function(dataUpdate) { + if (dataUpdate) { + this._append(dataUpdate); + } + var finalProcessedData = this._doFinalize(); + return finalProcessedData; + }, + keySize: 128 / 32, + ivSize: 128 / 32, + _ENC_XFORM_MODE: 1, + _DEC_XFORM_MODE: 2, + /** + * Creates shortcut functions to a cipher's object interface. + * + * @param {Cipher} cipher The cipher to create a helper for. + * + * @return {Object} An object with encrypt and decrypt shortcut functions. + * + * @static + * + * @example + * + * var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES); + */ + _createHelper: /* @__PURE__ */ function() { + function selectCipherStrategy(key) { + if (typeof key == "string") { + return PasswordBasedCipher; + } else { + return SerializableCipher; + } + } + return function(cipher) { + return { + encrypt: function(message, key, cfg) { + return selectCipherStrategy(key).encrypt(cipher, message, key, cfg); + }, + decrypt: function(ciphertext, key, cfg) { + return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg); + } + }; + }; + }() + }); + var StreamCipher = C_lib.StreamCipher = Cipher.extend({ + _doFinalize: function() { + var finalProcessedBlocks = this._process(true); + return finalProcessedBlocks; + }, + blockSize: 1 + }); + var C_mode = C.mode = {}; + var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({ + /** + * Creates this mode for encryption. + * + * @param {Cipher} cipher A block cipher instance. + * @param {Array} iv The IV words. + * + * @static + * + * @example + * + * var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words); + */ + createEncryptor: function(cipher, iv) { + return this.Encryptor.create(cipher, iv); + }, + /** + * Creates this mode for decryption. + * + * @param {Cipher} cipher A block cipher instance. + * @param {Array} iv The IV words. + * + * @static + * + * @example + * + * var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words); + */ + createDecryptor: function(cipher, iv) { + return this.Decryptor.create(cipher, iv); + }, + /** + * Initializes a newly created mode. + * + * @param {Cipher} cipher A block cipher instance. + * @param {Array} iv The IV words. + * + * @example + * + * var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words); + */ + init: function(cipher, iv) { + this._cipher = cipher; + this._iv = iv; + } + }); + var CBC = C_mode.CBC = function() { + var CBC2 = BlockCipherMode.extend(); + CBC2.Encryptor = CBC2.extend({ + /** + * Processes the data block at offset. + * + * @param {Array} words The data words to operate on. + * @param {number} offset The offset where the block starts. + * + * @example + * + * mode.processBlock(data.words, offset); + */ + processBlock: function(words, offset) { + var cipher = this._cipher; + var blockSize = cipher.blockSize; + xorBlock.call(this, words, offset, blockSize); + cipher.encryptBlock(words, offset); + this._prevBlock = words.slice(offset, offset + blockSize); + } + }); + CBC2.Decryptor = CBC2.extend({ + /** + * Processes the data block at offset. + * + * @param {Array} words The data words to operate on. + * @param {number} offset The offset where the block starts. + * + * @example + * + * mode.processBlock(data.words, offset); + */ + processBlock: function(words, offset) { + var cipher = this._cipher; + var blockSize = cipher.blockSize; + var thisBlock = words.slice(offset, offset + blockSize); + cipher.decryptBlock(words, offset); + xorBlock.call(this, words, offset, blockSize); + this._prevBlock = thisBlock; + } + }); + function xorBlock(words, offset, blockSize) { + var block; + var iv = this._iv; + if (iv) { + block = iv; + this._iv = undefined2; + } else { + block = this._prevBlock; + } + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= block[i]; + } + } + return CBC2; + }(); + var C_pad = C.pad = {}; + var Pkcs7 = C_pad.Pkcs7 = { + /** + * Pads data using the algorithm defined in PKCS #5/7. + * + * @param {WordArray} data The data to pad. + * @param {number} blockSize The multiple that the data should be padded to. + * + * @static + * + * @example + * + * CryptoJS.pad.Pkcs7.pad(wordArray, 4); + */ + pad: function(data, blockSize) { + var blockSizeBytes = blockSize * 4; + var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; + var paddingWord = nPaddingBytes << 24 | nPaddingBytes << 16 | nPaddingBytes << 8 | nPaddingBytes; + var paddingWords = []; + for (var i = 0; i < nPaddingBytes; i += 4) { + paddingWords.push(paddingWord); + } + var padding = WordArray.create(paddingWords, nPaddingBytes); + data.concat(padding); + }, + /** + * Unpads data that had been padded using the algorithm defined in PKCS #5/7. + * + * @param {WordArray} data The data to unpad. + * + * @static + * + * @example + * + * CryptoJS.pad.Pkcs7.unpad(wordArray); + */ + unpad: function(data) { + var nPaddingBytes = data.words[data.sigBytes - 1 >>> 2] & 255; + data.sigBytes -= nPaddingBytes; + } + }; + var BlockCipher = C_lib.BlockCipher = Cipher.extend({ + /** + * Configuration options. + * + * @property {Mode} mode The block mode to use. Default: CBC + * @property {Padding} padding The padding strategy to use. Default: Pkcs7 + */ + cfg: Cipher.cfg.extend({ + mode: CBC, + padding: Pkcs7 + }), + reset: function() { + var modeCreator; + Cipher.reset.call(this); + var cfg = this.cfg; + var iv = cfg.iv; + var mode = cfg.mode; + if (this._xformMode == this._ENC_XFORM_MODE) { + modeCreator = mode.createEncryptor; + } else { + modeCreator = mode.createDecryptor; + this._minBufferSize = 1; + } + if (this._mode && this._mode.__creator == modeCreator) { + this._mode.init(this, iv && iv.words); + } else { + this._mode = modeCreator.call(mode, this, iv && iv.words); + this._mode.__creator = modeCreator; + } + }, + _doProcessBlock: function(words, offset) { + this._mode.processBlock(words, offset); + }, + _doFinalize: function() { + var finalProcessedBlocks; + var padding = this.cfg.padding; + if (this._xformMode == this._ENC_XFORM_MODE) { + padding.pad(this._data, this.blockSize); + finalProcessedBlocks = this._process(true); + } else { + finalProcessedBlocks = this._process(true); + padding.unpad(finalProcessedBlocks); + } + return finalProcessedBlocks; + }, + blockSize: 128 / 32 + }); + var CipherParams = C_lib.CipherParams = Base.extend({ + /** + * Initializes a newly created cipher params object. + * + * @param {Object} cipherParams An object with any of the possible cipher parameters. + * + * @example + * + * var cipherParams = CryptoJS.lib.CipherParams.create({ + * ciphertext: ciphertextWordArray, + * key: keyWordArray, + * iv: ivWordArray, + * salt: saltWordArray, + * algorithm: CryptoJS.algo.AES, + * mode: CryptoJS.mode.CBC, + * padding: CryptoJS.pad.PKCS7, + * blockSize: 4, + * formatter: CryptoJS.format.OpenSSL + * }); + */ + init: function(cipherParams) { + this.mixIn(cipherParams); + }, + /** + * Converts this cipher params object to a string. + * + * @param {Format} formatter (Optional) The formatting strategy to use. + * + * @return {string} The stringified cipher params. + * + * @throws Error If neither the formatter nor the default formatter is set. + * + * @example + * + * var string = cipherParams + ''; + * var string = cipherParams.toString(); + * var string = cipherParams.toString(CryptoJS.format.OpenSSL); + */ + toString: function(formatter) { + return (formatter || this.formatter).stringify(this); + } + }); + var C_format = C.format = {}; + var OpenSSLFormatter = C_format.OpenSSL = { + /** + * Converts a cipher params object to an OpenSSL-compatible string. + * + * @param {CipherParams} cipherParams The cipher params object. + * + * @return {string} The OpenSSL-compatible string. + * + * @static + * + * @example + * + * var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams); + */ + stringify: function(cipherParams) { + var wordArray; + var ciphertext = cipherParams.ciphertext; + var salt = cipherParams.salt; + if (salt) { + wordArray = WordArray.create([1398893684, 1701076831]).concat(salt).concat(ciphertext); + } else { + wordArray = ciphertext; + } + return wordArray.toString(Base64); + }, + /** + * Converts an OpenSSL-compatible string to a cipher params object. + * + * @param {string} openSSLStr The OpenSSL-compatible string. + * + * @return {CipherParams} The cipher params object. + * + * @static + * + * @example + * + * var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString); + */ + parse: function(openSSLStr) { + var salt; + var ciphertext = Base64.parse(openSSLStr); + var ciphertextWords = ciphertext.words; + if (ciphertextWords[0] == 1398893684 && ciphertextWords[1] == 1701076831) { + salt = WordArray.create(ciphertextWords.slice(2, 4)); + ciphertextWords.splice(0, 4); + ciphertext.sigBytes -= 16; + } + return CipherParams.create({ ciphertext, salt }); + } + }; + var SerializableCipher = C_lib.SerializableCipher = Base.extend({ + /** + * Configuration options. + * + * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL + */ + cfg: Base.extend({ + format: OpenSSLFormatter + }), + /** + * Encrypts a message. + * + * @param {Cipher} cipher The cipher algorithm to use. + * @param {WordArray|string} message The message to encrypt. + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {CipherParams} A cipher params object. + * + * @static + * + * @example + * + * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key); + * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv }); + * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL }); + */ + encrypt: function(cipher, message, key, cfg) { + cfg = this.cfg.extend(cfg); + var encryptor = cipher.createEncryptor(key, cfg); + var ciphertext = encryptor.finalize(message); + var cipherCfg = encryptor.cfg; + return CipherParams.create({ + ciphertext, + key, + iv: cipherCfg.iv, + algorithm: cipher, + mode: cipherCfg.mode, + padding: cipherCfg.padding, + blockSize: cipher.blockSize, + formatter: cfg.format + }); + }, + /** + * Decrypts serialized ciphertext. + * + * @param {Cipher} cipher The cipher algorithm to use. + * @param {CipherParams|string} ciphertext The ciphertext to decrypt. + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {WordArray} The plaintext. + * + * @static + * + * @example + * + * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL }); + * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL }); + */ + decrypt: function(cipher, ciphertext, key, cfg) { + cfg = this.cfg.extend(cfg); + ciphertext = this._parse(ciphertext, cfg.format); + var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext); + return plaintext; + }, + /** + * Converts serialized ciphertext to CipherParams, + * else assumed CipherParams already and returns ciphertext unchanged. + * + * @param {CipherParams|string} ciphertext The ciphertext. + * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext. + * + * @return {CipherParams} The unserialized ciphertext. + * + * @static + * + * @example + * + * var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format); + */ + _parse: function(ciphertext, format) { + if (typeof ciphertext == "string") { + return format.parse(ciphertext, this); + } else { + return ciphertext; + } + } + }); + var C_kdf = C.kdf = {}; + var OpenSSLKdf = C_kdf.OpenSSL = { + /** + * Derives a key and IV from a password. + * + * @param {string} password The password to derive from. + * @param {number} keySize The size in words of the key to generate. + * @param {number} ivSize The size in words of the IV to generate. + * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly. + * + * @return {CipherParams} A cipher params object with the key, IV, and salt. + * + * @static + * + * @example + * + * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32); + * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt'); + */ + execute: function(password, keySize, ivSize, salt, hasher) { + if (!salt) { + salt = WordArray.random(64 / 8); + } + if (!hasher) { + var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt); + } else { + var key = EvpKDF.create({ keySize: keySize + ivSize, hasher }).compute(password, salt); + } + var iv = WordArray.create(key.words.slice(keySize), ivSize * 4); + key.sigBytes = keySize * 4; + return CipherParams.create({ key, iv, salt }); + } + }; + var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({ + /** + * Configuration options. + * + * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL + */ + cfg: SerializableCipher.cfg.extend({ + kdf: OpenSSLKdf + }), + /** + * Encrypts a message using a password. + * + * @param {Cipher} cipher The cipher algorithm to use. + * @param {WordArray|string} message The message to encrypt. + * @param {string} password The password. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {CipherParams} A cipher params object. + * + * @static + * + * @example + * + * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password'); + * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL }); + */ + encrypt: function(cipher, message, password, cfg) { + cfg = this.cfg.extend(cfg); + var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, cfg.salt, cfg.hasher); + cfg.iv = derivedParams.iv; + var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg); + ciphertext.mixIn(derivedParams); + return ciphertext; + }, + /** + * Decrypts serialized ciphertext using a password. + * + * @param {Cipher} cipher The cipher algorithm to use. + * @param {CipherParams|string} ciphertext The ciphertext to decrypt. + * @param {string} password The password. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {WordArray} The plaintext. + * + * @static + * + * @example + * + * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL }); + * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL }); + */ + decrypt: function(cipher, ciphertext, password, cfg) { + cfg = this.cfg.extend(cfg); + ciphertext = this._parse(ciphertext, cfg.format); + var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt, cfg.hasher); + cfg.iv = derivedParams.iv; + var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg); + return plaintext; + } + }); + }(); + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/mode-cfb.js +var require_mode_cfb = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/mode-cfb.js"(exports, module) { + (function(root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core(), require_cipher_core()); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./cipher-core"], factory); + } else { + factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + CryptoJS.mode.CFB = function() { + var CFB = CryptoJS.lib.BlockCipherMode.extend(); + CFB.Encryptor = CFB.extend({ + processBlock: function(words, offset) { + var cipher = this._cipher; + var blockSize = cipher.blockSize; + generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher); + this._prevBlock = words.slice(offset, offset + blockSize); + } + }); + CFB.Decryptor = CFB.extend({ + processBlock: function(words, offset) { + var cipher = this._cipher; + var blockSize = cipher.blockSize; + var thisBlock = words.slice(offset, offset + blockSize); + generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher); + this._prevBlock = thisBlock; + } + }); + function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) { + var keystream; + var iv = this._iv; + if (iv) { + keystream = iv.slice(0); + this._iv = void 0; + } else { + keystream = this._prevBlock; + } + cipher.encryptBlock(keystream, 0); + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= keystream[i]; + } + } + return CFB; + }(); + return CryptoJS.mode.CFB; + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/mode-ctr.js +var require_mode_ctr = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/mode-ctr.js"(exports, module) { + (function(root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core(), require_cipher_core()); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./cipher-core"], factory); + } else { + factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + CryptoJS.mode.CTR = function() { + var CTR = CryptoJS.lib.BlockCipherMode.extend(); + var Encryptor = CTR.Encryptor = CTR.extend({ + processBlock: function(words, offset) { + var cipher = this._cipher; + var blockSize = cipher.blockSize; + var iv = this._iv; + var counter = this._counter; + if (iv) { + counter = this._counter = iv.slice(0); + this._iv = void 0; + } + var keystream = counter.slice(0); + cipher.encryptBlock(keystream, 0); + counter[blockSize - 1] = counter[blockSize - 1] + 1 | 0; + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= keystream[i]; + } + } + }); + CTR.Decryptor = Encryptor; + return CTR; + }(); + return CryptoJS.mode.CTR; + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/mode-ctr-gladman.js +var require_mode_ctr_gladman = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/mode-ctr-gladman.js"(exports, module) { + (function(root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core(), require_cipher_core()); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./cipher-core"], factory); + } else { + factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + CryptoJS.mode.CTRGladman = function() { + var CTRGladman = CryptoJS.lib.BlockCipherMode.extend(); + function incWord(word) { + if ((word >> 24 & 255) === 255) { + var b1 = word >> 16 & 255; + var b2 = word >> 8 & 255; + var b3 = word & 255; + if (b1 === 255) { + b1 = 0; + if (b2 === 255) { + b2 = 0; + if (b3 === 255) { + b3 = 0; + } else { + ++b3; + } + } else { + ++b2; + } + } else { + ++b1; + } + word = 0; + word += b1 << 16; + word += b2 << 8; + word += b3; + } else { + word += 1 << 24; + } + return word; + } + function incCounter(counter) { + if ((counter[0] = incWord(counter[0])) === 0) { + counter[1] = incWord(counter[1]); + } + return counter; + } + var Encryptor = CTRGladman.Encryptor = CTRGladman.extend({ + processBlock: function(words, offset) { + var cipher = this._cipher; + var blockSize = cipher.blockSize; + var iv = this._iv; + var counter = this._counter; + if (iv) { + counter = this._counter = iv.slice(0); + this._iv = void 0; + } + incCounter(counter); + var keystream = counter.slice(0); + cipher.encryptBlock(keystream, 0); + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= keystream[i]; + } + } + }); + CTRGladman.Decryptor = Encryptor; + return CTRGladman; + }(); + return CryptoJS.mode.CTRGladman; + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/mode-ofb.js +var require_mode_ofb = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/mode-ofb.js"(exports, module) { + (function(root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core(), require_cipher_core()); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./cipher-core"], factory); + } else { + factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + CryptoJS.mode.OFB = function() { + var OFB = CryptoJS.lib.BlockCipherMode.extend(); + var Encryptor = OFB.Encryptor = OFB.extend({ + processBlock: function(words, offset) { + var cipher = this._cipher; + var blockSize = cipher.blockSize; + var iv = this._iv; + var keystream = this._keystream; + if (iv) { + keystream = this._keystream = iv.slice(0); + this._iv = void 0; + } + cipher.encryptBlock(keystream, 0); + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= keystream[i]; + } + } + }); + OFB.Decryptor = Encryptor; + return OFB; + }(); + return CryptoJS.mode.OFB; + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/mode-ecb.js +var require_mode_ecb = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/mode-ecb.js"(exports, module) { + (function(root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core(), require_cipher_core()); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./cipher-core"], factory); + } else { + factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + CryptoJS.mode.ECB = function() { + var ECB = CryptoJS.lib.BlockCipherMode.extend(); + ECB.Encryptor = ECB.extend({ + processBlock: function(words, offset) { + this._cipher.encryptBlock(words, offset); + } + }); + ECB.Decryptor = ECB.extend({ + processBlock: function(words, offset) { + this._cipher.decryptBlock(words, offset); + } + }); + return ECB; + }(); + return CryptoJS.mode.ECB; + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/pad-ansix923.js +var require_pad_ansix923 = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/pad-ansix923.js"(exports, module) { + (function(root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core(), require_cipher_core()); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./cipher-core"], factory); + } else { + factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + CryptoJS.pad.AnsiX923 = { + pad: function(data, blockSize) { + var dataSigBytes = data.sigBytes; + var blockSizeBytes = blockSize * 4; + var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes; + var lastBytePos = dataSigBytes + nPaddingBytes - 1; + data.clamp(); + data.words[lastBytePos >>> 2] |= nPaddingBytes << 24 - lastBytePos % 4 * 8; + data.sigBytes += nPaddingBytes; + }, + unpad: function(data) { + var nPaddingBytes = data.words[data.sigBytes - 1 >>> 2] & 255; + data.sigBytes -= nPaddingBytes; + } + }; + return CryptoJS.pad.Ansix923; + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/pad-iso10126.js +var require_pad_iso10126 = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/pad-iso10126.js"(exports, module) { + (function(root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core(), require_cipher_core()); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./cipher-core"], factory); + } else { + factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + CryptoJS.pad.Iso10126 = { + pad: function(data, blockSize) { + var blockSizeBytes = blockSize * 4; + var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; + data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)).concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1)); + }, + unpad: function(data) { + var nPaddingBytes = data.words[data.sigBytes - 1 >>> 2] & 255; + data.sigBytes -= nPaddingBytes; + } + }; + return CryptoJS.pad.Iso10126; + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/pad-iso97971.js +var require_pad_iso97971 = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/pad-iso97971.js"(exports, module) { + (function(root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core(), require_cipher_core()); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./cipher-core"], factory); + } else { + factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + CryptoJS.pad.Iso97971 = { + pad: function(data, blockSize) { + data.concat(CryptoJS.lib.WordArray.create([2147483648], 1)); + CryptoJS.pad.ZeroPadding.pad(data, blockSize); + }, + unpad: function(data) { + CryptoJS.pad.ZeroPadding.unpad(data); + data.sigBytes--; + } + }; + return CryptoJS.pad.Iso97971; + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/pad-zeropadding.js +var require_pad_zeropadding = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/pad-zeropadding.js"(exports, module) { + (function(root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core(), require_cipher_core()); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./cipher-core"], factory); + } else { + factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + CryptoJS.pad.ZeroPadding = { + pad: function(data, blockSize) { + var blockSizeBytes = blockSize * 4; + data.clamp(); + data.sigBytes += blockSizeBytes - (data.sigBytes % blockSizeBytes || blockSizeBytes); + }, + unpad: function(data) { + var dataWords = data.words; + var i = data.sigBytes - 1; + for (var i = data.sigBytes - 1; i >= 0; i--) { + if (dataWords[i >>> 2] >>> 24 - i % 4 * 8 & 255) { + data.sigBytes = i + 1; + break; + } + } + } + }; + return CryptoJS.pad.ZeroPadding; + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/pad-nopadding.js +var require_pad_nopadding = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/pad-nopadding.js"(exports, module) { + (function(root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core(), require_cipher_core()); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./cipher-core"], factory); + } else { + factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + CryptoJS.pad.NoPadding = { + pad: function() { + }, + unpad: function() { + } + }; + return CryptoJS.pad.NoPadding; + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/format-hex.js +var require_format_hex = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/format-hex.js"(exports, module) { + (function(root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core(), require_cipher_core()); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./cipher-core"], factory); + } else { + factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + (function(undefined2) { + var C = CryptoJS; + var C_lib = C.lib; + var CipherParams = C_lib.CipherParams; + var C_enc = C.enc; + var Hex = C_enc.Hex; + var C_format = C.format; + var HexFormatter = C_format.Hex = { + /** + * Converts the ciphertext of a cipher params object to a hexadecimally encoded string. + * + * @param {CipherParams} cipherParams The cipher params object. + * + * @return {string} The hexadecimally encoded string. + * + * @static + * + * @example + * + * var hexString = CryptoJS.format.Hex.stringify(cipherParams); + */ + stringify: function(cipherParams) { + return cipherParams.ciphertext.toString(Hex); + }, + /** + * Converts a hexadecimally encoded ciphertext string to a cipher params object. + * + * @param {string} input The hexadecimally encoded string. + * + * @return {CipherParams} The cipher params object. + * + * @static + * + * @example + * + * var cipherParams = CryptoJS.format.Hex.parse(hexString); + */ + parse: function(input) { + var ciphertext = Hex.parse(input); + return CipherParams.create({ ciphertext }); + } + }; + })(); + return CryptoJS.format.Hex; + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/aes.js +var require_aes = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/aes.js"(exports, module) { + (function(root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core(), require_enc_base64(), require_md5(), require_evpkdf(), require_cipher_core()); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory); + } else { + factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + (function() { + var C = CryptoJS; + var C_lib = C.lib; + var BlockCipher = C_lib.BlockCipher; + var C_algo = C.algo; + var SBOX = []; + var INV_SBOX = []; + var SUB_MIX_0 = []; + var SUB_MIX_1 = []; + var SUB_MIX_2 = []; + var SUB_MIX_3 = []; + var INV_SUB_MIX_0 = []; + var INV_SUB_MIX_1 = []; + var INV_SUB_MIX_2 = []; + var INV_SUB_MIX_3 = []; + (function() { + var d = []; + for (var i = 0; i < 256; i++) { + if (i < 128) { + d[i] = i << 1; + } else { + d[i] = i << 1 ^ 283; + } + } + var x = 0; + var xi = 0; + for (var i = 0; i < 256; i++) { + var sx = xi ^ xi << 1 ^ xi << 2 ^ xi << 3 ^ xi << 4; + sx = sx >>> 8 ^ sx & 255 ^ 99; + SBOX[x] = sx; + INV_SBOX[sx] = x; + var x2 = d[x]; + var x4 = d[x2]; + var x8 = d[x4]; + var t = d[sx] * 257 ^ sx * 16843008; + SUB_MIX_0[x] = t << 24 | t >>> 8; + SUB_MIX_1[x] = t << 16 | t >>> 16; + SUB_MIX_2[x] = t << 8 | t >>> 24; + SUB_MIX_3[x] = t; + var t = x8 * 16843009 ^ x4 * 65537 ^ x2 * 257 ^ x * 16843008; + INV_SUB_MIX_0[sx] = t << 24 | t >>> 8; + INV_SUB_MIX_1[sx] = t << 16 | t >>> 16; + INV_SUB_MIX_2[sx] = t << 8 | t >>> 24; + INV_SUB_MIX_3[sx] = t; + if (!x) { + x = xi = 1; + } else { + x = x2 ^ d[d[d[x8 ^ x2]]]; + xi ^= d[d[xi]]; + } + } + })(); + var RCON = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54]; + var AES = C_algo.AES = BlockCipher.extend({ + _doReset: function() { + var t; + if (this._nRounds && this._keyPriorReset === this._key) { + return; + } + var key = this._keyPriorReset = this._key; + var keyWords = key.words; + var keySize = key.sigBytes / 4; + var nRounds = this._nRounds = keySize + 6; + var ksRows = (nRounds + 1) * 4; + var keySchedule = this._keySchedule = []; + for (var ksRow = 0; ksRow < ksRows; ksRow++) { + if (ksRow < keySize) { + keySchedule[ksRow] = keyWords[ksRow]; + } else { + t = keySchedule[ksRow - 1]; + if (!(ksRow % keySize)) { + t = t << 8 | t >>> 24; + t = SBOX[t >>> 24] << 24 | SBOX[t >>> 16 & 255] << 16 | SBOX[t >>> 8 & 255] << 8 | SBOX[t & 255]; + t ^= RCON[ksRow / keySize | 0] << 24; + } else if (keySize > 6 && ksRow % keySize == 4) { + t = SBOX[t >>> 24] << 24 | SBOX[t >>> 16 & 255] << 16 | SBOX[t >>> 8 & 255] << 8 | SBOX[t & 255]; + } + keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t; + } + } + var invKeySchedule = this._invKeySchedule = []; + for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) { + var ksRow = ksRows - invKsRow; + if (invKsRow % 4) { + var t = keySchedule[ksRow]; + } else { + var t = keySchedule[ksRow - 4]; + } + if (invKsRow < 4 || ksRow <= 4) { + invKeySchedule[invKsRow] = t; + } else { + invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[t >>> 16 & 255]] ^ INV_SUB_MIX_2[SBOX[t >>> 8 & 255]] ^ INV_SUB_MIX_3[SBOX[t & 255]]; + } + } + }, + encryptBlock: function(M, offset) { + this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX); + }, + decryptBlock: function(M, offset) { + var t = M[offset + 1]; + M[offset + 1] = M[offset + 3]; + M[offset + 3] = t; + this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX); + var t = M[offset + 1]; + M[offset + 1] = M[offset + 3]; + M[offset + 3] = t; + }, + _doCryptBlock: function(M, offset, keySchedule, SUB_MIX_02, SUB_MIX_12, SUB_MIX_22, SUB_MIX_32, SBOX2) { + var nRounds = this._nRounds; + var s0 = M[offset] ^ keySchedule[0]; + var s1 = M[offset + 1] ^ keySchedule[1]; + var s2 = M[offset + 2] ^ keySchedule[2]; + var s3 = M[offset + 3] ^ keySchedule[3]; + var ksRow = 4; + for (var round = 1; round < nRounds; round++) { + var t0 = SUB_MIX_02[s0 >>> 24] ^ SUB_MIX_12[s1 >>> 16 & 255] ^ SUB_MIX_22[s2 >>> 8 & 255] ^ SUB_MIX_32[s3 & 255] ^ keySchedule[ksRow++]; + var t1 = SUB_MIX_02[s1 >>> 24] ^ SUB_MIX_12[s2 >>> 16 & 255] ^ SUB_MIX_22[s3 >>> 8 & 255] ^ SUB_MIX_32[s0 & 255] ^ keySchedule[ksRow++]; + var t2 = SUB_MIX_02[s2 >>> 24] ^ SUB_MIX_12[s3 >>> 16 & 255] ^ SUB_MIX_22[s0 >>> 8 & 255] ^ SUB_MIX_32[s1 & 255] ^ keySchedule[ksRow++]; + var t3 = SUB_MIX_02[s3 >>> 24] ^ SUB_MIX_12[s0 >>> 16 & 255] ^ SUB_MIX_22[s1 >>> 8 & 255] ^ SUB_MIX_32[s2 & 255] ^ keySchedule[ksRow++]; + s0 = t0; + s1 = t1; + s2 = t2; + s3 = t3; + } + var t0 = (SBOX2[s0 >>> 24] << 24 | SBOX2[s1 >>> 16 & 255] << 16 | SBOX2[s2 >>> 8 & 255] << 8 | SBOX2[s3 & 255]) ^ keySchedule[ksRow++]; + var t1 = (SBOX2[s1 >>> 24] << 24 | SBOX2[s2 >>> 16 & 255] << 16 | SBOX2[s3 >>> 8 & 255] << 8 | SBOX2[s0 & 255]) ^ keySchedule[ksRow++]; + var t2 = (SBOX2[s2 >>> 24] << 24 | SBOX2[s3 >>> 16 & 255] << 16 | SBOX2[s0 >>> 8 & 255] << 8 | SBOX2[s1 & 255]) ^ keySchedule[ksRow++]; + var t3 = (SBOX2[s3 >>> 24] << 24 | SBOX2[s0 >>> 16 & 255] << 16 | SBOX2[s1 >>> 8 & 255] << 8 | SBOX2[s2 & 255]) ^ keySchedule[ksRow++]; + M[offset] = t0; + M[offset + 1] = t1; + M[offset + 2] = t2; + M[offset + 3] = t3; + }, + keySize: 256 / 32 + }); + C.AES = BlockCipher._createHelper(AES); + })(); + return CryptoJS.AES; + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/tripledes.js +var require_tripledes = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/tripledes.js"(exports, module) { + (function(root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core(), require_enc_base64(), require_md5(), require_evpkdf(), require_cipher_core()); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory); + } else { + factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + (function() { + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var BlockCipher = C_lib.BlockCipher; + var C_algo = C.algo; + var PC1 = [ + 57, + 49, + 41, + 33, + 25, + 17, + 9, + 1, + 58, + 50, + 42, + 34, + 26, + 18, + 10, + 2, + 59, + 51, + 43, + 35, + 27, + 19, + 11, + 3, + 60, + 52, + 44, + 36, + 63, + 55, + 47, + 39, + 31, + 23, + 15, + 7, + 62, + 54, + 46, + 38, + 30, + 22, + 14, + 6, + 61, + 53, + 45, + 37, + 29, + 21, + 13, + 5, + 28, + 20, + 12, + 4 + ]; + var PC2 = [ + 14, + 17, + 11, + 24, + 1, + 5, + 3, + 28, + 15, + 6, + 21, + 10, + 23, + 19, + 12, + 4, + 26, + 8, + 16, + 7, + 27, + 20, + 13, + 2, + 41, + 52, + 31, + 37, + 47, + 55, + 30, + 40, + 51, + 45, + 33, + 48, + 44, + 49, + 39, + 56, + 34, + 53, + 46, + 42, + 50, + 36, + 29, + 32 + ]; + var BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28]; + var SBOX_P = [ + { + 0: 8421888, + 268435456: 32768, + 536870912: 8421378, + 805306368: 2, + 1073741824: 512, + 1342177280: 8421890, + 1610612736: 8389122, + 1879048192: 8388608, + 2147483648: 514, + 2415919104: 8389120, + 2684354560: 33280, + 2952790016: 8421376, + 3221225472: 32770, + 3489660928: 8388610, + 3758096384: 0, + 4026531840: 33282, + 134217728: 0, + 402653184: 8421890, + 671088640: 33282, + 939524096: 32768, + 1207959552: 8421888, + 1476395008: 512, + 1744830464: 8421378, + 2013265920: 2, + 2281701376: 8389120, + 2550136832: 33280, + 2818572288: 8421376, + 3087007744: 8389122, + 3355443200: 8388610, + 3623878656: 32770, + 3892314112: 514, + 4160749568: 8388608, + 1: 32768, + 268435457: 2, + 536870913: 8421888, + 805306369: 8388608, + 1073741825: 8421378, + 1342177281: 33280, + 1610612737: 512, + 1879048193: 8389122, + 2147483649: 8421890, + 2415919105: 8421376, + 2684354561: 8388610, + 2952790017: 33282, + 3221225473: 514, + 3489660929: 8389120, + 3758096385: 32770, + 4026531841: 0, + 134217729: 8421890, + 402653185: 8421376, + 671088641: 8388608, + 939524097: 512, + 1207959553: 32768, + 1476395009: 8388610, + 1744830465: 2, + 2013265921: 33282, + 2281701377: 32770, + 2550136833: 8389122, + 2818572289: 514, + 3087007745: 8421888, + 3355443201: 8389120, + 3623878657: 0, + 3892314113: 33280, + 4160749569: 8421378 + }, + { + 0: 1074282512, + 16777216: 16384, + 33554432: 524288, + 50331648: 1074266128, + 67108864: 1073741840, + 83886080: 1074282496, + 100663296: 1073758208, + 117440512: 16, + 134217728: 540672, + 150994944: 1073758224, + 167772160: 1073741824, + 184549376: 540688, + 201326592: 524304, + 218103808: 0, + 234881024: 16400, + 251658240: 1074266112, + 8388608: 1073758208, + 25165824: 540688, + 41943040: 16, + 58720256: 1073758224, + 75497472: 1074282512, + 92274688: 1073741824, + 109051904: 524288, + 125829120: 1074266128, + 142606336: 524304, + 159383552: 0, + 176160768: 16384, + 192937984: 1074266112, + 209715200: 1073741840, + 226492416: 540672, + 243269632: 1074282496, + 260046848: 16400, + 268435456: 0, + 285212672: 1074266128, + 301989888: 1073758224, + 318767104: 1074282496, + 335544320: 1074266112, + 352321536: 16, + 369098752: 540688, + 385875968: 16384, + 402653184: 16400, + 419430400: 524288, + 436207616: 524304, + 452984832: 1073741840, + 469762048: 540672, + 486539264: 1073758208, + 503316480: 1073741824, + 520093696: 1074282512, + 276824064: 540688, + 293601280: 524288, + 310378496: 1074266112, + 327155712: 16384, + 343932928: 1073758208, + 360710144: 1074282512, + 377487360: 16, + 394264576: 1073741824, + 411041792: 1074282496, + 427819008: 1073741840, + 444596224: 1073758224, + 461373440: 524304, + 478150656: 0, + 494927872: 16400, + 511705088: 1074266128, + 528482304: 540672 + }, + { + 0: 260, + 1048576: 0, + 2097152: 67109120, + 3145728: 65796, + 4194304: 65540, + 5242880: 67108868, + 6291456: 67174660, + 7340032: 67174400, + 8388608: 67108864, + 9437184: 67174656, + 10485760: 65792, + 11534336: 67174404, + 12582912: 67109124, + 13631488: 65536, + 14680064: 4, + 15728640: 256, + 524288: 67174656, + 1572864: 67174404, + 2621440: 0, + 3670016: 67109120, + 4718592: 67108868, + 5767168: 65536, + 6815744: 65540, + 7864320: 260, + 8912896: 4, + 9961472: 256, + 11010048: 67174400, + 12058624: 65796, + 13107200: 65792, + 14155776: 67109124, + 15204352: 67174660, + 16252928: 67108864, + 16777216: 67174656, + 17825792: 65540, + 18874368: 65536, + 19922944: 67109120, + 20971520: 256, + 22020096: 67174660, + 23068672: 67108868, + 24117248: 0, + 25165824: 67109124, + 26214400: 67108864, + 27262976: 4, + 28311552: 65792, + 29360128: 67174400, + 30408704: 260, + 31457280: 65796, + 32505856: 67174404, + 17301504: 67108864, + 18350080: 260, + 19398656: 67174656, + 20447232: 0, + 21495808: 65540, + 22544384: 67109120, + 23592960: 256, + 24641536: 67174404, + 25690112: 65536, + 26738688: 67174660, + 27787264: 65796, + 28835840: 67108868, + 29884416: 67109124, + 30932992: 67174400, + 31981568: 4, + 33030144: 65792 + }, + { + 0: 2151682048, + 65536: 2147487808, + 131072: 4198464, + 196608: 2151677952, + 262144: 0, + 327680: 4198400, + 393216: 2147483712, + 458752: 4194368, + 524288: 2147483648, + 589824: 4194304, + 655360: 64, + 720896: 2147487744, + 786432: 2151678016, + 851968: 4160, + 917504: 4096, + 983040: 2151682112, + 32768: 2147487808, + 98304: 64, + 163840: 2151678016, + 229376: 2147487744, + 294912: 4198400, + 360448: 2151682112, + 425984: 0, + 491520: 2151677952, + 557056: 4096, + 622592: 2151682048, + 688128: 4194304, + 753664: 4160, + 819200: 2147483648, + 884736: 4194368, + 950272: 4198464, + 1015808: 2147483712, + 1048576: 4194368, + 1114112: 4198400, + 1179648: 2147483712, + 1245184: 0, + 1310720: 4160, + 1376256: 2151678016, + 1441792: 2151682048, + 1507328: 2147487808, + 1572864: 2151682112, + 1638400: 2147483648, + 1703936: 2151677952, + 1769472: 4198464, + 1835008: 2147487744, + 1900544: 4194304, + 1966080: 64, + 2031616: 4096, + 1081344: 2151677952, + 1146880: 2151682112, + 1212416: 0, + 1277952: 4198400, + 1343488: 4194368, + 1409024: 2147483648, + 1474560: 2147487808, + 1540096: 64, + 1605632: 2147483712, + 1671168: 4096, + 1736704: 2147487744, + 1802240: 2151678016, + 1867776: 4160, + 1933312: 2151682048, + 1998848: 4194304, + 2064384: 4198464 + }, + { + 0: 128, + 4096: 17039360, + 8192: 262144, + 12288: 536870912, + 16384: 537133184, + 20480: 16777344, + 24576: 553648256, + 28672: 262272, + 32768: 16777216, + 36864: 537133056, + 40960: 536871040, + 45056: 553910400, + 49152: 553910272, + 53248: 0, + 57344: 17039488, + 61440: 553648128, + 2048: 17039488, + 6144: 553648256, + 10240: 128, + 14336: 17039360, + 18432: 262144, + 22528: 537133184, + 26624: 553910272, + 30720: 536870912, + 34816: 537133056, + 38912: 0, + 43008: 553910400, + 47104: 16777344, + 51200: 536871040, + 55296: 553648128, + 59392: 16777216, + 63488: 262272, + 65536: 262144, + 69632: 128, + 73728: 536870912, + 77824: 553648256, + 81920: 16777344, + 86016: 553910272, + 90112: 537133184, + 94208: 16777216, + 98304: 553910400, + 102400: 553648128, + 106496: 17039360, + 110592: 537133056, + 114688: 262272, + 118784: 536871040, + 122880: 0, + 126976: 17039488, + 67584: 553648256, + 71680: 16777216, + 75776: 17039360, + 79872: 537133184, + 83968: 536870912, + 88064: 17039488, + 92160: 128, + 96256: 553910272, + 100352: 262272, + 104448: 553910400, + 108544: 0, + 112640: 553648128, + 116736: 16777344, + 120832: 262144, + 124928: 537133056, + 129024: 536871040 + }, + { + 0: 268435464, + 256: 8192, + 512: 270532608, + 768: 270540808, + 1024: 268443648, + 1280: 2097152, + 1536: 2097160, + 1792: 268435456, + 2048: 0, + 2304: 268443656, + 2560: 2105344, + 2816: 8, + 3072: 270532616, + 3328: 2105352, + 3584: 8200, + 3840: 270540800, + 128: 270532608, + 384: 270540808, + 640: 8, + 896: 2097152, + 1152: 2105352, + 1408: 268435464, + 1664: 268443648, + 1920: 8200, + 2176: 2097160, + 2432: 8192, + 2688: 268443656, + 2944: 270532616, + 3200: 0, + 3456: 270540800, + 3712: 2105344, + 3968: 268435456, + 4096: 268443648, + 4352: 270532616, + 4608: 270540808, + 4864: 8200, + 5120: 2097152, + 5376: 268435456, + 5632: 268435464, + 5888: 2105344, + 6144: 2105352, + 6400: 0, + 6656: 8, + 6912: 270532608, + 7168: 8192, + 7424: 268443656, + 7680: 270540800, + 7936: 2097160, + 4224: 8, + 4480: 2105344, + 4736: 2097152, + 4992: 268435464, + 5248: 268443648, + 5504: 8200, + 5760: 270540808, + 6016: 270532608, + 6272: 270540800, + 6528: 270532616, + 6784: 8192, + 7040: 2105352, + 7296: 2097160, + 7552: 0, + 7808: 268435456, + 8064: 268443656 + }, + { + 0: 1048576, + 16: 33555457, + 32: 1024, + 48: 1049601, + 64: 34604033, + 80: 0, + 96: 1, + 112: 34603009, + 128: 33555456, + 144: 1048577, + 160: 33554433, + 176: 34604032, + 192: 34603008, + 208: 1025, + 224: 1049600, + 240: 33554432, + 8: 34603009, + 24: 0, + 40: 33555457, + 56: 34604032, + 72: 1048576, + 88: 33554433, + 104: 33554432, + 120: 1025, + 136: 1049601, + 152: 33555456, + 168: 34603008, + 184: 1048577, + 200: 1024, + 216: 34604033, + 232: 1, + 248: 1049600, + 256: 33554432, + 272: 1048576, + 288: 33555457, + 304: 34603009, + 320: 1048577, + 336: 33555456, + 352: 34604032, + 368: 1049601, + 384: 1025, + 400: 34604033, + 416: 1049600, + 432: 1, + 448: 0, + 464: 34603008, + 480: 33554433, + 496: 1024, + 264: 1049600, + 280: 33555457, + 296: 34603009, + 312: 1, + 328: 33554432, + 344: 1048576, + 360: 1025, + 376: 34604032, + 392: 33554433, + 408: 34603008, + 424: 0, + 440: 34604033, + 456: 1049601, + 472: 1024, + 488: 33555456, + 504: 1048577 + }, + { + 0: 134219808, + 1: 131072, + 2: 134217728, + 3: 32, + 4: 131104, + 5: 134350880, + 6: 134350848, + 7: 2048, + 8: 134348800, + 9: 134219776, + 10: 133120, + 11: 134348832, + 12: 2080, + 13: 0, + 14: 134217760, + 15: 133152, + 2147483648: 2048, + 2147483649: 134350880, + 2147483650: 134219808, + 2147483651: 134217728, + 2147483652: 134348800, + 2147483653: 133120, + 2147483654: 133152, + 2147483655: 32, + 2147483656: 134217760, + 2147483657: 2080, + 2147483658: 131104, + 2147483659: 134350848, + 2147483660: 0, + 2147483661: 134348832, + 2147483662: 134219776, + 2147483663: 131072, + 16: 133152, + 17: 134350848, + 18: 32, + 19: 2048, + 20: 134219776, + 21: 134217760, + 22: 134348832, + 23: 131072, + 24: 0, + 25: 131104, + 26: 134348800, + 27: 134219808, + 28: 134350880, + 29: 133120, + 30: 2080, + 31: 134217728, + 2147483664: 131072, + 2147483665: 2048, + 2147483666: 134348832, + 2147483667: 133152, + 2147483668: 32, + 2147483669: 134348800, + 2147483670: 134217728, + 2147483671: 134219808, + 2147483672: 134350880, + 2147483673: 134217760, + 2147483674: 134219776, + 2147483675: 0, + 2147483676: 133120, + 2147483677: 2080, + 2147483678: 131104, + 2147483679: 134350848 + } + ]; + var SBOX_MASK = [ + 4160749569, + 528482304, + 33030144, + 2064384, + 129024, + 8064, + 504, + 2147483679 + ]; + var DES = C_algo.DES = BlockCipher.extend({ + _doReset: function() { + var key = this._key; + var keyWords = key.words; + var keyBits = []; + for (var i = 0; i < 56; i++) { + var keyBitPos = PC1[i] - 1; + keyBits[i] = keyWords[keyBitPos >>> 5] >>> 31 - keyBitPos % 32 & 1; + } + var subKeys = this._subKeys = []; + for (var nSubKey = 0; nSubKey < 16; nSubKey++) { + var subKey = subKeys[nSubKey] = []; + var bitShift = BIT_SHIFTS[nSubKey]; + for (var i = 0; i < 24; i++) { + subKey[i / 6 | 0] |= keyBits[(PC2[i] - 1 + bitShift) % 28] << 31 - i % 6; + subKey[4 + (i / 6 | 0)] |= keyBits[28 + (PC2[i + 24] - 1 + bitShift) % 28] << 31 - i % 6; + } + subKey[0] = subKey[0] << 1 | subKey[0] >>> 31; + for (var i = 1; i < 7; i++) { + subKey[i] = subKey[i] >>> (i - 1) * 4 + 3; + } + subKey[7] = subKey[7] << 5 | subKey[7] >>> 27; + } + var invSubKeys = this._invSubKeys = []; + for (var i = 0; i < 16; i++) { + invSubKeys[i] = subKeys[15 - i]; + } + }, + encryptBlock: function(M, offset) { + this._doCryptBlock(M, offset, this._subKeys); + }, + decryptBlock: function(M, offset) { + this._doCryptBlock(M, offset, this._invSubKeys); + }, + _doCryptBlock: function(M, offset, subKeys) { + this._lBlock = M[offset]; + this._rBlock = M[offset + 1]; + exchangeLR.call(this, 4, 252645135); + exchangeLR.call(this, 16, 65535); + exchangeRL.call(this, 2, 858993459); + exchangeRL.call(this, 8, 16711935); + exchangeLR.call(this, 1, 1431655765); + for (var round = 0; round < 16; round++) { + var subKey = subKeys[round]; + var lBlock = this._lBlock; + var rBlock = this._rBlock; + var f = 0; + for (var i = 0; i < 8; i++) { + f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0]; + } + this._lBlock = rBlock; + this._rBlock = lBlock ^ f; + } + var t = this._lBlock; + this._lBlock = this._rBlock; + this._rBlock = t; + exchangeLR.call(this, 1, 1431655765); + exchangeRL.call(this, 8, 16711935); + exchangeRL.call(this, 2, 858993459); + exchangeLR.call(this, 16, 65535); + exchangeLR.call(this, 4, 252645135); + M[offset] = this._lBlock; + M[offset + 1] = this._rBlock; + }, + keySize: 64 / 32, + ivSize: 64 / 32, + blockSize: 64 / 32 + }); + function exchangeLR(offset, mask) { + var t = (this._lBlock >>> offset ^ this._rBlock) & mask; + this._rBlock ^= t; + this._lBlock ^= t << offset; + } + function exchangeRL(offset, mask) { + var t = (this._rBlock >>> offset ^ this._lBlock) & mask; + this._lBlock ^= t; + this._rBlock ^= t << offset; + } + C.DES = BlockCipher._createHelper(DES); + var TripleDES = C_algo.TripleDES = BlockCipher.extend({ + _doReset: function() { + var key = this._key; + var keyWords = key.words; + if (keyWords.length !== 2 && keyWords.length !== 4 && keyWords.length < 6) { + throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192."); + } + var key1 = keyWords.slice(0, 2); + var key2 = keyWords.length < 4 ? keyWords.slice(0, 2) : keyWords.slice(2, 4); + var key3 = keyWords.length < 6 ? keyWords.slice(0, 2) : keyWords.slice(4, 6); + this._des1 = DES.createEncryptor(WordArray.create(key1)); + this._des2 = DES.createEncryptor(WordArray.create(key2)); + this._des3 = DES.createEncryptor(WordArray.create(key3)); + }, + encryptBlock: function(M, offset) { + this._des1.encryptBlock(M, offset); + this._des2.decryptBlock(M, offset); + this._des3.encryptBlock(M, offset); + }, + decryptBlock: function(M, offset) { + this._des3.decryptBlock(M, offset); + this._des2.encryptBlock(M, offset); + this._des1.decryptBlock(M, offset); + }, + keySize: 192 / 32, + ivSize: 64 / 32, + blockSize: 64 / 32 + }); + C.TripleDES = BlockCipher._createHelper(TripleDES); + })(); + return CryptoJS.TripleDES; + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/rc4.js +var require_rc4 = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/rc4.js"(exports, module) { + (function(root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core(), require_enc_base64(), require_md5(), require_evpkdf(), require_cipher_core()); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory); + } else { + factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + (function() { + var C = CryptoJS; + var C_lib = C.lib; + var StreamCipher = C_lib.StreamCipher; + var C_algo = C.algo; + var RC4 = C_algo.RC4 = StreamCipher.extend({ + _doReset: function() { + var key = this._key; + var keyWords = key.words; + var keySigBytes = key.sigBytes; + var S = this._S = []; + for (var i = 0; i < 256; i++) { + S[i] = i; + } + for (var i = 0, j = 0; i < 256; i++) { + var keyByteIndex = i % keySigBytes; + var keyByte = keyWords[keyByteIndex >>> 2] >>> 24 - keyByteIndex % 4 * 8 & 255; + j = (j + S[i] + keyByte) % 256; + var t = S[i]; + S[i] = S[j]; + S[j] = t; + } + this._i = this._j = 0; + }, + _doProcessBlock: function(M, offset) { + M[offset] ^= generateKeystreamWord.call(this); + }, + keySize: 256 / 32, + ivSize: 0 + }); + function generateKeystreamWord() { + var S = this._S; + var i = this._i; + var j = this._j; + var keystreamWord = 0; + for (var n = 0; n < 4; n++) { + i = (i + 1) % 256; + j = (j + S[i]) % 256; + var t = S[i]; + S[i] = S[j]; + S[j] = t; + keystreamWord |= S[(S[i] + S[j]) % 256] << 24 - n * 8; + } + this._i = i; + this._j = j; + return keystreamWord; + } + C.RC4 = StreamCipher._createHelper(RC4); + var RC4Drop = C_algo.RC4Drop = RC4.extend({ + /** + * Configuration options. + * + * @property {number} drop The number of keystream words to drop. Default 192 + */ + cfg: RC4.cfg.extend({ + drop: 192 + }), + _doReset: function() { + RC4._doReset.call(this); + for (var i = this.cfg.drop; i > 0; i--) { + generateKeystreamWord.call(this); + } + } + }); + C.RC4Drop = StreamCipher._createHelper(RC4Drop); + })(); + return CryptoJS.RC4; + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/rabbit.js +var require_rabbit = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/rabbit.js"(exports, module) { + (function(root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core(), require_enc_base64(), require_md5(), require_evpkdf(), require_cipher_core()); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory); + } else { + factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + (function() { + var C = CryptoJS; + var C_lib = C.lib; + var StreamCipher = C_lib.StreamCipher; + var C_algo = C.algo; + var S = []; + var C_ = []; + var G = []; + var Rabbit = C_algo.Rabbit = StreamCipher.extend({ + _doReset: function() { + var K = this._key.words; + var iv = this.cfg.iv; + for (var i = 0; i < 4; i++) { + K[i] = (K[i] << 8 | K[i] >>> 24) & 16711935 | (K[i] << 24 | K[i] >>> 8) & 4278255360; + } + var X = this._X = [ + K[0], + K[3] << 16 | K[2] >>> 16, + K[1], + K[0] << 16 | K[3] >>> 16, + K[2], + K[1] << 16 | K[0] >>> 16, + K[3], + K[2] << 16 | K[1] >>> 16 + ]; + var C2 = this._C = [ + K[2] << 16 | K[2] >>> 16, + K[0] & 4294901760 | K[1] & 65535, + K[3] << 16 | K[3] >>> 16, + K[1] & 4294901760 | K[2] & 65535, + K[0] << 16 | K[0] >>> 16, + K[2] & 4294901760 | K[3] & 65535, + K[1] << 16 | K[1] >>> 16, + K[3] & 4294901760 | K[0] & 65535 + ]; + this._b = 0; + for (var i = 0; i < 4; i++) { + nextState.call(this); + } + for (var i = 0; i < 8; i++) { + C2[i] ^= X[i + 4 & 7]; + } + if (iv) { + var IV = iv.words; + var IV_0 = IV[0]; + var IV_1 = IV[1]; + var i0 = (IV_0 << 8 | IV_0 >>> 24) & 16711935 | (IV_0 << 24 | IV_0 >>> 8) & 4278255360; + var i2 = (IV_1 << 8 | IV_1 >>> 24) & 16711935 | (IV_1 << 24 | IV_1 >>> 8) & 4278255360; + var i1 = i0 >>> 16 | i2 & 4294901760; + var i3 = i2 << 16 | i0 & 65535; + C2[0] ^= i0; + C2[1] ^= i1; + C2[2] ^= i2; + C2[3] ^= i3; + C2[4] ^= i0; + C2[5] ^= i1; + C2[6] ^= i2; + C2[7] ^= i3; + for (var i = 0; i < 4; i++) { + nextState.call(this); + } + } + }, + _doProcessBlock: function(M, offset) { + var X = this._X; + nextState.call(this); + S[0] = X[0] ^ X[5] >>> 16 ^ X[3] << 16; + S[1] = X[2] ^ X[7] >>> 16 ^ X[5] << 16; + S[2] = X[4] ^ X[1] >>> 16 ^ X[7] << 16; + S[3] = X[6] ^ X[3] >>> 16 ^ X[1] << 16; + for (var i = 0; i < 4; i++) { + S[i] = (S[i] << 8 | S[i] >>> 24) & 16711935 | (S[i] << 24 | S[i] >>> 8) & 4278255360; + M[offset + i] ^= S[i]; + } + }, + blockSize: 128 / 32, + ivSize: 64 / 32 + }); + function nextState() { + var X = this._X; + var C2 = this._C; + for (var i = 0; i < 8; i++) { + C_[i] = C2[i]; + } + C2[0] = C2[0] + 1295307597 + this._b | 0; + C2[1] = C2[1] + 3545052371 + (C2[0] >>> 0 < C_[0] >>> 0 ? 1 : 0) | 0; + C2[2] = C2[2] + 886263092 + (C2[1] >>> 0 < C_[1] >>> 0 ? 1 : 0) | 0; + C2[3] = C2[3] + 1295307597 + (C2[2] >>> 0 < C_[2] >>> 0 ? 1 : 0) | 0; + C2[4] = C2[4] + 3545052371 + (C2[3] >>> 0 < C_[3] >>> 0 ? 1 : 0) | 0; + C2[5] = C2[5] + 886263092 + (C2[4] >>> 0 < C_[4] >>> 0 ? 1 : 0) | 0; + C2[6] = C2[6] + 1295307597 + (C2[5] >>> 0 < C_[5] >>> 0 ? 1 : 0) | 0; + C2[7] = C2[7] + 3545052371 + (C2[6] >>> 0 < C_[6] >>> 0 ? 1 : 0) | 0; + this._b = C2[7] >>> 0 < C_[7] >>> 0 ? 1 : 0; + for (var i = 0; i < 8; i++) { + var gx = X[i] + C2[i]; + var ga = gx & 65535; + var gb = gx >>> 16; + var gh = ((ga * ga >>> 17) + ga * gb >>> 15) + gb * gb; + var gl = ((gx & 4294901760) * gx | 0) + ((gx & 65535) * gx | 0); + G[i] = gh ^ gl; + } + X[0] = G[0] + (G[7] << 16 | G[7] >>> 16) + (G[6] << 16 | G[6] >>> 16) | 0; + X[1] = G[1] + (G[0] << 8 | G[0] >>> 24) + G[7] | 0; + X[2] = G[2] + (G[1] << 16 | G[1] >>> 16) + (G[0] << 16 | G[0] >>> 16) | 0; + X[3] = G[3] + (G[2] << 8 | G[2] >>> 24) + G[1] | 0; + X[4] = G[4] + (G[3] << 16 | G[3] >>> 16) + (G[2] << 16 | G[2] >>> 16) | 0; + X[5] = G[5] + (G[4] << 8 | G[4] >>> 24) + G[3] | 0; + X[6] = G[6] + (G[5] << 16 | G[5] >>> 16) + (G[4] << 16 | G[4] >>> 16) | 0; + X[7] = G[7] + (G[6] << 8 | G[6] >>> 24) + G[5] | 0; + } + C.Rabbit = StreamCipher._createHelper(Rabbit); + })(); + return CryptoJS.Rabbit; + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/rabbit-legacy.js +var require_rabbit_legacy = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/rabbit-legacy.js"(exports, module) { + (function(root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core(), require_enc_base64(), require_md5(), require_evpkdf(), require_cipher_core()); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory); + } else { + factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + (function() { + var C = CryptoJS; + var C_lib = C.lib; + var StreamCipher = C_lib.StreamCipher; + var C_algo = C.algo; + var S = []; + var C_ = []; + var G = []; + var RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({ + _doReset: function() { + var K = this._key.words; + var iv = this.cfg.iv; + var X = this._X = [ + K[0], + K[3] << 16 | K[2] >>> 16, + K[1], + K[0] << 16 | K[3] >>> 16, + K[2], + K[1] << 16 | K[0] >>> 16, + K[3], + K[2] << 16 | K[1] >>> 16 + ]; + var C2 = this._C = [ + K[2] << 16 | K[2] >>> 16, + K[0] & 4294901760 | K[1] & 65535, + K[3] << 16 | K[3] >>> 16, + K[1] & 4294901760 | K[2] & 65535, + K[0] << 16 | K[0] >>> 16, + K[2] & 4294901760 | K[3] & 65535, + K[1] << 16 | K[1] >>> 16, + K[3] & 4294901760 | K[0] & 65535 + ]; + this._b = 0; + for (var i = 0; i < 4; i++) { + nextState.call(this); + } + for (var i = 0; i < 8; i++) { + C2[i] ^= X[i + 4 & 7]; + } + if (iv) { + var IV = iv.words; + var IV_0 = IV[0]; + var IV_1 = IV[1]; + var i0 = (IV_0 << 8 | IV_0 >>> 24) & 16711935 | (IV_0 << 24 | IV_0 >>> 8) & 4278255360; + var i2 = (IV_1 << 8 | IV_1 >>> 24) & 16711935 | (IV_1 << 24 | IV_1 >>> 8) & 4278255360; + var i1 = i0 >>> 16 | i2 & 4294901760; + var i3 = i2 << 16 | i0 & 65535; + C2[0] ^= i0; + C2[1] ^= i1; + C2[2] ^= i2; + C2[3] ^= i3; + C2[4] ^= i0; + C2[5] ^= i1; + C2[6] ^= i2; + C2[7] ^= i3; + for (var i = 0; i < 4; i++) { + nextState.call(this); + } + } + }, + _doProcessBlock: function(M, offset) { + var X = this._X; + nextState.call(this); + S[0] = X[0] ^ X[5] >>> 16 ^ X[3] << 16; + S[1] = X[2] ^ X[7] >>> 16 ^ X[5] << 16; + S[2] = X[4] ^ X[1] >>> 16 ^ X[7] << 16; + S[3] = X[6] ^ X[3] >>> 16 ^ X[1] << 16; + for (var i = 0; i < 4; i++) { + S[i] = (S[i] << 8 | S[i] >>> 24) & 16711935 | (S[i] << 24 | S[i] >>> 8) & 4278255360; + M[offset + i] ^= S[i]; + } + }, + blockSize: 128 / 32, + ivSize: 64 / 32 + }); + function nextState() { + var X = this._X; + var C2 = this._C; + for (var i = 0; i < 8; i++) { + C_[i] = C2[i]; + } + C2[0] = C2[0] + 1295307597 + this._b | 0; + C2[1] = C2[1] + 3545052371 + (C2[0] >>> 0 < C_[0] >>> 0 ? 1 : 0) | 0; + C2[2] = C2[2] + 886263092 + (C2[1] >>> 0 < C_[1] >>> 0 ? 1 : 0) | 0; + C2[3] = C2[3] + 1295307597 + (C2[2] >>> 0 < C_[2] >>> 0 ? 1 : 0) | 0; + C2[4] = C2[4] + 3545052371 + (C2[3] >>> 0 < C_[3] >>> 0 ? 1 : 0) | 0; + C2[5] = C2[5] + 886263092 + (C2[4] >>> 0 < C_[4] >>> 0 ? 1 : 0) | 0; + C2[6] = C2[6] + 1295307597 + (C2[5] >>> 0 < C_[5] >>> 0 ? 1 : 0) | 0; + C2[7] = C2[7] + 3545052371 + (C2[6] >>> 0 < C_[6] >>> 0 ? 1 : 0) | 0; + this._b = C2[7] >>> 0 < C_[7] >>> 0 ? 1 : 0; + for (var i = 0; i < 8; i++) { + var gx = X[i] + C2[i]; + var ga = gx & 65535; + var gb = gx >>> 16; + var gh = ((ga * ga >>> 17) + ga * gb >>> 15) + gb * gb; + var gl = ((gx & 4294901760) * gx | 0) + ((gx & 65535) * gx | 0); + G[i] = gh ^ gl; + } + X[0] = G[0] + (G[7] << 16 | G[7] >>> 16) + (G[6] << 16 | G[6] >>> 16) | 0; + X[1] = G[1] + (G[0] << 8 | G[0] >>> 24) + G[7] | 0; + X[2] = G[2] + (G[1] << 16 | G[1] >>> 16) + (G[0] << 16 | G[0] >>> 16) | 0; + X[3] = G[3] + (G[2] << 8 | G[2] >>> 24) + G[1] | 0; + X[4] = G[4] + (G[3] << 16 | G[3] >>> 16) + (G[2] << 16 | G[2] >>> 16) | 0; + X[5] = G[5] + (G[4] << 8 | G[4] >>> 24) + G[3] | 0; + X[6] = G[6] + (G[5] << 16 | G[5] >>> 16) + (G[4] << 16 | G[4] >>> 16) | 0; + X[7] = G[7] + (G[6] << 8 | G[6] >>> 24) + G[5] | 0; + } + C.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy); + })(); + return CryptoJS.RabbitLegacy; + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/blowfish.js +var require_blowfish = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/blowfish.js"(exports, module) { + (function(root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core(), require_enc_base64(), require_md5(), require_evpkdf(), require_cipher_core()); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory); + } else { + factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + (function() { + var C = CryptoJS; + var C_lib = C.lib; + var BlockCipher = C_lib.BlockCipher; + var C_algo = C.algo; + const N = 16; + const ORIG_P = [ + 608135816, + 2242054355, + 320440878, + 57701188, + 2752067618, + 698298832, + 137296536, + 3964562569, + 1160258022, + 953160567, + 3193202383, + 887688300, + 3232508343, + 3380367581, + 1065670069, + 3041331479, + 2450970073, + 2306472731 + ]; + const ORIG_S = [ + [ + 3509652390, + 2564797868, + 805139163, + 3491422135, + 3101798381, + 1780907670, + 3128725573, + 4046225305, + 614570311, + 3012652279, + 134345442, + 2240740374, + 1667834072, + 1901547113, + 2757295779, + 4103290238, + 227898511, + 1921955416, + 1904987480, + 2182433518, + 2069144605, + 3260701109, + 2620446009, + 720527379, + 3318853667, + 677414384, + 3393288472, + 3101374703, + 2390351024, + 1614419982, + 1822297739, + 2954791486, + 3608508353, + 3174124327, + 2024746970, + 1432378464, + 3864339955, + 2857741204, + 1464375394, + 1676153920, + 1439316330, + 715854006, + 3033291828, + 289532110, + 2706671279, + 2087905683, + 3018724369, + 1668267050, + 732546397, + 1947742710, + 3462151702, + 2609353502, + 2950085171, + 1814351708, + 2050118529, + 680887927, + 999245976, + 1800124847, + 3300911131, + 1713906067, + 1641548236, + 4213287313, + 1216130144, + 1575780402, + 4018429277, + 3917837745, + 3693486850, + 3949271944, + 596196993, + 3549867205, + 258830323, + 2213823033, + 772490370, + 2760122372, + 1774776394, + 2652871518, + 566650946, + 4142492826, + 1728879713, + 2882767088, + 1783734482, + 3629395816, + 2517608232, + 2874225571, + 1861159788, + 326777828, + 3124490320, + 2130389656, + 2716951837, + 967770486, + 1724537150, + 2185432712, + 2364442137, + 1164943284, + 2105845187, + 998989502, + 3765401048, + 2244026483, + 1075463327, + 1455516326, + 1322494562, + 910128902, + 469688178, + 1117454909, + 936433444, + 3490320968, + 3675253459, + 1240580251, + 122909385, + 2157517691, + 634681816, + 4142456567, + 3825094682, + 3061402683, + 2540495037, + 79693498, + 3249098678, + 1084186820, + 1583128258, + 426386531, + 1761308591, + 1047286709, + 322548459, + 995290223, + 1845252383, + 2603652396, + 3431023940, + 2942221577, + 3202600964, + 3727903485, + 1712269319, + 422464435, + 3234572375, + 1170764815, + 3523960633, + 3117677531, + 1434042557, + 442511882, + 3600875718, + 1076654713, + 1738483198, + 4213154764, + 2393238008, + 3677496056, + 1014306527, + 4251020053, + 793779912, + 2902807211, + 842905082, + 4246964064, + 1395751752, + 1040244610, + 2656851899, + 3396308128, + 445077038, + 3742853595, + 3577915638, + 679411651, + 2892444358, + 2354009459, + 1767581616, + 3150600392, + 3791627101, + 3102740896, + 284835224, + 4246832056, + 1258075500, + 768725851, + 2589189241, + 3069724005, + 3532540348, + 1274779536, + 3789419226, + 2764799539, + 1660621633, + 3471099624, + 4011903706, + 913787905, + 3497959166, + 737222580, + 2514213453, + 2928710040, + 3937242737, + 1804850592, + 3499020752, + 2949064160, + 2386320175, + 2390070455, + 2415321851, + 4061277028, + 2290661394, + 2416832540, + 1336762016, + 1754252060, + 3520065937, + 3014181293, + 791618072, + 3188594551, + 3933548030, + 2332172193, + 3852520463, + 3043980520, + 413987798, + 3465142937, + 3030929376, + 4245938359, + 2093235073, + 3534596313, + 375366246, + 2157278981, + 2479649556, + 555357303, + 3870105701, + 2008414854, + 3344188149, + 4221384143, + 3956125452, + 2067696032, + 3594591187, + 2921233993, + 2428461, + 544322398, + 577241275, + 1471733935, + 610547355, + 4027169054, + 1432588573, + 1507829418, + 2025931657, + 3646575487, + 545086370, + 48609733, + 2200306550, + 1653985193, + 298326376, + 1316178497, + 3007786442, + 2064951626, + 458293330, + 2589141269, + 3591329599, + 3164325604, + 727753846, + 2179363840, + 146436021, + 1461446943, + 4069977195, + 705550613, + 3059967265, + 3887724982, + 4281599278, + 3313849956, + 1404054877, + 2845806497, + 146425753, + 1854211946 + ], + [ + 1266315497, + 3048417604, + 3681880366, + 3289982499, + 290971e4, + 1235738493, + 2632868024, + 2414719590, + 3970600049, + 1771706367, + 1449415276, + 3266420449, + 422970021, + 1963543593, + 2690192192, + 3826793022, + 1062508698, + 1531092325, + 1804592342, + 2583117782, + 2714934279, + 4024971509, + 1294809318, + 4028980673, + 1289560198, + 2221992742, + 1669523910, + 35572830, + 157838143, + 1052438473, + 1016535060, + 1802137761, + 1753167236, + 1386275462, + 3080475397, + 2857371447, + 1040679964, + 2145300060, + 2390574316, + 1461121720, + 2956646967, + 4031777805, + 4028374788, + 33600511, + 2920084762, + 1018524850, + 629373528, + 3691585981, + 3515945977, + 2091462646, + 2486323059, + 586499841, + 988145025, + 935516892, + 3367335476, + 2599673255, + 2839830854, + 265290510, + 3972581182, + 2759138881, + 3795373465, + 1005194799, + 847297441, + 406762289, + 1314163512, + 1332590856, + 1866599683, + 4127851711, + 750260880, + 613907577, + 1450815602, + 3165620655, + 3734664991, + 3650291728, + 3012275730, + 3704569646, + 1427272223, + 778793252, + 1343938022, + 2676280711, + 2052605720, + 1946737175, + 3164576444, + 3914038668, + 3967478842, + 3682934266, + 1661551462, + 3294938066, + 4011595847, + 840292616, + 3712170807, + 616741398, + 312560963, + 711312465, + 1351876610, + 322626781, + 1910503582, + 271666773, + 2175563734, + 1594956187, + 70604529, + 3617834859, + 1007753275, + 1495573769, + 4069517037, + 2549218298, + 2663038764, + 504708206, + 2263041392, + 3941167025, + 2249088522, + 1514023603, + 1998579484, + 1312622330, + 694541497, + 2582060303, + 2151582166, + 1382467621, + 776784248, + 2618340202, + 3323268794, + 2497899128, + 2784771155, + 503983604, + 4076293799, + 907881277, + 423175695, + 432175456, + 1378068232, + 4145222326, + 3954048622, + 3938656102, + 3820766613, + 2793130115, + 2977904593, + 26017576, + 3274890735, + 3194772133, + 1700274565, + 1756076034, + 4006520079, + 3677328699, + 720338349, + 1533947780, + 354530856, + 688349552, + 3973924725, + 1637815568, + 332179504, + 3949051286, + 53804574, + 2852348879, + 3044236432, + 1282449977, + 3583942155, + 3416972820, + 4006381244, + 1617046695, + 2628476075, + 3002303598, + 1686838959, + 431878346, + 2686675385, + 1700445008, + 1080580658, + 1009431731, + 832498133, + 3223435511, + 2605976345, + 2271191193, + 2516031870, + 1648197032, + 4164389018, + 2548247927, + 300782431, + 375919233, + 238389289, + 3353747414, + 2531188641, + 2019080857, + 1475708069, + 455242339, + 2609103871, + 448939670, + 3451063019, + 1395535956, + 2413381860, + 1841049896, + 1491858159, + 885456874, + 4264095073, + 4001119347, + 1565136089, + 3898914787, + 1108368660, + 540939232, + 1173283510, + 2745871338, + 3681308437, + 4207628240, + 3343053890, + 4016749493, + 1699691293, + 1103962373, + 3625875870, + 2256883143, + 3830138730, + 1031889488, + 3479347698, + 1535977030, + 4236805024, + 3251091107, + 2132092099, + 1774941330, + 1199868427, + 1452454533, + 157007616, + 2904115357, + 342012276, + 595725824, + 1480756522, + 206960106, + 497939518, + 591360097, + 863170706, + 2375253569, + 3596610801, + 1814182875, + 2094937945, + 3421402208, + 1082520231, + 3463918190, + 2785509508, + 435703966, + 3908032597, + 1641649973, + 2842273706, + 3305899714, + 1510255612, + 2148256476, + 2655287854, + 3276092548, + 4258621189, + 236887753, + 3681803219, + 274041037, + 1734335097, + 3815195456, + 3317970021, + 1899903192, + 1026095262, + 4050517792, + 356393447, + 2410691914, + 3873677099, + 3682840055 + ], + [ + 3913112168, + 2491498743, + 4132185628, + 2489919796, + 1091903735, + 1979897079, + 3170134830, + 3567386728, + 3557303409, + 857797738, + 1136121015, + 1342202287, + 507115054, + 2535736646, + 337727348, + 3213592640, + 1301675037, + 2528481711, + 1895095763, + 1721773893, + 3216771564, + 62756741, + 2142006736, + 835421444, + 2531993523, + 1442658625, + 3659876326, + 2882144922, + 676362277, + 1392781812, + 170690266, + 3921047035, + 1759253602, + 3611846912, + 1745797284, + 664899054, + 1329594018, + 3901205900, + 3045908486, + 2062866102, + 2865634940, + 3543621612, + 3464012697, + 1080764994, + 553557557, + 3656615353, + 3996768171, + 991055499, + 499776247, + 1265440854, + 648242737, + 3940784050, + 980351604, + 3713745714, + 1749149687, + 3396870395, + 4211799374, + 3640570775, + 1161844396, + 3125318951, + 1431517754, + 545492359, + 4268468663, + 3499529547, + 1437099964, + 2702547544, + 3433638243, + 2581715763, + 2787789398, + 1060185593, + 1593081372, + 2418618748, + 4260947970, + 69676912, + 2159744348, + 86519011, + 2512459080, + 3838209314, + 1220612927, + 3339683548, + 133810670, + 1090789135, + 1078426020, + 1569222167, + 845107691, + 3583754449, + 4072456591, + 1091646820, + 628848692, + 1613405280, + 3757631651, + 526609435, + 236106946, + 48312990, + 2942717905, + 3402727701, + 1797494240, + 859738849, + 992217954, + 4005476642, + 2243076622, + 3870952857, + 3732016268, + 765654824, + 3490871365, + 2511836413, + 1685915746, + 3888969200, + 1414112111, + 2273134842, + 3281911079, + 4080962846, + 172450625, + 2569994100, + 980381355, + 4109958455, + 2819808352, + 2716589560, + 2568741196, + 3681446669, + 3329971472, + 1835478071, + 660984891, + 3704678404, + 4045999559, + 3422617507, + 3040415634, + 1762651403, + 1719377915, + 3470491036, + 2693910283, + 3642056355, + 3138596744, + 1364962596, + 2073328063, + 1983633131, + 926494387, + 3423689081, + 2150032023, + 4096667949, + 1749200295, + 3328846651, + 309677260, + 2016342300, + 1779581495, + 3079819751, + 111262694, + 1274766160, + 443224088, + 298511866, + 1025883608, + 3806446537, + 1145181785, + 168956806, + 3641502830, + 3584813610, + 1689216846, + 3666258015, + 3200248200, + 1692713982, + 2646376535, + 4042768518, + 1618508792, + 1610833997, + 3523052358, + 4130873264, + 2001055236, + 3610705100, + 2202168115, + 4028541809, + 2961195399, + 1006657119, + 2006996926, + 3186142756, + 1430667929, + 3210227297, + 1314452623, + 4074634658, + 4101304120, + 2273951170, + 1399257539, + 3367210612, + 3027628629, + 1190975929, + 2062231137, + 2333990788, + 2221543033, + 2438960610, + 1181637006, + 548689776, + 2362791313, + 3372408396, + 3104550113, + 3145860560, + 296247880, + 1970579870, + 3078560182, + 3769228297, + 1714227617, + 3291629107, + 3898220290, + 166772364, + 1251581989, + 493813264, + 448347421, + 195405023, + 2709975567, + 677966185, + 3703036547, + 1463355134, + 2715995803, + 1338867538, + 1343315457, + 2802222074, + 2684532164, + 233230375, + 2599980071, + 2000651841, + 3277868038, + 1638401717, + 4028070440, + 3237316320, + 6314154, + 819756386, + 300326615, + 590932579, + 1405279636, + 3267499572, + 3150704214, + 2428286686, + 3959192993, + 3461946742, + 1862657033, + 1266418056, + 963775037, + 2089974820, + 2263052895, + 1917689273, + 448879540, + 3550394620, + 3981727096, + 150775221, + 3627908307, + 1303187396, + 508620638, + 2975983352, + 2726630617, + 1817252668, + 1876281319, + 1457606340, + 908771278, + 3720792119, + 3617206836, + 2455994898, + 1729034894, + 1080033504 + ], + [ + 976866871, + 3556439503, + 2881648439, + 1522871579, + 1555064734, + 1336096578, + 3548522304, + 2579274686, + 3574697629, + 3205460757, + 3593280638, + 3338716283, + 3079412587, + 564236357, + 2993598910, + 1781952180, + 1464380207, + 3163844217, + 3332601554, + 1699332808, + 1393555694, + 1183702653, + 3581086237, + 1288719814, + 691649499, + 2847557200, + 2895455976, + 3193889540, + 2717570544, + 1781354906, + 1676643554, + 2592534050, + 3230253752, + 1126444790, + 2770207658, + 2633158820, + 2210423226, + 2615765581, + 2414155088, + 3127139286, + 673620729, + 2805611233, + 1269405062, + 4015350505, + 3341807571, + 4149409754, + 1057255273, + 2012875353, + 2162469141, + 2276492801, + 2601117357, + 993977747, + 3918593370, + 2654263191, + 753973209, + 36408145, + 2530585658, + 25011837, + 3520020182, + 2088578344, + 530523599, + 2918365339, + 1524020338, + 1518925132, + 3760827505, + 3759777254, + 1202760957, + 3985898139, + 3906192525, + 674977740, + 4174734889, + 2031300136, + 2019492241, + 3983892565, + 4153806404, + 3822280332, + 352677332, + 2297720250, + 60907813, + 90501309, + 3286998549, + 1016092578, + 2535922412, + 2839152426, + 457141659, + 509813237, + 4120667899, + 652014361, + 1966332200, + 2975202805, + 55981186, + 2327461051, + 676427537, + 3255491064, + 2882294119, + 3433927263, + 1307055953, + 942726286, + 933058658, + 2468411793, + 3933900994, + 4215176142, + 1361170020, + 2001714738, + 2830558078, + 3274259782, + 1222529897, + 1679025792, + 2729314320, + 3714953764, + 1770335741, + 151462246, + 3013232138, + 1682292957, + 1483529935, + 471910574, + 1539241949, + 458788160, + 3436315007, + 1807016891, + 3718408830, + 978976581, + 1043663428, + 3165965781, + 1927990952, + 4200891579, + 2372276910, + 3208408903, + 3533431907, + 1412390302, + 2931980059, + 4132332400, + 1947078029, + 3881505623, + 4168226417, + 2941484381, + 1077988104, + 1320477388, + 886195818, + 18198404, + 3786409e3, + 2509781533, + 112762804, + 3463356488, + 1866414978, + 891333506, + 18488651, + 661792760, + 1628790961, + 3885187036, + 3141171499, + 876946877, + 2693282273, + 1372485963, + 791857591, + 2686433993, + 3759982718, + 3167212022, + 3472953795, + 2716379847, + 445679433, + 3561995674, + 3504004811, + 3574258232, + 54117162, + 3331405415, + 2381918588, + 3769707343, + 4154350007, + 1140177722, + 4074052095, + 668550556, + 3214352940, + 367459370, + 261225585, + 2610173221, + 4209349473, + 3468074219, + 3265815641, + 314222801, + 3066103646, + 3808782860, + 282218597, + 3406013506, + 3773591054, + 379116347, + 1285071038, + 846784868, + 2669647154, + 3771962079, + 3550491691, + 2305946142, + 453669953, + 1268987020, + 3317592352, + 3279303384, + 3744833421, + 2610507566, + 3859509063, + 266596637, + 3847019092, + 517658769, + 3462560207, + 3443424879, + 370717030, + 4247526661, + 2224018117, + 4143653529, + 4112773975, + 2788324899, + 2477274417, + 1456262402, + 2901442914, + 1517677493, + 1846949527, + 2295493580, + 3734397586, + 2176403920, + 1280348187, + 1908823572, + 3871786941, + 846861322, + 1172426758, + 3287448474, + 3383383037, + 1655181056, + 3139813346, + 901632758, + 1897031941, + 2986607138, + 3066810236, + 3447102507, + 1393639104, + 373351379, + 950779232, + 625454576, + 3124240540, + 4148612726, + 2007998917, + 544563296, + 2244738638, + 2330496472, + 2058025392, + 1291430526, + 424198748, + 50039436, + 29584100, + 3605783033, + 2429876329, + 2791104160, + 1057563949, + 3255363231, + 3075367218, + 3463963227, + 1469046755, + 985887462 + ] + ]; + var BLOWFISH_CTX = { + pbox: [], + sbox: [] + }; + function F(ctx, x) { + let a = x >> 24 & 255; + let b = x >> 16 & 255; + let c = x >> 8 & 255; + let d = x & 255; + let y = ctx.sbox[0][a] + ctx.sbox[1][b]; + y = y ^ ctx.sbox[2][c]; + y = y + ctx.sbox[3][d]; + return y; + } + function BlowFish_Encrypt(ctx, left, right) { + let Xl = left; + let Xr = right; + let temp; + for (let i = 0; i < N; ++i) { + Xl = Xl ^ ctx.pbox[i]; + Xr = F(ctx, Xl) ^ Xr; + temp = Xl; + Xl = Xr; + Xr = temp; + } + temp = Xl; + Xl = Xr; + Xr = temp; + Xr = Xr ^ ctx.pbox[N]; + Xl = Xl ^ ctx.pbox[N + 1]; + return { left: Xl, right: Xr }; + } + function BlowFish_Decrypt(ctx, left, right) { + let Xl = left; + let Xr = right; + let temp; + for (let i = N + 1; i > 1; --i) { + Xl = Xl ^ ctx.pbox[i]; + Xr = F(ctx, Xl) ^ Xr; + temp = Xl; + Xl = Xr; + Xr = temp; + } + temp = Xl; + Xl = Xr; + Xr = temp; + Xr = Xr ^ ctx.pbox[1]; + Xl = Xl ^ ctx.pbox[0]; + return { left: Xl, right: Xr }; + } + function BlowFishInit(ctx, key, keysize) { + for (let Row = 0; Row < 4; Row++) { + ctx.sbox[Row] = []; + for (let Col = 0; Col < 256; Col++) { + ctx.sbox[Row][Col] = ORIG_S[Row][Col]; + } + } + let keyIndex = 0; + for (let index = 0; index < N + 2; index++) { + ctx.pbox[index] = ORIG_P[index] ^ key[keyIndex]; + keyIndex++; + if (keyIndex >= keysize) { + keyIndex = 0; + } + } + let Data1 = 0; + let Data2 = 0; + let res = 0; + for (let i = 0; i < N + 2; i += 2) { + res = BlowFish_Encrypt(ctx, Data1, Data2); + Data1 = res.left; + Data2 = res.right; + ctx.pbox[i] = Data1; + ctx.pbox[i + 1] = Data2; + } + for (let i = 0; i < 4; i++) { + for (let j = 0; j < 256; j += 2) { + res = BlowFish_Encrypt(ctx, Data1, Data2); + Data1 = res.left; + Data2 = res.right; + ctx.sbox[i][j] = Data1; + ctx.sbox[i][j + 1] = Data2; + } + } + return true; + } + var Blowfish = C_algo.Blowfish = BlockCipher.extend({ + _doReset: function() { + if (this._keyPriorReset === this._key) { + return; + } + var key = this._keyPriorReset = this._key; + var keyWords = key.words; + var keySize = key.sigBytes / 4; + BlowFishInit(BLOWFISH_CTX, keyWords, keySize); + }, + encryptBlock: function(M, offset) { + var res = BlowFish_Encrypt(BLOWFISH_CTX, M[offset], M[offset + 1]); + M[offset] = res.left; + M[offset + 1] = res.right; + }, + decryptBlock: function(M, offset) { + var res = BlowFish_Decrypt(BLOWFISH_CTX, M[offset], M[offset + 1]); + M[offset] = res.left; + M[offset + 1] = res.right; + }, + blockSize: 64 / 32, + keySize: 128 / 32, + ivSize: 64 / 32 + }); + C.Blowfish = BlockCipher._createHelper(Blowfish); + })(); + return CryptoJS.Blowfish; + }); + } +}); + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/index.js +var require_crypto_js = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/crypto-js/index.js"(exports, module) { + (function(root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(require_core(), require_x64_core(), require_lib_typedarrays(), require_enc_utf16(), require_enc_base64(), require_enc_base64url(), require_md5(), require_sha1(), require_sha256(), require_sha224(), require_sha512(), require_sha384(), require_sha3(), require_ripemd160(), require_hmac(), require_pbkdf2(), require_evpkdf(), require_cipher_core(), require_mode_cfb(), require_mode_ctr(), require_mode_ctr_gladman(), require_mode_ofb(), require_mode_ecb(), require_pad_ansix923(), require_pad_iso10126(), require_pad_iso97971(), require_pad_zeropadding(), require_pad_nopadding(), require_format_hex(), require_aes(), require_tripledes(), require_rc4(), require_rabbit(), require_rabbit_legacy(), require_blowfish()); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./x64-core", "./lib-typedarrays", "./enc-utf16", "./enc-base64", "./enc-base64url", "./md5", "./sha1", "./sha256", "./sha224", "./sha512", "./sha384", "./sha3", "./ripemd160", "./hmac", "./pbkdf2", "./evpkdf", "./cipher-core", "./mode-cfb", "./mode-ctr", "./mode-ctr-gladman", "./mode-ofb", "./mode-ecb", "./pad-ansix923", "./pad-iso10126", "./pad-iso97971", "./pad-zeropadding", "./pad-nopadding", "./format-hex", "./aes", "./tripledes", "./rc4", "./rabbit", "./rabbit-legacy", "./blowfish"], factory); + } else { + root.CryptoJS = factory(root.CryptoJS); + } + })(exports, function(CryptoJS) { + return CryptoJS; + }); + } +}); +export default require_crypto_js(); +/*! Bundled license information: + +crypto-js/ripemd160.js: + (** @preserve + (c) 2012 by Cédric Mesnil. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + *) + +crypto-js/mode-ctr-gladman.js: + (** @preserve + * Counter block mode compatible with Dr Brian Gladman fileenc.c + * derived from CryptoJS.mode.CTR + * Jan Hruby jhruby.web@gmail.com + *) +*/ +//# sourceMappingURL=crypto-js.js.map diff --git a/jiuyi2/unpackage/dist/cache/.vite/deps/crypto-js.js.map b/jiuyi2/unpackage/dist/cache/.vite/deps/crypto-js.js.map new file mode 100644 index 00000000..e49d916a --- /dev/null +++ b/jiuyi2/unpackage/dist/cache/.vite/deps/crypto-js.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["browser-external:crypto", "../../../../../node_modules/crypto-js/core.js", "../../../../../node_modules/crypto-js/x64-core.js", "../../../../../node_modules/crypto-js/lib-typedarrays.js", "../../../../../node_modules/crypto-js/enc-utf16.js", "../../../../../node_modules/crypto-js/enc-base64.js", "../../../../../node_modules/crypto-js/enc-base64url.js", "../../../../../node_modules/crypto-js/md5.js", "../../../../../node_modules/crypto-js/sha1.js", "../../../../../node_modules/crypto-js/sha256.js", "../../../../../node_modules/crypto-js/sha224.js", "../../../../../node_modules/crypto-js/sha512.js", "../../../../../node_modules/crypto-js/sha384.js", "../../../../../node_modules/crypto-js/sha3.js", "../../../../../node_modules/crypto-js/ripemd160.js", "../../../../../node_modules/crypto-js/hmac.js", "../../../../../node_modules/crypto-js/pbkdf2.js", "../../../../../node_modules/crypto-js/evpkdf.js", "../../../../../node_modules/crypto-js/cipher-core.js", "../../../../../node_modules/crypto-js/mode-cfb.js", "../../../../../node_modules/crypto-js/mode-ctr.js", "../../../../../node_modules/crypto-js/mode-ctr-gladman.js", "../../../../../node_modules/crypto-js/mode-ofb.js", "../../../../../node_modules/crypto-js/mode-ecb.js", "../../../../../node_modules/crypto-js/pad-ansix923.js", "../../../../../node_modules/crypto-js/pad-iso10126.js", "../../../../../node_modules/crypto-js/pad-iso97971.js", "../../../../../node_modules/crypto-js/pad-zeropadding.js", "../../../../../node_modules/crypto-js/pad-nopadding.js", "../../../../../node_modules/crypto-js/format-hex.js", "../../../../../node_modules/crypto-js/aes.js", "../../../../../node_modules/crypto-js/tripledes.js", "../../../../../node_modules/crypto-js/rc4.js", "../../../../../node_modules/crypto-js/rabbit.js", "../../../../../node_modules/crypto-js/rabbit-legacy.js", "../../../../../node_modules/crypto-js/blowfish.js", "../../../../../node_modules/crypto-js/index.js"], + "sourcesContent": ["module.exports = Object.create(new Proxy({}, {\n get(_, key) {\n if (\n key !== '__esModule' &&\n key !== '__proto__' &&\n key !== 'constructor' &&\n key !== 'splice'\n ) {\n console.warn(`Module \"crypto\" has been externalized for browser compatibility. Cannot access \"crypto.${key}\" in client code. See https://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.`)\n }\n }\n}))", ";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory();\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\troot.CryptoJS = factory();\n\t}\n}(this, function () {\n\n\t/*globals window, global, require*/\n\n\t/**\n\t * CryptoJS core components.\n\t */\n\tvar CryptoJS = CryptoJS || (function (Math, undefined) {\n\n\t var crypto;\n\n\t // Native crypto from window (Browser)\n\t if (typeof window !== 'undefined' && window.crypto) {\n\t crypto = window.crypto;\n\t }\n\n\t // Native crypto in web worker (Browser)\n\t if (typeof self !== 'undefined' && self.crypto) {\n\t crypto = self.crypto;\n\t }\n\n\t // Native crypto from worker\n\t if (typeof globalThis !== 'undefined' && globalThis.crypto) {\n\t crypto = globalThis.crypto;\n\t }\n\n\t // Native (experimental IE 11) crypto from window (Browser)\n\t if (!crypto && typeof window !== 'undefined' && window.msCrypto) {\n\t crypto = window.msCrypto;\n\t }\n\n\t // Native crypto from global (NodeJS)\n\t if (!crypto && typeof global !== 'undefined' && global.crypto) {\n\t crypto = global.crypto;\n\t }\n\n\t // Native crypto import via require (NodeJS)\n\t if (!crypto && typeof require === 'function') {\n\t try {\n\t crypto = require('crypto');\n\t } catch (err) {}\n\t }\n\n\t /*\n\t * Cryptographically secure pseudorandom number generator\n\t *\n\t * As Math.random() is cryptographically not safe to use\n\t */\n\t var cryptoSecureRandomInt = function () {\n\t if (crypto) {\n\t // Use getRandomValues method (Browser)\n\t if (typeof crypto.getRandomValues === 'function') {\n\t try {\n\t return crypto.getRandomValues(new Uint32Array(1))[0];\n\t } catch (err) {}\n\t }\n\n\t // Use randomBytes method (NodeJS)\n\t if (typeof crypto.randomBytes === 'function') {\n\t try {\n\t return crypto.randomBytes(4).readInt32LE();\n\t } catch (err) {}\n\t }\n\t }\n\n\t throw new Error('Native crypto module could not be used to get secure random number.');\n\t };\n\n\t /*\n\t * Local polyfill of Object.create\n\n\t */\n\t var create = Object.create || (function () {\n\t function F() {}\n\n\t return function (obj) {\n\t var subtype;\n\n\t F.prototype = obj;\n\n\t subtype = new F();\n\n\t F.prototype = null;\n\n\t return subtype;\n\t };\n\t }());\n\n\t /**\n\t * CryptoJS namespace.\n\t */\n\t var C = {};\n\n\t /**\n\t * Library namespace.\n\t */\n\t var C_lib = C.lib = {};\n\n\t /**\n\t * Base object for prototypal inheritance.\n\t */\n\t var Base = C_lib.Base = (function () {\n\n\n\t return {\n\t /**\n\t * Creates a new object that inherits from this object.\n\t *\n\t * @param {Object} overrides Properties to copy into the new object.\n\t *\n\t * @return {Object} The new object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var MyType = CryptoJS.lib.Base.extend({\n\t * field: 'value',\n\t *\n\t * method: function () {\n\t * }\n\t * });\n\t */\n\t extend: function (overrides) {\n\t // Spawn\n\t var subtype = create(this);\n\n\t // Augment\n\t if (overrides) {\n\t subtype.mixIn(overrides);\n\t }\n\n\t // Create default initializer\n\t if (!subtype.hasOwnProperty('init') || this.init === subtype.init) {\n\t subtype.init = function () {\n\t subtype.$super.init.apply(this, arguments);\n\t };\n\t }\n\n\t // Initializer's prototype is the subtype object\n\t subtype.init.prototype = subtype;\n\n\t // Reference supertype\n\t subtype.$super = this;\n\n\t return subtype;\n\t },\n\n\t /**\n\t * Extends this object and runs the init method.\n\t * Arguments to create() will be passed to init().\n\t *\n\t * @return {Object} The new object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var instance = MyType.create();\n\t */\n\t create: function () {\n\t var instance = this.extend();\n\t instance.init.apply(instance, arguments);\n\n\t return instance;\n\t },\n\n\t /**\n\t * Initializes a newly created object.\n\t * Override this method to add some logic when your objects are created.\n\t *\n\t * @example\n\t *\n\t * var MyType = CryptoJS.lib.Base.extend({\n\t * init: function () {\n\t * // ...\n\t * }\n\t * });\n\t */\n\t init: function () {\n\t },\n\n\t /**\n\t * Copies properties into this object.\n\t *\n\t * @param {Object} properties The properties to mix in.\n\t *\n\t * @example\n\t *\n\t * MyType.mixIn({\n\t * field: 'value'\n\t * });\n\t */\n\t mixIn: function (properties) {\n\t for (var propertyName in properties) {\n\t if (properties.hasOwnProperty(propertyName)) {\n\t this[propertyName] = properties[propertyName];\n\t }\n\t }\n\n\t // IE won't copy toString using the loop above\n\t if (properties.hasOwnProperty('toString')) {\n\t this.toString = properties.toString;\n\t }\n\t },\n\n\t /**\n\t * Creates a copy of this object.\n\t *\n\t * @return {Object} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = instance.clone();\n\t */\n\t clone: function () {\n\t return this.init.prototype.extend(this);\n\t }\n\t };\n\t }());\n\n\t /**\n\t * An array of 32-bit words.\n\t *\n\t * @property {Array} words The array of 32-bit words.\n\t * @property {number} sigBytes The number of significant bytes in this word array.\n\t */\n\t var WordArray = C_lib.WordArray = Base.extend({\n\t /**\n\t * Initializes a newly created word array.\n\t *\n\t * @param {Array} words (Optional) An array of 32-bit words.\n\t * @param {number} sigBytes (Optional) The number of significant bytes in the words.\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.lib.WordArray.create();\n\t * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);\n\t * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);\n\t */\n\t init: function (words, sigBytes) {\n\t words = this.words = words || [];\n\n\t if (sigBytes != undefined) {\n\t this.sigBytes = sigBytes;\n\t } else {\n\t this.sigBytes = words.length * 4;\n\t }\n\t },\n\n\t /**\n\t * Converts this word array to a string.\n\t *\n\t * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex\n\t *\n\t * @return {string} The stringified word array.\n\t *\n\t * @example\n\t *\n\t * var string = wordArray + '';\n\t * var string = wordArray.toString();\n\t * var string = wordArray.toString(CryptoJS.enc.Utf8);\n\t */\n\t toString: function (encoder) {\n\t return (encoder || Hex).stringify(this);\n\t },\n\n\t /**\n\t * Concatenates a word array to this word array.\n\t *\n\t * @param {WordArray} wordArray The word array to append.\n\t *\n\t * @return {WordArray} This word array.\n\t *\n\t * @example\n\t *\n\t * wordArray1.concat(wordArray2);\n\t */\n\t concat: function (wordArray) {\n\t // Shortcuts\n\t var thisWords = this.words;\n\t var thatWords = wordArray.words;\n\t var thisSigBytes = this.sigBytes;\n\t var thatSigBytes = wordArray.sigBytes;\n\n\t // Clamp excess bits\n\t this.clamp();\n\n\t // Concat\n\t if (thisSigBytes % 4) {\n\t // Copy one byte at a time\n\t for (var i = 0; i < thatSigBytes; i++) {\n\t var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);\n\t }\n\t } else {\n\t // Copy one word at a time\n\t for (var j = 0; j < thatSigBytes; j += 4) {\n\t thisWords[(thisSigBytes + j) >>> 2] = thatWords[j >>> 2];\n\t }\n\t }\n\t this.sigBytes += thatSigBytes;\n\n\t // Chainable\n\t return this;\n\t },\n\n\t /**\n\t * Removes insignificant bits.\n\t *\n\t * @example\n\t *\n\t * wordArray.clamp();\n\t */\n\t clamp: function () {\n\t // Shortcuts\n\t var words = this.words;\n\t var sigBytes = this.sigBytes;\n\n\t // Clamp\n\t words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);\n\t words.length = Math.ceil(sigBytes / 4);\n\t },\n\n\t /**\n\t * Creates a copy of this word array.\n\t *\n\t * @return {WordArray} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = wordArray.clone();\n\t */\n\t clone: function () {\n\t var clone = Base.clone.call(this);\n\t clone.words = this.words.slice(0);\n\n\t return clone;\n\t },\n\n\t /**\n\t * Creates a word array filled with random bytes.\n\t *\n\t * @param {number} nBytes The number of random bytes to generate.\n\t *\n\t * @return {WordArray} The random word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.lib.WordArray.random(16);\n\t */\n\t random: function (nBytes) {\n\t var words = [];\n\n\t for (var i = 0; i < nBytes; i += 4) {\n\t words.push(cryptoSecureRandomInt());\n\t }\n\n\t return new WordArray.init(words, nBytes);\n\t }\n\t });\n\n\t /**\n\t * Encoder namespace.\n\t */\n\t var C_enc = C.enc = {};\n\n\t /**\n\t * Hex encoding strategy.\n\t */\n\t var Hex = C_enc.Hex = {\n\t /**\n\t * Converts a word array to a hex string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The hex string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hexString = CryptoJS.enc.Hex.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\n\t // Convert\n\t var hexChars = [];\n\t for (var i = 0; i < sigBytes; i++) {\n\t var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t hexChars.push((bite >>> 4).toString(16));\n\t hexChars.push((bite & 0x0f).toString(16));\n\t }\n\n\t return hexChars.join('');\n\t },\n\n\t /**\n\t * Converts a hex string to a word array.\n\t *\n\t * @param {string} hexStr The hex string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Hex.parse(hexString);\n\t */\n\t parse: function (hexStr) {\n\t // Shortcut\n\t var hexStrLength = hexStr.length;\n\n\t // Convert\n\t var words = [];\n\t for (var i = 0; i < hexStrLength; i += 2) {\n\t words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);\n\t }\n\n\t return new WordArray.init(words, hexStrLength / 2);\n\t }\n\t };\n\n\t /**\n\t * Latin1 encoding strategy.\n\t */\n\t var Latin1 = C_enc.Latin1 = {\n\t /**\n\t * Converts a word array to a Latin1 string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The Latin1 string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\n\t // Convert\n\t var latin1Chars = [];\n\t for (var i = 0; i < sigBytes; i++) {\n\t var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t latin1Chars.push(String.fromCharCode(bite));\n\t }\n\n\t return latin1Chars.join('');\n\t },\n\n\t /**\n\t * Converts a Latin1 string to a word array.\n\t *\n\t * @param {string} latin1Str The Latin1 string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);\n\t */\n\t parse: function (latin1Str) {\n\t // Shortcut\n\t var latin1StrLength = latin1Str.length;\n\n\t // Convert\n\t var words = [];\n\t for (var i = 0; i < latin1StrLength; i++) {\n\t words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);\n\t }\n\n\t return new WordArray.init(words, latin1StrLength);\n\t }\n\t };\n\n\t /**\n\t * UTF-8 encoding strategy.\n\t */\n\t var Utf8 = C_enc.Utf8 = {\n\t /**\n\t * Converts a word array to a UTF-8 string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The UTF-8 string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t try {\n\t return decodeURIComponent(escape(Latin1.stringify(wordArray)));\n\t } catch (e) {\n\t throw new Error('Malformed UTF-8 data');\n\t }\n\t },\n\n\t /**\n\t * Converts a UTF-8 string to a word array.\n\t *\n\t * @param {string} utf8Str The UTF-8 string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);\n\t */\n\t parse: function (utf8Str) {\n\t return Latin1.parse(unescape(encodeURIComponent(utf8Str)));\n\t }\n\t };\n\n\t /**\n\t * Abstract buffered block algorithm template.\n\t *\n\t * The property blockSize must be implemented in a concrete subtype.\n\t *\n\t * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0\n\t */\n\t var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({\n\t /**\n\t * Resets this block algorithm's data buffer to its initial state.\n\t *\n\t * @example\n\t *\n\t * bufferedBlockAlgorithm.reset();\n\t */\n\t reset: function () {\n\t // Initial values\n\t this._data = new WordArray.init();\n\t this._nDataBytes = 0;\n\t },\n\n\t /**\n\t * Adds new data to this block algorithm's buffer.\n\t *\n\t * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.\n\t *\n\t * @example\n\t *\n\t * bufferedBlockAlgorithm._append('data');\n\t * bufferedBlockAlgorithm._append(wordArray);\n\t */\n\t _append: function (data) {\n\t // Convert string to WordArray, else assume WordArray already\n\t if (typeof data == 'string') {\n\t data = Utf8.parse(data);\n\t }\n\n\t // Append\n\t this._data.concat(data);\n\t this._nDataBytes += data.sigBytes;\n\t },\n\n\t /**\n\t * Processes available data blocks.\n\t *\n\t * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.\n\t *\n\t * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.\n\t *\n\t * @return {WordArray} The processed data.\n\t *\n\t * @example\n\t *\n\t * var processedData = bufferedBlockAlgorithm._process();\n\t * var processedData = bufferedBlockAlgorithm._process(!!'flush');\n\t */\n\t _process: function (doFlush) {\n\t var processedWords;\n\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\t var dataSigBytes = data.sigBytes;\n\t var blockSize = this.blockSize;\n\t var blockSizeBytes = blockSize * 4;\n\n\t // Count blocks ready\n\t var nBlocksReady = dataSigBytes / blockSizeBytes;\n\t if (doFlush) {\n\t // Round up to include partial blocks\n\t nBlocksReady = Math.ceil(nBlocksReady);\n\t } else {\n\t // Round down to include only full blocks,\n\t // less the number of blocks that must remain in the buffer\n\t nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);\n\t }\n\n\t // Count words ready\n\t var nWordsReady = nBlocksReady * blockSize;\n\n\t // Count bytes ready\n\t var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);\n\n\t // Process blocks\n\t if (nWordsReady) {\n\t for (var offset = 0; offset < nWordsReady; offset += blockSize) {\n\t // Perform concrete-algorithm logic\n\t this._doProcessBlock(dataWords, offset);\n\t }\n\n\t // Remove processed words\n\t processedWords = dataWords.splice(0, nWordsReady);\n\t data.sigBytes -= nBytesReady;\n\t }\n\n\t // Return processed words\n\t return new WordArray.init(processedWords, nBytesReady);\n\t },\n\n\t /**\n\t * Creates a copy of this object.\n\t *\n\t * @return {Object} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = bufferedBlockAlgorithm.clone();\n\t */\n\t clone: function () {\n\t var clone = Base.clone.call(this);\n\t clone._data = this._data.clone();\n\n\t return clone;\n\t },\n\n\t _minBufferSize: 0\n\t });\n\n\t /**\n\t * Abstract hasher template.\n\t *\n\t * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)\n\t */\n\t var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({\n\t /**\n\t * Configuration options.\n\t */\n\t cfg: Base.extend(),\n\n\t /**\n\t * Initializes a newly created hasher.\n\t *\n\t * @param {Object} cfg (Optional) The configuration options to use for this hash computation.\n\t *\n\t * @example\n\t *\n\t * var hasher = CryptoJS.algo.SHA256.create();\n\t */\n\t init: function (cfg) {\n\t // Apply config defaults\n\t this.cfg = this.cfg.extend(cfg);\n\n\t // Set initial values\n\t this.reset();\n\t },\n\n\t /**\n\t * Resets this hasher to its initial state.\n\t *\n\t * @example\n\t *\n\t * hasher.reset();\n\t */\n\t reset: function () {\n\t // Reset data buffer\n\t BufferedBlockAlgorithm.reset.call(this);\n\n\t // Perform concrete-hasher logic\n\t this._doReset();\n\t },\n\n\t /**\n\t * Updates this hasher with a message.\n\t *\n\t * @param {WordArray|string} messageUpdate The message to append.\n\t *\n\t * @return {Hasher} This hasher.\n\t *\n\t * @example\n\t *\n\t * hasher.update('message');\n\t * hasher.update(wordArray);\n\t */\n\t update: function (messageUpdate) {\n\t // Append\n\t this._append(messageUpdate);\n\n\t // Update the hash\n\t this._process();\n\n\t // Chainable\n\t return this;\n\t },\n\n\t /**\n\t * Finalizes the hash computation.\n\t * Note that the finalize operation is effectively a destructive, read-once operation.\n\t *\n\t * @param {WordArray|string} messageUpdate (Optional) A final message update.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @example\n\t *\n\t * var hash = hasher.finalize();\n\t * var hash = hasher.finalize('message');\n\t * var hash = hasher.finalize(wordArray);\n\t */\n\t finalize: function (messageUpdate) {\n\t // Final message update\n\t if (messageUpdate) {\n\t this._append(messageUpdate);\n\t }\n\n\t // Perform concrete-hasher logic\n\t var hash = this._doFinalize();\n\n\t return hash;\n\t },\n\n\t blockSize: 512/32,\n\n\t /**\n\t * Creates a shortcut function to a hasher's object interface.\n\t *\n\t * @param {Hasher} hasher The hasher to create a helper for.\n\t *\n\t * @return {Function} The shortcut function.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);\n\t */\n\t _createHelper: function (hasher) {\n\t return function (message, cfg) {\n\t return new hasher.init(cfg).finalize(message);\n\t };\n\t },\n\n\t /**\n\t * Creates a shortcut function to the HMAC's object interface.\n\t *\n\t * @param {Hasher} hasher The hasher to use in this HMAC helper.\n\t *\n\t * @return {Function} The shortcut function.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);\n\t */\n\t _createHmacHelper: function (hasher) {\n\t return function (message, key) {\n\t return new C_algo.HMAC.init(hasher, key).finalize(message);\n\t };\n\t }\n\t });\n\n\t /**\n\t * Algorithm namespace.\n\t */\n\t var C_algo = C.algo = {};\n\n\t return C;\n\t}(Math));\n\n\n\treturn CryptoJS;\n\n}));", ";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function (undefined) {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var Base = C_lib.Base;\n\t var X32WordArray = C_lib.WordArray;\n\n\t /**\n\t * x64 namespace.\n\t */\n\t var C_x64 = C.x64 = {};\n\n\t /**\n\t * A 64-bit word.\n\t */\n\t var X64Word = C_x64.Word = Base.extend({\n\t /**\n\t * Initializes a newly created 64-bit word.\n\t *\n\t * @param {number} high The high 32 bits.\n\t * @param {number} low The low 32 bits.\n\t *\n\t * @example\n\t *\n\t * var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607);\n\t */\n\t init: function (high, low) {\n\t this.high = high;\n\t this.low = low;\n\t }\n\n\t /**\n\t * Bitwise NOTs this word.\n\t *\n\t * @return {X64Word} A new x64-Word object after negating.\n\t *\n\t * @example\n\t *\n\t * var negated = x64Word.not();\n\t */\n\t // not: function () {\n\t // var high = ~this.high;\n\t // var low = ~this.low;\n\n\t // return X64Word.create(high, low);\n\t // },\n\n\t /**\n\t * Bitwise ANDs this word with the passed word.\n\t *\n\t * @param {X64Word} word The x64-Word to AND with this word.\n\t *\n\t * @return {X64Word} A new x64-Word object after ANDing.\n\t *\n\t * @example\n\t *\n\t * var anded = x64Word.and(anotherX64Word);\n\t */\n\t // and: function (word) {\n\t // var high = this.high & word.high;\n\t // var low = this.low & word.low;\n\n\t // return X64Word.create(high, low);\n\t // },\n\n\t /**\n\t * Bitwise ORs this word with the passed word.\n\t *\n\t * @param {X64Word} word The x64-Word to OR with this word.\n\t *\n\t * @return {X64Word} A new x64-Word object after ORing.\n\t *\n\t * @example\n\t *\n\t * var ored = x64Word.or(anotherX64Word);\n\t */\n\t // or: function (word) {\n\t // var high = this.high | word.high;\n\t // var low = this.low | word.low;\n\n\t // return X64Word.create(high, low);\n\t // },\n\n\t /**\n\t * Bitwise XORs this word with the passed word.\n\t *\n\t * @param {X64Word} word The x64-Word to XOR with this word.\n\t *\n\t * @return {X64Word} A new x64-Word object after XORing.\n\t *\n\t * @example\n\t *\n\t * var xored = x64Word.xor(anotherX64Word);\n\t */\n\t // xor: function (word) {\n\t // var high = this.high ^ word.high;\n\t // var low = this.low ^ word.low;\n\n\t // return X64Word.create(high, low);\n\t // },\n\n\t /**\n\t * Shifts this word n bits to the left.\n\t *\n\t * @param {number} n The number of bits to shift.\n\t *\n\t * @return {X64Word} A new x64-Word object after shifting.\n\t *\n\t * @example\n\t *\n\t * var shifted = x64Word.shiftL(25);\n\t */\n\t // shiftL: function (n) {\n\t // if (n < 32) {\n\t // var high = (this.high << n) | (this.low >>> (32 - n));\n\t // var low = this.low << n;\n\t // } else {\n\t // var high = this.low << (n - 32);\n\t // var low = 0;\n\t // }\n\n\t // return X64Word.create(high, low);\n\t // },\n\n\t /**\n\t * Shifts this word n bits to the right.\n\t *\n\t * @param {number} n The number of bits to shift.\n\t *\n\t * @return {X64Word} A new x64-Word object after shifting.\n\t *\n\t * @example\n\t *\n\t * var shifted = x64Word.shiftR(7);\n\t */\n\t // shiftR: function (n) {\n\t // if (n < 32) {\n\t // var low = (this.low >>> n) | (this.high << (32 - n));\n\t // var high = this.high >>> n;\n\t // } else {\n\t // var low = this.high >>> (n - 32);\n\t // var high = 0;\n\t // }\n\n\t // return X64Word.create(high, low);\n\t // },\n\n\t /**\n\t * Rotates this word n bits to the left.\n\t *\n\t * @param {number} n The number of bits to rotate.\n\t *\n\t * @return {X64Word} A new x64-Word object after rotating.\n\t *\n\t * @example\n\t *\n\t * var rotated = x64Word.rotL(25);\n\t */\n\t // rotL: function (n) {\n\t // return this.shiftL(n).or(this.shiftR(64 - n));\n\t // },\n\n\t /**\n\t * Rotates this word n bits to the right.\n\t *\n\t * @param {number} n The number of bits to rotate.\n\t *\n\t * @return {X64Word} A new x64-Word object after rotating.\n\t *\n\t * @example\n\t *\n\t * var rotated = x64Word.rotR(7);\n\t */\n\t // rotR: function (n) {\n\t // return this.shiftR(n).or(this.shiftL(64 - n));\n\t // },\n\n\t /**\n\t * Adds this word with the passed word.\n\t *\n\t * @param {X64Word} word The x64-Word to add with this word.\n\t *\n\t * @return {X64Word} A new x64-Word object after adding.\n\t *\n\t * @example\n\t *\n\t * var added = x64Word.add(anotherX64Word);\n\t */\n\t // add: function (word) {\n\t // var low = (this.low + word.low) | 0;\n\t // var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0;\n\t // var high = (this.high + word.high + carry) | 0;\n\n\t // return X64Word.create(high, low);\n\t // }\n\t });\n\n\t /**\n\t * An array of 64-bit words.\n\t *\n\t * @property {Array} words The array of CryptoJS.x64.Word objects.\n\t * @property {number} sigBytes The number of significant bytes in this word array.\n\t */\n\t var X64WordArray = C_x64.WordArray = Base.extend({\n\t /**\n\t * Initializes a newly created word array.\n\t *\n\t * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects.\n\t * @param {number} sigBytes (Optional) The number of significant bytes in the words.\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.x64.WordArray.create();\n\t *\n\t * var wordArray = CryptoJS.x64.WordArray.create([\n\t * CryptoJS.x64.Word.create(0x00010203, 0x04050607),\n\t * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)\n\t * ]);\n\t *\n\t * var wordArray = CryptoJS.x64.WordArray.create([\n\t * CryptoJS.x64.Word.create(0x00010203, 0x04050607),\n\t * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)\n\t * ], 10);\n\t */\n\t init: function (words, sigBytes) {\n\t words = this.words = words || [];\n\n\t if (sigBytes != undefined) {\n\t this.sigBytes = sigBytes;\n\t } else {\n\t this.sigBytes = words.length * 8;\n\t }\n\t },\n\n\t /**\n\t * Converts this 64-bit word array to a 32-bit word array.\n\t *\n\t * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array.\n\t *\n\t * @example\n\t *\n\t * var x32WordArray = x64WordArray.toX32();\n\t */\n\t toX32: function () {\n\t // Shortcuts\n\t var x64Words = this.words;\n\t var x64WordsLength = x64Words.length;\n\n\t // Convert\n\t var x32Words = [];\n\t for (var i = 0; i < x64WordsLength; i++) {\n\t var x64Word = x64Words[i];\n\t x32Words.push(x64Word.high);\n\t x32Words.push(x64Word.low);\n\t }\n\n\t return X32WordArray.create(x32Words, this.sigBytes);\n\t },\n\n\t /**\n\t * Creates a copy of this word array.\n\t *\n\t * @return {X64WordArray} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = x64WordArray.clone();\n\t */\n\t clone: function () {\n\t var clone = Base.clone.call(this);\n\n\t // Clone \"words\" array\n\t var words = clone.words = this.words.slice(0);\n\n\t // Clone each X64Word object\n\t var wordsLength = words.length;\n\t for (var i = 0; i < wordsLength; i++) {\n\t words[i] = words[i].clone();\n\t }\n\n\t return clone;\n\t }\n\t });\n\t}());\n\n\n\treturn CryptoJS;\n\n}));", ";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Check if typed arrays are supported\n\t if (typeof ArrayBuffer != 'function') {\n\t return;\n\t }\n\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\n\t // Reference original init\n\t var superInit = WordArray.init;\n\n\t // Augment WordArray.init to handle typed arrays\n\t var subInit = WordArray.init = function (typedArray) {\n\t // Convert buffers to uint8\n\t if (typedArray instanceof ArrayBuffer) {\n\t typedArray = new Uint8Array(typedArray);\n\t }\n\n\t // Convert other array views to uint8\n\t if (\n\t typedArray instanceof Int8Array ||\n\t (typeof Uint8ClampedArray !== \"undefined\" && typedArray instanceof Uint8ClampedArray) ||\n\t typedArray instanceof Int16Array ||\n\t typedArray instanceof Uint16Array ||\n\t typedArray instanceof Int32Array ||\n\t typedArray instanceof Uint32Array ||\n\t typedArray instanceof Float32Array ||\n\t typedArray instanceof Float64Array\n\t ) {\n\t typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength);\n\t }\n\n\t // Handle Uint8Array\n\t if (typedArray instanceof Uint8Array) {\n\t // Shortcut\n\t var typedArrayByteLength = typedArray.byteLength;\n\n\t // Extract bytes\n\t var words = [];\n\t for (var i = 0; i < typedArrayByteLength; i++) {\n\t words[i >>> 2] |= typedArray[i] << (24 - (i % 4) * 8);\n\t }\n\n\t // Initialize this word array\n\t superInit.call(this, words, typedArrayByteLength);\n\t } else {\n\t // Else call normal init\n\t superInit.apply(this, arguments);\n\t }\n\t };\n\n\t subInit.prototype = WordArray;\n\t}());\n\n\n\treturn CryptoJS.lib.WordArray;\n\n}));", ";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var C_enc = C.enc;\n\n\t /**\n\t * UTF-16 BE encoding strategy.\n\t */\n\t var Utf16BE = C_enc.Utf16 = C_enc.Utf16BE = {\n\t /**\n\t * Converts a word array to a UTF-16 BE string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The UTF-16 BE string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var utf16String = CryptoJS.enc.Utf16.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\n\t // Convert\n\t var utf16Chars = [];\n\t for (var i = 0; i < sigBytes; i += 2) {\n\t var codePoint = (words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff;\n\t utf16Chars.push(String.fromCharCode(codePoint));\n\t }\n\n\t return utf16Chars.join('');\n\t },\n\n\t /**\n\t * Converts a UTF-16 BE string to a word array.\n\t *\n\t * @param {string} utf16Str The UTF-16 BE string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Utf16.parse(utf16String);\n\t */\n\t parse: function (utf16Str) {\n\t // Shortcut\n\t var utf16StrLength = utf16Str.length;\n\n\t // Convert\n\t var words = [];\n\t for (var i = 0; i < utf16StrLength; i++) {\n\t words[i >>> 1] |= utf16Str.charCodeAt(i) << (16 - (i % 2) * 16);\n\t }\n\n\t return WordArray.create(words, utf16StrLength * 2);\n\t }\n\t };\n\n\t /**\n\t * UTF-16 LE encoding strategy.\n\t */\n\t C_enc.Utf16LE = {\n\t /**\n\t * Converts a word array to a UTF-16 LE string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The UTF-16 LE string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\n\t // Convert\n\t var utf16Chars = [];\n\t for (var i = 0; i < sigBytes; i += 2) {\n\t var codePoint = swapEndian((words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff);\n\t utf16Chars.push(String.fromCharCode(codePoint));\n\t }\n\n\t return utf16Chars.join('');\n\t },\n\n\t /**\n\t * Converts a UTF-16 LE string to a word array.\n\t *\n\t * @param {string} utf16Str The UTF-16 LE string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str);\n\t */\n\t parse: function (utf16Str) {\n\t // Shortcut\n\t var utf16StrLength = utf16Str.length;\n\n\t // Convert\n\t var words = [];\n\t for (var i = 0; i < utf16StrLength; i++) {\n\t words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << (16 - (i % 2) * 16));\n\t }\n\n\t return WordArray.create(words, utf16StrLength * 2);\n\t }\n\t };\n\n\t function swapEndian(word) {\n\t return ((word << 8) & 0xff00ff00) | ((word >>> 8) & 0x00ff00ff);\n\t }\n\t}());\n\n\n\treturn CryptoJS.enc.Utf16;\n\n}));", ";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var C_enc = C.enc;\n\n\t /**\n\t * Base64 encoding strategy.\n\t */\n\t var Base64 = C_enc.Base64 = {\n\t /**\n\t * Converts a word array to a Base64 string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The Base64 string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var base64String = CryptoJS.enc.Base64.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\t var map = this._map;\n\n\t // Clamp excess bits\n\t wordArray.clamp();\n\n\t // Convert\n\t var base64Chars = [];\n\t for (var i = 0; i < sigBytes; i += 3) {\n\t var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff;\n\t var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff;\n\n\t var triplet = (byte1 << 16) | (byte2 << 8) | byte3;\n\n\t for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) {\n\t base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f));\n\t }\n\t }\n\n\t // Add padding\n\t var paddingChar = map.charAt(64);\n\t if (paddingChar) {\n\t while (base64Chars.length % 4) {\n\t base64Chars.push(paddingChar);\n\t }\n\t }\n\n\t return base64Chars.join('');\n\t },\n\n\t /**\n\t * Converts a Base64 string to a word array.\n\t *\n\t * @param {string} base64Str The Base64 string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Base64.parse(base64String);\n\t */\n\t parse: function (base64Str) {\n\t // Shortcuts\n\t var base64StrLength = base64Str.length;\n\t var map = this._map;\n\t var reverseMap = this._reverseMap;\n\n\t if (!reverseMap) {\n\t reverseMap = this._reverseMap = [];\n\t for (var j = 0; j < map.length; j++) {\n\t reverseMap[map.charCodeAt(j)] = j;\n\t }\n\t }\n\n\t // Ignore padding\n\t var paddingChar = map.charAt(64);\n\t if (paddingChar) {\n\t var paddingIndex = base64Str.indexOf(paddingChar);\n\t if (paddingIndex !== -1) {\n\t base64StrLength = paddingIndex;\n\t }\n\t }\n\n\t // Convert\n\t return parseLoop(base64Str, base64StrLength, reverseMap);\n\n\t },\n\n\t _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='\n\t };\n\n\t function parseLoop(base64Str, base64StrLength, reverseMap) {\n\t var words = [];\n\t var nBytes = 0;\n\t for (var i = 0; i < base64StrLength; i++) {\n\t if (i % 4) {\n\t var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2);\n\t var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2);\n\t var bitsCombined = bits1 | bits2;\n\t words[nBytes >>> 2] |= bitsCombined << (24 - (nBytes % 4) * 8);\n\t nBytes++;\n\t }\n\t }\n\t return WordArray.create(words, nBytes);\n\t }\n\t}());\n\n\n\treturn CryptoJS.enc.Base64;\n\n}));", ";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var C_enc = C.enc;\n\n\t /**\n\t * Base64url encoding strategy.\n\t */\n\t var Base64url = C_enc.Base64url = {\n\t /**\n\t * Converts a word array to a Base64url string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @param {boolean} urlSafe Whether to use url safe\n\t *\n\t * @return {string} The Base64url string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var base64String = CryptoJS.enc.Base64url.stringify(wordArray);\n\t */\n\t stringify: function (wordArray, urlSafe) {\n\t if (urlSafe === undefined) {\n\t urlSafe = true\n\t }\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\t var map = urlSafe ? this._safe_map : this._map;\n\n\t // Clamp excess bits\n\t wordArray.clamp();\n\n\t // Convert\n\t var base64Chars = [];\n\t for (var i = 0; i < sigBytes; i += 3) {\n\t var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff;\n\t var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff;\n\n\t var triplet = (byte1 << 16) | (byte2 << 8) | byte3;\n\n\t for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) {\n\t base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f));\n\t }\n\t }\n\n\t // Add padding\n\t var paddingChar = map.charAt(64);\n\t if (paddingChar) {\n\t while (base64Chars.length % 4) {\n\t base64Chars.push(paddingChar);\n\t }\n\t }\n\n\t return base64Chars.join('');\n\t },\n\n\t /**\n\t * Converts a Base64url string to a word array.\n\t *\n\t * @param {string} base64Str The Base64url string.\n\t *\n\t * @param {boolean} urlSafe Whether to use url safe\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Base64url.parse(base64String);\n\t */\n\t parse: function (base64Str, urlSafe) {\n\t if (urlSafe === undefined) {\n\t urlSafe = true\n\t }\n\n\t // Shortcuts\n\t var base64StrLength = base64Str.length;\n\t var map = urlSafe ? this._safe_map : this._map;\n\t var reverseMap = this._reverseMap;\n\n\t if (!reverseMap) {\n\t reverseMap = this._reverseMap = [];\n\t for (var j = 0; j < map.length; j++) {\n\t reverseMap[map.charCodeAt(j)] = j;\n\t }\n\t }\n\n\t // Ignore padding\n\t var paddingChar = map.charAt(64);\n\t if (paddingChar) {\n\t var paddingIndex = base64Str.indexOf(paddingChar);\n\t if (paddingIndex !== -1) {\n\t base64StrLength = paddingIndex;\n\t }\n\t }\n\n\t // Convert\n\t return parseLoop(base64Str, base64StrLength, reverseMap);\n\n\t },\n\n\t _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',\n\t _safe_map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_',\n\t };\n\n\t function parseLoop(base64Str, base64StrLength, reverseMap) {\n\t var words = [];\n\t var nBytes = 0;\n\t for (var i = 0; i < base64StrLength; i++) {\n\t if (i % 4) {\n\t var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2);\n\t var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2);\n\t var bitsCombined = bits1 | bits2;\n\t words[nBytes >>> 2] |= bitsCombined << (24 - (nBytes % 4) * 8);\n\t nBytes++;\n\t }\n\t }\n\t return WordArray.create(words, nBytes);\n\t }\n\t}());\n\n\n\treturn CryptoJS.enc.Base64url;\n\n}));", ";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function (Math) {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var Hasher = C_lib.Hasher;\n\t var C_algo = C.algo;\n\n\t // Constants table\n\t var T = [];\n\n\t // Compute constants\n\t (function () {\n\t for (var i = 0; i < 64; i++) {\n\t T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0;\n\t }\n\t }());\n\n\t /**\n\t * MD5 hash algorithm.\n\t */\n\t var MD5 = C_algo.MD5 = Hasher.extend({\n\t _doReset: function () {\n\t this._hash = new WordArray.init([\n\t 0x67452301, 0xefcdab89,\n\t 0x98badcfe, 0x10325476\n\t ]);\n\t },\n\n\t _doProcessBlock: function (M, offset) {\n\t // Swap endian\n\t for (var i = 0; i < 16; i++) {\n\t // Shortcuts\n\t var offset_i = offset + i;\n\t var M_offset_i = M[offset_i];\n\n\t M[offset_i] = (\n\t (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) |\n\t (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)\n\t );\n\t }\n\n\t // Shortcuts\n\t var H = this._hash.words;\n\n\t var M_offset_0 = M[offset + 0];\n\t var M_offset_1 = M[offset + 1];\n\t var M_offset_2 = M[offset + 2];\n\t var M_offset_3 = M[offset + 3];\n\t var M_offset_4 = M[offset + 4];\n\t var M_offset_5 = M[offset + 5];\n\t var M_offset_6 = M[offset + 6];\n\t var M_offset_7 = M[offset + 7];\n\t var M_offset_8 = M[offset + 8];\n\t var M_offset_9 = M[offset + 9];\n\t var M_offset_10 = M[offset + 10];\n\t var M_offset_11 = M[offset + 11];\n\t var M_offset_12 = M[offset + 12];\n\t var M_offset_13 = M[offset + 13];\n\t var M_offset_14 = M[offset + 14];\n\t var M_offset_15 = M[offset + 15];\n\n\t // Working variables\n\t var a = H[0];\n\t var b = H[1];\n\t var c = H[2];\n\t var d = H[3];\n\n\t // Computation\n\t a = FF(a, b, c, d, M_offset_0, 7, T[0]);\n\t d = FF(d, a, b, c, M_offset_1, 12, T[1]);\n\t c = FF(c, d, a, b, M_offset_2, 17, T[2]);\n\t b = FF(b, c, d, a, M_offset_3, 22, T[3]);\n\t a = FF(a, b, c, d, M_offset_4, 7, T[4]);\n\t d = FF(d, a, b, c, M_offset_5, 12, T[5]);\n\t c = FF(c, d, a, b, M_offset_6, 17, T[6]);\n\t b = FF(b, c, d, a, M_offset_7, 22, T[7]);\n\t a = FF(a, b, c, d, M_offset_8, 7, T[8]);\n\t d = FF(d, a, b, c, M_offset_9, 12, T[9]);\n\t c = FF(c, d, a, b, M_offset_10, 17, T[10]);\n\t b = FF(b, c, d, a, M_offset_11, 22, T[11]);\n\t a = FF(a, b, c, d, M_offset_12, 7, T[12]);\n\t d = FF(d, a, b, c, M_offset_13, 12, T[13]);\n\t c = FF(c, d, a, b, M_offset_14, 17, T[14]);\n\t b = FF(b, c, d, a, M_offset_15, 22, T[15]);\n\n\t a = GG(a, b, c, d, M_offset_1, 5, T[16]);\n\t d = GG(d, a, b, c, M_offset_6, 9, T[17]);\n\t c = GG(c, d, a, b, M_offset_11, 14, T[18]);\n\t b = GG(b, c, d, a, M_offset_0, 20, T[19]);\n\t a = GG(a, b, c, d, M_offset_5, 5, T[20]);\n\t d = GG(d, a, b, c, M_offset_10, 9, T[21]);\n\t c = GG(c, d, a, b, M_offset_15, 14, T[22]);\n\t b = GG(b, c, d, a, M_offset_4, 20, T[23]);\n\t a = GG(a, b, c, d, M_offset_9, 5, T[24]);\n\t d = GG(d, a, b, c, M_offset_14, 9, T[25]);\n\t c = GG(c, d, a, b, M_offset_3, 14, T[26]);\n\t b = GG(b, c, d, a, M_offset_8, 20, T[27]);\n\t a = GG(a, b, c, d, M_offset_13, 5, T[28]);\n\t d = GG(d, a, b, c, M_offset_2, 9, T[29]);\n\t c = GG(c, d, a, b, M_offset_7, 14, T[30]);\n\t b = GG(b, c, d, a, M_offset_12, 20, T[31]);\n\n\t a = HH(a, b, c, d, M_offset_5, 4, T[32]);\n\t d = HH(d, a, b, c, M_offset_8, 11, T[33]);\n\t c = HH(c, d, a, b, M_offset_11, 16, T[34]);\n\t b = HH(b, c, d, a, M_offset_14, 23, T[35]);\n\t a = HH(a, b, c, d, M_offset_1, 4, T[36]);\n\t d = HH(d, a, b, c, M_offset_4, 11, T[37]);\n\t c = HH(c, d, a, b, M_offset_7, 16, T[38]);\n\t b = HH(b, c, d, a, M_offset_10, 23, T[39]);\n\t a = HH(a, b, c, d, M_offset_13, 4, T[40]);\n\t d = HH(d, a, b, c, M_offset_0, 11, T[41]);\n\t c = HH(c, d, a, b, M_offset_3, 16, T[42]);\n\t b = HH(b, c, d, a, M_offset_6, 23, T[43]);\n\t a = HH(a, b, c, d, M_offset_9, 4, T[44]);\n\t d = HH(d, a, b, c, M_offset_12, 11, T[45]);\n\t c = HH(c, d, a, b, M_offset_15, 16, T[46]);\n\t b = HH(b, c, d, a, M_offset_2, 23, T[47]);\n\n\t a = II(a, b, c, d, M_offset_0, 6, T[48]);\n\t d = II(d, a, b, c, M_offset_7, 10, T[49]);\n\t c = II(c, d, a, b, M_offset_14, 15, T[50]);\n\t b = II(b, c, d, a, M_offset_5, 21, T[51]);\n\t a = II(a, b, c, d, M_offset_12, 6, T[52]);\n\t d = II(d, a, b, c, M_offset_3, 10, T[53]);\n\t c = II(c, d, a, b, M_offset_10, 15, T[54]);\n\t b = II(b, c, d, a, M_offset_1, 21, T[55]);\n\t a = II(a, b, c, d, M_offset_8, 6, T[56]);\n\t d = II(d, a, b, c, M_offset_15, 10, T[57]);\n\t c = II(c, d, a, b, M_offset_6, 15, T[58]);\n\t b = II(b, c, d, a, M_offset_13, 21, T[59]);\n\t a = II(a, b, c, d, M_offset_4, 6, T[60]);\n\t d = II(d, a, b, c, M_offset_11, 10, T[61]);\n\t c = II(c, d, a, b, M_offset_2, 15, T[62]);\n\t b = II(b, c, d, a, M_offset_9, 21, T[63]);\n\n\t // Intermediate hash value\n\t H[0] = (H[0] + a) | 0;\n\t H[1] = (H[1] + b) | 0;\n\t H[2] = (H[2] + c) | 0;\n\t H[3] = (H[3] + d) | 0;\n\t },\n\n\t _doFinalize: function () {\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\n\t var nBitsTotal = this._nDataBytes * 8;\n\t var nBitsLeft = data.sigBytes * 8;\n\n\t // Add padding\n\t dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);\n\n\t var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000);\n\t var nBitsTotalL = nBitsTotal;\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = (\n\t (((nBitsTotalH << 8) | (nBitsTotalH >>> 24)) & 0x00ff00ff) |\n\t (((nBitsTotalH << 24) | (nBitsTotalH >>> 8)) & 0xff00ff00)\n\t );\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (\n\t (((nBitsTotalL << 8) | (nBitsTotalL >>> 24)) & 0x00ff00ff) |\n\t (((nBitsTotalL << 24) | (nBitsTotalL >>> 8)) & 0xff00ff00)\n\t );\n\n\t data.sigBytes = (dataWords.length + 1) * 4;\n\n\t // Hash final blocks\n\t this._process();\n\n\t // Shortcuts\n\t var hash = this._hash;\n\t var H = hash.words;\n\n\t // Swap endian\n\t for (var i = 0; i < 4; i++) {\n\t // Shortcut\n\t var H_i = H[i];\n\n\t H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) |\n\t (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00);\n\t }\n\n\t // Return final computed hash\n\t return hash;\n\t },\n\n\t clone: function () {\n\t var clone = Hasher.clone.call(this);\n\t clone._hash = this._hash.clone();\n\n\t return clone;\n\t }\n\t });\n\n\t function FF(a, b, c, d, x, s, t) {\n\t var n = a + ((b & c) | (~b & d)) + x + t;\n\t return ((n << s) | (n >>> (32 - s))) + b;\n\t }\n\n\t function GG(a, b, c, d, x, s, t) {\n\t var n = a + ((b & d) | (c & ~d)) + x + t;\n\t return ((n << s) | (n >>> (32 - s))) + b;\n\t }\n\n\t function HH(a, b, c, d, x, s, t) {\n\t var n = a + (b ^ c ^ d) + x + t;\n\t return ((n << s) | (n >>> (32 - s))) + b;\n\t }\n\n\t function II(a, b, c, d, x, s, t) {\n\t var n = a + (c ^ (b | ~d)) + x + t;\n\t return ((n << s) | (n >>> (32 - s))) + b;\n\t }\n\n\t /**\n\t * Shortcut function to the hasher's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hash = CryptoJS.MD5('message');\n\t * var hash = CryptoJS.MD5(wordArray);\n\t */\n\t C.MD5 = Hasher._createHelper(MD5);\n\n\t /**\n\t * Shortcut function to the HMAC's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t * @param {WordArray|string} key The secret key.\n\t *\n\t * @return {WordArray} The HMAC.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hmac = CryptoJS.HmacMD5(message, key);\n\t */\n\t C.HmacMD5 = Hasher._createHmacHelper(MD5);\n\t}(Math));\n\n\n\treturn CryptoJS.MD5;\n\n}));", ";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var Hasher = C_lib.Hasher;\n\t var C_algo = C.algo;\n\n\t // Reusable object\n\t var W = [];\n\n\t /**\n\t * SHA-1 hash algorithm.\n\t */\n\t var SHA1 = C_algo.SHA1 = Hasher.extend({\n\t _doReset: function () {\n\t this._hash = new WordArray.init([\n\t 0x67452301, 0xefcdab89,\n\t 0x98badcfe, 0x10325476,\n\t 0xc3d2e1f0\n\t ]);\n\t },\n\n\t _doProcessBlock: function (M, offset) {\n\t // Shortcut\n\t var H = this._hash.words;\n\n\t // Working variables\n\t var a = H[0];\n\t var b = H[1];\n\t var c = H[2];\n\t var d = H[3];\n\t var e = H[4];\n\n\t // Computation\n\t for (var i = 0; i < 80; i++) {\n\t if (i < 16) {\n\t W[i] = M[offset + i] | 0;\n\t } else {\n\t var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];\n\t W[i] = (n << 1) | (n >>> 31);\n\t }\n\n\t var t = ((a << 5) | (a >>> 27)) + e + W[i];\n\t if (i < 20) {\n\t t += ((b & c) | (~b & d)) + 0x5a827999;\n\t } else if (i < 40) {\n\t t += (b ^ c ^ d) + 0x6ed9eba1;\n\t } else if (i < 60) {\n\t t += ((b & c) | (b & d) | (c & d)) - 0x70e44324;\n\t } else /* if (i < 80) */ {\n\t t += (b ^ c ^ d) - 0x359d3e2a;\n\t }\n\n\t e = d;\n\t d = c;\n\t c = (b << 30) | (b >>> 2);\n\t b = a;\n\t a = t;\n\t }\n\n\t // Intermediate hash value\n\t H[0] = (H[0] + a) | 0;\n\t H[1] = (H[1] + b) | 0;\n\t H[2] = (H[2] + c) | 0;\n\t H[3] = (H[3] + d) | 0;\n\t H[4] = (H[4] + e) | 0;\n\t },\n\n\t _doFinalize: function () {\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\n\t var nBitsTotal = this._nDataBytes * 8;\n\t var nBitsLeft = data.sigBytes * 8;\n\n\t // Add padding\n\t dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;\n\t data.sigBytes = dataWords.length * 4;\n\n\t // Hash final blocks\n\t this._process();\n\n\t // Return final computed hash\n\t return this._hash;\n\t },\n\n\t clone: function () {\n\t var clone = Hasher.clone.call(this);\n\t clone._hash = this._hash.clone();\n\n\t return clone;\n\t }\n\t });\n\n\t /**\n\t * Shortcut function to the hasher's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hash = CryptoJS.SHA1('message');\n\t * var hash = CryptoJS.SHA1(wordArray);\n\t */\n\t C.SHA1 = Hasher._createHelper(SHA1);\n\n\t /**\n\t * Shortcut function to the HMAC's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t * @param {WordArray|string} key The secret key.\n\t *\n\t * @return {WordArray} The HMAC.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hmac = CryptoJS.HmacSHA1(message, key);\n\t */\n\t C.HmacSHA1 = Hasher._createHmacHelper(SHA1);\n\t}());\n\n\n\treturn CryptoJS.SHA1;\n\n}));", ";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function (Math) {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var Hasher = C_lib.Hasher;\n\t var C_algo = C.algo;\n\n\t // Initialization and round constants tables\n\t var H = [];\n\t var K = [];\n\n\t // Compute constants\n\t (function () {\n\t function isPrime(n) {\n\t var sqrtN = Math.sqrt(n);\n\t for (var factor = 2; factor <= sqrtN; factor++) {\n\t if (!(n % factor)) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t }\n\n\t function getFractionalBits(n) {\n\t return ((n - (n | 0)) * 0x100000000) | 0;\n\t }\n\n\t var n = 2;\n\t var nPrime = 0;\n\t while (nPrime < 64) {\n\t if (isPrime(n)) {\n\t if (nPrime < 8) {\n\t H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2));\n\t }\n\t K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3));\n\n\t nPrime++;\n\t }\n\n\t n++;\n\t }\n\t }());\n\n\t // Reusable object\n\t var W = [];\n\n\t /**\n\t * SHA-256 hash algorithm.\n\t */\n\t var SHA256 = C_algo.SHA256 = Hasher.extend({\n\t _doReset: function () {\n\t this._hash = new WordArray.init(H.slice(0));\n\t },\n\n\t _doProcessBlock: function (M, offset) {\n\t // Shortcut\n\t var H = this._hash.words;\n\n\t // Working variables\n\t var a = H[0];\n\t var b = H[1];\n\t var c = H[2];\n\t var d = H[3];\n\t var e = H[4];\n\t var f = H[5];\n\t var g = H[6];\n\t var h = H[7];\n\n\t // Computation\n\t for (var i = 0; i < 64; i++) {\n\t if (i < 16) {\n\t W[i] = M[offset + i] | 0;\n\t } else {\n\t var gamma0x = W[i - 15];\n\t var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^\n\t ((gamma0x << 14) | (gamma0x >>> 18)) ^\n\t (gamma0x >>> 3);\n\n\t var gamma1x = W[i - 2];\n\t var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^\n\t ((gamma1x << 13) | (gamma1x >>> 19)) ^\n\t (gamma1x >>> 10);\n\n\t W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];\n\t }\n\n\t var ch = (e & f) ^ (~e & g);\n\t var maj = (a & b) ^ (a & c) ^ (b & c);\n\n\t var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22));\n\t var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25));\n\n\t var t1 = h + sigma1 + ch + K[i] + W[i];\n\t var t2 = sigma0 + maj;\n\n\t h = g;\n\t g = f;\n\t f = e;\n\t e = (d + t1) | 0;\n\t d = c;\n\t c = b;\n\t b = a;\n\t a = (t1 + t2) | 0;\n\t }\n\n\t // Intermediate hash value\n\t H[0] = (H[0] + a) | 0;\n\t H[1] = (H[1] + b) | 0;\n\t H[2] = (H[2] + c) | 0;\n\t H[3] = (H[3] + d) | 0;\n\t H[4] = (H[4] + e) | 0;\n\t H[5] = (H[5] + f) | 0;\n\t H[6] = (H[6] + g) | 0;\n\t H[7] = (H[7] + h) | 0;\n\t },\n\n\t _doFinalize: function () {\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\n\t var nBitsTotal = this._nDataBytes * 8;\n\t var nBitsLeft = data.sigBytes * 8;\n\n\t // Add padding\n\t dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;\n\t data.sigBytes = dataWords.length * 4;\n\n\t // Hash final blocks\n\t this._process();\n\n\t // Return final computed hash\n\t return this._hash;\n\t },\n\n\t clone: function () {\n\t var clone = Hasher.clone.call(this);\n\t clone._hash = this._hash.clone();\n\n\t return clone;\n\t }\n\t });\n\n\t /**\n\t * Shortcut function to the hasher's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hash = CryptoJS.SHA256('message');\n\t * var hash = CryptoJS.SHA256(wordArray);\n\t */\n\t C.SHA256 = Hasher._createHelper(SHA256);\n\n\t /**\n\t * Shortcut function to the HMAC's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t * @param {WordArray|string} key The secret key.\n\t *\n\t * @return {WordArray} The HMAC.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hmac = CryptoJS.HmacSHA256(message, key);\n\t */\n\t C.HmacSHA256 = Hasher._createHmacHelper(SHA256);\n\t}(Math));\n\n\n\treturn CryptoJS.SHA256;\n\n}));", ";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./sha256\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./sha256\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var C_algo = C.algo;\n\t var SHA256 = C_algo.SHA256;\n\n\t /**\n\t * SHA-224 hash algorithm.\n\t */\n\t var SHA224 = C_algo.SHA224 = SHA256.extend({\n\t _doReset: function () {\n\t this._hash = new WordArray.init([\n\t 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,\n\t 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4\n\t ]);\n\t },\n\n\t _doFinalize: function () {\n\t var hash = SHA256._doFinalize.call(this);\n\n\t hash.sigBytes -= 4;\n\n\t return hash;\n\t }\n\t });\n\n\t /**\n\t * Shortcut function to the hasher's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hash = CryptoJS.SHA224('message');\n\t * var hash = CryptoJS.SHA224(wordArray);\n\t */\n\t C.SHA224 = SHA256._createHelper(SHA224);\n\n\t /**\n\t * Shortcut function to the HMAC's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t * @param {WordArray|string} key The secret key.\n\t *\n\t * @return {WordArray} The HMAC.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hmac = CryptoJS.HmacSHA224(message, key);\n\t */\n\t C.HmacSHA224 = SHA256._createHmacHelper(SHA224);\n\t}());\n\n\n\treturn CryptoJS.SHA224;\n\n}));", ";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./x64-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./x64-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var Hasher = C_lib.Hasher;\n\t var C_x64 = C.x64;\n\t var X64Word = C_x64.Word;\n\t var X64WordArray = C_x64.WordArray;\n\t var C_algo = C.algo;\n\n\t function X64Word_create() {\n\t return X64Word.create.apply(X64Word, arguments);\n\t }\n\n\t // Constants\n\t var K = [\n\t X64Word_create(0x428a2f98, 0xd728ae22), X64Word_create(0x71374491, 0x23ef65cd),\n\t X64Word_create(0xb5c0fbcf, 0xec4d3b2f), X64Word_create(0xe9b5dba5, 0x8189dbbc),\n\t X64Word_create(0x3956c25b, 0xf348b538), X64Word_create(0x59f111f1, 0xb605d019),\n\t X64Word_create(0x923f82a4, 0xaf194f9b), X64Word_create(0xab1c5ed5, 0xda6d8118),\n\t X64Word_create(0xd807aa98, 0xa3030242), X64Word_create(0x12835b01, 0x45706fbe),\n\t X64Word_create(0x243185be, 0x4ee4b28c), X64Word_create(0x550c7dc3, 0xd5ffb4e2),\n\t X64Word_create(0x72be5d74, 0xf27b896f), X64Word_create(0x80deb1fe, 0x3b1696b1),\n\t X64Word_create(0x9bdc06a7, 0x25c71235), X64Word_create(0xc19bf174, 0xcf692694),\n\t X64Word_create(0xe49b69c1, 0x9ef14ad2), X64Word_create(0xefbe4786, 0x384f25e3),\n\t X64Word_create(0x0fc19dc6, 0x8b8cd5b5), X64Word_create(0x240ca1cc, 0x77ac9c65),\n\t X64Word_create(0x2de92c6f, 0x592b0275), X64Word_create(0x4a7484aa, 0x6ea6e483),\n\t X64Word_create(0x5cb0a9dc, 0xbd41fbd4), X64Word_create(0x76f988da, 0x831153b5),\n\t X64Word_create(0x983e5152, 0xee66dfab), X64Word_create(0xa831c66d, 0x2db43210),\n\t X64Word_create(0xb00327c8, 0x98fb213f), X64Word_create(0xbf597fc7, 0xbeef0ee4),\n\t X64Word_create(0xc6e00bf3, 0x3da88fc2), X64Word_create(0xd5a79147, 0x930aa725),\n\t X64Word_create(0x06ca6351, 0xe003826f), X64Word_create(0x14292967, 0x0a0e6e70),\n\t X64Word_create(0x27b70a85, 0x46d22ffc), X64Word_create(0x2e1b2138, 0x5c26c926),\n\t X64Word_create(0x4d2c6dfc, 0x5ac42aed), X64Word_create(0x53380d13, 0x9d95b3df),\n\t X64Word_create(0x650a7354, 0x8baf63de), X64Word_create(0x766a0abb, 0x3c77b2a8),\n\t X64Word_create(0x81c2c92e, 0x47edaee6), X64Word_create(0x92722c85, 0x1482353b),\n\t X64Word_create(0xa2bfe8a1, 0x4cf10364), X64Word_create(0xa81a664b, 0xbc423001),\n\t X64Word_create(0xc24b8b70, 0xd0f89791), X64Word_create(0xc76c51a3, 0x0654be30),\n\t X64Word_create(0xd192e819, 0xd6ef5218), X64Word_create(0xd6990624, 0x5565a910),\n\t X64Word_create(0xf40e3585, 0x5771202a), X64Word_create(0x106aa070, 0x32bbd1b8),\n\t X64Word_create(0x19a4c116, 0xb8d2d0c8), X64Word_create(0x1e376c08, 0x5141ab53),\n\t X64Word_create(0x2748774c, 0xdf8eeb99), X64Word_create(0x34b0bcb5, 0xe19b48a8),\n\t X64Word_create(0x391c0cb3, 0xc5c95a63), X64Word_create(0x4ed8aa4a, 0xe3418acb),\n\t X64Word_create(0x5b9cca4f, 0x7763e373), X64Word_create(0x682e6ff3, 0xd6b2b8a3),\n\t X64Word_create(0x748f82ee, 0x5defb2fc), X64Word_create(0x78a5636f, 0x43172f60),\n\t X64Word_create(0x84c87814, 0xa1f0ab72), X64Word_create(0x8cc70208, 0x1a6439ec),\n\t X64Word_create(0x90befffa, 0x23631e28), X64Word_create(0xa4506ceb, 0xde82bde9),\n\t X64Word_create(0xbef9a3f7, 0xb2c67915), X64Word_create(0xc67178f2, 0xe372532b),\n\t X64Word_create(0xca273ece, 0xea26619c), X64Word_create(0xd186b8c7, 0x21c0c207),\n\t X64Word_create(0xeada7dd6, 0xcde0eb1e), X64Word_create(0xf57d4f7f, 0xee6ed178),\n\t X64Word_create(0x06f067aa, 0x72176fba), X64Word_create(0x0a637dc5, 0xa2c898a6),\n\t X64Word_create(0x113f9804, 0xbef90dae), X64Word_create(0x1b710b35, 0x131c471b),\n\t X64Word_create(0x28db77f5, 0x23047d84), X64Word_create(0x32caab7b, 0x40c72493),\n\t X64Word_create(0x3c9ebe0a, 0x15c9bebc), X64Word_create(0x431d67c4, 0x9c100d4c),\n\t X64Word_create(0x4cc5d4be, 0xcb3e42b6), X64Word_create(0x597f299c, 0xfc657e2a),\n\t X64Word_create(0x5fcb6fab, 0x3ad6faec), X64Word_create(0x6c44198c, 0x4a475817)\n\t ];\n\n\t // Reusable objects\n\t var W = [];\n\t (function () {\n\t for (var i = 0; i < 80; i++) {\n\t W[i] = X64Word_create();\n\t }\n\t }());\n\n\t /**\n\t * SHA-512 hash algorithm.\n\t */\n\t var SHA512 = C_algo.SHA512 = Hasher.extend({\n\t _doReset: function () {\n\t this._hash = new X64WordArray.init([\n\t new X64Word.init(0x6a09e667, 0xf3bcc908), new X64Word.init(0xbb67ae85, 0x84caa73b),\n\t new X64Word.init(0x3c6ef372, 0xfe94f82b), new X64Word.init(0xa54ff53a, 0x5f1d36f1),\n\t new X64Word.init(0x510e527f, 0xade682d1), new X64Word.init(0x9b05688c, 0x2b3e6c1f),\n\t new X64Word.init(0x1f83d9ab, 0xfb41bd6b), new X64Word.init(0x5be0cd19, 0x137e2179)\n\t ]);\n\t },\n\n\t _doProcessBlock: function (M, offset) {\n\t // Shortcuts\n\t var H = this._hash.words;\n\n\t var H0 = H[0];\n\t var H1 = H[1];\n\t var H2 = H[2];\n\t var H3 = H[3];\n\t var H4 = H[4];\n\t var H5 = H[5];\n\t var H6 = H[6];\n\t var H7 = H[7];\n\n\t var H0h = H0.high;\n\t var H0l = H0.low;\n\t var H1h = H1.high;\n\t var H1l = H1.low;\n\t var H2h = H2.high;\n\t var H2l = H2.low;\n\t var H3h = H3.high;\n\t var H3l = H3.low;\n\t var H4h = H4.high;\n\t var H4l = H4.low;\n\t var H5h = H5.high;\n\t var H5l = H5.low;\n\t var H6h = H6.high;\n\t var H6l = H6.low;\n\t var H7h = H7.high;\n\t var H7l = H7.low;\n\n\t // Working variables\n\t var ah = H0h;\n\t var al = H0l;\n\t var bh = H1h;\n\t var bl = H1l;\n\t var ch = H2h;\n\t var cl = H2l;\n\t var dh = H3h;\n\t var dl = H3l;\n\t var eh = H4h;\n\t var el = H4l;\n\t var fh = H5h;\n\t var fl = H5l;\n\t var gh = H6h;\n\t var gl = H6l;\n\t var hh = H7h;\n\t var hl = H7l;\n\n\t // Rounds\n\t for (var i = 0; i < 80; i++) {\n\t var Wil;\n\t var Wih;\n\n\t // Shortcut\n\t var Wi = W[i];\n\n\t // Extend message\n\t if (i < 16) {\n\t Wih = Wi.high = M[offset + i * 2] | 0;\n\t Wil = Wi.low = M[offset + i * 2 + 1] | 0;\n\t } else {\n\t // Gamma0\n\t var gamma0x = W[i - 15];\n\t var gamma0xh = gamma0x.high;\n\t var gamma0xl = gamma0x.low;\n\t var gamma0h = ((gamma0xh >>> 1) | (gamma0xl << 31)) ^ ((gamma0xh >>> 8) | (gamma0xl << 24)) ^ (gamma0xh >>> 7);\n\t var gamma0l = ((gamma0xl >>> 1) | (gamma0xh << 31)) ^ ((gamma0xl >>> 8) | (gamma0xh << 24)) ^ ((gamma0xl >>> 7) | (gamma0xh << 25));\n\n\t // Gamma1\n\t var gamma1x = W[i - 2];\n\t var gamma1xh = gamma1x.high;\n\t var gamma1xl = gamma1x.low;\n\t var gamma1h = ((gamma1xh >>> 19) | (gamma1xl << 13)) ^ ((gamma1xh << 3) | (gamma1xl >>> 29)) ^ (gamma1xh >>> 6);\n\t var gamma1l = ((gamma1xl >>> 19) | (gamma1xh << 13)) ^ ((gamma1xl << 3) | (gamma1xh >>> 29)) ^ ((gamma1xl >>> 6) | (gamma1xh << 26));\n\n\t // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]\n\t var Wi7 = W[i - 7];\n\t var Wi7h = Wi7.high;\n\t var Wi7l = Wi7.low;\n\n\t var Wi16 = W[i - 16];\n\t var Wi16h = Wi16.high;\n\t var Wi16l = Wi16.low;\n\n\t Wil = gamma0l + Wi7l;\n\t Wih = gamma0h + Wi7h + ((Wil >>> 0) < (gamma0l >>> 0) ? 1 : 0);\n\t Wil = Wil + gamma1l;\n\t Wih = Wih + gamma1h + ((Wil >>> 0) < (gamma1l >>> 0) ? 1 : 0);\n\t Wil = Wil + Wi16l;\n\t Wih = Wih + Wi16h + ((Wil >>> 0) < (Wi16l >>> 0) ? 1 : 0);\n\n\t Wi.high = Wih;\n\t Wi.low = Wil;\n\t }\n\n\t var chh = (eh & fh) ^ (~eh & gh);\n\t var chl = (el & fl) ^ (~el & gl);\n\t var majh = (ah & bh) ^ (ah & ch) ^ (bh & ch);\n\t var majl = (al & bl) ^ (al & cl) ^ (bl & cl);\n\n\t var sigma0h = ((ah >>> 28) | (al << 4)) ^ ((ah << 30) | (al >>> 2)) ^ ((ah << 25) | (al >>> 7));\n\t var sigma0l = ((al >>> 28) | (ah << 4)) ^ ((al << 30) | (ah >>> 2)) ^ ((al << 25) | (ah >>> 7));\n\t var sigma1h = ((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9));\n\t var sigma1l = ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9));\n\n\t // t1 = h + sigma1 + ch + K[i] + W[i]\n\t var Ki = K[i];\n\t var Kih = Ki.high;\n\t var Kil = Ki.low;\n\n\t var t1l = hl + sigma1l;\n\t var t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0);\n\t var t1l = t1l + chl;\n\t var t1h = t1h + chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0);\n\t var t1l = t1l + Kil;\n\t var t1h = t1h + Kih + ((t1l >>> 0) < (Kil >>> 0) ? 1 : 0);\n\t var t1l = t1l + Wil;\n\t var t1h = t1h + Wih + ((t1l >>> 0) < (Wil >>> 0) ? 1 : 0);\n\n\t // t2 = sigma0 + maj\n\t var t2l = sigma0l + majl;\n\t var t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0);\n\n\t // Update working variables\n\t hh = gh;\n\t hl = gl;\n\t gh = fh;\n\t gl = fl;\n\t fh = eh;\n\t fl = el;\n\t el = (dl + t1l) | 0;\n\t eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0;\n\t dh = ch;\n\t dl = cl;\n\t ch = bh;\n\t cl = bl;\n\t bh = ah;\n\t bl = al;\n\t al = (t1l + t2l) | 0;\n\t ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0;\n\t }\n\n\t // Intermediate hash value\n\t H0l = H0.low = (H0l + al);\n\t H0.high = (H0h + ah + ((H0l >>> 0) < (al >>> 0) ? 1 : 0));\n\t H1l = H1.low = (H1l + bl);\n\t H1.high = (H1h + bh + ((H1l >>> 0) < (bl >>> 0) ? 1 : 0));\n\t H2l = H2.low = (H2l + cl);\n\t H2.high = (H2h + ch + ((H2l >>> 0) < (cl >>> 0) ? 1 : 0));\n\t H3l = H3.low = (H3l + dl);\n\t H3.high = (H3h + dh + ((H3l >>> 0) < (dl >>> 0) ? 1 : 0));\n\t H4l = H4.low = (H4l + el);\n\t H4.high = (H4h + eh + ((H4l >>> 0) < (el >>> 0) ? 1 : 0));\n\t H5l = H5.low = (H5l + fl);\n\t H5.high = (H5h + fh + ((H5l >>> 0) < (fl >>> 0) ? 1 : 0));\n\t H6l = H6.low = (H6l + gl);\n\t H6.high = (H6h + gh + ((H6l >>> 0) < (gl >>> 0) ? 1 : 0));\n\t H7l = H7.low = (H7l + hl);\n\t H7.high = (H7h + hh + ((H7l >>> 0) < (hl >>> 0) ? 1 : 0));\n\t },\n\n\t _doFinalize: function () {\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\n\t var nBitsTotal = this._nDataBytes * 8;\n\t var nBitsLeft = data.sigBytes * 8;\n\n\t // Add padding\n\t dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);\n\t dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 30] = Math.floor(nBitsTotal / 0x100000000);\n\t dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 31] = nBitsTotal;\n\t data.sigBytes = dataWords.length * 4;\n\n\t // Hash final blocks\n\t this._process();\n\n\t // Convert hash to 32-bit word array before returning\n\t var hash = this._hash.toX32();\n\n\t // Return final computed hash\n\t return hash;\n\t },\n\n\t clone: function () {\n\t var clone = Hasher.clone.call(this);\n\t clone._hash = this._hash.clone();\n\n\t return clone;\n\t },\n\n\t blockSize: 1024/32\n\t });\n\n\t /**\n\t * Shortcut function to the hasher's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hash = CryptoJS.SHA512('message');\n\t * var hash = CryptoJS.SHA512(wordArray);\n\t */\n\t C.SHA512 = Hasher._createHelper(SHA512);\n\n\t /**\n\t * Shortcut function to the HMAC's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t * @param {WordArray|string} key The secret key.\n\t *\n\t * @return {WordArray} The HMAC.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hmac = CryptoJS.HmacSHA512(message, key);\n\t */\n\t C.HmacSHA512 = Hasher._createHmacHelper(SHA512);\n\t}());\n\n\n\treturn CryptoJS.SHA512;\n\n}));", ";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./x64-core\"), require(\"./sha512\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./x64-core\", \"./sha512\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_x64 = C.x64;\n\t var X64Word = C_x64.Word;\n\t var X64WordArray = C_x64.WordArray;\n\t var C_algo = C.algo;\n\t var SHA512 = C_algo.SHA512;\n\n\t /**\n\t * SHA-384 hash algorithm.\n\t */\n\t var SHA384 = C_algo.SHA384 = SHA512.extend({\n\t _doReset: function () {\n\t this._hash = new X64WordArray.init([\n\t new X64Word.init(0xcbbb9d5d, 0xc1059ed8), new X64Word.init(0x629a292a, 0x367cd507),\n\t new X64Word.init(0x9159015a, 0x3070dd17), new X64Word.init(0x152fecd8, 0xf70e5939),\n\t new X64Word.init(0x67332667, 0xffc00b31), new X64Word.init(0x8eb44a87, 0x68581511),\n\t new X64Word.init(0xdb0c2e0d, 0x64f98fa7), new X64Word.init(0x47b5481d, 0xbefa4fa4)\n\t ]);\n\t },\n\n\t _doFinalize: function () {\n\t var hash = SHA512._doFinalize.call(this);\n\n\t hash.sigBytes -= 16;\n\n\t return hash;\n\t }\n\t });\n\n\t /**\n\t * Shortcut function to the hasher's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hash = CryptoJS.SHA384('message');\n\t * var hash = CryptoJS.SHA384(wordArray);\n\t */\n\t C.SHA384 = SHA512._createHelper(SHA384);\n\n\t /**\n\t * Shortcut function to the HMAC's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t * @param {WordArray|string} key The secret key.\n\t *\n\t * @return {WordArray} The HMAC.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hmac = CryptoJS.HmacSHA384(message, key);\n\t */\n\t C.HmacSHA384 = SHA512._createHmacHelper(SHA384);\n\t}());\n\n\n\treturn CryptoJS.SHA384;\n\n}));", ";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./x64-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./x64-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function (Math) {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var Hasher = C_lib.Hasher;\n\t var C_x64 = C.x64;\n\t var X64Word = C_x64.Word;\n\t var C_algo = C.algo;\n\n\t // Constants tables\n\t var RHO_OFFSETS = [];\n\t var PI_INDEXES = [];\n\t var ROUND_CONSTANTS = [];\n\n\t // Compute Constants\n\t (function () {\n\t // Compute rho offset constants\n\t var x = 1, y = 0;\n\t for (var t = 0; t < 24; t++) {\n\t RHO_OFFSETS[x + 5 * y] = ((t + 1) * (t + 2) / 2) % 64;\n\n\t var newX = y % 5;\n\t var newY = (2 * x + 3 * y) % 5;\n\t x = newX;\n\t y = newY;\n\t }\n\n\t // Compute pi index constants\n\t for (var x = 0; x < 5; x++) {\n\t for (var y = 0; y < 5; y++) {\n\t PI_INDEXES[x + 5 * y] = y + ((2 * x + 3 * y) % 5) * 5;\n\t }\n\t }\n\n\t // Compute round constants\n\t var LFSR = 0x01;\n\t for (var i = 0; i < 24; i++) {\n\t var roundConstantMsw = 0;\n\t var roundConstantLsw = 0;\n\n\t for (var j = 0; j < 7; j++) {\n\t if (LFSR & 0x01) {\n\t var bitPosition = (1 << j) - 1;\n\t if (bitPosition < 32) {\n\t roundConstantLsw ^= 1 << bitPosition;\n\t } else /* if (bitPosition >= 32) */ {\n\t roundConstantMsw ^= 1 << (bitPosition - 32);\n\t }\n\t }\n\n\t // Compute next LFSR\n\t if (LFSR & 0x80) {\n\t // Primitive polynomial over GF(2): x^8 + x^6 + x^5 + x^4 + 1\n\t LFSR = (LFSR << 1) ^ 0x71;\n\t } else {\n\t LFSR <<= 1;\n\t }\n\t }\n\n\t ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw);\n\t }\n\t }());\n\n\t // Reusable objects for temporary values\n\t var T = [];\n\t (function () {\n\t for (var i = 0; i < 25; i++) {\n\t T[i] = X64Word.create();\n\t }\n\t }());\n\n\t /**\n\t * SHA-3 hash algorithm.\n\t */\n\t var SHA3 = C_algo.SHA3 = Hasher.extend({\n\t /**\n\t * Configuration options.\n\t *\n\t * @property {number} outputLength\n\t * The desired number of bits in the output hash.\n\t * Only values permitted are: 224, 256, 384, 512.\n\t * Default: 512\n\t */\n\t cfg: Hasher.cfg.extend({\n\t outputLength: 512\n\t }),\n\n\t _doReset: function () {\n\t var state = this._state = []\n\t for (var i = 0; i < 25; i++) {\n\t state[i] = new X64Word.init();\n\t }\n\n\t this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32;\n\t },\n\n\t _doProcessBlock: function (M, offset) {\n\t // Shortcuts\n\t var state = this._state;\n\t var nBlockSizeLanes = this.blockSize / 2;\n\n\t // Absorb\n\t for (var i = 0; i < nBlockSizeLanes; i++) {\n\t // Shortcuts\n\t var M2i = M[offset + 2 * i];\n\t var M2i1 = M[offset + 2 * i + 1];\n\n\t // Swap endian\n\t M2i = (\n\t (((M2i << 8) | (M2i >>> 24)) & 0x00ff00ff) |\n\t (((M2i << 24) | (M2i >>> 8)) & 0xff00ff00)\n\t );\n\t M2i1 = (\n\t (((M2i1 << 8) | (M2i1 >>> 24)) & 0x00ff00ff) |\n\t (((M2i1 << 24) | (M2i1 >>> 8)) & 0xff00ff00)\n\t );\n\n\t // Absorb message into state\n\t var lane = state[i];\n\t lane.high ^= M2i1;\n\t lane.low ^= M2i;\n\t }\n\n\t // Rounds\n\t for (var round = 0; round < 24; round++) {\n\t // Theta\n\t for (var x = 0; x < 5; x++) {\n\t // Mix column lanes\n\t var tMsw = 0, tLsw = 0;\n\t for (var y = 0; y < 5; y++) {\n\t var lane = state[x + 5 * y];\n\t tMsw ^= lane.high;\n\t tLsw ^= lane.low;\n\t }\n\n\t // Temporary values\n\t var Tx = T[x];\n\t Tx.high = tMsw;\n\t Tx.low = tLsw;\n\t }\n\t for (var x = 0; x < 5; x++) {\n\t // Shortcuts\n\t var Tx4 = T[(x + 4) % 5];\n\t var Tx1 = T[(x + 1) % 5];\n\t var Tx1Msw = Tx1.high;\n\t var Tx1Lsw = Tx1.low;\n\n\t // Mix surrounding columns\n\t var tMsw = Tx4.high ^ ((Tx1Msw << 1) | (Tx1Lsw >>> 31));\n\t var tLsw = Tx4.low ^ ((Tx1Lsw << 1) | (Tx1Msw >>> 31));\n\t for (var y = 0; y < 5; y++) {\n\t var lane = state[x + 5 * y];\n\t lane.high ^= tMsw;\n\t lane.low ^= tLsw;\n\t }\n\t }\n\n\t // Rho Pi\n\t for (var laneIndex = 1; laneIndex < 25; laneIndex++) {\n\t var tMsw;\n\t var tLsw;\n\n\t // Shortcuts\n\t var lane = state[laneIndex];\n\t var laneMsw = lane.high;\n\t var laneLsw = lane.low;\n\t var rhoOffset = RHO_OFFSETS[laneIndex];\n\n\t // Rotate lanes\n\t if (rhoOffset < 32) {\n\t tMsw = (laneMsw << rhoOffset) | (laneLsw >>> (32 - rhoOffset));\n\t tLsw = (laneLsw << rhoOffset) | (laneMsw >>> (32 - rhoOffset));\n\t } else /* if (rhoOffset >= 32) */ {\n\t tMsw = (laneLsw << (rhoOffset - 32)) | (laneMsw >>> (64 - rhoOffset));\n\t tLsw = (laneMsw << (rhoOffset - 32)) | (laneLsw >>> (64 - rhoOffset));\n\t }\n\n\t // Transpose lanes\n\t var TPiLane = T[PI_INDEXES[laneIndex]];\n\t TPiLane.high = tMsw;\n\t TPiLane.low = tLsw;\n\t }\n\n\t // Rho pi at x = y = 0\n\t var T0 = T[0];\n\t var state0 = state[0];\n\t T0.high = state0.high;\n\t T0.low = state0.low;\n\n\t // Chi\n\t for (var x = 0; x < 5; x++) {\n\t for (var y = 0; y < 5; y++) {\n\t // Shortcuts\n\t var laneIndex = x + 5 * y;\n\t var lane = state[laneIndex];\n\t var TLane = T[laneIndex];\n\t var Tx1Lane = T[((x + 1) % 5) + 5 * y];\n\t var Tx2Lane = T[((x + 2) % 5) + 5 * y];\n\n\t // Mix rows\n\t lane.high = TLane.high ^ (~Tx1Lane.high & Tx2Lane.high);\n\t lane.low = TLane.low ^ (~Tx1Lane.low & Tx2Lane.low);\n\t }\n\t }\n\n\t // Iota\n\t var lane = state[0];\n\t var roundConstant = ROUND_CONSTANTS[round];\n\t lane.high ^= roundConstant.high;\n\t lane.low ^= roundConstant.low;\n\t }\n\t },\n\n\t _doFinalize: function () {\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\t var nBitsTotal = this._nDataBytes * 8;\n\t var nBitsLeft = data.sigBytes * 8;\n\t var blockSizeBits = this.blockSize * 32;\n\n\t // Add padding\n\t dataWords[nBitsLeft >>> 5] |= 0x1 << (24 - nBitsLeft % 32);\n\t dataWords[((Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits) >>> 5) - 1] |= 0x80;\n\t data.sigBytes = dataWords.length * 4;\n\n\t // Hash final blocks\n\t this._process();\n\n\t // Shortcuts\n\t var state = this._state;\n\t var outputLengthBytes = this.cfg.outputLength / 8;\n\t var outputLengthLanes = outputLengthBytes / 8;\n\n\t // Squeeze\n\t var hashWords = [];\n\t for (var i = 0; i < outputLengthLanes; i++) {\n\t // Shortcuts\n\t var lane = state[i];\n\t var laneMsw = lane.high;\n\t var laneLsw = lane.low;\n\n\t // Swap endian\n\t laneMsw = (\n\t (((laneMsw << 8) | (laneMsw >>> 24)) & 0x00ff00ff) |\n\t (((laneMsw << 24) | (laneMsw >>> 8)) & 0xff00ff00)\n\t );\n\t laneLsw = (\n\t (((laneLsw << 8) | (laneLsw >>> 24)) & 0x00ff00ff) |\n\t (((laneLsw << 24) | (laneLsw >>> 8)) & 0xff00ff00)\n\t );\n\n\t // Squeeze state to retrieve hash\n\t hashWords.push(laneLsw);\n\t hashWords.push(laneMsw);\n\t }\n\n\t // Return final computed hash\n\t return new WordArray.init(hashWords, outputLengthBytes);\n\t },\n\n\t clone: function () {\n\t var clone = Hasher.clone.call(this);\n\n\t var state = clone._state = this._state.slice(0);\n\t for (var i = 0; i < 25; i++) {\n\t state[i] = state[i].clone();\n\t }\n\n\t return clone;\n\t }\n\t });\n\n\t /**\n\t * Shortcut function to the hasher's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hash = CryptoJS.SHA3('message');\n\t * var hash = CryptoJS.SHA3(wordArray);\n\t */\n\t C.SHA3 = Hasher._createHelper(SHA3);\n\n\t /**\n\t * Shortcut function to the HMAC's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t * @param {WordArray|string} key The secret key.\n\t *\n\t * @return {WordArray} The HMAC.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hmac = CryptoJS.HmacSHA3(message, key);\n\t */\n\t C.HmacSHA3 = Hasher._createHmacHelper(SHA3);\n\t}(Math));\n\n\n\treturn CryptoJS.SHA3;\n\n}));", ";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t/** @preserve\n\t(c) 2012 by Cédric Mesnil. All rights reserved.\n\n\tRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n\t - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\t - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\n\tTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\t*/\n\n\t(function (Math) {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var Hasher = C_lib.Hasher;\n\t var C_algo = C.algo;\n\n\t // Constants table\n\t var _zl = WordArray.create([\n\t 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n\t 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,\n\t 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,\n\t 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,\n\t 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]);\n\t var _zr = WordArray.create([\n\t 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,\n\t 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,\n\t 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,\n\t 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,\n\t 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]);\n\t var _sl = WordArray.create([\n\t 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,\n\t 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,\n\t 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,\n\t 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,\n\t 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 ]);\n\t var _sr = WordArray.create([\n\t 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,\n\t 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,\n\t 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,\n\t 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,\n\t 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ]);\n\n\t var _hl = WordArray.create([ 0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]);\n\t var _hr = WordArray.create([ 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]);\n\n\t /**\n\t * RIPEMD160 hash algorithm.\n\t */\n\t var RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({\n\t _doReset: function () {\n\t this._hash = WordArray.create([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]);\n\t },\n\n\t _doProcessBlock: function (M, offset) {\n\n\t // Swap endian\n\t for (var i = 0; i < 16; i++) {\n\t // Shortcuts\n\t var offset_i = offset + i;\n\t var M_offset_i = M[offset_i];\n\n\t // Swap\n\t M[offset_i] = (\n\t (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) |\n\t (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)\n\t );\n\t }\n\t // Shortcut\n\t var H = this._hash.words;\n\t var hl = _hl.words;\n\t var hr = _hr.words;\n\t var zl = _zl.words;\n\t var zr = _zr.words;\n\t var sl = _sl.words;\n\t var sr = _sr.words;\n\n\t // Working variables\n\t var al, bl, cl, dl, el;\n\t var ar, br, cr, dr, er;\n\n\t ar = al = H[0];\n\t br = bl = H[1];\n\t cr = cl = H[2];\n\t dr = dl = H[3];\n\t er = el = H[4];\n\t // Computation\n\t var t;\n\t for (var i = 0; i < 80; i += 1) {\n\t t = (al + M[offset+zl[i]])|0;\n\t if (i<16){\n\t\t t += f1(bl,cl,dl) + hl[0];\n\t } else if (i<32) {\n\t\t t += f2(bl,cl,dl) + hl[1];\n\t } else if (i<48) {\n\t\t t += f3(bl,cl,dl) + hl[2];\n\t } else if (i<64) {\n\t\t t += f4(bl,cl,dl) + hl[3];\n\t } else {// if (i<80) {\n\t\t t += f5(bl,cl,dl) + hl[4];\n\t }\n\t t = t|0;\n\t t = rotl(t,sl[i]);\n\t t = (t+el)|0;\n\t al = el;\n\t el = dl;\n\t dl = rotl(cl, 10);\n\t cl = bl;\n\t bl = t;\n\n\t t = (ar + M[offset+zr[i]])|0;\n\t if (i<16){\n\t\t t += f5(br,cr,dr) + hr[0];\n\t } else if (i<32) {\n\t\t t += f4(br,cr,dr) + hr[1];\n\t } else if (i<48) {\n\t\t t += f3(br,cr,dr) + hr[2];\n\t } else if (i<64) {\n\t\t t += f2(br,cr,dr) + hr[3];\n\t } else {// if (i<80) {\n\t\t t += f1(br,cr,dr) + hr[4];\n\t }\n\t t = t|0;\n\t t = rotl(t,sr[i]) ;\n\t t = (t+er)|0;\n\t ar = er;\n\t er = dr;\n\t dr = rotl(cr, 10);\n\t cr = br;\n\t br = t;\n\t }\n\t // Intermediate hash value\n\t t = (H[1] + cl + dr)|0;\n\t H[1] = (H[2] + dl + er)|0;\n\t H[2] = (H[3] + el + ar)|0;\n\t H[3] = (H[4] + al + br)|0;\n\t H[4] = (H[0] + bl + cr)|0;\n\t H[0] = t;\n\t },\n\n\t _doFinalize: function () {\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\n\t var nBitsTotal = this._nDataBytes * 8;\n\t var nBitsLeft = data.sigBytes * 8;\n\n\t // Add padding\n\t dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (\n\t (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) |\n\t (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00)\n\t );\n\t data.sigBytes = (dataWords.length + 1) * 4;\n\n\t // Hash final blocks\n\t this._process();\n\n\t // Shortcuts\n\t var hash = this._hash;\n\t var H = hash.words;\n\n\t // Swap endian\n\t for (var i = 0; i < 5; i++) {\n\t // Shortcut\n\t var H_i = H[i];\n\n\t // Swap\n\t H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) |\n\t (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00);\n\t }\n\n\t // Return final computed hash\n\t return hash;\n\t },\n\n\t clone: function () {\n\t var clone = Hasher.clone.call(this);\n\t clone._hash = this._hash.clone();\n\n\t return clone;\n\t }\n\t });\n\n\n\t function f1(x, y, z) {\n\t return ((x) ^ (y) ^ (z));\n\n\t }\n\n\t function f2(x, y, z) {\n\t return (((x)&(y)) | ((~x)&(z)));\n\t }\n\n\t function f3(x, y, z) {\n\t return (((x) | (~(y))) ^ (z));\n\t }\n\n\t function f4(x, y, z) {\n\t return (((x) & (z)) | ((y)&(~(z))));\n\t }\n\n\t function f5(x, y, z) {\n\t return ((x) ^ ((y) |(~(z))));\n\n\t }\n\n\t function rotl(x,n) {\n\t return (x<>>(32-n));\n\t }\n\n\n\t /**\n\t * Shortcut function to the hasher's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hash = CryptoJS.RIPEMD160('message');\n\t * var hash = CryptoJS.RIPEMD160(wordArray);\n\t */\n\t C.RIPEMD160 = Hasher._createHelper(RIPEMD160);\n\n\t /**\n\t * Shortcut function to the HMAC's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t * @param {WordArray|string} key The secret key.\n\t *\n\t * @return {WordArray} The HMAC.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hmac = CryptoJS.HmacRIPEMD160(message, key);\n\t */\n\t C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160);\n\t}(Math));\n\n\n\treturn CryptoJS.RIPEMD160;\n\n}));", ";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var Base = C_lib.Base;\n\t var C_enc = C.enc;\n\t var Utf8 = C_enc.Utf8;\n\t var C_algo = C.algo;\n\n\t /**\n\t * HMAC algorithm.\n\t */\n\t var HMAC = C_algo.HMAC = Base.extend({\n\t /**\n\t * Initializes a newly created HMAC.\n\t *\n\t * @param {Hasher} hasher The hash algorithm to use.\n\t * @param {WordArray|string} key The secret key.\n\t *\n\t * @example\n\t *\n\t * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key);\n\t */\n\t init: function (hasher, key) {\n\t // Init hasher\n\t hasher = this._hasher = new hasher.init();\n\n\t // Convert string to WordArray, else assume WordArray already\n\t if (typeof key == 'string') {\n\t key = Utf8.parse(key);\n\t }\n\n\t // Shortcuts\n\t var hasherBlockSize = hasher.blockSize;\n\t var hasherBlockSizeBytes = hasherBlockSize * 4;\n\n\t // Allow arbitrary length keys\n\t if (key.sigBytes > hasherBlockSizeBytes) {\n\t key = hasher.finalize(key);\n\t }\n\n\t // Clamp excess bits\n\t key.clamp();\n\n\t // Clone key for inner and outer pads\n\t var oKey = this._oKey = key.clone();\n\t var iKey = this._iKey = key.clone();\n\n\t // Shortcuts\n\t var oKeyWords = oKey.words;\n\t var iKeyWords = iKey.words;\n\n\t // XOR keys with pad constants\n\t for (var i = 0; i < hasherBlockSize; i++) {\n\t oKeyWords[i] ^= 0x5c5c5c5c;\n\t iKeyWords[i] ^= 0x36363636;\n\t }\n\t oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes;\n\n\t // Set initial values\n\t this.reset();\n\t },\n\n\t /**\n\t * Resets this HMAC to its initial state.\n\t *\n\t * @example\n\t *\n\t * hmacHasher.reset();\n\t */\n\t reset: function () {\n\t // Shortcut\n\t var hasher = this._hasher;\n\n\t // Reset\n\t hasher.reset();\n\t hasher.update(this._iKey);\n\t },\n\n\t /**\n\t * Updates this HMAC with a message.\n\t *\n\t * @param {WordArray|string} messageUpdate The message to append.\n\t *\n\t * @return {HMAC} This HMAC instance.\n\t *\n\t * @example\n\t *\n\t * hmacHasher.update('message');\n\t * hmacHasher.update(wordArray);\n\t */\n\t update: function (messageUpdate) {\n\t this._hasher.update(messageUpdate);\n\n\t // Chainable\n\t return this;\n\t },\n\n\t /**\n\t * Finalizes the HMAC computation.\n\t * Note that the finalize operation is effectively a destructive, read-once operation.\n\t *\n\t * @param {WordArray|string} messageUpdate (Optional) A final message update.\n\t *\n\t * @return {WordArray} The HMAC.\n\t *\n\t * @example\n\t *\n\t * var hmac = hmacHasher.finalize();\n\t * var hmac = hmacHasher.finalize('message');\n\t * var hmac = hmacHasher.finalize(wordArray);\n\t */\n\t finalize: function (messageUpdate) {\n\t // Shortcut\n\t var hasher = this._hasher;\n\n\t // Compute HMAC\n\t var innerHash = hasher.finalize(messageUpdate);\n\t hasher.reset();\n\t var hmac = hasher.finalize(this._oKey.clone().concat(innerHash));\n\n\t return hmac;\n\t }\n\t });\n\t}());\n\n\n}));", ";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./sha256\"), require(\"./hmac\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./sha256\", \"./hmac\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var Base = C_lib.Base;\n\t var WordArray = C_lib.WordArray;\n\t var C_algo = C.algo;\n\t var SHA256 = C_algo.SHA256;\n\t var HMAC = C_algo.HMAC;\n\n\t /**\n\t * Password-Based Key Derivation Function 2 algorithm.\n\t */\n\t var PBKDF2 = C_algo.PBKDF2 = Base.extend({\n\t /**\n\t * Configuration options.\n\t *\n\t * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)\n\t * @property {Hasher} hasher The hasher to use. Default: SHA256\n\t * @property {number} iterations The number of iterations to perform. Default: 250000\n\t */\n\t cfg: Base.extend({\n\t keySize: 128/32,\n\t hasher: SHA256,\n\t iterations: 250000\n\t }),\n\n\t /**\n\t * Initializes a newly created key derivation function.\n\t *\n\t * @param {Object} cfg (Optional) The configuration options to use for the derivation.\n\t *\n\t * @example\n\t *\n\t * var kdf = CryptoJS.algo.PBKDF2.create();\n\t * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 });\n\t * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 });\n\t */\n\t init: function (cfg) {\n\t this.cfg = this.cfg.extend(cfg);\n\t },\n\n\t /**\n\t * Computes the Password-Based Key Derivation Function 2.\n\t *\n\t * @param {WordArray|string} password The password.\n\t * @param {WordArray|string} salt A salt.\n\t *\n\t * @return {WordArray} The derived key.\n\t *\n\t * @example\n\t *\n\t * var key = kdf.compute(password, salt);\n\t */\n\t compute: function (password, salt) {\n\t // Shortcut\n\t var cfg = this.cfg;\n\n\t // Init HMAC\n\t var hmac = HMAC.create(cfg.hasher, password);\n\n\t // Initial values\n\t var derivedKey = WordArray.create();\n\t var blockIndex = WordArray.create([0x00000001]);\n\n\t // Shortcuts\n\t var derivedKeyWords = derivedKey.words;\n\t var blockIndexWords = blockIndex.words;\n\t var keySize = cfg.keySize;\n\t var iterations = cfg.iterations;\n\n\t // Generate key\n\t while (derivedKeyWords.length < keySize) {\n\t var block = hmac.update(salt).finalize(blockIndex);\n\t hmac.reset();\n\n\t // Shortcuts\n\t var blockWords = block.words;\n\t var blockWordsLength = blockWords.length;\n\n\t // Iterations\n\t var intermediate = block;\n\t for (var i = 1; i < iterations; i++) {\n\t intermediate = hmac.finalize(intermediate);\n\t hmac.reset();\n\n\t // Shortcut\n\t var intermediateWords = intermediate.words;\n\n\t // XOR intermediate with block\n\t for (var j = 0; j < blockWordsLength; j++) {\n\t blockWords[j] ^= intermediateWords[j];\n\t }\n\t }\n\n\t derivedKey.concat(block);\n\t blockIndexWords[0]++;\n\t }\n\t derivedKey.sigBytes = keySize * 4;\n\n\t return derivedKey;\n\t }\n\t });\n\n\t /**\n\t * Computes the Password-Based Key Derivation Function 2.\n\t *\n\t * @param {WordArray|string} password The password.\n\t * @param {WordArray|string} salt A salt.\n\t * @param {Object} cfg (Optional) The configuration options to use for this computation.\n\t *\n\t * @return {WordArray} The derived key.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var key = CryptoJS.PBKDF2(password, salt);\n\t * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8 });\n\t * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 });\n\t */\n\t C.PBKDF2 = function (password, salt, cfg) {\n\t return PBKDF2.create(cfg).compute(password, salt);\n\t };\n\t}());\n\n\n\treturn CryptoJS.PBKDF2;\n\n}));", ";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./sha1\"), require(\"./hmac\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./sha1\", \"./hmac\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var Base = C_lib.Base;\n\t var WordArray = C_lib.WordArray;\n\t var C_algo = C.algo;\n\t var MD5 = C_algo.MD5;\n\n\t /**\n\t * This key derivation function is meant to conform with EVP_BytesToKey.\n\t * www.openssl.org/docs/crypto/EVP_BytesToKey.html\n\t */\n\t var EvpKDF = C_algo.EvpKDF = Base.extend({\n\t /**\n\t * Configuration options.\n\t *\n\t * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)\n\t * @property {Hasher} hasher The hash algorithm to use. Default: MD5\n\t * @property {number} iterations The number of iterations to perform. Default: 1\n\t */\n\t cfg: Base.extend({\n\t keySize: 128/32,\n\t hasher: MD5,\n\t iterations: 1\n\t }),\n\n\t /**\n\t * Initializes a newly created key derivation function.\n\t *\n\t * @param {Object} cfg (Optional) The configuration options to use for the derivation.\n\t *\n\t * @example\n\t *\n\t * var kdf = CryptoJS.algo.EvpKDF.create();\n\t * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 });\n\t * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 });\n\t */\n\t init: function (cfg) {\n\t this.cfg = this.cfg.extend(cfg);\n\t },\n\n\t /**\n\t * Derives a key from a password.\n\t *\n\t * @param {WordArray|string} password The password.\n\t * @param {WordArray|string} salt A salt.\n\t *\n\t * @return {WordArray} The derived key.\n\t *\n\t * @example\n\t *\n\t * var key = kdf.compute(password, salt);\n\t */\n\t compute: function (password, salt) {\n\t var block;\n\n\t // Shortcut\n\t var cfg = this.cfg;\n\n\t // Init hasher\n\t var hasher = cfg.hasher.create();\n\n\t // Initial values\n\t var derivedKey = WordArray.create();\n\n\t // Shortcuts\n\t var derivedKeyWords = derivedKey.words;\n\t var keySize = cfg.keySize;\n\t var iterations = cfg.iterations;\n\n\t // Generate key\n\t while (derivedKeyWords.length < keySize) {\n\t if (block) {\n\t hasher.update(block);\n\t }\n\t block = hasher.update(password).finalize(salt);\n\t hasher.reset();\n\n\t // Iterations\n\t for (var i = 1; i < iterations; i++) {\n\t block = hasher.finalize(block);\n\t hasher.reset();\n\t }\n\n\t derivedKey.concat(block);\n\t }\n\t derivedKey.sigBytes = keySize * 4;\n\n\t return derivedKey;\n\t }\n\t });\n\n\t /**\n\t * Derives a key from a password.\n\t *\n\t * @param {WordArray|string} password The password.\n\t * @param {WordArray|string} salt A salt.\n\t * @param {Object} cfg (Optional) The configuration options to use for this computation.\n\t *\n\t * @return {WordArray} The derived key.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var key = CryptoJS.EvpKDF(password, salt);\n\t * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 });\n\t * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 });\n\t */\n\t C.EvpKDF = function (password, salt, cfg) {\n\t return EvpKDF.create(cfg).compute(password, salt);\n\t };\n\t}());\n\n\n\treturn CryptoJS.EvpKDF;\n\n}));", ";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./evpkdf\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./evpkdf\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t/**\n\t * Cipher core components.\n\t */\n\tCryptoJS.lib.Cipher || (function (undefined) {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var Base = C_lib.Base;\n\t var WordArray = C_lib.WordArray;\n\t var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm;\n\t var C_enc = C.enc;\n\t var Utf8 = C_enc.Utf8;\n\t var Base64 = C_enc.Base64;\n\t var C_algo = C.algo;\n\t var EvpKDF = C_algo.EvpKDF;\n\n\t /**\n\t * Abstract base cipher template.\n\t *\n\t * @property {number} keySize This cipher's key size. Default: 4 (128 bits)\n\t * @property {number} ivSize This cipher's IV size. Default: 4 (128 bits)\n\t * @property {number} _ENC_XFORM_MODE A constant representing encryption mode.\n\t * @property {number} _DEC_XFORM_MODE A constant representing decryption mode.\n\t */\n\t var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({\n\t /**\n\t * Configuration options.\n\t *\n\t * @property {WordArray} iv The IV to use for this operation.\n\t */\n\t cfg: Base.extend(),\n\n\t /**\n\t * Creates this cipher in encryption mode.\n\t *\n\t * @param {WordArray} key The key.\n\t * @param {Object} cfg (Optional) The configuration options to use for this operation.\n\t *\n\t * @return {Cipher} A cipher instance.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray });\n\t */\n\t createEncryptor: function (key, cfg) {\n\t return this.create(this._ENC_XFORM_MODE, key, cfg);\n\t },\n\n\t /**\n\t * Creates this cipher in decryption mode.\n\t *\n\t * @param {WordArray} key The key.\n\t * @param {Object} cfg (Optional) The configuration options to use for this operation.\n\t *\n\t * @return {Cipher} A cipher instance.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray });\n\t */\n\t createDecryptor: function (key, cfg) {\n\t return this.create(this._DEC_XFORM_MODE, key, cfg);\n\t },\n\n\t /**\n\t * Initializes a newly created cipher.\n\t *\n\t * @param {number} xformMode Either the encryption or decryption transormation mode constant.\n\t * @param {WordArray} key The key.\n\t * @param {Object} cfg (Optional) The configuration options to use for this operation.\n\t *\n\t * @example\n\t *\n\t * var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray });\n\t */\n\t init: function (xformMode, key, cfg) {\n\t // Apply config defaults\n\t this.cfg = this.cfg.extend(cfg);\n\n\t // Store transform mode and key\n\t this._xformMode = xformMode;\n\t this._key = key;\n\n\t // Set initial values\n\t this.reset();\n\t },\n\n\t /**\n\t * Resets this cipher to its initial state.\n\t *\n\t * @example\n\t *\n\t * cipher.reset();\n\t */\n\t reset: function () {\n\t // Reset data buffer\n\t BufferedBlockAlgorithm.reset.call(this);\n\n\t // Perform concrete-cipher logic\n\t this._doReset();\n\t },\n\n\t /**\n\t * Adds data to be encrypted or decrypted.\n\t *\n\t * @param {WordArray|string} dataUpdate The data to encrypt or decrypt.\n\t *\n\t * @return {WordArray} The data after processing.\n\t *\n\t * @example\n\t *\n\t * var encrypted = cipher.process('data');\n\t * var encrypted = cipher.process(wordArray);\n\t */\n\t process: function (dataUpdate) {\n\t // Append\n\t this._append(dataUpdate);\n\n\t // Process available blocks\n\t return this._process();\n\t },\n\n\t /**\n\t * Finalizes the encryption or decryption process.\n\t * Note that the finalize operation is effectively a destructive, read-once operation.\n\t *\n\t * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt.\n\t *\n\t * @return {WordArray} The data after final processing.\n\t *\n\t * @example\n\t *\n\t * var encrypted = cipher.finalize();\n\t * var encrypted = cipher.finalize('data');\n\t * var encrypted = cipher.finalize(wordArray);\n\t */\n\t finalize: function (dataUpdate) {\n\t // Final data update\n\t if (dataUpdate) {\n\t this._append(dataUpdate);\n\t }\n\n\t // Perform concrete-cipher logic\n\t var finalProcessedData = this._doFinalize();\n\n\t return finalProcessedData;\n\t },\n\n\t keySize: 128/32,\n\n\t ivSize: 128/32,\n\n\t _ENC_XFORM_MODE: 1,\n\n\t _DEC_XFORM_MODE: 2,\n\n\t /**\n\t * Creates shortcut functions to a cipher's object interface.\n\t *\n\t * @param {Cipher} cipher The cipher to create a helper for.\n\t *\n\t * @return {Object} An object with encrypt and decrypt shortcut functions.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES);\n\t */\n\t _createHelper: (function () {\n\t function selectCipherStrategy(key) {\n\t if (typeof key == 'string') {\n\t return PasswordBasedCipher;\n\t } else {\n\t return SerializableCipher;\n\t }\n\t }\n\n\t return function (cipher) {\n\t return {\n\t encrypt: function (message, key, cfg) {\n\t return selectCipherStrategy(key).encrypt(cipher, message, key, cfg);\n\t },\n\n\t decrypt: function (ciphertext, key, cfg) {\n\t return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg);\n\t }\n\t };\n\t };\n\t }())\n\t });\n\n\t /**\n\t * Abstract base stream cipher template.\n\t *\n\t * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits)\n\t */\n\t var StreamCipher = C_lib.StreamCipher = Cipher.extend({\n\t _doFinalize: function () {\n\t // Process partial blocks\n\t var finalProcessedBlocks = this._process(!!'flush');\n\n\t return finalProcessedBlocks;\n\t },\n\n\t blockSize: 1\n\t });\n\n\t /**\n\t * Mode namespace.\n\t */\n\t var C_mode = C.mode = {};\n\n\t /**\n\t * Abstract base block cipher mode template.\n\t */\n\t var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({\n\t /**\n\t * Creates this mode for encryption.\n\t *\n\t * @param {Cipher} cipher A block cipher instance.\n\t * @param {Array} iv The IV words.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words);\n\t */\n\t createEncryptor: function (cipher, iv) {\n\t return this.Encryptor.create(cipher, iv);\n\t },\n\n\t /**\n\t * Creates this mode for decryption.\n\t *\n\t * @param {Cipher} cipher A block cipher instance.\n\t * @param {Array} iv The IV words.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words);\n\t */\n\t createDecryptor: function (cipher, iv) {\n\t return this.Decryptor.create(cipher, iv);\n\t },\n\n\t /**\n\t * Initializes a newly created mode.\n\t *\n\t * @param {Cipher} cipher A block cipher instance.\n\t * @param {Array} iv The IV words.\n\t *\n\t * @example\n\t *\n\t * var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words);\n\t */\n\t init: function (cipher, iv) {\n\t this._cipher = cipher;\n\t this._iv = iv;\n\t }\n\t });\n\n\t /**\n\t * Cipher Block Chaining mode.\n\t */\n\t var CBC = C_mode.CBC = (function () {\n\t /**\n\t * Abstract base CBC mode.\n\t */\n\t var CBC = BlockCipherMode.extend();\n\n\t /**\n\t * CBC encryptor.\n\t */\n\t CBC.Encryptor = CBC.extend({\n\t /**\n\t * Processes the data block at offset.\n\t *\n\t * @param {Array} words The data words to operate on.\n\t * @param {number} offset The offset where the block starts.\n\t *\n\t * @example\n\t *\n\t * mode.processBlock(data.words, offset);\n\t */\n\t processBlock: function (words, offset) {\n\t // Shortcuts\n\t var cipher = this._cipher;\n\t var blockSize = cipher.blockSize;\n\n\t // XOR and encrypt\n\t xorBlock.call(this, words, offset, blockSize);\n\t cipher.encryptBlock(words, offset);\n\n\t // Remember this block to use with next block\n\t this._prevBlock = words.slice(offset, offset + blockSize);\n\t }\n\t });\n\n\t /**\n\t * CBC decryptor.\n\t */\n\t CBC.Decryptor = CBC.extend({\n\t /**\n\t * Processes the data block at offset.\n\t *\n\t * @param {Array} words The data words to operate on.\n\t * @param {number} offset The offset where the block starts.\n\t *\n\t * @example\n\t *\n\t * mode.processBlock(data.words, offset);\n\t */\n\t processBlock: function (words, offset) {\n\t // Shortcuts\n\t var cipher = this._cipher;\n\t var blockSize = cipher.blockSize;\n\n\t // Remember this block to use with next block\n\t var thisBlock = words.slice(offset, offset + blockSize);\n\n\t // Decrypt and XOR\n\t cipher.decryptBlock(words, offset);\n\t xorBlock.call(this, words, offset, blockSize);\n\n\t // This block becomes the previous block\n\t this._prevBlock = thisBlock;\n\t }\n\t });\n\n\t function xorBlock(words, offset, blockSize) {\n\t var block;\n\n\t // Shortcut\n\t var iv = this._iv;\n\n\t // Choose mixing block\n\t if (iv) {\n\t block = iv;\n\n\t // Remove IV for subsequent blocks\n\t this._iv = undefined;\n\t } else {\n\t block = this._prevBlock;\n\t }\n\n\t // XOR blocks\n\t for (var i = 0; i < blockSize; i++) {\n\t words[offset + i] ^= block[i];\n\t }\n\t }\n\n\t return CBC;\n\t }());\n\n\t /**\n\t * Padding namespace.\n\t */\n\t var C_pad = C.pad = {};\n\n\t /**\n\t * PKCS #5/7 padding strategy.\n\t */\n\t var Pkcs7 = C_pad.Pkcs7 = {\n\t /**\n\t * Pads data using the algorithm defined in PKCS #5/7.\n\t *\n\t * @param {WordArray} data The data to pad.\n\t * @param {number} blockSize The multiple that the data should be padded to.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * CryptoJS.pad.Pkcs7.pad(wordArray, 4);\n\t */\n\t pad: function (data, blockSize) {\n\t // Shortcut\n\t var blockSizeBytes = blockSize * 4;\n\n\t // Count padding bytes\n\t var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;\n\n\t // Create padding word\n\t var paddingWord = (nPaddingBytes << 24) | (nPaddingBytes << 16) | (nPaddingBytes << 8) | nPaddingBytes;\n\n\t // Create padding\n\t var paddingWords = [];\n\t for (var i = 0; i < nPaddingBytes; i += 4) {\n\t paddingWords.push(paddingWord);\n\t }\n\t var padding = WordArray.create(paddingWords, nPaddingBytes);\n\n\t // Add padding\n\t data.concat(padding);\n\t },\n\n\t /**\n\t * Unpads data that had been padded using the algorithm defined in PKCS #5/7.\n\t *\n\t * @param {WordArray} data The data to unpad.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * CryptoJS.pad.Pkcs7.unpad(wordArray);\n\t */\n\t unpad: function (data) {\n\t // Get number of padding bytes from last byte\n\t var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;\n\n\t // Remove padding\n\t data.sigBytes -= nPaddingBytes;\n\t }\n\t };\n\n\t /**\n\t * Abstract base block cipher template.\n\t *\n\t * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits)\n\t */\n\t var BlockCipher = C_lib.BlockCipher = Cipher.extend({\n\t /**\n\t * Configuration options.\n\t *\n\t * @property {Mode} mode The block mode to use. Default: CBC\n\t * @property {Padding} padding The padding strategy to use. Default: Pkcs7\n\t */\n\t cfg: Cipher.cfg.extend({\n\t mode: CBC,\n\t padding: Pkcs7\n\t }),\n\n\t reset: function () {\n\t var modeCreator;\n\n\t // Reset cipher\n\t Cipher.reset.call(this);\n\n\t // Shortcuts\n\t var cfg = this.cfg;\n\t var iv = cfg.iv;\n\t var mode = cfg.mode;\n\n\t // Reset block mode\n\t if (this._xformMode == this._ENC_XFORM_MODE) {\n\t modeCreator = mode.createEncryptor;\n\t } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {\n\t modeCreator = mode.createDecryptor;\n\t // Keep at least one block in the buffer for unpadding\n\t this._minBufferSize = 1;\n\t }\n\n\t if (this._mode && this._mode.__creator == modeCreator) {\n\t this._mode.init(this, iv && iv.words);\n\t } else {\n\t this._mode = modeCreator.call(mode, this, iv && iv.words);\n\t this._mode.__creator = modeCreator;\n\t }\n\t },\n\n\t _doProcessBlock: function (words, offset) {\n\t this._mode.processBlock(words, offset);\n\t },\n\n\t _doFinalize: function () {\n\t var finalProcessedBlocks;\n\n\t // Shortcut\n\t var padding = this.cfg.padding;\n\n\t // Finalize\n\t if (this._xformMode == this._ENC_XFORM_MODE) {\n\t // Pad data\n\t padding.pad(this._data, this.blockSize);\n\n\t // Process final blocks\n\t finalProcessedBlocks = this._process(!!'flush');\n\t } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {\n\t // Process final blocks\n\t finalProcessedBlocks = this._process(!!'flush');\n\n\t // Unpad data\n\t padding.unpad(finalProcessedBlocks);\n\t }\n\n\t return finalProcessedBlocks;\n\t },\n\n\t blockSize: 128/32\n\t });\n\n\t /**\n\t * A collection of cipher parameters.\n\t *\n\t * @property {WordArray} ciphertext The raw ciphertext.\n\t * @property {WordArray} key The key to this ciphertext.\n\t * @property {WordArray} iv The IV used in the ciphering operation.\n\t * @property {WordArray} salt The salt used with a key derivation function.\n\t * @property {Cipher} algorithm The cipher algorithm.\n\t * @property {Mode} mode The block mode used in the ciphering operation.\n\t * @property {Padding} padding The padding scheme used in the ciphering operation.\n\t * @property {number} blockSize The block size of the cipher.\n\t * @property {Format} formatter The default formatting strategy to convert this cipher params object to a string.\n\t */\n\t var CipherParams = C_lib.CipherParams = Base.extend({\n\t /**\n\t * Initializes a newly created cipher params object.\n\t *\n\t * @param {Object} cipherParams An object with any of the possible cipher parameters.\n\t *\n\t * @example\n\t *\n\t * var cipherParams = CryptoJS.lib.CipherParams.create({\n\t * ciphertext: ciphertextWordArray,\n\t * key: keyWordArray,\n\t * iv: ivWordArray,\n\t * salt: saltWordArray,\n\t * algorithm: CryptoJS.algo.AES,\n\t * mode: CryptoJS.mode.CBC,\n\t * padding: CryptoJS.pad.PKCS7,\n\t * blockSize: 4,\n\t * formatter: CryptoJS.format.OpenSSL\n\t * });\n\t */\n\t init: function (cipherParams) {\n\t this.mixIn(cipherParams);\n\t },\n\n\t /**\n\t * Converts this cipher params object to a string.\n\t *\n\t * @param {Format} formatter (Optional) The formatting strategy to use.\n\t *\n\t * @return {string} The stringified cipher params.\n\t *\n\t * @throws Error If neither the formatter nor the default formatter is set.\n\t *\n\t * @example\n\t *\n\t * var string = cipherParams + '';\n\t * var string = cipherParams.toString();\n\t * var string = cipherParams.toString(CryptoJS.format.OpenSSL);\n\t */\n\t toString: function (formatter) {\n\t return (formatter || this.formatter).stringify(this);\n\t }\n\t });\n\n\t /**\n\t * Format namespace.\n\t */\n\t var C_format = C.format = {};\n\n\t /**\n\t * OpenSSL formatting strategy.\n\t */\n\t var OpenSSLFormatter = C_format.OpenSSL = {\n\t /**\n\t * Converts a cipher params object to an OpenSSL-compatible string.\n\t *\n\t * @param {CipherParams} cipherParams The cipher params object.\n\t *\n\t * @return {string} The OpenSSL-compatible string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams);\n\t */\n\t stringify: function (cipherParams) {\n\t var wordArray;\n\n\t // Shortcuts\n\t var ciphertext = cipherParams.ciphertext;\n\t var salt = cipherParams.salt;\n\n\t // Format\n\t if (salt) {\n\t wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext);\n\t } else {\n\t wordArray = ciphertext;\n\t }\n\n\t return wordArray.toString(Base64);\n\t },\n\n\t /**\n\t * Converts an OpenSSL-compatible string to a cipher params object.\n\t *\n\t * @param {string} openSSLStr The OpenSSL-compatible string.\n\t *\n\t * @return {CipherParams} The cipher params object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString);\n\t */\n\t parse: function (openSSLStr) {\n\t var salt;\n\n\t // Parse base64\n\t var ciphertext = Base64.parse(openSSLStr);\n\n\t // Shortcut\n\t var ciphertextWords = ciphertext.words;\n\n\t // Test for salt\n\t if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) {\n\t // Extract salt\n\t salt = WordArray.create(ciphertextWords.slice(2, 4));\n\n\t // Remove salt from ciphertext\n\t ciphertextWords.splice(0, 4);\n\t ciphertext.sigBytes -= 16;\n\t }\n\n\t return CipherParams.create({ ciphertext: ciphertext, salt: salt });\n\t }\n\t };\n\n\t /**\n\t * A cipher wrapper that returns ciphertext as a serializable cipher params object.\n\t */\n\t var SerializableCipher = C_lib.SerializableCipher = Base.extend({\n\t /**\n\t * Configuration options.\n\t *\n\t * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL\n\t */\n\t cfg: Base.extend({\n\t format: OpenSSLFormatter\n\t }),\n\n\t /**\n\t * Encrypts a message.\n\t *\n\t * @param {Cipher} cipher The cipher algorithm to use.\n\t * @param {WordArray|string} message The message to encrypt.\n\t * @param {WordArray} key The key.\n\t * @param {Object} cfg (Optional) The configuration options to use for this operation.\n\t *\n\t * @return {CipherParams} A cipher params object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key);\n\t * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv });\n\t * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL });\n\t */\n\t encrypt: function (cipher, message, key, cfg) {\n\t // Apply config defaults\n\t cfg = this.cfg.extend(cfg);\n\n\t // Encrypt\n\t var encryptor = cipher.createEncryptor(key, cfg);\n\t var ciphertext = encryptor.finalize(message);\n\n\t // Shortcut\n\t var cipherCfg = encryptor.cfg;\n\n\t // Create and return serializable cipher params\n\t return CipherParams.create({\n\t ciphertext: ciphertext,\n\t key: key,\n\t iv: cipherCfg.iv,\n\t algorithm: cipher,\n\t mode: cipherCfg.mode,\n\t padding: cipherCfg.padding,\n\t blockSize: cipher.blockSize,\n\t formatter: cfg.format\n\t });\n\t },\n\n\t /**\n\t * Decrypts serialized ciphertext.\n\t *\n\t * @param {Cipher} cipher The cipher algorithm to use.\n\t * @param {CipherParams|string} ciphertext The ciphertext to decrypt.\n\t * @param {WordArray} key The key.\n\t * @param {Object} cfg (Optional) The configuration options to use for this operation.\n\t *\n\t * @return {WordArray} The plaintext.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL });\n\t * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL });\n\t */\n\t decrypt: function (cipher, ciphertext, key, cfg) {\n\t // Apply config defaults\n\t cfg = this.cfg.extend(cfg);\n\n\t // Convert string to CipherParams\n\t ciphertext = this._parse(ciphertext, cfg.format);\n\n\t // Decrypt\n\t var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext);\n\n\t return plaintext;\n\t },\n\n\t /**\n\t * Converts serialized ciphertext to CipherParams,\n\t * else assumed CipherParams already and returns ciphertext unchanged.\n\t *\n\t * @param {CipherParams|string} ciphertext The ciphertext.\n\t * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext.\n\t *\n\t * @return {CipherParams} The unserialized ciphertext.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format);\n\t */\n\t _parse: function (ciphertext, format) {\n\t if (typeof ciphertext == 'string') {\n\t return format.parse(ciphertext, this);\n\t } else {\n\t return ciphertext;\n\t }\n\t }\n\t });\n\n\t /**\n\t * Key derivation function namespace.\n\t */\n\t var C_kdf = C.kdf = {};\n\n\t /**\n\t * OpenSSL key derivation function.\n\t */\n\t var OpenSSLKdf = C_kdf.OpenSSL = {\n\t /**\n\t * Derives a key and IV from a password.\n\t *\n\t * @param {string} password The password to derive from.\n\t * @param {number} keySize The size in words of the key to generate.\n\t * @param {number} ivSize The size in words of the IV to generate.\n\t * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly.\n\t *\n\t * @return {CipherParams} A cipher params object with the key, IV, and salt.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32);\n\t * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt');\n\t */\n\t execute: function (password, keySize, ivSize, salt, hasher) {\n\t // Generate random salt\n\t if (!salt) {\n\t salt = WordArray.random(64/8);\n\t }\n\n\t // Derive key and IV\n\t if (!hasher) {\n\t var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt);\n\t } else {\n\t var key = EvpKDF.create({ keySize: keySize + ivSize, hasher: hasher }).compute(password, salt);\n\t }\n\n\n\t // Separate key and IV\n\t var iv = WordArray.create(key.words.slice(keySize), ivSize * 4);\n\t key.sigBytes = keySize * 4;\n\n\t // Return params\n\t return CipherParams.create({ key: key, iv: iv, salt: salt });\n\t }\n\t };\n\n\t /**\n\t * A serializable cipher wrapper that derives the key from a password,\n\t * and returns ciphertext as a serializable cipher params object.\n\t */\n\t var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({\n\t /**\n\t * Configuration options.\n\t *\n\t * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL\n\t */\n\t cfg: SerializableCipher.cfg.extend({\n\t kdf: OpenSSLKdf\n\t }),\n\n\t /**\n\t * Encrypts a message using a password.\n\t *\n\t * @param {Cipher} cipher The cipher algorithm to use.\n\t * @param {WordArray|string} message The message to encrypt.\n\t * @param {string} password The password.\n\t * @param {Object} cfg (Optional) The configuration options to use for this operation.\n\t *\n\t * @return {CipherParams} A cipher params object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password');\n\t * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL });\n\t */\n\t encrypt: function (cipher, message, password, cfg) {\n\t // Apply config defaults\n\t cfg = this.cfg.extend(cfg);\n\n\t // Derive key and other params\n\t var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, cfg.salt, cfg.hasher);\n\n\t // Add IV to config\n\t cfg.iv = derivedParams.iv;\n\n\t // Encrypt\n\t var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg);\n\n\t // Mix in derived params\n\t ciphertext.mixIn(derivedParams);\n\n\t return ciphertext;\n\t },\n\n\t /**\n\t * Decrypts serialized ciphertext using a password.\n\t *\n\t * @param {Cipher} cipher The cipher algorithm to use.\n\t * @param {CipherParams|string} ciphertext The ciphertext to decrypt.\n\t * @param {string} password The password.\n\t * @param {Object} cfg (Optional) The configuration options to use for this operation.\n\t *\n\t * @return {WordArray} The plaintext.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL });\n\t * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL });\n\t */\n\t decrypt: function (cipher, ciphertext, password, cfg) {\n\t // Apply config defaults\n\t cfg = this.cfg.extend(cfg);\n\n\t // Convert string to CipherParams\n\t ciphertext = this._parse(ciphertext, cfg.format);\n\n\t // Derive key and other params\n\t var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt, cfg.hasher);\n\n\t // Add IV to config\n\t cfg.iv = derivedParams.iv;\n\n\t // Decrypt\n\t var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg);\n\n\t return plaintext;\n\t }\n\t });\n\t}());\n\n\n}));", ";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t/**\n\t * Cipher Feedback block mode.\n\t */\n\tCryptoJS.mode.CFB = (function () {\n\t var CFB = CryptoJS.lib.BlockCipherMode.extend();\n\n\t CFB.Encryptor = CFB.extend({\n\t processBlock: function (words, offset) {\n\t // Shortcuts\n\t var cipher = this._cipher;\n\t var blockSize = cipher.blockSize;\n\n\t generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);\n\n\t // Remember this block to use with next block\n\t this._prevBlock = words.slice(offset, offset + blockSize);\n\t }\n\t });\n\n\t CFB.Decryptor = CFB.extend({\n\t processBlock: function (words, offset) {\n\t // Shortcuts\n\t var cipher = this._cipher;\n\t var blockSize = cipher.blockSize;\n\n\t // Remember this block to use with next block\n\t var thisBlock = words.slice(offset, offset + blockSize);\n\n\t generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);\n\n\t // This block becomes the previous block\n\t this._prevBlock = thisBlock;\n\t }\n\t });\n\n\t function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) {\n\t var keystream;\n\n\t // Shortcut\n\t var iv = this._iv;\n\n\t // Generate keystream\n\t if (iv) {\n\t keystream = iv.slice(0);\n\n\t // Remove IV for subsequent blocks\n\t this._iv = undefined;\n\t } else {\n\t keystream = this._prevBlock;\n\t }\n\t cipher.encryptBlock(keystream, 0);\n\n\t // Encrypt\n\t for (var i = 0; i < blockSize; i++) {\n\t words[offset + i] ^= keystream[i];\n\t }\n\t }\n\n\t return CFB;\n\t}());\n\n\n\treturn CryptoJS.mode.CFB;\n\n}));", ";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t/**\n\t * Counter block mode.\n\t */\n\tCryptoJS.mode.CTR = (function () {\n\t var CTR = CryptoJS.lib.BlockCipherMode.extend();\n\n\t var Encryptor = CTR.Encryptor = CTR.extend({\n\t processBlock: function (words, offset) {\n\t // Shortcuts\n\t var cipher = this._cipher\n\t var blockSize = cipher.blockSize;\n\t var iv = this._iv;\n\t var counter = this._counter;\n\n\t // Generate keystream\n\t if (iv) {\n\t counter = this._counter = iv.slice(0);\n\n\t // Remove IV for subsequent blocks\n\t this._iv = undefined;\n\t }\n\t var keystream = counter.slice(0);\n\t cipher.encryptBlock(keystream, 0);\n\n\t // Increment counter\n\t counter[blockSize - 1] = (counter[blockSize - 1] + 1) | 0\n\n\t // Encrypt\n\t for (var i = 0; i < blockSize; i++) {\n\t words[offset + i] ^= keystream[i];\n\t }\n\t }\n\t });\n\n\t CTR.Decryptor = Encryptor;\n\n\t return CTR;\n\t}());\n\n\n\treturn CryptoJS.mode.CTR;\n\n}));", ";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t/** @preserve\n\t * Counter block mode compatible with Dr Brian Gladman fileenc.c\n\t * derived from CryptoJS.mode.CTR\n\t * Jan Hruby jhruby.web@gmail.com\n\t */\n\tCryptoJS.mode.CTRGladman = (function () {\n\t var CTRGladman = CryptoJS.lib.BlockCipherMode.extend();\n\n\t\tfunction incWord(word)\n\t\t{\n\t\t\tif (((word >> 24) & 0xff) === 0xff) { //overflow\n\t\t\tvar b1 = (word >> 16)&0xff;\n\t\t\tvar b2 = (word >> 8)&0xff;\n\t\t\tvar b3 = word & 0xff;\n\n\t\t\tif (b1 === 0xff) // overflow b1\n\t\t\t{\n\t\t\tb1 = 0;\n\t\t\tif (b2 === 0xff)\n\t\t\t{\n\t\t\t\tb2 = 0;\n\t\t\t\tif (b3 === 0xff)\n\t\t\t\t{\n\t\t\t\t\tb3 = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t++b3;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t++b2;\n\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t++b1;\n\t\t\t}\n\n\t\t\tword = 0;\n\t\t\tword += (b1 << 16);\n\t\t\tword += (b2 << 8);\n\t\t\tword += b3;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\tword += (0x01 << 24);\n\t\t\t}\n\t\t\treturn word;\n\t\t}\n\n\t\tfunction incCounter(counter)\n\t\t{\n\t\t\tif ((counter[0] = incWord(counter[0])) === 0)\n\t\t\t{\n\t\t\t\t// encr_data in fileenc.c from Dr Brian Gladman's counts only with DWORD j < 8\n\t\t\t\tcounter[1] = incWord(counter[1]);\n\t\t\t}\n\t\t\treturn counter;\n\t\t}\n\n\t var Encryptor = CTRGladman.Encryptor = CTRGladman.extend({\n\t processBlock: function (words, offset) {\n\t // Shortcuts\n\t var cipher = this._cipher\n\t var blockSize = cipher.blockSize;\n\t var iv = this._iv;\n\t var counter = this._counter;\n\n\t // Generate keystream\n\t if (iv) {\n\t counter = this._counter = iv.slice(0);\n\n\t // Remove IV for subsequent blocks\n\t this._iv = undefined;\n\t }\n\n\t\t\t\tincCounter(counter);\n\n\t\t\t\tvar keystream = counter.slice(0);\n\t cipher.encryptBlock(keystream, 0);\n\n\t // Encrypt\n\t for (var i = 0; i < blockSize; i++) {\n\t words[offset + i] ^= keystream[i];\n\t }\n\t }\n\t });\n\n\t CTRGladman.Decryptor = Encryptor;\n\n\t return CTRGladman;\n\t}());\n\n\n\n\n\treturn CryptoJS.mode.CTRGladman;\n\n}));", ";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t/**\n\t * Output Feedback block mode.\n\t */\n\tCryptoJS.mode.OFB = (function () {\n\t var OFB = CryptoJS.lib.BlockCipherMode.extend();\n\n\t var Encryptor = OFB.Encryptor = OFB.extend({\n\t processBlock: function (words, offset) {\n\t // Shortcuts\n\t var cipher = this._cipher\n\t var blockSize = cipher.blockSize;\n\t var iv = this._iv;\n\t var keystream = this._keystream;\n\n\t // Generate keystream\n\t if (iv) {\n\t keystream = this._keystream = iv.slice(0);\n\n\t // Remove IV for subsequent blocks\n\t this._iv = undefined;\n\t }\n\t cipher.encryptBlock(keystream, 0);\n\n\t // Encrypt\n\t for (var i = 0; i < blockSize; i++) {\n\t words[offset + i] ^= keystream[i];\n\t }\n\t }\n\t });\n\n\t OFB.Decryptor = Encryptor;\n\n\t return OFB;\n\t}());\n\n\n\treturn CryptoJS.mode.OFB;\n\n}));", ";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t/**\n\t * Electronic Codebook block mode.\n\t */\n\tCryptoJS.mode.ECB = (function () {\n\t var ECB = CryptoJS.lib.BlockCipherMode.extend();\n\n\t ECB.Encryptor = ECB.extend({\n\t processBlock: function (words, offset) {\n\t this._cipher.encryptBlock(words, offset);\n\t }\n\t });\n\n\t ECB.Decryptor = ECB.extend({\n\t processBlock: function (words, offset) {\n\t this._cipher.decryptBlock(words, offset);\n\t }\n\t });\n\n\t return ECB;\n\t}());\n\n\n\treturn CryptoJS.mode.ECB;\n\n}));", ";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t/**\n\t * ANSI X.923 padding strategy.\n\t */\n\tCryptoJS.pad.AnsiX923 = {\n\t pad: function (data, blockSize) {\n\t // Shortcuts\n\t var dataSigBytes = data.sigBytes;\n\t var blockSizeBytes = blockSize * 4;\n\n\t // Count padding bytes\n\t var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes;\n\n\t // Compute last byte position\n\t var lastBytePos = dataSigBytes + nPaddingBytes - 1;\n\n\t // Pad\n\t data.clamp();\n\t data.words[lastBytePos >>> 2] |= nPaddingBytes << (24 - (lastBytePos % 4) * 8);\n\t data.sigBytes += nPaddingBytes;\n\t },\n\n\t unpad: function (data) {\n\t // Get number of padding bytes from last byte\n\t var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;\n\n\t // Remove padding\n\t data.sigBytes -= nPaddingBytes;\n\t }\n\t};\n\n\n\treturn CryptoJS.pad.Ansix923;\n\n}));", ";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t/**\n\t * ISO 10126 padding strategy.\n\t */\n\tCryptoJS.pad.Iso10126 = {\n\t pad: function (data, blockSize) {\n\t // Shortcut\n\t var blockSizeBytes = blockSize * 4;\n\n\t // Count padding bytes\n\t var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;\n\n\t // Pad\n\t data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)).\n\t concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1));\n\t },\n\n\t unpad: function (data) {\n\t // Get number of padding bytes from last byte\n\t var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;\n\n\t // Remove padding\n\t data.sigBytes -= nPaddingBytes;\n\t }\n\t};\n\n\n\treturn CryptoJS.pad.Iso10126;\n\n}));", ";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t/**\n\t * ISO/IEC 9797-1 Padding Method 2.\n\t */\n\tCryptoJS.pad.Iso97971 = {\n\t pad: function (data, blockSize) {\n\t // Add 0x80 byte\n\t data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1));\n\n\t // Zero pad the rest\n\t CryptoJS.pad.ZeroPadding.pad(data, blockSize);\n\t },\n\n\t unpad: function (data) {\n\t // Remove zero padding\n\t CryptoJS.pad.ZeroPadding.unpad(data);\n\n\t // Remove one more byte -- the 0x80 byte\n\t data.sigBytes--;\n\t }\n\t};\n\n\n\treturn CryptoJS.pad.Iso97971;\n\n}));", ";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t/**\n\t * Zero padding strategy.\n\t */\n\tCryptoJS.pad.ZeroPadding = {\n\t pad: function (data, blockSize) {\n\t // Shortcut\n\t var blockSizeBytes = blockSize * 4;\n\n\t // Pad\n\t data.clamp();\n\t data.sigBytes += blockSizeBytes - ((data.sigBytes % blockSizeBytes) || blockSizeBytes);\n\t },\n\n\t unpad: function (data) {\n\t // Shortcut\n\t var dataWords = data.words;\n\n\t // Unpad\n\t var i = data.sigBytes - 1;\n\t for (var i = data.sigBytes - 1; i >= 0; i--) {\n\t if (((dataWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff)) {\n\t data.sigBytes = i + 1;\n\t break;\n\t }\n\t }\n\t }\n\t};\n\n\n\treturn CryptoJS.pad.ZeroPadding;\n\n}));", ";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t/**\n\t * A noop padding strategy.\n\t */\n\tCryptoJS.pad.NoPadding = {\n\t pad: function () {\n\t },\n\n\t unpad: function () {\n\t }\n\t};\n\n\n\treturn CryptoJS.pad.NoPadding;\n\n}));", ";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function (undefined) {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var CipherParams = C_lib.CipherParams;\n\t var C_enc = C.enc;\n\t var Hex = C_enc.Hex;\n\t var C_format = C.format;\n\n\t var HexFormatter = C_format.Hex = {\n\t /**\n\t * Converts the ciphertext of a cipher params object to a hexadecimally encoded string.\n\t *\n\t * @param {CipherParams} cipherParams The cipher params object.\n\t *\n\t * @return {string} The hexadecimally encoded string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hexString = CryptoJS.format.Hex.stringify(cipherParams);\n\t */\n\t stringify: function (cipherParams) {\n\t return cipherParams.ciphertext.toString(Hex);\n\t },\n\n\t /**\n\t * Converts a hexadecimally encoded ciphertext string to a cipher params object.\n\t *\n\t * @param {string} input The hexadecimally encoded string.\n\t *\n\t * @return {CipherParams} The cipher params object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var cipherParams = CryptoJS.format.Hex.parse(hexString);\n\t */\n\t parse: function (input) {\n\t var ciphertext = Hex.parse(input);\n\t return CipherParams.create({ ciphertext: ciphertext });\n\t }\n\t };\n\t}());\n\n\n\treturn CryptoJS.format.Hex;\n\n}));", ";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./enc-base64\"), require(\"./md5\"), require(\"./evpkdf\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./enc-base64\", \"./md5\", \"./evpkdf\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var BlockCipher = C_lib.BlockCipher;\n\t var C_algo = C.algo;\n\n\t // Lookup tables\n\t var SBOX = [];\n\t var INV_SBOX = [];\n\t var SUB_MIX_0 = [];\n\t var SUB_MIX_1 = [];\n\t var SUB_MIX_2 = [];\n\t var SUB_MIX_3 = [];\n\t var INV_SUB_MIX_0 = [];\n\t var INV_SUB_MIX_1 = [];\n\t var INV_SUB_MIX_2 = [];\n\t var INV_SUB_MIX_3 = [];\n\n\t // Compute lookup tables\n\t (function () {\n\t // Compute double table\n\t var d = [];\n\t for (var i = 0; i < 256; i++) {\n\t if (i < 128) {\n\t d[i] = i << 1;\n\t } else {\n\t d[i] = (i << 1) ^ 0x11b;\n\t }\n\t }\n\n\t // Walk GF(2^8)\n\t var x = 0;\n\t var xi = 0;\n\t for (var i = 0; i < 256; i++) {\n\t // Compute sbox\n\t var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4);\n\t sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63;\n\t SBOX[x] = sx;\n\t INV_SBOX[sx] = x;\n\n\t // Compute multiplication\n\t var x2 = d[x];\n\t var x4 = d[x2];\n\t var x8 = d[x4];\n\n\t // Compute sub bytes, mix columns tables\n\t var t = (d[sx] * 0x101) ^ (sx * 0x1010100);\n\t SUB_MIX_0[x] = (t << 24) | (t >>> 8);\n\t SUB_MIX_1[x] = (t << 16) | (t >>> 16);\n\t SUB_MIX_2[x] = (t << 8) | (t >>> 24);\n\t SUB_MIX_3[x] = t;\n\n\t // Compute inv sub bytes, inv mix columns tables\n\t var t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100);\n\t INV_SUB_MIX_0[sx] = (t << 24) | (t >>> 8);\n\t INV_SUB_MIX_1[sx] = (t << 16) | (t >>> 16);\n\t INV_SUB_MIX_2[sx] = (t << 8) | (t >>> 24);\n\t INV_SUB_MIX_3[sx] = t;\n\n\t // Compute next counter\n\t if (!x) {\n\t x = xi = 1;\n\t } else {\n\t x = x2 ^ d[d[d[x8 ^ x2]]];\n\t xi ^= d[d[xi]];\n\t }\n\t }\n\t }());\n\n\t // Precomputed Rcon lookup\n\t var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];\n\n\t /**\n\t * AES block cipher algorithm.\n\t */\n\t var AES = C_algo.AES = BlockCipher.extend({\n\t _doReset: function () {\n\t var t;\n\n\t // Skip reset of nRounds has been set before and key did not change\n\t if (this._nRounds && this._keyPriorReset === this._key) {\n\t return;\n\t }\n\n\t // Shortcuts\n\t var key = this._keyPriorReset = this._key;\n\t var keyWords = key.words;\n\t var keySize = key.sigBytes / 4;\n\n\t // Compute number of rounds\n\t var nRounds = this._nRounds = keySize + 6;\n\n\t // Compute number of key schedule rows\n\t var ksRows = (nRounds + 1) * 4;\n\n\t // Compute key schedule\n\t var keySchedule = this._keySchedule = [];\n\t for (var ksRow = 0; ksRow < ksRows; ksRow++) {\n\t if (ksRow < keySize) {\n\t keySchedule[ksRow] = keyWords[ksRow];\n\t } else {\n\t t = keySchedule[ksRow - 1];\n\n\t if (!(ksRow % keySize)) {\n\t // Rot word\n\t t = (t << 8) | (t >>> 24);\n\n\t // Sub word\n\t t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff];\n\n\t // Mix Rcon\n\t t ^= RCON[(ksRow / keySize) | 0] << 24;\n\t } else if (keySize > 6 && ksRow % keySize == 4) {\n\t // Sub word\n\t t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff];\n\t }\n\n\t keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t;\n\t }\n\t }\n\n\t // Compute inv key schedule\n\t var invKeySchedule = this._invKeySchedule = [];\n\t for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) {\n\t var ksRow = ksRows - invKsRow;\n\n\t if (invKsRow % 4) {\n\t var t = keySchedule[ksRow];\n\t } else {\n\t var t = keySchedule[ksRow - 4];\n\t }\n\n\t if (invKsRow < 4 || ksRow <= 4) {\n\t invKeySchedule[invKsRow] = t;\n\t } else {\n\t invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[(t >>> 16) & 0xff]] ^\n\t INV_SUB_MIX_2[SBOX[(t >>> 8) & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]];\n\t }\n\t }\n\t },\n\n\t encryptBlock: function (M, offset) {\n\t this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX);\n\t },\n\n\t decryptBlock: function (M, offset) {\n\t // Swap 2nd and 4th rows\n\t var t = M[offset + 1];\n\t M[offset + 1] = M[offset + 3];\n\t M[offset + 3] = t;\n\n\t this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX);\n\n\t // Inv swap 2nd and 4th rows\n\t var t = M[offset + 1];\n\t M[offset + 1] = M[offset + 3];\n\t M[offset + 3] = t;\n\t },\n\n\t _doCryptBlock: function (M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) {\n\t // Shortcut\n\t var nRounds = this._nRounds;\n\n\t // Get input, add round key\n\t var s0 = M[offset] ^ keySchedule[0];\n\t var s1 = M[offset + 1] ^ keySchedule[1];\n\t var s2 = M[offset + 2] ^ keySchedule[2];\n\t var s3 = M[offset + 3] ^ keySchedule[3];\n\n\t // Key schedule row counter\n\t var ksRow = 4;\n\n\t // Rounds\n\t for (var round = 1; round < nRounds; round++) {\n\t // Shift rows, sub bytes, mix columns, add round key\n\t var t0 = SUB_MIX_0[s0 >>> 24] ^ SUB_MIX_1[(s1 >>> 16) & 0xff] ^ SUB_MIX_2[(s2 >>> 8) & 0xff] ^ SUB_MIX_3[s3 & 0xff] ^ keySchedule[ksRow++];\n\t var t1 = SUB_MIX_0[s1 >>> 24] ^ SUB_MIX_1[(s2 >>> 16) & 0xff] ^ SUB_MIX_2[(s3 >>> 8) & 0xff] ^ SUB_MIX_3[s0 & 0xff] ^ keySchedule[ksRow++];\n\t var t2 = SUB_MIX_0[s2 >>> 24] ^ SUB_MIX_1[(s3 >>> 16) & 0xff] ^ SUB_MIX_2[(s0 >>> 8) & 0xff] ^ SUB_MIX_3[s1 & 0xff] ^ keySchedule[ksRow++];\n\t var t3 = SUB_MIX_0[s3 >>> 24] ^ SUB_MIX_1[(s0 >>> 16) & 0xff] ^ SUB_MIX_2[(s1 >>> 8) & 0xff] ^ SUB_MIX_3[s2 & 0xff] ^ keySchedule[ksRow++];\n\n\t // Update state\n\t s0 = t0;\n\t s1 = t1;\n\t s2 = t2;\n\t s3 = t3;\n\t }\n\n\t // Shift rows, sub bytes, add round key\n\t var t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++];\n\t var t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++];\n\t var t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++];\n\t var t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++];\n\n\t // Set output\n\t M[offset] = t0;\n\t M[offset + 1] = t1;\n\t M[offset + 2] = t2;\n\t M[offset + 3] = t3;\n\t },\n\n\t keySize: 256/32\n\t });\n\n\t /**\n\t * Shortcut functions to the cipher's object interface.\n\t *\n\t * @example\n\t *\n\t * var ciphertext = CryptoJS.AES.encrypt(message, key, cfg);\n\t * var plaintext = CryptoJS.AES.decrypt(ciphertext, key, cfg);\n\t */\n\t C.AES = BlockCipher._createHelper(AES);\n\t}());\n\n\n\treturn CryptoJS.AES;\n\n}));", ";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./enc-base64\"), require(\"./md5\"), require(\"./evpkdf\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./enc-base64\", \"./md5\", \"./evpkdf\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var BlockCipher = C_lib.BlockCipher;\n\t var C_algo = C.algo;\n\n\t // Permuted Choice 1 constants\n\t var PC1 = [\n\t 57, 49, 41, 33, 25, 17, 9, 1,\n\t 58, 50, 42, 34, 26, 18, 10, 2,\n\t 59, 51, 43, 35, 27, 19, 11, 3,\n\t 60, 52, 44, 36, 63, 55, 47, 39,\n\t 31, 23, 15, 7, 62, 54, 46, 38,\n\t 30, 22, 14, 6, 61, 53, 45, 37,\n\t 29, 21, 13, 5, 28, 20, 12, 4\n\t ];\n\n\t // Permuted Choice 2 constants\n\t var PC2 = [\n\t 14, 17, 11, 24, 1, 5,\n\t 3, 28, 15, 6, 21, 10,\n\t 23, 19, 12, 4, 26, 8,\n\t 16, 7, 27, 20, 13, 2,\n\t 41, 52, 31, 37, 47, 55,\n\t 30, 40, 51, 45, 33, 48,\n\t 44, 49, 39, 56, 34, 53,\n\t 46, 42, 50, 36, 29, 32\n\t ];\n\n\t // Cumulative bit shift constants\n\t var BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28];\n\n\t // SBOXes and round permutation constants\n\t var SBOX_P = [\n\t {\n\t 0x0: 0x808200,\n\t 0x10000000: 0x8000,\n\t 0x20000000: 0x808002,\n\t 0x30000000: 0x2,\n\t 0x40000000: 0x200,\n\t 0x50000000: 0x808202,\n\t 0x60000000: 0x800202,\n\t 0x70000000: 0x800000,\n\t 0x80000000: 0x202,\n\t 0x90000000: 0x800200,\n\t 0xa0000000: 0x8200,\n\t 0xb0000000: 0x808000,\n\t 0xc0000000: 0x8002,\n\t 0xd0000000: 0x800002,\n\t 0xe0000000: 0x0,\n\t 0xf0000000: 0x8202,\n\t 0x8000000: 0x0,\n\t 0x18000000: 0x808202,\n\t 0x28000000: 0x8202,\n\t 0x38000000: 0x8000,\n\t 0x48000000: 0x808200,\n\t 0x58000000: 0x200,\n\t 0x68000000: 0x808002,\n\t 0x78000000: 0x2,\n\t 0x88000000: 0x800200,\n\t 0x98000000: 0x8200,\n\t 0xa8000000: 0x808000,\n\t 0xb8000000: 0x800202,\n\t 0xc8000000: 0x800002,\n\t 0xd8000000: 0x8002,\n\t 0xe8000000: 0x202,\n\t 0xf8000000: 0x800000,\n\t 0x1: 0x8000,\n\t 0x10000001: 0x2,\n\t 0x20000001: 0x808200,\n\t 0x30000001: 0x800000,\n\t 0x40000001: 0x808002,\n\t 0x50000001: 0x8200,\n\t 0x60000001: 0x200,\n\t 0x70000001: 0x800202,\n\t 0x80000001: 0x808202,\n\t 0x90000001: 0x808000,\n\t 0xa0000001: 0x800002,\n\t 0xb0000001: 0x8202,\n\t 0xc0000001: 0x202,\n\t 0xd0000001: 0x800200,\n\t 0xe0000001: 0x8002,\n\t 0xf0000001: 0x0,\n\t 0x8000001: 0x808202,\n\t 0x18000001: 0x808000,\n\t 0x28000001: 0x800000,\n\t 0x38000001: 0x200,\n\t 0x48000001: 0x8000,\n\t 0x58000001: 0x800002,\n\t 0x68000001: 0x2,\n\t 0x78000001: 0x8202,\n\t 0x88000001: 0x8002,\n\t 0x98000001: 0x800202,\n\t 0xa8000001: 0x202,\n\t 0xb8000001: 0x808200,\n\t 0xc8000001: 0x800200,\n\t 0xd8000001: 0x0,\n\t 0xe8000001: 0x8200,\n\t 0xf8000001: 0x808002\n\t },\n\t {\n\t 0x0: 0x40084010,\n\t 0x1000000: 0x4000,\n\t 0x2000000: 0x80000,\n\t 0x3000000: 0x40080010,\n\t 0x4000000: 0x40000010,\n\t 0x5000000: 0x40084000,\n\t 0x6000000: 0x40004000,\n\t 0x7000000: 0x10,\n\t 0x8000000: 0x84000,\n\t 0x9000000: 0x40004010,\n\t 0xa000000: 0x40000000,\n\t 0xb000000: 0x84010,\n\t 0xc000000: 0x80010,\n\t 0xd000000: 0x0,\n\t 0xe000000: 0x4010,\n\t 0xf000000: 0x40080000,\n\t 0x800000: 0x40004000,\n\t 0x1800000: 0x84010,\n\t 0x2800000: 0x10,\n\t 0x3800000: 0x40004010,\n\t 0x4800000: 0x40084010,\n\t 0x5800000: 0x40000000,\n\t 0x6800000: 0x80000,\n\t 0x7800000: 0x40080010,\n\t 0x8800000: 0x80010,\n\t 0x9800000: 0x0,\n\t 0xa800000: 0x4000,\n\t 0xb800000: 0x40080000,\n\t 0xc800000: 0x40000010,\n\t 0xd800000: 0x84000,\n\t 0xe800000: 0x40084000,\n\t 0xf800000: 0x4010,\n\t 0x10000000: 0x0,\n\t 0x11000000: 0x40080010,\n\t 0x12000000: 0x40004010,\n\t 0x13000000: 0x40084000,\n\t 0x14000000: 0x40080000,\n\t 0x15000000: 0x10,\n\t 0x16000000: 0x84010,\n\t 0x17000000: 0x4000,\n\t 0x18000000: 0x4010,\n\t 0x19000000: 0x80000,\n\t 0x1a000000: 0x80010,\n\t 0x1b000000: 0x40000010,\n\t 0x1c000000: 0x84000,\n\t 0x1d000000: 0x40004000,\n\t 0x1e000000: 0x40000000,\n\t 0x1f000000: 0x40084010,\n\t 0x10800000: 0x84010,\n\t 0x11800000: 0x80000,\n\t 0x12800000: 0x40080000,\n\t 0x13800000: 0x4000,\n\t 0x14800000: 0x40004000,\n\t 0x15800000: 0x40084010,\n\t 0x16800000: 0x10,\n\t 0x17800000: 0x40000000,\n\t 0x18800000: 0x40084000,\n\t 0x19800000: 0x40000010,\n\t 0x1a800000: 0x40004010,\n\t 0x1b800000: 0x80010,\n\t 0x1c800000: 0x0,\n\t 0x1d800000: 0x4010,\n\t 0x1e800000: 0x40080010,\n\t 0x1f800000: 0x84000\n\t },\n\t {\n\t 0x0: 0x104,\n\t 0x100000: 0x0,\n\t 0x200000: 0x4000100,\n\t 0x300000: 0x10104,\n\t 0x400000: 0x10004,\n\t 0x500000: 0x4000004,\n\t 0x600000: 0x4010104,\n\t 0x700000: 0x4010000,\n\t 0x800000: 0x4000000,\n\t 0x900000: 0x4010100,\n\t 0xa00000: 0x10100,\n\t 0xb00000: 0x4010004,\n\t 0xc00000: 0x4000104,\n\t 0xd00000: 0x10000,\n\t 0xe00000: 0x4,\n\t 0xf00000: 0x100,\n\t 0x80000: 0x4010100,\n\t 0x180000: 0x4010004,\n\t 0x280000: 0x0,\n\t 0x380000: 0x4000100,\n\t 0x480000: 0x4000004,\n\t 0x580000: 0x10000,\n\t 0x680000: 0x10004,\n\t 0x780000: 0x104,\n\t 0x880000: 0x4,\n\t 0x980000: 0x100,\n\t 0xa80000: 0x4010000,\n\t 0xb80000: 0x10104,\n\t 0xc80000: 0x10100,\n\t 0xd80000: 0x4000104,\n\t 0xe80000: 0x4010104,\n\t 0xf80000: 0x4000000,\n\t 0x1000000: 0x4010100,\n\t 0x1100000: 0x10004,\n\t 0x1200000: 0x10000,\n\t 0x1300000: 0x4000100,\n\t 0x1400000: 0x100,\n\t 0x1500000: 0x4010104,\n\t 0x1600000: 0x4000004,\n\t 0x1700000: 0x0,\n\t 0x1800000: 0x4000104,\n\t 0x1900000: 0x4000000,\n\t 0x1a00000: 0x4,\n\t 0x1b00000: 0x10100,\n\t 0x1c00000: 0x4010000,\n\t 0x1d00000: 0x104,\n\t 0x1e00000: 0x10104,\n\t 0x1f00000: 0x4010004,\n\t 0x1080000: 0x4000000,\n\t 0x1180000: 0x104,\n\t 0x1280000: 0x4010100,\n\t 0x1380000: 0x0,\n\t 0x1480000: 0x10004,\n\t 0x1580000: 0x4000100,\n\t 0x1680000: 0x100,\n\t 0x1780000: 0x4010004,\n\t 0x1880000: 0x10000,\n\t 0x1980000: 0x4010104,\n\t 0x1a80000: 0x10104,\n\t 0x1b80000: 0x4000004,\n\t 0x1c80000: 0x4000104,\n\t 0x1d80000: 0x4010000,\n\t 0x1e80000: 0x4,\n\t 0x1f80000: 0x10100\n\t },\n\t {\n\t 0x0: 0x80401000,\n\t 0x10000: 0x80001040,\n\t 0x20000: 0x401040,\n\t 0x30000: 0x80400000,\n\t 0x40000: 0x0,\n\t 0x50000: 0x401000,\n\t 0x60000: 0x80000040,\n\t 0x70000: 0x400040,\n\t 0x80000: 0x80000000,\n\t 0x90000: 0x400000,\n\t 0xa0000: 0x40,\n\t 0xb0000: 0x80001000,\n\t 0xc0000: 0x80400040,\n\t 0xd0000: 0x1040,\n\t 0xe0000: 0x1000,\n\t 0xf0000: 0x80401040,\n\t 0x8000: 0x80001040,\n\t 0x18000: 0x40,\n\t 0x28000: 0x80400040,\n\t 0x38000: 0x80001000,\n\t 0x48000: 0x401000,\n\t 0x58000: 0x80401040,\n\t 0x68000: 0x0,\n\t 0x78000: 0x80400000,\n\t 0x88000: 0x1000,\n\t 0x98000: 0x80401000,\n\t 0xa8000: 0x400000,\n\t 0xb8000: 0x1040,\n\t 0xc8000: 0x80000000,\n\t 0xd8000: 0x400040,\n\t 0xe8000: 0x401040,\n\t 0xf8000: 0x80000040,\n\t 0x100000: 0x400040,\n\t 0x110000: 0x401000,\n\t 0x120000: 0x80000040,\n\t 0x130000: 0x0,\n\t 0x140000: 0x1040,\n\t 0x150000: 0x80400040,\n\t 0x160000: 0x80401000,\n\t 0x170000: 0x80001040,\n\t 0x180000: 0x80401040,\n\t 0x190000: 0x80000000,\n\t 0x1a0000: 0x80400000,\n\t 0x1b0000: 0x401040,\n\t 0x1c0000: 0x80001000,\n\t 0x1d0000: 0x400000,\n\t 0x1e0000: 0x40,\n\t 0x1f0000: 0x1000,\n\t 0x108000: 0x80400000,\n\t 0x118000: 0x80401040,\n\t 0x128000: 0x0,\n\t 0x138000: 0x401000,\n\t 0x148000: 0x400040,\n\t 0x158000: 0x80000000,\n\t 0x168000: 0x80001040,\n\t 0x178000: 0x40,\n\t 0x188000: 0x80000040,\n\t 0x198000: 0x1000,\n\t 0x1a8000: 0x80001000,\n\t 0x1b8000: 0x80400040,\n\t 0x1c8000: 0x1040,\n\t 0x1d8000: 0x80401000,\n\t 0x1e8000: 0x400000,\n\t 0x1f8000: 0x401040\n\t },\n\t {\n\t 0x0: 0x80,\n\t 0x1000: 0x1040000,\n\t 0x2000: 0x40000,\n\t 0x3000: 0x20000000,\n\t 0x4000: 0x20040080,\n\t 0x5000: 0x1000080,\n\t 0x6000: 0x21000080,\n\t 0x7000: 0x40080,\n\t 0x8000: 0x1000000,\n\t 0x9000: 0x20040000,\n\t 0xa000: 0x20000080,\n\t 0xb000: 0x21040080,\n\t 0xc000: 0x21040000,\n\t 0xd000: 0x0,\n\t 0xe000: 0x1040080,\n\t 0xf000: 0x21000000,\n\t 0x800: 0x1040080,\n\t 0x1800: 0x21000080,\n\t 0x2800: 0x80,\n\t 0x3800: 0x1040000,\n\t 0x4800: 0x40000,\n\t 0x5800: 0x20040080,\n\t 0x6800: 0x21040000,\n\t 0x7800: 0x20000000,\n\t 0x8800: 0x20040000,\n\t 0x9800: 0x0,\n\t 0xa800: 0x21040080,\n\t 0xb800: 0x1000080,\n\t 0xc800: 0x20000080,\n\t 0xd800: 0x21000000,\n\t 0xe800: 0x1000000,\n\t 0xf800: 0x40080,\n\t 0x10000: 0x40000,\n\t 0x11000: 0x80,\n\t 0x12000: 0x20000000,\n\t 0x13000: 0x21000080,\n\t 0x14000: 0x1000080,\n\t 0x15000: 0x21040000,\n\t 0x16000: 0x20040080,\n\t 0x17000: 0x1000000,\n\t 0x18000: 0x21040080,\n\t 0x19000: 0x21000000,\n\t 0x1a000: 0x1040000,\n\t 0x1b000: 0x20040000,\n\t 0x1c000: 0x40080,\n\t 0x1d000: 0x20000080,\n\t 0x1e000: 0x0,\n\t 0x1f000: 0x1040080,\n\t 0x10800: 0x21000080,\n\t 0x11800: 0x1000000,\n\t 0x12800: 0x1040000,\n\t 0x13800: 0x20040080,\n\t 0x14800: 0x20000000,\n\t 0x15800: 0x1040080,\n\t 0x16800: 0x80,\n\t 0x17800: 0x21040000,\n\t 0x18800: 0x40080,\n\t 0x19800: 0x21040080,\n\t 0x1a800: 0x0,\n\t 0x1b800: 0x21000000,\n\t 0x1c800: 0x1000080,\n\t 0x1d800: 0x40000,\n\t 0x1e800: 0x20040000,\n\t 0x1f800: 0x20000080\n\t },\n\t {\n\t 0x0: 0x10000008,\n\t 0x100: 0x2000,\n\t 0x200: 0x10200000,\n\t 0x300: 0x10202008,\n\t 0x400: 0x10002000,\n\t 0x500: 0x200000,\n\t 0x600: 0x200008,\n\t 0x700: 0x10000000,\n\t 0x800: 0x0,\n\t 0x900: 0x10002008,\n\t 0xa00: 0x202000,\n\t 0xb00: 0x8,\n\t 0xc00: 0x10200008,\n\t 0xd00: 0x202008,\n\t 0xe00: 0x2008,\n\t 0xf00: 0x10202000,\n\t 0x80: 0x10200000,\n\t 0x180: 0x10202008,\n\t 0x280: 0x8,\n\t 0x380: 0x200000,\n\t 0x480: 0x202008,\n\t 0x580: 0x10000008,\n\t 0x680: 0x10002000,\n\t 0x780: 0x2008,\n\t 0x880: 0x200008,\n\t 0x980: 0x2000,\n\t 0xa80: 0x10002008,\n\t 0xb80: 0x10200008,\n\t 0xc80: 0x0,\n\t 0xd80: 0x10202000,\n\t 0xe80: 0x202000,\n\t 0xf80: 0x10000000,\n\t 0x1000: 0x10002000,\n\t 0x1100: 0x10200008,\n\t 0x1200: 0x10202008,\n\t 0x1300: 0x2008,\n\t 0x1400: 0x200000,\n\t 0x1500: 0x10000000,\n\t 0x1600: 0x10000008,\n\t 0x1700: 0x202000,\n\t 0x1800: 0x202008,\n\t 0x1900: 0x0,\n\t 0x1a00: 0x8,\n\t 0x1b00: 0x10200000,\n\t 0x1c00: 0x2000,\n\t 0x1d00: 0x10002008,\n\t 0x1e00: 0x10202000,\n\t 0x1f00: 0x200008,\n\t 0x1080: 0x8,\n\t 0x1180: 0x202000,\n\t 0x1280: 0x200000,\n\t 0x1380: 0x10000008,\n\t 0x1480: 0x10002000,\n\t 0x1580: 0x2008,\n\t 0x1680: 0x10202008,\n\t 0x1780: 0x10200000,\n\t 0x1880: 0x10202000,\n\t 0x1980: 0x10200008,\n\t 0x1a80: 0x2000,\n\t 0x1b80: 0x202008,\n\t 0x1c80: 0x200008,\n\t 0x1d80: 0x0,\n\t 0x1e80: 0x10000000,\n\t 0x1f80: 0x10002008\n\t },\n\t {\n\t 0x0: 0x100000,\n\t 0x10: 0x2000401,\n\t 0x20: 0x400,\n\t 0x30: 0x100401,\n\t 0x40: 0x2100401,\n\t 0x50: 0x0,\n\t 0x60: 0x1,\n\t 0x70: 0x2100001,\n\t 0x80: 0x2000400,\n\t 0x90: 0x100001,\n\t 0xa0: 0x2000001,\n\t 0xb0: 0x2100400,\n\t 0xc0: 0x2100000,\n\t 0xd0: 0x401,\n\t 0xe0: 0x100400,\n\t 0xf0: 0x2000000,\n\t 0x8: 0x2100001,\n\t 0x18: 0x0,\n\t 0x28: 0x2000401,\n\t 0x38: 0x2100400,\n\t 0x48: 0x100000,\n\t 0x58: 0x2000001,\n\t 0x68: 0x2000000,\n\t 0x78: 0x401,\n\t 0x88: 0x100401,\n\t 0x98: 0x2000400,\n\t 0xa8: 0x2100000,\n\t 0xb8: 0x100001,\n\t 0xc8: 0x400,\n\t 0xd8: 0x2100401,\n\t 0xe8: 0x1,\n\t 0xf8: 0x100400,\n\t 0x100: 0x2000000,\n\t 0x110: 0x100000,\n\t 0x120: 0x2000401,\n\t 0x130: 0x2100001,\n\t 0x140: 0x100001,\n\t 0x150: 0x2000400,\n\t 0x160: 0x2100400,\n\t 0x170: 0x100401,\n\t 0x180: 0x401,\n\t 0x190: 0x2100401,\n\t 0x1a0: 0x100400,\n\t 0x1b0: 0x1,\n\t 0x1c0: 0x0,\n\t 0x1d0: 0x2100000,\n\t 0x1e0: 0x2000001,\n\t 0x1f0: 0x400,\n\t 0x108: 0x100400,\n\t 0x118: 0x2000401,\n\t 0x128: 0x2100001,\n\t 0x138: 0x1,\n\t 0x148: 0x2000000,\n\t 0x158: 0x100000,\n\t 0x168: 0x401,\n\t 0x178: 0x2100400,\n\t 0x188: 0x2000001,\n\t 0x198: 0x2100000,\n\t 0x1a8: 0x0,\n\t 0x1b8: 0x2100401,\n\t 0x1c8: 0x100401,\n\t 0x1d8: 0x400,\n\t 0x1e8: 0x2000400,\n\t 0x1f8: 0x100001\n\t },\n\t {\n\t 0x0: 0x8000820,\n\t 0x1: 0x20000,\n\t 0x2: 0x8000000,\n\t 0x3: 0x20,\n\t 0x4: 0x20020,\n\t 0x5: 0x8020820,\n\t 0x6: 0x8020800,\n\t 0x7: 0x800,\n\t 0x8: 0x8020000,\n\t 0x9: 0x8000800,\n\t 0xa: 0x20800,\n\t 0xb: 0x8020020,\n\t 0xc: 0x820,\n\t 0xd: 0x0,\n\t 0xe: 0x8000020,\n\t 0xf: 0x20820,\n\t 0x80000000: 0x800,\n\t 0x80000001: 0x8020820,\n\t 0x80000002: 0x8000820,\n\t 0x80000003: 0x8000000,\n\t 0x80000004: 0x8020000,\n\t 0x80000005: 0x20800,\n\t 0x80000006: 0x20820,\n\t 0x80000007: 0x20,\n\t 0x80000008: 0x8000020,\n\t 0x80000009: 0x820,\n\t 0x8000000a: 0x20020,\n\t 0x8000000b: 0x8020800,\n\t 0x8000000c: 0x0,\n\t 0x8000000d: 0x8020020,\n\t 0x8000000e: 0x8000800,\n\t 0x8000000f: 0x20000,\n\t 0x10: 0x20820,\n\t 0x11: 0x8020800,\n\t 0x12: 0x20,\n\t 0x13: 0x800,\n\t 0x14: 0x8000800,\n\t 0x15: 0x8000020,\n\t 0x16: 0x8020020,\n\t 0x17: 0x20000,\n\t 0x18: 0x0,\n\t 0x19: 0x20020,\n\t 0x1a: 0x8020000,\n\t 0x1b: 0x8000820,\n\t 0x1c: 0x8020820,\n\t 0x1d: 0x20800,\n\t 0x1e: 0x820,\n\t 0x1f: 0x8000000,\n\t 0x80000010: 0x20000,\n\t 0x80000011: 0x800,\n\t 0x80000012: 0x8020020,\n\t 0x80000013: 0x20820,\n\t 0x80000014: 0x20,\n\t 0x80000015: 0x8020000,\n\t 0x80000016: 0x8000000,\n\t 0x80000017: 0x8000820,\n\t 0x80000018: 0x8020820,\n\t 0x80000019: 0x8000020,\n\t 0x8000001a: 0x8000800,\n\t 0x8000001b: 0x0,\n\t 0x8000001c: 0x20800,\n\t 0x8000001d: 0x820,\n\t 0x8000001e: 0x20020,\n\t 0x8000001f: 0x8020800\n\t }\n\t ];\n\n\t // Masks that select the SBOX input\n\t var SBOX_MASK = [\n\t 0xf8000001, 0x1f800000, 0x01f80000, 0x001f8000,\n\t 0x0001f800, 0x00001f80, 0x000001f8, 0x8000001f\n\t ];\n\n\t /**\n\t * DES block cipher algorithm.\n\t */\n\t var DES = C_algo.DES = BlockCipher.extend({\n\t _doReset: function () {\n\t // Shortcuts\n\t var key = this._key;\n\t var keyWords = key.words;\n\n\t // Select 56 bits according to PC1\n\t var keyBits = [];\n\t for (var i = 0; i < 56; i++) {\n\t var keyBitPos = PC1[i] - 1;\n\t keyBits[i] = (keyWords[keyBitPos >>> 5] >>> (31 - keyBitPos % 32)) & 1;\n\t }\n\n\t // Assemble 16 subkeys\n\t var subKeys = this._subKeys = [];\n\t for (var nSubKey = 0; nSubKey < 16; nSubKey++) {\n\t // Create subkey\n\t var subKey = subKeys[nSubKey] = [];\n\n\t // Shortcut\n\t var bitShift = BIT_SHIFTS[nSubKey];\n\n\t // Select 48 bits according to PC2\n\t for (var i = 0; i < 24; i++) {\n\t // Select from the left 28 key bits\n\t subKey[(i / 6) | 0] |= keyBits[((PC2[i] - 1) + bitShift) % 28] << (31 - i % 6);\n\n\t // Select from the right 28 key bits\n\t subKey[4 + ((i / 6) | 0)] |= keyBits[28 + (((PC2[i + 24] - 1) + bitShift) % 28)] << (31 - i % 6);\n\t }\n\n\t // Since each subkey is applied to an expanded 32-bit input,\n\t // the subkey can be broken into 8 values scaled to 32-bits,\n\t // which allows the key to be used without expansion\n\t subKey[0] = (subKey[0] << 1) | (subKey[0] >>> 31);\n\t for (var i = 1; i < 7; i++) {\n\t subKey[i] = subKey[i] >>> ((i - 1) * 4 + 3);\n\t }\n\t subKey[7] = (subKey[7] << 5) | (subKey[7] >>> 27);\n\t }\n\n\t // Compute inverse subkeys\n\t var invSubKeys = this._invSubKeys = [];\n\t for (var i = 0; i < 16; i++) {\n\t invSubKeys[i] = subKeys[15 - i];\n\t }\n\t },\n\n\t encryptBlock: function (M, offset) {\n\t this._doCryptBlock(M, offset, this._subKeys);\n\t },\n\n\t decryptBlock: function (M, offset) {\n\t this._doCryptBlock(M, offset, this._invSubKeys);\n\t },\n\n\t _doCryptBlock: function (M, offset, subKeys) {\n\t // Get input\n\t this._lBlock = M[offset];\n\t this._rBlock = M[offset + 1];\n\n\t // Initial permutation\n\t exchangeLR.call(this, 4, 0x0f0f0f0f);\n\t exchangeLR.call(this, 16, 0x0000ffff);\n\t exchangeRL.call(this, 2, 0x33333333);\n\t exchangeRL.call(this, 8, 0x00ff00ff);\n\t exchangeLR.call(this, 1, 0x55555555);\n\n\t // Rounds\n\t for (var round = 0; round < 16; round++) {\n\t // Shortcuts\n\t var subKey = subKeys[round];\n\t var lBlock = this._lBlock;\n\t var rBlock = this._rBlock;\n\n\t // Feistel function\n\t var f = 0;\n\t for (var i = 0; i < 8; i++) {\n\t f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0];\n\t }\n\t this._lBlock = rBlock;\n\t this._rBlock = lBlock ^ f;\n\t }\n\n\t // Undo swap from last round\n\t var t = this._lBlock;\n\t this._lBlock = this._rBlock;\n\t this._rBlock = t;\n\n\t // Final permutation\n\t exchangeLR.call(this, 1, 0x55555555);\n\t exchangeRL.call(this, 8, 0x00ff00ff);\n\t exchangeRL.call(this, 2, 0x33333333);\n\t exchangeLR.call(this, 16, 0x0000ffff);\n\t exchangeLR.call(this, 4, 0x0f0f0f0f);\n\n\t // Set output\n\t M[offset] = this._lBlock;\n\t M[offset + 1] = this._rBlock;\n\t },\n\n\t keySize: 64/32,\n\n\t ivSize: 64/32,\n\n\t blockSize: 64/32\n\t });\n\n\t // Swap bits across the left and right words\n\t function exchangeLR(offset, mask) {\n\t var t = ((this._lBlock >>> offset) ^ this._rBlock) & mask;\n\t this._rBlock ^= t;\n\t this._lBlock ^= t << offset;\n\t }\n\n\t function exchangeRL(offset, mask) {\n\t var t = ((this._rBlock >>> offset) ^ this._lBlock) & mask;\n\t this._lBlock ^= t;\n\t this._rBlock ^= t << offset;\n\t }\n\n\t /**\n\t * Shortcut functions to the cipher's object interface.\n\t *\n\t * @example\n\t *\n\t * var ciphertext = CryptoJS.DES.encrypt(message, key, cfg);\n\t * var plaintext = CryptoJS.DES.decrypt(ciphertext, key, cfg);\n\t */\n\t C.DES = BlockCipher._createHelper(DES);\n\n\t /**\n\t * Triple-DES block cipher algorithm.\n\t */\n\t var TripleDES = C_algo.TripleDES = BlockCipher.extend({\n\t _doReset: function () {\n\t // Shortcuts\n\t var key = this._key;\n\t var keyWords = key.words;\n\t // Make sure the key length is valid (64, 128 or >= 192 bit)\n\t if (keyWords.length !== 2 && keyWords.length !== 4 && keyWords.length < 6) {\n\t throw new Error('Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.');\n\t }\n\n\t // Extend the key according to the keying options defined in 3DES standard\n\t var key1 = keyWords.slice(0, 2);\n\t var key2 = keyWords.length < 4 ? keyWords.slice(0, 2) : keyWords.slice(2, 4);\n\t var key3 = keyWords.length < 6 ? keyWords.slice(0, 2) : keyWords.slice(4, 6);\n\n\t // Create DES instances\n\t this._des1 = DES.createEncryptor(WordArray.create(key1));\n\t this._des2 = DES.createEncryptor(WordArray.create(key2));\n\t this._des3 = DES.createEncryptor(WordArray.create(key3));\n\t },\n\n\t encryptBlock: function (M, offset) {\n\t this._des1.encryptBlock(M, offset);\n\t this._des2.decryptBlock(M, offset);\n\t this._des3.encryptBlock(M, offset);\n\t },\n\n\t decryptBlock: function (M, offset) {\n\t this._des3.decryptBlock(M, offset);\n\t this._des2.encryptBlock(M, offset);\n\t this._des1.decryptBlock(M, offset);\n\t },\n\n\t keySize: 192/32,\n\n\t ivSize: 64/32,\n\n\t blockSize: 64/32\n\t });\n\n\t /**\n\t * Shortcut functions to the cipher's object interface.\n\t *\n\t * @example\n\t *\n\t * var ciphertext = CryptoJS.TripleDES.encrypt(message, key, cfg);\n\t * var plaintext = CryptoJS.TripleDES.decrypt(ciphertext, key, cfg);\n\t */\n\t C.TripleDES = BlockCipher._createHelper(TripleDES);\n\t}());\n\n\n\treturn CryptoJS.TripleDES;\n\n}));", ";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./enc-base64\"), require(\"./md5\"), require(\"./evpkdf\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./enc-base64\", \"./md5\", \"./evpkdf\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var StreamCipher = C_lib.StreamCipher;\n\t var C_algo = C.algo;\n\n\t /**\n\t * RC4 stream cipher algorithm.\n\t */\n\t var RC4 = C_algo.RC4 = StreamCipher.extend({\n\t _doReset: function () {\n\t // Shortcuts\n\t var key = this._key;\n\t var keyWords = key.words;\n\t var keySigBytes = key.sigBytes;\n\n\t // Init sbox\n\t var S = this._S = [];\n\t for (var i = 0; i < 256; i++) {\n\t S[i] = i;\n\t }\n\n\t // Key setup\n\t for (var i = 0, j = 0; i < 256; i++) {\n\t var keyByteIndex = i % keySigBytes;\n\t var keyByte = (keyWords[keyByteIndex >>> 2] >>> (24 - (keyByteIndex % 4) * 8)) & 0xff;\n\n\t j = (j + S[i] + keyByte) % 256;\n\n\t // Swap\n\t var t = S[i];\n\t S[i] = S[j];\n\t S[j] = t;\n\t }\n\n\t // Counters\n\t this._i = this._j = 0;\n\t },\n\n\t _doProcessBlock: function (M, offset) {\n\t M[offset] ^= generateKeystreamWord.call(this);\n\t },\n\n\t keySize: 256/32,\n\n\t ivSize: 0\n\t });\n\n\t function generateKeystreamWord() {\n\t // Shortcuts\n\t var S = this._S;\n\t var i = this._i;\n\t var j = this._j;\n\n\t // Generate keystream word\n\t var keystreamWord = 0;\n\t for (var n = 0; n < 4; n++) {\n\t i = (i + 1) % 256;\n\t j = (j + S[i]) % 256;\n\n\t // Swap\n\t var t = S[i];\n\t S[i] = S[j];\n\t S[j] = t;\n\n\t keystreamWord |= S[(S[i] + S[j]) % 256] << (24 - n * 8);\n\t }\n\n\t // Update counters\n\t this._i = i;\n\t this._j = j;\n\n\t return keystreamWord;\n\t }\n\n\t /**\n\t * Shortcut functions to the cipher's object interface.\n\t *\n\t * @example\n\t *\n\t * var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg);\n\t * var plaintext = CryptoJS.RC4.decrypt(ciphertext, key, cfg);\n\t */\n\t C.RC4 = StreamCipher._createHelper(RC4);\n\n\t /**\n\t * Modified RC4 stream cipher algorithm.\n\t */\n\t var RC4Drop = C_algo.RC4Drop = RC4.extend({\n\t /**\n\t * Configuration options.\n\t *\n\t * @property {number} drop The number of keystream words to drop. Default 192\n\t */\n\t cfg: RC4.cfg.extend({\n\t drop: 192\n\t }),\n\n\t _doReset: function () {\n\t RC4._doReset.call(this);\n\n\t // Drop\n\t for (var i = this.cfg.drop; i > 0; i--) {\n\t generateKeystreamWord.call(this);\n\t }\n\t }\n\t });\n\n\t /**\n\t * Shortcut functions to the cipher's object interface.\n\t *\n\t * @example\n\t *\n\t * var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg);\n\t * var plaintext = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg);\n\t */\n\t C.RC4Drop = StreamCipher._createHelper(RC4Drop);\n\t}());\n\n\n\treturn CryptoJS.RC4;\n\n}));", ";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./enc-base64\"), require(\"./md5\"), require(\"./evpkdf\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./enc-base64\", \"./md5\", \"./evpkdf\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var StreamCipher = C_lib.StreamCipher;\n\t var C_algo = C.algo;\n\n\t // Reusable objects\n\t var S = [];\n\t var C_ = [];\n\t var G = [];\n\n\t /**\n\t * Rabbit stream cipher algorithm\n\t */\n\t var Rabbit = C_algo.Rabbit = StreamCipher.extend({\n\t _doReset: function () {\n\t // Shortcuts\n\t var K = this._key.words;\n\t var iv = this.cfg.iv;\n\n\t // Swap endian\n\t for (var i = 0; i < 4; i++) {\n\t K[i] = (((K[i] << 8) | (K[i] >>> 24)) & 0x00ff00ff) |\n\t (((K[i] << 24) | (K[i] >>> 8)) & 0xff00ff00);\n\t }\n\n\t // Generate initial state values\n\t var X = this._X = [\n\t K[0], (K[3] << 16) | (K[2] >>> 16),\n\t K[1], (K[0] << 16) | (K[3] >>> 16),\n\t K[2], (K[1] << 16) | (K[0] >>> 16),\n\t K[3], (K[2] << 16) | (K[1] >>> 16)\n\t ];\n\n\t // Generate initial counter values\n\t var C = this._C = [\n\t (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff),\n\t (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff),\n\t (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff),\n\t (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff)\n\t ];\n\n\t // Carry bit\n\t this._b = 0;\n\n\t // Iterate the system four times\n\t for (var i = 0; i < 4; i++) {\n\t nextState.call(this);\n\t }\n\n\t // Modify the counters\n\t for (var i = 0; i < 8; i++) {\n\t C[i] ^= X[(i + 4) & 7];\n\t }\n\n\t // IV setup\n\t if (iv) {\n\t // Shortcuts\n\t var IV = iv.words;\n\t var IV_0 = IV[0];\n\t var IV_1 = IV[1];\n\n\t // Generate four subvectors\n\t var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00);\n\t var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00);\n\t var i1 = (i0 >>> 16) | (i2 & 0xffff0000);\n\t var i3 = (i2 << 16) | (i0 & 0x0000ffff);\n\n\t // Modify counter values\n\t C[0] ^= i0;\n\t C[1] ^= i1;\n\t C[2] ^= i2;\n\t C[3] ^= i3;\n\t C[4] ^= i0;\n\t C[5] ^= i1;\n\t C[6] ^= i2;\n\t C[7] ^= i3;\n\n\t // Iterate the system four times\n\t for (var i = 0; i < 4; i++) {\n\t nextState.call(this);\n\t }\n\t }\n\t },\n\n\t _doProcessBlock: function (M, offset) {\n\t // Shortcut\n\t var X = this._X;\n\n\t // Iterate the system\n\t nextState.call(this);\n\n\t // Generate four keystream words\n\t S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16);\n\t S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16);\n\t S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16);\n\t S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16);\n\n\t for (var i = 0; i < 4; i++) {\n\t // Swap endian\n\t S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) |\n\t (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00);\n\n\t // Encrypt\n\t M[offset + i] ^= S[i];\n\t }\n\t },\n\n\t blockSize: 128/32,\n\n\t ivSize: 64/32\n\t });\n\n\t function nextState() {\n\t // Shortcuts\n\t var X = this._X;\n\t var C = this._C;\n\n\t // Save old counter values\n\t for (var i = 0; i < 8; i++) {\n\t C_[i] = C[i];\n\t }\n\n\t // Calculate new counter values\n\t C[0] = (C[0] + 0x4d34d34d + this._b) | 0;\n\t C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0;\n\t C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0;\n\t C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0;\n\t C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0;\n\t C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0;\n\t C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0;\n\t C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0;\n\t this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0;\n\n\t // Calculate the g-values\n\t for (var i = 0; i < 8; i++) {\n\t var gx = X[i] + C[i];\n\n\t // Construct high and low argument for squaring\n\t var ga = gx & 0xffff;\n\t var gb = gx >>> 16;\n\n\t // Calculate high and low result of squaring\n\t var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb;\n\t var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0);\n\n\t // High XOR low\n\t G[i] = gh ^ gl;\n\t }\n\n\t // Calculate new state values\n\t X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0;\n\t X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0;\n\t X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0;\n\t X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0;\n\t X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0;\n\t X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0;\n\t X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0;\n\t X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0;\n\t }\n\n\t /**\n\t * Shortcut functions to the cipher's object interface.\n\t *\n\t * @example\n\t *\n\t * var ciphertext = CryptoJS.Rabbit.encrypt(message, key, cfg);\n\t * var plaintext = CryptoJS.Rabbit.decrypt(ciphertext, key, cfg);\n\t */\n\t C.Rabbit = StreamCipher._createHelper(Rabbit);\n\t}());\n\n\n\treturn CryptoJS.Rabbit;\n\n}));", ";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./enc-base64\"), require(\"./md5\"), require(\"./evpkdf\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./enc-base64\", \"./md5\", \"./evpkdf\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var StreamCipher = C_lib.StreamCipher;\n\t var C_algo = C.algo;\n\n\t // Reusable objects\n\t var S = [];\n\t var C_ = [];\n\t var G = [];\n\n\t /**\n\t * Rabbit stream cipher algorithm.\n\t *\n\t * This is a legacy version that neglected to convert the key to little-endian.\n\t * This error doesn't affect the cipher's security,\n\t * but it does affect its compatibility with other implementations.\n\t */\n\t var RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({\n\t _doReset: function () {\n\t // Shortcuts\n\t var K = this._key.words;\n\t var iv = this.cfg.iv;\n\n\t // Generate initial state values\n\t var X = this._X = [\n\t K[0], (K[3] << 16) | (K[2] >>> 16),\n\t K[1], (K[0] << 16) | (K[3] >>> 16),\n\t K[2], (K[1] << 16) | (K[0] >>> 16),\n\t K[3], (K[2] << 16) | (K[1] >>> 16)\n\t ];\n\n\t // Generate initial counter values\n\t var C = this._C = [\n\t (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff),\n\t (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff),\n\t (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff),\n\t (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff)\n\t ];\n\n\t // Carry bit\n\t this._b = 0;\n\n\t // Iterate the system four times\n\t for (var i = 0; i < 4; i++) {\n\t nextState.call(this);\n\t }\n\n\t // Modify the counters\n\t for (var i = 0; i < 8; i++) {\n\t C[i] ^= X[(i + 4) & 7];\n\t }\n\n\t // IV setup\n\t if (iv) {\n\t // Shortcuts\n\t var IV = iv.words;\n\t var IV_0 = IV[0];\n\t var IV_1 = IV[1];\n\n\t // Generate four subvectors\n\t var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00);\n\t var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00);\n\t var i1 = (i0 >>> 16) | (i2 & 0xffff0000);\n\t var i3 = (i2 << 16) | (i0 & 0x0000ffff);\n\n\t // Modify counter values\n\t C[0] ^= i0;\n\t C[1] ^= i1;\n\t C[2] ^= i2;\n\t C[3] ^= i3;\n\t C[4] ^= i0;\n\t C[5] ^= i1;\n\t C[6] ^= i2;\n\t C[7] ^= i3;\n\n\t // Iterate the system four times\n\t for (var i = 0; i < 4; i++) {\n\t nextState.call(this);\n\t }\n\t }\n\t },\n\n\t _doProcessBlock: function (M, offset) {\n\t // Shortcut\n\t var X = this._X;\n\n\t // Iterate the system\n\t nextState.call(this);\n\n\t // Generate four keystream words\n\t S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16);\n\t S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16);\n\t S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16);\n\t S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16);\n\n\t for (var i = 0; i < 4; i++) {\n\t // Swap endian\n\t S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) |\n\t (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00);\n\n\t // Encrypt\n\t M[offset + i] ^= S[i];\n\t }\n\t },\n\n\t blockSize: 128/32,\n\n\t ivSize: 64/32\n\t });\n\n\t function nextState() {\n\t // Shortcuts\n\t var X = this._X;\n\t var C = this._C;\n\n\t // Save old counter values\n\t for (var i = 0; i < 8; i++) {\n\t C_[i] = C[i];\n\t }\n\n\t // Calculate new counter values\n\t C[0] = (C[0] + 0x4d34d34d + this._b) | 0;\n\t C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0;\n\t C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0;\n\t C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0;\n\t C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0;\n\t C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0;\n\t C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0;\n\t C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0;\n\t this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0;\n\n\t // Calculate the g-values\n\t for (var i = 0; i < 8; i++) {\n\t var gx = X[i] + C[i];\n\n\t // Construct high and low argument for squaring\n\t var ga = gx & 0xffff;\n\t var gb = gx >>> 16;\n\n\t // Calculate high and low result of squaring\n\t var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb;\n\t var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0);\n\n\t // High XOR low\n\t G[i] = gh ^ gl;\n\t }\n\n\t // Calculate new state values\n\t X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0;\n\t X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0;\n\t X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0;\n\t X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0;\n\t X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0;\n\t X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0;\n\t X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0;\n\t X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0;\n\t }\n\n\t /**\n\t * Shortcut functions to the cipher's object interface.\n\t *\n\t * @example\n\t *\n\t * var ciphertext = CryptoJS.RabbitLegacy.encrypt(message, key, cfg);\n\t * var plaintext = CryptoJS.RabbitLegacy.decrypt(ciphertext, key, cfg);\n\t */\n\t C.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy);\n\t}());\n\n\n\treturn CryptoJS.RabbitLegacy;\n\n}));", ";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./enc-base64\"), require(\"./md5\"), require(\"./evpkdf\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./enc-base64\", \"./md5\", \"./evpkdf\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var BlockCipher = C_lib.BlockCipher;\n\t var C_algo = C.algo;\n\n\t const N = 16;\n\n\t //Origin pbox and sbox, derived from PI\n\t const ORIG_P = [\n\t 0x243F6A88, 0x85A308D3, 0x13198A2E, 0x03707344,\n\t 0xA4093822, 0x299F31D0, 0x082EFA98, 0xEC4E6C89,\n\t 0x452821E6, 0x38D01377, 0xBE5466CF, 0x34E90C6C,\n\t 0xC0AC29B7, 0xC97C50DD, 0x3F84D5B5, 0xB5470917,\n\t 0x9216D5D9, 0x8979FB1B\n\t ];\n\n\t const ORIG_S = [\n\t [ 0xD1310BA6, 0x98DFB5AC, 0x2FFD72DB, 0xD01ADFB7,\n\t 0xB8E1AFED, 0x6A267E96, 0xBA7C9045, 0xF12C7F99,\n\t 0x24A19947, 0xB3916CF7, 0x0801F2E2, 0x858EFC16,\n\t 0x636920D8, 0x71574E69, 0xA458FEA3, 0xF4933D7E,\n\t 0x0D95748F, 0x728EB658, 0x718BCD58, 0x82154AEE,\n\t 0x7B54A41D, 0xC25A59B5, 0x9C30D539, 0x2AF26013,\n\t 0xC5D1B023, 0x286085F0, 0xCA417918, 0xB8DB38EF,\n\t 0x8E79DCB0, 0x603A180E, 0x6C9E0E8B, 0xB01E8A3E,\n\t 0xD71577C1, 0xBD314B27, 0x78AF2FDA, 0x55605C60,\n\t 0xE65525F3, 0xAA55AB94, 0x57489862, 0x63E81440,\n\t 0x55CA396A, 0x2AAB10B6, 0xB4CC5C34, 0x1141E8CE,\n\t 0xA15486AF, 0x7C72E993, 0xB3EE1411, 0x636FBC2A,\n\t 0x2BA9C55D, 0x741831F6, 0xCE5C3E16, 0x9B87931E,\n\t 0xAFD6BA33, 0x6C24CF5C, 0x7A325381, 0x28958677,\n\t 0x3B8F4898, 0x6B4BB9AF, 0xC4BFE81B, 0x66282193,\n\t 0x61D809CC, 0xFB21A991, 0x487CAC60, 0x5DEC8032,\n\t 0xEF845D5D, 0xE98575B1, 0xDC262302, 0xEB651B88,\n\t 0x23893E81, 0xD396ACC5, 0x0F6D6FF3, 0x83F44239,\n\t 0x2E0B4482, 0xA4842004, 0x69C8F04A, 0x9E1F9B5E,\n\t 0x21C66842, 0xF6E96C9A, 0x670C9C61, 0xABD388F0,\n\t 0x6A51A0D2, 0xD8542F68, 0x960FA728, 0xAB5133A3,\n\t 0x6EEF0B6C, 0x137A3BE4, 0xBA3BF050, 0x7EFB2A98,\n\t 0xA1F1651D, 0x39AF0176, 0x66CA593E, 0x82430E88,\n\t 0x8CEE8619, 0x456F9FB4, 0x7D84A5C3, 0x3B8B5EBE,\n\t 0xE06F75D8, 0x85C12073, 0x401A449F, 0x56C16AA6,\n\t 0x4ED3AA62, 0x363F7706, 0x1BFEDF72, 0x429B023D,\n\t 0x37D0D724, 0xD00A1248, 0xDB0FEAD3, 0x49F1C09B,\n\t 0x075372C9, 0x80991B7B, 0x25D479D8, 0xF6E8DEF7,\n\t 0xE3FE501A, 0xB6794C3B, 0x976CE0BD, 0x04C006BA,\n\t 0xC1A94FB6, 0x409F60C4, 0x5E5C9EC2, 0x196A2463,\n\t 0x68FB6FAF, 0x3E6C53B5, 0x1339B2EB, 0x3B52EC6F,\n\t 0x6DFC511F, 0x9B30952C, 0xCC814544, 0xAF5EBD09,\n\t 0xBEE3D004, 0xDE334AFD, 0x660F2807, 0x192E4BB3,\n\t 0xC0CBA857, 0x45C8740F, 0xD20B5F39, 0xB9D3FBDB,\n\t 0x5579C0BD, 0x1A60320A, 0xD6A100C6, 0x402C7279,\n\t 0x679F25FE, 0xFB1FA3CC, 0x8EA5E9F8, 0xDB3222F8,\n\t 0x3C7516DF, 0xFD616B15, 0x2F501EC8, 0xAD0552AB,\n\t 0x323DB5FA, 0xFD238760, 0x53317B48, 0x3E00DF82,\n\t 0x9E5C57BB, 0xCA6F8CA0, 0x1A87562E, 0xDF1769DB,\n\t 0xD542A8F6, 0x287EFFC3, 0xAC6732C6, 0x8C4F5573,\n\t 0x695B27B0, 0xBBCA58C8, 0xE1FFA35D, 0xB8F011A0,\n\t 0x10FA3D98, 0xFD2183B8, 0x4AFCB56C, 0x2DD1D35B,\n\t 0x9A53E479, 0xB6F84565, 0xD28E49BC, 0x4BFB9790,\n\t 0xE1DDF2DA, 0xA4CB7E33, 0x62FB1341, 0xCEE4C6E8,\n\t 0xEF20CADA, 0x36774C01, 0xD07E9EFE, 0x2BF11FB4,\n\t 0x95DBDA4D, 0xAE909198, 0xEAAD8E71, 0x6B93D5A0,\n\t 0xD08ED1D0, 0xAFC725E0, 0x8E3C5B2F, 0x8E7594B7,\n\t 0x8FF6E2FB, 0xF2122B64, 0x8888B812, 0x900DF01C,\n\t 0x4FAD5EA0, 0x688FC31C, 0xD1CFF191, 0xB3A8C1AD,\n\t 0x2F2F2218, 0xBE0E1777, 0xEA752DFE, 0x8B021FA1,\n\t 0xE5A0CC0F, 0xB56F74E8, 0x18ACF3D6, 0xCE89E299,\n\t 0xB4A84FE0, 0xFD13E0B7, 0x7CC43B81, 0xD2ADA8D9,\n\t 0x165FA266, 0x80957705, 0x93CC7314, 0x211A1477,\n\t 0xE6AD2065, 0x77B5FA86, 0xC75442F5, 0xFB9D35CF,\n\t 0xEBCDAF0C, 0x7B3E89A0, 0xD6411BD3, 0xAE1E7E49,\n\t 0x00250E2D, 0x2071B35E, 0x226800BB, 0x57B8E0AF,\n\t 0x2464369B, 0xF009B91E, 0x5563911D, 0x59DFA6AA,\n\t 0x78C14389, 0xD95A537F, 0x207D5BA2, 0x02E5B9C5,\n\t 0x83260376, 0x6295CFA9, 0x11C81968, 0x4E734A41,\n\t 0xB3472DCA, 0x7B14A94A, 0x1B510052, 0x9A532915,\n\t 0xD60F573F, 0xBC9BC6E4, 0x2B60A476, 0x81E67400,\n\t 0x08BA6FB5, 0x571BE91F, 0xF296EC6B, 0x2A0DD915,\n\t 0xB6636521, 0xE7B9F9B6, 0xFF34052E, 0xC5855664,\n\t 0x53B02D5D, 0xA99F8FA1, 0x08BA4799, 0x6E85076A ],\n\t [ 0x4B7A70E9, 0xB5B32944, 0xDB75092E, 0xC4192623,\n\t 0xAD6EA6B0, 0x49A7DF7D, 0x9CEE60B8, 0x8FEDB266,\n\t 0xECAA8C71, 0x699A17FF, 0x5664526C, 0xC2B19EE1,\n\t 0x193602A5, 0x75094C29, 0xA0591340, 0xE4183A3E,\n\t 0x3F54989A, 0x5B429D65, 0x6B8FE4D6, 0x99F73FD6,\n\t 0xA1D29C07, 0xEFE830F5, 0x4D2D38E6, 0xF0255DC1,\n\t 0x4CDD2086, 0x8470EB26, 0x6382E9C6, 0x021ECC5E,\n\t 0x09686B3F, 0x3EBAEFC9, 0x3C971814, 0x6B6A70A1,\n\t 0x687F3584, 0x52A0E286, 0xB79C5305, 0xAA500737,\n\t 0x3E07841C, 0x7FDEAE5C, 0x8E7D44EC, 0x5716F2B8,\n\t 0xB03ADA37, 0xF0500C0D, 0xF01C1F04, 0x0200B3FF,\n\t 0xAE0CF51A, 0x3CB574B2, 0x25837A58, 0xDC0921BD,\n\t 0xD19113F9, 0x7CA92FF6, 0x94324773, 0x22F54701,\n\t 0x3AE5E581, 0x37C2DADC, 0xC8B57634, 0x9AF3DDA7,\n\t 0xA9446146, 0x0FD0030E, 0xECC8C73E, 0xA4751E41,\n\t 0xE238CD99, 0x3BEA0E2F, 0x3280BBA1, 0x183EB331,\n\t 0x4E548B38, 0x4F6DB908, 0x6F420D03, 0xF60A04BF,\n\t 0x2CB81290, 0x24977C79, 0x5679B072, 0xBCAF89AF,\n\t 0xDE9A771F, 0xD9930810, 0xB38BAE12, 0xDCCF3F2E,\n\t 0x5512721F, 0x2E6B7124, 0x501ADDE6, 0x9F84CD87,\n\t 0x7A584718, 0x7408DA17, 0xBC9F9ABC, 0xE94B7D8C,\n\t 0xEC7AEC3A, 0xDB851DFA, 0x63094366, 0xC464C3D2,\n\t 0xEF1C1847, 0x3215D908, 0xDD433B37, 0x24C2BA16,\n\t 0x12A14D43, 0x2A65C451, 0x50940002, 0x133AE4DD,\n\t 0x71DFF89E, 0x10314E55, 0x81AC77D6, 0x5F11199B,\n\t 0x043556F1, 0xD7A3C76B, 0x3C11183B, 0x5924A509,\n\t 0xF28FE6ED, 0x97F1FBFA, 0x9EBABF2C, 0x1E153C6E,\n\t 0x86E34570, 0xEAE96FB1, 0x860E5E0A, 0x5A3E2AB3,\n\t 0x771FE71C, 0x4E3D06FA, 0x2965DCB9, 0x99E71D0F,\n\t 0x803E89D6, 0x5266C825, 0x2E4CC978, 0x9C10B36A,\n\t 0xC6150EBA, 0x94E2EA78, 0xA5FC3C53, 0x1E0A2DF4,\n\t 0xF2F74EA7, 0x361D2B3D, 0x1939260F, 0x19C27960,\n\t 0x5223A708, 0xF71312B6, 0xEBADFE6E, 0xEAC31F66,\n\t 0xE3BC4595, 0xA67BC883, 0xB17F37D1, 0x018CFF28,\n\t 0xC332DDEF, 0xBE6C5AA5, 0x65582185, 0x68AB9802,\n\t 0xEECEA50F, 0xDB2F953B, 0x2AEF7DAD, 0x5B6E2F84,\n\t 0x1521B628, 0x29076170, 0xECDD4775, 0x619F1510,\n\t 0x13CCA830, 0xEB61BD96, 0x0334FE1E, 0xAA0363CF,\n\t 0xB5735C90, 0x4C70A239, 0xD59E9E0B, 0xCBAADE14,\n\t 0xEECC86BC, 0x60622CA7, 0x9CAB5CAB, 0xB2F3846E,\n\t 0x648B1EAF, 0x19BDF0CA, 0xA02369B9, 0x655ABB50,\n\t 0x40685A32, 0x3C2AB4B3, 0x319EE9D5, 0xC021B8F7,\n\t 0x9B540B19, 0x875FA099, 0x95F7997E, 0x623D7DA8,\n\t 0xF837889A, 0x97E32D77, 0x11ED935F, 0x16681281,\n\t 0x0E358829, 0xC7E61FD6, 0x96DEDFA1, 0x7858BA99,\n\t 0x57F584A5, 0x1B227263, 0x9B83C3FF, 0x1AC24696,\n\t 0xCDB30AEB, 0x532E3054, 0x8FD948E4, 0x6DBC3128,\n\t 0x58EBF2EF, 0x34C6FFEA, 0xFE28ED61, 0xEE7C3C73,\n\t 0x5D4A14D9, 0xE864B7E3, 0x42105D14, 0x203E13E0,\n\t 0x45EEE2B6, 0xA3AAABEA, 0xDB6C4F15, 0xFACB4FD0,\n\t 0xC742F442, 0xEF6ABBB5, 0x654F3B1D, 0x41CD2105,\n\t 0xD81E799E, 0x86854DC7, 0xE44B476A, 0x3D816250,\n\t 0xCF62A1F2, 0x5B8D2646, 0xFC8883A0, 0xC1C7B6A3,\n\t 0x7F1524C3, 0x69CB7492, 0x47848A0B, 0x5692B285,\n\t 0x095BBF00, 0xAD19489D, 0x1462B174, 0x23820E00,\n\t 0x58428D2A, 0x0C55F5EA, 0x1DADF43E, 0x233F7061,\n\t 0x3372F092, 0x8D937E41, 0xD65FECF1, 0x6C223BDB,\n\t 0x7CDE3759, 0xCBEE7460, 0x4085F2A7, 0xCE77326E,\n\t 0xA6078084, 0x19F8509E, 0xE8EFD855, 0x61D99735,\n\t 0xA969A7AA, 0xC50C06C2, 0x5A04ABFC, 0x800BCADC,\n\t 0x9E447A2E, 0xC3453484, 0xFDD56705, 0x0E1E9EC9,\n\t 0xDB73DBD3, 0x105588CD, 0x675FDA79, 0xE3674340,\n\t 0xC5C43465, 0x713E38D8, 0x3D28F89E, 0xF16DFF20,\n\t 0x153E21E7, 0x8FB03D4A, 0xE6E39F2B, 0xDB83ADF7 ],\n\t [ 0xE93D5A68, 0x948140F7, 0xF64C261C, 0x94692934,\n\t 0x411520F7, 0x7602D4F7, 0xBCF46B2E, 0xD4A20068,\n\t 0xD4082471, 0x3320F46A, 0x43B7D4B7, 0x500061AF,\n\t 0x1E39F62E, 0x97244546, 0x14214F74, 0xBF8B8840,\n\t 0x4D95FC1D, 0x96B591AF, 0x70F4DDD3, 0x66A02F45,\n\t 0xBFBC09EC, 0x03BD9785, 0x7FAC6DD0, 0x31CB8504,\n\t 0x96EB27B3, 0x55FD3941, 0xDA2547E6, 0xABCA0A9A,\n\t 0x28507825, 0x530429F4, 0x0A2C86DA, 0xE9B66DFB,\n\t 0x68DC1462, 0xD7486900, 0x680EC0A4, 0x27A18DEE,\n\t 0x4F3FFEA2, 0xE887AD8C, 0xB58CE006, 0x7AF4D6B6,\n\t 0xAACE1E7C, 0xD3375FEC, 0xCE78A399, 0x406B2A42,\n\t 0x20FE9E35, 0xD9F385B9, 0xEE39D7AB, 0x3B124E8B,\n\t 0x1DC9FAF7, 0x4B6D1856, 0x26A36631, 0xEAE397B2,\n\t 0x3A6EFA74, 0xDD5B4332, 0x6841E7F7, 0xCA7820FB,\n\t 0xFB0AF54E, 0xD8FEB397, 0x454056AC, 0xBA489527,\n\t 0x55533A3A, 0x20838D87, 0xFE6BA9B7, 0xD096954B,\n\t 0x55A867BC, 0xA1159A58, 0xCCA92963, 0x99E1DB33,\n\t 0xA62A4A56, 0x3F3125F9, 0x5EF47E1C, 0x9029317C,\n\t 0xFDF8E802, 0x04272F70, 0x80BB155C, 0x05282CE3,\n\t 0x95C11548, 0xE4C66D22, 0x48C1133F, 0xC70F86DC,\n\t 0x07F9C9EE, 0x41041F0F, 0x404779A4, 0x5D886E17,\n\t 0x325F51EB, 0xD59BC0D1, 0xF2BCC18F, 0x41113564,\n\t 0x257B7834, 0x602A9C60, 0xDFF8E8A3, 0x1F636C1B,\n\t 0x0E12B4C2, 0x02E1329E, 0xAF664FD1, 0xCAD18115,\n\t 0x6B2395E0, 0x333E92E1, 0x3B240B62, 0xEEBEB922,\n\t 0x85B2A20E, 0xE6BA0D99, 0xDE720C8C, 0x2DA2F728,\n\t 0xD0127845, 0x95B794FD, 0x647D0862, 0xE7CCF5F0,\n\t 0x5449A36F, 0x877D48FA, 0xC39DFD27, 0xF33E8D1E,\n\t 0x0A476341, 0x992EFF74, 0x3A6F6EAB, 0xF4F8FD37,\n\t 0xA812DC60, 0xA1EBDDF8, 0x991BE14C, 0xDB6E6B0D,\n\t 0xC67B5510, 0x6D672C37, 0x2765D43B, 0xDCD0E804,\n\t 0xF1290DC7, 0xCC00FFA3, 0xB5390F92, 0x690FED0B,\n\t 0x667B9FFB, 0xCEDB7D9C, 0xA091CF0B, 0xD9155EA3,\n\t 0xBB132F88, 0x515BAD24, 0x7B9479BF, 0x763BD6EB,\n\t 0x37392EB3, 0xCC115979, 0x8026E297, 0xF42E312D,\n\t 0x6842ADA7, 0xC66A2B3B, 0x12754CCC, 0x782EF11C,\n\t 0x6A124237, 0xB79251E7, 0x06A1BBE6, 0x4BFB6350,\n\t 0x1A6B1018, 0x11CAEDFA, 0x3D25BDD8, 0xE2E1C3C9,\n\t 0x44421659, 0x0A121386, 0xD90CEC6E, 0xD5ABEA2A,\n\t 0x64AF674E, 0xDA86A85F, 0xBEBFE988, 0x64E4C3FE,\n\t 0x9DBC8057, 0xF0F7C086, 0x60787BF8, 0x6003604D,\n\t 0xD1FD8346, 0xF6381FB0, 0x7745AE04, 0xD736FCCC,\n\t 0x83426B33, 0xF01EAB71, 0xB0804187, 0x3C005E5F,\n\t 0x77A057BE, 0xBDE8AE24, 0x55464299, 0xBF582E61,\n\t 0x4E58F48F, 0xF2DDFDA2, 0xF474EF38, 0x8789BDC2,\n\t 0x5366F9C3, 0xC8B38E74, 0xB475F255, 0x46FCD9B9,\n\t 0x7AEB2661, 0x8B1DDF84, 0x846A0E79, 0x915F95E2,\n\t 0x466E598E, 0x20B45770, 0x8CD55591, 0xC902DE4C,\n\t 0xB90BACE1, 0xBB8205D0, 0x11A86248, 0x7574A99E,\n\t 0xB77F19B6, 0xE0A9DC09, 0x662D09A1, 0xC4324633,\n\t 0xE85A1F02, 0x09F0BE8C, 0x4A99A025, 0x1D6EFE10,\n\t 0x1AB93D1D, 0x0BA5A4DF, 0xA186F20F, 0x2868F169,\n\t 0xDCB7DA83, 0x573906FE, 0xA1E2CE9B, 0x4FCD7F52,\n\t 0x50115E01, 0xA70683FA, 0xA002B5C4, 0x0DE6D027,\n\t 0x9AF88C27, 0x773F8641, 0xC3604C06, 0x61A806B5,\n\t 0xF0177A28, 0xC0F586E0, 0x006058AA, 0x30DC7D62,\n\t 0x11E69ED7, 0x2338EA63, 0x53C2DD94, 0xC2C21634,\n\t 0xBBCBEE56, 0x90BCB6DE, 0xEBFC7DA1, 0xCE591D76,\n\t 0x6F05E409, 0x4B7C0188, 0x39720A3D, 0x7C927C24,\n\t 0x86E3725F, 0x724D9DB9, 0x1AC15BB4, 0xD39EB8FC,\n\t 0xED545578, 0x08FCA5B5, 0xD83D7CD3, 0x4DAD0FC4,\n\t 0x1E50EF5E, 0xB161E6F8, 0xA28514D9, 0x6C51133C,\n\t 0x6FD5C7E7, 0x56E14EC4, 0x362ABFCE, 0xDDC6C837,\n\t 0xD79A3234, 0x92638212, 0x670EFA8E, 0x406000E0 ],\n\t [ 0x3A39CE37, 0xD3FAF5CF, 0xABC27737, 0x5AC52D1B,\n\t 0x5CB0679E, 0x4FA33742, 0xD3822740, 0x99BC9BBE,\n\t 0xD5118E9D, 0xBF0F7315, 0xD62D1C7E, 0xC700C47B,\n\t 0xB78C1B6B, 0x21A19045, 0xB26EB1BE, 0x6A366EB4,\n\t 0x5748AB2F, 0xBC946E79, 0xC6A376D2, 0x6549C2C8,\n\t 0x530FF8EE, 0x468DDE7D, 0xD5730A1D, 0x4CD04DC6,\n\t 0x2939BBDB, 0xA9BA4650, 0xAC9526E8, 0xBE5EE304,\n\t 0xA1FAD5F0, 0x6A2D519A, 0x63EF8CE2, 0x9A86EE22,\n\t 0xC089C2B8, 0x43242EF6, 0xA51E03AA, 0x9CF2D0A4,\n\t 0x83C061BA, 0x9BE96A4D, 0x8FE51550, 0xBA645BD6,\n\t 0x2826A2F9, 0xA73A3AE1, 0x4BA99586, 0xEF5562E9,\n\t 0xC72FEFD3, 0xF752F7DA, 0x3F046F69, 0x77FA0A59,\n\t 0x80E4A915, 0x87B08601, 0x9B09E6AD, 0x3B3EE593,\n\t 0xE990FD5A, 0x9E34D797, 0x2CF0B7D9, 0x022B8B51,\n\t 0x96D5AC3A, 0x017DA67D, 0xD1CF3ED6, 0x7C7D2D28,\n\t 0x1F9F25CF, 0xADF2B89B, 0x5AD6B472, 0x5A88F54C,\n\t 0xE029AC71, 0xE019A5E6, 0x47B0ACFD, 0xED93FA9B,\n\t 0xE8D3C48D, 0x283B57CC, 0xF8D56629, 0x79132E28,\n\t 0x785F0191, 0xED756055, 0xF7960E44, 0xE3D35E8C,\n\t 0x15056DD4, 0x88F46DBA, 0x03A16125, 0x0564F0BD,\n\t 0xC3EB9E15, 0x3C9057A2, 0x97271AEC, 0xA93A072A,\n\t 0x1B3F6D9B, 0x1E6321F5, 0xF59C66FB, 0x26DCF319,\n\t 0x7533D928, 0xB155FDF5, 0x03563482, 0x8ABA3CBB,\n\t 0x28517711, 0xC20AD9F8, 0xABCC5167, 0xCCAD925F,\n\t 0x4DE81751, 0x3830DC8E, 0x379D5862, 0x9320F991,\n\t 0xEA7A90C2, 0xFB3E7BCE, 0x5121CE64, 0x774FBE32,\n\t 0xA8B6E37E, 0xC3293D46, 0x48DE5369, 0x6413E680,\n\t 0xA2AE0810, 0xDD6DB224, 0x69852DFD, 0x09072166,\n\t 0xB39A460A, 0x6445C0DD, 0x586CDECF, 0x1C20C8AE,\n\t 0x5BBEF7DD, 0x1B588D40, 0xCCD2017F, 0x6BB4E3BB,\n\t 0xDDA26A7E, 0x3A59FF45, 0x3E350A44, 0xBCB4CDD5,\n\t 0x72EACEA8, 0xFA6484BB, 0x8D6612AE, 0xBF3C6F47,\n\t 0xD29BE463, 0x542F5D9E, 0xAEC2771B, 0xF64E6370,\n\t 0x740E0D8D, 0xE75B1357, 0xF8721671, 0xAF537D5D,\n\t 0x4040CB08, 0x4EB4E2CC, 0x34D2466A, 0x0115AF84,\n\t 0xE1B00428, 0x95983A1D, 0x06B89FB4, 0xCE6EA048,\n\t 0x6F3F3B82, 0x3520AB82, 0x011A1D4B, 0x277227F8,\n\t 0x611560B1, 0xE7933FDC, 0xBB3A792B, 0x344525BD,\n\t 0xA08839E1, 0x51CE794B, 0x2F32C9B7, 0xA01FBAC9,\n\t 0xE01CC87E, 0xBCC7D1F6, 0xCF0111C3, 0xA1E8AAC7,\n\t 0x1A908749, 0xD44FBD9A, 0xD0DADECB, 0xD50ADA38,\n\t 0x0339C32A, 0xC6913667, 0x8DF9317C, 0xE0B12B4F,\n\t 0xF79E59B7, 0x43F5BB3A, 0xF2D519FF, 0x27D9459C,\n\t 0xBF97222C, 0x15E6FC2A, 0x0F91FC71, 0x9B941525,\n\t 0xFAE59361, 0xCEB69CEB, 0xC2A86459, 0x12BAA8D1,\n\t 0xB6C1075E, 0xE3056A0C, 0x10D25065, 0xCB03A442,\n\t 0xE0EC6E0E, 0x1698DB3B, 0x4C98A0BE, 0x3278E964,\n\t 0x9F1F9532, 0xE0D392DF, 0xD3A0342B, 0x8971F21E,\n\t 0x1B0A7441, 0x4BA3348C, 0xC5BE7120, 0xC37632D8,\n\t 0xDF359F8D, 0x9B992F2E, 0xE60B6F47, 0x0FE3F11D,\n\t 0xE54CDA54, 0x1EDAD891, 0xCE6279CF, 0xCD3E7E6F,\n\t 0x1618B166, 0xFD2C1D05, 0x848FD2C5, 0xF6FB2299,\n\t 0xF523F357, 0xA6327623, 0x93A83531, 0x56CCCD02,\n\t 0xACF08162, 0x5A75EBB5, 0x6E163697, 0x88D273CC,\n\t 0xDE966292, 0x81B949D0, 0x4C50901B, 0x71C65614,\n\t 0xE6C6C7BD, 0x327A140A, 0x45E1D006, 0xC3F27B9A,\n\t 0xC9AA53FD, 0x62A80F00, 0xBB25BFE2, 0x35BDD2F6,\n\t 0x71126905, 0xB2040222, 0xB6CBCF7C, 0xCD769C2B,\n\t 0x53113EC0, 0x1640E3D3, 0x38ABBD60, 0x2547ADF0,\n\t 0xBA38209C, 0xF746CE76, 0x77AFA1C5, 0x20756060,\n\t 0x85CBFE4E, 0x8AE88DD8, 0x7AAAF9B0, 0x4CF9AA7E,\n\t 0x1948C25C, 0x02FB8A8C, 0x01C36AE4, 0xD6EBE1F9,\n\t 0x90D4F869, 0xA65CDEA0, 0x3F09252D, 0xC208E69F,\n\t 0xB74E6132, 0xCE77E25B, 0x578FDFE3, 0x3AC372E6 ]\n\t ];\n\n\t var BLOWFISH_CTX = {\n\t pbox: [],\n\t sbox: []\n\t }\n\n\t function F(ctx, x){\n\t let a = (x >> 24) & 0xFF;\n\t let b = (x >> 16) & 0xFF;\n\t let c = (x >> 8) & 0xFF;\n\t let d = x & 0xFF;\n\n\t let y = ctx.sbox[0][a] + ctx.sbox[1][b];\n\t y = y ^ ctx.sbox[2][c];\n\t y = y + ctx.sbox[3][d];\n\n\t return y;\n\t }\n\n\t function BlowFish_Encrypt(ctx, left, right){\n\t let Xl = left;\n\t let Xr = right;\n\t let temp;\n\n\t for(let i = 0; i < N; ++i){\n\t Xl = Xl ^ ctx.pbox[i];\n\t Xr = F(ctx, Xl) ^ Xr;\n\n\t temp = Xl;\n\t Xl = Xr;\n\t Xr = temp;\n\t }\n\n\t temp = Xl;\n\t Xl = Xr;\n\t Xr = temp;\n\n\t Xr = Xr ^ ctx.pbox[N];\n\t Xl = Xl ^ ctx.pbox[N + 1];\n\n\t return {left: Xl, right: Xr};\n\t }\n\n\t function BlowFish_Decrypt(ctx, left, right){\n\t let Xl = left;\n\t let Xr = right;\n\t let temp;\n\n\t for(let i = N + 1; i > 1; --i){\n\t Xl = Xl ^ ctx.pbox[i];\n\t Xr = F(ctx, Xl) ^ Xr;\n\n\t temp = Xl;\n\t Xl = Xr;\n\t Xr = temp;\n\t }\n\n\t temp = Xl;\n\t Xl = Xr;\n\t Xr = temp;\n\n\t Xr = Xr ^ ctx.pbox[1];\n\t Xl = Xl ^ ctx.pbox[0];\n\n\t return {left: Xl, right: Xr};\n\t }\n\n\t /**\n\t * Initialization ctx's pbox and sbox.\n\t *\n\t * @param {Object} ctx The object has pbox and sbox.\n\t * @param {Array} key An array of 32-bit words.\n\t * @param {int} keysize The length of the key.\n\t *\n\t * @example\n\t *\n\t * BlowFishInit(BLOWFISH_CTX, key, 128/32);\n\t */\n\t function BlowFishInit(ctx, key, keysize)\n\t {\n\t for(let Row = 0; Row < 4; Row++)\n\t {\n\t ctx.sbox[Row] = [];\n\t for(let Col = 0; Col < 256; Col++)\n\t {\n\t ctx.sbox[Row][Col] = ORIG_S[Row][Col];\n\t }\n\t }\n\n\t let keyIndex = 0;\n\t for(let index = 0; index < N + 2; index++)\n\t {\n\t ctx.pbox[index] = ORIG_P[index] ^ key[keyIndex];\n\t keyIndex++;\n\t if(keyIndex >= keysize)\n\t {\n\t keyIndex = 0;\n\t }\n\t }\n\n\t let Data1 = 0;\n\t let Data2 = 0;\n\t let res = 0;\n\t for(let i = 0; i < N + 2; i += 2)\n\t {\n\t res = BlowFish_Encrypt(ctx, Data1, Data2);\n\t Data1 = res.left;\n\t Data2 = res.right;\n\t ctx.pbox[i] = Data1;\n\t ctx.pbox[i + 1] = Data2;\n\t }\n\n\t for(let i = 0; i < 4; i++)\n\t {\n\t for(let j = 0; j < 256; j += 2)\n\t {\n\t res = BlowFish_Encrypt(ctx, Data1, Data2);\n\t Data1 = res.left;\n\t Data2 = res.right;\n\t ctx.sbox[i][j] = Data1;\n\t ctx.sbox[i][j + 1] = Data2;\n\t }\n\t }\n\n\t return true;\n\t }\n\n\t /**\n\t * Blowfish block cipher algorithm.\n\t */\n\t var Blowfish = C_algo.Blowfish = BlockCipher.extend({\n\t _doReset: function () {\n\t // Skip reset of nRounds has been set before and key did not change\n\t if (this._keyPriorReset === this._key) {\n\t return;\n\t }\n\n\t // Shortcuts\n\t var key = this._keyPriorReset = this._key;\n\t var keyWords = key.words;\n\t var keySize = key.sigBytes / 4;\n\n\t //Initialization pbox and sbox\n\t BlowFishInit(BLOWFISH_CTX, keyWords, keySize);\n\t },\n\n\t encryptBlock: function (M, offset) {\n\t var res = BlowFish_Encrypt(BLOWFISH_CTX, M[offset], M[offset + 1]);\n\t M[offset] = res.left;\n\t M[offset + 1] = res.right;\n\t },\n\n\t decryptBlock: function (M, offset) {\n\t var res = BlowFish_Decrypt(BLOWFISH_CTX, M[offset], M[offset + 1]);\n\t M[offset] = res.left;\n\t M[offset + 1] = res.right;\n\t },\n\n\t blockSize: 64/32,\n\n\t keySize: 128/32,\n\n\t ivSize: 64/32\n\t });\n\n\t /**\n\t * Shortcut functions to the cipher's object interface.\n\t *\n\t * @example\n\t *\n\t * var ciphertext = CryptoJS.Blowfish.encrypt(message, key, cfg);\n\t * var plaintext = CryptoJS.Blowfish.decrypt(ciphertext, key, cfg);\n\t */\n\t C.Blowfish = BlockCipher._createHelper(Blowfish);\n\t}());\n\n\n\treturn CryptoJS.Blowfish;\n\n}));", ";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./x64-core\"), require(\"./lib-typedarrays\"), require(\"./enc-utf16\"), require(\"./enc-base64\"), require(\"./enc-base64url\"), require(\"./md5\"), require(\"./sha1\"), require(\"./sha256\"), require(\"./sha224\"), require(\"./sha512\"), require(\"./sha384\"), require(\"./sha3\"), require(\"./ripemd160\"), require(\"./hmac\"), require(\"./pbkdf2\"), require(\"./evpkdf\"), require(\"./cipher-core\"), require(\"./mode-cfb\"), require(\"./mode-ctr\"), require(\"./mode-ctr-gladman\"), require(\"./mode-ofb\"), require(\"./mode-ecb\"), require(\"./pad-ansix923\"), require(\"./pad-iso10126\"), require(\"./pad-iso97971\"), require(\"./pad-zeropadding\"), require(\"./pad-nopadding\"), require(\"./format-hex\"), require(\"./aes\"), require(\"./tripledes\"), require(\"./rc4\"), require(\"./rabbit\"), require(\"./rabbit-legacy\"), require(\"./blowfish\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./x64-core\", \"./lib-typedarrays\", \"./enc-utf16\", \"./enc-base64\", \"./enc-base64url\", \"./md5\", \"./sha1\", \"./sha256\", \"./sha224\", \"./sha512\", \"./sha384\", \"./sha3\", \"./ripemd160\", \"./hmac\", \"./pbkdf2\", \"./evpkdf\", \"./cipher-core\", \"./mode-cfb\", \"./mode-ctr\", \"./mode-ctr-gladman\", \"./mode-ofb\", \"./mode-ecb\", \"./pad-ansix923\", \"./pad-iso10126\", \"./pad-iso97971\", \"./pad-zeropadding\", \"./pad-nopadding\", \"./format-hex\", \"./aes\", \"./tripledes\", \"./rc4\", \"./rabbit\", \"./rabbit-legacy\", \"./blowfish\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\troot.CryptoJS = factory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\treturn CryptoJS;\n\n}));"], + "mappings": ";;;;;;AAAA;AAAA;AAAA,WAAO,UAAU,OAAO,OAAO,IAAI,MAAM,CAAC,GAAG;AAAA,MAC3C,IAAI,GAAG,KAAK;AACV,YACE,QAAQ,gBACR,QAAQ,eACR,QAAQ,iBACR,QAAQ,UACR;AACA,kBAAQ,KAAK,0FAA0F,GAAG,qIAAqI;AAAA,QACjP;AAAA,MACF;AAAA,IACF,CAAC,CAAC;AAAA;AAAA;;;ACXF;AAAA;AAAC,KAAC,SAAU,MAAM,SAAS;AAC1B,UAAI,OAAO,YAAY,UAAU;AAEhC,eAAO,UAAU,UAAU,QAAQ;AAAA,MACpC,WACS,OAAO,WAAW,cAAc,OAAO,KAAK;AAEpD,eAAO,CAAC,GAAG,OAAO;AAAA,MACnB,OACK;AAEJ,aAAK,WAAW,QAAQ;AAAA,MACzB;AAAA,IACD,GAAE,SAAM,WAAY;AAOnB,UAAI,WAAW,YAAa,SAAUA,OAAMC,YAAW;AAEnD,YAAI;AAGJ,YAAI,OAAO,WAAW,eAAe,OAAO,QAAQ;AAChD,mBAAS,OAAO;AAAA,QACpB;AAGA,YAAI,OAAO,SAAS,eAAe,KAAK,QAAQ;AAC5C,mBAAS,KAAK;AAAA,QAClB;AAGA,YAAI,OAAO,eAAe,eAAe,WAAW,QAAQ;AACxD,mBAAS,WAAW;AAAA,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Y,UAAU;AAEhC,eAAO,UAAU,UAAU,QAAQ,gBAAmB,oBAAuB,2BAA8B,qBAAwB,sBAAyB,yBAA4B,eAAkB,gBAAmB,kBAAqB,kBAAqB,kBAAqB,kBAAqB,gBAAmB,qBAAwB,gBAAmB,kBAAqB,kBAAqB,uBAA0B,oBAAuB,oBAAuB,4BAA+B,oBAAuB,oBAAuB,wBAA2B,wBAA2B,wBAA2B,2BAA8B,yBAA4B,sBAAyB,eAAkB,qBAAwB,eAAkB,kBAAqB,yBAA4B,kBAAqB;AAAA,MACr1B,WACS,OAAO,WAAW,cAAc,OAAO,KAAK;AAEpD,eAAO,CAAC,UAAU,cAAc,qBAAqB,eAAe,gBAAgB,mBAAmB,SAAS,UAAU,YAAY,YAAY,YAAY,YAAY,UAAU,eAAe,UAAU,YAAY,YAAY,iBAAiB,cAAc,cAAc,sBAAsB,cAAc,cAAc,kBAAkB,kBAAkB,kBAAkB,qBAAqB,mBAAmB,gBAAgB,SAAS,eAAe,SAAS,YAAY,mBAAmB,YAAY,GAAG,OAAO;AAAA,MACzgB,OACK;AAEJ,aAAK,WAAW,QAAQ,KAAK,QAAQ;AAAA,MACtC;AAAA,IACD,GAAE,SAAM,SAAU,UAAU;AAE3B,aAAO;AAAA,IAER,CAAC;AAAA;AAAA;", + "names": ["Math", "undefined", "undefined", "Math", "Math", "n", "H", "Math", "Math", "undefined", "CBC", "undefined", "SUB_MIX_0", "SUB_MIX_1", "SUB_MIX_2", "SUB_MIX_3", "SBOX", "C", "C"] +} diff --git a/jiuyi2/unpackage/dist/cache/.vite/deps/tim-upload-plugin.js b/jiuyi2/unpackage/dist/cache/.vite/deps/tim-upload-plugin.js new file mode 100644 index 00000000..4c6b1caa --- /dev/null +++ b/jiuyi2/unpackage/dist/cache/.vite/deps/tim-upload-plugin.js @@ -0,0 +1,242 @@ +import { + __commonJS +} from "./chunk-TDUMLE5V.js"; + +// ../../../../document/九亿商城/jy/jiuyi2/node_modules/tim-upload-plugin/index.js +var require_tim_upload_plugin = __commonJS({ + "../../../../document/九亿商城/jy/jiuyi2/node_modules/tim-upload-plugin/index.js"(exports, module) { + !function(e, t) { + "object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = e || self).TIMUploadPlugin = t(); + }(exports, function() { + function e(e2, t2) { + var o2 = Object.keys(e2); + if (Object.getOwnPropertySymbols) { + var n2 = Object.getOwnPropertySymbols(e2); + t2 && (n2 = n2.filter(function(t3) { + return Object.getOwnPropertyDescriptor(e2, t3).enumerable; + })), o2.push.apply(o2, n2); + } + return o2; + } + function t(t2) { + for (var o2 = 1; o2 < arguments.length; o2++) { + var n2 = null != arguments[o2] ? arguments[o2] : {}; + o2 % 2 ? e(Object(n2), true).forEach(function(e2) { + s(t2, e2, n2[e2]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t2, Object.getOwnPropertyDescriptors(n2)) : e(Object(n2)).forEach(function(e2) { + Object.defineProperty(t2, e2, Object.getOwnPropertyDescriptor(n2, e2)); + }); + } + return t2; + } + function o(e2) { + return (o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e3) { + return typeof e3; + } : function(e3) { + return e3 && "function" == typeof Symbol && e3.constructor === Symbol && e3 !== Symbol.prototype ? "symbol" : typeof e3; + })(e2); + } + function n(e2, t2) { + if (!(e2 instanceof t2)) + throw new TypeError("Cannot call a class as a function"); + } + function r(e2, t2) { + for (var o2 = 0; o2 < t2.length; o2++) { + var n2 = t2[o2]; + n2.enumerable = n2.enumerable || false, n2.configurable = true, "value" in n2 && (n2.writable = true), Object.defineProperty(e2, n2.key, n2); + } + } + function a(e2, t2, o2) { + return t2 && r(e2.prototype, t2), o2 && r(e2, o2), Object.defineProperty(e2, "prototype", { writable: false }), e2; + } + function s(e2, t2, o2) { + return t2 in e2 ? Object.defineProperty(e2, t2, { value: o2, enumerable: true, configurable: true, writable: true }) : e2[t2] = o2, e2; + } + function i(e2, t2) { + if (null == e2) + return {}; + var o2, n2, r2 = function(e3, t3) { + if (null == e3) + return {}; + var o3, n3, r3 = {}, a3 = Object.keys(e3); + for (n3 = 0; n3 < a3.length; n3++) + o3 = a3[n3], t3.indexOf(o3) >= 0 || (r3[o3] = e3[o3]); + return r3; + }(e2, t2); + if (Object.getOwnPropertySymbols) { + var a2 = Object.getOwnPropertySymbols(e2); + for (n2 = 0; n2 < a2.length; n2++) + o2 = a2[n2], t2.indexOf(o2) >= 0 || Object.prototype.propertyIsEnumerable.call(e2, o2) && (r2[o2] = e2[o2]); + } + return r2; + } + var u = "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}, l = "undefined" != typeof wx && "function" == typeof wx.getSystemInfoSync && Boolean(wx.getSystemInfoSync().fontSizeSetting), f = "undefined" != typeof qq && "function" == typeof qq.getSystemInfoSync && Boolean(qq.getSystemInfoSync().fontSizeSetting), c = "undefined" != typeof tt && "function" == typeof tt.getSystemInfoSync && Boolean(tt.getSystemInfoSync().fontSizeSetting), d = "undefined" != typeof swan && "function" == typeof swan.getSystemInfoSync && Boolean(swan.getSystemInfoSync().fontSizeSetting), p = "undefined" != typeof my && "function" == typeof my.getSystemInfoSync && Boolean(my.getSystemInfoSync().fontSizeSetting), y = "undefined" != typeof uni && "undefined" == typeof window && "function" == typeof uni.requireNativePlugin, h = y && "ios" === uni.getDeviceInfo().platform.toLocaleLowerCase(), g = (y && uni.getDeviceInfo().platform.toLocaleLowerCase(), l || f || c || d || p || y), m = void 0 !== u && (void 0 !== u.nativeModuleProxy || void 0 !== u.ReactNative), v = f ? qq : c ? tt : d ? swan : p ? my : l ? wx : y ? uni : {}, b = function(e2) { + if ("object" !== o(e2) || null === e2) + return false; + var t2 = Object.getPrototypeOf(e2); + if (null === t2) + return true; + for (var n2 = t2; null !== Object.getPrototypeOf(n2); ) + n2 = Object.getPrototypeOf(n2); + return t2 === n2; + }; + function w(e2) { + if (null == e2) + return true; + if ("boolean" == typeof e2) + return false; + if ("number" == typeof e2) + return 0 === e2; + if ("string" == typeof e2) + return 0 === e2.length; + if ("function" == typeof e2) + return 0 === e2.length; + if (Array.isArray(e2)) + return 0 === e2.length; + if (e2 instanceof Error) + return "" === e2.message; + if (b(e2)) { + for (var t2 in e2) + if (Object.prototype.hasOwnProperty.call(e2, t2)) + return false; + return true; + } + return false; + } + var O = function() { + function e2() { + n(this, e2), this._n = "WebRequest"; + } + return a(e2, [{ key: "request", value: function(e3, o2) { + var n2 = this, r2 = "".concat(this._n, ".request"), a2 = e3.downloadUrl || "", s2 = (e3.method || "PUT").toUpperCase(), i2 = e3.url; + if (console.log("%c tim-upload-plugin %c", "background:#0abf5b; padding:1px; border-radius:3px; color: #fff", "background:transparent", "".concat(r2, " URL:").concat(i2)), e3.qs) { + var u2 = function(e4) { + var t2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "&", o3 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "="; + return w(e4) ? "" : b(e4) ? Object.keys(e4).map(function(n3) { + var r3 = encodeURIComponent(n3) + o3; + return Array.isArray(e4[n3]) ? e4[n3].map(function(e5) { + return r3 + encodeURIComponent(e5); + }).join(t2) : r3 + encodeURIComponent(e4[n3]); + }).filter(Boolean).join(t2) : void 0; + }(e3.qs); + u2 && (i2 += "".concat(-1 === i2.indexOf("?") ? "?" : "&").concat(u2)); + } + var l2 = new XMLHttpRequest(); + l2.open(s2, i2, true), l2.responseType = e3.dataType || "text"; + var f2 = e3.headers || {}; + if (e3.uploadByIP && (f2 = t(t({}, f2), {}, { host: e3.uploadIP })), !w(f2)) + for (var c2 in f2) + f2.hasOwnProperty(c2) && "content-length" !== c2.toLowerCase() && "user-agent" !== c2.toLowerCase() && "origin" !== c2.toLowerCase() && "host" !== c2.toLowerCase() && l2.setRequestHeader(c2, f2[c2]); + return l2.onload = function() { + if (200 === l2.status) + o2(null, n2._xhrRes(l2, n2._xhrBody(l2, a2, e3.uploadByIP && e3.uploadIP), f2)); + else { + if (e3.uploadIP && -1 === e3.url.indexOf(e3.uploadIP)) + return e3.url = function(e4, t3) { + return e4.replace(/^http(s)?:\/\/(.*?)\//, "https://".concat(t3, "/")); + }(e3.url, e3.uploadIP), e3.uploadByIP = true, n2.request(e3, o2); + var t2 = { code: l2.status, message: JSON.stringify(l2.responseText) }; + o2(t2, n2._xhrRes(l2, n2._xhrBody(l2, a2, e3.uploadByIP && e3.uploadIP), f2)); + } + }, l2.onerror = function(t2) { + var r3 = n2._xhrBody(l2, a2, e3.uploadByIP && e3.uploadIP), s3 = { code: l2.status, message: JSON.stringify(l2.responseText) }; + r3 || l2.statusText || 0 !== l2.status || (t2.message = "CORS blocked or network error"), o2(s3, n2._xhrRes(l2, r3)), s3 = null; + }, e3.onProgress && l2.upload && (l2.upload.onprogress = function(t2) { + var o3 = t2.total, n3 = t2.loaded, r3 = Math.floor(100 * n3 / o3); + e3.onProgress({ total: o3, loaded: n3, percent: (r3 >= 100 ? 100 : r3) / 100 }); + }), l2.send(e3.resources), l2; + } }, { key: "_xhrRes", value: function(e3, t2) { + var o2 = {}; + return e3.getAllResponseHeaders().trim().split("\n").forEach(function(e4) { + if (e4) { + var t3 = e4.indexOf(":"), n2 = e4.substr(0, t3).trim().toLowerCase(), r2 = e4.substr(t3 + 1).trim(); + o2[n2] = r2; + } + }), { statusCode: e3.status, statusMessage: e3.statusText, headers: o2, data: t2 }; + } }, { key: "_xhrBody", value: function(e3, t2, o2) { + return 200 === e3.status && t2 ? { location: t2, uploadIP: o2 } : { response: e3.responseText, uploadIP: o2 }; + } }]), e2; + }(), S = ["unknown", "image", "video", "audio", "log"], P = ["name"], I = function() { + function e2() { + n(this, e2); + } + return a(e2, [{ key: "request", value: function(e3, o2) { + var n2 = this, r2 = e3.resources, a2 = void 0 === r2 ? "" : r2, s2 = e3.headers, u2 = void 0 === s2 ? {} : s2, l2 = e3.url, f2 = e3.downloadUrl, c2 = void 0 === f2 ? "" : f2, d2 = l2, y2 = null, g2 = c2.match(/^(https?:\/\/[^/]+\/)([^/]*\/?)(.*)$/), m2 = decodeURIComponent(g2[3]), b2 = m2.indexOf("?") > -1 ? m2.split("?")[0] : m2, w2 = { key: e3.fileKey ? e3.fileKey : b2, success_action_status: 200, "Content-Type": "" }, O2 = {}; + if (h) { + var I2 = l2.split("?sign="); + if (I2.length > 1) { + var C2 = I2[1]; + d2 = "".concat(I2[0], "?sign=").concat(encodeURIComponent("".concat(C2))), O2.sign = decodeURIComponent(C2), O2.signature = decodeURIComponent(C2); + } + } + var k = { url: d2, header: u2, name: "file", filePath: a2, formData: t(t({}, w2), O2), timeout: e3.timeout || 3e5 }; + if (p) { + var x = k; + x.name; + k = t(t({}, i(x, P)), {}, { fileName: "file", fileType: S[e3.fileType] }); + } + return (y2 = v.uploadFile(t(t({}, k), {}, { success: function(e4) { + n2._handleResponse({ response: e4, downloadUrl: c2, callback: o2 }); + }, fail: function(e4) { + n2._handleResponse({ response: e4, downloadUrl: c2, callback: o2 }); + } }))).onProgressUpdate && y2.onProgressUpdate(function(t2) { + e3.onProgress && e3.onProgress({ total: t2.totalBytesExpectedToSend, loaded: t2.totalBytesSent, percent: Math.floor(t2.progress) / 100 }); + }), y2; + } }, { key: "_handleResponse", value: function(e3) { + var o2 = e3.downloadUrl, n2 = e3.response, r2 = e3.callback, a2 = n2.header, s2 = {}; + if (a2) + for (var i2 in a2) + a2.hasOwnProperty(i2) && (s2[i2.toLowerCase()] = a2[i2]); + var u2 = +n2.statusCode; + 200 === u2 ? r2(null, { statusCode: u2, headers: s2, data: t(t({}, n2.data), {}, { location: o2 }) }) : r2({ code: u2, message: JSON.stringify(n2.data) }, { statusCode: u2, headers: s2, data: void 0 }); + } }]), e2; + }(), C = function() { + function e2() { + n(this, e2); + } + return a(e2, [{ key: "request", value: function(e3, t2) { + var o2 = this, n2 = e3.resources, r2 = void 0 === n2 ? "" : n2, a2 = e3.fileKey, s2 = void 0 === a2 ? "" : a2, i2 = e3.url, u2 = e3.downloadUrl, l2 = void 0 === u2 ? "" : u2, f2 = new FormData(); + f2.append("key", s2), f2.append("success_action_status", 200), f2.append("file", { uri: r2, type: "application/octet-stream", name: "uploaded_file" }), fetch(i2, { method: "POST", headers: { "Content-Type": "multipart/form-data" }, body: f2 }).then(function(e4) { + o2._handleResponse({ response: e4, downloadUrl: l2, callback: t2 }); + }).catch(function(e4) { + o2._handleResponse({ response: e4, downloadUrl: l2, callback: t2 }); + }); + } }, { key: "_handleResponse", value: function(e3) { + var t2 = e3.downloadUrl, o2 = e3.response, n2 = e3.callback, r2 = o2.headers, a2 = o2.status, s2 = r2 && r2.map || {}; + 200 === a2 ? n2(null, { statusCode: 200, headers: s2, data: { location: t2 } }) : n2({ code: a2, message: JSON.stringify(o2) }, { statusCode: a2, headers: s2, data: void 0 }); + } }]), e2; + }(); + return function() { + function e2() { + n(this, e2), this.retry = 1, this.tryCount = 0, this.systemClockOffset = 0, this.httpRequest = g ? new I() : m ? new C() : new O(), console.log("TIMUploadPlugin.VERSION: ".concat("1.4.1")); + } + return a(e2, [{ key: "uploadFile", value: function(e3, t2) { + var o2 = this; + return this.httpRequest.request(e3, function(n2, r2) { + n2 && o2.tryCount < o2.retry && o2.allowRetry(n2) ? (o2.tryCount++, o2.uploadFile(e3, t2)) : (o2.tryCount = 0, t2(n2, r2)); + }); + } }, { key: "allowRetry", value: function(e3) { + var t2 = false, o2 = false; + if (e3) { + var n2 = e3.headers && (e3.headers.date || e3.headers.Date) || e3.error && e3.error.ServerTime; + try { + var r2 = e3.error && e3.error.Code, a2 = e3.error && e3.error.Message; + ("RequestTimeTooSkewed" === r2 || "AccessDenied" === r2 && "Request has expired" === a2) && (o2 = true); + } catch (u2) { + } + if (o2 && n2) { + var s2 = Date.now(), i2 = Date.parse(n2); + Math.abs(s2 + this.systemClockOffset - i2) >= 3e4 && (this.systemClockOffset = i2 - s2, t2 = true); + } else + 5 === Math.floor(e3.statusCode / 100) && (t2 = true); + } + return t2; + } }], [{ key: "getVersion", value: function() { + return "1.4.1"; + } }]), e2; + }(); + }); + } +}); +export default require_tim_upload_plugin(); +//# sourceMappingURL=tim-upload-plugin.js.map diff --git a/jiuyi2/unpackage/dist/cache/.vite/deps/tim-upload-plugin.js.map b/jiuyi2/unpackage/dist/cache/.vite/deps/tim-upload-plugin.js.map new file mode 100644 index 00000000..e9443485 --- /dev/null +++ b/jiuyi2/unpackage/dist/cache/.vite/deps/tim-upload-plugin.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../../../../node_modules/tim-upload-plugin/index.js"], + "sourcesContent": ["!function(e,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define(t):(e=e||self).TIMUploadPlugin=t()}(this,(function(){function e(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function t(t){for(var o=1;o=0||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}var u=\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:{},l=\"undefined\"!=typeof wx&&\"function\"==typeof wx.getSystemInfoSync&&Boolean(wx.getSystemInfoSync().fontSizeSetting),f=\"undefined\"!=typeof qq&&\"function\"==typeof qq.getSystemInfoSync&&Boolean(qq.getSystemInfoSync().fontSizeSetting),c=\"undefined\"!=typeof tt&&\"function\"==typeof tt.getSystemInfoSync&&Boolean(tt.getSystemInfoSync().fontSizeSetting),d=\"undefined\"!=typeof swan&&\"function\"==typeof swan.getSystemInfoSync&&Boolean(swan.getSystemInfoSync().fontSizeSetting),p=\"undefined\"!=typeof my&&\"function\"==typeof my.getSystemInfoSync&&Boolean(my.getSystemInfoSync().fontSizeSetting),y=\"undefined\"!=typeof uni&&\"undefined\"==typeof window&&\"function\"==typeof uni.requireNativePlugin,h=y&&\"ios\"===uni.getDeviceInfo().platform.toLocaleLowerCase(),g=(y&&uni.getDeviceInfo().platform.toLocaleLowerCase(),l||f||c||d||p||y),m=void 0!==u&&(void 0!==u.nativeModuleProxy||void 0!==u.ReactNative),v=f?qq:c?tt:d?swan:p?my:l?wx:y?uni:{},b=function(e){if(\"object\"!==o(e)||null===e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var n=t;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return t===n};function w(e){if(null==e)return!0;if(\"boolean\"==typeof e)return!1;if(\"number\"==typeof e)return 0===e;if(\"string\"==typeof e)return 0===e.length;if(\"function\"==typeof e)return 0===e.length;if(Array.isArray(e))return 0===e.length;if(e instanceof Error)return\"\"===e.message;if(b(e)){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}return!1}var O=function(){function e(){n(this,e),this._n=\"WebRequest\"}return a(e,[{key:\"request\",value:function(e,o){var n=this,r=\"\".concat(this._n,\".request\"),a=e.downloadUrl||\"\",s=(e.method||\"PUT\").toUpperCase(),i=e.url;if(console.log(\"%c tim-upload-plugin %c\",\"background:#0abf5b; padding:1px; border-radius:3px; color: #fff\",\"background:transparent\",\"\".concat(r,\" URL:\").concat(i)),e.qs){var u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"&\",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:\"=\";return w(e)?\"\":b(e)?Object.keys(e).map((function(n){var r=encodeURIComponent(n)+o;return Array.isArray(e[n])?e[n].map((function(e){return r+encodeURIComponent(e)})).join(t):r+encodeURIComponent(e[n])})).filter(Boolean).join(t):void 0}(e.qs);u&&(i+=\"\".concat(-1===i.indexOf(\"?\")?\"?\":\"&\").concat(u))}var l=new XMLHttpRequest;l.open(s,i,!0),l.responseType=e.dataType||\"text\";var f=e.headers||{};if(e.uploadByIP&&(f=t(t({},f),{},{host:e.uploadIP})),!w(f))for(var c in f)f.hasOwnProperty(c)&&\"content-length\"!==c.toLowerCase()&&\"user-agent\"!==c.toLowerCase()&&\"origin\"!==c.toLowerCase()&&\"host\"!==c.toLowerCase()&&l.setRequestHeader(c,f[c]);return l.onload=function(){if(200===l.status)o(null,n._xhrRes(l,n._xhrBody(l,a,e.uploadByIP&&e.uploadIP),f));else{if(e.uploadIP&&-1===e.url.indexOf(e.uploadIP))return e.url=function(e,t){return e.replace(/^http(s)?:\\/\\/(.*?)\\//,\"https://\".concat(t,\"/\"))}(e.url,e.uploadIP),e.uploadByIP=!0,n.request(e,o);var t={code:l.status,message:JSON.stringify(l.responseText)};o(t,n._xhrRes(l,n._xhrBody(l,a,e.uploadByIP&&e.uploadIP),f))}},l.onerror=function(t){var r=n._xhrBody(l,a,e.uploadByIP&&e.uploadIP),s={code:l.status,message:JSON.stringify(l.responseText)};r||l.statusText||0!==l.status||(t.message=\"CORS blocked or network error\"),o(s,n._xhrRes(l,r)),s=null},e.onProgress&&l.upload&&(l.upload.onprogress=function(t){var o=t.total,n=t.loaded,r=Math.floor(100*n/o);e.onProgress({total:o,loaded:n,percent:(r>=100?100:r)/100})}),l.send(e.resources),l}},{key:\"_xhrRes\",value:function(e,t){var o={};return e.getAllResponseHeaders().trim().split(\"\\n\").forEach((function(e){if(e){var t=e.indexOf(\":\"),n=e.substr(0,t).trim().toLowerCase(),r=e.substr(t+1).trim();o[n]=r}})),{statusCode:e.status,statusMessage:e.statusText,headers:o,data:t}}},{key:\"_xhrBody\",value:function(e,t,o){return 200===e.status&&t?{location:t,uploadIP:o}:{response:e.responseText,uploadIP:o}}}]),e}(),S=[\"unknown\",\"image\",\"video\",\"audio\",\"log\"],P=[\"name\"],I=function(){function e(){n(this,e)}return a(e,[{key:\"request\",value:function(e,o){var n=this,r=e.resources,a=void 0===r?\"\":r,s=e.headers,u=void 0===s?{}:s,l=e.url,f=e.downloadUrl,c=void 0===f?\"\":f,d=l,y=null,g=c.match(/^(https?:\\/\\/[^/]+\\/)([^/]*\\/?)(.*)$/),m=decodeURIComponent(g[3]),b=m.indexOf(\"?\")>-1?m.split(\"?\")[0]:m,w={key:e.fileKey?e.fileKey:b,success_action_status:200,\"Content-Type\":\"\"},O={};if(h){var I=l.split(\"?sign=\");if(I.length>1){var C=I[1];d=\"\".concat(I[0],\"?sign=\").concat(encodeURIComponent(\"\".concat(C))),O.sign=decodeURIComponent(C),O.signature=decodeURIComponent(C)}}var k={url:d,header:u,name:\"file\",filePath:a,formData:t(t({},w),O),timeout:e.timeout||3e5};if(p){var x=k;x.name;k=t(t({},i(x,P)),{},{fileName:\"file\",fileType:S[e.fileType]})}return(y=v.uploadFile(t(t({},k),{},{success:function(e){n._handleResponse({response:e,downloadUrl:c,callback:o})},fail:function(e){n._handleResponse({response:e,downloadUrl:c,callback:o})}}))).onProgressUpdate&&y.onProgressUpdate((function(t){e.onProgress&&e.onProgress({total:t.totalBytesExpectedToSend,loaded:t.totalBytesSent,percent:Math.floor(t.progress)/100})})),y}},{key:\"_handleResponse\",value:function(e){var o=e.downloadUrl,n=e.response,r=e.callback,a=n.header,s={};if(a)for(var i in a)a.hasOwnProperty(i)&&(s[i.toLowerCase()]=a[i]);var u=+n.statusCode;200===u?r(null,{statusCode:u,headers:s,data:t(t({},n.data),{},{location:o})}):r({code:u,message:JSON.stringify(n.data)},{statusCode:u,headers:s,data:void 0})}}]),e}(),C=function(){function e(){n(this,e)}return a(e,[{key:\"request\",value:function(e,t){var o=this,n=e.resources,r=void 0===n?\"\":n,a=e.fileKey,s=void 0===a?\"\":a,i=e.url,u=e.downloadUrl,l=void 0===u?\"\":u,f=new FormData;f.append(\"key\",s),f.append(\"success_action_status\",200),f.append(\"file\",{uri:r,type:\"application/octet-stream\",name:\"uploaded_file\"}),fetch(i,{method:\"POST\",headers:{\"Content-Type\":\"multipart/form-data\"},body:f}).then((function(e){o._handleResponse({response:e,downloadUrl:l,callback:t})})).catch((function(e){o._handleResponse({response:e,downloadUrl:l,callback:t})}))}},{key:\"_handleResponse\",value:function(e){var t=e.downloadUrl,o=e.response,n=e.callback,r=o.headers,a=o.status,s=r&&r.map||{};200===a?n(null,{statusCode:200,headers:s,data:{location:t}}):n({code:a,message:JSON.stringify(o)},{statusCode:a,headers:s,data:void 0})}}]),e}();return function(){function e(){n(this,e),this.retry=1,this.tryCount=0,this.systemClockOffset=0,this.httpRequest=g?new I:m?new C:new O,console.log(\"TIMUploadPlugin.VERSION: \".concat(\"1.4.1\"))}return a(e,[{key:\"uploadFile\",value:function(e,t){var o=this;return this.httpRequest.request(e,(function(n,r){n&&o.tryCount=3e4&&(this.systemClockOffset=i-s,t=!0)}else 5===Math.floor(e.statusCode/100)&&(t=!0)}return t}}],[{key:\"getVersion\",value:function(){return\"1.4.1\"}}]),e}()}));\n"], + "mappings": ";;;;;AAAA;AAAA;AAAA,KAAC,SAAS,GAAE,GAAE;AAAC,kBAAU,OAAO,WAAS,eAAa,OAAO,SAAO,OAAO,UAAQ,EAAE,IAAE,cAAY,OAAO,UAAQ,OAAO,MAAI,OAAO,CAAC,KAAG,IAAE,KAAG,MAAM,kBAAgB,EAAE;AAAA,IAAC,EAAE,SAAM,WAAU;AAAC,eAAS,EAAEA,IAAEC,IAAE;AAAC,YAAIC,KAAE,OAAO,KAAKF,EAAC;AAAE,YAAG,OAAO,uBAAsB;AAAC,cAAIG,KAAE,OAAO,sBAAsBH,EAAC;AAAE,UAAAC,OAAIE,KAAEA,GAAE,OAAQ,SAASF,IAAE;AAAC,mBAAO,OAAO,yBAAyBD,IAAEC,EAAC,EAAE;AAAA,UAAU,CAAE,IAAGC,GAAE,KAAK,MAAMA,IAAEC,EAAC;AAAA,QAAC;AAAC,eAAOD;AAAA,MAAC;AAAC,eAAS,EAAED,IAAE;AAAC,iBAAQC,KAAE,GAAEA,KAAE,UAAU,QAAOA,MAAI;AAAC,cAAIC,KAAE,QAAM,UAAUD,EAAC,IAAE,UAAUA,EAAC,IAAE,CAAC;AAAE,UAAAA,KAAE,IAAE,EAAE,OAAOC,EAAC,GAAE,IAAE,EAAE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